亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? specialiofunction.cpp

?? 文件過濾系統
?? CPP
?? 第 1 頁 / 共 4 頁
字號:

#include "FsTPM.h"

// Used to set Object's flag
#ifndef SetFlag
#define SetFlag(x,f)    ((x) |= (f))
#endif

// Used to clear Object's flag
#ifndef ClearFlag
#define ClearFlag(x,f)  ((x) &= ~(f))
#endif

BOOL IsSomeSpecialFile( PWCHAR WideSource, PFILE_OBJECT pFileObject, PIO_STACK_LOCATION pCurrentIrpStack)
{
	if ( /*(0==pFileObject->FileName.Length)			||*/
		(wcsstr(WideSource,L"SYSTEM32\\CONFIG")!=0) ||
		(wcsstr(WideSource,L"NTUSER.DAT.LOG")!=0)	||
		(wcsstr(WideSource,L"PAGEFILE.SYS")!=0)		||
		(wcsstr(WideSource,L"NTUSER.DAT")!=0)		||
		(wcsstr(WideSource,L"SECURITY.LOG")!=0)		||
		(wcsstr(WideSource,L"SOFTWARE.LOG")!=0)		||
		(wcsstr(WideSource,L"SYSTEM.LOG")!=0)		||
		(wcsstr(WideSource,L"DEFAULT.LOG")!=0)		||
		(Is_Directory_File(pCurrentIrpStack->Parameters.Create.Options))
		)
	{
		return TRUE;
	}
	return FALSE;
}



VOID 
FsTPMGetFileStandardInformation(
								  PFILE_OBJECT FileObject,
								  PFILE_STANDARD_INFORMATION StandardInformation,
								  PIO_STATUS_BLOCK IoStatusBlock,
								  PDEVICE_OBJECT pDeviceObject
								  )
								  //++
								  // Function:	FsTPMGetFileStandardInformation
								  //
								  // Description:
								  //		Get a file's standard information 
								  //
								  // Arguments:
								  //		IN  FileObject			- Target file object 
								  //		OUT StandardInformation - Standard information pointer
								  //		OUT IoStatusBlock		- Point out whether this request is success.
								  //		IN  pDeviceObject       - the Device below me
								  // Return value:
								  //		None
								  //
								  // Notice :
								  //		This function is provided by OSR
								  //--
{
	PIRP irp;
	KEVENT event;
	PIO_STACK_LOCATION ioStackLocation;
	PDEVICE_OBJECT fsdDevice=pDeviceObject;

	//
	// Start off on the right foot - zero the information block.
	//

	RtlZeroMemory(StandardInformation, sizeof(FILE_STANDARD_INFORMATION));

	//
	// Allocate an irp for this request.  This could also come from a 
	// private pool, for instance.
	//

	irp = IoAllocateIrp(fsdDevice->StackSize, FALSE);

	if (!irp) {
		//
		// Failure!
		//

		return;
	}

	irp->AssociatedIrp.SystemBuffer = StandardInformation;

	irp->UserEvent = &event;

	irp->UserIosb = IoStatusBlock;

	irp->Tail.Overlay.Thread = PsGetCurrentThread();

	irp->Tail.Overlay.OriginalFileObject = FileObject;

	irp->RequestorMode = KernelMode;

	//
	// Initialize the event
	//

	KeInitializeEvent(&event, SynchronizationEvent, FALSE);

	//
	// Set up the I/O stack location.
	//

	ioStackLocation = IoGetNextIrpStackLocation(irp);

	ioStackLocation->MajorFunction = IRP_MJ_QUERY_INFORMATION;

	ioStackLocation->DeviceObject = fsdDevice;

	ioStackLocation->FileObject = FileObject;

	ioStackLocation->Parameters.QueryFile.Length = sizeof(FILE_STANDARD_INFORMATION);

	ioStackLocation->Parameters.QueryFile.FileInformationClass = FileStandardInformation;

	//
	// Set the completion routine.
	//

	IoSetCompletionRoutine(irp, KfcIoCompletion, 0, TRUE, TRUE, TRUE);

	//
	// Send it to the FSD
	//

	(void) IoCallDriver(fsdDevice, irp);

	//
	// Wait for the I/O
	//

	KeWaitForSingleObject(&event, Executive, KernelMode, TRUE, 0);

	//
	// Done!
	//

	return;

}


