-
Notifications
You must be signed in to change notification settings - Fork 0
/
Win32API_PtrSafe.TXT
16004 lines (13496 loc) · 676 KB
/
Win32API_PtrSafe.TXT
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
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
' -------------------------------------------------------------------------
'
' Win32API_PtrSafe.TXT -- Declare statements for
' Visual Basic for Applications and Microsoft Office 2010
'
' Copyright (C) 2010 Microsoft Corporation.
' All rights reserved.
'
'
' This file contains Declare statements for many functions in the
' Microsoft Windows API for use with Visual Basic for Applications (VBA)
' and Microsoft Office 2010 on 32-bit (x86) and 64-bit (x64) platforms.
'
' The declare statements in this file are not compatible with VB6 or
' previous versions of Microsoft Office. Refer to the Microsoft Windows
' Programmer's Reference for further information on the use of Windows APIs.
'
' You may use, modify, reproduce, and distribute this file (and/or any
' modified version), for use with any of the Microsoft technologies
' described above. THIS FILE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY
' KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF
' FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
' -------------------------------------------------------------------------
' Type definitions for Windows' basic types.
Const ANYSIZE_ARRAY = 1
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type RECTL
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type POINTAPI
x As Long
y As Long
End Type
Type POINTL
x As Long
y As Long
End Type
Type Size
cx As Long
cy As Long
End Type
Type POINTS
x As Integer
y As Integer
End Type
Type MSG
hwnd As LongPtr
message As Long
wParam As LongPtr
lParam As LongPtr
time As Long
pt As POINTAPI
End Type
Const DELETE = &H10000
Const READ_CONTROL = &H20000
Const WRITE_DAC = &H40000
Const WRITE_OWNER = &H80000
Const SYNCHRONIZE = &H100000
Const STANDARD_RIGHTS_READ = (READ_CONTROL)
Const STANDARD_RIGHTS_WRITE = (READ_CONTROL)
Const STANDARD_RIGHTS_EXECUTE = (READ_CONTROL)
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const STANDARD_RIGHTS_ALL = &H1F0000
Const SPECIFIC_RIGHTS_ALL = &HFFFF&
Type SID_IDENTIFIER_AUTHORITY
Value(0 To 5) As Byte
End Type
Const SID_REVISION = (1) ' Current revision level
Const SID_MAX_SUB_AUTHORITIES = (15)
Const SID_RECOMMENDED_SUB_AUTHORITIES = (1) ' Will change to around 6 in a future release.
Const SidTypeUser = 1
Const SidTypeGroup = 2
Const SidTypeDomain = 3
Const SidTypeAlias = 4
Const SidTypeWellKnownGroup = 5
Const SidTypeDeletedAccount = 6
Const SidTypeInvalid = 7
Const SidTypeUnknown = 8
Type SID_AND_ATTRIBUTES
Sid As LongPtr
Attributes As Long
End Type
' ///////////////////////////////////////////////////////////////////////////
' //
' Universal well-known SIDs //
' //
' Null SID S-1-0-0 //
' World S-1-1-0 //
' Local S-1-2-0 //
' Creator Owner ID S-1-3-0 //
' Creator Group ID S-1-3-1 //
' //
' (Non-unique IDs) S-1-4 //
' //
' ///////////////////////////////////////////////////////////////////////////
Const SECURITY_NULL_RID = &H0
Const SECURITY_WORLD_RID = &H0
Const SECURITY_LOCAL_RID = &H0
Const SECURITY_CREATOR_OWNER_RID = &H0
Const SECURITY_CREATOR_GROUP_RID = &H1
' ///////////////////////////////////////////////////////////////////////////
' //
' NT well-known SIDs //
' //
' NT Authority S-1-5 //
' Dialup S-1-5-1 //
' //
' Network S-1-5-2 //
' Batch S-1-5-3 //
' Interactive S-1-5-4 //
' Service S-1-5-6 //
' AnonymousLogon S-1-5-7 (aka null logon session) //
' //
' (Logon IDs) S-1-5-5-X-Y //
' //
' (NT non-unique IDs) S-1-5-0x15-... //
' //
' (Built-in domain) s-1-5-0x20 //
' //
' ///////////////////////////////////////////////////////////////////////////
Const SECURITY_DIALUP_RID = &H1
Const SECURITY_NETWORK_RID = &H2
Const SECURITY_BATCH_RID = &H3
Const SECURITY_INTERACTIVE_RID = &H4
Const SECURITY_SERVICE_RID = &H6
Const SECURITY_ANONYMOUS_LOGON_RID = &H7
Const SECURITY_LOGON_IDS_RID = &H5
Const SECURITY_LOCAL_SYSTEM_RID = &H12
Const SECURITY_NT_NON_UNIQUE = &H15
Const SECURITY_BUILTIN_DOMAIN_RID = &H20
' ///////////////////////////////////////////////////////////////////////////
' //
' well-known domain relative sub-authority values (RIDs)... //
' //
' ///////////////////////////////////////////////////////////////////////////
Const DOMAIN_USER_RID_ADMIN = &H1F4
Const DOMAIN_USER_RID_GUEST = &H1F5
Const DOMAIN_GROUP_RID_ADMINS = &H200
Const DOMAIN_GROUP_RID_USERS = &H201
Const DOMAIN_GROUP_RID_GUESTS = &H202
Const DOMAIN_ALIAS_RID_ADMINS = &H220
Const DOMAIN_ALIAS_RID_USERS = &H221
Const DOMAIN_ALIAS_RID_GUESTS = &H222
Const DOMAIN_ALIAS_RID_POWER_USERS = &H223
Const DOMAIN_ALIAS_RID_ACCOUNT_OPS = &H224
Const DOMAIN_ALIAS_RID_SYSTEM_OPS = &H225
Const DOMAIN_ALIAS_RID_PRINT_OPS = &H226
Const DOMAIN_ALIAS_RID_BACKUP_OPS = &H227
Const DOMAIN_ALIAS_RID_REPLICATOR = &H228
' Allocate the System Luid. The first 1000 LUIDs are reserved.
' Use #999 here0x3E7 = 999)
' end_ntifs
' //////////////////////////////////////////////////////////////////////
' //
' User and Group related SID attributes //
' //
' //////////////////////////////////////////////////////////////////////
' Group attributes
Const SE_GROUP_MANDATORY = &H1
Const SE_GROUP_ENABLED_BY_DEFAULT = &H2
Const SE_GROUP_ENABLED = &H4
Const SE_GROUP_OWNER = &H8
Const SE_GROUP_LOGON_ID = &HC0000000
' User attributes
' (None yet defined.)
' ----------------
' Kernel Section
' ----------------
Const FILE_BEGIN = 0
Const FILE_CURRENT = 1
Const FILE_END = 2
Const FILE_FLAG_WRITE_THROUGH = &H80000000
Const FILE_FLAG_OVERLAPPED = &H40000000
Const FILE_FLAG_NO_BUFFERING = &H20000000
Const FILE_FLAG_RANDOM_ACCESS = &H10000000
Const FILE_FLAG_SEQUENTIAL_SCAN = &H8000000
Const FILE_FLAG_DELETE_ON_CLOSE = &H4000000
Const FILE_FLAG_BACKUP_SEMANTICS = &H2000000
Const FILE_FLAG_POSIX_SEMANTICS = &H1000000
Const CREATE_NEW = 1
Const CREATE_ALWAYS = 2
Const OPEN_EXISTING = 3
Const OPEN_ALWAYS = 4
Const TRUNCATE_EXISTING = 5
' Define the dwOpenMode values for CreateNamedPipe
Const PIPE_ACCESS_INBOUND = &H1
Const PIPE_ACCESS_OUTBOUND = &H2
Const PIPE_ACCESS_DUPLEX = &H3
' Define the Named Pipe End flags for GetNamedPipeInfo
Const PIPE_CLIENT_END = &H0
Const PIPE_SERVER_END = &H1
' Define the dwPipeMode values for CreateNamedPipe
Const PIPE_WAIT = &H0
Const PIPE_NOWAIT = &H1
Const PIPE_READMODE_BYTE = &H0
Const PIPE_READMODE_MESSAGE = &H2
Const PIPE_TYPE_BYTE = &H0
Const PIPE_TYPE_MESSAGE = &H4
' Define the well known values for CreateNamedPipe nMaxInstances
Const PIPE_UNLIMITED_INSTANCES = 255
' Define the Security Quality of Service bits to be passed
' into CreateFile
Const SECURITY_CONTEXT_TRACKING = &H40000
Const SECURITY_EFFECTIVE_ONLY = &H80000
Const SECURITY_SQOS_PRESENT = &H100000
Const SECURITY_VALID_SQOS_FLAGS = &H1F0000
Type OVERLAPPED
Internal As LongPtr
InternalHigh As LongPtr
offset As Long
OffsetHigh As Long
hEvent As LongPtr
End Type
Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As LongPtr
bInheritHandle As Long
End Type
Type PROCESS_INFORMATION
hProcess As LongPtr
hThread As LongPtr
dwProcessId As Long
dwThreadId As Long
End Type
Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
' Serial provider type.
Const SP_SERIALCOMM = &H1&
' Provider SubTypes
Const PST_UNSPECIFIED = &H0&
Const PST_RS232 = &H1&
Const PST_PARALLELPORT = &H2&
Const PST_RS422 = &H3&
Const PST_RS423 = &H4&
Const PST_RS449 = &H5&
Const PST_FAX = &H21&
Const PST_SCANNER = &H22&
Const PST_NETWORK_BRIDGE = &H100&
Const PST_LAT = &H101&
Const PST_TCPIP_TELNET = &H102&
Const PST_X25 = &H103&
' Provider capabilities flags.
Const PCF_DTRDSR = &H1&
Const PCF_RTSCTS = &H2&
Const PCF_RLSD = &H4&
Const PCF_PARITY_CHECK = &H8&
Const PCF_XONXOFF = &H10&
Const PCF_SETXCHAR = &H20&
Const PCF_TOTALTIMEOUTS = &H40&
Const PCF_INTTIMEOUTS = &H80&
Const PCF_SPECIALCHARS = &H100&
Const PCF_16BITMODE = &H200&
' Comm provider settable parameters.
Const SP_PARITY = &H1&
Const SP_BAUD = &H2&
Const SP_DATABITS = &H4&
Const SP_STOPBITS = &H8&
Const SP_HANDSHAKING = &H10&
Const SP_PARITY_CHECK = &H20&
Const SP_RLSD = &H40&
' Settable baud rates in the provider.
Const BAUD_075 = &H1&
Const BAUD_110 = &H2&
Const BAUD_134_5 = &H4&
Const BAUD_150 = &H8&
Const BAUD_300 = &H10&
Const BAUD_600 = &H20&
Const BAUD_1200 = &H40&
Const BAUD_1800 = &H80&
Const BAUD_2400 = &H100&
Const BAUD_4800 = &H200&
Const BAUD_7200 = &H400&
Const BAUD_9600 = &H800&
Const BAUD_14400 = &H1000&
Const BAUD_19200 = &H2000&
Const BAUD_38400 = &H4000&
Const BAUD_56K = &H8000&
Const BAUD_128K = &H10000
Const BAUD_115200 = &H20000
Const BAUD_57600 = &H40000
Const BAUD_USER = &H10000000
' Settable Data Bits
Const DATABITS_5 = &H1&
Const DATABITS_6 = &H2&
Const DATABITS_7 = &H4&
Const DATABITS_8 = &H8&
Const DATABITS_16 = &H10&
Const DATABITS_16X = &H20&
' Settable Stop and Parity bits.
Const STOPBITS_10 = &H1&
Const STOPBITS_15 = &H2&
Const STOPBITS_20 = &H4&
Const PARITY_NONE = &H100&
Const PARITY_ODD = &H200&
Const PARITY_EVEN = &H400&
Const PARITY_MARK = &H800&
Const PARITY_SPACE = &H1000&
Type COMMPROP
wPacketLength As Integer
wPacketVersion As Integer
dwServiceMask As Long
dwReserved1 As Long
dwMaxTxQueue As Long
dwMaxRxQueue As Long
dwMaxBaud As Long
dwProvSubType As Long
dwProvCapabilities As Long
dwSettableParams As Long
dwSettableBaud As Long
wSettableData As Integer
wSettableStopParity As Integer
dwCurrentTxQueue As Long
dwCurrentRxQueue As Long
dwProvSpec1 As Long
dwProvSpec2 As Long
wcProvChar(1) As Integer
End Type
'Type COMSTAT
' fCtsHold As Long
' fDsrHold As Long
' fRlsdHold As Long
' fXoffHold As Long
' fXoffSent As Long
' fEof As Long
' fTxim As Long
' fReserved As Long
' cbInQue As Long
' cbOutQue As Long
'End Type
Type COMSTAT
fBitFields As Long 'See Comment in WinAPI.Txt
cbInQue As Long
cbOutQue As Long
End Type
' The eight actual COMSTAT bit-sized data fields within the four bytes of fBitFields can be manipulated by bitwise logical And/Or operations.
' FieldName Bit # Description
' --------- ----- ---------------------------
' fCtsHold 1 Tx waiting for CTS signal
' fDsrHold 2 Tx waiting for DSR signal
' fRlsdHold 3 Tx waiting for RLSD signal
' fXoffHold 4 Tx waiting, XOFF char rec'd
' fXoffSent 5 Tx waiting, XOFF char sent
' fEof 6 EOF character sent
' fTxim 7 character waiting for Tx
' fReserved 8 reserved (25 bits)
' DTR Control Flow Values.
Const DTR_CONTROL_DISABLE = &H0
Const DTR_CONTROL_ENABLE = &H1
Const DTR_CONTROL_HANDSHAKE = &H2
' RTS Control Flow Values
Const RTS_CONTROL_DISABLE = &H0
Const RTS_CONTROL_ENABLE = &H1
Const RTS_CONTROL_HANDSHAKE = &H2
Const RTS_CONTROL_TOGGLE = &H3
'Type DCB
' DCBlength As Long
' BaudRate As Long
' fBinary As Long
' fParity As Long
' fOutxCtsFlow As Long
' fOutxDsrFlow As Long
' fDtrControl As Long
' fDsrSensitivity As Long
' fTXContinueOnXoff As Long
' fOutX As Long
' fInX As Long
' fErrorChar As Long
' fNull As Long
' fRtsControl As Long
' fAbortOnError As Long
' fDummy2 As Long
' wReserved As Integer
' XonLim As Integer
' XoffLim As Integer
' ByteSize As Byte
' Parity As Byte
' StopBits As Byte
' XonChar As Byte
' XoffChar As Byte
' ErrorChar As Byte
' EofChar As Byte
' EvtChar As Byte
'End Type
Type DCB
DCBlength As Long
BaudRate As Long
fBitFields As Long 'See Comments in Win32API.Txt
wReserved As Integer
XonLim As Integer
XoffLim As Integer
ByteSize As Byte
Parity As Byte
StopBits As Byte
XonChar As Byte
XoffChar As Byte
ErrorChar As Byte
EofChar As Byte
EvtChar As Byte
wReserved1 As Integer 'Reserved; Do Not Use
End Type
' The fourteen actual DCB bit-sized data fields within the four bytes of fBitFields can be manipulated by bitwise logical And/Or operations.
' FieldName Bit # Description
' ----------------- ----- ------------------------------
' fBinary 1 binary mode, no EOF check
' fParity 2 enable parity checking
' fOutxCtsFlow 3 CTS output flow control
' fOutxDsrFlow 4 DSR output flow control
' fDtrControl 5 DTR flow control type (2 bits)
' fDsrSensitivity 7 DSR sensitivity
' fTXContinueOnXoff 8 XOFF continues Tx
' fOutX 9 XON/XOFF out flow control
' fInX 10 XON/XOFF in flow control
' fErrorChar 11 enable error replacement
' fNull 12 enable null stripping
' fRtsControl 13 RTS flow control (2 bits)
' fAbortOnError 15 abort reads/writes on error
' fDummy2 16 reserved
Type COMMTIMEOUTS
ReadIntervalTimeout As Long
ReadTotalTimeoutMultiplier As Long
ReadTotalTimeoutConstant As Long
WriteTotalTimeoutMultiplier As Long
WriteTotalTimeoutConstant As Long
End Type
Type SYSTEM_INFO
wProcessorArchitecture As Integer
wReserved As Integer
dwPageSize As Long
lpMinimumApplicationAddress As LongPtr
lpMaximumApplicationAddress As LongPtr
dwActiveProcessorMask As LongPtr
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
wProcessorLevel As Integer
wProcessorRevision As Integer
End Type
' Global Memory Flags
Const GMEM_FIXED = &H0
Const GMEM_MOVEABLE = &H2
Const GMEM_NOCOMPACT = &H10
Const GMEM_NODISCARD = &H20
Const GMEM_ZEROINIT = &H40
Const GMEM_MODIFY = &H80
Const GMEM_DISCARDABLE = &H100
Const GMEM_NOT_BANKED = &H1000
Const GMEM_SHARE = &H2000
Const GMEM_DDESHARE = &H2000
Const GMEM_NOTIFY = &H4000
Const GMEM_LOWER = GMEM_NOT_BANKED
Const GMEM_VALID_FLAGS = &H7F72
Const GMEM_INVALID_HANDLE = &H8000&
Const GHND = (GMEM_MOVEABLE Or GMEM_ZEROINIT)
Const GPTR = (GMEM_FIXED Or GMEM_ZEROINIT)
' Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE)
Const GMEM_DISCARDED = &H4000
Const GMEM_LOCKCOUNT = &HFF
Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As LongPtr
dwAvailPhys As LongPtr
dwTotalPageFile As LongPtr
dwAvailPageFile As LongPtr
dwTotalVirtual As LongPtr
dwAvailVirtual As LongPtr
End Type
' Local Memory Flags
Const LMEM_FIXED = &H0
Const LMEM_MOVEABLE = &H2
Const LMEM_NOCOMPACT = &H10
Const LMEM_NODISCARD = &H20
Const LMEM_ZEROINIT = &H40
Const LMEM_MODIFY = &H80
Const LMEM_DISCARDABLE = &HF00
Const LMEM_VALID_FLAGS = &HF72
Const LMEM_INVALID_HANDLE = &H8000&
Const LHND = (LMEM_MOVEABLE + LMEM_ZEROINIT)
Const LPTR = (LMEM_FIXED + LMEM_ZEROINIT)
Const NONZEROLHND = (LMEM_MOVEABLE)
Const NONZEROLPTR = (LMEM_FIXED)
' Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)
Const LMEM_DISCARDED = &H4000
Const LMEM_LOCKCOUNT = &HFF
' dwCreationFlag values
Const DEBUG_PROCESS = &H1
Const DEBUG_ONLY_THIS_PROCESS = &H2
Const CREATE_SUSPENDED = &H4
Const DETACHED_PROCESS = &H8
Const CREATE_NEW_CONSOLE = &H10
Const NORMAL_PRIORITY_CLASS = &H20
Const IDLE_PRIORITY_CLASS = &H40
Const HIGH_PRIORITY_CLASS = &H80
Const REALTIME_PRIORITY_CLASS = &H100
Const CREATE_NEW_PROCESS_GROUP = &H200
Const CREATE_NO_WINDOW = &H8000000
Const PROFILE_USER = &H10000000
Const PROFILE_KERNEL = &H20000000
Const PROFILE_SERVER = &H40000000
Const MAXLONG = &H7FFFFFFF
Const THREAD_BASE_PRIORITY_MIN = -2
Const THREAD_BASE_PRIORITY_MAX = 2
Const THREAD_BASE_PRIORITY_LOWRT = 15
Const THREAD_BASE_PRIORITY_IDLE = -15
Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
Const THREAD_PRIORITY_BELOW_NORMAL = (THREAD_PRIORITY_LOWEST + 1)
Const THREAD_PRIORITY_NORMAL = 0
Const THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
Const THREAD_PRIORITY_ABOVE_NORMAL = (THREAD_PRIORITY_HIGHEST - 1)
Const THREAD_PRIORITY_ERROR_RETURN = (MAXLONG)
Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
Const THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE
' ++ BUILD Version: 0093 Increment this if a change has global effects
' Copyright (c) 1990-1995 Microsoft Corporation
' Module Name:
' winnt.h
' Abstract:
' This module defines the 32-Bit Windows types and constants that are
' defined by NT, but exposed through the Win32 API.
' Revision History:
Const APPLICATION_ERROR_MASK = &H20000000
Const ERROR_SEVERITY_SUCCESS = &H0
Const ERROR_SEVERITY_INFORMATIONAL = &H40000000
Const ERROR_SEVERITY_WARNING = &H80000000
Const ERROR_SEVERITY_ERROR = &HC0000000
Const MINCHAR = &H80
Const MAXCHAR = &H7F
Const MINSHORT = &H8000
Const MAXSHORT = &H7FFF
Const MINLONG = &H80000000
Const MAXByte = &HFF
Const MAXWORD = &HFFFF
Const MAXDWORD = &HFFFFFFFF
'
' Calculate the byte offset of a field in a structure of type type.
' * Language IDs.
' *
' * The following two combinations of primary language ID and
' * sublanguage ID have special semantics:
' *
' * Primary Language ID Sublanguage ID Result
' * ------------------- --------------- ------------------------
' * LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral
' * LANG_NEUTRAL SUBLANG_DEFAULT User default language
' * LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language
' */
'
' * Primary language IDs.
' */
Const LANG_NEUTRAL = &H0
Const LANG_BULGARIAN = &H2
Const LANG_CHINESE = &H4
Const LANG_CROATIAN = &H1A
Const LANG_CZECH = &H5
Const LANG_DANISH = &H6
Const LANG_DUTCH = &H13
Const LANG_ENGLISH = &H9
Const LANG_FINNISH = &HB
Const LANG_FRENCH = &HC
Const LANG_GERMAN = &H7
Const LANG_GREEK = &H8
Const LANG_HUNGARIAN = &HE
Const LANG_ICELANDIC = &HF
Const LANG_ITALIAN = &H10
Const LANG_JAPANESE = &H11
Const LANG_KOREAN = &H12
Const LANG_NORWEGIAN = &H14
Const LANG_POLISH = &H15
Const LANG_PORTUGUESE = &H16
Const LANG_ROMANIAN = &H18
Const LANG_RUSSIAN = &H19
Const LANG_SLOVAK = &H1B
Const LANG_SLOVENIAN = &H24
Const LANG_SPANISH = &HA
Const LANG_SWEDISH = &H1D
Const LANG_TURKISH = &H1F
'
' * Sublanguage IDs.
' *
' * The name immediately following SUBLANG_ dictates which primary
' * language ID that sublanguage ID can be combined with to form a
' * valid language ID.
' */
Const SUBLANG_NEUTRAL = &H0 ' language neutral
Const SUBLANG_DEFAULT = &H1 ' user default
Const SUBLANG_SYS_DEFAULT = &H2 ' system default
Const SUBLANG_CHINESE_TRADITIONAL = &H1 ' Chinese (Taiwan)
Const SUBLANG_CHINESE_SIMPLIFIED = &H2 ' Chinese (PR China)
Const SUBLANG_CHINESE_HONGKONG = &H3 ' Chinese (Hong Kong)
Const SUBLANG_CHINESE_SINGAPORE = &H4 ' Chinese (Singapore)
Const SUBLANG_DUTCH = &H1 ' Dutch
Const SUBLANG_DUTCH_BELGIAN = &H2 ' Dutch (Belgian)
Const SUBLANG_ENGLISH_US = &H1 ' English (USA)
Const SUBLANG_ENGLISH_UK = &H2 ' English (UK)
Const SUBLANG_ENGLISH_AUS = &H3 ' English (Australian)
Const SUBLANG_ENGLISH_CAN = &H4 ' English (Canadian)
Const SUBLANG_ENGLISH_NZ = &H5 ' English (New Zealand)
Const SUBLANG_ENGLISH_EIRE = &H6 ' English (Irish)
Const SUBLANG_FRENCH = &H1 ' French
Const SUBLANG_FRENCH_BELGIAN = &H2 ' French (Belgian)
Const SUBLANG_FRENCH_CANADIAN = &H3 ' French (Canadian)
Const SUBLANG_FRENCH_SWISS = &H4 ' French (Swiss)
Const SUBLANG_GERMAN = &H1 ' German
Const SUBLANG_GERMAN_SWISS = &H2 ' German (Swiss)
Const SUBLANG_GERMAN_AUSTRIAN = &H3 ' German (Austrian)
Const SUBLANG_ITALIAN = &H1 ' Italian
Const SUBLANG_ITALIAN_SWISS = &H2 ' Italian (Swiss)
Const SUBLANG_NORWEGIAN_BOKMAL = &H1 ' Norwegian (Bokma
Const SUBLANG_NORWEGIAN_NYNORSK = &H2 ' Norwegian (Nynorsk)
Const SUBLANG_PORTUGUESE = &H2 ' Portuguese
Const SUBLANG_PORTUGUESE_BRAZILIAN = &H1 ' Portuguese (Brazilian)
Const SUBLANG_SPANISH = &H1 ' Spanish (Castilian)
Const SUBLANG_SPANISH_MEXICAN = &H2 ' Spanish (Mexican)
Const SUBLANG_SPANISH_MODERN = &H3 ' Spanish (Modern)
'
' * Sorting IDs.
' *
' */
Const SORT_DEFAULT = &H0 ' sorting default
Const SORT_JAPANESE_XJIS = &H0 ' Japanese0xJIS order
Const SORT_JAPANESE_UNICODE = &H1 ' Japanese Unicode order
Const SORT_CHINESE_BIG5 = &H0 ' Chinese BIG5 order
Const SORT_CHINESE_UNICODE = &H1 ' Chinese Unicode order
Const SORT_KOREAN_KSC = &H0 ' Korean KSC order
Const SORT_KOREAN_UNICODE = &H1 ' Korean Unicode order
' The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
' devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
' constants *MUST* always be in sync.
' The values are redefined in devioctl.h because they must be available to
' both DOS and NT.
'
Const MAX_PATH = 260
' String Length Maximums
Const MAX_LEADBYTES = 12 ' 5 ranges, 2 bytes ea., 0 term.
Const FILE_READ_DATA = (&H1) ' file pipe
Const FILE_LIST_DIRECTORY = (&H1) ' directory
Const FILE_WRITE_DATA = (&H2) ' file pipe
Const FILE_ADD_FILE = (&H2) ' directory
Const FILE_APPEND_DATA = (&H4) ' file
Const FILE_ADD_SUBDIRECTORY = (&H4) ' directory
Const FILE_CREATE_PIPE_INSTANCE = (&H4) ' named pipe
Const FILE_READ_EA = (&H8) ' file directory
Const FILE_READ_PROPERTIES = FILE_READ_EA
Const FILE_WRITE_EA = (&H10) ' file directory
Const FILE_WRITE_PROPERTIES = FILE_WRITE_EA
Const FILE_EXECUTE = (&H20) ' file
Const FILE_TRAVERSE = (&H20) ' directory
Const FILE_DELETE_CHILD = (&H40) ' directory
Const FILE_READ_ATTRIBUTES = (&H80) ' all
Const FILE_WRITE_ATTRIBUTES = (&H100) ' all
Const FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H1FF)
Const FILE_GENERIC_READ = (STANDARD_RIGHTS_READ Or FILE_READ_DATA Or FILE_READ_ATTRIBUTES Or FILE_READ_EA Or SYNCHRONIZE)
Const FILE_GENERIC_WRITE = (STANDARD_RIGHTS_WRITE Or FILE_WRITE_DATA Or FILE_WRITE_ATTRIBUTES Or FILE_WRITE_EA Or FILE_APPEND_DATA Or SYNCHRONIZE)
Const FILE_GENERIC_EXECUTE = (STANDARD_RIGHTS_EXECUTE Or FILE_READ_ATTRIBUTES Or FILE_EXECUTE Or SYNCHRONIZE)
Const FILE_SHARE_READ = &H1
Const FILE_SHARE_WRITE = &H2
Const FILE_ATTRIBUTE_READONLY = &H1
Const FILE_ATTRIBUTE_HIDDEN = &H2
Const FILE_ATTRIBUTE_SYSTEM = &H4
Const FILE_ATTRIBUTE_DIRECTORY = &H10
Const FILE_ATTRIBUTE_ARCHIVE = &H20
Const FILE_ATTRIBUTE_NORMAL = &H80
Const FILE_ATTRIBUTE_TEMPORARY = &H100
Const FILE_ATTRIBUTE_COMPRESSED = &H800
Const FILE_NOTIFY_CHANGE_FILE_NAME = &H1
Const FILE_NOTIFY_CHANGE_DIR_NAME = &H2
Const FILE_NOTIFY_CHANGE_ATTRIBUTES = &H4
Const FILE_NOTIFY_CHANGE_SIZE = &H8
Const FILE_NOTIFY_CHANGE_LAST_WRITE = &H10
Const FILE_NOTIFY_CHANGE_SECURITY = &H100
Const MAILSLOT_NO_MESSAGE = (-1)
Const MAILSLOT_WAIT_FOREVER = (-1)
Const FILE_CASE_SENSITIVE_SEARCH = &H1
Const FILE_CASE_PRESERVED_NAMES = &H2
Const FILE_UNICODE_ON_DISK = &H4
Const FILE_PERSISTENT_ACLS = &H8
Const FILE_FILE_COMPRESSION = &H10
Const FILE_VOLUME_IS_COMPRESSED = &H8000&
Const IO_COMPLETION_MODIFY_STATE = &H2
Const IO_COMPLETION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
Const DUPLICATE_CLOSE_SOURCE = &H1
Const DUPLICATE_SAME_ACCESS = &H2
' //////////////////////////////////////////////////////////////////////
' //
' ACCESS MASK //
' //
' //////////////////////////////////////////////////////////////////////
'
' Define the access mask as a longword sized structure divided up as
' follows:
' typedef struct _ACCESS_MASK {
' WORD SpecificRights;
' Byte StandardRights;
' Byte AccessSystemAcl : 1;
' Byte Reserved : 3;
' Byte GenericAll : 1;
' Byte GenericExecute : 1;
' Byte GenericWrite : 1;
' Byte GenericRead : 1;
' } ACCESS_MASK;
' typedef ACCESS_MASK *PACCESS_MASK;
'
' but to make life simple for programmer's we'll allow them to specify
' a desired access mask by simply OR'ing together mulitple single rights
' and treat an access mask as a DWORD. For example
'
' DesiredAccess = DELETE Or READ_CONTROL
'
' So we'll declare ACCESS_MASK as DWORD
'
' begin_ntddk begin_nthal begin_ntifs
' //////////////////////////////////////////////////////////////////////
' //
' ACCESS TYPES //
' //
' //////////////////////////////////////////////////////////////////////
' begin_ntddk begin_nthal begin_ntifs
'
' The following are masks for the predefined standard access types
' AccessSystemAcl access type
Const ACCESS_SYSTEM_SECURITY = &H1000000
' MaximumAllowed access type
Const MAXIMUM_ALLOWED = &H2000000
' These are the generic rights.
Const GENERIC_READ = &H80000000
Const GENERIC_WRITE = &H40000000
Const GENERIC_EXECUTE = &H20000000
Const GENERIC_ALL = &H10000000
' Define the generic mapping array. This is used to denote the
' mapping of each generic access right to a specific access mask.
Type GENERIC_MAPPING
GenericRead As Long
GenericWrite As Long
GenericExecute As Long
GenericAll As Long
End Type
' //////////////////////////////////////////////////////////////////////
' //
' LUID_AND_ATTRIBUTES //
' //
' //////////////////////////////////////////////////////////////////////
'
Type LUID
LowPart As Long
HighPart As Long
End Type
Type LUID_AND_ATTRIBUTES
pLuid As LUID
Attributes As Long
End Type
' //////////////////////////////////////////////////////////////////////
' //
' ACL and ACE //
' //
' //////////////////////////////////////////////////////////////////////
'
' Define an ACL and the ACE format. The structure of an ACL header
' followed by one or more ACEs. Pictorally the structure of an ACL header
' is as follows:
'
' The current AclRevision is defined to be ACL_REVISION.
'
' AclSize is the size, in bytes, allocated for the ACL. This includes
' the ACL header, ACES, and remaining free space in the buffer.
'
' AceCount is the number of ACES in the ACL.
'
' begin_ntddk begin_ntifs
' This is the *current* ACL revision
Const ACL_REVISION = (2)
' This is the history of ACL revisions. Add a new one whenever
' ACL_REVISION is updated
Const ACL_REVISION1 = (1)
Const ACL_REVISION2 = (2)
Type ACL
AclRevision As Byte
Sbz1 As Byte
AclSize As Integer
AceCount As Integer
Sbz2 As Integer
End Type
' typedef ACL *PACL;
' end_ntddk
' The structure of an ACE is a common ace header followed by ace type
' specific data. Pictorally the structure of the common ace header is
' as follows:
' AceType denotes the type of the ace, there are some predefined ace
' types
'
' AceSize is the size, in bytes, of ace.
'
' AceFlags are the Ace flags for audit and inheritance, defined Integerly.
Type ACE_HEADER
AceType As Byte
AceFlags As Byte
AceSize As Integer
End Type
'
' The following are the predefined ace types that go into the AceType
' field of an Ace header.
Const ACCESS_ALLOWED_ACE_TYPE = &H0
Const ACCESS_DENIED_ACE_TYPE = &H1
Const SYSTEM_AUDIT_ACE_TYPE = &H2
Const SYSTEM_ALARM_ACE_TYPE = &H3
' The following are the inherit flags that go into the AceFlags field
' of an Ace header.
Const OBJECT_INHERIT_ACE = &H1
Const CONTAINER_INHERIT_ACE = &H2
Const NO_PROPAGATE_INHERIT_ACE = &H4
Const INHERIT_ONLY_ACE = &H8
Const VALID_INHERIT_FLAGS = &HF
' The following are the currently defined ACE flags that go into the
' AceFlags field of an ACE header. Each ACE type has its own set of
' AceFlags.
'
' SUCCESSFUL_ACCESS_ACE_FLAG - used only with system audit and alarm ACE
' types to indicate that a message is generated for successful accesses.
'
' FAILED_ACCESS_ACE_FLAG - used only with system audit and alarm ACE types
' to indicate that a message is generated for failed accesses.
' SYSTEM_AUDIT and SYSTEM_ALARM AceFlags
'