-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJclWin32.pas
9333 lines (8024 loc) · 341 KB
/
JclWin32.pas
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
{**************************************************************************************************}
{ WARNING: JEDI preprocessor generated unit. Do not edit. }
{**************************************************************************************************}
{**************************************************************************************************}
{ }
{ Project JEDI Code Library (JCL) }
{ }
{ The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); }
{ you may not use this file except in compliance with the License. You may obtain a copy of the }
{ License at http://www.mozilla.org/MPL/ }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF }
{ ANY KIND, either express or implied. See the License for the specific language governing rights }
{ and limitations under the License. }
{ }
{ Portions of this code are translated from DelayImp.h. }
{ The Initial Developer of DelayImp.h is Inprise Corporation. Portions created by Inprise }
{ Corporation are Copyright (C) 1999, 2000 by Inprise Corporation. All Rights Reserved. }
{ }
{ The Original Code is JclWin32.pas. }
{ }
{ The Initial Developer of the Original Code is Marcel van Brakel. Portions created by Marcel van }
{ Brakel are Copyright (C) Marcel van Brakel. All Rights Reserved. }
{ }
{ Contributors: }
{ Marcel van Brakel }
{ Peter Friese }
{ Andreas Hausladen (ahuser) }
{ Flier Lu (flier) }
{ Robert Marquardt (marquardt) }
{ Robert Rossmair (rrossmair) }
{ Olivier Sannier (obones) }
{ Matthias Thoma (mthoma) }
{ Petr Vones (pvones) }
{ Florent Ouchet (outchy) }
{ }
{**************************************************************************************************}
{ }
{ This unit defines various Win32 API declarations which are either missing or incorrect in one or }
{ more of the supported Delphi versions. This unit is not intended for regular code, only API }
{ declarations. }
{ }
{**************************************************************************************************}
{ }
{ Last modified: $Date:: $ }
{ Revision: $Rev:: $ }
{ Author: $Author:: $ }
{ }
{**************************************************************************************************}
unit JclWin32;
//{$I jcl.inc}
//{$I windowsonly.inc}
{$MINENUMSIZE 4}
{$ALIGN ON}
interface
uses
{$IFDEF UNITVERSIONING}
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
{$IFDEF HAS_UNITSCOPE}
Winapi.Windows, System.SysUtils,
{$IFNDEF FPC}
Winapi.AccCtrl, Winapi.ActiveX,
{$ENDIF ~FPC}
{$ELSE ~HAS_UNITSCOPE}
Windows, SysUtils,
{$IFNDEF FPC}
AccCtrl,
{$ENDIF ~FPC}
ActiveX,
{$ENDIF ~HAS_UNITSCOPE}
JclBase;
{$HPPEMIT '#include <WinDef.h>'}
{$HPPEMIT '#include <WinNT.h>'}
{$HPPEMIT '#include <WinBase.h>'}
{$HPPEMIT '#include <BaseTsd.h>'}
{$HPPEMIT '#include <ImageHlp.h>'}
{$HPPEMIT '#include <lm.h>'}
{$HPPEMIT '#include <Nb30.h>'}
{$HPPEMIT '#include <RasDlg.h>'}
{$HPPEMIT '#include <Reason.h>'}
{$HPPEMIT '#include <ShlWApi.h>'}
{$HPPEMIT '#include <WinError.h>'}
{$HPPEMIT '#include <WinIoCtl.h>'}
{$HPPEMIT '#include <WinUser.h>'}
//{$HPPEMIT '#include <Powrprof.h>'}
{$HPPEMIT '#include <delayimp.h>'}
{$HPPEMIT '#include <propidl.h>'}
{$HPPEMIT '#include <msidefs.h>'}
{$HPPEMIT '#include <shlguid.h>'}
{$IFNDEF COMPILER14_UP}
{$HPPEMIT '#include <imgguids.h>'}
{$ENDIF ~COMPILER14_UP}
{$HPPEMIT '#include <objbase.h>'}
{$HPPEMIT '#include <ntsecapi.h>'}
{$HPPEMIT ''}
{$IFDEF RTL230_UP}
{$HPPEMIT '// To avoid ambiguity between IMAGE_LOAD_CONFIG_DIRECTORY32 and Winapi::Windows::IMAGE_LOAD_CONFIG_DIRECTORY32'}
{$HPPEMIT '#define IMAGE_LOAD_CONFIG_DIRECTORY32 ::IMAGE_LOAD_CONFIG_DIRECTORY32'}
{$HPPEMIT ''}
{$HPPEMIT '// To avoid ambiguity between IMAGE_LOAD_CONFIG_DIRECTORY64 and Winapi::Windows::IMAGE_LOAD_CONFIG_DIRECTORY64'}
{$HPPEMIT '#define IMAGE_LOAD_CONFIG_DIRECTORY64 ::IMAGE_LOAD_CONFIG_DIRECTORY64'}
{$HPPEMIT ''}
{$ENDIF RTL230_UP}
// EJclWin32Error
type
EJclWin32Error = class(EJclError)
private
FLastError: DWORD;
FLastErrorMsg: string;
public
constructor Create(const Msg: string);
constructor CreateFmt(const Msg: string; const Args: array of const);
constructor CreateRes(Ident: Integer); overload;
constructor CreateRes(ResStringRec: PResStringRec); overload;
property LastError: DWORD read FLastError;
property LastErrorMsg: string read FLastErrorMsg;
end;
//DOM-IGNORE-BEGIN
{$IFNDEF FPC}
//
// Unsigned Basics
//
type
USHORT = Word;
{$EXTERNALSYM USHORT}
{$ENDIF ~FPC}
//==================================================================================================
// presumable from any older WinNT.h or from WinIfs.h
//==================================================================================================
//--------------------------------------------------------------------------------------------------
// NTFS Reparse Points
//--------------------------------------------------------------------------------------------------
// The reparse structure is used by layered drivers to store data in a
// reparse point. The constraints on reparse tags are defined below.
// This version of the reparse data buffer is only for Microsoft tags.
(*$HPPEMIT 'typedef struct _REPARSE_DATA_BUFFER {'*)
(*$HPPEMIT ''*)
(*$HPPEMIT ' DWORD ReparseTag;'*)
(*$HPPEMIT ' WORD ReparseDataLength;'*)
(*$HPPEMIT ' WORD Reserved;'*)
(*$HPPEMIT ''*)
(*$HPPEMIT ' union {'*)
(*$HPPEMIT ''*)
(*$HPPEMIT ' struct {'*)
(*$HPPEMIT ' WORD SubstituteNameOffset;'*)
(*$HPPEMIT ' WORD SubstituteNameLength;'*)
(*$HPPEMIT ' WORD PrintNameOffset;'*)
(*$HPPEMIT ' WORD PrintNameLength;'*)
(*$HPPEMIT ' WCHAR PathBuffer[1];'*)
(*$HPPEMIT ' } SymbolicLinkReparseBuffer;'*)
(*$HPPEMIT ''*)
(*$HPPEMIT ' struct {'*)
(*$HPPEMIT ' WORD SubstituteNameOffset;'*)
(*$HPPEMIT ' WORD SubstituteNameLength;'*)
(*$HPPEMIT ' WORD PrintNameOffset;'*)
(*$HPPEMIT ' WORD PrintNameLength;'*)
(*$HPPEMIT ' WCHAR PathBuffer[1];'*)
(*$HPPEMIT ' } MountPointReparseBuffer;'*)
(*$HPPEMIT ''*)
(*$HPPEMIT ' struct {'*)
(*$HPPEMIT ' UCHAR DataBuffer[1];'*)
(*$HPPEMIT ' } GenericReparseBuffer;'*)
(*$HPPEMIT ' };'*)
(*$HPPEMIT ''*)
(*$HPPEMIT '} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;'*)
(*$HPPEMIT ''*)
(*$HPPEMIT '#ifndef REPARSE_DATA_BUFFER_HEADER_SIZE'*)
(*$HPPEMIT '#define REPARSE_DATA_BUFFER_HEADER_SIZE 8'*)
(*$HPPEMIT '#endif'*)
(*$HPPEMIT ''*)
(*$HPPEMIT 'typedef struct _REPARSE_POINT_INFORMATION {'*)
(*$HPPEMIT ' WORD ReparseDataLength;'*)
(*$HPPEMIT ' WORD UnparsedNameLength;'*)
(*$HPPEMIT '} REPARSE_POINT_INFORMATION, *PREPARSE_POINT_INFORMATION;'*)
(*$HPPEMIT ''*)
(*$HPPEMIT '#ifndef IO_REPARSE_TAG_VALID_VALUES'*)
(*$HPPEMIT '#define IO_REPARSE_TAG_VALID_VALUES 0x0E000FFFF'*)
(*$HPPEMIT '#endif'*)
(*$HPPEMIT ''*)
type
{$EXTERNALSYM _REPARSE_DATA_BUFFER}
_REPARSE_DATA_BUFFER = record
ReparseTag: DWORD;
ReparseDataLength: Word;
Reserved: Word;
case Integer of
0: (
SymbolicLinkReparseBuffer: record
SubstituteNameOffset: Word;
SubstituteNameLength: Word;
PrintNameOffset: Word;
PrintNameLength: Word;
Flags: ULONG;
PathBuffer: array [0..0] of WCHAR;
end);
1: (
MountPointReparseBuffer: record
SubstituteNameOffset: Word;
SubstituteNameLength: Word;
PrintNameOffset: Word;
PrintNameLength: Word;
PathBuffer: array [0..0] of WCHAR;
end);
2: (
GenericReparseBuffer: record
DataBuffer: array [0..0] of Byte;
end);
end;
{$EXTERNALSYM REPARSE_DATA_BUFFER}
REPARSE_DATA_BUFFER = _REPARSE_DATA_BUFFER;
{$EXTERNALSYM PREPARSE_DATA_BUFFER}
PREPARSE_DATA_BUFFER = ^_REPARSE_DATA_BUFFER;
TReparseDataBuffer = _REPARSE_DATA_BUFFER;
PReparseDataBuffer = PREPARSE_DATA_BUFFER;
const
{$EXTERNALSYM REPARSE_DATA_BUFFER_HEADER_SIZE}
REPARSE_DATA_BUFFER_HEADER_SIZE = 8;
type
{$EXTERNALSYM _REPARSE_POINT_INFORMATION}
_REPARSE_POINT_INFORMATION = record
ReparseDataLength: Word;
UnparsedNameLength: Word;
end;
{$EXTERNALSYM REPARSE_POINT_INFORMATION}
REPARSE_POINT_INFORMATION = _REPARSE_POINT_INFORMATION;
{$EXTERNALSYM PREPARSE_POINT_INFORMATION}
PREPARSE_POINT_INFORMATION = ^_REPARSE_POINT_INFORMATION;
TReparsePointInformation = _REPARSE_POINT_INFORMATION;
PReparsePointInformation = PREPARSE_POINT_INFORMATION;
const
{$EXTERNALSYM IO_REPARSE_TAG_VALID_VALUES}
IO_REPARSE_TAG_VALID_VALUES = DWORD($E000FFFF);
//==================================================================================================
// from JwaWinNT.pas (few declarations from JwaWinType)
const
MAXLONGLONG = $7fffffffffffffff;
{$EXTERNALSYM MAXLONGLONG}
{$IFNDEF FPC}
type
ULONGLONG = Int64;
{$EXTERNALSYM ULONGLONG}
PLONGLONG = ^LONGLONG;
{$EXTERNALSYM PLONGLONG}
PULONGLONG = ^ULONGLONG;
{$EXTERNALSYM PULONGLONG}
{$ENDIF ~FPC}
const
ANYSIZE_ARRAY = 1;
{$EXTERNALSYM ANYSIZE_ARRAY}
MAX_NATURAL_ALIGNMENT = SizeOf(ULONG);
{$EXTERNALSYM MAX_NATURAL_ALIGNMENT}
// line 72
const
VER_SERVER_NT = DWORD($80000000);
{$EXTERNALSYM VER_SERVER_NT}
VER_WORKSTATION_NT = $40000000;
{$EXTERNALSYM VER_WORKSTATION_NT}
VER_SUITE_SMALLBUSINESS = $00000001;
{$EXTERNALSYM VER_SUITE_SMALLBUSINESS}
VER_SUITE_ENTERPRISE = $00000002;
{$EXTERNALSYM VER_SUITE_ENTERPRISE}
VER_SUITE_BACKOFFICE = $00000004;
{$EXTERNALSYM VER_SUITE_BACKOFFICE}
VER_SUITE_COMMUNICATIONS = $00000008;
{$EXTERNALSYM VER_SUITE_COMMUNICATIONS}
VER_SUITE_TERMINAL = $00000010;
{$EXTERNALSYM VER_SUITE_TERMINAL}
VER_SUITE_SMALLBUSINESS_RESTRICTED = $00000020;
{$EXTERNALSYM VER_SUITE_SMALLBUSINESS_RESTRICTED}
VER_SUITE_EMBEDDEDNT = $00000040;
{$EXTERNALSYM VER_SUITE_EMBEDDEDNT}
VER_SUITE_DATACENTER = $00000080;
{$EXTERNALSYM VER_SUITE_DATACENTER}
VER_SUITE_SINGLEUSERTS = $00000100;
{$EXTERNALSYM VER_SUITE_SINGLEUSERTS}
VER_SUITE_PERSONAL = $00000200;
{$EXTERNALSYM VER_SUITE_PERSONAL}
VER_SUITE_BLADE = $00000400;
{$EXTERNALSYM VER_SUITE_BLADE}
VER_SUITE_EMBEDDED_RESTRICTED = $00000800;
{$EXTERNALSYM VER_SUITE_EMBEDDED_RESTRICTED}
VER_SUITE_SECURITY_APPLIANCE = $00001000;
{$EXTERNALSYM VER_SUITE_SECURITY_APPLIANCE}
VER_SUITE_STORAGE_SERVER = $00002000;
{$EXTERNALSYM VER_SUITE_STORAGE_SERVER}
VER_SUITE_COMPUTE_SERVER = $00004000;
{$EXTERNALSYM VER_SUITE_COMPUTE_SERVER}
// line 515
//
// A language ID is a 16 bit value which is the combination of a
// primary language ID and a secondary language ID. The bits are
// allocated as follows:
//
// +-----------------------+-------------------------+
// | Sublanguage ID | Primary Language ID |
// +-----------------------+-------------------------+
// 15 10 9 0 bit
//
//
// Language ID creation/extraction macros:
//
// MAKELANGID - construct language id from a primary language id and
// a sublanguage id.
// PRIMARYLANGID - extract primary language id from a language id.
// SUBLANGID - extract sublanguage id from a language id.
//
function MAKELANGID(PrimaryLang, SubLang: USHORT): WORD;
{$EXTERNALSYM MAKELANGID}
function PRIMARYLANGID(LangId: WORD): WORD;
{$EXTERNALSYM PRIMARYLANGID}
function SUBLANGID(LangId: WORD): WORD;
{$EXTERNALSYM SUBLANGID}
//
// A locale ID is a 32 bit value which is the combination of a
// language ID, a sort ID, and a reserved area. The bits are
// allocated as follows:
//
// +-------------+---------+-------------------------+
// | Reserved | Sort ID | Language ID |
// +-------------+---------+-------------------------+
// 31 20 19 16 15 0 bit
//
//
// Locale ID creation/extraction macros:
//
// MAKELCID - construct the locale id from a language id and a sort id.
// MAKESORTLCID - construct the locale id from a language id, sort id, and sort version.
// LANGIDFROMLCID - extract the language id from a locale id.
// SORTIDFROMLCID - extract the sort id from a locale id.
// SORTVERSIONFROMLCID - extract the sort version from a locale id.
//
const
NLS_VALID_LOCALE_MASK = $000fffff;
{$EXTERNALSYM NLS_VALID_LOCALE_MASK}
function MAKELCID(LangId, SortId: WORD): DWORD;
{$EXTERNALSYM MAKELCID}
function MAKESORTLCID(LangId, SortId, SortVersion: WORD): DWORD;
{$EXTERNALSYM MAKESORTLCID}
function LANGIDFROMLCID(LocaleId: LCID): WORD;
{$EXTERNALSYM LANGIDFROMLCID}
function SORTIDFROMLCID(LocaleId: LCID): WORD;
{$EXTERNALSYM SORTIDFROMLCID}
function SORTVERSIONFROMLCID(LocaleId: LCID): WORD;
{$EXTERNALSYM SORTVERSIONFROMLCID}
// line 1154
////////////////////////////////////////////////////////////////////////
// //
// Security Id (SID) //
// //
////////////////////////////////////////////////////////////////////////
//
//
// Pictorially the structure of an SID is as follows:
//
// 1 1 1 1 1 1
// 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---------------------------------------------------------------+
// | SubAuthorityCount |Reserved1 (SBZ)| Revision |
// +---------------------------------------------------------------+
// | IdentifierAuthority[0] |
// +---------------------------------------------------------------+
// | IdentifierAuthority[1] |
// +---------------------------------------------------------------+
// | IdentifierAuthority[2] |
// +---------------------------------------------------------------+
// | |
// +- - - - - - - - SubAuthority[] - - - - - - - - -+
// | |
// +---------------------------------------------------------------+
//
//
{$IFNDEF FPC}
type
_SID_IDENTIFIER_AUTHORITY = record
Value: array [0..5] of Byte;
end;
{$EXTERNALSYM _SID_IDENTIFIER_AUTHORITY}
SID_IDENTIFIER_AUTHORITY = _SID_IDENTIFIER_AUTHORITY;
{$EXTERNALSYM SID_IDENTIFIER_AUTHORITY}
PSID_IDENTIFIER_AUTHORITY = ^_SID_IDENTIFIER_AUTHORITY;
{$EXTERNALSYM PSID_IDENTIFIER_AUTHORITY}
// PSid = ^SID;
_SID = record
Revision: Byte;
SubAuthorityCount: Byte;
IdentifierAuthority: SID_IDENTIFIER_AUTHORITY;
SubAuthority: array [0..ANYSIZE_ARRAY - 1] of DWORD;
end;
{$EXTERNALSYM _SID}
SID = _SID;
{$EXTERNALSYM SID}
PPSID = ^PSID;
{$NODEFINE PPSID}
TSid = SID;
{$ENDIF ~FPC}
const
SID_REVISION = (1); // Current revision level
{$EXTERNALSYM SID_REVISION}
SID_MAX_SUB_AUTHORITIES = (15);
{$EXTERNALSYM SID_MAX_SUB_AUTHORITIES}
SID_RECOMMENDED_SUB_AUTHORITIES = (1); // Will change to around 6 in a future release.
{$EXTERNALSYM SID_RECOMMENDED_SUB_AUTHORITIES}
SECURITY_MAX_SID_SIZE = SizeOf(SID) - SizeOf(DWORD) + (SID_MAX_SUB_AUTHORITIES * SizeOf(DWORD));
{$EXTERNALSYM SECURITY_MAX_SID_SIZE}
{$IFNDEF FPC}
SidTypeUser = 1;
{$EXTERNALSYM SidTypeUser}
SidTypeGroup = 2;
{$EXTERNALSYM SidTypeGroup}
SidTypeDomain = 3;
{$EXTERNALSYM SidTypeDomain}
SidTypeAlias = 4;
{$EXTERNALSYM SidTypeAlias}
SidTypeWellKnownGroup = 5;
{$EXTERNALSYM SidTypeWellKnownGroup}
SidTypeDeletedAccount = 6;
{$EXTERNALSYM SidTypeDeletedAccount}
SidTypeInvalid = 7;
{$EXTERNALSYM SidTypeInvalid}
SidTypeUnknown = 8;
{$EXTERNALSYM SidTypeUnknown}
SidTypeComputer = 9;
{$EXTERNALSYM SidTypeComputer}
type
_SID_NAME_USE = DWORD;
{$EXTERNALSYM _SID_NAME_USE}
// SID_NAME_USE = _SID_NAME_USE;
// {$EXTERNALSYM SID_NAME_USE}
PSID_NAME_USE = ^SID_NAME_USE;
{$EXTERNALSYM PSID_NAME_USE}
TSidNameUse = SID_NAME_USE;
PSidNameUSe = PSID_NAME_USE;
PSID_AND_ATTRIBUTES = ^SID_AND_ATTRIBUTES;
{$EXTERNALSYM PSID_AND_ATTRIBUTES}
_SID_AND_ATTRIBUTES = record
Sid: PSID;
Attributes: DWORD;
end;
{$EXTERNALSYM _SID_AND_ATTRIBUTES}
SID_AND_ATTRIBUTES = _SID_AND_ATTRIBUTES;
{$EXTERNALSYM SID_AND_ATTRIBUTES}
TSidAndAttributes = SID_AND_ATTRIBUTES;
PSidAndAttributes = PSID_AND_ATTRIBUTES;
SID_AND_ATTRIBUTES_ARRAY = array [0..ANYSIZE_ARRAY - 1] of SID_AND_ATTRIBUTES;
{$EXTERNALSYM SID_AND_ATTRIBUTES_ARRAY}
PSID_AND_ATTRIBUTES_ARRAY = ^SID_AND_ATTRIBUTES_ARRAY;
{$EXTERNALSYM PSID_AND_ATTRIBUTES_ARRAY}
PSidAndAttributesArray = ^TSidAndAttributesArray;
TSidAndAttributesArray = SID_AND_ATTRIBUTES_ARRAY;
{$ENDIF ~FPC}
/////////////////////////////////////////////////////////////////////////////
// //
// 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 //
// Creator Owner Server ID S-1-3-2 //
// Creator Group Server ID S-1-3-3 //
// //
// (Non-unique IDs) S-1-4 //
// //
/////////////////////////////////////////////////////////////////////////////
const
SECURITY_NULL_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 0));
{$EXTERNALSYM SECURITY_NULL_SID_AUTHORITY}
SECURITY_WORLD_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 1));
{$EXTERNALSYM SECURITY_WORLD_SID_AUTHORITY}
SECURITY_LOCAL_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 2));
{$EXTERNALSYM SECURITY_LOCAL_SID_AUTHORITY}
SECURITY_CREATOR_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 3));
{$EXTERNALSYM SECURITY_CREATOR_SID_AUTHORITY}
SECURITY_NON_UNIQUE_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 4));
{$EXTERNALSYM SECURITY_NON_UNIQUE_AUTHORITY}
SECURITY_RESOURCE_MANAGER_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 9));
{$EXTERNALSYM SECURITY_RESOURCE_MANAGER_AUTHORITY}
SECURITY_NULL_RID = ($00000000);
{$EXTERNALSYM SECURITY_NULL_RID}
SECURITY_WORLD_RID = ($00000000);
{$EXTERNALSYM SECURITY_WORLD_RID}
SECURITY_LOCAL_RID = ($00000000);
{$EXTERNALSYM SECURITY_LOCAL_RID}
SECURITY_CREATOR_OWNER_RID = ($00000000);
{$EXTERNALSYM SECURITY_CREATOR_OWNER_RID}
SECURITY_CREATOR_GROUP_RID = ($00000001);
{$EXTERNALSYM SECURITY_CREATOR_GROUP_RID}
SECURITY_CREATOR_OWNER_SERVER_RID = ($00000002);
{$EXTERNALSYM SECURITY_CREATOR_OWNER_SERVER_RID}
SECURITY_CREATOR_GROUP_SERVER_RID = ($00000003);
{$EXTERNALSYM SECURITY_CREATOR_GROUP_SERVER_RID}
/////////////////////////////////////////////////////////////////////////////
// //
// 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 //
// (Logon IDs) S-1-5-5-X-Y //
// Service S-1-5-6 //
// AnonymousLogon S-1-5-7 (aka null logon session) //
// Proxy S-1-5-8 //
// Enterprise DC (EDC) S-1-5-9 (aka domain controller account) //
// Self S-1-5-10 (self RID) //
// Authenticated User S-1-5-11 (Authenticated user somewhere) //
// Restricted Code S-1-5-12 (Running restricted code) //
// Terminal Server S-1-5-13 (Running on Terminal Server) //
// Remote Logon S-1-5-14 (Remote Interactive Logon) //
// This Organization S-1-5-15 //
// //
// Local System S-1-5-18 //
// Local Service S-1-5-19 //
// Network Service S-1-5-20 //
// //
// (NT non-unique IDs) S-1-5-0x15-... (NT Domain Sids) //
// //
// (Built-in domain) S-1-5-0x20 //
// //
// (Security Package IDs) S-1-5-0x40 //
// NTLM Authentication S-1-5-0x40-10 //
// SChannel Authentication S-1-5-0x40-14 //
// Digest Authentication S-1-5-0x40-21 //
// //
// Other Organization S-1-5-1000 (>=1000 can not be filtered) //
// //
// //
// NOTE: the relative identifier values (RIDs) determine which security //
// boundaries the SID is allowed to cross. Before adding new RIDs, //
// a determination needs to be made regarding which range they should //
// be added to in order to ensure proper "SID filtering" //
// //
/////////////////////////////////////////////////////////////////////////////
const
SECURITY_NT_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5));
{$EXTERNALSYM SECURITY_NT_AUTHORITY}
SECURITY_DIALUP_RID = ($00000001);
{$EXTERNALSYM SECURITY_DIALUP_RID}
SECURITY_NETWORK_RID = ($00000002);
{$EXTERNALSYM SECURITY_NETWORK_RID}
SECURITY_BATCH_RID = ($00000003);
{$EXTERNALSYM SECURITY_BATCH_RID}
SECURITY_INTERACTIVE_RID = ($00000004);
{$EXTERNALSYM SECURITY_INTERACTIVE_RID}
SECURITY_LOGON_IDS_RID = ($00000005);
{$EXTERNALSYM SECURITY_LOGON_IDS_RID}
SECURITY_LOGON_IDS_RID_COUNT = (3);
{$EXTERNALSYM SECURITY_LOGON_IDS_RID_COUNT}
SECURITY_SERVICE_RID = ($00000006);
{$EXTERNALSYM SECURITY_SERVICE_RID}
SECURITY_ANONYMOUS_LOGON_RID = ($00000007);
{$EXTERNALSYM SECURITY_ANONYMOUS_LOGON_RID}
SECURITY_PROXY_RID = ($00000008);
{$EXTERNALSYM SECURITY_PROXY_RID}
SECURITY_ENTERPRISE_CONTROLLERS_RID = ($00000009);
{$EXTERNALSYM SECURITY_ENTERPRISE_CONTROLLERS_RID}
SECURITY_SERVER_LOGON_RID = SECURITY_ENTERPRISE_CONTROLLERS_RID;
{$EXTERNALSYM SECURITY_SERVER_LOGON_RID}
SECURITY_PRINCIPAL_SELF_RID = ($0000000A);
{$EXTERNALSYM SECURITY_PRINCIPAL_SELF_RID}
SECURITY_AUTHENTICATED_USER_RID = ($0000000B);
{$EXTERNALSYM SECURITY_AUTHENTICATED_USER_RID}
SECURITY_RESTRICTED_CODE_RID = ($0000000C);
{$EXTERNALSYM SECURITY_RESTRICTED_CODE_RID}
SECURITY_TERMINAL_SERVER_RID = ($0000000D);
{$EXTERNALSYM SECURITY_TERMINAL_SERVER_RID}
SECURITY_REMOTE_LOGON_RID = ($0000000E);
{$EXTERNALSYM SECURITY_REMOTE_LOGON_RID}
SECURITY_THIS_ORGANIZATION_RID = ($0000000F);
{$EXTERNALSYM SECURITY_THIS_ORGANIZATION_RID}
SECURITY_LOCAL_SYSTEM_RID = ($00000012);
{$EXTERNALSYM SECURITY_LOCAL_SYSTEM_RID}
SECURITY_LOCAL_SERVICE_RID = ($00000013);
{$EXTERNALSYM SECURITY_LOCAL_SERVICE_RID}
SECURITY_NETWORK_SERVICE_RID = ($00000014);
{$EXTERNALSYM SECURITY_NETWORK_SERVICE_RID}
SECURITY_NT_NON_UNIQUE = ($00000015);
{$EXTERNALSYM SECURITY_NT_NON_UNIQUE}
SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT = (3);
{$EXTERNALSYM SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT}
SECURITY_BUILTIN_DOMAIN_RID = ($00000020);
{$EXTERNALSYM SECURITY_BUILTIN_DOMAIN_RID}
SECURITY_PACKAGE_BASE_RID = ($00000040);
{$EXTERNALSYM SECURITY_PACKAGE_BASE_RID}
SECURITY_PACKAGE_RID_COUNT = (2);
{$EXTERNALSYM SECURITY_PACKAGE_RID_COUNT}
SECURITY_PACKAGE_NTLM_RID = ($0000000A);
{$EXTERNALSYM SECURITY_PACKAGE_NTLM_RID}
SECURITY_PACKAGE_SCHANNEL_RID = ($0000000E);
{$EXTERNALSYM SECURITY_PACKAGE_SCHANNEL_RID}
SECURITY_PACKAGE_DIGEST_RID = ($00000015);
{$EXTERNALSYM SECURITY_PACKAGE_DIGEST_RID}
SECURITY_MAX_ALWAYS_FILTERED = ($000003E7);
{$EXTERNALSYM SECURITY_MAX_ALWAYS_FILTERED}
SECURITY_MIN_NEVER_FILTERED = ($000003E8);
{$EXTERNALSYM SECURITY_MIN_NEVER_FILTERED}
SECURITY_OTHER_ORGANIZATION_RID = ($000003E8);
{$EXTERNALSYM SECURITY_OTHER_ORGANIZATION_RID}
/////////////////////////////////////////////////////////////////////////////
// //
// well-known domain relative sub-authority values (RIDs)... //
// //
/////////////////////////////////////////////////////////////////////////////
// Well-known users ...
FOREST_USER_RID_MAX = ($000001F3);
{$EXTERNALSYM FOREST_USER_RID_MAX}
DOMAIN_USER_RID_ADMIN = ($000001F4);
{$EXTERNALSYM DOMAIN_USER_RID_ADMIN}
DOMAIN_USER_RID_GUEST = ($000001F5);
{$EXTERNALSYM DOMAIN_USER_RID_GUEST}
DOMAIN_USER_RID_KRBTGT = ($000001F6);
{$EXTERNALSYM DOMAIN_USER_RID_KRBTGT}
DOMAIN_USER_RID_MAX = ($000003E7);
{$EXTERNALSYM DOMAIN_USER_RID_MAX}
// well-known groups ...
DOMAIN_GROUP_RID_ADMINS = ($00000200);
{$EXTERNALSYM DOMAIN_GROUP_RID_ADMINS}
DOMAIN_GROUP_RID_USERS = ($00000201);
{$EXTERNALSYM DOMAIN_GROUP_RID_USERS}
DOMAIN_GROUP_RID_GUESTS = ($00000202);
{$EXTERNALSYM DOMAIN_GROUP_RID_GUESTS}
DOMAIN_GROUP_RID_COMPUTERS = ($00000203);
{$EXTERNALSYM DOMAIN_GROUP_RID_COMPUTERS}
DOMAIN_GROUP_RID_CONTROLLERS = ($00000204);
{$EXTERNALSYM DOMAIN_GROUP_RID_CONTROLLERS}
DOMAIN_GROUP_RID_CERT_ADMINS = ($00000205);
{$EXTERNALSYM DOMAIN_GROUP_RID_CERT_ADMINS}
DOMAIN_GROUP_RID_SCHEMA_ADMINS = ($00000206);
{$EXTERNALSYM DOMAIN_GROUP_RID_SCHEMA_ADMINS}
DOMAIN_GROUP_RID_ENTERPRISE_ADMINS = ($00000207);
{$EXTERNALSYM DOMAIN_GROUP_RID_ENTERPRISE_ADMINS}
DOMAIN_GROUP_RID_POLICY_ADMINS = ($00000208);
{$EXTERNALSYM DOMAIN_GROUP_RID_POLICY_ADMINS}
// well-known aliases ...
DOMAIN_ALIAS_RID_ADMINS = ($00000220);
{$EXTERNALSYM DOMAIN_ALIAS_RID_ADMINS}
DOMAIN_ALIAS_RID_USERS = ($00000221);
{$EXTERNALSYM DOMAIN_ALIAS_RID_USERS}
DOMAIN_ALIAS_RID_GUESTS = ($00000222);
{$EXTERNALSYM DOMAIN_ALIAS_RID_GUESTS}
DOMAIN_ALIAS_RID_POWER_USERS = ($00000223);
{$EXTERNALSYM DOMAIN_ALIAS_RID_POWER_USERS}
DOMAIN_ALIAS_RID_ACCOUNT_OPS = ($00000224);
{$EXTERNALSYM DOMAIN_ALIAS_RID_ACCOUNT_OPS}
DOMAIN_ALIAS_RID_SYSTEM_OPS = ($00000225);
{$EXTERNALSYM DOMAIN_ALIAS_RID_SYSTEM_OPS}
DOMAIN_ALIAS_RID_PRINT_OPS = ($00000226);
{$EXTERNALSYM DOMAIN_ALIAS_RID_PRINT_OPS}
DOMAIN_ALIAS_RID_BACKUP_OPS = ($00000227);
{$EXTERNALSYM DOMAIN_ALIAS_RID_BACKUP_OPS}
DOMAIN_ALIAS_RID_REPLICATOR = ($00000228);
{$EXTERNALSYM DOMAIN_ALIAS_RID_REPLICATOR}
DOMAIN_ALIAS_RID_RAS_SERVERS = ($00000229);
{$EXTERNALSYM DOMAIN_ALIAS_RID_RAS_SERVERS}
DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = ($0000022A);
{$EXTERNALSYM DOMAIN_ALIAS_RID_PREW2KCOMPACCESS}
DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = ($0000022B);
{$EXTERNALSYM DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS}
DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = ($0000022C);
{$EXTERNALSYM DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS}
DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = ($0000022D);
{$EXTERNALSYM DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS}
DOMAIN_ALIAS_RID_MONITORING_USERS = ($0000022E);
{$EXTERNALSYM DOMAIN_ALIAS_RID_MONITORING_USERS}
DOMAIN_ALIAS_RID_LOGGING_USERS = ($0000022F);
{$EXTERNALSYM DOMAIN_ALIAS_RID_LOGGING_USERS}
DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = ($00000230);
{$EXTERNALSYM DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS}
DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = ($00000231);
{$EXTERNALSYM DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS}
// line 2495
////////////////////////////////////////////////////////////////////////
// //
// NT Defined Privileges //
// //
////////////////////////////////////////////////////////////////////////
const
SE_CREATE_TOKEN_NAME = 'SeCreateTokenPrivilege';
{$EXTERNALSYM SE_CREATE_TOKEN_NAME}
SE_ASSIGNPRIMARYTOKEN_NAME = 'SeAssignPrimaryTokenPrivilege';
{$EXTERNALSYM SE_ASSIGNPRIMARYTOKEN_NAME}
SE_LOCK_MEMORY_NAME = 'SeLockMemoryPrivilege';
{$EXTERNALSYM SE_LOCK_MEMORY_NAME}
SE_INCREASE_QUOTA_NAME = 'SeIncreaseQuotaPrivilege';
{$EXTERNALSYM SE_INCREASE_QUOTA_NAME}
SE_UNSOLICITED_INPUT_NAME = 'SeUnsolicitedInputPrivilege';
{$EXTERNALSYM SE_UNSOLICITED_INPUT_NAME}
SE_MACHINE_ACCOUNT_NAME = 'SeMachineAccountPrivilege';
{$EXTERNALSYM SE_MACHINE_ACCOUNT_NAME}
SE_TCB_NAME = 'SeTcbPrivilege';
{$EXTERNALSYM SE_TCB_NAME}
SE_SECURITY_NAME = 'SeSecurityPrivilege';
{$EXTERNALSYM SE_SECURITY_NAME}
SE_TAKE_OWNERSHIP_NAME = 'SeTakeOwnershipPrivilege';
{$EXTERNALSYM SE_TAKE_OWNERSHIP_NAME}
SE_LOAD_DRIVER_NAME = 'SeLoadDriverPrivilege';
{$EXTERNALSYM SE_LOAD_DRIVER_NAME}
SE_SYSTEM_PROFILE_NAME = 'SeSystemProfilePrivilege';
{$EXTERNALSYM SE_SYSTEM_PROFILE_NAME}
SE_SYSTEMTIME_NAME = 'SeSystemtimePrivilege';
{$EXTERNALSYM SE_SYSTEMTIME_NAME}
SE_PROF_SINGLE_PROCESS_NAME = 'SeProfileSingleProcessPrivilege';
{$EXTERNALSYM SE_PROF_SINGLE_PROCESS_NAME}
SE_INC_BASE_PRIORITY_NAME = 'SeIncreaseBasePriorityPrivilege';
{$EXTERNALSYM SE_INC_BASE_PRIORITY_NAME}
SE_CREATE_PAGEFILE_NAME = 'SeCreatePagefilePrivilege';
{$EXTERNALSYM SE_CREATE_PAGEFILE_NAME}
SE_CREATE_PERMANENT_NAME = 'SeCreatePermanentPrivilege';
{$EXTERNALSYM SE_CREATE_PERMANENT_NAME}
SE_BACKUP_NAME = 'SeBackupPrivilege';
{$EXTERNALSYM SE_BACKUP_NAME}
SE_RESTORE_NAME = 'SeRestorePrivilege';
{$EXTERNALSYM SE_RESTORE_NAME}
SE_SHUTDOWN_NAME = 'SeShutdownPrivilege';
{$EXTERNALSYM SE_SHUTDOWN_NAME}
SE_DEBUG_NAME = 'SeDebugPrivilege';
{$EXTERNALSYM SE_DEBUG_NAME}
SE_AUDIT_NAME = 'SeAuditPrivilege';
{$EXTERNALSYM SE_AUDIT_NAME}
SE_SYSTEM_ENVIRONMENT_NAME = 'SeSystemEnvironmentPrivilege';
{$EXTERNALSYM SE_SYSTEM_ENVIRONMENT_NAME}
SE_CHANGE_NOTIFY_NAME = 'SeChangeNotifyPrivilege';
{$EXTERNALSYM SE_CHANGE_NOTIFY_NAME}
SE_REMOTE_SHUTDOWN_NAME = 'SeRemoteShutdownPrivilege';
{$EXTERNALSYM SE_REMOTE_SHUTDOWN_NAME}
SE_UNDOCK_NAME = 'SeUndockPrivilege';
{$EXTERNALSYM SE_UNDOCK_NAME}
SE_SYNC_AGENT_NAME = 'SeSyncAgentPrivilege';
{$EXTERNALSYM SE_SYNC_AGENT_NAME}
SE_ENABLE_DELEGATION_NAME = 'SeEnableDelegationPrivilege';
{$EXTERNALSYM SE_ENABLE_DELEGATION_NAME}
SE_MANAGE_VOLUME_NAME = 'SeManageVolumePrivilege';
{$EXTERNALSYM SE_MANAGE_VOLUME_NAME}
SE_IMPERSONATE_NAME = 'SeImpersonatePrivilege';
{$EXTERNALSYM SE_IMPERSONATE_NAME}
SE_CREATE_GLOBAL_NAME = 'SeCreateGlobalPrivilege';
{$EXTERNALSYM SE_CREATE_GLOBAL_NAME}
//
// Thread Information Block (TIB)
//
type
NT_TIB32 = packed record
ExceptionList: DWORD;
StackBase: DWORD;
StackLimit: DWORD;
SubSystemTib: DWORD;
case Integer of
0 : (
FiberData: DWORD;
ArbitraryUserPointer: DWORD;
Self: DWORD;
);
1 : (
Version: DWORD;
);
end;
{$EXTERNALSYM NT_TIB32}
PNT_TIB32 = ^NT_TIB32;
{$EXTERNALSYM PNT_TIB32}
NT_TIB64 = packed record
ExceptionList: TJclAddr64;
StackBase: TJclAddr64;
StackLimit: TJclAddr64;
SubSystemTib: TJclAddr64;
case Integer of
0 : (
FiberData: TJclAddr64;
ArbitraryUserPointer: TJclAddr64;
Self: TJclAddr64;
);
1 : (
Version: DWORD;
);
end;
{$EXTERNALSYM NT_TIB64}
PNT_TIB64 = ^NT_TIB64;
{$EXTERNALSYM PNT_TIB64}
// line 2686
//
// Token information class structures
//
{$IFNDEF FPC}
type
PTOKEN_USER = ^TOKEN_USER;
{$EXTERNALSYM PTOKEN_USER}
_TOKEN_USER = record
User: SID_AND_ATTRIBUTES;
end;
{$EXTERNALSYM _TOKEN_USER}
TOKEN_USER = _TOKEN_USER;
{$EXTERNALSYM TOKEN_USER}
TTokenUser = TOKEN_USER;
PTokenUser = PTOKEN_USER;
{$ENDIF ~FPC}
function CaptureStackBackTrace(FramesToSkip, FramesToCapture: DWORD;
BackTrace: Pointer; out BackTraceHash: DWORD): Word; stdcall;
{$EXTERNALSYM CaptureStackBackTrace}
// line 3858
//
// Define access rights to files and directories
//
//
// 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
FILE_READ_DATA = ($0001); // file & pipe
{$EXTERNALSYM FILE_READ_DATA}
FILE_LIST_DIRECTORY = ($0001); // directory
{$EXTERNALSYM FILE_LIST_DIRECTORY}
FILE_WRITE_DATA = ($0002); // file & pipe
{$EXTERNALSYM FILE_WRITE_DATA}
FILE_ADD_FILE = ($0002); // directory
{$EXTERNALSYM FILE_ADD_FILE}
FILE_APPEND_DATA = ($0004); // file
{$EXTERNALSYM FILE_APPEND_DATA}
FILE_ADD_SUBDIRECTORY = ($0004); // directory
{$EXTERNALSYM FILE_ADD_SUBDIRECTORY}
FILE_CREATE_PIPE_INSTANCE = ($0004); // named pipe
{$EXTERNALSYM FILE_CREATE_PIPE_INSTANCE}
FILE_READ_EA = ($0008); // file & directory
{$EXTERNALSYM FILE_READ_EA}
FILE_WRITE_EA = ($0010); // file & directory
{$EXTERNALSYM FILE_WRITE_EA}
FILE_EXECUTE = ($0020); // file
{$EXTERNALSYM FILE_EXECUTE}
FILE_TRAVERSE = ($0020); // directory
{$EXTERNALSYM FILE_TRAVERSE}
FILE_DELETE_CHILD = ($0040); // directory
{$EXTERNALSYM FILE_DELETE_CHILD}
FILE_READ_ATTRIBUTES = ($0080); // all
{$EXTERNALSYM FILE_READ_ATTRIBUTES}
FILE_WRITE_ATTRIBUTES = ($0100); // all
{$EXTERNALSYM FILE_WRITE_ATTRIBUTES}
FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $1FF);
{$EXTERNALSYM FILE_ALL_ACCESS}
FILE_GENERIC_READ = (STANDARD_RIGHTS_READ or FILE_READ_DATA or
FILE_READ_ATTRIBUTES or FILE_READ_EA or SYNCHRONIZE);
{$EXTERNALSYM FILE_GENERIC_READ}
FILE_GENERIC_WRITE = (STANDARD_RIGHTS_WRITE or FILE_WRITE_DATA or
FILE_WRITE_ATTRIBUTES or FILE_WRITE_EA or FILE_APPEND_DATA or SYNCHRONIZE);
{$EXTERNALSYM FILE_GENERIC_WRITE}
FILE_GENERIC_EXECUTE = (STANDARD_RIGHTS_EXECUTE or FILE_READ_ATTRIBUTES or
FILE_EXECUTE or SYNCHRONIZE);
{$EXTERNALSYM FILE_GENERIC_EXECUTE}
FILE_SHARE_READ = $00000001;
{$EXTERNALSYM FILE_SHARE_READ}
FILE_SHARE_WRITE = $00000002;
{$EXTERNALSYM FILE_SHARE_WRITE}
FILE_SHARE_DELETE = $00000004;
{$EXTERNALSYM FILE_SHARE_DELETE}
FILE_ATTRIBUTE_READONLY = $00000001;
{$EXTERNALSYM FILE_ATTRIBUTE_READONLY}
FILE_ATTRIBUTE_HIDDEN = $00000002;
{$EXTERNALSYM FILE_ATTRIBUTE_HIDDEN}
FILE_ATTRIBUTE_SYSTEM = $00000004;
{$EXTERNALSYM FILE_ATTRIBUTE_SYSTEM}
FILE_ATTRIBUTE_DIRECTORY = $00000010;
{$EXTERNALSYM FILE_ATTRIBUTE_DIRECTORY}
FILE_ATTRIBUTE_ARCHIVE = $00000020;
{$EXTERNALSYM FILE_ATTRIBUTE_ARCHIVE}
FILE_ATTRIBUTE_DEVICE = $00000040;
{$EXTERNALSYM FILE_ATTRIBUTE_DEVICE}
FILE_ATTRIBUTE_NORMAL = $00000080;
{$EXTERNALSYM FILE_ATTRIBUTE_NORMAL}
FILE_ATTRIBUTE_TEMPORARY = $00000100;
{$EXTERNALSYM FILE_ATTRIBUTE_TEMPORARY}
FILE_ATTRIBUTE_SPARSE_FILE = $00000200;
{$EXTERNALSYM FILE_ATTRIBUTE_SPARSE_FILE}
FILE_ATTRIBUTE_REPARSE_POINT = $00000400;
{$EXTERNALSYM FILE_ATTRIBUTE_REPARSE_POINT}
FILE_ATTRIBUTE_COMPRESSED = $00000800;
{$EXTERNALSYM FILE_ATTRIBUTE_COMPRESSED}
FILE_ATTRIBUTE_OFFLINE = $00001000;
{$EXTERNALSYM FILE_ATTRIBUTE_OFFLINE}
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = $00002000;
{$EXTERNALSYM FILE_ATTRIBUTE_NOT_CONTENT_INDEXED}
FILE_ATTRIBUTE_ENCRYPTED = $00004000;
{$EXTERNALSYM FILE_ATTRIBUTE_ENCRYPTED}
FILE_NOTIFY_CHANGE_FILE_NAME = $00000001;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_FILE_NAME}
FILE_NOTIFY_CHANGE_DIR_NAME = $00000002;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_DIR_NAME}
FILE_NOTIFY_CHANGE_ATTRIBUTES = $00000004;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_ATTRIBUTES}
FILE_NOTIFY_CHANGE_SIZE = $00000008;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_SIZE}
FILE_NOTIFY_CHANGE_LAST_WRITE = $00000010;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_LAST_WRITE}
FILE_NOTIFY_CHANGE_LAST_ACCESS = $00000020;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_LAST_ACCESS}
FILE_NOTIFY_CHANGE_CREATION = $00000040;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_CREATION}
FILE_NOTIFY_CHANGE_SECURITY = $00000100;
{$EXTERNALSYM FILE_NOTIFY_CHANGE_SECURITY}
FILE_ACTION_ADDED = $00000001;