NTSTATUS 
KfcIoCompletion(
				PDEVICE_OBJECT DeviceObject,
				PIRP Irp,
				PVOID Context
				)
				//++
				// Function:	KfcIoCompletion
				//
				// Description:
				//		This routine is used to handle I/O (read OR write) completion
				//
				// Arguments:
				//		DeviceObject - not used
				//		Irp - the I/O operation being completed
				//		Context - not used
				//
				// Return value:
				//		STATUS_MORE_PROCESSING_REQUIRED
				//	
				// Notice :
				//		This function is provided by OSR
				//
				// Notes:
				//		The purpose of this routine is to do "cleanup" on I/O operations
				//  so we don't constantly throw away perfectly good MDLs as part of
				//  completion processing.
				//
{
	//
	// Copy the status information back into the "user" IOSB.
	//

	*Irp->UserIosb = Irp->IoStatus;

	//
	// Set the user event - wakes up the mainline code doing this.
	// So that we can jump out of KeWaitForSingleObject() in my routine
	//

	KeSetEvent(Irp->UserEvent, 0, FALSE);


	//
	// Free the IRP now that we are done with it.
	//

	IoFreeIrp(Irp);

	//
	// We return STATUS_MORE_PROCESSING_REQUIRED because this "magic" return value
	// tells the I/O Manager that additional processing will be done by this driver
	// to the IRP - in fact, it might (as it is in this case) already BE done - and
	// the IRP cannot be completed.
	//

	return STATUS_MORE_PROCESSING_REQUIRED;
}

VOID 
FsTPMRead(
			PFILE_OBJECT FileObject,
			PLARGE_INTEGER Offset,
			ULONG Length,
			PMDL Mdl,
			PIO_STATUS_BLOCK IoStatusBlock,
			PDEVICE_OBJECT pDevice
			)
			//++
			// Function:	FsTPMRead
			//
			// Description:
			//		This routine is used to read the file object to memory discribed by MDL
			//
			// Arguments:
			//		PFILE_OBJECT FileObject,
			//		PLARGE_INTEGER Offset,
			//		ULONG Length,
			//		PMDL Mdl,
			//		PIO_STATUS_BLOCK IoStatusBlock
			//
			// Return value:
			//		None
			//	
			// Notice :
			//		This function is provided by OSR
			//
{
	PIRP irp;
	KEVENT event;
	PIO_STACK_LOCATION ioStackLocation;
	PDEVICE_OBJECT fsdDevice=pDevice;
	//
	// Set up the event we'll use.
	//

	KeInitializeEvent(&event, SynchronizationEvent, FALSE);


	//
	// Allocate and build the IRP we'll be sending to the FSD.
	//

	irp = IoAllocateIrp(fsdDevice->StackSize, FALSE);

	if (!irp) {

		//
		// Allocation failed, presumably due to memory allocation failure.
		//

		IoStatusBlock->Status = STATUS_INSUFFICIENT_RESOURCES;

		IoStatusBlock->Information = 0;

	}

	irp->MdlAddress = Mdl;

	irp->UserEvent = &event;

	irp->UserIosb = IoStatusBlock;

	irp->Tail.Overlay.Thread = PsGetCurrentThread();

	irp->Tail.Overlay.OriginalFileObject= FileObject;

	irp->RequestorMode = KernelMode;


	//
	// Indicate that this is a READ operation.
	//

	irp->Flags = IRP_READ_OPERATION;


	//
	// Set up the next I/O stack location.  These are the parameters
	// that will be passed to the underlying driver.
	//

	ioStackLocation = IoGetNextIrpStackLocation(irp);

	ioStackLocation->MajorFunction = IRP_MJ_READ;

	ioStackLocation->MinorFunction = 0;

	ioStackLocation->DeviceObject = fsdDevice;

	ioStackLocation->FileObject = FileObject;


	//
	// We use a completion routine to keep the I/O Manager from doing
	// "cleanup" on our IRP - like freeing our MDL.
	//

	IoSetCompletionRoutine(irp, KfcIoCompletion, 0, TRUE, TRUE, TRUE);

	ioStackLocation->Parameters.Read.Length = Length;

	ioStackLocation->Parameters.Read.ByteOffset = *Offset;


	//
	// Send it on.  Ignore the return code.
	//

	(void) IoCallDriver(fsdDevice, irp);


	//
	// Wait for the I/O to complete.
	//

	KeWaitForSingleObject(&event, Executive, KernelMode, TRUE, 0);


	//
	// Done.  Return results are in the io status block.
	//

	return;
}



