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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sfilter.c

?? winddk src目錄下的文件系統(tǒng)驅(qū)動源碼壓縮!
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*++

Copyright (c) 1989-2004  Microsoft Corporation

Module Name:

    sfilter.c

Abstract:

    This module contains the code that implements the general purpose sample
    file system filter driver.

    As of the Windows XP SP1 IFS Kit version of this sample and later, this
    sample can be built for each build environment released with the IFS Kit
    with no additional modifications.  To provide this capability, additional
    compile-time logic was added -- see the '#if WINVER' locations.  Comments
    tagged with the 'VERSION NOTE' header have also been added as appropriate to
    describe how the logic must change between versions.

    If this sample is built in the Windows XP environment or later, it will run
    on Windows 2000 or later.  This is done by dynamically loading the routines
    that are only available on Windows XP or later and making run-time decisions
    to determine what code to execute.  Comments tagged with 'MULTIVERISON NOTE'
    mark the locations where such logic has been added.

Environment:

    Kernel mode

--*/

//
//  Fixes Win2K compatibility regarding lookaside lists.
//

#ifndef _WIN2K_COMPAT_SLIST_USAGE
#define _WIN2K_COMPAT_SLIST_USAGE
#endif

#include "ntifs.h"
#include "ntdddisk.h"
#include "namelookup.h"
#include <dontuse.h>


//
//  Enable these warnings in the code.
//

#pragma warning(error:4100)   // Unreferenced formal parameter
#pragma warning(error:4101)   // Unreferenced local variable

/////////////////////////////////////////////////////////////////////////////
//
//                   Macro and Structure Definitions
//
/////////////////////////////////////////////////////////////////////////////

//
//  VERSION NOTE:
//
//  The following useful macros are defined in NTIFS.H in Windows XP and later.
//  We will define them locally if we are building for the Windows 2000
//  environment.
//

#if WINVER == 0x0500

//
//  These macros are used to test, set and clear flags respectively
//

#ifndef FlagOn
#define FlagOn(_F,_SF)        ((_F) & (_SF))
#endif

#ifndef BooleanFlagOn
#define BooleanFlagOn(F,SF)   ((BOOLEAN)(((F) & (SF)) != 0))
#endif

#ifndef SetFlag
#define SetFlag(_F,_SF)       ((_F) |= (_SF))
#endif

#ifndef ClearFlag
#define ClearFlag(_F,_SF)     ((_F) &= ~(_SF))
#endif


#define RtlInitEmptyUnicodeString(_ucStr,_buf,_bufSize) \
    ((_ucStr)->Buffer = (_buf), \
     (_ucStr)->Length = 0, \
     (_ucStr)->MaximumLength = (USHORT)(_bufSize))


#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif

#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif

//
//  We want ASSERT defined as an expression, which was fixed after Windows 2000
//

