ntdll.h
上传用户:shouhua
上传日期:2014-12-06
资源大小:5685k
文件大小:6k
源码类别:

杀毒

开发平台:

Visual C++

  1. typedef LONG NTSTATUS;
  2. #define   OBJ_INHERIT  0x02
  3. #define   STATUS_SUCCESS  0x0
  4. #define   DUPLICATE_SAME_ATTRIBUTES  0x04
  5. #define NT_SUCCESS(status)      ((NTSTATUS)(status)>=0)
  6. typedef enum _SYSTEM_INFORMATION_CLASS     //    Q S
  7. {
  8.     SystemBasicInformation,                // 00 Y N
  9.     SystemProcessorInformation,            // 01 Y N
  10.     SystemPerformanceInformation,          // 02 Y N
  11.     SystemTimeOfDayInformation,            // 03 Y N
  12.     SystemNotImplemented1,                 // 04 Y N
  13.     SystemProcessesAndThreadsInformation,  // 05 Y N
  14.     SystemCallCounts,                      // 06 Y N
  15.     SystemConfigurationInformation,        // 07 Y N
  16.     SystemProcessorTimes,                  // 08 Y N
  17.     SystemGlobalFlag,                      // 09 Y Y
  18.     SystemNotImplemented2,                 // 10 Y N
  19.     SystemModuleInformation,               // 11 Y N
  20.     SystemLockInformation,                 // 12 Y N
  21.     SystemNotImplemented3,                 // 13 Y N
  22.     SystemNotImplemented4,                 // 14 Y N
  23.     SystemNotImplemented5,                 // 15 Y N
  24.     SystemHandleInformation,               // 16 Y N
  25.     SystemObjectInformation,               // 17 Y N
  26.     SystemPagefileInformation,             // 18 Y N
  27.     SystemInstructionEmulationCounts,      // 19 Y N
  28.     SystemInvalidInfoClass1,               // 20
  29.     SystemCacheInformation,                // 21 Y Y
  30.     SystemPoolTagInformation,              // 22 Y N
  31.     SystemProcessorStatistics,             // 23 Y N
  32.     SystemDpcInformation,                  // 24 Y Y
  33.     SystemNotImplemented6,                 // 25 Y N
  34.     SystemLoadImage,                       // 26 N Y
  35.     SystemUnloadImage,                     // 27 N Y
  36.     SystemTimeAdjustment,                  // 28 Y Y
  37.     SystemNotImplemented7,                 // 29 Y N
  38.     SystemNotImplemented8,                 // 30 Y N
  39.     SystemNotImplemented9,                 // 31 Y N
  40.     SystemCrashDumpInformation,            // 32 Y N
  41.     SystemExceptionInformation,            // 33 Y N
  42.     SystemCrashDumpStateInformation,       // 34 Y Y/N
  43.     SystemKernelDebuggerInformation,       // 35 Y N
  44.     SystemContextSwitchInformation,        // 36 Y N
  45.     SystemRegistryQuotaInformation,        // 37 Y Y
  46.     SystemLoadAndCallImage,                // 38 N Y
  47.     SystemPrioritySeparation,              // 39 N Y
  48.     SystemNotImplemented10,                // 40 Y N
  49.     SystemNotImplemented11,                // 41 Y N
  50.     SystemInvalidInfoClass2,               // 42
  51.     SystemInvalidInfoClass3,               // 43
  52.     SystemTimeZoneInformation,             // 44 Y N
  53.     SystemLookasideInformation,            // 45 Y N
  54.     SystemSetTimeSlipEvent,                // 46 N Y
  55.     SystemCreateSession,                   // 47 N Y
  56.     SystemDeleteSession,                   // 48 N Y
  57.     SystemInvalidInfoClass4,               // 49
  58.     SystemRangeStartInformation,           // 50 Y N
  59.     SystemVerifierInformation,             // 51 Y Y
  60.     SystemAddVerifier,                     // 52 N Y
  61.     SystemSessionProcessesInformation      // 53 Y N
  62. } SYSTEM_INFORMATION_CLASS;
  63. typedef struct _SYSTEM_MODULE_INFORMATION  // Information Class 11
  64. {
  65.     ULONG  Reserved[2];
  66.     PVOID  Base;
  67.     ULONG  Size;
  68.     ULONG  Flags;
  69.     USHORT Index;
  70.     USHORT Unknown;
  71.     USHORT LoadCount;
  72.     USHORT ModuleNameOffset;
  73.     CHAR   ImageName[256];
  74. } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
  75. typedef struct _SYSTEM_HANDLE_INFORMATION 
  76. {
  77. ULONG ProcessId;
  78. UCHAR ObjectTypeNumber;
  79. UCHAR Flags;
  80. USHORT Handle;
  81. ULONG Object;
  82. ACCESS_MASK GrantedAccess;
  83. }SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
  84. typedef struct _CLIENT_ID
  85. {
  86. HANDLE  UniqueProcess;
  87. HANDLE  UniqueThread;
  88. }CLIENT_ID,*PCLIENT_ID;
  89. typedef struct _UNICODE_STRING {
  90.   USHORT  Length;
  91.   USHORT  MaximumLength;
  92.   PWSTR  Buffer;
  93. } UNICODE_STRING, *PUNICODE_STRING;
  94. typedef struct _OBJECT_ATTRIBUTES {
  95.     ULONG  Length;
  96.     HANDLE  RootDirectory;
  97.     PUNICODE_STRING  ObjectName;
  98.     ULONG  Attributes;
  99.     PVOID  SecurityDescriptor;
  100.     PVOID  SecurityQualityOfService;
  101. } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
  102. typedef struct _SYSTEM_HANDLE_INFORMATION_EX 
  103. {
  104. ULONG NumberOfHandles;
  105. SYSTEM_HANDLE_INFORMATION Information[1];
  106. }SYSTEM_HANDLE_INFORMATION_EX, *PSYSTEM_HANDLE_INFORMATION_EX;
  107. typedef 
  108. NTSTATUS 
  109. ( __stdcall *ZWQUERYSYSTEMINFORMATION ) 
  110.                                       ( 
  111.   IN SYSTEM_INFORMATION_CLASS SystemInformationClass, 
  112.   IN OUT PVOID SystemInformation, 
  113.   IN ULONG SystemInformationLength, 
  114.   OUT PULONG ReturnLength OPTIONAL 
  115.   );
  116. static ZWQUERYSYSTEMINFORMATION ZwQuerySystemInformation = NULL;
  117. #define STATUS_INFO_LENGTH_MISMATCH  0xC0000004
  118. typedef struct _TIME_FIELDS {
  119.     short  Year;        // range [1601...]
  120.     short  Month;       // range [1..12]
  121.     short  Day;         // range [1..31]
  122.     short  Hour;        // range [0..23]
  123.     short  Minute;      // range [0..59]
  124.     short  Second;      // range [0..59]
  125.     short  Milliseconds;// range [0..999]
  126.     short  Weekday;     // range [0..6] == [Sunday..Saturday]
  127. } TIME_FIELDS;
  128. //typedef TIME_FIELDS *PTIME_FIELDS;
  129. typedef struct _DIRECTORY_INFO{
  130.        char FileName[50];      
  131.    LARGE_INTEGER  AllocationSize;
  132.        TIME_FIELDS    CreationTime;
  133.         TIME_FIELDS    LastAccessTime ; 
  134. TIME_FIELDS             LastWriteTime;  
  135. TIME_FIELDS    ChangeTime; 
  136.         ULONG     FileAttributes ;    
  137. }DIRECTORY_INFO ,*PDIRECTORY_INFO ;
  138. typedef struct _IOFCOM_CODE
  139. {
  140. unsigned int  a;
  141. ULONG   b;
  142. BYTE   c;
  143. }IOFCOM_CODE,*PIOFCOM_CODE;
  144. typedef struct _PROCESS_BASIC_INFORMATION {
  145.     PVOID Reserved1;
  146.     ULONG PebBaseAddress;
  147.     PVOID Reserved2[2];
  148.     ULONG UniqueProcessId;
  149.     PVOID Reserved3;
  150. } PROCESS_BASIC_INFORMATION;
  151. typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO{
  152.         int  UniqueProcessId;
  153.         int  CreatorBackTraceIndex;
  154.         byte  ObjectTypeIndex;
  155.         byte  HandleAttributes;
  156.         int   HandleValue ;
  157.         ULONG  pObject;
  158.         ULONG GrantedAccess;
  159. }SYSTEM_HANDLE_TABLE_ENTRY_INFO,*PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
  160. typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES;