This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
advapi32.go
4059 lines (3617 loc) · 161 KB
/
advapi32.go
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
// This file was automatically generated by https://github.com/kbinani/win/blob/generator/internal/cmd/gen/gen.go
// go run internal/cmd/gen/gen.go
// +build windows
package win
import (
"syscall"
"unsafe"
)
var (
// Library
libadvapi32 uintptr
// Functions
abortSystemShutdown uintptr
accessCheck uintptr
accessCheckAndAuditAlarm uintptr
accessCheckByType uintptr
accessCheckByTypeResultList uintptr
addAccessAllowedAce uintptr
addAccessAllowedAceEx uintptr
addAccessAllowedObjectAce uintptr
addAccessDeniedAce uintptr
addAccessDeniedAceEx uintptr
addAccessDeniedObjectAce uintptr
addAce uintptr
addAuditAccessAce uintptr
addAuditAccessAceEx uintptr
addAuditAccessObjectAce uintptr
addConditionalAce uintptr
addMandatoryAce uintptr
addUsersToEncryptedFile uintptr
adjustTokenGroups uintptr
adjustTokenPrivileges uintptr
allocateAndInitializeSid uintptr
allocateLocallyUniqueId uintptr
areAllAccessesGranted uintptr
areAnyAccessesGranted uintptr
auditComputeEffectivePolicyBySid uintptr
auditComputeEffectivePolicyByToken uintptr
auditEnumerateCategories uintptr
auditEnumeratePerUserPolicy uintptr
auditEnumerateSubCategories uintptr
auditFree uintptr
auditLookupCategoryGuidFromCategoryId uintptr
auditLookupCategoryIdFromCategoryGuid uintptr
auditLookupCategoryName uintptr
auditLookupSubCategoryName uintptr
auditQueryPerUserPolicy uintptr
auditQuerySecurity uintptr
auditQuerySystemPolicy uintptr
auditSetPerUserPolicy uintptr
auditSetSecurity uintptr
auditSetSystemPolicy uintptr
backupEventLog uintptr
buildExplicitAccessWithName uintptr
buildImpersonateExplicitAccessWithName uintptr
buildImpersonateTrustee uintptr
buildSecurityDescriptor uintptr
buildTrusteeWithName uintptr
buildTrusteeWithObjectsAndName uintptr
buildTrusteeWithObjectsAndSid uintptr
buildTrusteeWithSid uintptr
changeServiceConfig2 uintptr
changeServiceConfig uintptr
checkTokenMembership uintptr
clearEventLog uintptr
closeEncryptedFileRaw uintptr
closeEventLog uintptr
closeServiceHandle uintptr
closeThreadWaitChainSession uintptr
commandLineFromMsiDescriptor uintptr
controlService uintptr
controlServiceEx uintptr
convertSecurityDescriptorToStringSecurityDescriptor uintptr
convertSidToStringSid uintptr
convertStringSecurityDescriptorToSecurityDescriptor uintptr
convertStringSidToSid uintptr
convertToAutoInheritPrivateObjectSecurity uintptr
copySid uintptr
createPrivateObjectSecurity uintptr
createPrivateObjectSecurityEx uintptr
createPrivateObjectSecurityWithMultipleInheritance uintptr
createProcessAsUser uintptr
createProcessWithLogonW uintptr
createProcessWithTokenW uintptr
createService uintptr
credDelete uintptr
credEnumerate uintptr
credFree uintptr
credGetSessionTypes uintptr
credIsMarshaledCredential uintptr
credRename uintptr
credUnprotect uintptr
credWrite uintptr
cryptAcquireContext uintptr
cryptContextAddRef uintptr
cryptCreateHash uintptr
cryptDecrypt uintptr
cryptDeriveKey uintptr
cryptDestroyHash uintptr
cryptDestroyKey uintptr
cryptDuplicateHash uintptr
cryptDuplicateKey uintptr
cryptEncrypt uintptr
cryptEnumProviderTypes uintptr
cryptEnumProviders uintptr
cryptExportKey uintptr
cryptGenKey uintptr
cryptGenRandom uintptr
cryptGetDefaultProvider uintptr
cryptGetHashParam uintptr
cryptGetKeyParam uintptr
cryptGetProvParam uintptr
cryptGetUserKey uintptr
cryptHashData uintptr
cryptHashSessionKey uintptr
cryptImportKey uintptr
cryptReleaseContext uintptr
cryptSetHashParam uintptr
cryptSetKeyParam uintptr
cryptSetProvParam uintptr
cryptSetProviderEx uintptr
cryptSetProvider uintptr
cryptSignHash uintptr
cryptVerifySignature uintptr
decryptFile uintptr
deleteAce uintptr
deleteService uintptr
deregisterEventSource uintptr
destroyPrivateObjectSecurity uintptr
duplicateEncryptionInfoFile uintptr
duplicateToken uintptr
encryptFile uintptr
encryptionDisable uintptr
equalDomainSid uintptr
equalPrefixSid uintptr
equalSid uintptr
fileEncryptionStatus uintptr
findFirstFreeAce uintptr
freeSid uintptr
getAce uintptr
getEventLogInformation uintptr
getFileSecurity uintptr
getKernelObjectSecurity uintptr
getLengthSid uintptr
getLocalManagedApplicationData uintptr
getMultipleTrusteeOperation uintptr
getMultipleTrustee uintptr
getNumberOfEventLogRecords uintptr
getOldestEventLogRecord uintptr
getPrivateObjectSecurity uintptr
getSecurityDescriptorControl uintptr
getSecurityDescriptorGroup uintptr
getSecurityDescriptorLength uintptr
getSecurityDescriptorOwner uintptr
getSecurityDescriptorRMControl uintptr
getServiceDisplayName uintptr
getServiceKeyName uintptr
getSidIdentifierAuthority uintptr
getSidLengthRequired uintptr
getSidSubAuthority uintptr
getSidSubAuthorityCount uintptr
getTrusteeForm uintptr
getTrusteeName uintptr
getTrusteeType uintptr
getUserName uintptr
getWindowsAccountDomainSid uintptr
impersonateAnonymousToken uintptr
impersonateLoggedOnUser uintptr
impersonateNamedPipeClient uintptr
impersonateSelf uintptr
initializeAcl uintptr
initializeSecurityDescriptor uintptr
initializeSid uintptr
initiateShutdown uintptr
initiateSystemShutdownEx uintptr
initiateSystemShutdown uintptr
isTextUnicode uintptr
isTokenRestricted uintptr
isTokenUntrusted uintptr
isValidAcl uintptr
isValidSecurityDescriptor uintptr
isValidSid uintptr
lockServiceDatabase uintptr
logonUser uintptr
lookupPrivilegeDisplayName uintptr
lookupPrivilegeName uintptr
lookupPrivilegeValue uintptr
makeAbsoluteSD uintptr
makeSelfRelativeSD uintptr
mapGenericMask uintptr
notifyBootConfigStatus uintptr
notifyChangeEventLog uintptr
objectCloseAuditAlarm uintptr
objectDeleteAuditAlarm uintptr
objectOpenAuditAlarm uintptr
objectPrivilegeAuditAlarm uintptr
openBackupEventLog uintptr
openEncryptedFileRaw uintptr
openEventLog uintptr
openProcessToken uintptr
openSCManager uintptr
openService uintptr
openThreadToken uintptr
perfCreateInstance uintptr
perfDecrementULongCounterValue uintptr
perfDecrementULongLongCounterValue uintptr
perfDeleteInstance uintptr
perfIncrementULongCounterValue uintptr
perfIncrementULongLongCounterValue uintptr
perfQueryInstance uintptr
perfSetCounterRefValue uintptr
perfSetULongCounterValue uintptr
perfSetULongLongCounterValue uintptr
perfStopProvider uintptr
privilegeCheck uintptr
privilegedServiceAuditAlarm uintptr
querySecurityAccessMask uintptr
queryServiceConfig2 uintptr
queryServiceObjectSecurity uintptr
queryServiceStatus uintptr
readEventLog uintptr
regCloseKey uintptr
regConnectRegistryEx uintptr
regConnectRegistry uintptr
regCopyTree uintptr
regCreateKeyEx uintptr
regCreateKeyTransacted uintptr
regCreateKey uintptr
regDeleteKeyEx uintptr
regDeleteKeyTransacted uintptr
regDeleteKeyValue uintptr
regDeleteKey uintptr
regDeleteTree uintptr
regDeleteValue uintptr
regDisablePredefinedCache uintptr
regDisablePredefinedCacheEx uintptr
regDisableReflectionKey uintptr
regEnableReflectionKey uintptr
regEnumKey uintptr
regEnumValue uintptr
regFlushKey uintptr
regGetKeySecurity uintptr
regGetValue uintptr
regLoadAppKey uintptr
regLoadKey uintptr
regLoadMUIString uintptr
regNotifyChangeKeyValue uintptr
regOpenCurrentUser uintptr
regOpenKeyEx uintptr
regOpenKeyTransacted uintptr
regOpenKey uintptr
regOpenUserClassesRoot uintptr
regOverridePredefKey uintptr
regQueryReflectionKey uintptr
regQueryValueEx uintptr
regQueryValue uintptr
regReplaceKey uintptr
regRestoreKey uintptr
regSaveKeyEx uintptr
regSaveKey uintptr
regSetKeySecurity uintptr
regSetKeyValue uintptr
regSetValueEx uintptr
regSetValue uintptr
regUnLoadKey uintptr
registerEventSource uintptr
registerServiceCtrlHandlerEx uintptr
reportEvent uintptr
revertToSelf uintptr
saferCloseLevel uintptr
saferComputeTokenFromLevel uintptr
saferCreateLevel uintptr
saferRecordEventLogEntry uintptr
saferiIsExecutableFileType uintptr
setFileSecurity uintptr
setKernelObjectSecurity uintptr
setNamedSecurityInfo uintptr
setPrivateObjectSecurity uintptr
setPrivateObjectSecurityEx uintptr
setSecurityAccessMask uintptr
setSecurityDescriptorControl uintptr
setSecurityDescriptorDacl uintptr
setSecurityDescriptorGroup uintptr
setSecurityDescriptorOwner uintptr
setSecurityDescriptorRMControl uintptr
setSecurityDescriptorSacl uintptr
setSecurityInfo uintptr
setServiceBits uintptr
setServiceObjectSecurity uintptr
setServiceStatus uintptr
setThreadToken uintptr
setUserFileEncryptionKey uintptr
startService uintptr
uninstallApplication uintptr
unlockServiceDatabase uintptr
wow64Win32ApiEntry uintptr
eventActivityIdControl uintptr
lsaNtStatusToWinError uintptr
systemFunction001 uintptr
systemFunction002 uintptr
systemFunction003 uintptr
systemFunction006 uintptr
systemFunction008 uintptr
systemFunction009 uintptr
systemFunction010 uintptr
systemFunction012 uintptr
systemFunction013 uintptr
systemFunction024 uintptr
systemFunction025 uintptr
systemFunction030 uintptr
systemFunction035 uintptr
systemFunction036 uintptr
systemFunction040 uintptr
systemFunction041 uintptr
)
func init() {
// Library
libadvapi32 = doLoadLibrary("advapi32.dll")
// Functions
abortSystemShutdown = doGetProcAddress(libadvapi32, "AbortSystemShutdownW")
accessCheck = doGetProcAddress(libadvapi32, "AccessCheck")
accessCheckAndAuditAlarm = doGetProcAddress(libadvapi32, "AccessCheckAndAuditAlarmW")
accessCheckByType = doGetProcAddress(libadvapi32, "AccessCheckByType")
accessCheckByTypeResultList = doGetProcAddress(libadvapi32, "AccessCheckByTypeResultList")
addAccessAllowedAce = doGetProcAddress(libadvapi32, "AddAccessAllowedAce")
addAccessAllowedAceEx = doGetProcAddress(libadvapi32, "AddAccessAllowedAceEx")
addAccessAllowedObjectAce = doGetProcAddress(libadvapi32, "AddAccessAllowedObjectAce")
addAccessDeniedAce = doGetProcAddress(libadvapi32, "AddAccessDeniedAce")
addAccessDeniedAceEx = doGetProcAddress(libadvapi32, "AddAccessDeniedAceEx")
addAccessDeniedObjectAce = doGetProcAddress(libadvapi32, "AddAccessDeniedObjectAce")
addAce = doGetProcAddress(libadvapi32, "AddAce")
addAuditAccessAce = doGetProcAddress(libadvapi32, "AddAuditAccessAce")
addAuditAccessAceEx = doGetProcAddress(libadvapi32, "AddAuditAccessAceEx")
addAuditAccessObjectAce = doGetProcAddress(libadvapi32, "AddAuditAccessObjectAce")
addConditionalAce = doGetProcAddress(libadvapi32, "AddConditionalAce")
addMandatoryAce = doGetProcAddress(libadvapi32, "AddMandatoryAce")
addUsersToEncryptedFile = doGetProcAddress(libadvapi32, "AddUsersToEncryptedFile")
adjustTokenGroups = doGetProcAddress(libadvapi32, "AdjustTokenGroups")
adjustTokenPrivileges = doGetProcAddress(libadvapi32, "AdjustTokenPrivileges")
allocateAndInitializeSid = doGetProcAddress(libadvapi32, "AllocateAndInitializeSid")
allocateLocallyUniqueId = doGetProcAddress(libadvapi32, "AllocateLocallyUniqueId")
areAllAccessesGranted = doGetProcAddress(libadvapi32, "AreAllAccessesGranted")
areAnyAccessesGranted = doGetProcAddress(libadvapi32, "AreAnyAccessesGranted")
auditComputeEffectivePolicyBySid = doGetProcAddress(libadvapi32, "AuditComputeEffectivePolicyBySid")
auditComputeEffectivePolicyByToken = doGetProcAddress(libadvapi32, "AuditComputeEffectivePolicyByToken")
auditEnumerateCategories = doGetProcAddress(libadvapi32, "AuditEnumerateCategories")
auditEnumeratePerUserPolicy = doGetProcAddress(libadvapi32, "AuditEnumeratePerUserPolicy")
auditEnumerateSubCategories = doGetProcAddress(libadvapi32, "AuditEnumerateSubCategories")
auditFree = doGetProcAddress(libadvapi32, "AuditFree")
auditLookupCategoryGuidFromCategoryId = doGetProcAddress(libadvapi32, "AuditLookupCategoryGuidFromCategoryId")
auditLookupCategoryIdFromCategoryGuid = doGetProcAddress(libadvapi32, "AuditLookupCategoryIdFromCategoryGuid")
auditLookupCategoryName = doGetProcAddress(libadvapi32, "AuditLookupCategoryNameW")
auditLookupSubCategoryName = doGetProcAddress(libadvapi32, "AuditLookupSubCategoryNameW")
auditQueryPerUserPolicy = doGetProcAddress(libadvapi32, "AuditQueryPerUserPolicy")
auditQuerySecurity = doGetProcAddress(libadvapi32, "AuditQuerySecurity")
auditQuerySystemPolicy = doGetProcAddress(libadvapi32, "AuditQuerySystemPolicy")
auditSetPerUserPolicy = doGetProcAddress(libadvapi32, "AuditSetPerUserPolicy")
auditSetSecurity = doGetProcAddress(libadvapi32, "AuditSetSecurity")
auditSetSystemPolicy = doGetProcAddress(libadvapi32, "AuditSetSystemPolicy")
backupEventLog = doGetProcAddress(libadvapi32, "BackupEventLogW")
buildExplicitAccessWithName = doGetProcAddress(libadvapi32, "BuildExplicitAccessWithNameW")
buildImpersonateExplicitAccessWithName = doGetProcAddress(libadvapi32, "BuildImpersonateExplicitAccessWithNameW")
buildImpersonateTrustee = doGetProcAddress(libadvapi32, "BuildImpersonateTrusteeW")
buildSecurityDescriptor = doGetProcAddress(libadvapi32, "BuildSecurityDescriptorW")
buildTrusteeWithName = doGetProcAddress(libadvapi32, "BuildTrusteeWithNameW")
buildTrusteeWithObjectsAndName = doGetProcAddress(libadvapi32, "BuildTrusteeWithObjectsAndNameW")
buildTrusteeWithObjectsAndSid = doGetProcAddress(libadvapi32, "BuildTrusteeWithObjectsAndSidW")
buildTrusteeWithSid = doGetProcAddress(libadvapi32, "BuildTrusteeWithSidW")
changeServiceConfig2 = doGetProcAddress(libadvapi32, "ChangeServiceConfig2W")
changeServiceConfig = doGetProcAddress(libadvapi32, "ChangeServiceConfigW")
checkTokenMembership = doGetProcAddress(libadvapi32, "CheckTokenMembership")
clearEventLog = doGetProcAddress(libadvapi32, "ClearEventLogW")
closeEncryptedFileRaw = doGetProcAddress(libadvapi32, "CloseEncryptedFileRaw")
closeEventLog = doGetProcAddress(libadvapi32, "CloseEventLog")
closeServiceHandle = doGetProcAddress(libadvapi32, "CloseServiceHandle")
closeThreadWaitChainSession = doGetProcAddress(libadvapi32, "CloseThreadWaitChainSession")
commandLineFromMsiDescriptor = doGetProcAddress(libadvapi32, "CommandLineFromMsiDescriptor")
controlService = doGetProcAddress(libadvapi32, "ControlService")
controlServiceEx = doGetProcAddress(libadvapi32, "ControlServiceExW")
convertSecurityDescriptorToStringSecurityDescriptor = doGetProcAddress(libadvapi32, "ConvertSecurityDescriptorToStringSecurityDescriptorW")
convertSidToStringSid = doGetProcAddress(libadvapi32, "ConvertSidToStringSidW")
convertStringSecurityDescriptorToSecurityDescriptor = doGetProcAddress(libadvapi32, "ConvertStringSecurityDescriptorToSecurityDescriptorW")
convertStringSidToSid = doGetProcAddress(libadvapi32, "ConvertStringSidToSidW")
convertToAutoInheritPrivateObjectSecurity = doGetProcAddress(libadvapi32, "ConvertToAutoInheritPrivateObjectSecurity")
copySid = doGetProcAddress(libadvapi32, "CopySid")
createPrivateObjectSecurity = doGetProcAddress(libadvapi32, "CreatePrivateObjectSecurity")
createPrivateObjectSecurityEx = doGetProcAddress(libadvapi32, "CreatePrivateObjectSecurityEx")
createPrivateObjectSecurityWithMultipleInheritance = doGetProcAddress(libadvapi32, "CreatePrivateObjectSecurityWithMultipleInheritance")
createProcessAsUser = doGetProcAddress(libadvapi32, "CreateProcessAsUserW")
createProcessWithLogonW = doGetProcAddress(libadvapi32, "CreateProcessWithLogonW")
createProcessWithTokenW = doGetProcAddress(libadvapi32, "CreateProcessWithTokenW")
createService = doGetProcAddress(libadvapi32, "CreateServiceW")
credDelete = doGetProcAddress(libadvapi32, "CredDeleteW")
credEnumerate = doGetProcAddress(libadvapi32, "CredEnumerateW")
credFree = doGetProcAddress(libadvapi32, "CredFree")
credGetSessionTypes = doGetProcAddress(libadvapi32, "CredGetSessionTypes")
credIsMarshaledCredential = doGetProcAddress(libadvapi32, "CredIsMarshaledCredentialW")
credRename = doGetProcAddress(libadvapi32, "CredRenameW")
credUnprotect = doGetProcAddress(libadvapi32, "CredUnprotectW")
credWrite = doGetProcAddress(libadvapi32, "CredWriteW")
cryptAcquireContext = doGetProcAddress(libadvapi32, "CryptAcquireContextW")
cryptContextAddRef = doGetProcAddress(libadvapi32, "CryptContextAddRef")
cryptCreateHash = doGetProcAddress(libadvapi32, "CryptCreateHash")
cryptDecrypt = doGetProcAddress(libadvapi32, "CryptDecrypt")
cryptDeriveKey = doGetProcAddress(libadvapi32, "CryptDeriveKey")
cryptDestroyHash = doGetProcAddress(libadvapi32, "CryptDestroyHash")
cryptDestroyKey = doGetProcAddress(libadvapi32, "CryptDestroyKey")
cryptDuplicateHash = doGetProcAddress(libadvapi32, "CryptDuplicateHash")
cryptDuplicateKey = doGetProcAddress(libadvapi32, "CryptDuplicateKey")
cryptEncrypt = doGetProcAddress(libadvapi32, "CryptEncrypt")
cryptEnumProviderTypes = doGetProcAddress(libadvapi32, "CryptEnumProviderTypesW")
cryptEnumProviders = doGetProcAddress(libadvapi32, "CryptEnumProvidersW")
cryptExportKey = doGetProcAddress(libadvapi32, "CryptExportKey")
cryptGenKey = doGetProcAddress(libadvapi32, "CryptGenKey")
cryptGenRandom = doGetProcAddress(libadvapi32, "CryptGenRandom")
cryptGetDefaultProvider = doGetProcAddress(libadvapi32, "CryptGetDefaultProviderW")
cryptGetHashParam = doGetProcAddress(libadvapi32, "CryptGetHashParam")
cryptGetKeyParam = doGetProcAddress(libadvapi32, "CryptGetKeyParam")
cryptGetProvParam = doGetProcAddress(libadvapi32, "CryptGetProvParam")
cryptGetUserKey = doGetProcAddress(libadvapi32, "CryptGetUserKey")
cryptHashData = doGetProcAddress(libadvapi32, "CryptHashData")
cryptHashSessionKey = doGetProcAddress(libadvapi32, "CryptHashSessionKey")
cryptImportKey = doGetProcAddress(libadvapi32, "CryptImportKey")
cryptReleaseContext = doGetProcAddress(libadvapi32, "CryptReleaseContext")
cryptSetHashParam = doGetProcAddress(libadvapi32, "CryptSetHashParam")
cryptSetKeyParam = doGetProcAddress(libadvapi32, "CryptSetKeyParam")
cryptSetProvParam = doGetProcAddress(libadvapi32, "CryptSetProvParam")
cryptSetProviderEx = doGetProcAddress(libadvapi32, "CryptSetProviderExW")
cryptSetProvider = doGetProcAddress(libadvapi32, "CryptSetProviderW")
cryptSignHash = doGetProcAddress(libadvapi32, "CryptSignHashW")
cryptVerifySignature = doGetProcAddress(libadvapi32, "CryptVerifySignatureW")
decryptFile = doGetProcAddress(libadvapi32, "DecryptFileW")
deleteAce = doGetProcAddress(libadvapi32, "DeleteAce")
deleteService = doGetProcAddress(libadvapi32, "DeleteService")
deregisterEventSource = doGetProcAddress(libadvapi32, "DeregisterEventSource")
destroyPrivateObjectSecurity = doGetProcAddress(libadvapi32, "DestroyPrivateObjectSecurity")
duplicateEncryptionInfoFile = doGetProcAddress(libadvapi32, "DuplicateEncryptionInfoFile")
duplicateToken = doGetProcAddress(libadvapi32, "DuplicateToken")
encryptFile = doGetProcAddress(libadvapi32, "EncryptFileW")
encryptionDisable = doGetProcAddress(libadvapi32, "EncryptionDisable")
equalDomainSid = doGetProcAddress(libadvapi32, "EqualDomainSid")
equalPrefixSid = doGetProcAddress(libadvapi32, "EqualPrefixSid")
equalSid = doGetProcAddress(libadvapi32, "EqualSid")
fileEncryptionStatus = doGetProcAddress(libadvapi32, "FileEncryptionStatusW")
findFirstFreeAce = doGetProcAddress(libadvapi32, "FindFirstFreeAce")
freeSid = doGetProcAddress(libadvapi32, "FreeSid")
getAce = doGetProcAddress(libadvapi32, "GetAce")
getEventLogInformation = doGetProcAddress(libadvapi32, "GetEventLogInformation")
getFileSecurity = doGetProcAddress(libadvapi32, "GetFileSecurityW")
getKernelObjectSecurity = doGetProcAddress(libadvapi32, "GetKernelObjectSecurity")
getLengthSid = doGetProcAddress(libadvapi32, "GetLengthSid")
getLocalManagedApplicationData = doGetProcAddress(libadvapi32, "GetLocalManagedApplicationData")
getMultipleTrusteeOperation = doGetProcAddress(libadvapi32, "GetMultipleTrusteeOperationW")
getMultipleTrustee = doGetProcAddress(libadvapi32, "GetMultipleTrusteeW")
getNumberOfEventLogRecords = doGetProcAddress(libadvapi32, "GetNumberOfEventLogRecords")
getOldestEventLogRecord = doGetProcAddress(libadvapi32, "GetOldestEventLogRecord")
getPrivateObjectSecurity = doGetProcAddress(libadvapi32, "GetPrivateObjectSecurity")
getSecurityDescriptorControl = doGetProcAddress(libadvapi32, "GetSecurityDescriptorControl")
getSecurityDescriptorGroup = doGetProcAddress(libadvapi32, "GetSecurityDescriptorGroup")
getSecurityDescriptorLength = doGetProcAddress(libadvapi32, "GetSecurityDescriptorLength")
getSecurityDescriptorOwner = doGetProcAddress(libadvapi32, "GetSecurityDescriptorOwner")
getSecurityDescriptorRMControl = doGetProcAddress(libadvapi32, "GetSecurityDescriptorRMControl")
getServiceDisplayName = doGetProcAddress(libadvapi32, "GetServiceDisplayNameW")
getServiceKeyName = doGetProcAddress(libadvapi32, "GetServiceKeyNameW")
getSidIdentifierAuthority = doGetProcAddress(libadvapi32, "GetSidIdentifierAuthority")
getSidLengthRequired = doGetProcAddress(libadvapi32, "GetSidLengthRequired")
getSidSubAuthority = doGetProcAddress(libadvapi32, "GetSidSubAuthority")
getSidSubAuthorityCount = doGetProcAddress(libadvapi32, "GetSidSubAuthorityCount")
getTrusteeForm = doGetProcAddress(libadvapi32, "GetTrusteeFormW")
getTrusteeName = doGetProcAddress(libadvapi32, "GetTrusteeNameW")
getTrusteeType = doGetProcAddress(libadvapi32, "GetTrusteeTypeW")
getUserName = doGetProcAddress(libadvapi32, "GetUserNameW")
getWindowsAccountDomainSid = doGetProcAddress(libadvapi32, "GetWindowsAccountDomainSid")
impersonateAnonymousToken = doGetProcAddress(libadvapi32, "ImpersonateAnonymousToken")
impersonateLoggedOnUser = doGetProcAddress(libadvapi32, "ImpersonateLoggedOnUser")
impersonateNamedPipeClient = doGetProcAddress(libadvapi32, "ImpersonateNamedPipeClient")
impersonateSelf = doGetProcAddress(libadvapi32, "ImpersonateSelf")
initializeAcl = doGetProcAddress(libadvapi32, "InitializeAcl")
initializeSecurityDescriptor = doGetProcAddress(libadvapi32, "InitializeSecurityDescriptor")
initializeSid = doGetProcAddress(libadvapi32, "InitializeSid")
initiateShutdown = doGetProcAddress(libadvapi32, "InitiateShutdownW")
initiateSystemShutdownEx = doGetProcAddress(libadvapi32, "InitiateSystemShutdownExW")
initiateSystemShutdown = doGetProcAddress(libadvapi32, "InitiateSystemShutdownW")
isTextUnicode = doGetProcAddress(libadvapi32, "IsTextUnicode")
isTokenRestricted = doGetProcAddress(libadvapi32, "IsTokenRestricted")
isTokenUntrusted = doGetProcAddress(libadvapi32, "IsTokenUntrusted")
isValidAcl = doGetProcAddress(libadvapi32, "IsValidAcl")
isValidSecurityDescriptor = doGetProcAddress(libadvapi32, "IsValidSecurityDescriptor")
isValidSid = doGetProcAddress(libadvapi32, "IsValidSid")
lockServiceDatabase = doGetProcAddress(libadvapi32, "LockServiceDatabase")
logonUser = doGetProcAddress(libadvapi32, "LogonUserW")
lookupPrivilegeDisplayName = doGetProcAddress(libadvapi32, "LookupPrivilegeDisplayNameW")
lookupPrivilegeName = doGetProcAddress(libadvapi32, "LookupPrivilegeNameW")
lookupPrivilegeValue = doGetProcAddress(libadvapi32, "LookupPrivilegeValueW")
makeAbsoluteSD = doGetProcAddress(libadvapi32, "MakeAbsoluteSD")
makeSelfRelativeSD = doGetProcAddress(libadvapi32, "MakeSelfRelativeSD")
mapGenericMask = doGetProcAddress(libadvapi32, "MapGenericMask")
notifyBootConfigStatus = doGetProcAddress(libadvapi32, "NotifyBootConfigStatus")
notifyChangeEventLog = doGetProcAddress(libadvapi32, "NotifyChangeEventLog")
objectCloseAuditAlarm = doGetProcAddress(libadvapi32, "ObjectCloseAuditAlarmW")
objectDeleteAuditAlarm = doGetProcAddress(libadvapi32, "ObjectDeleteAuditAlarmW")
objectOpenAuditAlarm = doGetProcAddress(libadvapi32, "ObjectOpenAuditAlarmW")
objectPrivilegeAuditAlarm = doGetProcAddress(libadvapi32, "ObjectPrivilegeAuditAlarmW")
openBackupEventLog = doGetProcAddress(libadvapi32, "OpenBackupEventLogW")
openEncryptedFileRaw = doGetProcAddress(libadvapi32, "OpenEncryptedFileRawW")
openEventLog = doGetProcAddress(libadvapi32, "OpenEventLogW")
openProcessToken = doGetProcAddress(libadvapi32, "OpenProcessToken")
openSCManager = doGetProcAddress(libadvapi32, "OpenSCManagerW")
openService = doGetProcAddress(libadvapi32, "OpenServiceW")
openThreadToken = doGetProcAddress(libadvapi32, "OpenThreadToken")
perfCreateInstance = doGetProcAddress(libadvapi32, "PerfCreateInstance")
perfDecrementULongCounterValue = doGetProcAddress(libadvapi32, "PerfDecrementULongCounterValue")
perfDecrementULongLongCounterValue = doGetProcAddress(libadvapi32, "PerfDecrementULongLongCounterValue")
perfDeleteInstance = doGetProcAddress(libadvapi32, "PerfDeleteInstance")
perfIncrementULongCounterValue = doGetProcAddress(libadvapi32, "PerfIncrementULongCounterValue")
perfIncrementULongLongCounterValue = doGetProcAddress(libadvapi32, "PerfIncrementULongLongCounterValue")
perfQueryInstance = doGetProcAddress(libadvapi32, "PerfQueryInstance")
perfSetCounterRefValue = doGetProcAddress(libadvapi32, "PerfSetCounterRefValue")
perfSetULongCounterValue = doGetProcAddress(libadvapi32, "PerfSetULongCounterValue")
perfSetULongLongCounterValue = doGetProcAddress(libadvapi32, "PerfSetULongLongCounterValue")
perfStopProvider = doGetProcAddress(libadvapi32, "PerfStopProvider")
privilegeCheck = doGetProcAddress(libadvapi32, "PrivilegeCheck")
privilegedServiceAuditAlarm = doGetProcAddress(libadvapi32, "PrivilegedServiceAuditAlarmW")
querySecurityAccessMask = doGetProcAddress(libadvapi32, "QuerySecurityAccessMask")
queryServiceConfig2 = doGetProcAddress(libadvapi32, "QueryServiceConfig2W")
queryServiceObjectSecurity = doGetProcAddress(libadvapi32, "QueryServiceObjectSecurity")
queryServiceStatus = doGetProcAddress(libadvapi32, "QueryServiceStatus")
readEventLog = doGetProcAddress(libadvapi32, "ReadEventLogW")
regCloseKey = doGetProcAddress(libadvapi32, "RegCloseKey")
regConnectRegistryEx = doGetProcAddress(libadvapi32, "RegConnectRegistryExW")
regConnectRegistry = doGetProcAddress(libadvapi32, "RegConnectRegistryW")
regCopyTree = doGetProcAddress(libadvapi32, "RegCopyTreeW")
regCreateKeyEx = doGetProcAddress(libadvapi32, "RegCreateKeyExW")
regCreateKeyTransacted = doGetProcAddress(libadvapi32, "RegCreateKeyTransactedW")
regCreateKey = doGetProcAddress(libadvapi32, "RegCreateKeyW")
regDeleteKeyEx = doGetProcAddress(libadvapi32, "RegDeleteKeyExW")
regDeleteKeyTransacted = doGetProcAddress(libadvapi32, "RegDeleteKeyTransactedW")
regDeleteKeyValue = doGetProcAddress(libadvapi32, "RegDeleteKeyValueW")
regDeleteKey = doGetProcAddress(libadvapi32, "RegDeleteKeyW")
regDeleteTree = doGetProcAddress(libadvapi32, "RegDeleteTreeW")
regDeleteValue = doGetProcAddress(libadvapi32, "RegDeleteValueW")
regDisablePredefinedCache = doGetProcAddress(libadvapi32, "RegDisablePredefinedCache")
regDisablePredefinedCacheEx = doGetProcAddress(libadvapi32, "RegDisablePredefinedCacheEx")
regDisableReflectionKey = doGetProcAddress(libadvapi32, "RegDisableReflectionKey")
regEnableReflectionKey = doGetProcAddress(libadvapi32, "RegEnableReflectionKey")
regEnumKey = doGetProcAddress(libadvapi32, "RegEnumKeyW")
regEnumValue = doGetProcAddress(libadvapi32, "RegEnumValueW")
regFlushKey = doGetProcAddress(libadvapi32, "RegFlushKey")
regGetKeySecurity = doGetProcAddress(libadvapi32, "RegGetKeySecurity")
regGetValue = doGetProcAddress(libadvapi32, "RegGetValueW")
regLoadAppKey = doGetProcAddress(libadvapi32, "RegLoadAppKeyW")
regLoadKey = doGetProcAddress(libadvapi32, "RegLoadKeyW")
regLoadMUIString = doGetProcAddress(libadvapi32, "RegLoadMUIStringW")
regNotifyChangeKeyValue = doGetProcAddress(libadvapi32, "RegNotifyChangeKeyValue")
regOpenCurrentUser = doGetProcAddress(libadvapi32, "RegOpenCurrentUser")
regOpenKeyEx = doGetProcAddress(libadvapi32, "RegOpenKeyExW")
regOpenKeyTransacted = doGetProcAddress(libadvapi32, "RegOpenKeyTransactedW")
regOpenKey = doGetProcAddress(libadvapi32, "RegOpenKeyW")
regOpenUserClassesRoot = doGetProcAddress(libadvapi32, "RegOpenUserClassesRoot")
regOverridePredefKey = doGetProcAddress(libadvapi32, "RegOverridePredefKey")
regQueryReflectionKey = doGetProcAddress(libadvapi32, "RegQueryReflectionKey")
regQueryValueEx = doGetProcAddress(libadvapi32, "RegQueryValueExW")
regQueryValue = doGetProcAddress(libadvapi32, "RegQueryValueW")
regReplaceKey = doGetProcAddress(libadvapi32, "RegReplaceKeyW")
regRestoreKey = doGetProcAddress(libadvapi32, "RegRestoreKeyW")
regSaveKeyEx = doGetProcAddress(libadvapi32, "RegSaveKeyExW")
regSaveKey = doGetProcAddress(libadvapi32, "RegSaveKeyW")
regSetKeySecurity = doGetProcAddress(libadvapi32, "RegSetKeySecurity")
regSetKeyValue = doGetProcAddress(libadvapi32, "RegSetKeyValueW")
regSetValueEx = doGetProcAddress(libadvapi32, "RegSetValueExW")
regSetValue = doGetProcAddress(libadvapi32, "RegSetValueW")
regUnLoadKey = doGetProcAddress(libadvapi32, "RegUnLoadKeyW")
registerEventSource = doGetProcAddress(libadvapi32, "RegisterEventSourceW")
registerServiceCtrlHandlerEx = doGetProcAddress(libadvapi32, "RegisterServiceCtrlHandlerExW")
reportEvent = doGetProcAddress(libadvapi32, "ReportEventW")
revertToSelf = doGetProcAddress(libadvapi32, "RevertToSelf")
saferCloseLevel = doGetProcAddress(libadvapi32, "SaferCloseLevel")
saferComputeTokenFromLevel = doGetProcAddress(libadvapi32, "SaferComputeTokenFromLevel")
saferCreateLevel = doGetProcAddress(libadvapi32, "SaferCreateLevel")
saferRecordEventLogEntry = doGetProcAddress(libadvapi32, "SaferRecordEventLogEntry")
saferiIsExecutableFileType = doGetProcAddress(libadvapi32, "SaferiIsExecutableFileType")
setFileSecurity = doGetProcAddress(libadvapi32, "SetFileSecurityW")
setKernelObjectSecurity = doGetProcAddress(libadvapi32, "SetKernelObjectSecurity")
setNamedSecurityInfo = doGetProcAddress(libadvapi32, "SetNamedSecurityInfoW")
setPrivateObjectSecurity = doGetProcAddress(libadvapi32, "SetPrivateObjectSecurity")
setPrivateObjectSecurityEx = doGetProcAddress(libadvapi32, "SetPrivateObjectSecurityEx")
setSecurityAccessMask = doGetProcAddress(libadvapi32, "SetSecurityAccessMask")
setSecurityDescriptorControl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorControl")
setSecurityDescriptorDacl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorDacl")
setSecurityDescriptorGroup = doGetProcAddress(libadvapi32, "SetSecurityDescriptorGroup")
setSecurityDescriptorOwner = doGetProcAddress(libadvapi32, "SetSecurityDescriptorOwner")
setSecurityDescriptorRMControl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorRMControl")
setSecurityDescriptorSacl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorSacl")
setSecurityInfo = doGetProcAddress(libadvapi32, "SetSecurityInfo")
setServiceBits = doGetProcAddress(libadvapi32, "SetServiceBits")
setServiceObjectSecurity = doGetProcAddress(libadvapi32, "SetServiceObjectSecurity")
setServiceStatus = doGetProcAddress(libadvapi32, "SetServiceStatus")
setThreadToken = doGetProcAddress(libadvapi32, "SetThreadToken")
setUserFileEncryptionKey = doGetProcAddress(libadvapi32, "SetUserFileEncryptionKey")
startService = doGetProcAddress(libadvapi32, "StartServiceW")
uninstallApplication = doGetProcAddress(libadvapi32, "UninstallApplication")
unlockServiceDatabase = doGetProcAddress(libadvapi32, "UnlockServiceDatabase")
wow64Win32ApiEntry = doGetProcAddress(libadvapi32, "Wow64Win32ApiEntry")
eventActivityIdControl = doGetProcAddress(libadvapi32, "EventActivityIdControl")
lsaNtStatusToWinError = doGetProcAddress(libadvapi32, "LsaNtStatusToWinError")
systemFunction001 = doGetProcAddress(libadvapi32, "SystemFunction001")
systemFunction002 = doGetProcAddress(libadvapi32, "SystemFunction002")
systemFunction003 = doGetProcAddress(libadvapi32, "SystemFunction003")
systemFunction006 = doGetProcAddress(libadvapi32, "SystemFunction006")
systemFunction008 = doGetProcAddress(libadvapi32, "SystemFunction008")
systemFunction009 = doGetProcAddress(libadvapi32, "SystemFunction009")
systemFunction010 = doGetProcAddress(libadvapi32, "SystemFunction010")
systemFunction012 = doGetProcAddress(libadvapi32, "SystemFunction012")
systemFunction013 = doGetProcAddress(libadvapi32, "SystemFunction013")
systemFunction024 = doGetProcAddress(libadvapi32, "SystemFunction024")
systemFunction025 = doGetProcAddress(libadvapi32, "SystemFunction025")
systemFunction030 = doGetProcAddress(libadvapi32, "SystemFunction030")
systemFunction035 = doGetProcAddress(libadvapi32, "SystemFunction035")
systemFunction036 = doGetProcAddress(libadvapi32, "SystemFunction036")
systemFunction040 = doGetProcAddress(libadvapi32, "SystemFunction040")
systemFunction041 = doGetProcAddress(libadvapi32, "SystemFunction041")
}
func AbortSystemShutdown(lpMachineName LPWSTR) bool {
ret1 := syscall3(abortSystemShutdown, 1,
uintptr(unsafe.Pointer(lpMachineName)),
0,
0)
return ret1 != 0
}
func AccessCheck(pSecurityDescriptor PSECURITY_DESCRIPTOR, clientToken HANDLE, desiredAccess DWORD, genericMapping *GENERIC_MAPPING, privilegeSet *PRIVILEGE_SET, privilegeSetLength *uint32, grantedAccess *uint32, accessStatus *BOOL) bool {
ret1 := syscall9(accessCheck, 8,
uintptr(unsafe.Pointer(pSecurityDescriptor)),
uintptr(clientToken),
uintptr(desiredAccess),
uintptr(unsafe.Pointer(genericMapping)),
uintptr(unsafe.Pointer(privilegeSet)),
uintptr(unsafe.Pointer(privilegeSetLength)),
uintptr(unsafe.Pointer(grantedAccess)),
uintptr(unsafe.Pointer(accessStatus)),
0)
return ret1 != 0
}
func AccessCheckAndAuditAlarm(subsystemName string, handleId LPVOID, objectTypeName LPWSTR, objectName LPWSTR, securityDescriptor PSECURITY_DESCRIPTOR, desiredAccess DWORD, genericMapping *GENERIC_MAPPING, objectCreation bool, grantedAccess *uint32, accessStatus *BOOL, pfGenerateOnClose *BOOL) bool {
subsystemNameStr := unicode16FromString(subsystemName)
ret1 := syscall12(accessCheckAndAuditAlarm, 11,
uintptr(unsafe.Pointer(&subsystemNameStr[0])),
uintptr(unsafe.Pointer(handleId)),
uintptr(unsafe.Pointer(objectTypeName)),
uintptr(unsafe.Pointer(objectName)),
uintptr(unsafe.Pointer(securityDescriptor)),
uintptr(desiredAccess),
uintptr(unsafe.Pointer(genericMapping)),
getUintptrFromBool(objectCreation),
uintptr(unsafe.Pointer(grantedAccess)),
uintptr(unsafe.Pointer(accessStatus)),
uintptr(unsafe.Pointer(pfGenerateOnClose)),
0)
return ret1 != 0
}
func AccessCheckByType(pSecurityDescriptor PSECURITY_DESCRIPTOR, principalSelfSid PSID, clientToken HANDLE, desiredAccess DWORD, objectTypeList *OBJECT_TYPE_LIST, objectTypeListLength DWORD, genericMapping *GENERIC_MAPPING, privilegeSet *PRIVILEGE_SET, privilegeSetLength *uint32, grantedAccess *uint32, accessStatus *BOOL) bool {
ret1 := syscall12(accessCheckByType, 11,
uintptr(unsafe.Pointer(pSecurityDescriptor)),
uintptr(principalSelfSid),
uintptr(clientToken),
uintptr(desiredAccess),
uintptr(unsafe.Pointer(objectTypeList)),
uintptr(objectTypeListLength),
uintptr(unsafe.Pointer(genericMapping)),
uintptr(unsafe.Pointer(privilegeSet)),
uintptr(unsafe.Pointer(privilegeSetLength)),
uintptr(unsafe.Pointer(grantedAccess)),
uintptr(unsafe.Pointer(accessStatus)),
0)
return ret1 != 0
}
// TODO: Too many syscall arguments: 18
// func AccessCheckByTypeAndAuditAlarm(subsystemName string, handleId LPVOID, objectTypeName string, objectName string, securityDescriptor PSECURITY_DESCRIPTOR, principalSelfSid PSID, desiredAccess DWORD, auditType AUDIT_EVENT_TYPE, flags DWORD, objectTypeList *OBJECT_TYPE_LIST, objectTypeListLength DWORD, genericMapping *GENERIC_MAPPING, objectCreation bool, grantedAccess *uint32, accessStatus *BOOL, pfGenerateOnClose *BOOL) bool
func AccessCheckByTypeResultList(pSecurityDescriptor PSECURITY_DESCRIPTOR, principalSelfSid PSID, clientToken HANDLE, desiredAccess DWORD, objectTypeList *OBJECT_TYPE_LIST, objectTypeListLength DWORD, genericMapping *GENERIC_MAPPING, privilegeSet *PRIVILEGE_SET, privilegeSetLength *uint32, grantedAccessList *uint32, accessStatusList *uint32) bool {
ret1 := syscall12(accessCheckByTypeResultList, 11,
uintptr(unsafe.Pointer(pSecurityDescriptor)),
uintptr(principalSelfSid),
uintptr(clientToken),
uintptr(desiredAccess),
uintptr(unsafe.Pointer(objectTypeList)),
uintptr(objectTypeListLength),
uintptr(unsafe.Pointer(genericMapping)),
uintptr(unsafe.Pointer(privilegeSet)),
uintptr(unsafe.Pointer(privilegeSetLength)),
uintptr(unsafe.Pointer(grantedAccessList)),
uintptr(unsafe.Pointer(accessStatusList)),
0)
return ret1 != 0
}
// TODO: Too many syscall arguments: 18
// func AccessCheckByTypeResultListAndAuditAlarmByHandle(subsystemName string, handleId LPVOID, clientToken HANDLE, objectTypeName string, objectName string, securityDescriptor PSECURITY_DESCRIPTOR, principalSelfSid PSID, desiredAccess DWORD, auditType AUDIT_EVENT_TYPE, flags DWORD, objectTypeList *OBJECT_TYPE_LIST, objectTypeListLength DWORD, genericMapping *GENERIC_MAPPING, objectCreation bool, grantedAccessList *uint32, accessStatusList *uint32, pfGenerateOnClose *BOOL) bool
// TODO: Too many syscall arguments: 18
// func AccessCheckByTypeResultListAndAuditAlarm(subsystemName string, handleId LPVOID, objectTypeName string, objectName string, securityDescriptor PSECURITY_DESCRIPTOR, principalSelfSid PSID, desiredAccess DWORD, auditType AUDIT_EVENT_TYPE, flags DWORD, objectTypeList *OBJECT_TYPE_LIST, objectTypeListLength DWORD, genericMapping *GENERIC_MAPPING, objectCreation bool, grantedAccessList *uint32, accessStatusList *uint32, pfGenerateOnClose *BOOL) bool
func AddAccessAllowedAce(pAcl *ACL, dwAceRevision DWORD, accessMask DWORD, pSid PSID) bool {
ret1 := syscall6(addAccessAllowedAce, 4,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(accessMask),
uintptr(pSid),
0,
0)
return ret1 != 0
}
func AddAccessAllowedAceEx(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, pSid PSID) bool {
ret1 := syscall6(addAccessAllowedAceEx, 5,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(accessMask),
uintptr(pSid),
0)
return ret1 != 0
}
func AddAccessAllowedObjectAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, objectTypeGuid *GUID, inheritedObjectTypeGuid *GUID, pSid PSID) bool {
ret1 := syscall9(addAccessAllowedObjectAce, 7,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(accessMask),
uintptr(unsafe.Pointer(objectTypeGuid)),
uintptr(unsafe.Pointer(inheritedObjectTypeGuid)),
uintptr(pSid),
0,
0)
return ret1 != 0
}
func AddAccessDeniedAce(pAcl *ACL, dwAceRevision DWORD, accessMask DWORD, pSid PSID) bool {
ret1 := syscall6(addAccessDeniedAce, 4,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(accessMask),
uintptr(pSid),
0,
0)
return ret1 != 0
}
func AddAccessDeniedAceEx(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, pSid PSID) bool {
ret1 := syscall6(addAccessDeniedAceEx, 5,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(accessMask),
uintptr(pSid),
0)
return ret1 != 0
}
func AddAccessDeniedObjectAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, objectTypeGuid *GUID, inheritedObjectTypeGuid *GUID, pSid PSID) bool {
ret1 := syscall9(addAccessDeniedObjectAce, 7,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(accessMask),
uintptr(unsafe.Pointer(objectTypeGuid)),
uintptr(unsafe.Pointer(inheritedObjectTypeGuid)),
uintptr(pSid),
0,
0)
return ret1 != 0
}
func AddAce(pAcl *ACL, dwAceRevision DWORD, dwStartingAceIndex DWORD, pAceList LPVOID, nAceListLength DWORD) bool {
ret1 := syscall6(addAce, 5,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(dwStartingAceIndex),
uintptr(unsafe.Pointer(pAceList)),
uintptr(nAceListLength),
0)
return ret1 != 0
}
func AddAuditAccessAce(pAcl *ACL, dwAceRevision DWORD, dwAccessMask DWORD, pSid PSID, bAuditSuccess bool, bAuditFailure bool) bool {
ret1 := syscall6(addAuditAccessAce, 6,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(dwAccessMask),
uintptr(pSid),
getUintptrFromBool(bAuditSuccess),
getUintptrFromBool(bAuditFailure))
return ret1 != 0
}
func AddAuditAccessAceEx(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, dwAccessMask DWORD, pSid PSID, bAuditSuccess bool, bAuditFailure bool) bool {
ret1 := syscall9(addAuditAccessAceEx, 7,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(dwAccessMask),
uintptr(pSid),
getUintptrFromBool(bAuditSuccess),
getUintptrFromBool(bAuditFailure),
0,
0)
return ret1 != 0
}
func AddAuditAccessObjectAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, objectTypeGuid *GUID, inheritedObjectTypeGuid *GUID, pSid PSID, bAuditSuccess bool, bAuditFailure bool) bool {
ret1 := syscall9(addAuditAccessObjectAce, 9,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(accessMask),
uintptr(unsafe.Pointer(objectTypeGuid)),
uintptr(unsafe.Pointer(inheritedObjectTypeGuid)),
uintptr(pSid),
getUintptrFromBool(bAuditSuccess),
getUintptrFromBool(bAuditFailure))
return ret1 != 0
}
func AddConditionalAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, aceType UCHAR, accessMask DWORD, pSid PSID, conditionStr PWCHAR, returnLength *uint32) bool {
ret1 := syscall9(addConditionalAce, 8,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(aceType),
uintptr(accessMask),
uintptr(pSid),
uintptr(unsafe.Pointer(conditionStr)),
uintptr(unsafe.Pointer(returnLength)),
0)
return ret1 != 0
}
func AddMandatoryAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, mandatoryPolicy DWORD, pLabelSid PSID) bool {
ret1 := syscall6(addMandatoryAce, 5,
uintptr(unsafe.Pointer(pAcl)),
uintptr(dwAceRevision),
uintptr(aceFlags),
uintptr(mandatoryPolicy),
uintptr(pLabelSid),
0)
return ret1 != 0
}
func AddUsersToEncryptedFile(lpFileName string, pUsers *ENCRYPTION_CERTIFICATE_LIST) DWORD {
lpFileNameStr := unicode16FromString(lpFileName)
ret1 := syscall3(addUsersToEncryptedFile, 2,
uintptr(unsafe.Pointer(&lpFileNameStr[0])),
uintptr(unsafe.Pointer(pUsers)),
0)
return DWORD(ret1)
}
func AdjustTokenGroups(tokenHandle HANDLE, resetToDefault bool, newState *TOKEN_GROUPS, bufferLength DWORD, previousState *TOKEN_GROUPS, returnLength *DWORD) bool {
ret1 := syscall6(adjustTokenGroups, 6,
uintptr(tokenHandle),
getUintptrFromBool(resetToDefault),
uintptr(unsafe.Pointer(newState)),
uintptr(bufferLength),
uintptr(unsafe.Pointer(previousState)),
uintptr(unsafe.Pointer(returnLength)))
return ret1 != 0
}
func AdjustTokenPrivileges(tokenHandle HANDLE, disableAllPrivileges bool, newState *TOKEN_PRIVILEGES, bufferLength DWORD, previousState *TOKEN_PRIVILEGES, returnLength *DWORD) bool {
ret1 := syscall6(adjustTokenPrivileges, 6,
uintptr(tokenHandle),
getUintptrFromBool(disableAllPrivileges),
uintptr(unsafe.Pointer(newState)),
uintptr(bufferLength),
uintptr(unsafe.Pointer(previousState)),
uintptr(unsafe.Pointer(returnLength)))
return ret1 != 0
}
func AllocateAndInitializeSid(pIdentifierAuthority *SID_IDENTIFIER_AUTHORITY, nSubAuthorityCount BYTE, nSubAuthority0 DWORD, nSubAuthority1 DWORD, nSubAuthority2 DWORD, nSubAuthority3 DWORD, nSubAuthority4 DWORD, nSubAuthority5 DWORD, nSubAuthority6 DWORD, nSubAuthority7 DWORD, pSid *PSID) bool {
ret1 := syscall12(allocateAndInitializeSid, 11,
uintptr(unsafe.Pointer(pIdentifierAuthority)),
uintptr(nSubAuthorityCount),
uintptr(nSubAuthority0),
uintptr(nSubAuthority1),
uintptr(nSubAuthority2),
uintptr(nSubAuthority3),
uintptr(nSubAuthority4),
uintptr(nSubAuthority5),
uintptr(nSubAuthority6),
uintptr(nSubAuthority7),
uintptr(unsafe.Pointer(pSid)),
0)
return ret1 != 0
}
func AllocateLocallyUniqueId(luid *LUID) bool {
ret1 := syscall3(allocateLocallyUniqueId, 1,
uintptr(unsafe.Pointer(luid)),
0,
0)
return ret1 != 0
}
func AreAllAccessesGranted(grantedAccess DWORD, desiredAccess DWORD) bool {
ret1 := syscall3(areAllAccessesGranted, 2,
uintptr(grantedAccess),
uintptr(desiredAccess),
0)
return ret1 != 0
}
func AreAnyAccessesGranted(grantedAccess DWORD, desiredAccess DWORD) bool {
ret1 := syscall3(areAnyAccessesGranted, 2,
uintptr(grantedAccess),
uintptr(desiredAccess),
0)
return ret1 != 0
}
func AuditComputeEffectivePolicyBySid(pSid /*const*/ PSID, pSubCategoryGuids /*const*/ *GUID, policyCount ULONG, ppAuditPolicy *PAUDIT_POLICY_INFORMATION) BOOLEAN {
ret1 := syscall6(auditComputeEffectivePolicyBySid, 4,
uintptr(pSid),
uintptr(unsafe.Pointer(pSubCategoryGuids)),
uintptr(policyCount),
uintptr(unsafe.Pointer(ppAuditPolicy)),
0,
0)
return BOOLEAN(ret1)
}
func AuditComputeEffectivePolicyByToken(hTokenHandle HANDLE, pSubCategoryGuids /*const*/ *GUID, policyCount ULONG, ppAuditPolicy *PAUDIT_POLICY_INFORMATION) BOOLEAN {
ret1 := syscall6(auditComputeEffectivePolicyByToken, 4,
uintptr(hTokenHandle),
uintptr(unsafe.Pointer(pSubCategoryGuids)),
uintptr(policyCount),
uintptr(unsafe.Pointer(ppAuditPolicy)),
0,
0)
return BOOLEAN(ret1)
}
func AuditEnumerateCategories(ppAuditCategoriesArray uintptr, pCountReturned *uint32) BOOLEAN {
ret1 := syscall3(auditEnumerateCategories, 2,
ppAuditCategoriesArray,
uintptr(unsafe.Pointer(pCountReturned)),
0)
return BOOLEAN(ret1)
}
func AuditEnumeratePerUserPolicy(ppAuditSidArray *PPOLICY_AUDIT_SID_ARRAY) BOOLEAN {
ret1 := syscall3(auditEnumeratePerUserPolicy, 1,
uintptr(unsafe.Pointer(ppAuditSidArray)),
0,
0)
return BOOLEAN(ret1)
}
func AuditEnumerateSubCategories(pAuditCategoryGuid /*const*/ *GUID, bRetrieveAllSubCategories BOOLEAN, ppAuditSubCategoriesArray uintptr, pCountReturned *uint32) BOOLEAN {
ret1 := syscall6(auditEnumerateSubCategories, 4,
uintptr(unsafe.Pointer(pAuditCategoryGuid)),
uintptr(bRetrieveAllSubCategories),
ppAuditSubCategoriesArray,
uintptr(unsafe.Pointer(pCountReturned)),
0,
0)
return BOOLEAN(ret1)
}
func AuditFree(buffer uintptr) {
syscall3(auditFree, 1,
buffer,
0,
0)
}
func AuditLookupCategoryGuidFromCategoryId(auditCategoryId POLICY_AUDIT_EVENT_TYPE, pAuditCategoryGuid *GUID) BOOLEAN {
ret1 := syscall3(auditLookupCategoryGuidFromCategoryId, 2,
uintptr(auditCategoryId),
uintptr(unsafe.Pointer(pAuditCategoryGuid)),
0)
return BOOLEAN(ret1)
}
func AuditLookupCategoryIdFromCategoryGuid(pAuditCategoryGuid /*const*/ *GUID, pAuditCategoryId PPOLICY_AUDIT_EVENT_TYPE) BOOLEAN {
ret1 := syscall3(auditLookupCategoryIdFromCategoryGuid, 2,
uintptr(unsafe.Pointer(pAuditCategoryGuid)),
uintptr(unsafe.Pointer(pAuditCategoryId)),