#ifdef ASSERT
#undef ASSERT
#if DBG
#define ASSERT( exp ) \
    ((!(exp)) ? \
        (RtlAssert( #exp, __FILE__, __LINE__, NULL ),FALSE) : \
        TRUE)
#else
#define ASSERT( exp ) ((void) 0)
#endif
#endif

#define ExFreePoolWithTag( a, b ) ExFreePool( (a) )

#endif /* WINVER == 0x0500 */

#ifndef Add2Ptr
#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
#endif

//
//  Buffer size for local names on the stack
//

#define MAX_DEVNAME_LENGTH 64

#define CONSTANT_UNICODE_STRING(s)   { sizeof( s ) - sizeof( WCHAR ), sizeof(s), s }

//
//  Device extension definition for our driver.  Note that the same extension
//  is used for the following types of device objects:
//      - File system device object we attach to
//      - Mounted volume device objects we attach to
//

typedef struct _SFILTER_DEVICE_EXTENSION {

    //
    //  NL_DEVICE_EXTENSION_HEADER contains all the fields that are needed by
    //  the name lookup library. It happens to contain all fields SFilter needs
    //  for its device extension.
    //

    NL_DEVICE_EXTENSION_HEADER NLExtHeader;

    //
    //  Local flags for this device
    //

    ULONG Flags;

} SFILTER_DEVICE_EXTENSION, *PSFILTER_DEVICE_EXTENSION;

//
//  If set, disable all special debug options on this volume
//

#define SFDEVFL_DISABLE_VOLUME      0x00000001



//
//  This structure contains the information we need to pass to the completion
//  processing for FSCTRLs.
//

typedef struct _FSCTRL_COMPLETION_CONTEXT {

    //
    //  The workitem that will be initialized with our context and
    //  worker routine if this completion processing needs to be completed
    //  in a worker thread.
    //

    WORK_QUEUE_ITEM WorkItem;

    //
    //  The device object to which this device is currently directed.
    //

    PDEVICE_OBJECT DeviceObject;

    //
    //  The IRP for this FSCTRL operation.
    //

    PIRP Irp;

    //
    //  For mount operations, the new device object that we have allocated
    //  and partially initialized that we will attach to the mounted volume
    //  if the mount is successful.
    //

    PDEVICE_OBJECT NewDeviceObject;

} FSCTRL_COMPLETION_CONTEXT, *PFSCTRL_COMPLETION_CONTEXT;


//
//  Macro to test if this is my device object
//

#define IS_MY_DEVICE_OBJECT(_devObj) \
    (((_devObj) != NULL) && \
     ((_devObj)->DriverObject == gSFilterDriverObject) && \
      ((_devObj)->DeviceExtension != NULL))

//
//  Macro to test if this is my control device object
//

#define IS_MY_CONTROL_DEVICE_OBJECT(_devObj) \
    (((_devObj) == gSFilterControlDeviceObject) ? \
            (ASSERT(((_devObj)->DriverObject == gSFilterDriverObject) && \
                    ((_devObj)->DeviceExtension == NULL)), TRUE) : \
            FALSE)

//
//  Macro to test for device types we want to attach to
//

#define IS_DESIRED_DEVICE_TYPE(_type) \
    (((_type) == FILE_DEVICE_DISK_FILE_SYSTEM) || \
     ((_type) == FILE_DEVICE_CD_ROM_FILE_SYSTEM) || \
     ((_type) == FILE_DEVICE_NETWORK_FILE_SYSTEM))

//
//  Macro to test if FAST_IO_DISPATCH handling routine is valid
//

#define VALID_FAST_IO_DISPATCH_HANDLER(_FastIoDispatchPtr, _FieldName) \
    (((_FastIoDispatchPtr) != NULL) && \
     (((_FastIoDispatchPtr)->SizeOfFastIoDispatch) >= \
            (FIELD_OFFSET(FAST_IO_DISPATCH, _FieldName) + sizeof(void *))) && \
     ((_FastIoDispatchPtr)->_FieldName != NULL))


#if WINVER >= 0x0501
//
//  MULTIVERSION NOTE:
//
//  If built in the Windows XP environment or later, we will dynamically import
//  the function pointers for routines that were not supported on Windows 2000
//  so that we can build a driver that will run, with modified logic, on
//  Windows 2000 or later.
//
//  Below are the prototypes for the function pointers that we need to
//  dynamically import because not all OS versions support these routines.
//

typedef
NTSTATUS
(*PSF_REGISTER_FILE_SYSTEM_FILTER_CALLBACKS) (
    IN PDRIVER_OBJECT DriverObject,
    IN PFS_FILTER_CALLBACKS Callbacks
    );

typedef
NTSTATUS
(*PSF_ENUMERATE_DEVICE_OBJECT_LIST) (
    IN  PDRIVER_OBJECT DriverObject,
    IN  PDEVICE_OBJECT *DeviceObjectList,
    IN  ULONG DeviceObjectListSize,
    OUT PULONG ActualNumberDeviceObjects
    );

typedef
NTSTATUS
(*PSF_ATTACH_DEVICE_TO_DEVICE_STACK_SAFE) (
    IN PDEVICE_OBJECT SourceDevice,
    IN PDEVICE_OBJECT TargetDevice,
    OUT PDEVICE_OBJECT *AttachedToDeviceObject
    );

typedef
PDEVICE_OBJECT
(*PSF_GET_LOWER_DEVICE_OBJECT) (
    IN  PDEVICE_OBJECT  DeviceObject
    );

typedef
PDEVICE_OBJECT
(*PSF_GET_DEVICE_ATTACHMENT_BASE_REF) (
    IN PDEVICE_OBJECT DeviceObject
    );

typedef
NTSTATUS
(*PSF_GET_DISK_DEVICE_OBJECT) (
    IN  PDEVICE_OBJECT  FileSystemDeviceObject,
    OUT PDEVICE_OBJECT  *DiskDeviceObject
    );

typedef
PDEVICE_OBJECT
(*PSF_GET_ATTACHED_DEVICE_REFERENCE) (
    IN PDEVICE_OBJECT DeviceObject
    );

typedef
NTSTATUS
(*PSF_GET_VERSION) (
    IN OUT PRTL_OSVERSIONINFOW VersionInformation
    );

typedef struct _SF_DYNAMIC_FUNCTION_POINTERS {

    //
    //  The following routines should all be available on Windows XP (5.1) and
    //  later.
    //

    PSF_REGISTER_FILE_SYSTEM_FILTER_CALLBACKS RegisterFileSystemFilterCallbacks;
    PSF_ATTACH_DEVICE_TO_DEVICE_STACK_SAFE AttachDeviceToDeviceStackSafe;
    PSF_ENUMERATE_DEVICE_OBJECT_LIST EnumerateDeviceObjectList;
    PSF_GET_LOWER_DEVICE_OBJECT GetLowerDeviceObject;
    PSF_GET_DEVICE_ATTACHMENT_BASE_REF GetDeviceAttachmentBaseRef;
    PSF_GET_DISK_DEVICE_OBJECT GetDiskDeviceObject;
    PSF_GET_ATTACHED_DEVICE_REFERENCE GetAttachedDeviceReference;
    PSF_GET_VERSION GetVersion;

} SF_DYNAMIC_FUNCTION_POINTERS, *PSF_DYNAMIC_FUNCTION_POINTERS;

SF_DYNAMIC_FUNCTION_POINTERS gSfDynamicFunctions = {0};

//
//  MULTIVERSION NOTE: For this version of the driver, we need to know the
//  current OS version while we are running to make decisions regarding what
//  logic to use when the logic cannot be the same for all platforms.  We
//  will look up the OS version in DriverEntry and store the values
//  in these global variables.
//

ULONG gSfOsMajorVersion = 0;
ULONG gSfOsMinorVersion = 0;

//
//  Here is what the major and minor versions should be for the various
//  OS versions:
//
//  OS Name                                 MajorVersion    MinorVersion
//  ---------------------------------------------------------------------
//  Windows 2000                             5                 0
//  Windows XP                               5                 1
//  Windows Server 2003                      5                 2
//

#define IS_WINDOWS2000() \
    ((gSfOsMajorVersion == 5) && (gSfOsMinorVersion == 0))

#define IS_WINDOWSXP() \
    ((gSfOsMajorVersion == 5) && (gSfOsMinorVersion == 1))

#define IS_WINDOWSXP_OR_LATER() \
    (((gSfOsMajorVersion == 5) && (gSfOsMinorVersion >= 1)) || \
     (gSfOsMajorVersion > 5))

#define IS_WINDOWSSRV2003_OR_LATER() \
    (((gSfOsMajorVersion == 5) && (gSfOsMinorVersion >= 2)) || \
     (gSfOsMajorVersion > 5))

#endif


//
//  Tags identifying memory SFilter allocates
//

#define SFLT_POOL_TAG_FASTIO        'ifFS'
#define SFLT_POOL_TAG_MOUNTVOL      'vmFS'
#define SFLT_POOL_TAG_LOADFS        'flFS'
#define SFLT_POOL_TAG_ENUMFSVOL     'neFS'
#define SFLT_POOL_TAG_DOSNAME       'ndFS'
#define SFLT_POOL_TAG_NAME_BUFFER   'bnFS'
#define SFLT_POOL_TAG_BIGNAMEBUFFER 'nbFS'
#define SFLT_POOL_TAG_DEVNAME       'nvFS'

//
//  Macros for SFilter DbgPrint levels.
//

#define SF_LOG_PRINT( _dbgLevel, _string )                  \
    (FlagOn(SfDebug,(_dbgLevel)) ?                          \
        DbgPrint _string  :                                 \
        ((void)0))

//
//  Delay values for KeDelayExecutionThread()
//  (Values are negative to represent relative time)
//

#define DELAY_ONE_MICROSECOND   (-10)
#define DELAY_ONE_MILLISECOND   (DELAY_ONE_MICROSECOND*1000)
#define DELAY_ONE_SECOND        (DELAY_ONE_MILLISECOND*1000)


/////////////////////////////////////////////////////////////////////////////
//
//                      Global variables
//
/////////////////////////////////////////////////////////////////////////////

//
//  Lookaside list for various name buffers.
//

PAGED_LOOKASIDE_LIST gSfNameBufferLookasideList;

//
//  Since we always use this list to allocate NAME_CONTROLs, we will use that
//  for the size of the lookaside list.
//

#define SFILTER_LOOKASIDE_SIZE  sizeof( NAME_CONTROL )

//
//  Holds pointer to the driver object for this driver
//

PDRIVER_OBJECT gSFilterDriverObject = NULL;

//
//  Holds pointer to the device object that represents this driver and is used
//  by external programs to access this driver.  This is also known as the
//  "control device object".
//

PDEVICE_OBJECT gSFilterControlDeviceObject = NULL;

//
//  This lock is used to synchronize our attaching to a given device object.
//  This lock fixes a race condition where we could accidently attach to the
//  same device object more then once.  This race condition only occurs if
//  a volume is being mounted at the same time as this filter is being loaded.
//  This problem will never occur if this filter is loaded at boot time before
//  any file systems are loaded.
//
//  This lock is used to atomically test if we are already attached to a given
//  device object and if not, do the attach.
//

FAST_MUTEX gSfilterAttachLock;

UNICODE_STRING gInsufficientResourcesUnicode = CONSTANT_UNICODE_STRING(L"[-= Insufficient Resources =-]");

/////////////////////////////////////////////////////////////////////////////
//
//                      Debug Definitions
//
/////////////////////////////////////////////////////////////////////////////

//

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频你懂的| 老司机午夜精品| 亚洲欧洲av另类| 欧美高清在线精品一区| 日本一区二区视频在线| 国产欧美一区二区在线观看| 国产日韩欧美高清在线| 久久精品亚洲乱码伦伦中文| 国产女人aaa级久久久级| 国产麻豆视频一区二区| 美女www一区二区| 看片网站欧美日韩| 国产一区二区三区在线观看免费视频 | 欧美一二三在线| 91麻豆精品国产91| 欧美电影免费观看高清完整版在线观看 | 视频一区在线播放| 香蕉久久一区二区不卡无毒影院| 午夜免费久久看| 久久精品国产成人一区二区三区| 九色|91porny| 国产盗摄精品一区二区三区在线| 国产成人在线免费观看| 99视频一区二区| 91高清在线观看| 亚洲电影你懂得| 丝袜亚洲另类丝袜在线| 极品少妇xxxx精品少妇偷拍| 国产精品一区在线观看乱码| 成人黄色在线视频| 欧美性生活大片视频| 欧美一区二区三区视频在线| 久久久精品国产免大香伊| 亚洲天堂av一区| 日本欧美韩国一区三区| 国产精品一区久久久久| 一本高清dvd不卡在线观看| 欧美精品色综合| 久久精品欧美一区二区三区不卡| 国产精品国产精品国产专区不蜜 | 国产精品一区二区免费不卡| 91在线观看视频| 欧美精品久久天天躁| 国产日韩欧美在线一区| 夜夜操天天操亚洲| 国产在线视视频有精品| 91在线视频官网| 欧美成人福利视频| 亚洲丝袜美腿综合| 久久国产精品99精品国产| 91视频精品在这里| 日韩精品一区国产麻豆| 亚洲欧美日韩在线不卡| 日本女人一区二区三区| 欧美国产国产综合| 日韩精品一二三四| av在线播放一区二区三区| 91精品国产色综合久久不卡蜜臀| 国产精品视频第一区| 日本不卡视频一二三区| aaa国产一区| 精品国产一区二区亚洲人成毛片| 综合在线观看色| 国产一区在线观看麻豆| 欧美日韩视频在线一区二区| 欧美高清在线精品一区| 男女男精品视频网| 91久久精品一区二区| 久久久精品日韩欧美| 首页国产丝袜综合| 91色九色蝌蚪| 国产色91在线| 精品亚洲成a人在线观看| 欧美性做爰猛烈叫床潮| 亚洲日本免费电影| 国产成人亚洲综合a∨猫咪| 欧美一区二区视频在线观看2022| 亚洲日本青草视频在线怡红院| 国产在线观看一区二区| 91精品国产入口| 亚洲国产欧美日韩另类综合| 久久久久国产一区二区三区四区| 亚洲电影在线免费观看| 99久久国产综合色|国产精品| 久久蜜桃香蕉精品一区二区三区| 免费在线看一区| 欧洲色大大久久| 亚洲男同性恋视频| av中文一区二区三区| 久久影音资源网| 紧缚捆绑精品一区二区| 日韩欧美亚洲一区二区| 日本伊人色综合网| 欧美日韩大陆一区二区| 亚洲国产日韩a在线播放性色| 日本丶国产丶欧美色综合| 中文字幕一区二区三区不卡| 成人精品在线视频观看| 国产精品久久久久aaaa樱花| 成人小视频免费观看| 国产精品午夜免费| 高潮精品一区videoshd| 国产蜜臀97一区二区三区| 国产伦精品一区二区三区视频青涩 | 337p亚洲精品色噜噜| 亚洲国产一区在线观看| 欧美日韩国产在线播放网站| 亚洲第四色夜色| 欧美一区二区在线视频| 日本美女视频一区二区| 日韩欧美国产三级电影视频| 久久国产精品免费| 欧美精品一区二区三区蜜臀| 国产在线一区观看| 日本一区二区久久| 99精品一区二区三区| 99视频国产精品| 亚洲一区免费在线观看| 欧美午夜视频网站| 肉色丝袜一区二区| 欧美成人一级视频| 国产精品一品二品| 日韩美女精品在线| 精品视频在线免费| 久久99精品一区二区三区| 2021中文字幕一区亚洲| 成人小视频在线| 一区二区理论电影在线观看| 欧美精品v国产精品v日韩精品 | 视频一区视频二区在线观看| 91精品国产综合久久精品图片| 免费久久精品视频| 中文字幕不卡在线播放| 日本久久电影网| 免费成人你懂的| 国产亚洲成av人在线观看导航| 99视频精品免费视频| 视频一区视频二区中文字幕| 久久亚洲一级片| 色网综合在线观看| 日韩精品乱码av一区二区| 久久网这里都是精品| 91尤物视频在线观看| 欧美日韩亚洲高清一区二区| 六月丁香婷婷色狠狠久久| 中文字幕第一区| 777午夜精品视频在线播放| 国产激情视频一区二区三区欧美| 成人欧美一区二区三区1314 | 亚洲国产日韩a在线播放| 精品欧美一区二区三区精品久久| 成人免费视频视频| 天天影视网天天综合色在线播放| 久久久久国产一区二区三区四区 | 欧美体内she精高潮| 国内久久精品视频| 亚洲午夜久久久久中文字幕久| 久久蜜桃av一区精品变态类天堂| 在线观看一区日韩| 国产高清无密码一区二区三区| 亚洲激情在线激情| 久久精品亚洲一区二区三区浴池 | 自拍偷在线精品自拍偷无码专区| 欧美一区二区高清| 色综合视频在线观看| 国产综合色视频| 亚洲午夜精品网| 欧美激情在线一区二区| 欧美一级生活片| 色婷婷激情一区二区三区| 国产精品综合久久| 日本视频一区二区| 一区二区三区欧美在线观看| 国产日韩视频一区二区三区| 日韩欧美一区二区视频| 色美美综合视频| 成人av在线网站| 国产综合一区二区| 日本三级亚洲精品| 欧美在线一二三| 成人影视亚洲图片在线| 精品在线一区二区| 日韩国产欧美三级| 亚洲综合丁香婷婷六月香| 国产精品电影一区二区| 久久综合给合久久狠狠狠97色69| 制服.丝袜.亚洲.另类.中文| 欧美在线观看视频一区二区三区| www.欧美亚洲| 岛国av在线一区| 国产高清精品在线| 国产精品一区二区久久不卡| 久久精品99国产精品| 日韩影院精彩在线| 性欧美大战久久久久久久久| 一区二区三区**美女毛片| 亚洲人成人一区二区在线观看| 亚洲国产精品成人综合| 久久色在线观看| 久久久国产一区二区三区四区小说|