几个结构体


typedef struct _EX_PUSH_LOCK
{
  union
  {
  ULONG Locked: 1;
  ULONG Waiting: 1;
  ULONG Waking: 1;
  ULONG MultipleShared: 1;
  ULONG Shared: 28;
  ULONG Value;
  PVOID Ptr;
  };
} EX_PUSH_LOCK, *PEX_PUSH_LOCK;

typedef struct _FSRTL_COMMON_FCB_HEADER {
  CSHORT NodeTypeCode; 0
  CSHORT NodeByteSize; 2
  UCHAR Flags; 4
  UCHAR IsFastIoPossible; 5
  UCHAR Flags2; 6
  UCHAR Reserved : 4; 7
  UCHAR Version : 4;  
  PERESOURCE Resource; 8
  PERESOURCE PagingIoResource; c
  LARGE_INTEGER AllocationSize; 10
  LARGE_INTEGER FileSize; 18
  LARGE_INTEGER ValidDataLength; 20
} FSRTL_COMMON_FCB_HEADER;
typedef FSRTL_COMMON_FCB_HEADER *PFSRTL_COMMON_FCB_HEADER;

typedef struct _FSRTL_ADVANCED_FCB_HEADER {
  FSRTL_COMMON_FCB_HEADER;
  PFAST_MUTEX FastMutex; 28
  LIST_ENTRY FilterContexts; 2c
  EX_PUSH_LOCK PushLock; 34
  PVOID* FileContextSupportPointer; 38
} FSRTL_ADVANCED_FCB_HEADER;
typedef FSRTL_ADVANCED_FCB_HEADER *PFSRTL_ADVANCED_FCB_HEADER;

typedef struct _SCB {

  //
  // The following field is used for fast I/O. It contains the node
  // type code and size, indicates if fast I/O is possible, contains
  // allocation, file, and valid data size, a resource, and call back
  // pointers for FastIoRead and FastMdlRead.
  //
  // The node type codes for the Scb must be either NTFS_NTC_SCB_INDEX,
  // NTFS_NTC_SCB_ROOT_INDEX, or NTFS_NTC_SCB_DATA. Which one it is
  // determines the state of the union below.
  //

  FSRTL_ADVANCED_FCB_HEADER Header;

  //
  // The links for the queue of Scb off of a given Fcb. And a pointer
  // back to the Fcb. Corresponds to Fcb->ScbQueue
  //

  LIST_ENTRY FcbLinks; <-0x3C
  PFCB Fcb; <-0x44

  //
  // A pointer to the Vcb containing this Scb
  //

  PVCB Vcb; <-0x48

  //
  // The internal state of the Scb.
  //

  ULONG ScbState;

  //
  // A count of the number of file objects opened on this stream
  // which represent user non-cached handles. We use this count to
  // determine when to flush and purge the data section in only
  // non-cached handles remain on the file.
  //

  CLONG NonCachedCleanupCount;

  //
  // A count of the number of file objects that have been opened for
  // this attribute, but not yet been cleaned up yet.
  // This count gets decremented in NtfsCommonCleanup,
  // while the CloseCount below gets decremented in NtfsCommonClose.
  //

  CLONG CleanupCount;

  //
  // A count of the number of file objects that have opened
  // this attribute.
  //

  CLONG CloseCount;

  //
  // Share Access structure for this stream.
  //

  SHARE_ACCESS ShareAccess;

  //
  // The following two fields identify the actual attribute for this
  // Scb with respect to its file. We identify the attribute by
  // its type code and name.
  //

  ATTRIBUTE_TYPE_CODE AttributeTypeCode;
  UNICODE_STRING AttributeName;

  //
  // Stream File Object for internal use. This field is NULL if the
  // file stream is not being accessed internally.
  //

  PFILE_OBJECT FileObject;

  //
  // These pointers are used to detect writes that eminated from the
  // cache manager's worker thread. It prevents lazy writer threads,
  // who already have the Fcb shared, from trying to acquire it
  // exclusive, and thus causing a deadlock. We have to store two
  // threads, because the second thread could be writing the compressed
  // stream
  //

  PVOID LazyWriteThread[2];

  //
  // Pointer to the non-paged section objects and open attribute
  // table index.
  //

  PSCB_NONPAGED NonpagedScb;

  //
  // The following field contains the mcb for this Scb and some initial
  // structures for small and medium files.
  //

  NTFS_MCB Mcb;
  NTFS_MCB_INITIAL_STRUCTS McbStructs;

  //
  // Compression unit from attribute record.
  //

  ULONG CompressionUnit;

  //
  // AttributeFlags and CompressionUnitShift from attribute record
  //

  USHORT AttributeFlags;
  UCHAR CompressionUnitShift;
  UCHAR PadUchar;

  //
  // Valid Data to disk - as updated by NtfsPrepareBuffers
  //

  LONGLONG ValidDataToDisk;

  //
  // Number of clusters added due to Split Mcb calls. The user has
  // not asked for this allocation.
  //

  LONGLONG ExcessFromSplitMcb;

  //
  // Actual allocated bytes for this file.
  //

  LONGLONG TotalAllocated;

  //
  // Used by advanced Scb Header
  //

  LIST_ENTRY EofListHead;

  //
  // Defragmentation parameters
  //

  union {

  PMOVE_FILE_DATA MoveData;

  } Union;

  //
  // Pointer to structure containing snapshotted Scb values, or NULL
  // if the values have not been snapshotted.
  //

  struct _SCB_SNAPSHOT * ScbSnapshot;
  ULONG PadUlong;

  //
  // Scb Type union, for different types of Scbs
  //

  union {

  SCB_DATA Data;
  SCB_INDEX Index;
  SCB_MFT Mft;

  } ScbType;

} SCB;
typedef SCB *PSCB; 

### 回答1: C++中的函数结构体是一种可以像普通函数一样使用的结构体。它可以通过重载运算符来实现,也可以通过定义函数指针来实现。 举个例子: ``` struct Add { int operator()(int a, int b) const { return a + b; } }; Add add; int result = add(3, 4); // result is 7 ``` 另一个例子: ``` struct Divide { double operator()(double a, double b) const { return a / b; } }; Divide divide; double result = divide(10.0, 3.0); // result is 3.3333 ``` 还有一个例子 ``` struct Multiply { int operator()(int a, int b) const { return a * b; } }; Multiply multiply; int result = multiply(2, 3); // result is 6 ``` ### 回答2: 函数结构体是指将函数作为结构体的成员,以实现对函数的封装和组织。以下是几个函数结构体的例子: 1. 四则运算函数结构体:包含加、减、乘、除等基本运算函数作为结构体成员。通过定义函数指针,可以通过该结构体调用相应的函数来进行四则运算。 2. 排序函数结构体:包含多种排序算法,如冒泡排序、快速排序、归并排序等函数作为结构体成员。通过该结构体可以灵活选择不同的排序算法来对不同的数据进行排序。 3. 文件操作函数结构体:包含打开、读取、写入、关闭等文件操作函数作为结构体成员。通过定义函数指针,可以通过该结构体来调用相应的文件操作函数,实现对文件的读写操作。 4. 网络请求函数结构体:包含发送、接收、解析数据等网络相关的函数作为结构体成员。通过该结构体可以进行网络请求,并对收到的数据进行解析和处理。 5. 系统调用函数结构体:包含调用、进程管理、内存管理等系统调用函数作为结构体成员。通过该结构体可以直接调用系统提供的功能,实现底层操作和控制。 这些函数结构体的例子都可以通过结构体内的函数指针成员来调用具体的函数,提高代码的组织性和可复用性,并对函数进行封装,方便使用和维护。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值