VOID 
FsTPMSetFileAllocation(
						 PFILE_OBJECT FileObject,
						 PLARGE_INTEGER AllocationSize,
						 PIO_STATUS_BLOCK IoStatusBlock,
						 PDEVICE_OBJECT   pDevice
						 )
						 //++
						 // Function:	FsTPMSetFileAllocation
						 //
						 // Description:
						 //		This routine sets a file's ALLOCATION size to the specified value.
						 //  Note that this DOES NOT extend the file's EOF.
						 //
						 // Arguments:
						 //		FileObject - the file on which to set the allocation size
						 //		AllocationSize - the new allocation size
						 //	    IoStatusBlock - the results of this operation
						 //
						 // Return value:
						 //		None
						 //	
						 // Notice :
						 //		This function is provided by OSR
						 //--
{
	PIRP irp;
	KEVENT event;
	PIO_STACK_LOCATION ioStackLocation;
	PDEVICE_OBJECT fsdDevice=pDevice;

	//
	// Allocate an irp for this request.  This could also come from a 
	// private pool, for instance.
	//

	irp = IoAllocateIrp(fsdDevice->StackSize, FALSE);

	if (!irp) {
		//
		// Failure!
		//

		return;
	}

	irp->AssociatedIrp.SystemBuffer = AllocationSize;

	irp->UserEvent = &event;

	irp->UserIosb = IoStatusBlock;

	irp->Tail.Overlay.Thread = PsGetCurrentThread();

	irp->Tail.Overlay.OriginalFileObject = FileObject;

	irp->RequestorMode = KernelMode;


	//
	// Initialize the event
	//

	KeInitializeEvent(&event, SynchronizationEvent, FALSE);


	//
	// Set up the I/O stack location.
	//

	ioStackLocation = IoGetNextIrpStackLocation(irp);

	ioStackLocation->MajorFunction = IRP_MJ_SET_INFORMATION;

	ioStackLocation->DeviceObject = fsdDevice;

	ioStackLocation->FileObject = FileObject;

	ioStackLocation->Parameters.SetFile.Length = sizeof(LARGE_INTEGER);

	ioStackLocation->Parameters.SetFile.FileInformationClass = FileAllocationInformation;

	ioStackLocation->Parameters.SetFile.FileObject = 0; // not used for allocation

	ioStackLocation->Parameters.SetFile.AdvanceOnly = FALSE;

	//
	// Set the completion routine.
	//

	IoSetCompletionRoutine(irp, KfcIoCompletion, 0, TRUE, TRUE, TRUE);

	//
	// Send it to the FSD
	//

	(void) IoCallDriver(fsdDevice, irp);

	//
	// Wait for the I/O
	//

	KeWaitForSingleObject(&event, Executive, KernelMode, TRUE, 0);

	//
	// Done!
	//

	return;
}

VOID 
FsTPMWrite(
			 PFILE_OBJECT FileObject,
			 PLARGE_INTEGER Offset,
			 ULONG Length,
			 PMDL Mdl,
			 PIO_STATUS_BLOCK IoStatusBlock,
			 PDEVICE_OBJECT   pDevice
			 )
			 //++
			 // Function:	FsTPMWrite
			 //
			 // Description:
			 //		This routine is used to write to the file object from memory discribed by MDL
			 //
			 // Arguments:
			 //		PFILE_OBJECT FileObject,
			 //		PLARGE_INTEGER Offset,
			 //		ULONG Length,
			 //		PMDL Mdl,
			 //		PIO_STATUS_BLOCK IoStatusBlock
			 //
			 // Return value:
			 //		None
			 //	
			 // Notice :
			 //		This function is provided by OSR
			 //
{
	PIRP irp;
	KEVENT event;
	PIO_STACK_LOCATION ioStackLocation;
	PDEVICE_OBJECT fsdDevice =pDevice;

	//
	// Set up the event we'll use.
	//

	KeInitializeEvent(&event, SynchronizationEvent, FALSE);


	//
	// Allocate and build the IRP we'll be sending to the FSD.
	//

	irp = IoAllocateIrp(fsdDevice->StackSize, FALSE);

	if (!irp) {

		//
		// Allocation failed, presumably due to memory allocation failure.
		//

		IoStatusBlock->Status = STATUS_INSUFFICIENT_RESOURCES;

		IoStatusBlock->Information = 0;

	}

	irp->MdlAddress = Mdl;

	irp->UserEvent = &event;

	irp->UserIosb = IoStatusBlock;

	irp->Tail.Overlay.Thread = PsGetCurrentThread();

	irp->Tail.Overlay.OriginalFileObject= FileObject;

	irp->RequestorMode = KernelMode;


	//
	// Indicate that this is a WRITE operation.
	//

	irp->Flags = IRP_WRITE_OPERATION;


	//
	// Set up the next I/O stack location.  These are the parameters
	// that will be passed to the underlying driver.
	//

	ioStackLocation = IoGetNextIrpStackLocation(irp);

	ioStackLocation->MajorFunction = IRP_MJ_WRITE;

	ioStackLocation->MinorFunction = 0;

	ioStackLocation->DeviceObject = fsdDevice;

	ioStackLocation->FileObject = FileObject;


	//
	// We use a completion routine to keep the I/O Manager from doing
	// "cleanup" on our IRP - like freeing our MDL.
	//

	IoSetCompletionRoutine(irp, KfcIoCompletion, 0, TRUE, TRUE, TRUE);

	ioStackLocation->Parameters.Write.Length = Length;

	ioStackLocation->Parameters.Write.ByteOffset = *Offset;


	//
	// Send it on.  Ignore the return code.
	//

	(void) IoCallDriver(fsdDevice, irp);


	//
	// Wait for the I/O to complete.
	//

	KeWaitForSingleObject(&event, Executive, KernelMode, TRUE, 0);


	//
	// Done.  Return results are in the io status block.
	//

	return;

}


