-
Notifications
You must be signed in to change notification settings - Fork 0
/
shundoc.h
690 lines (619 loc) · 20.5 KB
/
shundoc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
//+-------------------------------------------------------------------------
//
// TaskMan - NT TaskManager
// Copyright (C) Microsoft
//
// File: shundoc.h
//
// History: Oct-11-24 aubymori Created
//
//--------------------------------------------------------------------------
#pragma once
#include "precomp.h"
//
// Macros
//
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
//
// Function definitions
//
// Needed for RunFileDlg
#define RFD_NOBROWSE 0x00000001
#define RFD_NODEFFILE 0x00000002
#define RFD_USEFULLPATHDIR 0x00000004
#define RFD_NOSHOWOPEN 0x00000008
#define RFD_WOW_APP 0x00000010
#define RFD_NOSEPMEMORY_BOX 0x00000020
extern int (WINAPI *RunFileDlg)(HWND hwnd, HICON hIcon, LPCWSTR pszWorkingDir, LPCWSTR pszTitle,
LPCWSTR pszPrompt, DWORD dwFlags);
extern BOOL (WINAPI *SHTestTokenPrivilegeW)(HANDLE hToken, LPCWSTR pszPrivilegeName);
extern HRESULT (WINAPI *SHGetUserDisplayName)(LPWSTR pszDisplayName, PULONG uLen);
extern NTSTATUS (NTAPI *NtInitiatePowerAction)(
IN POWER_ACTION SystemAction,
IN SYSTEM_POWER_STATE MinSystemState,
IN ULONG Flags,
IN BOOLEAN Asynchronous
);
typedef LONG KPRIORITY;
typedef struct _SYSTEM_PERFORMANCE_INFORMATION
{
__int64 IdleProcessTime;
__int64 IoReadTransferCount;
__int64 IoWriteTransferCount;
__int64 IoOtherTransferCount;
ULONG IoReadOperationCount;
ULONG IoWriteOperationCount;
ULONG IoOtherOperationCount;
ULONG AvailablePages;
ULONG CommittedPages;
ULONG CommitLimit;
ULONG PeakCommitment;
ULONG PageFaultCount;
ULONG CopyOnWriteCount;
ULONG TransitionCount;
ULONG CacheTransitionCount;
ULONG DemandZeroCount;
ULONG PageReadCount;
ULONG PageReadIoCount;
ULONG CacheReadCount;
ULONG CacheIoCount;
ULONG DirtyPagesWriteCount;
ULONG DirtyWriteIoCount;
ULONG MappedPagesWriteCount;
ULONG MappedWriteIoCount;
ULONG PagedPoolPages;
ULONG NonPagedPoolPages;
ULONG PagedPoolAllocs;
ULONG PagedPoolFrees;
ULONG NonPagedPoolAllocs;
ULONG NonPagedPoolFrees;
ULONG FreeSystemPtes;
ULONG ResidentSystemCodePage;
ULONG TotalSystemDriverPages;
ULONG TotalSystemCodePages;
ULONG NonPagedPoolLookasideHits;
ULONG PagedPoolLookasideHits;
ULONG AvailablePagedPoolPages;
ULONG ResidentSystemCachePage;
ULONG ResidentPagedPoolPage;
ULONG ResidentSystemDriverPage;
ULONG CcFastReadNoWait;
ULONG CcFastReadWait;
ULONG CcFastReadResourceMiss;
ULONG CcFastReadNotPossible;
ULONG CcFastMdlReadNoWait;
ULONG CcFastMdlReadWait;
ULONG CcFastMdlReadResourceMiss;
ULONG CcFastMdlReadNotPossible;
ULONG CcMapDataNoWait;
ULONG CcMapDataWait;
ULONG CcMapDataNoWaitMiss;
ULONG CcMapDataWaitMiss;
ULONG CcPinMappedDataCount;
ULONG CcPinReadNoWait;
ULONG CcPinReadWait;
ULONG CcPinReadNoWaitMiss;
ULONG CcPinReadWaitMiss;
ULONG CcCopyReadNoWait;
ULONG CcCopyReadWait;
ULONG CcCopyReadNoWaitMiss;
ULONG CcCopyReadWaitMiss;
ULONG CcMdlReadNoWait;
ULONG CcMdlReadWait;
ULONG CcMdlReadNoWaitMiss;
ULONG CcMdlReadWaitMiss;
ULONG CcReadAheadIos;
ULONG CcLazyWriteIos;
ULONG CcLazyWritePages;
ULONG CcDataFlushes;
ULONG CcDataPages;
ULONG ContextSwitches;
ULONG FirstLevelTbFills;
ULONG SecondLevelTbFills;
ULONG SystemCalls;
} SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
typedef struct _SYSTEM_BASIC_INFORMATION
{
ULONG Reserved;
ULONG TimerResolution;
ULONG PageSize;
ULONG NumberOfPhysicalPages;
ULONG LowestPhysicalPageNumber;
ULONG HighestPhysicalPageNumber;
ULONG AllocationGranularity;
ULONG MinimumUserModeAddress;
ULONG MaximumUserModeAddress;
KAFFINITY ActiveProcessorsAffinityMask;
// Expects a 40-byte struct but I legit cannot find one in the src
PVOID Dummy;
CCHAR NumberOfProcessors;
} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
typedef enum _SYSTEM_INFORMATION_CLASS
{
SystemBasicInformation,
SystemProcessorInformation, // obsolete...delete
SystemPerformanceInformation,
SystemTimeOfDayInformation,
SystemPathInformation,
SystemProcessInformation,
SystemCallCountInformation,
SystemDeviceInformation,
SystemProcessorPerformanceInformation,
SystemFlagsInformation,
SystemCallTimeInformation,
SystemModuleInformation,
SystemLocksInformation,
SystemStackTraceInformation,
SystemPagedPoolInformation,
SystemNonPagedPoolInformation,
SystemHandleInformation,
SystemObjectInformation,
SystemPageFileInformation,
SystemVdmInstemulInformation,
SystemVdmBopInformation,
SystemFileCacheInformation,
SystemPoolTagInformation,
SystemInterruptInformation,
SystemDpcBehaviorInformation,
SystemFullMemoryInformation,
SystemLoadGdiDriverInformation,
SystemUnloadGdiDriverInformation,
SystemTimeAdjustmentInformation,
SystemSummaryMemoryInformation,
SystemMirrorMemoryInformation,
SystemPerformanceTraceInformation,
SystemObsolete0,
SystemExceptionInformation,
SystemCrashDumpStateInformation,
SystemKernelDebuggerInformation,
SystemContextSwitchInformation,
SystemRegistryQuotaInformation,
SystemExtendServiceTableInformation,
SystemPrioritySeperation,
SystemVerifierAddDriverInformation,
SystemVerifierRemoveDriverInformation,
SystemProcessorIdleInformation,
SystemLegacyDriverInformation,
SystemCurrentTimeZoneInformation,
SystemLookasideInformation,
SystemTimeSlipNotification,
SystemSessionCreate,
SystemSessionDetach,
SystemSessionInformation,
SystemRangeStartInformation,
SystemVerifierInformation,
SystemVerifierThunkExtend,
SystemSessionProcessInformation,
SystemLoadGdiDriverInSystemSpace,
SystemNumaProcessorMap,
SystemPrefetcherInformation,
SystemExtendedProcessInformation,
SystemRecommendedSharedDataAlignment,
SystemComPlusPackage,
SystemNumaAvailableMemory,
SystemProcessorPowerInformation,
SystemEmulationBasicInformation,
SystemEmulationProcessorInformation,
SystemExtendedHandleInformation,
SystemLostDelayedWriteInformation,
SystemBigPoolInformation,
SystemSessionPoolTagInformation,
SystemSessionMappedViewInformation,
SystemHotpatchInformation,
SystemObjectSecurityMode,
SystemWatchdogTimerHandler,
SystemWatchdogTimerInformation,
SystemLogicalProcessorInformation,
MaxSystemInfoClass // MaxSystemInfoClass should always be the last enum
} SYSTEM_INFORMATION_CLASS;
extern NTSTATUS (NTAPI *NtQuerySystemInformation)(
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
OUT PVOID SystemInformation,
IN ULONG SystemInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
typedef enum _SHUTDOWN_ACTION
{
ShutdownNoReboot,
ShutdownReboot,
ShutdownPowerOff
} SHUTDOWN_ACTION;
typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
{
__int64 IdleTime;
__int64 KernelTime;
__int64 UserTime;
__int64 DpcTime; // DEVL only
__int64 InterruptTime; // DEVL only
ULONG InterruptCount;
} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
typedef struct _UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING, *PUNICODE_STRING;
typedef struct _SYSTEM_PROCESS_INFORMATION
{
ULONG NextEntryOffset;
ULONG NumberOfThreads;
__int64 SpareLi1;
__int64 SpareLi2;
__int64 SpareLi3;
__int64 CreateTime;
__int64 UserTime;
__int64 KernelTime;
UNICODE_STRING ImageName;
KPRIORITY BasePriority;
HANDLE UniqueProcessId;
HANDLE InheritedFromUniqueProcessId;
ULONG HandleCount;
ULONG SessionId;
ULONG_PTR PageDirectoryBase;
SIZE_T PeakVirtualSize;
SIZE_T VirtualSize;
ULONG PageFaultCount;
SIZE_T PeakWorkingSetSize;
SIZE_T WorkingSetSize;
SIZE_T QuotaPeakPagedPoolUsage;
SIZE_T QuotaPagedPoolUsage;
SIZE_T QuotaPeakNonPagedPoolUsage;
SIZE_T QuotaNonPagedPoolUsage;
SIZE_T PagefileUsage;
SIZE_T PeakPagefileUsage;
SIZE_T PrivatePageCount;
__int64 ReadOperationCount;
__int64 WriteOperationCount;
__int64 OtherOperationCount;
__int64 ReadTransferCount;
__int64 WriteTransferCount;
__int64 OtherTransferCount;
} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
typedef struct _SYSTEM_FILECACHE_INFORMATION
{
SIZE_T CurrentSize;
SIZE_T PeakSize;
ULONG PageFaultCount;
SIZE_T MinimumWorkingSet;
SIZE_T MaximumWorkingSet;
SIZE_T CurrentSizeIncludingTransitionInPages;
SIZE_T PeakSizeIncludingTransitionInPages;
ULONG TransitionRePurposeCount;
ULONG spare[1];
} SYSTEM_FILECACHE_INFORMATION, *PSYSTEM_FILECACHE_INFORMATION;
typedef struct _CLIENT_ID
{
HANDLE UniqueProcess;
HANDLE UniqueThread;
} CLIENT_ID;
typedef CLIENT_ID *PCLIENT_ID;
typedef struct _TIME_FIELDS
{
CSHORT Year; // range [1601...]
CSHORT Month; // range [1..12]
CSHORT Day; // range [1..31]
CSHORT Hour; // range [0..23]
CSHORT Minute; // range [0..59]
CSHORT Second; // range [0..59]
CSHORT Milliseconds;// range [0..999]
CSHORT Weekday; // range [0..6] == [Sunday..Saturday]
} TIME_FIELDS;
typedef TIME_FIELDS *PTIME_FIELDS;
extern NTSTATUS (NTAPI *NtShutdownSystem)(
IN SHUTDOWN_ACTION Action
);
typedef struct _OBJECT_ATTRIBUTES
{
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
/* Helper Macro */
#define InitializeObjectAttributes(p,n,a,r,s) { \
(p)->Length = sizeof(OBJECT_ATTRIBUTES); \
(p)->RootDirectory = (r); \
(p)->Attributes = (a); \
(p)->ObjectName = (n); \
(p)->SecurityDescriptor = (s); \
(p)->SecurityQualityOfService = NULL; \
extern NTSTATUS (NTAPI *NtOpenThread)(
_Out_ PHANDLE ThreadHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ PCLIENT_ID ClientId
);
extern NTSTATUS (NTAPI *NtClose)(
_In_ HANDLE Handle
);
#define PASSWORD_LENGTH 14
#define LOGONID_CURRENT ((ULONG)-1)
extern BOOLEAN (WINAPI *WinStationGetProcessSid)(
HANDLE hServer,
DWORD ProcessId,
FILETIME ProcessStartTime,
PBYTE pProcessUserSid,
DWORD *pdwSidSize
);
extern BOOLEAN (WINAPI *WinStationConnectW)(
HANDLE hServer,
ULONG LogonId,
ULONG TargetLogonId,
PWCHAR pPassword,
BOOLEAN bWait
);
#define DIRECTORY_LENGTH 256
#define INITIALPROGRAM_LENGTH 256
#define CALLBACK_LENGTH 50
#define NASIFILESERVER_LENGTH 47
/*
* Callback options
*/
typedef enum _CALLBACKCLASS
{
Callback_Disable,
Callback_Roving,
Callback_Fixed,
} CALLBACKCLASS;
/*
* Shadow options
*/
typedef enum _SHADOWCLASS
{
Shadow_Disable,
Shadow_EnableInputNotify,
Shadow_EnableInputNoNotify,
Shadow_EnableNoInputNotify,
Shadow_EnableNoInputNoNotify,
} SHADOWCLASS;
#define MAX_BR_NAME 65 // maximum length of browser name (including null)
typedef WCHAR APPLICATIONNAMEW[MAX_BR_NAME];
/*
* User Configuration data
*/
typedef struct _USERCONFIGW
{
/* if flag is set inherit parameter from user or client configuration */
ULONG fInheritAutoLogon : 1;
ULONG fInheritResetBroken : 1;
ULONG fInheritReconnectSame : 1;
ULONG fInheritInitialProgram : 1;
ULONG fInheritCallback : 1;
ULONG fInheritCallbackNumber : 1;
ULONG fInheritShadow : 1;
ULONG fInheritMaxSessionTime : 1;
ULONG fInheritMaxDisconnectionTime : 1;
ULONG fInheritMaxIdleTime : 1;
ULONG fInheritAutoClient : 1;
ULONG fInheritSecurity : 1;
ULONG fPromptForPassword : 1; // fInheritAutoLogon
ULONG fResetBroken : 1;
ULONG fReconnectSame : 1;
ULONG fLogonDisabled : 1;
ULONG fWallPaperDisabled : 1;
ULONG fAutoClientDrives : 1;
ULONG fAutoClientLpts : 1;
ULONG fForceClientLptDef : 1;
ULONG fRequireEncryption : 1;
ULONG fDisableEncryption : 1;
ULONG fUnused1 : 1; // old fDisableIniFileMapping
ULONG fHomeDirectoryMapRoot : 1;
ULONG fUseDefaultGina : 1;
ULONG fCursorBlinkDisabled : 1;
ULONG fPublishedApp : 1;
ULONG fHideTitleBar : 1;
ULONG fMaximize : 1;
ULONG fDisableCpm : 1;
ULONG fDisableCdm : 1;
ULONG fDisableCcm : 1;
ULONG fDisableLPT : 1;
ULONG fDisableClip : 1;
ULONG fDisableExe : 1;
ULONG fDisableCam : 1;
ULONG fDisableAutoReconnect : 1;
/* fInheritColorDepth */
ULONG ColorDepth : 3;
//NA 2/19/01
ULONG fInheritColorDepth : 1;
//
//Different error flags
//
ULONG fErrorInvalidProfile : 1; //Set if WFProfilePath, WFHomeDir, or WFHomeDirDrive are invalid (too long).
/* fInheritAutoLogon */
WCHAR UserName[USERNAME_LENGTH + 1];
WCHAR Domain[DOMAIN_LENGTH + 1];
WCHAR Password[PASSWORD_LENGTH + 1];
/* fInheritInitialProgram */
WCHAR WorkDirectory[DIRECTORY_LENGTH + 1];
WCHAR InitialProgram[INITIALPROGRAM_LENGTH + 1];
/* fInheritCallback */
WCHAR CallbackNumber[CALLBACK_LENGTH + 1];
CALLBACKCLASS Callback;
/* fInheritShadow */
SHADOWCLASS Shadow;
ULONG MaxConnectionTime;
ULONG MaxDisconnectionTime;
ULONG MaxIdleTime;
ULONG KeyboardLayout; // 0 = inherit
/* fInheritSecurity */
BYTE MinEncryptionLevel;
WCHAR NWLogonServer[NASIFILESERVER_LENGTH + 1];
APPLICATIONNAMEW PublishedName;
/* WinFrame Profile Path - Overrides standard profile path */
WCHAR WFProfilePath[DIRECTORY_LENGTH + 1];
/* WinFrame Home Directory - Overrides standard Home Directory */
WCHAR WFHomeDir[DIRECTORY_LENGTH + 1];
/* WinFrame Home Directory Drive - Overrides standard Home Directory Drive*/
WCHAR WFHomeDirDrive[4];
} USERCONFIGW, *PUSERCONFIGW;
#define WINSTATIONCOMMENT_LENGTH 60
typedef struct _WINSTATIONCONFIGW
{
WCHAR Comment[WINSTATIONCOMMENT_LENGTH + 1];
USERCONFIGW User;
char OEMId[4]; // WinFrame Server OEM Id
} WINSTATIONCONFIGW, *PWINSTATIONCONFIGW;
typedef enum _WINSTATIONINFOCLASS
{
WinStationCreateData, // query WinStation create data
WinStationConfiguration, // query/set WinStation parameters
WinStationPdParams, // query/set PD parameters
WinStationWd, // query WD config (only one can be loaded)
WinStationPd, // query PD config (many can be loaded)
WinStationPrinter, // query/set LPT mapping to printer queues
WinStationClient, // query information about client
WinStationModules, // query information about all client modules
WinStationInformation, // query information about WinStation
WinStationTrace, // enable/disable winstation tracing
WinStationBeep, // beep the WinStation
WinStationEncryptionOff, // turn off encryption
WinStationEncryptionPerm, // encryption is permanent on
WinStationNtSecurity, // select winlogon security desktop
WinStationUserToken, // User token
WinStationUnused1, // *** AVAILABLE *** (old IniMapping)
WinStationVideoData, // query hres, vres, color depth
WinStationInitialProgram, // Identify Initial Program
WinStationCd, // query CD config (only one can be loaded)
WinStationSystemTrace, // enable/disable system tracing
WinStationVirtualData, // query client virtual data
WinStationClientData, // send data to client
WinStationSecureDesktopEnter, // turn encryption on, if enabled
WinStationSecureDesktopExit, // turn encryption off, if enabled
WinStationLoadBalanceSessionTarget, // Load balance info from redirected client.
WinStationLoadIndicator, // query load capacity information
WinStationShadowInfo, // query/set Shadow state & parameters
WinStationDigProductId, // get the outermost digital product id, the client's product id, and the current product id
WinStationLockedState, // winlogon sets this for notifing apps/services.
WinStationRemoteAddress, // Query client IP address
WinStationIdleTime, // Query for how much time the winstation is idle
WinStationLastReconnectType, // If last reconnect for this winstation was manual or auto reconnect.
WinStationDisallowAutoReconnect, // Allow/Disallow AutoReconnect for this WinStation
WinStationMprNotifyInfo, // Mprnotify info from Winlogon for notifying 3rd party network providers
WinStationExecSrvSystemPipe, // Exec Srv System Pipe name
WinStationSDRedirectedSmartCardLogon, // Was this a Session Directory redirected SmartCard logon
WinStationIsAdminLoggedOn // Is the currently logged on user an administrator ?
} WINSTATIONINFOCLASS;
typedef struct _PEB_LDR_DATA
{
BYTE Reserved1[8];
PVOID Reserved2[3];
LIST_ENTRY InMemoryOrderModuleList;
} PEB_LDR_DATA, *PPEB_LDR_DATA;
typedef struct _RTL_USER_PROCESS_PARAMETERS
{
BYTE Reserved1[16];
PVOID Reserved2[10];
UNICODE_STRING ImagePathName;
UNICODE_STRING CommandLine;
} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
typedef VOID(NTAPI *PPS_POST_PROCESS_INIT_ROUTINE)(VOID);
typedef struct _PEB
{
BYTE Reserved1[2];
BYTE BeingDebugged;
BYTE Reserved2[1];
PVOID Reserved3[2];
PPEB_LDR_DATA Ldr;
PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
PVOID Reserved4[3];
PVOID AtlThunkSListPtr;
PVOID Reserved5;
ULONG Reserved6;
PVOID Reserved7;
ULONG Reserved8;
ULONG AtlThunkSListPtr32;
PVOID Reserved9[45];
BYTE Reserved10[96];
PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine;
BYTE Reserved11[128];
PVOID Reserved12[1];
ULONG SessionId;
} PEB, *PPEB;
typedef struct _PROCESS_BASIC_INFORMATION
{
NTSTATUS ExitStatus;
PPEB PebBaseAddress;
ULONG_PTR AffinityMask;
KPRIORITY BasePriority;
ULONG_PTR UniqueProcessId;
ULONG_PTR InheritedFromUniqueProcessId;
} PROCESS_BASIC_INFORMATION;
extern BOOLEAN (WINAPI *WinStationQueryInformationW)(
HANDLE hServer,
ULONG LogonId,
WINSTATIONINFOCLASS WinStationInformationClass,
PVOID pWinStationInformation,
ULONG WinStationInformationLength,
PULONG pReturnLength
);
extern BOOLEAN (WINAPI *WinStationShadow)(
HANDLE hServer,
PWSTR pTargetServerName,
ULONG TargetLogonId,
BYTE HotkeyVk,
USHORT HotkeyModifiers
);
extern VOID (NTAPI *RtlTimeToElapsedTimeFields)(
_In_ __int64 * Time,
_Out_ PTIME_FIELDS TimeFields
);
extern NTSTATUS (NTAPI *RtlGetVersion)(PRTL_OSVERSIONINFOW lpVersionInformation);
typedef enum _PROCESSINFOCLASS
{
ProcessBasicInformation,
ProcessQuotaLimits,
ProcessIoCounters,
ProcessVmCounters,
ProcessTimes,
ProcessBasePriority,
ProcessRaisePriority,
ProcessDebugPort,
ProcessExceptionPort,
ProcessAccessToken,
ProcessLdtInformation,
ProcessLdtSize,
ProcessDefaultHardErrorMode,
ProcessIoPortHandlers, // Note: this is kernel mode only
ProcessPooledUsageAndLimits,
ProcessWorkingSetWatch,
ProcessUserModeIOPL,
ProcessEnableAlignmentFaultFixup,
ProcessPriorityClass,
ProcessWx86Information,
ProcessHandleCount,
ProcessAffinityMask,
ProcessPriorityBoost,
ProcessDeviceMap,
ProcessSessionInformation,
ProcessForegroundInformation,
ProcessWow64Information,
ProcessImageFileName,
ProcessLUIDDeviceMapsEnabled,
ProcessBreakOnTermination,
ProcessDebugObjectHandle,
ProcessDebugFlags,
ProcessHandleTracing,
MaxProcessInfoClass // MaxProcessInfoClass should always be the last enum
} PROCESSINFOCLASS;
extern NTSTATUS (NTAPI *NtQueryInformationProcess)(
IN HANDLE ProcessHandle,
IN PROCESSINFOCLASS ProcessInformationClass,
OUT PVOID ProcessInformation,
IN ULONG ProcessInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
extern BOOL (WINAPI *EndTask)(HWND hWnd, BOOL fShutDown, BOOL fForce);
extern void (WINAPI *CachedGetUserFromSid)(PSID pSid, PWCHAR pUserName, PULONG cbUserName);
extern void (WINAPI *CurrentDateTimeString)(LPWSTR pString);
#define GMI_DOCKSTATE 0x0000
// Return values for SHGetMachineInfo(GMI_DOCKSTATE)
#define GMID_NOTDOCKABLE 0 // Cannot be docked
#define GMID_UNDOCKED 1 // Is undocked
#define GMID_DOCKED 2 // Is docked
extern DWORD_PTR (WINAPI *SHGetMachineInfo)(UINT gmi);
//
// Function loader
//
bool SHUndocInit(void);