Debian Codegraph @

psutil/arch/windows/ntextapi.h

raw
1 /*
2 * Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 * Define Windows structs and constants which are considered private.
6 */
7
8 #if !defined(__NTEXTAPI_H__)
9 #define __NTEXTAPI_H__
10 #include <winternl.h>
11 #include <iphlpapi.h>
12
13 typedef LONG NTSTATUS;
14
15 // https://github.com/ajkhoury/TestDll/blob/master/nt_ddk.h
16 #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
17 #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
18 #define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L)
19 #define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225L)
20 #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005L)
21
22 // WtsApi32.h
23 #define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
24 #define WINSTATIONNAME_LENGTH 32
25 #define DOMAIN_LENGTH 17
26 #define USERNAME_LENGTH 20
27
28 // ================================================================
29 // Enums
30 // ================================================================
31
32 #undef SystemExtendedHandleInformation
33 #define SystemExtendedHandleInformation 64
34 #undef MemoryWorkingSetInformation
35 #define MemoryWorkingSetInformation 0x1
36 #undef ObjectNameInformation
37 #define ObjectNameInformation 1
38 #undef ProcessIoPriority
39 #define ProcessIoPriority 33
40 #undef ProcessWow64Information
41 #define ProcessWow64Information 26
42 #undef SystemProcessIdInformation
43 #define SystemProcessIdInformation 88
44
45 // process suspend() / resume()
46 typedef enum _KTHREAD_STATE {
47 Initialized,
48 Ready,
49 Running,
50 Standby,
51 Terminated,
52 Waiting,
53 Transition,
54 DeferredReady,
55 GateWait,
56 MaximumThreadState
57 } KTHREAD_STATE, *PKTHREAD_STATE;
58
59 typedef enum _KWAIT_REASON {
60 Executive,
61 FreePage,
62 PageIn,
63 PoolAllocation,
64 DelayExecution,
65 Suspended,
66 UserRequest,
67 WrExecutive,
68 WrFreePage,
69 WrPageIn,
70 WrPoolAllocation,
71 WrDelayExecution,
72 WrSuspended,
73 WrUserRequest,
74 WrEventPair,
75 WrQueue,
76 WrLpcReceive,
77 WrLpcReply,
78 WrVirtualMemory,
79 WrPageOut,
80 WrRendezvous,
81 WrKeyedEvent,
82 WrTerminated,
83 WrProcessInSwap,
84 WrCpuRateControl,
85 WrCalloutStack,
86 WrKernel,
87 WrResource,
88 WrPushLock,
89 WrMutex,
90 WrQuantumEnd,
91 WrDispatchInt,
92 WrPreempted,
93 WrYieldExecution,
94 WrFastMutex,
95 WrGuardedMutex,
96 WrRundown,
97 WrAlertByThreadId,
98 WrDeferredPreempt,
99 MaximumWaitReason
100 } KWAIT_REASON, *PKWAIT_REASON;
101
102 // users()
103 typedef enum _WTS_INFO_CLASS {
104 WTSInitialProgram,
105 WTSApplicationName,
106 WTSWorkingDirectory,
107 WTSOEMId,
108 WTSSessionId,
109 WTSUserName,
110 WTSWinStationName,
111 WTSDomainName,
112 WTSConnectState,
113 WTSClientBuildNumber,
114 WTSClientName,
115 WTSClientDirectory,
116 WTSClientProductId,
117 WTSClientHardwareId,
118 WTSClientAddress,
119 WTSClientDisplay,
120 WTSClientProtocolType,
121 WTSIdleTime,
122 WTSLogonTime,
123 WTSIncomingBytes,
124 WTSOutgoingBytes,
125 WTSIncomingFrames,
126 WTSOutgoingFrames,
127 WTSClientInfo,
128 WTSSessionInfo,
129 WTSSessionInfoEx,
130 WTSConfigInfo,
131 WTSValidationInfo, // Info Class value used to fetch Validation Information through the WTSQuerySessionInformation
132 WTSSessionAddressV4,
133 WTSIsRemoteSession
134 } WTS_INFO_CLASS;
135
136 typedef enum _WTS_CONNECTSTATE_CLASS {
137 WTSActive, // User logged on to WinStation
138 WTSConnected, // WinStation connected to client
139 WTSConnectQuery, // In the process of connecting to client
140 WTSShadow, // Shadowing another WinStation
141 WTSDisconnected, // WinStation logged on without client
142 WTSIdle, // Waiting for client to connect
143 WTSListen, // WinStation is listening for connection
144 WTSReset, // WinStation is being reset
145 WTSDown, // WinStation is down due to error
146 WTSInit, // WinStation in initialization
147 } WTS_CONNECTSTATE_CLASS;
148
149 // ================================================================
150 // Structs.
151 // ================================================================
152
153 // cpu_stats(), per_cpu_times()
154 typedef struct {
155 LARGE_INTEGER IdleTime;
156 LARGE_INTEGER KernelTime;
157 LARGE_INTEGER UserTime;
158 LARGE_INTEGER DpcTime;
159 LARGE_INTEGER InterruptTime;
160 ULONG InterruptCount;
161 } _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
162
163 // cpu_stats()
164 typedef struct {
165 LARGE_INTEGER IdleProcessTime;
166 LARGE_INTEGER IoReadTransferCount;
167 LARGE_INTEGER IoWriteTransferCount;
168 LARGE_INTEGER IoOtherTransferCount;
169 ULONG IoReadOperationCount;
170 ULONG IoWriteOperationCount;
171 ULONG IoOtherOperationCount;
172 ULONG AvailablePages;
173 ULONG CommittedPages;
174 ULONG CommitLimit;
175 ULONG PeakCommitment;
176 ULONG PageFaultCount;
177 ULONG CopyOnWriteCount;
178 ULONG TransitionCount;
179 ULONG CacheTransitionCount;
180 ULONG DemandZeroCount;
181 ULONG PageReadCount;
182 ULONG PageReadIoCount;
183 ULONG CacheReadCount;
184 ULONG CacheIoCount;
185 ULONG DirtyPagesWriteCount;
186 ULONG DirtyWriteIoCount;
187 ULONG MappedPagesWriteCount;
188 ULONG MappedWriteIoCount;
189 ULONG PagedPoolPages;
190 ULONG NonPagedPoolPages;
191 ULONG PagedPoolAllocs;
192 ULONG PagedPoolFrees;
193 ULONG NonPagedPoolAllocs;
194 ULONG NonPagedPoolFrees;
195 ULONG FreeSystemPtes;
196 ULONG ResidentSystemCodePage;
197 ULONG TotalSystemDriverPages;
198 ULONG TotalSystemCodePages;
199 ULONG NonPagedPoolLookasideHits;
200 ULONG PagedPoolLookasideHits;
201 ULONG AvailablePagedPoolPages;
202 ULONG ResidentSystemCachePage;
203 ULONG ResidentPagedPoolPage;
204 ULONG ResidentSystemDriverPage;
205 ULONG CcFastReadNoWait;
206 ULONG CcFastReadWait;
207 ULONG CcFastReadResourceMiss;
208 ULONG CcFastReadNotPossible;
209 ULONG CcFastMdlReadNoWait;
210 ULONG CcFastMdlReadWait;
211 ULONG CcFastMdlReadResourceMiss;
212 ULONG CcFastMdlReadNotPossible;
213 ULONG CcMapDataNoWait;
214 ULONG CcMapDataWait;
215 ULONG CcMapDataNoWaitMiss;
216 ULONG CcMapDataWaitMiss;
217 ULONG CcPinMappedDataCount;
218 ULONG CcPinReadNoWait;
219 ULONG CcPinReadWait;
220 ULONG CcPinReadNoWaitMiss;
221 ULONG CcPinReadWaitMiss;
222 ULONG CcCopyReadNoWait;
223 ULONG CcCopyReadWait;
224 ULONG CcCopyReadNoWaitMiss;
225 ULONG CcCopyReadWaitMiss;
226 ULONG CcMdlReadNoWait;
227 ULONG CcMdlReadWait;
228 ULONG CcMdlReadNoWaitMiss;
229 ULONG CcMdlReadWaitMiss;
230 ULONG CcReadAheadIos;
231 ULONG CcLazyWriteIos;
232 ULONG CcLazyWritePages;
233 ULONG CcDataFlushes;
234 ULONG CcDataPages;
235 ULONG ContextSwitches;
236 ULONG FirstLevelTbFills;
237 ULONG SecondLevelTbFills;
238 ULONG SystemCalls;
239 } _SYSTEM_PERFORMANCE_INFORMATION;
240
241 // cpu_stats()
242 typedef struct {
243 ULONG ContextSwitches;
244 ULONG DpcCount;
245 ULONG DpcRate;
246 ULONG TimeIncrement;
247 ULONG DpcBypassCount;
248 ULONG ApcBypassCount;
249 } _SYSTEM_INTERRUPT_INFORMATION;
250
251 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX {
252 PVOID Object;
253 HANDLE UniqueProcessId;
254 HANDLE HandleValue;
255 ULONG GrantedAccess;
256 USHORT CreatorBackTraceIndex;
257 USHORT ObjectTypeIndex;
258 ULONG HandleAttributes;
259 ULONG Reserved;
260 } SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
261
262 typedef struct _SYSTEM_HANDLE_INFORMATION_EX {
263 ULONG_PTR NumberOfHandles;
264 ULONG_PTR Reserved;
265 SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handles[1];
266 } SYSTEM_HANDLE_INFORMATION_EX, *PSYSTEM_HANDLE_INFORMATION_EX;
267
268 typedef struct _CLIENT_ID2 {
269 HANDLE UniqueProcess;
270 HANDLE UniqueThread;
271 } CLIENT_ID2, *PCLIENT_ID2;
272
273 #define CLIENT_ID CLIENT_ID2
274 #define PCLIENT_ID PCLIENT_ID2
275
276 typedef struct _SYSTEM_THREAD_INFORMATION2 {
277 LARGE_INTEGER KernelTime;
278 LARGE_INTEGER UserTime;
279 LARGE_INTEGER CreateTime;
280 ULONG WaitTime;
281 PVOID StartAddress;
282 CLIENT_ID ClientId;
283 LONG Priority;
284 LONG BasePriority;
285 ULONG ContextSwitches;
286 ULONG ThreadState;
287 KWAIT_REASON WaitReason;
288 } SYSTEM_THREAD_INFORMATION2, *PSYSTEM_THREAD_INFORMATION2;
289
290 #define SYSTEM_THREAD_INFORMATION SYSTEM_THREAD_INFORMATION2
291 #define PSYSTEM_THREAD_INFORMATION PSYSTEM_THREAD_INFORMATION2
292
293 typedef struct _SYSTEM_PROCESS_INFORMATION2 {
294 ULONG NextEntryOffset;
295 ULONG NumberOfThreads;
296 LARGE_INTEGER SpareLi1;
297 LARGE_INTEGER SpareLi2;
298 LARGE_INTEGER SpareLi3;
299 LARGE_INTEGER CreateTime;
300 LARGE_INTEGER UserTime;
301 LARGE_INTEGER KernelTime;
302 UNICODE_STRING ImageName;
303 LONG BasePriority;
304 HANDLE UniqueProcessId;
305 HANDLE InheritedFromUniqueProcessId;
306 ULONG HandleCount;
307 ULONG SessionId;
308 ULONG_PTR PageDirectoryBase;
309 SIZE_T PeakVirtualSize;
310 SIZE_T VirtualSize;
311 DWORD PageFaultCount;
312 SIZE_T PeakWorkingSetSize;
313 SIZE_T WorkingSetSize;
314 SIZE_T QuotaPeakPagedPoolUsage;
315 SIZE_T QuotaPagedPoolUsage;
316 SIZE_T QuotaPeakNonPagedPoolUsage;
317 SIZE_T QuotaNonPagedPoolUsage;
318 SIZE_T PagefileUsage;
319 SIZE_T PeakPagefileUsage;
320 SIZE_T PrivatePageCount;
321 LARGE_INTEGER ReadOperationCount;
322 LARGE_INTEGER WriteOperationCount;
323 LARGE_INTEGER OtherOperationCount;
324 LARGE_INTEGER ReadTransferCount;
325 LARGE_INTEGER WriteTransferCount;
326 LARGE_INTEGER OtherTransferCount;
327 SYSTEM_THREAD_INFORMATION Threads[1];
328 } SYSTEM_PROCESS_INFORMATION2, *PSYSTEM_PROCESS_INFORMATION2;
329
330 #define SYSTEM_PROCESS_INFORMATION SYSTEM_PROCESS_INFORMATION2
331 #define PSYSTEM_PROCESS_INFORMATION PSYSTEM_PROCESS_INFORMATION2
332
333 // cpu_freq()
334 typedef struct _PROCESSOR_POWER_INFORMATION {
335 ULONG Number;
336 ULONG MaxMhz;
337 ULONG CurrentMhz;
338 ULONG MhzLimit;
339 ULONG MaxIdleState;
340 ULONG CurrentIdleState;
341 } PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION;
342
343 #ifndef __IPHLPAPI_H__
344 typedef struct in6_addr {
345 union {
346 UCHAR Byte[16];
347 USHORT Word[8];
348 } u;
349 } IN6_ADDR, *PIN6_ADDR, FAR *LPIN6_ADDR;
350 #endif
351
352 // PEB / cmdline(), cwd(), environ()
353 typedef struct {
354 BYTE Reserved1[16];
355 PVOID Reserved2[5];
356 UNICODE_STRING CurrentDirectoryPath;
357 PVOID CurrentDirectoryHandle;
358 UNICODE_STRING DllPath;
359 UNICODE_STRING ImagePathName;
360 UNICODE_STRING CommandLine;
361 LPCWSTR env;
362 } RTL_USER_PROCESS_PARAMETERS_, *PRTL_USER_PROCESS_PARAMETERS_;
363
364 // users()
365 typedef struct _WTS_SESSION_INFOW {
366 DWORD SessionId; // session id
367 LPWSTR pWinStationName; // name of WinStation this session is
368 // connected to
369 WTS_CONNECTSTATE_CLASS State; // connection state (see enum)
370 } WTS_SESSION_INFOW, * PWTS_SESSION_INFOW;
371
372 #define PWTS_SESSION_INFO PWTS_SESSION_INFOW
373
374 typedef struct _WTS_CLIENT_ADDRESS {
375 DWORD AddressFamily; // AF_INET, AF_INET6, AF_IPX, AF_NETBIOS, AF_UNSPEC
376 BYTE Address[20]; // client network address
377 } WTS_CLIENT_ADDRESS, * PWTS_CLIENT_ADDRESS;
378
379 typedef struct _WTSINFOW {
380 WTS_CONNECTSTATE_CLASS State; // connection state (see enum)
381 DWORD SessionId; // session id
382 DWORD IncomingBytes;
383 DWORD OutgoingBytes;
384 DWORD IncomingFrames;
385 DWORD OutgoingFrames;
386 DWORD IncomingCompressedBytes;
387 DWORD OutgoingCompressedBytes;
388 WCHAR WinStationName[WINSTATIONNAME_LENGTH];
389 WCHAR Domain[DOMAIN_LENGTH];
390 WCHAR UserName[USERNAME_LENGTH + 1];// name of WinStation this session is
391 // connected to
392 LARGE_INTEGER ConnectTime;
393 LARGE_INTEGER DisconnectTime;
394 LARGE_INTEGER LastInputTime;
395 LARGE_INTEGER LogonTime;
396 LARGE_INTEGER CurrentTime;
397
398 } WTSINFOW, * PWTSINFOW;
399
400 #define PWTSINFO PWTSINFOW
401
402 // cpu_count_cores()
403 #if (_WIN32_WINNT < 0x0601) // Windows < 7 (Vista and XP)
404 typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX {
405 LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
406 DWORD Size;
407 _ANONYMOUS_UNION
408 union {
409 PROCESSOR_RELATIONSHIP Processor;
410 NUMA_NODE_RELATIONSHIP NumaNode;
411 CACHE_RELATIONSHIP Cache;
412 GROUP_RELATIONSHIP Group;
413 } DUMMYUNIONNAME;
414 } SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, \
415 *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX;
416 #endif
417
418 // memory_uss()
419 typedef struct _MEMORY_WORKING_SET_BLOCK {
420 ULONG_PTR Protection : 5;
421 ULONG_PTR ShareCount : 3;
422 ULONG_PTR Shared : 1;
423 ULONG_PTR Node : 3;
424 #ifdef _WIN64
425 ULONG_PTR VirtualPage : 52;
426 #else
427 ULONG VirtualPage : 20;
428 #endif
429 } MEMORY_WORKING_SET_BLOCK, *PMEMORY_WORKING_SET_BLOCK;
430
431 // memory_uss()
432 typedef struct _MEMORY_WORKING_SET_INFORMATION {
433 ULONG_PTR NumberOfEntries;
434 MEMORY_WORKING_SET_BLOCK WorkingSetInfo[1];
435 } MEMORY_WORKING_SET_INFORMATION, *PMEMORY_WORKING_SET_INFORMATION;
436
437 // memory_uss()
438 typedef struct _PSUTIL_PROCESS_WS_COUNTERS {
439 SIZE_T NumberOfPages;
440 SIZE_T NumberOfPrivatePages;
441 SIZE_T NumberOfSharedPages;
442 SIZE_T NumberOfShareablePages;
443 } PSUTIL_PROCESS_WS_COUNTERS, *PPSUTIL_PROCESS_WS_COUNTERS;
444
445 // exe()
446 typedef struct _SYSTEM_PROCESS_ID_INFORMATION {
447 HANDLE ProcessId;
448 UNICODE_STRING ImageName;
449 } SYSTEM_PROCESS_ID_INFORMATION, *PSYSTEM_PROCESS_ID_INFORMATION;
450
451 // ====================================================================
452 // PEB structs for cmdline(), cwd(), environ()
453 // ====================================================================
454
455 #ifdef _WIN64
456 typedef struct {
457 BYTE Reserved1[2];
458 BYTE BeingDebugged;
459 BYTE Reserved2[21];
460 PVOID LoaderData;
461 PRTL_USER_PROCESS_PARAMETERS_ ProcessParameters;
462 // more fields...
463 } PEB_;
464
465 // When we are a 64 bit process accessing a 32 bit (WoW64)
466 // process we need to use the 32 bit structure layout.
467 typedef struct {
468 USHORT Length;
469 USHORT MaxLength;
470 DWORD Buffer;
471 } UNICODE_STRING32;
472
473 typedef struct {
474 BYTE Reserved1[16];
475 DWORD Reserved2[5];
476 UNICODE_STRING32 CurrentDirectoryPath;
477 DWORD CurrentDirectoryHandle;
478 UNICODE_STRING32 DllPath;
479 UNICODE_STRING32 ImagePathName;
480 UNICODE_STRING32 CommandLine;
481 DWORD env;
482 } RTL_USER_PROCESS_PARAMETERS32;
483
484 typedef struct {
485 BYTE Reserved1[2];
486 BYTE BeingDebugged;
487 BYTE Reserved2[1];
488 DWORD Reserved3[2];
489 DWORD Ldr;
490 DWORD ProcessParameters;
491 // more fields...
492 } PEB32;
493 #else // ! _WIN64
494 typedef struct {
495 BYTE Reserved1[2];
496 BYTE BeingDebugged;
497 BYTE Reserved2[1];
498 PVOID Reserved3[2];
499 PVOID Ldr;
500 PRTL_USER_PROCESS_PARAMETERS_ ProcessParameters;
501 // more fields...
502 } PEB_;
503
504 // When we are a 32 bit (WoW64) process accessing a 64 bit process
505 // we need to use the 64 bit structure layout and a special function
506 // to read its memory.
507 typedef NTSTATUS (NTAPI *_NtWow64ReadVirtualMemory64)(
508 HANDLE ProcessHandle,
509 PVOID64 BaseAddress,
510 PVOID Buffer,
511 ULONG64 Size,
512 PULONG64 NumberOfBytesRead);
513
514 typedef struct {
515 PVOID Reserved1[2];
516 PVOID64 PebBaseAddress;
517 PVOID Reserved2[4];
518 PVOID UniqueProcessId[2];
519 PVOID Reserved3[2];
520 } PROCESS_BASIC_INFORMATION64;
521
522 typedef struct {
523 USHORT Length;
524 USHORT MaxLength;
525 PVOID64 Buffer;
526 } UNICODE_STRING64;
527
528 typedef struct {
529 BYTE Reserved1[16];
530 PVOID64 Reserved2[5];
531 UNICODE_STRING64 CurrentDirectoryPath;
532 PVOID64 CurrentDirectoryHandle;
533 UNICODE_STRING64 DllPath;
534 UNICODE_STRING64 ImagePathName;
535 UNICODE_STRING64 CommandLine;
536 PVOID64 env;
537 } RTL_USER_PROCESS_PARAMETERS64;
538
539 typedef struct {
540 BYTE Reserved1[2];
541 BYTE BeingDebugged;
542 BYTE Reserved2[21];
543 PVOID64 LoaderData;
544 PVOID64 ProcessParameters;
545 // more fields...
546 } PEB64;
547 #endif // _WIN64
548
549 // ================================================================
550 // Type defs for modules loaded at runtime.
551 // ================================================================
552
553 BOOL (WINAPI *_GetLogicalProcessorInformationEx) (
554 LOGICAL_PROCESSOR_RELATIONSHIP relationship,
555 PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Buffer,
556 PDWORD ReturnLength);
557
558 #define GetLogicalProcessorInformationEx _GetLogicalProcessorInformationEx
559
560 BOOLEAN (WINAPI * _WinStationQueryInformationW) (
561 HANDLE ServerHandle,
562 ULONG SessionId,
563 WINSTATIONINFOCLASS WinStationInformationClass,
564 PVOID pWinStationInformation,
565 ULONG WinStationInformationLength,
566 PULONG pReturnLength);
567
568 #define WinStationQueryInformationW _WinStationQueryInformationW
569
570 NTSTATUS (NTAPI *_NtQueryInformationProcess) (
571 HANDLE ProcessHandle,
572 DWORD ProcessInformationClass,
573 PVOID ProcessInformation,
574 DWORD ProcessInformationLength,
575 PDWORD ReturnLength);
576
577 #define NtQueryInformationProcess _NtQueryInformationProcess
578
579 NTSTATUS (NTAPI *_NtQuerySystemInformation) (
580 ULONG SystemInformationClass,
581 PVOID SystemInformation,
582 ULONG SystemInformationLength,
583 PULONG ReturnLength);
584
585 #define NtQuerySystemInformation _NtQuerySystemInformation
586
587 NTSTATUS (NTAPI *_NtSetInformationProcess) (
588 HANDLE ProcessHandle,
589 DWORD ProcessInformationClass,
590 PVOID ProcessInformation,
591 DWORD ProcessInformationLength);
592
593 #define NtSetInformationProcess _NtSetInformationProcess
594
595 PSTR (NTAPI * _RtlIpv4AddressToStringA) (
596 struct in_addr *Addr,
597 PSTR S);
598
599 #define RtlIpv4AddressToStringA _RtlIpv4AddressToStringA
600
601 PSTR (NTAPI * _RtlIpv6AddressToStringA) (
602 struct in6_addr *Addr,
603 PSTR P);
604
605 #define RtlIpv6AddressToStringA _RtlIpv6AddressToStringA
606
607 DWORD (WINAPI * _GetExtendedTcpTable) (
608 PVOID pTcpTable,
609 PDWORD pdwSize,
610 BOOL bOrder,
611 ULONG ulAf,
612 TCP_TABLE_CLASS TableClass,
613 ULONG Reserved);
614
615 #define GetExtendedTcpTable _GetExtendedTcpTable
616
617 DWORD (WINAPI * _GetExtendedUdpTable) (
618 PVOID pUdpTable,
619 PDWORD pdwSize,
620 BOOL bOrder,
621 ULONG ulAf,
622 UDP_TABLE_CLASS TableClass,
623 ULONG Reserved);
624
625 #define GetExtendedUdpTable _GetExtendedUdpTable
626
627 DWORD (CALLBACK *_GetActiveProcessorCount) (
628 WORD GroupNumber);
629
630 #define GetActiveProcessorCount _GetActiveProcessorCount
631
632 BOOL(CALLBACK *_WTSQuerySessionInformationW) (
633 HANDLE hServer,
634 DWORD SessionId,
635 WTS_INFO_CLASS WTSInfoClass,
636 LPWSTR* ppBuffer,
637 DWORD* pBytesReturned
638 );
639
640 #define WTSQuerySessionInformationW _WTSQuerySessionInformationW
641
642 BOOL(CALLBACK *_WTSEnumerateSessionsW)(
643 HANDLE hServer,
644 DWORD Reserved,
645 DWORD Version,
646 PWTS_SESSION_INFO* ppSessionInfo,
647 DWORD* pCount
648 );
649
650 #define WTSEnumerateSessionsW _WTSEnumerateSessionsW
651
652 VOID(CALLBACK *_WTSFreeMemory)(
653 IN PVOID pMemory
654 );
655
656 #define WTSFreeMemory _WTSFreeMemory
657
658 ULONGLONG (CALLBACK *_GetTickCount64) (
659 void);
660
661 #define GetTickCount64 _GetTickCount64
662
663 VOID(CALLBACK *_QueryInterruptTime) (
664 PULONGLONG lpInterruptTime
665 );
666
667 #define QueryInterruptTime _QueryInterruptTime
668
669 NTSTATUS (NTAPI *_NtQueryObject) (
670 HANDLE Handle,
671 OBJECT_INFORMATION_CLASS ObjectInformationClass,
672 PVOID ObjectInformation,
673 ULONG ObjectInformationLength,
674 PULONG ReturnLength);
675
676 #define NtQueryObject _NtQueryObject
677
678 NTSTATUS (WINAPI *_RtlGetVersion) (
679 PRTL_OSVERSIONINFOW lpVersionInformation
680 );
681
682 #define RtlGetVersion _RtlGetVersion
683
684 NTSTATUS (WINAPI *_NtResumeProcess) (
685 HANDLE hProcess
686 );
687
688 #define NtResumeProcess _NtResumeProcess
689
690 NTSTATUS (WINAPI *_NtSuspendProcess) (
691 HANDLE hProcess
692 );
693
694 #define NtSuspendProcess _NtSuspendProcess
695
696 NTSTATUS (NTAPI *_NtQueryVirtualMemory) (
697 HANDLE ProcessHandle,
698 PVOID BaseAddress,
699 int MemoryInformationClass,
700 PVOID MemoryInformation,
701 SIZE_T MemoryInformationLength,
702 PSIZE_T ReturnLength
703 );
704
705 #define NtQueryVirtualMemory _NtQueryVirtualMemory
706
707 ULONG (WINAPI *_RtlNtStatusToDosErrorNoTeb) (
708 NTSTATUS status
709 );
710
711 #define RtlNtStatusToDosErrorNoTeb _RtlNtStatusToDosErrorNoTeb
712
713 #endif // __NTEXTAPI_H__