//-----------------------------------------------------------------------------
/*++
The following functions

Abstract:
This module implements routines to support synchronous API calls to
the next lower file system driver.

Revision History:

02-01-2002 : created

Note:
Thank OSR and Mr. Paul for providing some useful information
--*/


VOID FsTPMReferenceDeviceAndVpb(IN PFILE_OBJECT FileObject)
{
	//	NTSTATUS Status;
	PDEVICE_OBJECT RealDevice;
	PVPB Vpb;

	//
	// Copy RealDevice and Vpb into local variables to make things easier.
	//

	RealDevice =  FileObject->DeviceObject;
	Vpb =  FileObject->Vpb;

	//ASSERT(Vpb !=  NULL ? RealDevice->Vpb !=  NULL : RealDevice->Vpb ==  NULL);

	//
	// Increment RealDevice's reference count.
	//

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99热这里只有精品| 欧美xxxxxxxx| 欧美哺乳videos| 国产精品久久久久aaaa| 日本少妇一区二区| 91久久精品网| 亚洲欧洲精品天堂一级| 国产一区二区看久久| 欧美日韩在线不卡| 国产精品免费aⅴ片在线观看| 免费观看在线色综合| 欧美中文一区二区三区| 亚洲天堂av老司机| 成人午夜av在线| 久久新电视剧免费观看| 日韩激情中文字幕| 欧美日韩三级在线| 亚洲欧美欧美一区二区三区| 成人精品一区二区三区中文字幕| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 3d动漫精品啪啪一区二区竹菊| 中文字幕亚洲在| 国产成人在线视频网站| 久久综合色鬼综合色| 久久精品久久99精品久久| 欧美精品视频www在线观看| 国产精品不卡一区| 99久久婷婷国产精品综合| 亚洲欧洲精品天堂一级 | 色一情一伦一子一伦一区| 中文字幕一区二区三区在线观看| 国产一区二区三区精品视频| 国产欧美一区二区在线观看| 美女一区二区久久| 日韩欧美一级在线播放| 午夜激情一区二区三区| 在线播放91灌醉迷j高跟美女| 亚洲成人免费看| 666欧美在线视频| 日本一不卡视频| 6080午夜不卡| 国产在线精品一区二区夜色| 精品成人a区在线观看| 国产成人亚洲精品青草天美 | 成人av资源网站| 专区另类欧美日韩| 91香蕉国产在线观看软件| 国产精品久久久久影院| 色哟哟国产精品| 日韩综合在线视频| 精品国产91乱码一区二区三区| 国产成人在线视频免费播放| 国产精品成人网| 欧美性一二三区| 久久精品国产成人一区二区三区 | 亚洲色图20p| 欧美专区亚洲专区| 日本午夜一区二区| 国产日本欧美一区二区| 91视频com| 日本女优在线视频一区二区| 欧美—级在线免费片| 欧美亚洲动漫制服丝袜| 极品少妇一区二区三区精品视频| 国产亚洲精品超碰| 色狠狠av一区二区三区| 激情丁香综合五月| 亚洲人成亚洲人成在线观看图片 | 欧美色手机在线观看| 美女一区二区久久| 国产精品成人免费 | 欧美午夜宅男影院| 国产最新精品免费| 亚洲成a人v欧美综合天堂| 精品第一国产综合精品aⅴ| 一本色道a无线码一区v| 裸体一区二区三区| 亚洲日本一区二区| 欧美一区二区播放| 91老司机福利 在线| 黄色日韩网站视频| 亚洲一区自拍偷拍| 国产欧美日产一区| 91精品国产综合久久精品图片| 成人午夜伦理影院| 激情综合网av| 三级久久三级久久久| 国产精品国产精品国产专区不片| 88在线观看91蜜桃国自产| 色婷婷av一区二区| 成人网页在线观看| 精品亚洲国产成人av制服丝袜 | 综合久久综合久久| 亚洲精品一区二区三区香蕉| 欧美这里有精品| av电影在线不卡| 国产精品亚洲第一区在线暖暖韩国 | 日日夜夜一区二区| 一区二区三区精品视频在线| 国产精品网友自拍| 久久久蜜臀国产一区二区| 欧美一区二区三区四区五区| 欧美性videosxxxxx| 色综合中文字幕| 成人激情av网| 成人动漫一区二区在线| 成人午夜av在线| www.亚洲在线| 97久久人人超碰| 91美女在线视频| 97精品视频在线观看自产线路二| 国产成人亚洲综合a∨婷婷图片| 狠狠v欧美v日韩v亚洲ⅴ| 久久电影网站中文字幕 | 99久久精品费精品国产一区二区| 国产激情一区二区三区| 国产寡妇亲子伦一区二区| 国产九九视频一区二区三区| 国产不卡视频一区二区三区| 国产成人在线网站| www.亚洲免费av| 欧美亚洲高清一区| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲精品成a人| 亚洲美女在线一区| 夜夜嗨av一区二区三区中文字幕 | 在线影院国内精品| 欧美性videosxxxxx| 欧美精品久久久久久久多人混战 | 欧美日韩国产综合久久| 欧美日韩国产首页在线观看| 欧美一级生活片| 久久久久国产精品麻豆ai换脸| 日本一区二区成人在线| 一区在线观看视频| 天使萌一区二区三区免费观看| 日韩不卡手机在线v区| 国产美女精品人人做人人爽| 99久久婷婷国产综合精品电影| 欧美系列在线观看| 久久午夜色播影院免费高清| 中文字幕亚洲电影| 亚洲电影你懂得| 国产成人在线视频网站| 色欧美88888久久久久久影院| 宅男在线国产精品| xf在线a精品一区二区视频网站| 亚洲国产精品成人久久综合一区| 亚洲夂夂婷婷色拍ww47| 国产一区啦啦啦在线观看| 一本大道久久a久久综合| 日韩精品综合一本久道在线视频| 国产精品天美传媒| 亚洲成a人v欧美综合天堂 | 日韩电影一二三区| 国产suv精品一区二区883| 欧美亚洲国产怡红院影院| 精品1区2区在线观看| 亚洲欧美日韩国产综合在线 | 欧亚一区二区三区| 欧美精品一区二区三区四区 | 日韩精品一区二区三区四区视频| 国产精品免费看片| 奇米影视在线99精品| 色婷婷av一区二区三区gif| 久久久影视传媒| 日韩精品电影在线观看| 色综合天天性综合| 久久色在线视频| 丝袜亚洲精品中文字幕一区| 99这里只有精品| 精品美女一区二区| 天天综合日日夜夜精品| 暴力调教一区二区三区| 26uuu久久综合| 日本中文一区二区三区| 欧美三级电影在线看| 亚洲三级免费观看| 成人免费视频视频| 国产午夜精品一区二区三区视频| 美女一区二区三区| 欧美日本乱大交xxxxx| 亚洲美女偷拍久久| 91亚洲男人天堂| 国产精品久久久久久亚洲毛片 | 精品欧美一区二区久久| 亚洲第一主播视频| 欧美色老头old∨ideo| 成人免费在线播放视频| 成人免费看片app下载| 日本一区二区三区四区在线视频 | 国产欧美一区二区在线| 国产伦精品一区二区三区免费迷 | 伊人婷婷欧美激情| 91麻豆123| 亚洲超碰97人人做人人爱| 欧美视频一区在线| 天堂一区二区在线| 91精品国产色综合久久不卡蜜臀| 亚洲成人精品在线观看|