github.com/tomatome/win@v0.3.1/advapi32.go (about)

     1  // This file was automatically generated by https://github.com/kbinani/win/blob/generator/internal/cmd/gen/gen.go
     2  // go run internal/cmd/gen/gen.go
     3  
     4  // +build windows
     5  
     6  package win
     7  
     8  import (
     9  	"syscall"
    10  	"unsafe"
    11  )
    12  
    13  var (
    14  	// Library
    15  	libadvapi32 uintptr
    16  
    17  	// Functions
    18  	abortSystemShutdown                                 uintptr
    19  	accessCheck                                         uintptr
    20  	accessCheckAndAuditAlarm                            uintptr
    21  	accessCheckByType                                   uintptr
    22  	accessCheckByTypeResultList                         uintptr
    23  	addAccessAllowedAce                                 uintptr
    24  	addAccessAllowedAceEx                               uintptr
    25  	addAccessAllowedObjectAce                           uintptr
    26  	addAccessDeniedAce                                  uintptr
    27  	addAccessDeniedAceEx                                uintptr
    28  	addAccessDeniedObjectAce                            uintptr
    29  	addAce                                              uintptr
    30  	addAuditAccessAce                                   uintptr
    31  	addAuditAccessAceEx                                 uintptr
    32  	addAuditAccessObjectAce                             uintptr
    33  	addConditionalAce                                   uintptr
    34  	addMandatoryAce                                     uintptr
    35  	addUsersToEncryptedFile                             uintptr
    36  	adjustTokenGroups                                   uintptr
    37  	adjustTokenPrivileges                               uintptr
    38  	allocateAndInitializeSid                            uintptr
    39  	allocateLocallyUniqueId                             uintptr
    40  	areAllAccessesGranted                               uintptr
    41  	areAnyAccessesGranted                               uintptr
    42  	auditComputeEffectivePolicyBySid                    uintptr
    43  	auditComputeEffectivePolicyByToken                  uintptr
    44  	auditEnumerateCategories                            uintptr
    45  	auditEnumeratePerUserPolicy                         uintptr
    46  	auditEnumerateSubCategories                         uintptr
    47  	auditFree                                           uintptr
    48  	auditLookupCategoryGuidFromCategoryId               uintptr
    49  	auditLookupCategoryIdFromCategoryGuid               uintptr
    50  	auditLookupCategoryName                             uintptr
    51  	auditLookupSubCategoryName                          uintptr
    52  	auditQueryPerUserPolicy                             uintptr
    53  	auditQuerySecurity                                  uintptr
    54  	auditQuerySystemPolicy                              uintptr
    55  	auditSetPerUserPolicy                               uintptr
    56  	auditSetSecurity                                    uintptr
    57  	auditSetSystemPolicy                                uintptr
    58  	backupEventLog                                      uintptr
    59  	buildExplicitAccessWithName                         uintptr
    60  	buildImpersonateExplicitAccessWithName              uintptr
    61  	buildImpersonateTrustee                             uintptr
    62  	buildSecurityDescriptor                             uintptr
    63  	buildTrusteeWithName                                uintptr
    64  	buildTrusteeWithObjectsAndName                      uintptr
    65  	buildTrusteeWithObjectsAndSid                       uintptr
    66  	buildTrusteeWithSid                                 uintptr
    67  	changeServiceConfig2                                uintptr
    68  	changeServiceConfig                                 uintptr
    69  	checkTokenMembership                                uintptr
    70  	clearEventLog                                       uintptr
    71  	closeEncryptedFileRaw                               uintptr
    72  	closeEventLog                                       uintptr
    73  	closeServiceHandle                                  uintptr
    74  	closeThreadWaitChainSession                         uintptr
    75  	commandLineFromMsiDescriptor                        uintptr
    76  	controlService                                      uintptr
    77  	controlServiceEx                                    uintptr
    78  	convertSecurityDescriptorToStringSecurityDescriptor uintptr
    79  	convertSidToStringSid                               uintptr
    80  	convertStringSecurityDescriptorToSecurityDescriptor uintptr
    81  	convertStringSidToSid                               uintptr
    82  	convertToAutoInheritPrivateObjectSecurity           uintptr
    83  	copySid                                             uintptr
    84  	createPrivateObjectSecurity                         uintptr
    85  	createPrivateObjectSecurityEx                       uintptr
    86  	createPrivateObjectSecurityWithMultipleInheritance  uintptr
    87  	createProcessAsUser                                 uintptr
    88  	createProcessWithLogonW                             uintptr
    89  	createProcessWithTokenW                             uintptr
    90  	createService                                       uintptr
    91  	credDelete                                          uintptr
    92  	credEnumerate                                       uintptr
    93  	credFree                                            uintptr
    94  	credGetSessionTypes                                 uintptr
    95  	credIsMarshaledCredential                           uintptr
    96  	credRename                                          uintptr
    97  	credUnprotect                                       uintptr
    98  	credWrite                                           uintptr
    99  	cryptAcquireContext                                 uintptr
   100  	cryptContextAddRef                                  uintptr
   101  	cryptCreateHash                                     uintptr
   102  	cryptDecrypt                                        uintptr
   103  	cryptDeriveKey                                      uintptr
   104  	cryptDestroyHash                                    uintptr
   105  	cryptDestroyKey                                     uintptr
   106  	cryptDuplicateHash                                  uintptr
   107  	cryptDuplicateKey                                   uintptr
   108  	cryptEncrypt                                        uintptr
   109  	cryptEnumProviderTypes                              uintptr
   110  	cryptEnumProviders                                  uintptr
   111  	cryptExportKey                                      uintptr
   112  	cryptGenKey                                         uintptr
   113  	cryptGenRandom                                      uintptr
   114  	cryptGetDefaultProvider                             uintptr
   115  	cryptGetHashParam                                   uintptr
   116  	cryptGetKeyParam                                    uintptr
   117  	cryptGetProvParam                                   uintptr
   118  	cryptGetUserKey                                     uintptr
   119  	cryptHashData                                       uintptr
   120  	cryptHashSessionKey                                 uintptr
   121  	cryptImportKey                                      uintptr
   122  	cryptReleaseContext                                 uintptr
   123  	cryptSetHashParam                                   uintptr
   124  	cryptSetKeyParam                                    uintptr
   125  	cryptSetProvParam                                   uintptr
   126  	cryptSetProviderEx                                  uintptr
   127  	cryptSetProvider                                    uintptr
   128  	cryptSignHash                                       uintptr
   129  	cryptVerifySignature                                uintptr
   130  	decryptFile                                         uintptr
   131  	deleteAce                                           uintptr
   132  	deleteService                                       uintptr
   133  	deregisterEventSource                               uintptr
   134  	destroyPrivateObjectSecurity                        uintptr
   135  	duplicateEncryptionInfoFile                         uintptr
   136  	duplicateToken                                      uintptr
   137  	encryptFile                                         uintptr
   138  	encryptionDisable                                   uintptr
   139  	equalDomainSid                                      uintptr
   140  	equalPrefixSid                                      uintptr
   141  	equalSid                                            uintptr
   142  	fileEncryptionStatus                                uintptr
   143  	findFirstFreeAce                                    uintptr
   144  	freeSid                                             uintptr
   145  	getAce                                              uintptr
   146  	getEventLogInformation                              uintptr
   147  	getFileSecurity                                     uintptr
   148  	getKernelObjectSecurity                             uintptr
   149  	getLengthSid                                        uintptr
   150  	getLocalManagedApplicationData                      uintptr
   151  	getMultipleTrusteeOperation                         uintptr
   152  	getMultipleTrustee                                  uintptr
   153  	getNumberOfEventLogRecords                          uintptr
   154  	getOldestEventLogRecord                             uintptr
   155  	getPrivateObjectSecurity                            uintptr
   156  	getSecurityDescriptorControl                        uintptr
   157  	getSecurityDescriptorGroup                          uintptr
   158  	getSecurityDescriptorLength                         uintptr
   159  	getSecurityDescriptorOwner                          uintptr
   160  	getSecurityDescriptorRMControl                      uintptr
   161  	getServiceDisplayName                               uintptr
   162  	getServiceKeyName                                   uintptr
   163  	getSidIdentifierAuthority                           uintptr
   164  	getSidLengthRequired                                uintptr
   165  	getSidSubAuthority                                  uintptr
   166  	getSidSubAuthorityCount                             uintptr
   167  	getTrusteeForm                                      uintptr
   168  	getTrusteeName                                      uintptr
   169  	getTrusteeType                                      uintptr
   170  	getUserName                                         uintptr
   171  	getWindowsAccountDomainSid                          uintptr
   172  	impersonateAnonymousToken                           uintptr
   173  	impersonateLoggedOnUser                             uintptr
   174  	impersonateNamedPipeClient                          uintptr
   175  	impersonateSelf                                     uintptr
   176  	initializeAcl                                       uintptr
   177  	initializeSecurityDescriptor                        uintptr
   178  	initializeSid                                       uintptr
   179  	initiateShutdown                                    uintptr
   180  	initiateSystemShutdownEx                            uintptr
   181  	initiateSystemShutdown                              uintptr
   182  	isTextUnicode                                       uintptr
   183  	isTokenRestricted                                   uintptr
   184  	isTokenUntrusted                                    uintptr
   185  	isValidAcl                                          uintptr
   186  	isValidSecurityDescriptor                           uintptr
   187  	isValidSid                                          uintptr
   188  	lockServiceDatabase                                 uintptr
   189  	logonUser                                           uintptr
   190  	lookupPrivilegeDisplayName                          uintptr
   191  	lookupPrivilegeName                                 uintptr
   192  	lookupPrivilegeValue                                uintptr
   193  	makeAbsoluteSD                                      uintptr
   194  	makeSelfRelativeSD                                  uintptr
   195  	mapGenericMask                                      uintptr
   196  	notifyBootConfigStatus                              uintptr
   197  	notifyChangeEventLog                                uintptr
   198  	objectCloseAuditAlarm                               uintptr
   199  	objectDeleteAuditAlarm                              uintptr
   200  	objectOpenAuditAlarm                                uintptr
   201  	objectPrivilegeAuditAlarm                           uintptr
   202  	openBackupEventLog                                  uintptr
   203  	openEncryptedFileRaw                                uintptr
   204  	openEventLog                                        uintptr
   205  	openProcessToken                                    uintptr
   206  	openSCManager                                       uintptr
   207  	openService                                         uintptr
   208  	openThreadToken                                     uintptr
   209  	perfCreateInstance                                  uintptr
   210  	perfDecrementULongCounterValue                      uintptr
   211  	perfDecrementULongLongCounterValue                  uintptr
   212  	perfDeleteInstance                                  uintptr
   213  	perfIncrementULongCounterValue                      uintptr
   214  	perfIncrementULongLongCounterValue                  uintptr
   215  	perfQueryInstance                                   uintptr
   216  	perfSetCounterRefValue                              uintptr
   217  	perfSetULongCounterValue                            uintptr
   218  	perfSetULongLongCounterValue                        uintptr
   219  	perfStopProvider                                    uintptr
   220  	privilegeCheck                                      uintptr
   221  	privilegedServiceAuditAlarm                         uintptr
   222  	querySecurityAccessMask                             uintptr
   223  	queryServiceConfig2                                 uintptr
   224  	queryServiceObjectSecurity                          uintptr
   225  	queryServiceStatus                                  uintptr
   226  	readEventLog                                        uintptr
   227  	regCloseKey                                         uintptr
   228  	regConnectRegistryEx                                uintptr
   229  	regConnectRegistry                                  uintptr
   230  	regCopyTree                                         uintptr
   231  	regCreateKeyEx                                      uintptr
   232  	regCreateKeyTransacted                              uintptr
   233  	regCreateKey                                        uintptr
   234  	regDeleteKeyEx                                      uintptr
   235  	regDeleteKeyTransacted                              uintptr
   236  	regDeleteKeyValue                                   uintptr
   237  	regDeleteKey                                        uintptr
   238  	regDeleteTree                                       uintptr
   239  	regDeleteValue                                      uintptr
   240  	regDisablePredefinedCache                           uintptr
   241  	regDisablePredefinedCacheEx                         uintptr
   242  	regDisableReflectionKey                             uintptr
   243  	regEnableReflectionKey                              uintptr
   244  	regEnumKey                                          uintptr
   245  	regEnumValue                                        uintptr
   246  	regFlushKey                                         uintptr
   247  	regGetKeySecurity                                   uintptr
   248  	regGetValue                                         uintptr
   249  	regLoadAppKey                                       uintptr
   250  	regLoadKey                                          uintptr
   251  	regLoadMUIString                                    uintptr
   252  	regNotifyChangeKeyValue                             uintptr
   253  	regOpenCurrentUser                                  uintptr
   254  	regOpenKeyEx                                        uintptr
   255  	regOpenKeyTransacted                                uintptr
   256  	regOpenKey                                          uintptr
   257  	regOpenUserClassesRoot                              uintptr
   258  	regOverridePredefKey                                uintptr
   259  	regQueryReflectionKey                               uintptr
   260  	regQueryValueEx                                     uintptr
   261  	regQueryValue                                       uintptr
   262  	regReplaceKey                                       uintptr
   263  	regRestoreKey                                       uintptr
   264  	regSaveKeyEx                                        uintptr
   265  	regSaveKey                                          uintptr
   266  	regSetKeySecurity                                   uintptr
   267  	regSetKeyValue                                      uintptr
   268  	regSetValueEx                                       uintptr
   269  	regSetValue                                         uintptr
   270  	regUnLoadKey                                        uintptr
   271  	registerEventSource                                 uintptr
   272  	registerServiceCtrlHandlerEx                        uintptr
   273  	reportEvent                                         uintptr
   274  	revertToSelf                                        uintptr
   275  	saferCloseLevel                                     uintptr
   276  	saferComputeTokenFromLevel                          uintptr
   277  	saferCreateLevel                                    uintptr
   278  	saferRecordEventLogEntry                            uintptr
   279  	saferiIsExecutableFileType                          uintptr
   280  	setFileSecurity                                     uintptr
   281  	setKernelObjectSecurity                             uintptr
   282  	setNamedSecurityInfo                                uintptr
   283  	setPrivateObjectSecurity                            uintptr
   284  	setPrivateObjectSecurityEx                          uintptr
   285  	setSecurityAccessMask                               uintptr
   286  	setSecurityDescriptorControl                        uintptr
   287  	setSecurityDescriptorDacl                           uintptr
   288  	setSecurityDescriptorGroup                          uintptr
   289  	setSecurityDescriptorOwner                          uintptr
   290  	setSecurityDescriptorRMControl                      uintptr
   291  	setSecurityDescriptorSacl                           uintptr
   292  	setSecurityInfo                                     uintptr
   293  	setServiceBits                                      uintptr
   294  	setServiceObjectSecurity                            uintptr
   295  	setServiceStatus                                    uintptr
   296  	setThreadToken                                      uintptr
   297  	setUserFileEncryptionKey                            uintptr
   298  	startService                                        uintptr
   299  	uninstallApplication                                uintptr
   300  	unlockServiceDatabase                               uintptr
   301  	wow64Win32ApiEntry                                  uintptr
   302  	eventActivityIdControl                              uintptr
   303  	lsaNtStatusToWinError                               uintptr
   304  	systemFunction001                                   uintptr
   305  	systemFunction002                                   uintptr
   306  	systemFunction003                                   uintptr
   307  	systemFunction006                                   uintptr
   308  	systemFunction008                                   uintptr
   309  	systemFunction009                                   uintptr
   310  	systemFunction010                                   uintptr
   311  	systemFunction012                                   uintptr
   312  	systemFunction013                                   uintptr
   313  	systemFunction024                                   uintptr
   314  	systemFunction025                                   uintptr
   315  	systemFunction030                                   uintptr
   316  	systemFunction035                                   uintptr
   317  	systemFunction036                                   uintptr
   318  	systemFunction040                                   uintptr
   319  	systemFunction041                                   uintptr
   320  )
   321  
   322  func init() {
   323  	// Library
   324  	libadvapi32 = doLoadLibrary("advapi32.dll")
   325  
   326  	// Functions
   327  	abortSystemShutdown = doGetProcAddress(libadvapi32, "AbortSystemShutdownW")
   328  	accessCheck = doGetProcAddress(libadvapi32, "AccessCheck")
   329  	accessCheckAndAuditAlarm = doGetProcAddress(libadvapi32, "AccessCheckAndAuditAlarmW")
   330  	accessCheckByType = doGetProcAddress(libadvapi32, "AccessCheckByType")
   331  	accessCheckByTypeResultList = doGetProcAddress(libadvapi32, "AccessCheckByTypeResultList")
   332  	addAccessAllowedAce = doGetProcAddress(libadvapi32, "AddAccessAllowedAce")
   333  	addAccessAllowedAceEx = doGetProcAddress(libadvapi32, "AddAccessAllowedAceEx")
   334  	addAccessAllowedObjectAce = doGetProcAddress(libadvapi32, "AddAccessAllowedObjectAce")
   335  	addAccessDeniedAce = doGetProcAddress(libadvapi32, "AddAccessDeniedAce")
   336  	addAccessDeniedAceEx = doGetProcAddress(libadvapi32, "AddAccessDeniedAceEx")
   337  	addAccessDeniedObjectAce = doGetProcAddress(libadvapi32, "AddAccessDeniedObjectAce")
   338  	addAce = doGetProcAddress(libadvapi32, "AddAce")
   339  	addAuditAccessAce = doGetProcAddress(libadvapi32, "AddAuditAccessAce")
   340  	addAuditAccessAceEx = doGetProcAddress(libadvapi32, "AddAuditAccessAceEx")
   341  	addAuditAccessObjectAce = doGetProcAddress(libadvapi32, "AddAuditAccessObjectAce")
   342  	addConditionalAce = doGetProcAddress(libadvapi32, "AddConditionalAce")
   343  	addMandatoryAce = doGetProcAddress(libadvapi32, "AddMandatoryAce")
   344  	addUsersToEncryptedFile = doGetProcAddress(libadvapi32, "AddUsersToEncryptedFile")
   345  	adjustTokenGroups = doGetProcAddress(libadvapi32, "AdjustTokenGroups")
   346  	adjustTokenPrivileges = doGetProcAddress(libadvapi32, "AdjustTokenPrivileges")
   347  	allocateAndInitializeSid = doGetProcAddress(libadvapi32, "AllocateAndInitializeSid")
   348  	allocateLocallyUniqueId = doGetProcAddress(libadvapi32, "AllocateLocallyUniqueId")
   349  	areAllAccessesGranted = doGetProcAddress(libadvapi32, "AreAllAccessesGranted")
   350  	areAnyAccessesGranted = doGetProcAddress(libadvapi32, "AreAnyAccessesGranted")
   351  	auditComputeEffectivePolicyBySid = doGetProcAddress(libadvapi32, "AuditComputeEffectivePolicyBySid")
   352  	auditComputeEffectivePolicyByToken = doGetProcAddress(libadvapi32, "AuditComputeEffectivePolicyByToken")
   353  	auditEnumerateCategories = doGetProcAddress(libadvapi32, "AuditEnumerateCategories")
   354  	auditEnumeratePerUserPolicy = doGetProcAddress(libadvapi32, "AuditEnumeratePerUserPolicy")
   355  	auditEnumerateSubCategories = doGetProcAddress(libadvapi32, "AuditEnumerateSubCategories")
   356  	auditFree = doGetProcAddress(libadvapi32, "AuditFree")
   357  	auditLookupCategoryGuidFromCategoryId = doGetProcAddress(libadvapi32, "AuditLookupCategoryGuidFromCategoryId")
   358  	auditLookupCategoryIdFromCategoryGuid = doGetProcAddress(libadvapi32, "AuditLookupCategoryIdFromCategoryGuid")
   359  	auditLookupCategoryName = doGetProcAddress(libadvapi32, "AuditLookupCategoryNameW")
   360  	auditLookupSubCategoryName = doGetProcAddress(libadvapi32, "AuditLookupSubCategoryNameW")
   361  	auditQueryPerUserPolicy = doGetProcAddress(libadvapi32, "AuditQueryPerUserPolicy")
   362  	auditQuerySecurity = doGetProcAddress(libadvapi32, "AuditQuerySecurity")
   363  	auditQuerySystemPolicy = doGetProcAddress(libadvapi32, "AuditQuerySystemPolicy")
   364  	auditSetPerUserPolicy = doGetProcAddress(libadvapi32, "AuditSetPerUserPolicy")
   365  	auditSetSecurity = doGetProcAddress(libadvapi32, "AuditSetSecurity")
   366  	auditSetSystemPolicy = doGetProcAddress(libadvapi32, "AuditSetSystemPolicy")
   367  	backupEventLog = doGetProcAddress(libadvapi32, "BackupEventLogW")
   368  	buildExplicitAccessWithName = doGetProcAddress(libadvapi32, "BuildExplicitAccessWithNameW")
   369  	buildImpersonateExplicitAccessWithName = doGetProcAddress(libadvapi32, "BuildImpersonateExplicitAccessWithNameW")
   370  	buildImpersonateTrustee = doGetProcAddress(libadvapi32, "BuildImpersonateTrusteeW")
   371  	buildSecurityDescriptor = doGetProcAddress(libadvapi32, "BuildSecurityDescriptorW")
   372  	buildTrusteeWithName = doGetProcAddress(libadvapi32, "BuildTrusteeWithNameW")
   373  	buildTrusteeWithObjectsAndName = doGetProcAddress(libadvapi32, "BuildTrusteeWithObjectsAndNameW")
   374  	buildTrusteeWithObjectsAndSid = doGetProcAddress(libadvapi32, "BuildTrusteeWithObjectsAndSidW")
   375  	buildTrusteeWithSid = doGetProcAddress(libadvapi32, "BuildTrusteeWithSidW")
   376  	changeServiceConfig2 = doGetProcAddress(libadvapi32, "ChangeServiceConfig2W")
   377  	changeServiceConfig = doGetProcAddress(libadvapi32, "ChangeServiceConfigW")
   378  	checkTokenMembership = doGetProcAddress(libadvapi32, "CheckTokenMembership")
   379  	clearEventLog = doGetProcAddress(libadvapi32, "ClearEventLogW")
   380  	closeEncryptedFileRaw = doGetProcAddress(libadvapi32, "CloseEncryptedFileRaw")
   381  	closeEventLog = doGetProcAddress(libadvapi32, "CloseEventLog")
   382  	closeServiceHandle = doGetProcAddress(libadvapi32, "CloseServiceHandle")
   383  	closeThreadWaitChainSession = doGetProcAddress(libadvapi32, "CloseThreadWaitChainSession")
   384  	commandLineFromMsiDescriptor = doGetProcAddress(libadvapi32, "CommandLineFromMsiDescriptor")
   385  	controlService = doGetProcAddress(libadvapi32, "ControlService")
   386  	controlServiceEx = doGetProcAddress(libadvapi32, "ControlServiceExW")
   387  	convertSecurityDescriptorToStringSecurityDescriptor = doGetProcAddress(libadvapi32, "ConvertSecurityDescriptorToStringSecurityDescriptorW")
   388  	convertSidToStringSid = doGetProcAddress(libadvapi32, "ConvertSidToStringSidW")
   389  	convertStringSecurityDescriptorToSecurityDescriptor = doGetProcAddress(libadvapi32, "ConvertStringSecurityDescriptorToSecurityDescriptorW")
   390  	convertStringSidToSid = doGetProcAddress(libadvapi32, "ConvertStringSidToSidW")
   391  	convertToAutoInheritPrivateObjectSecurity = doGetProcAddress(libadvapi32, "ConvertToAutoInheritPrivateObjectSecurity")
   392  	copySid = doGetProcAddress(libadvapi32, "CopySid")
   393  	createPrivateObjectSecurity = doGetProcAddress(libadvapi32, "CreatePrivateObjectSecurity")
   394  	createPrivateObjectSecurityEx = doGetProcAddress(libadvapi32, "CreatePrivateObjectSecurityEx")
   395  	createPrivateObjectSecurityWithMultipleInheritance = doGetProcAddress(libadvapi32, "CreatePrivateObjectSecurityWithMultipleInheritance")
   396  	createProcessAsUser = doGetProcAddress(libadvapi32, "CreateProcessAsUserW")
   397  	createProcessWithLogonW = doGetProcAddress(libadvapi32, "CreateProcessWithLogonW")
   398  	createProcessWithTokenW = doGetProcAddress(libadvapi32, "CreateProcessWithTokenW")
   399  	createService = doGetProcAddress(libadvapi32, "CreateServiceW")
   400  	credDelete = doGetProcAddress(libadvapi32, "CredDeleteW")
   401  	credEnumerate = doGetProcAddress(libadvapi32, "CredEnumerateW")
   402  	credFree = doGetProcAddress(libadvapi32, "CredFree")
   403  	credGetSessionTypes = doGetProcAddress(libadvapi32, "CredGetSessionTypes")
   404  	credIsMarshaledCredential = doGetProcAddress(libadvapi32, "CredIsMarshaledCredentialW")
   405  	credRename = doGetProcAddress(libadvapi32, "CredRenameW")
   406  	credUnprotect = doGetProcAddress(libadvapi32, "CredUnprotectW")
   407  	credWrite = doGetProcAddress(libadvapi32, "CredWriteW")
   408  	cryptAcquireContext = doGetProcAddress(libadvapi32, "CryptAcquireContextW")
   409  	cryptContextAddRef = doGetProcAddress(libadvapi32, "CryptContextAddRef")
   410  	cryptCreateHash = doGetProcAddress(libadvapi32, "CryptCreateHash")
   411  	cryptDecrypt = doGetProcAddress(libadvapi32, "CryptDecrypt")
   412  	cryptDeriveKey = doGetProcAddress(libadvapi32, "CryptDeriveKey")
   413  	cryptDestroyHash = doGetProcAddress(libadvapi32, "CryptDestroyHash")
   414  	cryptDestroyKey = doGetProcAddress(libadvapi32, "CryptDestroyKey")
   415  	cryptDuplicateHash = doGetProcAddress(libadvapi32, "CryptDuplicateHash")
   416  	cryptDuplicateKey = doGetProcAddress(libadvapi32, "CryptDuplicateKey")
   417  	cryptEncrypt = doGetProcAddress(libadvapi32, "CryptEncrypt")
   418  	cryptEnumProviderTypes = doGetProcAddress(libadvapi32, "CryptEnumProviderTypesW")
   419  	cryptEnumProviders = doGetProcAddress(libadvapi32, "CryptEnumProvidersW")
   420  	cryptExportKey = doGetProcAddress(libadvapi32, "CryptExportKey")
   421  	cryptGenKey = doGetProcAddress(libadvapi32, "CryptGenKey")
   422  	cryptGenRandom = doGetProcAddress(libadvapi32, "CryptGenRandom")
   423  	cryptGetDefaultProvider = doGetProcAddress(libadvapi32, "CryptGetDefaultProviderW")
   424  	cryptGetHashParam = doGetProcAddress(libadvapi32, "CryptGetHashParam")
   425  	cryptGetKeyParam = doGetProcAddress(libadvapi32, "CryptGetKeyParam")
   426  	cryptGetProvParam = doGetProcAddress(libadvapi32, "CryptGetProvParam")
   427  	cryptGetUserKey = doGetProcAddress(libadvapi32, "CryptGetUserKey")
   428  	cryptHashData = doGetProcAddress(libadvapi32, "CryptHashData")
   429  	cryptHashSessionKey = doGetProcAddress(libadvapi32, "CryptHashSessionKey")
   430  	cryptImportKey = doGetProcAddress(libadvapi32, "CryptImportKey")
   431  	cryptReleaseContext = doGetProcAddress(libadvapi32, "CryptReleaseContext")
   432  	cryptSetHashParam = doGetProcAddress(libadvapi32, "CryptSetHashParam")
   433  	cryptSetKeyParam = doGetProcAddress(libadvapi32, "CryptSetKeyParam")
   434  	cryptSetProvParam = doGetProcAddress(libadvapi32, "CryptSetProvParam")
   435  	cryptSetProviderEx = doGetProcAddress(libadvapi32, "CryptSetProviderExW")
   436  	cryptSetProvider = doGetProcAddress(libadvapi32, "CryptSetProviderW")
   437  	cryptSignHash = doGetProcAddress(libadvapi32, "CryptSignHashW")
   438  	cryptVerifySignature = doGetProcAddress(libadvapi32, "CryptVerifySignatureW")
   439  	decryptFile = doGetProcAddress(libadvapi32, "DecryptFileW")
   440  	deleteAce = doGetProcAddress(libadvapi32, "DeleteAce")
   441  	deleteService = doGetProcAddress(libadvapi32, "DeleteService")
   442  	deregisterEventSource = doGetProcAddress(libadvapi32, "DeregisterEventSource")
   443  	destroyPrivateObjectSecurity = doGetProcAddress(libadvapi32, "DestroyPrivateObjectSecurity")
   444  	duplicateEncryptionInfoFile = doGetProcAddress(libadvapi32, "DuplicateEncryptionInfoFile")
   445  	duplicateToken = doGetProcAddress(libadvapi32, "DuplicateToken")
   446  	encryptFile = doGetProcAddress(libadvapi32, "EncryptFileW")
   447  	encryptionDisable = doGetProcAddress(libadvapi32, "EncryptionDisable")
   448  	equalDomainSid = doGetProcAddress(libadvapi32, "EqualDomainSid")
   449  	equalPrefixSid = doGetProcAddress(libadvapi32, "EqualPrefixSid")
   450  	equalSid = doGetProcAddress(libadvapi32, "EqualSid")
   451  	fileEncryptionStatus = doGetProcAddress(libadvapi32, "FileEncryptionStatusW")
   452  	findFirstFreeAce = doGetProcAddress(libadvapi32, "FindFirstFreeAce")
   453  	freeSid = doGetProcAddress(libadvapi32, "FreeSid")
   454  	getAce = doGetProcAddress(libadvapi32, "GetAce")
   455  	getEventLogInformation = doGetProcAddress(libadvapi32, "GetEventLogInformation")
   456  	getFileSecurity = doGetProcAddress(libadvapi32, "GetFileSecurityW")
   457  	getKernelObjectSecurity = doGetProcAddress(libadvapi32, "GetKernelObjectSecurity")
   458  	getLengthSid = doGetProcAddress(libadvapi32, "GetLengthSid")
   459  	getLocalManagedApplicationData = doGetProcAddress(libadvapi32, "GetLocalManagedApplicationData")
   460  	getMultipleTrusteeOperation = doGetProcAddress(libadvapi32, "GetMultipleTrusteeOperationW")
   461  	getMultipleTrustee = doGetProcAddress(libadvapi32, "GetMultipleTrusteeW")
   462  	getNumberOfEventLogRecords = doGetProcAddress(libadvapi32, "GetNumberOfEventLogRecords")
   463  	getOldestEventLogRecord = doGetProcAddress(libadvapi32, "GetOldestEventLogRecord")
   464  	getPrivateObjectSecurity = doGetProcAddress(libadvapi32, "GetPrivateObjectSecurity")
   465  	getSecurityDescriptorControl = doGetProcAddress(libadvapi32, "GetSecurityDescriptorControl")
   466  	getSecurityDescriptorGroup = doGetProcAddress(libadvapi32, "GetSecurityDescriptorGroup")
   467  	getSecurityDescriptorLength = doGetProcAddress(libadvapi32, "GetSecurityDescriptorLength")
   468  	getSecurityDescriptorOwner = doGetProcAddress(libadvapi32, "GetSecurityDescriptorOwner")
   469  	getSecurityDescriptorRMControl = doGetProcAddress(libadvapi32, "GetSecurityDescriptorRMControl")
   470  	getServiceDisplayName = doGetProcAddress(libadvapi32, "GetServiceDisplayNameW")
   471  	getServiceKeyName = doGetProcAddress(libadvapi32, "GetServiceKeyNameW")
   472  	getSidIdentifierAuthority = doGetProcAddress(libadvapi32, "GetSidIdentifierAuthority")
   473  	getSidLengthRequired = doGetProcAddress(libadvapi32, "GetSidLengthRequired")
   474  	getSidSubAuthority = doGetProcAddress(libadvapi32, "GetSidSubAuthority")
   475  	getSidSubAuthorityCount = doGetProcAddress(libadvapi32, "GetSidSubAuthorityCount")
   476  	getTrusteeForm = doGetProcAddress(libadvapi32, "GetTrusteeFormW")
   477  	getTrusteeName = doGetProcAddress(libadvapi32, "GetTrusteeNameW")
   478  	getTrusteeType = doGetProcAddress(libadvapi32, "GetTrusteeTypeW")
   479  	getUserName = doGetProcAddress(libadvapi32, "GetUserNameW")
   480  	getWindowsAccountDomainSid = doGetProcAddress(libadvapi32, "GetWindowsAccountDomainSid")
   481  	impersonateAnonymousToken = doGetProcAddress(libadvapi32, "ImpersonateAnonymousToken")
   482  	impersonateLoggedOnUser = doGetProcAddress(libadvapi32, "ImpersonateLoggedOnUser")
   483  	impersonateNamedPipeClient = doGetProcAddress(libadvapi32, "ImpersonateNamedPipeClient")
   484  	impersonateSelf = doGetProcAddress(libadvapi32, "ImpersonateSelf")
   485  	initializeAcl = doGetProcAddress(libadvapi32, "InitializeAcl")
   486  	initializeSecurityDescriptor = doGetProcAddress(libadvapi32, "InitializeSecurityDescriptor")
   487  	initializeSid = doGetProcAddress(libadvapi32, "InitializeSid")
   488  	initiateShutdown = doGetProcAddress(libadvapi32, "InitiateShutdownW")
   489  	initiateSystemShutdownEx = doGetProcAddress(libadvapi32, "InitiateSystemShutdownExW")
   490  	initiateSystemShutdown = doGetProcAddress(libadvapi32, "InitiateSystemShutdownW")
   491  	isTextUnicode = doGetProcAddress(libadvapi32, "IsTextUnicode")
   492  	isTokenRestricted = doGetProcAddress(libadvapi32, "IsTokenRestricted")
   493  	isTokenUntrusted = doGetProcAddress(libadvapi32, "IsTokenUntrusted")
   494  	isValidAcl = doGetProcAddress(libadvapi32, "IsValidAcl")
   495  	isValidSecurityDescriptor = doGetProcAddress(libadvapi32, "IsValidSecurityDescriptor")
   496  	isValidSid = doGetProcAddress(libadvapi32, "IsValidSid")
   497  	lockServiceDatabase = doGetProcAddress(libadvapi32, "LockServiceDatabase")
   498  	logonUser = doGetProcAddress(libadvapi32, "LogonUserW")
   499  	lookupPrivilegeDisplayName = doGetProcAddress(libadvapi32, "LookupPrivilegeDisplayNameW")
   500  	lookupPrivilegeName = doGetProcAddress(libadvapi32, "LookupPrivilegeNameW")
   501  	lookupPrivilegeValue = doGetProcAddress(libadvapi32, "LookupPrivilegeValueW")
   502  	makeAbsoluteSD = doGetProcAddress(libadvapi32, "MakeAbsoluteSD")
   503  	makeSelfRelativeSD = doGetProcAddress(libadvapi32, "MakeSelfRelativeSD")
   504  	mapGenericMask = doGetProcAddress(libadvapi32, "MapGenericMask")
   505  	notifyBootConfigStatus = doGetProcAddress(libadvapi32, "NotifyBootConfigStatus")
   506  	notifyChangeEventLog = doGetProcAddress(libadvapi32, "NotifyChangeEventLog")
   507  	objectCloseAuditAlarm = doGetProcAddress(libadvapi32, "ObjectCloseAuditAlarmW")
   508  	objectDeleteAuditAlarm = doGetProcAddress(libadvapi32, "ObjectDeleteAuditAlarmW")
   509  	objectOpenAuditAlarm = doGetProcAddress(libadvapi32, "ObjectOpenAuditAlarmW")
   510  	objectPrivilegeAuditAlarm = doGetProcAddress(libadvapi32, "ObjectPrivilegeAuditAlarmW")
   511  	openBackupEventLog = doGetProcAddress(libadvapi32, "OpenBackupEventLogW")
   512  	openEncryptedFileRaw = doGetProcAddress(libadvapi32, "OpenEncryptedFileRawW")
   513  	openEventLog = doGetProcAddress(libadvapi32, "OpenEventLogW")
   514  	openProcessToken = doGetProcAddress(libadvapi32, "OpenProcessToken")
   515  	openSCManager = doGetProcAddress(libadvapi32, "OpenSCManagerW")
   516  	openService = doGetProcAddress(libadvapi32, "OpenServiceW")
   517  	openThreadToken = doGetProcAddress(libadvapi32, "OpenThreadToken")
   518  	perfCreateInstance = doGetProcAddress(libadvapi32, "PerfCreateInstance")
   519  	perfDecrementULongCounterValue = doGetProcAddress(libadvapi32, "PerfDecrementULongCounterValue")
   520  	perfDecrementULongLongCounterValue = doGetProcAddress(libadvapi32, "PerfDecrementULongLongCounterValue")
   521  	perfDeleteInstance = doGetProcAddress(libadvapi32, "PerfDeleteInstance")
   522  	perfIncrementULongCounterValue = doGetProcAddress(libadvapi32, "PerfIncrementULongCounterValue")
   523  	perfIncrementULongLongCounterValue = doGetProcAddress(libadvapi32, "PerfIncrementULongLongCounterValue")
   524  	perfQueryInstance = doGetProcAddress(libadvapi32, "PerfQueryInstance")
   525  	perfSetCounterRefValue = doGetProcAddress(libadvapi32, "PerfSetCounterRefValue")
   526  	perfSetULongCounterValue = doGetProcAddress(libadvapi32, "PerfSetULongCounterValue")
   527  	perfSetULongLongCounterValue = doGetProcAddress(libadvapi32, "PerfSetULongLongCounterValue")
   528  	perfStopProvider = doGetProcAddress(libadvapi32, "PerfStopProvider")
   529  	privilegeCheck = doGetProcAddress(libadvapi32, "PrivilegeCheck")
   530  	privilegedServiceAuditAlarm = doGetProcAddress(libadvapi32, "PrivilegedServiceAuditAlarmW")
   531  	querySecurityAccessMask = doGetProcAddress(libadvapi32, "QuerySecurityAccessMask")
   532  	queryServiceConfig2 = doGetProcAddress(libadvapi32, "QueryServiceConfig2W")
   533  	queryServiceObjectSecurity = doGetProcAddress(libadvapi32, "QueryServiceObjectSecurity")
   534  	queryServiceStatus = doGetProcAddress(libadvapi32, "QueryServiceStatus")
   535  	readEventLog = doGetProcAddress(libadvapi32, "ReadEventLogW")
   536  	regCloseKey = doGetProcAddress(libadvapi32, "RegCloseKey")
   537  	regConnectRegistryEx = doGetProcAddress(libadvapi32, "RegConnectRegistryExW")
   538  	regConnectRegistry = doGetProcAddress(libadvapi32, "RegConnectRegistryW")
   539  	regCopyTree = doGetProcAddress(libadvapi32, "RegCopyTreeW")
   540  	regCreateKeyEx = doGetProcAddress(libadvapi32, "RegCreateKeyExW")
   541  	regCreateKeyTransacted = doGetProcAddress(libadvapi32, "RegCreateKeyTransactedW")
   542  	regCreateKey = doGetProcAddress(libadvapi32, "RegCreateKeyW")
   543  	regDeleteKeyEx = doGetProcAddress(libadvapi32, "RegDeleteKeyExW")
   544  	regDeleteKeyTransacted = doGetProcAddress(libadvapi32, "RegDeleteKeyTransactedW")
   545  	regDeleteKeyValue = doGetProcAddress(libadvapi32, "RegDeleteKeyValueW")
   546  	regDeleteKey = doGetProcAddress(libadvapi32, "RegDeleteKeyW")
   547  	regDeleteTree = doGetProcAddress(libadvapi32, "RegDeleteTreeW")
   548  	regDeleteValue = doGetProcAddress(libadvapi32, "RegDeleteValueW")
   549  	regDisablePredefinedCache = doGetProcAddress(libadvapi32, "RegDisablePredefinedCache")
   550  	regDisablePredefinedCacheEx = doGetProcAddress(libadvapi32, "RegDisablePredefinedCacheEx")
   551  	regDisableReflectionKey = doGetProcAddress(libadvapi32, "RegDisableReflectionKey")
   552  	regEnableReflectionKey = doGetProcAddress(libadvapi32, "RegEnableReflectionKey")
   553  	regEnumKey = doGetProcAddress(libadvapi32, "RegEnumKeyW")
   554  	regEnumValue = doGetProcAddress(libadvapi32, "RegEnumValueW")
   555  	regFlushKey = doGetProcAddress(libadvapi32, "RegFlushKey")
   556  	regGetKeySecurity = doGetProcAddress(libadvapi32, "RegGetKeySecurity")
   557  	regGetValue = doGetProcAddress(libadvapi32, "RegGetValueW")
   558  	regLoadAppKey = doGetProcAddress(libadvapi32, "RegLoadAppKeyW")
   559  	regLoadKey = doGetProcAddress(libadvapi32, "RegLoadKeyW")
   560  	regLoadMUIString = doGetProcAddress(libadvapi32, "RegLoadMUIStringW")
   561  	regNotifyChangeKeyValue = doGetProcAddress(libadvapi32, "RegNotifyChangeKeyValue")
   562  	regOpenCurrentUser = doGetProcAddress(libadvapi32, "RegOpenCurrentUser")
   563  	regOpenKeyEx = doGetProcAddress(libadvapi32, "RegOpenKeyExW")
   564  	regOpenKeyTransacted = doGetProcAddress(libadvapi32, "RegOpenKeyTransactedW")
   565  	regOpenKey = doGetProcAddress(libadvapi32, "RegOpenKeyW")
   566  	regOpenUserClassesRoot = doGetProcAddress(libadvapi32, "RegOpenUserClassesRoot")
   567  	regOverridePredefKey = doGetProcAddress(libadvapi32, "RegOverridePredefKey")
   568  	regQueryReflectionKey = doGetProcAddress(libadvapi32, "RegQueryReflectionKey")
   569  	regQueryValueEx = doGetProcAddress(libadvapi32, "RegQueryValueExW")
   570  	regQueryValue = doGetProcAddress(libadvapi32, "RegQueryValueW")
   571  	regReplaceKey = doGetProcAddress(libadvapi32, "RegReplaceKeyW")
   572  	regRestoreKey = doGetProcAddress(libadvapi32, "RegRestoreKeyW")
   573  	regSaveKeyEx = doGetProcAddress(libadvapi32, "RegSaveKeyExW")
   574  	regSaveKey = doGetProcAddress(libadvapi32, "RegSaveKeyW")
   575  	regSetKeySecurity = doGetProcAddress(libadvapi32, "RegSetKeySecurity")
   576  	regSetKeyValue = doGetProcAddress(libadvapi32, "RegSetKeyValueW")
   577  	regSetValueEx = doGetProcAddress(libadvapi32, "RegSetValueExW")
   578  	regSetValue = doGetProcAddress(libadvapi32, "RegSetValueW")
   579  	regUnLoadKey = doGetProcAddress(libadvapi32, "RegUnLoadKeyW")
   580  	registerEventSource = doGetProcAddress(libadvapi32, "RegisterEventSourceW")
   581  	registerServiceCtrlHandlerEx = doGetProcAddress(libadvapi32, "RegisterServiceCtrlHandlerExW")
   582  	reportEvent = doGetProcAddress(libadvapi32, "ReportEventW")
   583  	revertToSelf = doGetProcAddress(libadvapi32, "RevertToSelf")
   584  	saferCloseLevel = doGetProcAddress(libadvapi32, "SaferCloseLevel")
   585  	saferComputeTokenFromLevel = doGetProcAddress(libadvapi32, "SaferComputeTokenFromLevel")
   586  	saferCreateLevel = doGetProcAddress(libadvapi32, "SaferCreateLevel")
   587  	saferRecordEventLogEntry = doGetProcAddress(libadvapi32, "SaferRecordEventLogEntry")
   588  	saferiIsExecutableFileType = doGetProcAddress(libadvapi32, "SaferiIsExecutableFileType")
   589  	setFileSecurity = doGetProcAddress(libadvapi32, "SetFileSecurityW")
   590  	setKernelObjectSecurity = doGetProcAddress(libadvapi32, "SetKernelObjectSecurity")
   591  	setNamedSecurityInfo = doGetProcAddress(libadvapi32, "SetNamedSecurityInfoW")
   592  	setPrivateObjectSecurity = doGetProcAddress(libadvapi32, "SetPrivateObjectSecurity")
   593  	setPrivateObjectSecurityEx = doGetProcAddress(libadvapi32, "SetPrivateObjectSecurityEx")
   594  	setSecurityAccessMask = doGetProcAddress(libadvapi32, "SetSecurityAccessMask")
   595  	setSecurityDescriptorControl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorControl")
   596  	setSecurityDescriptorDacl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorDacl")
   597  	setSecurityDescriptorGroup = doGetProcAddress(libadvapi32, "SetSecurityDescriptorGroup")
   598  	setSecurityDescriptorOwner = doGetProcAddress(libadvapi32, "SetSecurityDescriptorOwner")
   599  	setSecurityDescriptorRMControl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorRMControl")
   600  	setSecurityDescriptorSacl = doGetProcAddress(libadvapi32, "SetSecurityDescriptorSacl")
   601  	setSecurityInfo = doGetProcAddress(libadvapi32, "SetSecurityInfo")
   602  	setServiceBits = doGetProcAddress(libadvapi32, "SetServiceBits")
   603  	setServiceObjectSecurity = doGetProcAddress(libadvapi32, "SetServiceObjectSecurity")
   604  	setServiceStatus = doGetProcAddress(libadvapi32, "SetServiceStatus")
   605  	setThreadToken = doGetProcAddress(libadvapi32, "SetThreadToken")
   606  	setUserFileEncryptionKey = doGetProcAddress(libadvapi32, "SetUserFileEncryptionKey")
   607  	startService = doGetProcAddress(libadvapi32, "StartServiceW")
   608  	uninstallApplication = doGetProcAddress(libadvapi32, "UninstallApplication")
   609  	unlockServiceDatabase = doGetProcAddress(libadvapi32, "UnlockServiceDatabase")
   610  	wow64Win32ApiEntry = doGetProcAddress(libadvapi32, "Wow64Win32ApiEntry")
   611  	eventActivityIdControl = doGetProcAddress(libadvapi32, "EventActivityIdControl")
   612  	lsaNtStatusToWinError = doGetProcAddress(libadvapi32, "LsaNtStatusToWinError")
   613  	systemFunction001 = doGetProcAddress(libadvapi32, "SystemFunction001")
   614  	systemFunction002 = doGetProcAddress(libadvapi32, "SystemFunction002")
   615  	systemFunction003 = doGetProcAddress(libadvapi32, "SystemFunction003")
   616  	systemFunction006 = doGetProcAddress(libadvapi32, "SystemFunction006")
   617  	systemFunction008 = doGetProcAddress(libadvapi32, "SystemFunction008")
   618  	systemFunction009 = doGetProcAddress(libadvapi32, "SystemFunction009")
   619  	systemFunction010 = doGetProcAddress(libadvapi32, "SystemFunction010")
   620  	systemFunction012 = doGetProcAddress(libadvapi32, "SystemFunction012")
   621  	systemFunction013 = doGetProcAddress(libadvapi32, "SystemFunction013")
   622  	systemFunction024 = doGetProcAddress(libadvapi32, "SystemFunction024")
   623  	systemFunction025 = doGetProcAddress(libadvapi32, "SystemFunction025")
   624  	systemFunction030 = doGetProcAddress(libadvapi32, "SystemFunction030")
   625  	systemFunction035 = doGetProcAddress(libadvapi32, "SystemFunction035")
   626  	systemFunction036 = doGetProcAddress(libadvapi32, "SystemFunction036")
   627  	systemFunction040 = doGetProcAddress(libadvapi32, "SystemFunction040")
   628  	systemFunction041 = doGetProcAddress(libadvapi32, "SystemFunction041")
   629  }
   630  
   631  func AbortSystemShutdown(lpMachineName LPWSTR) bool {
   632  	ret1 := syscall3(abortSystemShutdown, 1,
   633  		uintptr(unsafe.Pointer(lpMachineName)),
   634  		0,
   635  		0)
   636  	return ret1 != 0
   637  }
   638  
   639  func AccessCheck(pSecurityDescriptor PSECURITY_DESCRIPTOR, clientToken HANDLE, desiredAccess DWORD, genericMapping *GENERIC_MAPPING, privilegeSet *PRIVILEGE_SET, privilegeSetLength *uint32, grantedAccess *uint32, accessStatus *BOOL) bool {
   640  	ret1 := syscall9(accessCheck, 8,
   641  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
   642  		uintptr(clientToken),
   643  		uintptr(desiredAccess),
   644  		uintptr(unsafe.Pointer(genericMapping)),
   645  		uintptr(unsafe.Pointer(privilegeSet)),
   646  		uintptr(unsafe.Pointer(privilegeSetLength)),
   647  		uintptr(unsafe.Pointer(grantedAccess)),
   648  		uintptr(unsafe.Pointer(accessStatus)),
   649  		0)
   650  	return ret1 != 0
   651  }
   652  
   653  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 {
   654  	subsystemNameStr := unicode16FromString(subsystemName)
   655  	ret1 := syscall12(accessCheckAndAuditAlarm, 11,
   656  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
   657  		uintptr(unsafe.Pointer(handleId)),
   658  		uintptr(unsafe.Pointer(objectTypeName)),
   659  		uintptr(unsafe.Pointer(objectName)),
   660  		uintptr(unsafe.Pointer(securityDescriptor)),
   661  		uintptr(desiredAccess),
   662  		uintptr(unsafe.Pointer(genericMapping)),
   663  		getUintptrFromBool(objectCreation),
   664  		uintptr(unsafe.Pointer(grantedAccess)),
   665  		uintptr(unsafe.Pointer(accessStatus)),
   666  		uintptr(unsafe.Pointer(pfGenerateOnClose)),
   667  		0)
   668  	return ret1 != 0
   669  }
   670  
   671  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 {
   672  	ret1 := syscall12(accessCheckByType, 11,
   673  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
   674  		uintptr(principalSelfSid),
   675  		uintptr(clientToken),
   676  		uintptr(desiredAccess),
   677  		uintptr(unsafe.Pointer(objectTypeList)),
   678  		uintptr(objectTypeListLength),
   679  		uintptr(unsafe.Pointer(genericMapping)),
   680  		uintptr(unsafe.Pointer(privilegeSet)),
   681  		uintptr(unsafe.Pointer(privilegeSetLength)),
   682  		uintptr(unsafe.Pointer(grantedAccess)),
   683  		uintptr(unsafe.Pointer(accessStatus)),
   684  		0)
   685  	return ret1 != 0
   686  }
   687  
   688  // TODO: Too many syscall arguments: 18
   689  // 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
   690  
   691  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 {
   692  	ret1 := syscall12(accessCheckByTypeResultList, 11,
   693  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
   694  		uintptr(principalSelfSid),
   695  		uintptr(clientToken),
   696  		uintptr(desiredAccess),
   697  		uintptr(unsafe.Pointer(objectTypeList)),
   698  		uintptr(objectTypeListLength),
   699  		uintptr(unsafe.Pointer(genericMapping)),
   700  		uintptr(unsafe.Pointer(privilegeSet)),
   701  		uintptr(unsafe.Pointer(privilegeSetLength)),
   702  		uintptr(unsafe.Pointer(grantedAccessList)),
   703  		uintptr(unsafe.Pointer(accessStatusList)),
   704  		0)
   705  	return ret1 != 0
   706  }
   707  
   708  // TODO: Too many syscall arguments: 18
   709  // 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
   710  
   711  // TODO: Too many syscall arguments: 18
   712  // 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
   713  
   714  func AddAccessAllowedAce(pAcl *ACL, dwAceRevision DWORD, accessMask DWORD, pSid PSID) bool {
   715  	ret1 := syscall6(addAccessAllowedAce, 4,
   716  		uintptr(unsafe.Pointer(pAcl)),
   717  		uintptr(dwAceRevision),
   718  		uintptr(accessMask),
   719  		uintptr(pSid),
   720  		0,
   721  		0)
   722  	return ret1 != 0
   723  }
   724  
   725  func AddAccessAllowedAceEx(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, pSid PSID) bool {
   726  	ret1 := syscall6(addAccessAllowedAceEx, 5,
   727  		uintptr(unsafe.Pointer(pAcl)),
   728  		uintptr(dwAceRevision),
   729  		uintptr(aceFlags),
   730  		uintptr(accessMask),
   731  		uintptr(pSid),
   732  		0)
   733  	return ret1 != 0
   734  }
   735  
   736  func AddAccessAllowedObjectAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, objectTypeGuid *GUID, inheritedObjectTypeGuid *GUID, pSid PSID) bool {
   737  	ret1 := syscall9(addAccessAllowedObjectAce, 7,
   738  		uintptr(unsafe.Pointer(pAcl)),
   739  		uintptr(dwAceRevision),
   740  		uintptr(aceFlags),
   741  		uintptr(accessMask),
   742  		uintptr(unsafe.Pointer(objectTypeGuid)),
   743  		uintptr(unsafe.Pointer(inheritedObjectTypeGuid)),
   744  		uintptr(pSid),
   745  		0,
   746  		0)
   747  	return ret1 != 0
   748  }
   749  
   750  func AddAccessDeniedAce(pAcl *ACL, dwAceRevision DWORD, accessMask DWORD, pSid PSID) bool {
   751  	ret1 := syscall6(addAccessDeniedAce, 4,
   752  		uintptr(unsafe.Pointer(pAcl)),
   753  		uintptr(dwAceRevision),
   754  		uintptr(accessMask),
   755  		uintptr(pSid),
   756  		0,
   757  		0)
   758  	return ret1 != 0
   759  }
   760  
   761  func AddAccessDeniedAceEx(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, pSid PSID) bool {
   762  	ret1 := syscall6(addAccessDeniedAceEx, 5,
   763  		uintptr(unsafe.Pointer(pAcl)),
   764  		uintptr(dwAceRevision),
   765  		uintptr(aceFlags),
   766  		uintptr(accessMask),
   767  		uintptr(pSid),
   768  		0)
   769  	return ret1 != 0
   770  }
   771  
   772  func AddAccessDeniedObjectAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, objectTypeGuid *GUID, inheritedObjectTypeGuid *GUID, pSid PSID) bool {
   773  	ret1 := syscall9(addAccessDeniedObjectAce, 7,
   774  		uintptr(unsafe.Pointer(pAcl)),
   775  		uintptr(dwAceRevision),
   776  		uintptr(aceFlags),
   777  		uintptr(accessMask),
   778  		uintptr(unsafe.Pointer(objectTypeGuid)),
   779  		uintptr(unsafe.Pointer(inheritedObjectTypeGuid)),
   780  		uintptr(pSid),
   781  		0,
   782  		0)
   783  	return ret1 != 0
   784  }
   785  
   786  func AddAce(pAcl *ACL, dwAceRevision DWORD, dwStartingAceIndex DWORD, pAceList LPVOID, nAceListLength DWORD) bool {
   787  	ret1 := syscall6(addAce, 5,
   788  		uintptr(unsafe.Pointer(pAcl)),
   789  		uintptr(dwAceRevision),
   790  		uintptr(dwStartingAceIndex),
   791  		uintptr(unsafe.Pointer(pAceList)),
   792  		uintptr(nAceListLength),
   793  		0)
   794  	return ret1 != 0
   795  }
   796  
   797  func AddAuditAccessAce(pAcl *ACL, dwAceRevision DWORD, dwAccessMask DWORD, pSid PSID, bAuditSuccess bool, bAuditFailure bool) bool {
   798  	ret1 := syscall6(addAuditAccessAce, 6,
   799  		uintptr(unsafe.Pointer(pAcl)),
   800  		uintptr(dwAceRevision),
   801  		uintptr(dwAccessMask),
   802  		uintptr(pSid),
   803  		getUintptrFromBool(bAuditSuccess),
   804  		getUintptrFromBool(bAuditFailure))
   805  	return ret1 != 0
   806  }
   807  
   808  func AddAuditAccessAceEx(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, dwAccessMask DWORD, pSid PSID, bAuditSuccess bool, bAuditFailure bool) bool {
   809  	ret1 := syscall9(addAuditAccessAceEx, 7,
   810  		uintptr(unsafe.Pointer(pAcl)),
   811  		uintptr(dwAceRevision),
   812  		uintptr(aceFlags),
   813  		uintptr(dwAccessMask),
   814  		uintptr(pSid),
   815  		getUintptrFromBool(bAuditSuccess),
   816  		getUintptrFromBool(bAuditFailure),
   817  		0,
   818  		0)
   819  	return ret1 != 0
   820  }
   821  
   822  func AddAuditAccessObjectAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, accessMask DWORD, objectTypeGuid *GUID, inheritedObjectTypeGuid *GUID, pSid PSID, bAuditSuccess bool, bAuditFailure bool) bool {
   823  	ret1 := syscall9(addAuditAccessObjectAce, 9,
   824  		uintptr(unsafe.Pointer(pAcl)),
   825  		uintptr(dwAceRevision),
   826  		uintptr(aceFlags),
   827  		uintptr(accessMask),
   828  		uintptr(unsafe.Pointer(objectTypeGuid)),
   829  		uintptr(unsafe.Pointer(inheritedObjectTypeGuid)),
   830  		uintptr(pSid),
   831  		getUintptrFromBool(bAuditSuccess),
   832  		getUintptrFromBool(bAuditFailure))
   833  	return ret1 != 0
   834  }
   835  
   836  func AddConditionalAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, aceType UCHAR, accessMask DWORD, pSid PSID, conditionStr PWCHAR, returnLength *uint32) bool {
   837  	ret1 := syscall9(addConditionalAce, 8,
   838  		uintptr(unsafe.Pointer(pAcl)),
   839  		uintptr(dwAceRevision),
   840  		uintptr(aceFlags),
   841  		uintptr(aceType),
   842  		uintptr(accessMask),
   843  		uintptr(pSid),
   844  		uintptr(unsafe.Pointer(conditionStr)),
   845  		uintptr(unsafe.Pointer(returnLength)),
   846  		0)
   847  	return ret1 != 0
   848  }
   849  
   850  func AddMandatoryAce(pAcl *ACL, dwAceRevision DWORD, aceFlags DWORD, mandatoryPolicy DWORD, pLabelSid PSID) bool {
   851  	ret1 := syscall6(addMandatoryAce, 5,
   852  		uintptr(unsafe.Pointer(pAcl)),
   853  		uintptr(dwAceRevision),
   854  		uintptr(aceFlags),
   855  		uintptr(mandatoryPolicy),
   856  		uintptr(pLabelSid),
   857  		0)
   858  	return ret1 != 0
   859  }
   860  
   861  func AddUsersToEncryptedFile(lpFileName string, pUsers *ENCRYPTION_CERTIFICATE_LIST) DWORD {
   862  	lpFileNameStr := unicode16FromString(lpFileName)
   863  	ret1 := syscall3(addUsersToEncryptedFile, 2,
   864  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
   865  		uintptr(unsafe.Pointer(pUsers)),
   866  		0)
   867  	return DWORD(ret1)
   868  }
   869  
   870  func AdjustTokenGroups(tokenHandle HANDLE, resetToDefault bool, newState *TOKEN_GROUPS, bufferLength DWORD, previousState *TOKEN_GROUPS, returnLength *DWORD) bool {
   871  	ret1 := syscall6(adjustTokenGroups, 6,
   872  		uintptr(tokenHandle),
   873  		getUintptrFromBool(resetToDefault),
   874  		uintptr(unsafe.Pointer(newState)),
   875  		uintptr(bufferLength),
   876  		uintptr(unsafe.Pointer(previousState)),
   877  		uintptr(unsafe.Pointer(returnLength)))
   878  	return ret1 != 0
   879  }
   880  
   881  func AdjustTokenPrivileges(tokenHandle HANDLE, disableAllPrivileges bool, newState *TOKEN_PRIVILEGES, bufferLength DWORD, previousState *TOKEN_PRIVILEGES, returnLength *DWORD) bool {
   882  	ret1 := syscall6(adjustTokenPrivileges, 6,
   883  		uintptr(tokenHandle),
   884  		getUintptrFromBool(disableAllPrivileges),
   885  		uintptr(unsafe.Pointer(newState)),
   886  		uintptr(bufferLength),
   887  		uintptr(unsafe.Pointer(previousState)),
   888  		uintptr(unsafe.Pointer(returnLength)))
   889  	return ret1 != 0
   890  }
   891  
   892  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 {
   893  	ret1 := syscall12(allocateAndInitializeSid, 11,
   894  		uintptr(unsafe.Pointer(pIdentifierAuthority)),
   895  		uintptr(nSubAuthorityCount),
   896  		uintptr(nSubAuthority0),
   897  		uintptr(nSubAuthority1),
   898  		uintptr(nSubAuthority2),
   899  		uintptr(nSubAuthority3),
   900  		uintptr(nSubAuthority4),
   901  		uintptr(nSubAuthority5),
   902  		uintptr(nSubAuthority6),
   903  		uintptr(nSubAuthority7),
   904  		uintptr(unsafe.Pointer(pSid)),
   905  		0)
   906  	return ret1 != 0
   907  }
   908  
   909  func AllocateLocallyUniqueId(luid *LUID) bool {
   910  	ret1 := syscall3(allocateLocallyUniqueId, 1,
   911  		uintptr(unsafe.Pointer(luid)),
   912  		0,
   913  		0)
   914  	return ret1 != 0
   915  }
   916  
   917  func AreAllAccessesGranted(grantedAccess DWORD, desiredAccess DWORD) bool {
   918  	ret1 := syscall3(areAllAccessesGranted, 2,
   919  		uintptr(grantedAccess),
   920  		uintptr(desiredAccess),
   921  		0)
   922  	return ret1 != 0
   923  }
   924  
   925  func AreAnyAccessesGranted(grantedAccess DWORD, desiredAccess DWORD) bool {
   926  	ret1 := syscall3(areAnyAccessesGranted, 2,
   927  		uintptr(grantedAccess),
   928  		uintptr(desiredAccess),
   929  		0)
   930  	return ret1 != 0
   931  }
   932  
   933  func AuditComputeEffectivePolicyBySid(pSid /*const*/ PSID, pSubCategoryGuids /*const*/ *GUID, policyCount ULONG, ppAuditPolicy *PAUDIT_POLICY_INFORMATION) BOOLEAN {
   934  	ret1 := syscall6(auditComputeEffectivePolicyBySid, 4,
   935  		uintptr(pSid),
   936  		uintptr(unsafe.Pointer(pSubCategoryGuids)),
   937  		uintptr(policyCount),
   938  		uintptr(unsafe.Pointer(ppAuditPolicy)),
   939  		0,
   940  		0)
   941  	return BOOLEAN(ret1)
   942  }
   943  
   944  func AuditComputeEffectivePolicyByToken(hTokenHandle HANDLE, pSubCategoryGuids /*const*/ *GUID, policyCount ULONG, ppAuditPolicy *PAUDIT_POLICY_INFORMATION) BOOLEAN {
   945  	ret1 := syscall6(auditComputeEffectivePolicyByToken, 4,
   946  		uintptr(hTokenHandle),
   947  		uintptr(unsafe.Pointer(pSubCategoryGuids)),
   948  		uintptr(policyCount),
   949  		uintptr(unsafe.Pointer(ppAuditPolicy)),
   950  		0,
   951  		0)
   952  	return BOOLEAN(ret1)
   953  }
   954  
   955  func AuditEnumerateCategories(ppAuditCategoriesArray uintptr, pCountReturned *uint32) BOOLEAN {
   956  	ret1 := syscall3(auditEnumerateCategories, 2,
   957  		ppAuditCategoriesArray,
   958  		uintptr(unsafe.Pointer(pCountReturned)),
   959  		0)
   960  	return BOOLEAN(ret1)
   961  }
   962  
   963  func AuditEnumeratePerUserPolicy(ppAuditSidArray *PPOLICY_AUDIT_SID_ARRAY) BOOLEAN {
   964  	ret1 := syscall3(auditEnumeratePerUserPolicy, 1,
   965  		uintptr(unsafe.Pointer(ppAuditSidArray)),
   966  		0,
   967  		0)
   968  	return BOOLEAN(ret1)
   969  }
   970  
   971  func AuditEnumerateSubCategories(pAuditCategoryGuid /*const*/ *GUID, bRetrieveAllSubCategories BOOLEAN, ppAuditSubCategoriesArray uintptr, pCountReturned *uint32) BOOLEAN {
   972  	ret1 := syscall6(auditEnumerateSubCategories, 4,
   973  		uintptr(unsafe.Pointer(pAuditCategoryGuid)),
   974  		uintptr(bRetrieveAllSubCategories),
   975  		ppAuditSubCategoriesArray,
   976  		uintptr(unsafe.Pointer(pCountReturned)),
   977  		0,
   978  		0)
   979  	return BOOLEAN(ret1)
   980  }
   981  
   982  func AuditFree(buffer uintptr) {
   983  	syscall3(auditFree, 1,
   984  		buffer,
   985  		0,
   986  		0)
   987  }
   988  
   989  func AuditLookupCategoryGuidFromCategoryId(auditCategoryId POLICY_AUDIT_EVENT_TYPE, pAuditCategoryGuid *GUID) BOOLEAN {
   990  	ret1 := syscall3(auditLookupCategoryGuidFromCategoryId, 2,
   991  		uintptr(auditCategoryId),
   992  		uintptr(unsafe.Pointer(pAuditCategoryGuid)),
   993  		0)
   994  	return BOOLEAN(ret1)
   995  }
   996  
   997  func AuditLookupCategoryIdFromCategoryGuid(pAuditCategoryGuid /*const*/ *GUID, pAuditCategoryId PPOLICY_AUDIT_EVENT_TYPE) BOOLEAN {
   998  	ret1 := syscall3(auditLookupCategoryIdFromCategoryGuid, 2,
   999  		uintptr(unsafe.Pointer(pAuditCategoryGuid)),
  1000  		uintptr(unsafe.Pointer(pAuditCategoryId)),
  1001  		0)
  1002  	return BOOLEAN(ret1)
  1003  }
  1004  
  1005  func AuditLookupCategoryName(pAuditCategoryGuid /*const*/ *GUID, ppszCategoryName *LPWSTR) BOOLEAN {
  1006  	ret1 := syscall3(auditLookupCategoryName, 2,
  1007  		uintptr(unsafe.Pointer(pAuditCategoryGuid)),
  1008  		uintptr(unsafe.Pointer(ppszCategoryName)),
  1009  		0)
  1010  	return BOOLEAN(ret1)
  1011  }
  1012  
  1013  func AuditLookupSubCategoryName(pAuditSubCategoryGuid /*const*/ *GUID, ppszSubCategoryName *LPWSTR) BOOLEAN {
  1014  	ret1 := syscall3(auditLookupSubCategoryName, 2,
  1015  		uintptr(unsafe.Pointer(pAuditSubCategoryGuid)),
  1016  		uintptr(unsafe.Pointer(ppszSubCategoryName)),
  1017  		0)
  1018  	return BOOLEAN(ret1)
  1019  }
  1020  
  1021  func AuditQueryPerUserPolicy(pSid /*const*/ PSID, pSubCategoryGuids /*const*/ *GUID, policyCount ULONG, ppAuditPolicy *PAUDIT_POLICY_INFORMATION) BOOLEAN {
  1022  	ret1 := syscall6(auditQueryPerUserPolicy, 4,
  1023  		uintptr(pSid),
  1024  		uintptr(unsafe.Pointer(pSubCategoryGuids)),
  1025  		uintptr(policyCount),
  1026  		uintptr(unsafe.Pointer(ppAuditPolicy)),
  1027  		0,
  1028  		0)
  1029  	return BOOLEAN(ret1)
  1030  }
  1031  
  1032  func AuditQuerySecurity(securityInformation SECURITY_INFORMATION, ppSecurityDescriptor *PSECURITY_DESCRIPTOR) BOOLEAN {
  1033  	ret1 := syscall3(auditQuerySecurity, 2,
  1034  		uintptr(securityInformation),
  1035  		uintptr(unsafe.Pointer(ppSecurityDescriptor)),
  1036  		0)
  1037  	return BOOLEAN(ret1)
  1038  }
  1039  
  1040  func AuditQuerySystemPolicy(pSubCategoryGuids /*const*/ *GUID, policyCount ULONG, ppAuditPolicy *PAUDIT_POLICY_INFORMATION) BOOLEAN {
  1041  	ret1 := syscall3(auditQuerySystemPolicy, 3,
  1042  		uintptr(unsafe.Pointer(pSubCategoryGuids)),
  1043  		uintptr(policyCount),
  1044  		uintptr(unsafe.Pointer(ppAuditPolicy)))
  1045  	return BOOLEAN(ret1)
  1046  }
  1047  
  1048  func AuditSetPerUserPolicy(pSid /*const*/ PSID, pAuditPolicy /*const*/ PAUDIT_POLICY_INFORMATION, policyCount ULONG) BOOLEAN {
  1049  	ret1 := syscall3(auditSetPerUserPolicy, 3,
  1050  		uintptr(pSid),
  1051  		uintptr(unsafe.Pointer(pAuditPolicy)),
  1052  		uintptr(policyCount))
  1053  	return BOOLEAN(ret1)
  1054  }
  1055  
  1056  func AuditSetSecurity(securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR) BOOLEAN {
  1057  	ret1 := syscall3(auditSetSecurity, 2,
  1058  		uintptr(securityInformation),
  1059  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  1060  		0)
  1061  	return BOOLEAN(ret1)
  1062  }
  1063  
  1064  func AuditSetSystemPolicy(pAuditPolicy /*const*/ PAUDIT_POLICY_INFORMATION, policyCount ULONG) BOOLEAN {
  1065  	ret1 := syscall3(auditSetSystemPolicy, 2,
  1066  		uintptr(unsafe.Pointer(pAuditPolicy)),
  1067  		uintptr(policyCount),
  1068  		0)
  1069  	return BOOLEAN(ret1)
  1070  }
  1071  
  1072  func BackupEventLog(hEventLog HANDLE, lpBackupFileName string) bool {
  1073  	lpBackupFileNameStr := unicode16FromString(lpBackupFileName)
  1074  	ret1 := syscall3(backupEventLog, 2,
  1075  		uintptr(hEventLog),
  1076  		uintptr(unsafe.Pointer(&lpBackupFileNameStr[0])),
  1077  		0)
  1078  	return ret1 != 0
  1079  }
  1080  
  1081  func BuildExplicitAccessWithName(pExplicitAccess *EXPLICIT_ACCESS, pTrusteeName LPWSTR, accessPermissions DWORD, accessMode ACCESS_MODE, inheritance DWORD) {
  1082  	syscall6(buildExplicitAccessWithName, 5,
  1083  		uintptr(unsafe.Pointer(pExplicitAccess)),
  1084  		uintptr(unsafe.Pointer(pTrusteeName)),
  1085  		uintptr(accessPermissions),
  1086  		uintptr(accessMode),
  1087  		uintptr(inheritance),
  1088  		0)
  1089  }
  1090  
  1091  func BuildImpersonateExplicitAccessWithName(pExplicitAccess *EXPLICIT_ACCESS, pTrusteeName LPWSTR, pTrustee *TRUSTEE, accessPermissions DWORD, accessMode ACCESS_MODE, inheritance DWORD) {
  1092  	syscall6(buildImpersonateExplicitAccessWithName, 6,
  1093  		uintptr(unsafe.Pointer(pExplicitAccess)),
  1094  		uintptr(unsafe.Pointer(pTrusteeName)),
  1095  		uintptr(unsafe.Pointer(pTrustee)),
  1096  		uintptr(accessPermissions),
  1097  		uintptr(accessMode),
  1098  		uintptr(inheritance))
  1099  }
  1100  
  1101  func BuildImpersonateTrustee(pTrustee *TRUSTEE, pImpersonateTrustee *TRUSTEE) {
  1102  	syscall3(buildImpersonateTrustee, 2,
  1103  		uintptr(unsafe.Pointer(pTrustee)),
  1104  		uintptr(unsafe.Pointer(pImpersonateTrustee)),
  1105  		0)
  1106  }
  1107  
  1108  func BuildSecurityDescriptor(pOwner *TRUSTEE, pGroup *TRUSTEE, cCountOfAccessEntries ULONG, pListOfAccessEntries *EXPLICIT_ACCESS, cCountOfAuditEntries ULONG, pListOfAuditEntries *EXPLICIT_ACCESS, pOldSD PSECURITY_DESCRIPTOR, pSizeNewSD *uint32, pNewSD *PSECURITY_DESCRIPTOR) DWORD {
  1109  	ret1 := syscall9(buildSecurityDescriptor, 9,
  1110  		uintptr(unsafe.Pointer(pOwner)),
  1111  		uintptr(unsafe.Pointer(pGroup)),
  1112  		uintptr(cCountOfAccessEntries),
  1113  		uintptr(unsafe.Pointer(pListOfAccessEntries)),
  1114  		uintptr(cCountOfAuditEntries),
  1115  		uintptr(unsafe.Pointer(pListOfAuditEntries)),
  1116  		uintptr(unsafe.Pointer(pOldSD)),
  1117  		uintptr(unsafe.Pointer(pSizeNewSD)),
  1118  		uintptr(unsafe.Pointer(pNewSD)))
  1119  	return DWORD(ret1)
  1120  }
  1121  
  1122  func BuildTrusteeWithName(pTrustee *TRUSTEE, pName LPWSTR) {
  1123  	syscall3(buildTrusteeWithName, 2,
  1124  		uintptr(unsafe.Pointer(pTrustee)),
  1125  		uintptr(unsafe.Pointer(pName)),
  1126  		0)
  1127  }
  1128  
  1129  func BuildTrusteeWithObjectsAndName(pTrustee *TRUSTEE, pObjName *OBJECTS_AND_NAME, objectType SE_OBJECT_TYPE, objectTypeName LPWSTR, inheritedObjectTypeName LPWSTR, name LPWSTR) {
  1130  	syscall6(buildTrusteeWithObjectsAndName, 6,
  1131  		uintptr(unsafe.Pointer(pTrustee)),
  1132  		uintptr(unsafe.Pointer(pObjName)),
  1133  		uintptr(objectType),
  1134  		uintptr(unsafe.Pointer(objectTypeName)),
  1135  		uintptr(unsafe.Pointer(inheritedObjectTypeName)),
  1136  		uintptr(unsafe.Pointer(name)))
  1137  }
  1138  
  1139  func BuildTrusteeWithObjectsAndSid(pTrustee *TRUSTEE, pObjSid *OBJECTS_AND_SID, pObjectGuid *GUID, pInheritedObjectGuid *GUID, pSid PSID) {
  1140  	syscall6(buildTrusteeWithObjectsAndSid, 5,
  1141  		uintptr(unsafe.Pointer(pTrustee)),
  1142  		uintptr(unsafe.Pointer(pObjSid)),
  1143  		uintptr(unsafe.Pointer(pObjectGuid)),
  1144  		uintptr(unsafe.Pointer(pInheritedObjectGuid)),
  1145  		uintptr(pSid),
  1146  		0)
  1147  }
  1148  
  1149  func BuildTrusteeWithSid(pTrustee *TRUSTEE, pSid PSID) {
  1150  	syscall3(buildTrusteeWithSid, 2,
  1151  		uintptr(unsafe.Pointer(pTrustee)),
  1152  		uintptr(pSid),
  1153  		0)
  1154  }
  1155  
  1156  func ChangeServiceConfig2(hService SC_HANDLE, dwInfoLevel DWORD, lpInfo LPVOID) bool {
  1157  	ret1 := syscall3(changeServiceConfig2, 3,
  1158  		uintptr(hService),
  1159  		uintptr(dwInfoLevel),
  1160  		uintptr(unsafe.Pointer(lpInfo)))
  1161  	return ret1 != 0
  1162  }
  1163  
  1164  func ChangeServiceConfig(hService SC_HANDLE, dwServiceType DWORD, dwStartType DWORD, dwErrorControl DWORD, lpBinaryPathName string, lpLoadOrderGroup string, lpdwTagId *uint32, lpDependencies string, lpServiceStartName string, lpPassword string, lpDisplayName string) bool {
  1165  	lpBinaryPathNameStr := unicode16FromString(lpBinaryPathName)
  1166  	lpLoadOrderGroupStr := unicode16FromString(lpLoadOrderGroup)
  1167  	lpDependenciesStr := unicode16FromString(lpDependencies)
  1168  	lpServiceStartNameStr := unicode16FromString(lpServiceStartName)
  1169  	lpPasswordStr := unicode16FromString(lpPassword)
  1170  	lpDisplayNameStr := unicode16FromString(lpDisplayName)
  1171  	ret1 := syscall12(changeServiceConfig, 11,
  1172  		uintptr(hService),
  1173  		uintptr(dwServiceType),
  1174  		uintptr(dwStartType),
  1175  		uintptr(dwErrorControl),
  1176  		uintptr(unsafe.Pointer(&lpBinaryPathNameStr[0])),
  1177  		uintptr(unsafe.Pointer(&lpLoadOrderGroupStr[0])),
  1178  		uintptr(unsafe.Pointer(lpdwTagId)),
  1179  		uintptr(unsafe.Pointer(&lpDependenciesStr[0])),
  1180  		uintptr(unsafe.Pointer(&lpServiceStartNameStr[0])),
  1181  		uintptr(unsafe.Pointer(&lpPasswordStr[0])),
  1182  		uintptr(unsafe.Pointer(&lpDisplayNameStr[0])),
  1183  		0)
  1184  	return ret1 != 0
  1185  }
  1186  
  1187  func CheckTokenMembership(tokenHandle HANDLE, sidToCheck PSID, isMember *BOOL) bool {
  1188  	ret1 := syscall3(checkTokenMembership, 3,
  1189  		uintptr(tokenHandle),
  1190  		uintptr(sidToCheck),
  1191  		uintptr(unsafe.Pointer(isMember)))
  1192  	return ret1 != 0
  1193  }
  1194  
  1195  func ClearEventLog(hEventLog HANDLE, lpBackupFileName string) bool {
  1196  	lpBackupFileNameStr := unicode16FromString(lpBackupFileName)
  1197  	ret1 := syscall3(clearEventLog, 2,
  1198  		uintptr(hEventLog),
  1199  		uintptr(unsafe.Pointer(&lpBackupFileNameStr[0])),
  1200  		0)
  1201  	return ret1 != 0
  1202  }
  1203  
  1204  func CloseEncryptedFileRaw(pvContext uintptr) {
  1205  	syscall3(closeEncryptedFileRaw, 1,
  1206  		pvContext,
  1207  		0,
  1208  		0)
  1209  }
  1210  
  1211  func CloseEventLog(hEventLog HANDLE) bool {
  1212  	ret1 := syscall3(closeEventLog, 1,
  1213  		uintptr(hEventLog),
  1214  		0,
  1215  		0)
  1216  	return ret1 != 0
  1217  }
  1218  
  1219  func CloseServiceHandle(hSCObject SC_HANDLE) bool {
  1220  	ret1 := syscall3(closeServiceHandle, 1,
  1221  		uintptr(hSCObject),
  1222  		0,
  1223  		0)
  1224  	return ret1 != 0
  1225  }
  1226  
  1227  func CloseThreadWaitChainSession(wctHandle HWCT) {
  1228  	syscall3(closeThreadWaitChainSession, 1,
  1229  		uintptr(wctHandle),
  1230  		0,
  1231  		0)
  1232  }
  1233  
  1234  func CommandLineFromMsiDescriptor(descriptor *WCHAR, commandLine *WCHAR, commandLineLength *uint32) DWORD {
  1235  	ret1 := syscall3(commandLineFromMsiDescriptor, 3,
  1236  		uintptr(unsafe.Pointer(descriptor)),
  1237  		uintptr(unsafe.Pointer(commandLine)),
  1238  		uintptr(unsafe.Pointer(commandLineLength)))
  1239  	return DWORD(ret1)
  1240  }
  1241  
  1242  func ControlService(hService SC_HANDLE, dwControl DWORD, lpServiceStatus *SERVICE_STATUS) bool {
  1243  	ret1 := syscall3(controlService, 3,
  1244  		uintptr(hService),
  1245  		uintptr(dwControl),
  1246  		uintptr(unsafe.Pointer(lpServiceStatus)))
  1247  	return ret1 != 0
  1248  }
  1249  
  1250  func ControlServiceEx(hService SC_HANDLE, dwControl DWORD, dwInfoLevel DWORD, pControlParams uintptr) bool {
  1251  	ret1 := syscall6(controlServiceEx, 4,
  1252  		uintptr(hService),
  1253  		uintptr(dwControl),
  1254  		uintptr(dwInfoLevel),
  1255  		pControlParams,
  1256  		0,
  1257  		0)
  1258  	return ret1 != 0
  1259  }
  1260  
  1261  func ConvertSecurityDescriptorToStringSecurityDescriptor(securityDescriptor PSECURITY_DESCRIPTOR, requestedStringSDRevision DWORD, securityInformation SECURITY_INFORMATION, stringSecurityDescriptor *LPWSTR, stringSecurityDescriptorLen *uint32) bool {
  1262  	ret1 := syscall6(convertSecurityDescriptorToStringSecurityDescriptor, 5,
  1263  		uintptr(unsafe.Pointer(securityDescriptor)),
  1264  		uintptr(requestedStringSDRevision),
  1265  		uintptr(securityInformation),
  1266  		uintptr(unsafe.Pointer(stringSecurityDescriptor)),
  1267  		uintptr(unsafe.Pointer(stringSecurityDescriptorLen)),
  1268  		0)
  1269  	return ret1 != 0
  1270  }
  1271  
  1272  func ConvertSidToStringSid(sid PSID, stringSid *LPWSTR) bool {
  1273  	ret1 := syscall3(convertSidToStringSid, 2,
  1274  		uintptr(sid),
  1275  		uintptr(unsafe.Pointer(stringSid)),
  1276  		0)
  1277  	return ret1 != 0
  1278  }
  1279  
  1280  func ConvertStringSecurityDescriptorToSecurityDescriptor(stringSecurityDescriptor string, stringSDRevision DWORD, securityDescriptor *PSECURITY_DESCRIPTOR, securityDescriptorSize *uint32) bool {
  1281  	stringSecurityDescriptorStr := unicode16FromString(stringSecurityDescriptor)
  1282  	ret1 := syscall6(convertStringSecurityDescriptorToSecurityDescriptor, 4,
  1283  		uintptr(unsafe.Pointer(&stringSecurityDescriptorStr[0])),
  1284  		uintptr(stringSDRevision),
  1285  		uintptr(unsafe.Pointer(securityDescriptor)),
  1286  		uintptr(unsafe.Pointer(securityDescriptorSize)),
  1287  		0,
  1288  		0)
  1289  	return ret1 != 0
  1290  }
  1291  
  1292  func ConvertStringSidToSid(stringSid string, sid *PSID) bool {
  1293  	stringSidStr := unicode16FromString(stringSid)
  1294  	ret1 := syscall3(convertStringSidToSid, 2,
  1295  		uintptr(unsafe.Pointer(&stringSidStr[0])),
  1296  		uintptr(unsafe.Pointer(sid)),
  1297  		0)
  1298  	return ret1 != 0
  1299  }
  1300  
  1301  func ConvertToAutoInheritPrivateObjectSecurity(parentDescriptor PSECURITY_DESCRIPTOR, currentSecurityDescriptor PSECURITY_DESCRIPTOR, newSecurityDescriptor *PSECURITY_DESCRIPTOR, objectType *GUID, isDirectoryObject BOOLEAN, genericMapping *GENERIC_MAPPING) bool {
  1302  	ret1 := syscall6(convertToAutoInheritPrivateObjectSecurity, 6,
  1303  		uintptr(unsafe.Pointer(parentDescriptor)),
  1304  		uintptr(unsafe.Pointer(currentSecurityDescriptor)),
  1305  		uintptr(unsafe.Pointer(newSecurityDescriptor)),
  1306  		uintptr(unsafe.Pointer(objectType)),
  1307  		uintptr(isDirectoryObject),
  1308  		uintptr(unsafe.Pointer(genericMapping)))
  1309  	return ret1 != 0
  1310  }
  1311  
  1312  func CopySid(nDestinationSidLength DWORD, pDestinationSid PSID, pSourceSid PSID) bool {
  1313  	ret1 := syscall3(copySid, 3,
  1314  		uintptr(nDestinationSidLength),
  1315  		uintptr(pDestinationSid),
  1316  		uintptr(pSourceSid))
  1317  	return ret1 != 0
  1318  }
  1319  
  1320  func CreatePrivateObjectSecurity(parentDescriptor PSECURITY_DESCRIPTOR, creatorDescriptor PSECURITY_DESCRIPTOR, newDescriptor *PSECURITY_DESCRIPTOR, isDirectoryObject bool, token HANDLE, genericMapping *GENERIC_MAPPING) bool {
  1321  	ret1 := syscall6(createPrivateObjectSecurity, 6,
  1322  		uintptr(unsafe.Pointer(parentDescriptor)),
  1323  		uintptr(unsafe.Pointer(creatorDescriptor)),
  1324  		uintptr(unsafe.Pointer(newDescriptor)),
  1325  		getUintptrFromBool(isDirectoryObject),
  1326  		uintptr(token),
  1327  		uintptr(unsafe.Pointer(genericMapping)))
  1328  	return ret1 != 0
  1329  }
  1330  
  1331  func CreatePrivateObjectSecurityEx(parentDescriptor PSECURITY_DESCRIPTOR, creatorDescriptor PSECURITY_DESCRIPTOR, newDescriptor *PSECURITY_DESCRIPTOR, objectType *GUID, isContainerObject bool, autoInheritFlags ULONG, token HANDLE, genericMapping *GENERIC_MAPPING) bool {
  1332  	ret1 := syscall9(createPrivateObjectSecurityEx, 8,
  1333  		uintptr(unsafe.Pointer(parentDescriptor)),
  1334  		uintptr(unsafe.Pointer(creatorDescriptor)),
  1335  		uintptr(unsafe.Pointer(newDescriptor)),
  1336  		uintptr(unsafe.Pointer(objectType)),
  1337  		getUintptrFromBool(isContainerObject),
  1338  		uintptr(autoInheritFlags),
  1339  		uintptr(token),
  1340  		uintptr(unsafe.Pointer(genericMapping)),
  1341  		0)
  1342  	return ret1 != 0
  1343  }
  1344  
  1345  func CreatePrivateObjectSecurityWithMultipleInheritance(parentDescriptor PSECURITY_DESCRIPTOR, creatorDescriptor PSECURITY_DESCRIPTOR, newDescriptor *PSECURITY_DESCRIPTOR, objectTypes uintptr, guidCount ULONG, isContainerObject bool, autoInheritFlags ULONG, token HANDLE, genericMapping *GENERIC_MAPPING) bool {
  1346  	ret1 := syscall9(createPrivateObjectSecurityWithMultipleInheritance, 9,
  1347  		uintptr(unsafe.Pointer(parentDescriptor)),
  1348  		uintptr(unsafe.Pointer(creatorDescriptor)),
  1349  		uintptr(unsafe.Pointer(newDescriptor)),
  1350  		objectTypes,
  1351  		uintptr(guidCount),
  1352  		getUintptrFromBool(isContainerObject),
  1353  		uintptr(autoInheritFlags),
  1354  		uintptr(token),
  1355  		uintptr(unsafe.Pointer(genericMapping)))
  1356  	return ret1 != 0
  1357  }
  1358  
  1359  func CreateProcessAsUser(hToken HANDLE, lpApplicationName string, lpCommandLine LPWSTR, lpProcessAttributes *SECURITY_ATTRIBUTES, lpThreadAttributes *SECURITY_ATTRIBUTES, bInheritHandles bool, dwCreationFlags DWORD, lpEnvironment LPVOID, lpCurrentDirectory string, lpStartupInfo *STARTUPINFO, lpProcessInformation *PROCESS_INFORMATION) bool {
  1360  	lpApplicationNameStr := unicode16FromString(lpApplicationName)
  1361  	lpCurrentDirectoryStr := unicode16FromString(lpCurrentDirectory)
  1362  	ret1 := syscall12(createProcessAsUser, 11,
  1363  		uintptr(hToken),
  1364  		uintptr(unsafe.Pointer(&lpApplicationNameStr[0])),
  1365  		uintptr(unsafe.Pointer(lpCommandLine)),
  1366  		uintptr(unsafe.Pointer(lpProcessAttributes)),
  1367  		uintptr(unsafe.Pointer(lpThreadAttributes)),
  1368  		getUintptrFromBool(bInheritHandles),
  1369  		uintptr(dwCreationFlags),
  1370  		uintptr(unsafe.Pointer(lpEnvironment)),
  1371  		uintptr(unsafe.Pointer(&lpCurrentDirectoryStr[0])),
  1372  		uintptr(unsafe.Pointer(lpStartupInfo)),
  1373  		uintptr(unsafe.Pointer(lpProcessInformation)),
  1374  		0)
  1375  	return ret1 != 0
  1376  }
  1377  
  1378  func CreateProcessWithLogonW(lpUsername string, lpDomain string, lpPassword string, dwLogonFlags DWORD, lpApplicationName string, lpCommandLine LPWSTR, dwCreationFlags DWORD, lpEnvironment LPVOID, lpCurrentDirectory string, lpStartupInfo *STARTUPINFO, lpProcessInformation *PROCESS_INFORMATION) bool {
  1379  	lpUsernameStr := unicode16FromString(lpUsername)
  1380  	lpDomainStr := unicode16FromString(lpDomain)
  1381  	lpPasswordStr := unicode16FromString(lpPassword)
  1382  	lpApplicationNameStr := unicode16FromString(lpApplicationName)
  1383  	lpCurrentDirectoryStr := unicode16FromString(lpCurrentDirectory)
  1384  	ret1 := syscall12(createProcessWithLogonW, 11,
  1385  		uintptr(unsafe.Pointer(&lpUsernameStr[0])),
  1386  		uintptr(unsafe.Pointer(&lpDomainStr[0])),
  1387  		uintptr(unsafe.Pointer(&lpPasswordStr[0])),
  1388  		uintptr(dwLogonFlags),
  1389  		uintptr(unsafe.Pointer(&lpApplicationNameStr[0])),
  1390  		uintptr(unsafe.Pointer(lpCommandLine)),
  1391  		uintptr(dwCreationFlags),
  1392  		uintptr(unsafe.Pointer(lpEnvironment)),
  1393  		uintptr(unsafe.Pointer(&lpCurrentDirectoryStr[0])),
  1394  		uintptr(unsafe.Pointer(lpStartupInfo)),
  1395  		uintptr(unsafe.Pointer(lpProcessInformation)),
  1396  		0)
  1397  	return ret1 != 0
  1398  }
  1399  
  1400  func CreateProcessWithTokenW(hToken HANDLE, dwLogonFlags DWORD, lpApplicationName string, lpCommandLine LPWSTR, dwCreationFlags DWORD, lpEnvironment LPVOID, lpCurrentDirectory string, lpStartupInfo *STARTUPINFO, lpProcessInformation *PROCESS_INFORMATION) bool {
  1401  	lpApplicationNameStr := unicode16FromString(lpApplicationName)
  1402  	lpCurrentDirectoryStr := unicode16FromString(lpCurrentDirectory)
  1403  	ret1 := syscall9(createProcessWithTokenW, 9,
  1404  		uintptr(hToken),
  1405  		uintptr(dwLogonFlags),
  1406  		uintptr(unsafe.Pointer(&lpApplicationNameStr[0])),
  1407  		uintptr(unsafe.Pointer(lpCommandLine)),
  1408  		uintptr(dwCreationFlags),
  1409  		uintptr(unsafe.Pointer(lpEnvironment)),
  1410  		uintptr(unsafe.Pointer(&lpCurrentDirectoryStr[0])),
  1411  		uintptr(unsafe.Pointer(lpStartupInfo)),
  1412  		uintptr(unsafe.Pointer(lpProcessInformation)))
  1413  	return ret1 != 0
  1414  }
  1415  
  1416  // TODO: Unknown type(s): PLUID_AND_ATTRIBUTES, PSID_AND_ATTRIBUTES
  1417  // func CreateRestrictedToken(existingTokenHandle HANDLE, flags DWORD, disableSidCount DWORD, sidsToDisable PSID_AND_ATTRIBUTES, deletePrivilegeCount DWORD, privilegesToDelete PLUID_AND_ATTRIBUTES, restrictedSidCount DWORD, sidsToRestrict PSID_AND_ATTRIBUTES, newTokenHandle *HANDLE) bool
  1418  
  1419  func CreateService(hSCManager SC_HANDLE, lpServiceName string, lpDisplayName string, dwDesiredAccess DWORD, dwServiceType DWORD, dwStartType DWORD, dwErrorControl DWORD, lpBinaryPathName string, lpLoadOrderGroup string, lpdwTagId *uint32, lpDependencies string, lpServiceStartName string, lpPassword string) SC_HANDLE {
  1420  	lpServiceNameStr := unicode16FromString(lpServiceName)
  1421  	lpDisplayNameStr := unicode16FromString(lpDisplayName)
  1422  	lpBinaryPathNameStr := unicode16FromString(lpBinaryPathName)
  1423  	lpLoadOrderGroupStr := unicode16FromString(lpLoadOrderGroup)
  1424  	lpDependenciesStr := unicode16FromString(lpDependencies)
  1425  	lpServiceStartNameStr := unicode16FromString(lpServiceStartName)
  1426  	lpPasswordStr := unicode16FromString(lpPassword)
  1427  	ret1 := syscall15(createService, 13,
  1428  		uintptr(hSCManager),
  1429  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  1430  		uintptr(unsafe.Pointer(&lpDisplayNameStr[0])),
  1431  		uintptr(dwDesiredAccess),
  1432  		uintptr(dwServiceType),
  1433  		uintptr(dwStartType),
  1434  		uintptr(dwErrorControl),
  1435  		uintptr(unsafe.Pointer(&lpBinaryPathNameStr[0])),
  1436  		uintptr(unsafe.Pointer(&lpLoadOrderGroupStr[0])),
  1437  		uintptr(unsafe.Pointer(lpdwTagId)),
  1438  		uintptr(unsafe.Pointer(&lpDependenciesStr[0])),
  1439  		uintptr(unsafe.Pointer(&lpServiceStartNameStr[0])),
  1440  		uintptr(unsafe.Pointer(&lpPasswordStr[0])),
  1441  		0,
  1442  		0)
  1443  	return SC_HANDLE(ret1)
  1444  }
  1445  
  1446  // TODO: Unknown type(s): WELL_KNOWN_SID_TYPE
  1447  // func CreateWellKnownSid(wellKnownSidType WELL_KNOWN_SID_TYPE, domainSid PSID, pSid PSID, cbSid *uint32) bool
  1448  
  1449  func CredDelete(targetName string, aType DWORD, flags DWORD) bool {
  1450  	targetNameStr := unicode16FromString(targetName)
  1451  	ret1 := syscall3(credDelete, 3,
  1452  		uintptr(unsafe.Pointer(&targetNameStr[0])),
  1453  		uintptr(aType),
  1454  		uintptr(flags))
  1455  	return ret1 != 0
  1456  }
  1457  
  1458  func CredEnumerate(filter string, flags DWORD, count *uint32, credential uintptr) bool {
  1459  	filterStr := unicode16FromString(filter)
  1460  	ret1 := syscall6(credEnumerate, 4,
  1461  		uintptr(unsafe.Pointer(&filterStr[0])),
  1462  		uintptr(flags),
  1463  		uintptr(unsafe.Pointer(count)),
  1464  		credential,
  1465  		0,
  1466  		0)
  1467  	return ret1 != 0
  1468  }
  1469  
  1470  // TODO: Unknown type(s): PCREDENTIALW *
  1471  // func CredFindBestCredential(targetName string, aType DWORD, flags DWORD, credential PCREDENTIALW *) bool
  1472  
  1473  func CredFree(buffer uintptr) {
  1474  	syscall3(credFree, 1,
  1475  		buffer,
  1476  		0,
  1477  		0)
  1478  }
  1479  
  1480  func CredGetSessionTypes(maximumPersistCount DWORD, maximumPersist *uint32) bool {
  1481  	ret1 := syscall3(credGetSessionTypes, 2,
  1482  		uintptr(maximumPersistCount),
  1483  		uintptr(unsafe.Pointer(maximumPersist)),
  1484  		0)
  1485  	return ret1 != 0
  1486  }
  1487  
  1488  // TODO: Unknown type(s): PCREDENTIAL_TARGET_INFORMATIONW *
  1489  // func CredGetTargetInfo(targetName string, flags DWORD, targetInfo PCREDENTIAL_TARGET_INFORMATIONW *) bool
  1490  
  1491  func CredIsMarshaledCredential(marshaledCredential string) bool {
  1492  	marshaledCredentialStr := unicode16FromString(marshaledCredential)
  1493  	ret1 := syscall3(credIsMarshaledCredential, 1,
  1494  		uintptr(unsafe.Pointer(&marshaledCredentialStr[0])),
  1495  		0,
  1496  		0)
  1497  	return ret1 != 0
  1498  }
  1499  
  1500  // TODO: Unknown type(s): CRED_PROTECTION_TYPE *
  1501  // func CredIsProtected(pszProtectedCredentials LPWSTR, pProtectionType CRED_PROTECTION_TYPE *) bool
  1502  
  1503  // TODO: Unknown type(s): CRED_MARSHAL_TYPE
  1504  // func CredMarshalCredential(credType CRED_MARSHAL_TYPE, credential uintptr, marshaledCredential *LPWSTR) bool
  1505  
  1506  // TODO: Unknown type(s): CRED_PROTECTION_TYPE *
  1507  // func CredProtect(fAsSelf bool, pszCredentials LPWSTR, cchCredentials DWORD, pszProtectedCredentials LPWSTR, pcchMaxChars *uint32, protectionType CRED_PROTECTION_TYPE *) bool
  1508  
  1509  // TODO: Unknown type(s): PCREDENTIAL_TARGET_INFORMATIONW
  1510  // func CredReadDomainCredentials(targetInfo PCREDENTIAL_TARGET_INFORMATIONW, flags DWORD, count *uint32, credential uintptr) bool
  1511  
  1512  // TODO: Unknown type(s): PCREDENTIALW *
  1513  // func CredRead(targetName string, aType DWORD, flags DWORD, credential PCREDENTIALW *) bool
  1514  
  1515  func CredRename(oldTargetName string, newTargetName string, aType DWORD, flags DWORD) bool {
  1516  	oldTargetNameStr := unicode16FromString(oldTargetName)
  1517  	newTargetNameStr := unicode16FromString(newTargetName)
  1518  	ret1 := syscall6(credRename, 4,
  1519  		uintptr(unsafe.Pointer(&oldTargetNameStr[0])),
  1520  		uintptr(unsafe.Pointer(&newTargetNameStr[0])),
  1521  		uintptr(aType),
  1522  		uintptr(flags),
  1523  		0,
  1524  		0)
  1525  	return ret1 != 0
  1526  }
  1527  
  1528  // TODO: Unknown type(s): PCRED_MARSHAL_TYPE
  1529  // func CredUnmarshalCredential(marshaledCredential string, credType PCRED_MARSHAL_TYPE, credential *PVOID) bool
  1530  
  1531  func CredUnprotect(fAsSelf bool, pszProtectedCredentials LPWSTR, cchCredentials DWORD, pszCredentials LPWSTR, pcchMaxChars *uint32) bool {
  1532  	ret1 := syscall6(credUnprotect, 5,
  1533  		getUintptrFromBool(fAsSelf),
  1534  		uintptr(unsafe.Pointer(pszProtectedCredentials)),
  1535  		uintptr(cchCredentials),
  1536  		uintptr(unsafe.Pointer(pszCredentials)),
  1537  		uintptr(unsafe.Pointer(pcchMaxChars)),
  1538  		0)
  1539  	return ret1 != 0
  1540  }
  1541  
  1542  // TODO: Unknown type(s): PCREDENTIAL_TARGET_INFORMATIONW
  1543  // func CredWriteDomainCredentials(targetInfo PCREDENTIAL_TARGET_INFORMATIONW, credential *CREDENTIAL, flags DWORD) bool
  1544  
  1545  func CredWrite(credential *CREDENTIAL, flags DWORD) bool {
  1546  	ret1 := syscall3(credWrite, 2,
  1547  		uintptr(unsafe.Pointer(credential)),
  1548  		uintptr(flags),
  1549  		0)
  1550  	return ret1 != 0
  1551  }
  1552  
  1553  func CryptAcquireContext(phProv *HCRYPTPROV, szContainer string, szProvider string, dwProvType DWORD, dwFlags DWORD) bool {
  1554  	szContainerStr := unicode16FromString(szContainer)
  1555  	szProviderStr := unicode16FromString(szProvider)
  1556  	ret1 := syscall6(cryptAcquireContext, 5,
  1557  		uintptr(unsafe.Pointer(phProv)),
  1558  		uintptr(unsafe.Pointer(&szContainerStr[0])),
  1559  		uintptr(unsafe.Pointer(&szProviderStr[0])),
  1560  		uintptr(dwProvType),
  1561  		uintptr(dwFlags),
  1562  		0)
  1563  	return ret1 != 0
  1564  }
  1565  
  1566  func CryptContextAddRef(hProv HCRYPTPROV, pdwReserved *uint32, dwFlags DWORD) bool {
  1567  	ret1 := syscall3(cryptContextAddRef, 3,
  1568  		uintptr(hProv),
  1569  		uintptr(unsafe.Pointer(pdwReserved)),
  1570  		uintptr(dwFlags))
  1571  	return ret1 != 0
  1572  }
  1573  
  1574  func CryptCreateHash(hProv HCRYPTPROV, algid ALG_ID, hKey HCRYPTKEY, dwFlags DWORD, phHash *HCRYPTHASH) bool {
  1575  	ret1 := syscall6(cryptCreateHash, 5,
  1576  		uintptr(hProv),
  1577  		uintptr(algid),
  1578  		uintptr(hKey),
  1579  		uintptr(dwFlags),
  1580  		uintptr(unsafe.Pointer(phHash)),
  1581  		0)
  1582  	return ret1 != 0
  1583  }
  1584  
  1585  func CryptDecrypt(hKey HCRYPTKEY, hHash HCRYPTHASH, final bool, dwFlags DWORD, pbData *byte, pdwDataLen *uint32) bool {
  1586  	ret1 := syscall6(cryptDecrypt, 6,
  1587  		uintptr(hKey),
  1588  		uintptr(hHash),
  1589  		getUintptrFromBool(final),
  1590  		uintptr(dwFlags),
  1591  		uintptr(unsafe.Pointer(pbData)),
  1592  		uintptr(unsafe.Pointer(pdwDataLen)))
  1593  	return ret1 != 0
  1594  }
  1595  
  1596  func CryptDeriveKey(hProv HCRYPTPROV, algid ALG_ID, hBaseData HCRYPTHASH, dwFlags DWORD, phKey *HCRYPTKEY) bool {
  1597  	ret1 := syscall6(cryptDeriveKey, 5,
  1598  		uintptr(hProv),
  1599  		uintptr(algid),
  1600  		uintptr(hBaseData),
  1601  		uintptr(dwFlags),
  1602  		uintptr(unsafe.Pointer(phKey)),
  1603  		0)
  1604  	return ret1 != 0
  1605  }
  1606  
  1607  func CryptDestroyHash(hHash HCRYPTHASH) bool {
  1608  	ret1 := syscall3(cryptDestroyHash, 1,
  1609  		uintptr(hHash),
  1610  		0,
  1611  		0)
  1612  	return ret1 != 0
  1613  }
  1614  
  1615  func CryptDestroyKey(hKey HCRYPTKEY) bool {
  1616  	ret1 := syscall3(cryptDestroyKey, 1,
  1617  		uintptr(hKey),
  1618  		0,
  1619  		0)
  1620  	return ret1 != 0
  1621  }
  1622  
  1623  func CryptDuplicateHash(hHash HCRYPTHASH, pdwReserved *uint32, dwFlags DWORD, phHash *HCRYPTHASH) bool {
  1624  	ret1 := syscall6(cryptDuplicateHash, 4,
  1625  		uintptr(hHash),
  1626  		uintptr(unsafe.Pointer(pdwReserved)),
  1627  		uintptr(dwFlags),
  1628  		uintptr(unsafe.Pointer(phHash)),
  1629  		0,
  1630  		0)
  1631  	return ret1 != 0
  1632  }
  1633  
  1634  func CryptDuplicateKey(hKey HCRYPTKEY, pdwReserved *uint32, dwFlags DWORD, phKey *HCRYPTKEY) bool {
  1635  	ret1 := syscall6(cryptDuplicateKey, 4,
  1636  		uintptr(hKey),
  1637  		uintptr(unsafe.Pointer(pdwReserved)),
  1638  		uintptr(dwFlags),
  1639  		uintptr(unsafe.Pointer(phKey)),
  1640  		0,
  1641  		0)
  1642  	return ret1 != 0
  1643  }
  1644  
  1645  func CryptEncrypt(hKey HCRYPTKEY, hHash HCRYPTHASH, final bool, dwFlags DWORD, pbData *byte, pdwDataLen *uint32, dwBufLen DWORD) bool {
  1646  	ret1 := syscall9(cryptEncrypt, 7,
  1647  		uintptr(hKey),
  1648  		uintptr(hHash),
  1649  		getUintptrFromBool(final),
  1650  		uintptr(dwFlags),
  1651  		uintptr(unsafe.Pointer(pbData)),
  1652  		uintptr(unsafe.Pointer(pdwDataLen)),
  1653  		uintptr(dwBufLen),
  1654  		0,
  1655  		0)
  1656  	return ret1 != 0
  1657  }
  1658  
  1659  func CryptEnumProviderTypes(dwIndex DWORD, pdwReserved *uint32, dwFlags DWORD, pdwProvType *uint32, szTypeName LPWSTR, pcbTypeName *uint32) bool {
  1660  	ret1 := syscall6(cryptEnumProviderTypes, 6,
  1661  		uintptr(dwIndex),
  1662  		uintptr(unsafe.Pointer(pdwReserved)),
  1663  		uintptr(dwFlags),
  1664  		uintptr(unsafe.Pointer(pdwProvType)),
  1665  		uintptr(unsafe.Pointer(szTypeName)),
  1666  		uintptr(unsafe.Pointer(pcbTypeName)))
  1667  	return ret1 != 0
  1668  }
  1669  
  1670  func CryptEnumProviders(dwIndex DWORD, pdwReserved *uint32, dwFlags DWORD, pdwProvType *uint32, szProvName LPWSTR, pcbProvName *uint32) bool {
  1671  	ret1 := syscall6(cryptEnumProviders, 6,
  1672  		uintptr(dwIndex),
  1673  		uintptr(unsafe.Pointer(pdwReserved)),
  1674  		uintptr(dwFlags),
  1675  		uintptr(unsafe.Pointer(pdwProvType)),
  1676  		uintptr(unsafe.Pointer(szProvName)),
  1677  		uintptr(unsafe.Pointer(pcbProvName)))
  1678  	return ret1 != 0
  1679  }
  1680  
  1681  func CryptExportKey(hKey HCRYPTKEY, hExpKey HCRYPTKEY, dwBlobType DWORD, dwFlags DWORD, pbData *byte, pdwDataLen *uint32) bool {
  1682  	ret1 := syscall6(cryptExportKey, 6,
  1683  		uintptr(hKey),
  1684  		uintptr(hExpKey),
  1685  		uintptr(dwBlobType),
  1686  		uintptr(dwFlags),
  1687  		uintptr(unsafe.Pointer(pbData)),
  1688  		uintptr(unsafe.Pointer(pdwDataLen)))
  1689  	return ret1 != 0
  1690  }
  1691  
  1692  func CryptGenKey(hProv HCRYPTPROV, algid ALG_ID, dwFlags DWORD, phKey *HCRYPTKEY) bool {
  1693  	ret1 := syscall6(cryptGenKey, 4,
  1694  		uintptr(hProv),
  1695  		uintptr(algid),
  1696  		uintptr(dwFlags),
  1697  		uintptr(unsafe.Pointer(phKey)),
  1698  		0,
  1699  		0)
  1700  	return ret1 != 0
  1701  }
  1702  
  1703  func CryptGenRandom(hProv HCRYPTPROV, dwLen DWORD, pbBuffer *byte) bool {
  1704  	ret1 := syscall3(cryptGenRandom, 3,
  1705  		uintptr(hProv),
  1706  		uintptr(dwLen),
  1707  		uintptr(unsafe.Pointer(pbBuffer)))
  1708  	return ret1 != 0
  1709  }
  1710  
  1711  func CryptGetDefaultProvider(dwProvType DWORD, pdwReserved *uint32, dwFlags DWORD, pszProvName LPWSTR, pcbProvName *uint32) bool {
  1712  	ret1 := syscall6(cryptGetDefaultProvider, 5,
  1713  		uintptr(dwProvType),
  1714  		uintptr(unsafe.Pointer(pdwReserved)),
  1715  		uintptr(dwFlags),
  1716  		uintptr(unsafe.Pointer(pszProvName)),
  1717  		uintptr(unsafe.Pointer(pcbProvName)),
  1718  		0)
  1719  	return ret1 != 0
  1720  }
  1721  
  1722  func CryptGetHashParam(hHash HCRYPTHASH, dwParam DWORD, pbData *byte, pdwDataLen *uint32, dwFlags DWORD) bool {
  1723  	ret1 := syscall6(cryptGetHashParam, 5,
  1724  		uintptr(hHash),
  1725  		uintptr(dwParam),
  1726  		uintptr(unsafe.Pointer(pbData)),
  1727  		uintptr(unsafe.Pointer(pdwDataLen)),
  1728  		uintptr(dwFlags),
  1729  		0)
  1730  	return ret1 != 0
  1731  }
  1732  
  1733  func CryptGetKeyParam(hKey HCRYPTKEY, dwParam DWORD, pbData *byte, pdwDataLen *uint32, dwFlags DWORD) bool {
  1734  	ret1 := syscall6(cryptGetKeyParam, 5,
  1735  		uintptr(hKey),
  1736  		uintptr(dwParam),
  1737  		uintptr(unsafe.Pointer(pbData)),
  1738  		uintptr(unsafe.Pointer(pdwDataLen)),
  1739  		uintptr(dwFlags),
  1740  		0)
  1741  	return ret1 != 0
  1742  }
  1743  
  1744  func CryptGetProvParam(hProv HCRYPTPROV, dwParam DWORD, pbData *byte, pdwDataLen *uint32, dwFlags DWORD) bool {
  1745  	ret1 := syscall6(cryptGetProvParam, 5,
  1746  		uintptr(hProv),
  1747  		uintptr(dwParam),
  1748  		uintptr(unsafe.Pointer(pbData)),
  1749  		uintptr(unsafe.Pointer(pdwDataLen)),
  1750  		uintptr(dwFlags),
  1751  		0)
  1752  	return ret1 != 0
  1753  }
  1754  
  1755  func CryptGetUserKey(hProv HCRYPTPROV, dwKeySpec DWORD, phUserKey *HCRYPTKEY) bool {
  1756  	ret1 := syscall3(cryptGetUserKey, 3,
  1757  		uintptr(hProv),
  1758  		uintptr(dwKeySpec),
  1759  		uintptr(unsafe.Pointer(phUserKey)))
  1760  	return ret1 != 0
  1761  }
  1762  
  1763  func CryptHashData(hHash HCRYPTHASH, pbData /*const*/ *byte, dwDataLen DWORD, dwFlags DWORD) bool {
  1764  	ret1 := syscall6(cryptHashData, 4,
  1765  		uintptr(hHash),
  1766  		uintptr(unsafe.Pointer(pbData)),
  1767  		uintptr(dwDataLen),
  1768  		uintptr(dwFlags),
  1769  		0,
  1770  		0)
  1771  	return ret1 != 0
  1772  }
  1773  
  1774  func CryptHashSessionKey(hHash HCRYPTHASH, hKey HCRYPTKEY, dwFlags DWORD) bool {
  1775  	ret1 := syscall3(cryptHashSessionKey, 3,
  1776  		uintptr(hHash),
  1777  		uintptr(hKey),
  1778  		uintptr(dwFlags))
  1779  	return ret1 != 0
  1780  }
  1781  
  1782  func CryptImportKey(hProv HCRYPTPROV, pbData /*const*/ *byte, dwDataLen DWORD, hPubKey HCRYPTKEY, dwFlags DWORD, phKey *HCRYPTKEY) bool {
  1783  	ret1 := syscall6(cryptImportKey, 6,
  1784  		uintptr(hProv),
  1785  		uintptr(unsafe.Pointer(pbData)),
  1786  		uintptr(dwDataLen),
  1787  		uintptr(hPubKey),
  1788  		uintptr(dwFlags),
  1789  		uintptr(unsafe.Pointer(phKey)))
  1790  	return ret1 != 0
  1791  }
  1792  
  1793  func CryptReleaseContext(hProv HCRYPTPROV, dwFlags DWORD) bool {
  1794  	ret1 := syscall3(cryptReleaseContext, 2,
  1795  		uintptr(hProv),
  1796  		uintptr(dwFlags),
  1797  		0)
  1798  	return ret1 != 0
  1799  }
  1800  
  1801  func CryptSetHashParam(hHash HCRYPTHASH, dwParam DWORD, pbData /*const*/ *byte, dwFlags DWORD) bool {
  1802  	ret1 := syscall6(cryptSetHashParam, 4,
  1803  		uintptr(hHash),
  1804  		uintptr(dwParam),
  1805  		uintptr(unsafe.Pointer(pbData)),
  1806  		uintptr(dwFlags),
  1807  		0,
  1808  		0)
  1809  	return ret1 != 0
  1810  }
  1811  
  1812  func CryptSetKeyParam(hKey HCRYPTKEY, dwParam DWORD, pbData /*const*/ *byte, dwFlags DWORD) bool {
  1813  	ret1 := syscall6(cryptSetKeyParam, 4,
  1814  		uintptr(hKey),
  1815  		uintptr(dwParam),
  1816  		uintptr(unsafe.Pointer(pbData)),
  1817  		uintptr(dwFlags),
  1818  		0,
  1819  		0)
  1820  	return ret1 != 0
  1821  }
  1822  
  1823  func CryptSetProvParam(hProv HCRYPTPROV, dwParam DWORD, pbData /*const*/ *byte, dwFlags DWORD) bool {
  1824  	ret1 := syscall6(cryptSetProvParam, 4,
  1825  		uintptr(hProv),
  1826  		uintptr(dwParam),
  1827  		uintptr(unsafe.Pointer(pbData)),
  1828  		uintptr(dwFlags),
  1829  		0,
  1830  		0)
  1831  	return ret1 != 0
  1832  }
  1833  
  1834  func CryptSetProviderEx(pszProvName string, dwProvType DWORD, pdwReserved *uint32, dwFlags DWORD) bool {
  1835  	pszProvNameStr := unicode16FromString(pszProvName)
  1836  	ret1 := syscall6(cryptSetProviderEx, 4,
  1837  		uintptr(unsafe.Pointer(&pszProvNameStr[0])),
  1838  		uintptr(dwProvType),
  1839  		uintptr(unsafe.Pointer(pdwReserved)),
  1840  		uintptr(dwFlags),
  1841  		0,
  1842  		0)
  1843  	return ret1 != 0
  1844  }
  1845  
  1846  func CryptSetProvider(pszProvName string, dwProvType DWORD) bool {
  1847  	pszProvNameStr := unicode16FromString(pszProvName)
  1848  	ret1 := syscall3(cryptSetProvider, 2,
  1849  		uintptr(unsafe.Pointer(&pszProvNameStr[0])),
  1850  		uintptr(dwProvType),
  1851  		0)
  1852  	return ret1 != 0
  1853  }
  1854  
  1855  func CryptSignHash(hHash HCRYPTHASH, dwKeySpec DWORD, szDescription string, dwFlags DWORD, pbSignature *byte, pdwSigLen *uint32) bool {
  1856  	szDescriptionStr := unicode16FromString(szDescription)
  1857  	ret1 := syscall6(cryptSignHash, 6,
  1858  		uintptr(hHash),
  1859  		uintptr(dwKeySpec),
  1860  		uintptr(unsafe.Pointer(&szDescriptionStr[0])),
  1861  		uintptr(dwFlags),
  1862  		uintptr(unsafe.Pointer(pbSignature)),
  1863  		uintptr(unsafe.Pointer(pdwSigLen)))
  1864  	return ret1 != 0
  1865  }
  1866  
  1867  func CryptVerifySignature(hHash HCRYPTHASH, pbSignature /*const*/ *byte, dwSigLen DWORD, hPubKey HCRYPTKEY, szDescription string, dwFlags DWORD) bool {
  1868  	szDescriptionStr := unicode16FromString(szDescription)
  1869  	ret1 := syscall6(cryptVerifySignature, 6,
  1870  		uintptr(hHash),
  1871  		uintptr(unsafe.Pointer(pbSignature)),
  1872  		uintptr(dwSigLen),
  1873  		uintptr(hPubKey),
  1874  		uintptr(unsafe.Pointer(&szDescriptionStr[0])),
  1875  		uintptr(dwFlags))
  1876  	return ret1 != 0
  1877  }
  1878  
  1879  func DecryptFile(lpFileName string, dwReserved DWORD) bool {
  1880  	lpFileNameStr := unicode16FromString(lpFileName)
  1881  	ret1 := syscall3(decryptFile, 2,
  1882  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  1883  		uintptr(dwReserved),
  1884  		0)
  1885  	return ret1 != 0
  1886  }
  1887  
  1888  func DeleteAce(pAcl *ACL, dwAceIndex DWORD) bool {
  1889  	ret1 := syscall3(deleteAce, 2,
  1890  		uintptr(unsafe.Pointer(pAcl)),
  1891  		uintptr(dwAceIndex),
  1892  		0)
  1893  	return ret1 != 0
  1894  }
  1895  
  1896  func DeleteService(hService SC_HANDLE) bool {
  1897  	ret1 := syscall3(deleteService, 1,
  1898  		uintptr(hService),
  1899  		0,
  1900  		0)
  1901  	return ret1 != 0
  1902  }
  1903  
  1904  func DeregisterEventSource(hEventLog HANDLE) bool {
  1905  	ret1 := syscall3(deregisterEventSource, 1,
  1906  		uintptr(hEventLog),
  1907  		0,
  1908  		0)
  1909  	return ret1 != 0
  1910  }
  1911  
  1912  func DestroyPrivateObjectSecurity(objectDescriptor *PSECURITY_DESCRIPTOR) bool {
  1913  	ret1 := syscall3(destroyPrivateObjectSecurity, 1,
  1914  		uintptr(unsafe.Pointer(objectDescriptor)),
  1915  		0,
  1916  		0)
  1917  	return ret1 != 0
  1918  }
  1919  
  1920  func DuplicateEncryptionInfoFile(srcFileName string, dstFileName string, dwCreationDistribution DWORD, dwAttributes DWORD, lpSecurityAttributes /*const*/ *SECURITY_ATTRIBUTES) DWORD {
  1921  	srcFileNameStr := unicode16FromString(srcFileName)
  1922  	dstFileNameStr := unicode16FromString(dstFileName)
  1923  	ret1 := syscall6(duplicateEncryptionInfoFile, 5,
  1924  		uintptr(unsafe.Pointer(&srcFileNameStr[0])),
  1925  		uintptr(unsafe.Pointer(&dstFileNameStr[0])),
  1926  		uintptr(dwCreationDistribution),
  1927  		uintptr(dwAttributes),
  1928  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  1929  		0)
  1930  	return DWORD(ret1)
  1931  }
  1932  
  1933  func DuplicateToken(existingTokenHandle HANDLE, impersonationLevel SECURITY_IMPERSONATION_LEVEL, duplicateTokenHandle *HANDLE) bool {
  1934  	ret1 := syscall3(duplicateToken, 3,
  1935  		uintptr(existingTokenHandle),
  1936  		uintptr(impersonationLevel),
  1937  		uintptr(unsafe.Pointer(duplicateTokenHandle)))
  1938  	return ret1 != 0
  1939  }
  1940  
  1941  type TOKEN_TYPE uint32
  1942  
  1943  const (
  1944  	TokenPrimary = iota + 1
  1945  	TokenImpersonation
  1946  )
  1947  
  1948  // TODO: Unknown type(s): TOKEN_TYPE
  1949  func DuplicateTokenEx(hExistingToken HANDLE,
  1950  	dwDesiredAccess DWORD,
  1951  	lpTokenAttributes *SECURITY_ATTRIBUTES,
  1952  	impersonationLevel SECURITY_IMPERSONATION_LEVEL,
  1953  	tokenType TOKEN_TYPE,
  1954  	phNewToken *HANDLE) DWORD {
  1955  	ret1 := syscall6(duplicateToken, 6,
  1956  		uintptr(hExistingToken),
  1957  		uintptr(dwDesiredAccess),
  1958  		uintptr(unsafe.Pointer(lpTokenAttributes)),
  1959  		uintptr(impersonationLevel),
  1960  		uintptr(tokenType),
  1961  		uintptr(unsafe.Pointer(phNewToken)))
  1962  	return DWORD(ret1)
  1963  }
  1964  
  1965  func EncryptFile(lpFileName string) bool {
  1966  	lpFileNameStr := unicode16FromString(lpFileName)
  1967  	ret1 := syscall3(encryptFile, 1,
  1968  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  1969  		0,
  1970  		0)
  1971  	return ret1 != 0
  1972  }
  1973  
  1974  func EncryptionDisable(dirPath string, disable bool) bool {
  1975  	dirPathStr := unicode16FromString(dirPath)
  1976  	ret1 := syscall3(encryptionDisable, 2,
  1977  		uintptr(unsafe.Pointer(&dirPathStr[0])),
  1978  		getUintptrFromBool(disable),
  1979  		0)
  1980  	return ret1 != 0
  1981  }
  1982  
  1983  // TODO: Unknown type(s): LPENUM_SERVICE_STATUSW
  1984  // func EnumDependentServices(hService SC_HANDLE, dwServiceState DWORD, lpServices LPENUM_SERVICE_STATUSW, cbBufSize DWORD, pcbBytesNeeded *uint32, lpServicesReturned *uint32) bool
  1985  
  1986  // TODO: Unknown type(s): SC_ENUM_TYPE
  1987  // func EnumServicesStatusEx(hSCManager SC_HANDLE, infoLevel SC_ENUM_TYPE, dwServiceType DWORD, dwServiceState DWORD, lpServices *byte, cbBufSize DWORD, pcbBytesNeeded *uint32, lpServicesReturned *uint32, lpResumeHandle *uint32, pszGroupName string) bool
  1988  
  1989  // TODO: Unknown type(s): LPENUM_SERVICE_STATUSW
  1990  // func EnumServicesStatus(hSCManager SC_HANDLE, dwServiceType DWORD, dwServiceState DWORD, lpServices LPENUM_SERVICE_STATUSW, cbBufSize DWORD, pcbBytesNeeded *uint32, lpServicesReturned *uint32, lpResumeHandle *uint32) bool
  1991  
  1992  func EqualDomainSid(pSid1 PSID, pSid2 PSID, pfEqual *BOOL) bool {
  1993  	ret1 := syscall3(equalDomainSid, 3,
  1994  		uintptr(pSid1),
  1995  		uintptr(pSid2),
  1996  		uintptr(unsafe.Pointer(pfEqual)))
  1997  	return ret1 != 0
  1998  }
  1999  
  2000  func EqualPrefixSid(pSid1 PSID, pSid2 PSID) bool {
  2001  	ret1 := syscall3(equalPrefixSid, 2,
  2002  		uintptr(pSid1),
  2003  		uintptr(pSid2),
  2004  		0)
  2005  	return ret1 != 0
  2006  }
  2007  
  2008  func EqualSid(pSid1 PSID, pSid2 PSID) bool {
  2009  	ret1 := syscall3(equalSid, 2,
  2010  		uintptr(pSid1),
  2011  		uintptr(pSid2),
  2012  		0)
  2013  	return ret1 != 0
  2014  }
  2015  
  2016  func FileEncryptionStatus(lpFileName string, lpStatus *uint32) bool {
  2017  	lpFileNameStr := unicode16FromString(lpFileName)
  2018  	ret1 := syscall3(fileEncryptionStatus, 2,
  2019  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2020  		uintptr(unsafe.Pointer(lpStatus)),
  2021  		0)
  2022  	return ret1 != 0
  2023  }
  2024  
  2025  func FindFirstFreeAce(pAcl *ACL, pAce *LPVOID) bool {
  2026  	ret1 := syscall3(findFirstFreeAce, 2,
  2027  		uintptr(unsafe.Pointer(pAcl)),
  2028  		uintptr(unsafe.Pointer(pAce)),
  2029  		0)
  2030  	return ret1 != 0
  2031  }
  2032  
  2033  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST
  2034  // func FreeEncryptionCertificateHashList(pHashes PENCRYPTION_CERTIFICATE_HASH_LIST)
  2035  
  2036  // TODO: Unknown type(s): PFN_OBJECT_MGR_FUNCTS, PINHERITED_FROMW
  2037  // func FreeInheritedFromArray(pInheritArray PINHERITED_FROMW, aceCnt USHORT, pfnArray PFN_OBJECT_MGR_FUNCTS) DWORD
  2038  
  2039  func FreeSid(pSid PSID) uintptr {
  2040  	ret1 := syscall3(freeSid, 1,
  2041  		uintptr(pSid),
  2042  		0,
  2043  		0)
  2044  	return (uintptr)(unsafe.Pointer(ret1))
  2045  }
  2046  
  2047  func GetAce(pAcl *ACL, dwAceIndex DWORD, pAce *LPVOID) bool {
  2048  	ret1 := syscall3(getAce, 3,
  2049  		uintptr(unsafe.Pointer(pAcl)),
  2050  		uintptr(dwAceIndex),
  2051  		uintptr(unsafe.Pointer(pAce)))
  2052  	return ret1 != 0
  2053  }
  2054  
  2055  // TODO: Unknown type(s): ACL_INFORMATION_CLASS
  2056  // func GetAclInformation(pAcl *ACL, pAclInformation LPVOID, nAclInformationLength DWORD, dwAclInformationClass ACL_INFORMATION_CLASS) bool
  2057  
  2058  // TODO: Unknown type(s): PACCESS_MASK
  2059  // func GetAuditedPermissionsFromAcl(pacl *ACL, pTrustee *TRUSTEE, pSuccessfulAuditedRights PACCESS_MASK, pFailedAuditRights PACCESS_MASK) DWORD
  2060  
  2061  // TODO: Unknown type(s): LPHW_PROFILE_INFOW
  2062  // func GetCurrentHwProfile(lpHwProfileInfo LPHW_PROFILE_INFOW) bool
  2063  
  2064  // TODO: Unknown type(s): PACCESS_MASK
  2065  // func GetEffectiveRightsFromAcl(pacl *ACL, pTrustee *TRUSTEE, pAccessRights PACCESS_MASK) DWORD
  2066  
  2067  func GetEventLogInformation(hEventLog HANDLE, dwInfoLevel DWORD, lpBuffer LPVOID, cbBufSize DWORD, pcbBytesNeeded *uint32) bool {
  2068  	ret1 := syscall6(getEventLogInformation, 5,
  2069  		uintptr(hEventLog),
  2070  		uintptr(dwInfoLevel),
  2071  		uintptr(unsafe.Pointer(lpBuffer)),
  2072  		uintptr(cbBufSize),
  2073  		uintptr(unsafe.Pointer(pcbBytesNeeded)),
  2074  		0)
  2075  	return ret1 != 0
  2076  }
  2077  
  2078  // TODO: Unknown type(s): PEXPLICIT_ACCESS_W *
  2079  // func GetExplicitEntriesFromAcl(pacl *ACL, pcCountOfExplicitEntries *uint32, pListOfExplicitEntries PEXPLICIT_ACCESS_W *) DWORD
  2080  
  2081  func GetFileSecurity(lpFileName string, requestedInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR, nLength DWORD, lpnLengthNeeded *uint32) bool {
  2082  	lpFileNameStr := unicode16FromString(lpFileName)
  2083  	ret1 := syscall6(getFileSecurity, 5,
  2084  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2085  		uintptr(requestedInformation),
  2086  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2087  		uintptr(nLength),
  2088  		uintptr(unsafe.Pointer(lpnLengthNeeded)),
  2089  		0)
  2090  	return ret1 != 0
  2091  }
  2092  
  2093  // TODO: Unknown type(s): PFN_OBJECT_MGR_FUNCTS, PINHERITED_FROMW
  2094  // func GetInheritanceSource(pObjectName LPWSTR, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, container bool, pObjectClassGuids uintptr, guidCount DWORD, pAcl *ACL, pfnArray PFN_OBJECT_MGR_FUNCTS, pGenericMapping *GENERIC_MAPPING, pInheritArray PINHERITED_FROMW) DWORD
  2095  
  2096  func GetKernelObjectSecurity(handle HANDLE, requestedInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR, nLength DWORD, lpnLengthNeeded *uint32) bool {
  2097  	ret1 := syscall6(getKernelObjectSecurity, 5,
  2098  		uintptr(handle),
  2099  		uintptr(requestedInformation),
  2100  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2101  		uintptr(nLength),
  2102  		uintptr(unsafe.Pointer(lpnLengthNeeded)),
  2103  		0)
  2104  	return ret1 != 0
  2105  }
  2106  
  2107  func GetLengthSid(pSid PSID) DWORD {
  2108  	ret1 := syscall3(getLengthSid, 1,
  2109  		uintptr(pSid),
  2110  		0,
  2111  		0)
  2112  	return DWORD(ret1)
  2113  }
  2114  
  2115  func GetLocalManagedApplicationData(productCode *WCHAR, displayName *LPWSTR, supportUrl *LPWSTR) {
  2116  	syscall3(getLocalManagedApplicationData, 3,
  2117  		uintptr(unsafe.Pointer(productCode)),
  2118  		uintptr(unsafe.Pointer(displayName)),
  2119  		uintptr(unsafe.Pointer(supportUrl)))
  2120  }
  2121  
  2122  // TODO: Unknown type(s): PLOCALMANAGEDAPPLICATION *
  2123  // func GetLocalManagedApplications(bUserApps bool, pdwApps *uint32, prgLocalApps PLOCALMANAGEDAPPLICATION *) DWORD
  2124  
  2125  // TODO: Unknown type(s): APPCATEGORYINFOLIST *
  2126  // func GetManagedApplicationCategories(dwReserved DWORD, pAppCategory APPCATEGORYINFOLIST *) DWORD
  2127  
  2128  // TODO: Unknown type(s): PMANAGEDAPPLICATION *
  2129  // func GetManagedApplications(pCategory *GUID, dwQueryFlags DWORD, dwInfoLevel DWORD, pdwApps *uint32, prgManagedApps PMANAGEDAPPLICATION *) DWORD
  2130  
  2131  func GetMultipleTrusteeOperation(pTrustee *TRUSTEE) MULTIPLE_TRUSTEE_OPERATION {
  2132  	ret1 := syscall3(getMultipleTrusteeOperation, 1,
  2133  		uintptr(unsafe.Pointer(pTrustee)),
  2134  		0,
  2135  		0)
  2136  	return MULTIPLE_TRUSTEE_OPERATION(ret1)
  2137  }
  2138  
  2139  func GetMultipleTrustee(pTrustee *TRUSTEE) *TRUSTEE {
  2140  	ret1 := syscall3(getMultipleTrustee, 1,
  2141  		uintptr(unsafe.Pointer(pTrustee)),
  2142  		0,
  2143  		0)
  2144  	return (*TRUSTEE)(unsafe.Pointer(ret1))
  2145  }
  2146  
  2147  // TODO: Unknown type(s): PACL *
  2148  // func GetNamedSecurityInfo(pObjectName string, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, ppsidOwner *PSID, ppsidGroup *PSID, ppDacl PACL *, ppSacl PACL *, ppSecurityDescriptor *PSECURITY_DESCRIPTOR) DWORD
  2149  
  2150  func GetNumberOfEventLogRecords(hEventLog HANDLE, numberOfRecords *DWORD) bool {
  2151  	ret1 := syscall3(getNumberOfEventLogRecords, 2,
  2152  		uintptr(hEventLog),
  2153  		uintptr(unsafe.Pointer(numberOfRecords)),
  2154  		0)
  2155  	return ret1 != 0
  2156  }
  2157  
  2158  func GetOldestEventLogRecord(hEventLog HANDLE, oldestRecord *DWORD) bool {
  2159  	ret1 := syscall3(getOldestEventLogRecord, 2,
  2160  		uintptr(hEventLog),
  2161  		uintptr(unsafe.Pointer(oldestRecord)),
  2162  		0)
  2163  	return ret1 != 0
  2164  }
  2165  
  2166  func GetPrivateObjectSecurity(objectDescriptor PSECURITY_DESCRIPTOR, securityInformation SECURITY_INFORMATION, resultantDescriptor PSECURITY_DESCRIPTOR, descriptorLength DWORD, returnLength *DWORD) bool {
  2167  	ret1 := syscall6(getPrivateObjectSecurity, 5,
  2168  		uintptr(unsafe.Pointer(objectDescriptor)),
  2169  		uintptr(securityInformation),
  2170  		uintptr(unsafe.Pointer(resultantDescriptor)),
  2171  		uintptr(descriptorLength),
  2172  		uintptr(unsafe.Pointer(returnLength)),
  2173  		0)
  2174  	return ret1 != 0
  2175  }
  2176  
  2177  func GetSecurityDescriptorControl(pSecurityDescriptor PSECURITY_DESCRIPTOR, pControl *SECURITY_DESCRIPTOR_CONTROL, lpdwRevision *uint32) bool {
  2178  	ret1 := syscall3(getSecurityDescriptorControl, 3,
  2179  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2180  		uintptr(unsafe.Pointer(pControl)),
  2181  		uintptr(unsafe.Pointer(lpdwRevision)))
  2182  	return ret1 != 0
  2183  }
  2184  
  2185  // TODO: Unknown type(s): PACL *
  2186  // func GetSecurityDescriptorDacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, lpbDaclPresent *BOOL, pDacl PACL *, lpbDaclDefaulted *BOOL) bool
  2187  
  2188  func GetSecurityDescriptorGroup(pSecurityDescriptor PSECURITY_DESCRIPTOR, pGroup *PSID, lpbGroupDefaulted *BOOL) bool {
  2189  	ret1 := syscall3(getSecurityDescriptorGroup, 3,
  2190  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2191  		uintptr(unsafe.Pointer(pGroup)),
  2192  		uintptr(unsafe.Pointer(lpbGroupDefaulted)))
  2193  	return ret1 != 0
  2194  }
  2195  
  2196  func GetSecurityDescriptorLength(pSecurityDescriptor PSECURITY_DESCRIPTOR) DWORD {
  2197  	ret1 := syscall3(getSecurityDescriptorLength, 1,
  2198  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2199  		0,
  2200  		0)
  2201  	return DWORD(ret1)
  2202  }
  2203  
  2204  func GetSecurityDescriptorOwner(pSecurityDescriptor PSECURITY_DESCRIPTOR, pOwner *PSID, lpbOwnerDefaulted *BOOL) bool {
  2205  	ret1 := syscall3(getSecurityDescriptorOwner, 3,
  2206  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2207  		uintptr(unsafe.Pointer(pOwner)),
  2208  		uintptr(unsafe.Pointer(lpbOwnerDefaulted)))
  2209  	return ret1 != 0
  2210  }
  2211  
  2212  func GetSecurityDescriptorRMControl(securityDescriptor PSECURITY_DESCRIPTOR, rMControl PUCHAR) DWORD {
  2213  	ret1 := syscall3(getSecurityDescriptorRMControl, 2,
  2214  		uintptr(unsafe.Pointer(securityDescriptor)),
  2215  		uintptr(unsafe.Pointer(rMControl)),
  2216  		0)
  2217  	return DWORD(ret1)
  2218  }
  2219  
  2220  // TODO: Unknown type(s): PACL *
  2221  // func GetSecurityDescriptorSacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, lpbSaclPresent *BOOL, pSacl PACL *, lpbSaclDefaulted *BOOL) bool
  2222  
  2223  // TODO: Unknown type(s): PACL *
  2224  // func GetSecurityInfo(handle HANDLE, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, ppsidOwner *PSID, ppsidGroup *PSID, ppDacl PACL *, ppSacl PACL *, ppSecurityDescriptor *PSECURITY_DESCRIPTOR) DWORD
  2225  
  2226  func GetServiceDisplayName(hSCManager SC_HANDLE, lpServiceName string, lpDisplayName LPWSTR, lpcchBuffer *uint32) bool {
  2227  	lpServiceNameStr := unicode16FromString(lpServiceName)
  2228  	ret1 := syscall6(getServiceDisplayName, 4,
  2229  		uintptr(hSCManager),
  2230  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  2231  		uintptr(unsafe.Pointer(lpDisplayName)),
  2232  		uintptr(unsafe.Pointer(lpcchBuffer)),
  2233  		0,
  2234  		0)
  2235  	return ret1 != 0
  2236  }
  2237  
  2238  func GetServiceKeyName(hSCManager SC_HANDLE, lpDisplayName string, lpServiceName LPWSTR, lpcchBuffer *uint32) bool {
  2239  	lpDisplayNameStr := unicode16FromString(lpDisplayName)
  2240  	ret1 := syscall6(getServiceKeyName, 4,
  2241  		uintptr(hSCManager),
  2242  		uintptr(unsafe.Pointer(&lpDisplayNameStr[0])),
  2243  		uintptr(unsafe.Pointer(lpServiceName)),
  2244  		uintptr(unsafe.Pointer(lpcchBuffer)),
  2245  		0,
  2246  		0)
  2247  	return ret1 != 0
  2248  }
  2249  
  2250  func GetSidIdentifierAuthority(pSid PSID) *SID_IDENTIFIER_AUTHORITY {
  2251  	ret1 := syscall3(getSidIdentifierAuthority, 1,
  2252  		uintptr(pSid),
  2253  		0,
  2254  		0)
  2255  	return (*SID_IDENTIFIER_AUTHORITY)(unsafe.Pointer(ret1))
  2256  }
  2257  
  2258  func GetSidLengthRequired(nSubAuthorityCount UCHAR) DWORD {
  2259  	ret1 := syscall3(getSidLengthRequired, 1,
  2260  		uintptr(nSubAuthorityCount),
  2261  		0,
  2262  		0)
  2263  	return DWORD(ret1)
  2264  }
  2265  
  2266  func GetSidSubAuthority(pSid PSID, nSubAuthority DWORD) *DWORD {
  2267  	ret1 := syscall3(getSidSubAuthority, 2,
  2268  		uintptr(pSid),
  2269  		uintptr(nSubAuthority),
  2270  		0)
  2271  	return (*DWORD)(unsafe.Pointer(ret1))
  2272  }
  2273  
  2274  func GetSidSubAuthorityCount(pSid PSID) PUCHAR {
  2275  	ret1 := syscall3(getSidSubAuthorityCount, 1,
  2276  		uintptr(pSid),
  2277  		0,
  2278  		0)
  2279  	return (PUCHAR)(unsafe.Pointer(ret1))
  2280  }
  2281  
  2282  // TODO: Unknown type(s): PWAITCHAIN_NODE_INFO
  2283  // func GetThreadWaitChain(wctHandle HWCT, context *uint32, flags DWORD, threadId DWORD, nodeCount *uint32, nodeInfoArray PWAITCHAIN_NODE_INFO, isCycle *BOOL) bool
  2284  
  2285  // TODO: Unknown type(s): TOKEN_INFORMATION_CLASS
  2286  // func GetTokenInformation(tokenHandle HANDLE, tokenInformationClass TOKEN_INFORMATION_CLASS, tokenInformation LPVOID, tokenInformationLength DWORD, returnLength *DWORD) bool
  2287  
  2288  func GetTrusteeForm(pTrustee *TRUSTEE) TRUSTEE_FORM {
  2289  	ret1 := syscall3(getTrusteeForm, 1,
  2290  		uintptr(unsafe.Pointer(pTrustee)),
  2291  		0,
  2292  		0)
  2293  	return TRUSTEE_FORM(ret1)
  2294  }
  2295  
  2296  func GetTrusteeName(pTrustee *TRUSTEE) LPWSTR {
  2297  	ret1 := syscall3(getTrusteeName, 1,
  2298  		uintptr(unsafe.Pointer(pTrustee)),
  2299  		0,
  2300  		0)
  2301  	return (LPWSTR)(unsafe.Pointer(ret1))
  2302  }
  2303  
  2304  func GetTrusteeType(pTrustee *TRUSTEE) TRUSTEE_TYPE {
  2305  	ret1 := syscall3(getTrusteeType, 1,
  2306  		uintptr(unsafe.Pointer(pTrustee)),
  2307  		0,
  2308  		0)
  2309  	return TRUSTEE_TYPE(ret1)
  2310  }
  2311  
  2312  func GetUserName(lpBuffer LPWSTR, pcbBuffer *uint32) bool {
  2313  	ret1 := syscall3(getUserName, 2,
  2314  		uintptr(unsafe.Pointer(lpBuffer)),
  2315  		uintptr(unsafe.Pointer(pcbBuffer)),
  2316  		0)
  2317  	return ret1 != 0
  2318  }
  2319  
  2320  func GetWindowsAccountDomainSid(pSid PSID, pDomainSid PSID, cbDomainSid *uint32) bool {
  2321  	ret1 := syscall3(getWindowsAccountDomainSid, 3,
  2322  		uintptr(pSid),
  2323  		uintptr(pDomainSid),
  2324  		uintptr(unsafe.Pointer(cbDomainSid)))
  2325  	return ret1 != 0
  2326  }
  2327  
  2328  func ImpersonateAnonymousToken(threadHandle HANDLE) bool {
  2329  	ret1 := syscall3(impersonateAnonymousToken, 1,
  2330  		uintptr(threadHandle),
  2331  		0,
  2332  		0)
  2333  	return ret1 != 0
  2334  }
  2335  
  2336  func ImpersonateLoggedOnUser(hToken HANDLE) bool {
  2337  	ret1 := syscall3(impersonateLoggedOnUser, 1,
  2338  		uintptr(hToken),
  2339  		0,
  2340  		0)
  2341  	return ret1 != 0
  2342  }
  2343  
  2344  func ImpersonateNamedPipeClient(hNamedPipe HANDLE) bool {
  2345  	ret1 := syscall3(impersonateNamedPipeClient, 1,
  2346  		uintptr(hNamedPipe),
  2347  		0,
  2348  		0)
  2349  	return ret1 != 0
  2350  }
  2351  
  2352  func ImpersonateSelf(impersonationLevel SECURITY_IMPERSONATION_LEVEL) bool {
  2353  	ret1 := syscall3(impersonateSelf, 1,
  2354  		uintptr(impersonationLevel),
  2355  		0,
  2356  		0)
  2357  	return ret1 != 0
  2358  }
  2359  
  2360  func InitializeAcl(pAcl *ACL, nAclLength DWORD, dwAclRevision DWORD) bool {
  2361  	ret1 := syscall3(initializeAcl, 3,
  2362  		uintptr(unsafe.Pointer(pAcl)),
  2363  		uintptr(nAclLength),
  2364  		uintptr(dwAclRevision))
  2365  	return ret1 != 0
  2366  }
  2367  
  2368  func InitializeSecurityDescriptor(pSecurityDescriptor PSECURITY_DESCRIPTOR, dwRevision DWORD) bool {
  2369  	ret1 := syscall3(initializeSecurityDescriptor, 2,
  2370  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2371  		uintptr(dwRevision),
  2372  		0)
  2373  	return ret1 != 0
  2374  }
  2375  
  2376  func InitializeSid(sid PSID, pIdentifierAuthority *SID_IDENTIFIER_AUTHORITY, nSubAuthorityCount BYTE) bool {
  2377  	ret1 := syscall3(initializeSid, 3,
  2378  		uintptr(sid),
  2379  		uintptr(unsafe.Pointer(pIdentifierAuthority)),
  2380  		uintptr(nSubAuthorityCount))
  2381  	return ret1 != 0
  2382  }
  2383  
  2384  func InitiateShutdown(lpMachineName LPWSTR, lpMessage LPWSTR, dwGracePeriod DWORD, dwShutdownFlags DWORD, dwReason DWORD) DWORD {
  2385  	ret1 := syscall6(initiateShutdown, 5,
  2386  		uintptr(unsafe.Pointer(lpMachineName)),
  2387  		uintptr(unsafe.Pointer(lpMessage)),
  2388  		uintptr(dwGracePeriod),
  2389  		uintptr(dwShutdownFlags),
  2390  		uintptr(dwReason),
  2391  		0)
  2392  	return DWORD(ret1)
  2393  }
  2394  
  2395  func InitiateSystemShutdownEx(lpMachineName LPWSTR, lpMessage LPWSTR, dwTimeout DWORD, bForceAppsClosed bool, bRebootAfterShutdown bool, dwReason DWORD) bool {
  2396  	ret1 := syscall6(initiateSystemShutdownEx, 6,
  2397  		uintptr(unsafe.Pointer(lpMachineName)),
  2398  		uintptr(unsafe.Pointer(lpMessage)),
  2399  		uintptr(dwTimeout),
  2400  		getUintptrFromBool(bForceAppsClosed),
  2401  		getUintptrFromBool(bRebootAfterShutdown),
  2402  		uintptr(dwReason))
  2403  	return ret1 != 0
  2404  }
  2405  
  2406  func InitiateSystemShutdown(lpMachineName LPWSTR, lpMessage LPWSTR, dwTimeout DWORD, bForceAppsClosed bool, bRebootAfterShutdown bool) bool {
  2407  	ret1 := syscall6(initiateSystemShutdown, 5,
  2408  		uintptr(unsafe.Pointer(lpMachineName)),
  2409  		uintptr(unsafe.Pointer(lpMessage)),
  2410  		uintptr(dwTimeout),
  2411  		getUintptrFromBool(bForceAppsClosed),
  2412  		getUintptrFromBool(bRebootAfterShutdown),
  2413  		0)
  2414  	return ret1 != 0
  2415  }
  2416  
  2417  // TODO: Unknown type(s): PINSTALLDATA
  2418  // func InstallApplication(pInstallInfo PINSTALLDATA) DWORD
  2419  
  2420  func IsTextUnicode(lpv /*const*/ uintptr, iSize int32, lpiResult *int32) bool {
  2421  	ret1 := syscall3(isTextUnicode, 3,
  2422  		lpv,
  2423  		uintptr(iSize),
  2424  		uintptr(unsafe.Pointer(lpiResult)))
  2425  	return ret1 != 0
  2426  }
  2427  
  2428  func IsTokenRestricted(tokenHandle HANDLE) bool {
  2429  	ret1 := syscall3(isTokenRestricted, 1,
  2430  		uintptr(tokenHandle),
  2431  		0,
  2432  		0)
  2433  	return ret1 != 0
  2434  }
  2435  
  2436  func IsTokenUntrusted(tokenHandle HANDLE) bool {
  2437  	ret1 := syscall3(isTokenUntrusted, 1,
  2438  		uintptr(tokenHandle),
  2439  		0,
  2440  		0)
  2441  	return ret1 != 0
  2442  }
  2443  
  2444  func IsValidAcl(pAcl *ACL) bool {
  2445  	ret1 := syscall3(isValidAcl, 1,
  2446  		uintptr(unsafe.Pointer(pAcl)),
  2447  		0,
  2448  		0)
  2449  	return ret1 != 0
  2450  }
  2451  
  2452  func IsValidSecurityDescriptor(pSecurityDescriptor PSECURITY_DESCRIPTOR) bool {
  2453  	ret1 := syscall3(isValidSecurityDescriptor, 1,
  2454  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2455  		0,
  2456  		0)
  2457  	return ret1 != 0
  2458  }
  2459  
  2460  func IsValidSid(pSid PSID) bool {
  2461  	ret1 := syscall3(isValidSid, 1,
  2462  		uintptr(pSid),
  2463  		0,
  2464  		0)
  2465  	return ret1 != 0
  2466  }
  2467  
  2468  // TODO: Unknown type(s): WELL_KNOWN_SID_TYPE
  2469  // func IsWellKnownSid(pSid PSID, wellKnownSidType WELL_KNOWN_SID_TYPE) bool
  2470  
  2471  func LockServiceDatabase(hSCManager SC_HANDLE) SC_LOCK {
  2472  	ret1 := syscall3(lockServiceDatabase, 1,
  2473  		uintptr(hSCManager),
  2474  		0,
  2475  		0)
  2476  	return SC_LOCK(ret1)
  2477  }
  2478  
  2479  // TODO: Unknown type(s): PQUOTA_LIMITS
  2480  // func LogonUserEx(lpszUsername string, lpszDomain string, lpszPassword string, dwLogonType DWORD, dwLogonProvider DWORD, phToken *HANDLE, ppLogonSid *PSID, ppProfileBuffer *PVOID, pdwProfileLength *uint32, pQuotaLimits PQUOTA_LIMITS) bool
  2481  
  2482  func LogonUser(lpszUsername string, lpszDomain string, lpszPassword string, dwLogonType DWORD, dwLogonProvider DWORD, phToken *HANDLE) bool {
  2483  	lpszUsernameStr := unicode16FromString(lpszUsername)
  2484  	lpszDomainStr := unicode16FromString(lpszDomain)
  2485  	lpszPasswordStr := unicode16FromString(lpszPassword)
  2486  	ret1 := syscall6(logonUser, 6,
  2487  		uintptr(unsafe.Pointer(&lpszUsernameStr[0])),
  2488  		uintptr(unsafe.Pointer(&lpszDomainStr[0])),
  2489  		uintptr(unsafe.Pointer(&lpszPasswordStr[0])),
  2490  		uintptr(dwLogonType),
  2491  		uintptr(dwLogonProvider),
  2492  		uintptr(unsafe.Pointer(phToken)))
  2493  	return ret1 != 0
  2494  }
  2495  
  2496  // TODO: Unknown type(s): PSID_NAME_USE
  2497  // func LookupAccountName(lpSystemName string, lpAccountName string, sid PSID, cbSid *uint32, referencedDomainName LPWSTR, cchReferencedDomainName *uint32, peUse PSID_NAME_USE) bool
  2498  
  2499  // TODO: Unknown type(s): PSID_NAME_USE
  2500  // func LookupAccountSid(lpSystemName string, sid PSID, name LPWSTR, cchName *uint32, referencedDomainName LPWSTR, cchReferencedDomainName *uint32, peUse PSID_NAME_USE) bool
  2501  
  2502  func LookupPrivilegeDisplayName(lpSystemName string, lpName string, lpDisplayName LPWSTR, cchDisplayName *uint32, lpLanguageId *uint32) bool {
  2503  	lpSystemNameStr := unicode16FromString(lpSystemName)
  2504  	lpNameStr := unicode16FromString(lpName)
  2505  	ret1 := syscall6(lookupPrivilegeDisplayName, 5,
  2506  		uintptr(unsafe.Pointer(&lpSystemNameStr[0])),
  2507  		uintptr(unsafe.Pointer(&lpNameStr[0])),
  2508  		uintptr(unsafe.Pointer(lpDisplayName)),
  2509  		uintptr(unsafe.Pointer(cchDisplayName)),
  2510  		uintptr(unsafe.Pointer(lpLanguageId)),
  2511  		0)
  2512  	return ret1 != 0
  2513  }
  2514  
  2515  func LookupPrivilegeName(lpSystemName string, lpLuid *LUID, lpName LPWSTR, cchName *uint32) bool {
  2516  	lpSystemNameStr := unicode16FromString(lpSystemName)
  2517  	ret1 := syscall6(lookupPrivilegeName, 4,
  2518  		uintptr(unsafe.Pointer(&lpSystemNameStr[0])),
  2519  		uintptr(unsafe.Pointer(lpLuid)),
  2520  		uintptr(unsafe.Pointer(lpName)),
  2521  		uintptr(unsafe.Pointer(cchName)),
  2522  		0,
  2523  		0)
  2524  	return ret1 != 0
  2525  }
  2526  
  2527  func LookupPrivilegeValue(lpSystemName string, lpName string, lpLuid *LUID) bool {
  2528  	lpSystemNameStr := unicode16FromString(lpSystemName)
  2529  	lpNameStr := unicode16FromString(lpName)
  2530  	ret1 := syscall3(lookupPrivilegeValue, 3,
  2531  		uintptr(unsafe.Pointer(&lpSystemNameStr[0])),
  2532  		uintptr(unsafe.Pointer(&lpNameStr[0])),
  2533  		uintptr(unsafe.Pointer(lpLuid)))
  2534  	return ret1 != 0
  2535  }
  2536  
  2537  // TODO: Unknown type(s): PEXPLICIT_ACCESS_W *, PTRUSTEE_W *
  2538  // func LookupSecurityDescriptorParts(ppOwner PTRUSTEE_W *, ppGroup PTRUSTEE_W *, pcCountOfAccessEntries *uint32, ppListOfAccessEntries PEXPLICIT_ACCESS_W *, pcCountOfAuditEntries *uint32, ppListOfAuditEntries PEXPLICIT_ACCESS_W *, pSD PSECURITY_DESCRIPTOR) DWORD
  2539  
  2540  // TODO: Unknown type(s): PLM_OWF_PASSWORD, PNT_OWF_PASSWORD
  2541  // func MSChapSrvChangePassword(serverName LPWSTR, userName LPWSTR, lmOldPresent BOOLEAN, lmOldOwfPassword PLM_OWF_PASSWORD, lmNewOwfPassword PLM_OWF_PASSWORD, ntOldOwfPassword PNT_OWF_PASSWORD, ntNewOwfPassword PNT_OWF_PASSWORD) DWORD
  2542  
  2543  // TODO: Unknown type(s): PENCRYPTED_LM_OWF_PASSWORD, PENCRYPTED_NT_OWF_PASSWORD, PSAMPR_ENCRYPTED_USER_PASSWORD
  2544  // func MSChapSrvChangePassword2(serverName LPWSTR, userName LPWSTR, newPasswordEncryptedWithOldNt PSAMPR_ENCRYPTED_USER_PASSWORD, oldNtOwfPasswordEncryptedWithNewNt PENCRYPTED_NT_OWF_PASSWORD, lmPresent BOOLEAN, newPasswordEncryptedWithOldLm PSAMPR_ENCRYPTED_USER_PASSWORD, oldLmOwfPasswordEncryptedWithNewLmOrNt PENCRYPTED_LM_OWF_PASSWORD) DWORD
  2545  
  2546  func MakeAbsoluteSD(pSelfRelativeSecurityDescriptor PSECURITY_DESCRIPTOR, pAbsoluteSecurityDescriptor PSECURITY_DESCRIPTOR, lpdwAbsoluteSecurityDescriptorSize *uint32, pDacl *ACL, lpdwDaclSize *uint32, pSacl *ACL, lpdwSaclSize *uint32, pOwner PSID, lpdwOwnerSize *uint32, pPrimaryGroup PSID, lpdwPrimaryGroupSize *uint32) bool {
  2547  	ret1 := syscall12(makeAbsoluteSD, 11,
  2548  		uintptr(unsafe.Pointer(pSelfRelativeSecurityDescriptor)),
  2549  		uintptr(unsafe.Pointer(pAbsoluteSecurityDescriptor)),
  2550  		uintptr(unsafe.Pointer(lpdwAbsoluteSecurityDescriptorSize)),
  2551  		uintptr(unsafe.Pointer(pDacl)),
  2552  		uintptr(unsafe.Pointer(lpdwDaclSize)),
  2553  		uintptr(unsafe.Pointer(pSacl)),
  2554  		uintptr(unsafe.Pointer(lpdwSaclSize)),
  2555  		uintptr(pOwner),
  2556  		uintptr(unsafe.Pointer(lpdwOwnerSize)),
  2557  		uintptr(pPrimaryGroup),
  2558  		uintptr(unsafe.Pointer(lpdwPrimaryGroupSize)),
  2559  		0)
  2560  	return ret1 != 0
  2561  }
  2562  
  2563  func MakeSelfRelativeSD(pAbsoluteSecurityDescriptor PSECURITY_DESCRIPTOR, pSelfRelativeSecurityDescriptor PSECURITY_DESCRIPTOR, lpdwBufferLength *uint32) bool {
  2564  	ret1 := syscall3(makeSelfRelativeSD, 3,
  2565  		uintptr(unsafe.Pointer(pAbsoluteSecurityDescriptor)),
  2566  		uintptr(unsafe.Pointer(pSelfRelativeSecurityDescriptor)),
  2567  		uintptr(unsafe.Pointer(lpdwBufferLength)))
  2568  	return ret1 != 0
  2569  }
  2570  
  2571  func MapGenericMask(accessMask *DWORD, genericMapping *GENERIC_MAPPING) {
  2572  	syscall3(mapGenericMask, 2,
  2573  		uintptr(unsafe.Pointer(accessMask)),
  2574  		uintptr(unsafe.Pointer(genericMapping)),
  2575  		0)
  2576  }
  2577  
  2578  func NotifyBootConfigStatus(bootAcceptable bool) bool {
  2579  	ret1 := syscall3(notifyBootConfigStatus, 1,
  2580  		getUintptrFromBool(bootAcceptable),
  2581  		0,
  2582  		0)
  2583  	return ret1 != 0
  2584  }
  2585  
  2586  func NotifyChangeEventLog(hEventLog HANDLE, hEvent HANDLE) bool {
  2587  	ret1 := syscall3(notifyChangeEventLog, 2,
  2588  		uintptr(hEventLog),
  2589  		uintptr(hEvent),
  2590  		0)
  2591  	return ret1 != 0
  2592  }
  2593  
  2594  // TODO: Unknown type(s): PSERVICE_NOTIFYW
  2595  // func NotifyServiceStatusChange(hService SC_HANDLE, dwNotifyMask DWORD, pNotifyBuffer PSERVICE_NOTIFYW) DWORD
  2596  
  2597  func ObjectCloseAuditAlarm(subsystemName string, handleId LPVOID, generateOnClose bool) bool {
  2598  	subsystemNameStr := unicode16FromString(subsystemName)
  2599  	ret1 := syscall3(objectCloseAuditAlarm, 3,
  2600  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2601  		uintptr(unsafe.Pointer(handleId)),
  2602  		getUintptrFromBool(generateOnClose))
  2603  	return ret1 != 0
  2604  }
  2605  
  2606  func ObjectDeleteAuditAlarm(subsystemName string, handleId LPVOID, generateOnClose bool) bool {
  2607  	subsystemNameStr := unicode16FromString(subsystemName)
  2608  	ret1 := syscall3(objectDeleteAuditAlarm, 3,
  2609  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2610  		uintptr(unsafe.Pointer(handleId)),
  2611  		getUintptrFromBool(generateOnClose))
  2612  	return ret1 != 0
  2613  }
  2614  
  2615  func ObjectOpenAuditAlarm(subsystemName string, handleId LPVOID, objectTypeName LPWSTR, objectName LPWSTR, pSecurityDescriptor PSECURITY_DESCRIPTOR, clientToken HANDLE, desiredAccess DWORD, grantedAccess DWORD, privileges *PRIVILEGE_SET, objectCreation bool, accessGranted bool, generateOnClose *BOOL) bool {
  2616  	subsystemNameStr := unicode16FromString(subsystemName)
  2617  	ret1 := syscall12(objectOpenAuditAlarm, 12,
  2618  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2619  		uintptr(unsafe.Pointer(handleId)),
  2620  		uintptr(unsafe.Pointer(objectTypeName)),
  2621  		uintptr(unsafe.Pointer(objectName)),
  2622  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2623  		uintptr(clientToken),
  2624  		uintptr(desiredAccess),
  2625  		uintptr(grantedAccess),
  2626  		uintptr(unsafe.Pointer(privileges)),
  2627  		getUintptrFromBool(objectCreation),
  2628  		getUintptrFromBool(accessGranted),
  2629  		uintptr(unsafe.Pointer(generateOnClose)))
  2630  	return ret1 != 0
  2631  }
  2632  
  2633  func ObjectPrivilegeAuditAlarm(subsystemName string, handleId LPVOID, clientToken HANDLE, desiredAccess DWORD, privileges *PRIVILEGE_SET, accessGranted bool) bool {
  2634  	subsystemNameStr := unicode16FromString(subsystemName)
  2635  	ret1 := syscall6(objectPrivilegeAuditAlarm, 6,
  2636  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2637  		uintptr(unsafe.Pointer(handleId)),
  2638  		uintptr(clientToken),
  2639  		uintptr(desiredAccess),
  2640  		uintptr(unsafe.Pointer(privileges)),
  2641  		getUintptrFromBool(accessGranted))
  2642  	return ret1 != 0
  2643  }
  2644  
  2645  func OpenBackupEventLog(lpUNCServerName string, lpFileName string) HANDLE {
  2646  	lpUNCServerNameStr := unicode16FromString(lpUNCServerName)
  2647  	lpFileNameStr := unicode16FromString(lpFileName)
  2648  	ret1 := syscall3(openBackupEventLog, 2,
  2649  		uintptr(unsafe.Pointer(&lpUNCServerNameStr[0])),
  2650  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2651  		0)
  2652  	return HANDLE(ret1)
  2653  }
  2654  
  2655  func OpenEncryptedFileRaw(lpFileName string, ulFlags ULONG, pvContext *PVOID) DWORD {
  2656  	lpFileNameStr := unicode16FromString(lpFileName)
  2657  	ret1 := syscall3(openEncryptedFileRaw, 3,
  2658  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2659  		uintptr(ulFlags),
  2660  		uintptr(unsafe.Pointer(pvContext)))
  2661  	return DWORD(ret1)
  2662  }
  2663  
  2664  func OpenEventLog(lpUNCServerName string, lpSourceName string) HANDLE {
  2665  	lpUNCServerNameStr := unicode16FromString(lpUNCServerName)
  2666  	lpSourceNameStr := unicode16FromString(lpSourceName)
  2667  	ret1 := syscall3(openEventLog, 2,
  2668  		uintptr(unsafe.Pointer(&lpUNCServerNameStr[0])),
  2669  		uintptr(unsafe.Pointer(&lpSourceNameStr[0])),
  2670  		0)
  2671  	return HANDLE(ret1)
  2672  }
  2673  
  2674  func OpenProcessToken(processHandle HANDLE, desiredAccess DWORD, tokenHandle *HANDLE) bool {
  2675  	ret1 := syscall3(openProcessToken, 3,
  2676  		uintptr(processHandle),
  2677  		uintptr(desiredAccess),
  2678  		uintptr(unsafe.Pointer(tokenHandle)))
  2679  	return ret1 != 0
  2680  }
  2681  
  2682  func OpenSCManager(lpMachineName string, lpDatabaseName string, dwDesiredAccess DWORD) SC_HANDLE {
  2683  	lpMachineNameStr := unicode16FromString(lpMachineName)
  2684  	lpDatabaseNameStr := unicode16FromString(lpDatabaseName)
  2685  	ret1 := syscall3(openSCManager, 3,
  2686  		uintptr(unsafe.Pointer(&lpMachineNameStr[0])),
  2687  		uintptr(unsafe.Pointer(&lpDatabaseNameStr[0])),
  2688  		uintptr(dwDesiredAccess))
  2689  	return SC_HANDLE(ret1)
  2690  }
  2691  
  2692  func OpenService(hSCManager SC_HANDLE, lpServiceName string, dwDesiredAccess DWORD) SC_HANDLE {
  2693  	lpServiceNameStr := unicode16FromString(lpServiceName)
  2694  	ret1 := syscall3(openService, 3,
  2695  		uintptr(hSCManager),
  2696  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  2697  		uintptr(dwDesiredAccess))
  2698  	return SC_HANDLE(ret1)
  2699  }
  2700  
  2701  func OpenThreadToken(threadHandle HANDLE, desiredAccess DWORD, openAsSelf bool, tokenHandle *HANDLE) bool {
  2702  	ret1 := syscall6(openThreadToken, 4,
  2703  		uintptr(threadHandle),
  2704  		uintptr(desiredAccess),
  2705  		getUintptrFromBool(openAsSelf),
  2706  		uintptr(unsafe.Pointer(tokenHandle)),
  2707  		0,
  2708  		0)
  2709  	return ret1 != 0
  2710  }
  2711  
  2712  // TODO: Unknown type(s): PWAITCHAINCALLBACK
  2713  // func OpenThreadWaitChainSession(flags DWORD, callback PWAITCHAINCALLBACK) HWCT
  2714  
  2715  func PerfCreateInstance(hProvider HANDLE, counterSetGuid /*const*/ *GUID, szInstanceName string, dwInstance ULONG) *PERF_COUNTERSET_INSTANCE {
  2716  	szInstanceNameStr := unicode16FromString(szInstanceName)
  2717  	ret1 := syscall6(perfCreateInstance, 4,
  2718  		uintptr(hProvider),
  2719  		uintptr(unsafe.Pointer(counterSetGuid)),
  2720  		uintptr(unsafe.Pointer(&szInstanceNameStr[0])),
  2721  		uintptr(dwInstance),
  2722  		0,
  2723  		0)
  2724  	return (*PERF_COUNTERSET_INSTANCE)(unsafe.Pointer(ret1))
  2725  }
  2726  
  2727  func PerfDecrementULongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lValue ULONG) ULONG {
  2728  	ret1 := syscall6(perfDecrementULongCounterValue, 4,
  2729  		uintptr(hProvider),
  2730  		uintptr(unsafe.Pointer(pInstance)),
  2731  		uintptr(counterId),
  2732  		uintptr(lValue),
  2733  		0,
  2734  		0)
  2735  	return ULONG(ret1)
  2736  }
  2737  
  2738  func PerfDecrementULongLongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, llValue ULONGLONG) ULONG {
  2739  	ret1 := syscall6(perfDecrementULongLongCounterValue, 4,
  2740  		uintptr(hProvider),
  2741  		uintptr(unsafe.Pointer(pInstance)),
  2742  		uintptr(counterId),
  2743  		uintptr(llValue),
  2744  		0,
  2745  		0)
  2746  	return ULONG(ret1)
  2747  }
  2748  
  2749  func PerfDeleteInstance(hProvider HANDLE, instanceBlock *PERF_COUNTERSET_INSTANCE) ULONG {
  2750  	ret1 := syscall3(perfDeleteInstance, 2,
  2751  		uintptr(hProvider),
  2752  		uintptr(unsafe.Pointer(instanceBlock)),
  2753  		0)
  2754  	return ULONG(ret1)
  2755  }
  2756  
  2757  func PerfIncrementULongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lValue ULONG) ULONG {
  2758  	ret1 := syscall6(perfIncrementULongCounterValue, 4,
  2759  		uintptr(hProvider),
  2760  		uintptr(unsafe.Pointer(pInstance)),
  2761  		uintptr(counterId),
  2762  		uintptr(lValue),
  2763  		0,
  2764  		0)
  2765  	return ULONG(ret1)
  2766  }
  2767  
  2768  func PerfIncrementULongLongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, llValue ULONGLONG) ULONG {
  2769  	ret1 := syscall6(perfIncrementULongLongCounterValue, 4,
  2770  		uintptr(hProvider),
  2771  		uintptr(unsafe.Pointer(pInstance)),
  2772  		uintptr(counterId),
  2773  		uintptr(llValue),
  2774  		0,
  2775  		0)
  2776  	return ULONG(ret1)
  2777  }
  2778  
  2779  func PerfQueryInstance(hProvider HANDLE, counterSetGuid /*const*/ *GUID, szInstance string, dwInstance ULONG) *PERF_COUNTERSET_INSTANCE {
  2780  	szInstanceStr := unicode16FromString(szInstance)
  2781  	ret1 := syscall6(perfQueryInstance, 4,
  2782  		uintptr(hProvider),
  2783  		uintptr(unsafe.Pointer(counterSetGuid)),
  2784  		uintptr(unsafe.Pointer(&szInstanceStr[0])),
  2785  		uintptr(dwInstance),
  2786  		0,
  2787  		0)
  2788  	return (*PERF_COUNTERSET_INSTANCE)(unsafe.Pointer(ret1))
  2789  }
  2790  
  2791  func PerfSetCounterRefValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lpAddr uintptr) ULONG {
  2792  	ret1 := syscall6(perfSetCounterRefValue, 4,
  2793  		uintptr(hProvider),
  2794  		uintptr(unsafe.Pointer(pInstance)),
  2795  		uintptr(counterId),
  2796  		lpAddr,
  2797  		0,
  2798  		0)
  2799  	return ULONG(ret1)
  2800  }
  2801  
  2802  // TODO: Unknown type(s): PPERF_COUNTERSET_INFO
  2803  // func PerfSetCounterSetInfo(hProvider HANDLE, pTemplate PPERF_COUNTERSET_INFO, dwTemplateSize ULONG) ULONG
  2804  
  2805  func PerfSetULongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lValue ULONG) ULONG {
  2806  	ret1 := syscall6(perfSetULongCounterValue, 4,
  2807  		uintptr(hProvider),
  2808  		uintptr(unsafe.Pointer(pInstance)),
  2809  		uintptr(counterId),
  2810  		uintptr(lValue),
  2811  		0,
  2812  		0)
  2813  	return ULONG(ret1)
  2814  }
  2815  
  2816  func PerfSetULongLongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, llValue ULONGLONG) ULONG {
  2817  	ret1 := syscall6(perfSetULongLongCounterValue, 4,
  2818  		uintptr(hProvider),
  2819  		uintptr(unsafe.Pointer(pInstance)),
  2820  		uintptr(counterId),
  2821  		uintptr(llValue),
  2822  		0,
  2823  		0)
  2824  	return ULONG(ret1)
  2825  }
  2826  
  2827  // TODO: Unknown type(s): PERFLIBREQUEST
  2828  // func PerfStartProvider(providerGuid *GUID, controlCallback PERFLIBREQUEST, phProvider *HANDLE) ULONG
  2829  
  2830  // TODO: Unknown type(s): PPERF_PROVIDER_CONTEXT
  2831  // func PerfStartProviderEx(providerGuid *GUID, providerContext PPERF_PROVIDER_CONTEXT, phProvider *HANDLE) ULONG
  2832  
  2833  func PerfStopProvider(hProvider HANDLE) ULONG {
  2834  	ret1 := syscall3(perfStopProvider, 1,
  2835  		uintptr(hProvider),
  2836  		0,
  2837  		0)
  2838  	return ULONG(ret1)
  2839  }
  2840  
  2841  func PrivilegeCheck(clientToken HANDLE, requiredPrivileges *PRIVILEGE_SET, pfResult *BOOL) bool {
  2842  	ret1 := syscall3(privilegeCheck, 3,
  2843  		uintptr(clientToken),
  2844  		uintptr(unsafe.Pointer(requiredPrivileges)),
  2845  		uintptr(unsafe.Pointer(pfResult)))
  2846  	return ret1 != 0
  2847  }
  2848  
  2849  func PrivilegedServiceAuditAlarm(subsystemName string, serviceName string, clientToken HANDLE, privileges *PRIVILEGE_SET, accessGranted bool) bool {
  2850  	subsystemNameStr := unicode16FromString(subsystemName)
  2851  	serviceNameStr := unicode16FromString(serviceName)
  2852  	ret1 := syscall6(privilegedServiceAuditAlarm, 5,
  2853  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2854  		uintptr(unsafe.Pointer(&serviceNameStr[0])),
  2855  		uintptr(clientToken),
  2856  		uintptr(unsafe.Pointer(privileges)),
  2857  		getUintptrFromBool(accessGranted),
  2858  		0)
  2859  	return ret1 != 0
  2860  }
  2861  
  2862  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST *
  2863  // func QueryRecoveryAgentsOnEncryptedFile(lpFileName string, pRecoveryAgents PENCRYPTION_CERTIFICATE_HASH_LIST *) DWORD
  2864  
  2865  func QuerySecurityAccessMask(securityInformation SECURITY_INFORMATION, desiredAccess *uint32) {
  2866  	syscall3(querySecurityAccessMask, 2,
  2867  		uintptr(securityInformation),
  2868  		uintptr(unsafe.Pointer(desiredAccess)),
  2869  		0)
  2870  }
  2871  
  2872  func QueryServiceConfig2(hService SC_HANDLE, dwInfoLevel DWORD, lpBuffer *byte, cbBufSize DWORD, pcbBytesNeeded *uint32) bool {
  2873  	ret1 := syscall6(queryServiceConfig2, 5,
  2874  		uintptr(hService),
  2875  		uintptr(dwInfoLevel),
  2876  		uintptr(unsafe.Pointer(lpBuffer)),
  2877  		uintptr(cbBufSize),
  2878  		uintptr(unsafe.Pointer(pcbBytesNeeded)),
  2879  		0)
  2880  	return ret1 != 0
  2881  }
  2882  
  2883  // TODO: Unknown type(s): LPQUERY_SERVICE_CONFIGW
  2884  // func QueryServiceConfig(hService SC_HANDLE, lpServiceConfig LPQUERY_SERVICE_CONFIGW, cbBufSize DWORD, pcbBytesNeeded *uint32) bool
  2885  
  2886  // TODO: Unknown type(s): LPQUERY_SERVICE_LOCK_STATUSW
  2887  // func QueryServiceLockStatus(hSCManager SC_HANDLE, lpLockStatus LPQUERY_SERVICE_LOCK_STATUSW, cbBufSize DWORD, pcbBytesNeeded *uint32) bool
  2888  
  2889  func QueryServiceObjectSecurity(hService SC_HANDLE, dwSecurityInformation SECURITY_INFORMATION, lpSecurityDescriptor PSECURITY_DESCRIPTOR, cbBufSize DWORD, pcbBytesNeeded *uint32) bool {
  2890  	ret1 := syscall6(queryServiceObjectSecurity, 5,
  2891  		uintptr(hService),
  2892  		uintptr(dwSecurityInformation),
  2893  		uintptr(unsafe.Pointer(lpSecurityDescriptor)),
  2894  		uintptr(cbBufSize),
  2895  		uintptr(unsafe.Pointer(pcbBytesNeeded)),
  2896  		0)
  2897  	return ret1 != 0
  2898  }
  2899  
  2900  func QueryServiceStatus(hService SC_HANDLE, lpServiceStatus *SERVICE_STATUS) bool {
  2901  	ret1 := syscall3(queryServiceStatus, 2,
  2902  		uintptr(hService),
  2903  		uintptr(unsafe.Pointer(lpServiceStatus)),
  2904  		0)
  2905  	return ret1 != 0
  2906  }
  2907  
  2908  // TODO: Unknown type(s): SC_STATUS_TYPE
  2909  // func QueryServiceStatusEx(hService SC_HANDLE, infoLevel SC_STATUS_TYPE, lpBuffer *byte, cbBufSize DWORD, pcbBytesNeeded *uint32) bool
  2910  
  2911  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST *
  2912  // func QueryUsersOnEncryptedFile(lpFileName string, pUsers PENCRYPTION_CERTIFICATE_HASH_LIST *) DWORD
  2913  
  2914  // TODO: Unknown type(s): PFE_EXPORT_FUNC
  2915  // func ReadEncryptedFileRaw(pfExportCallback PFE_EXPORT_FUNC, pvCallbackContext uintptr, pvContext uintptr) DWORD
  2916  
  2917  func ReadEventLog(hEventLog HANDLE, dwReadFlags DWORD, dwRecordOffset DWORD, lpBuffer LPVOID, nNumberOfBytesToRead DWORD, pnBytesRead *uint32, pnMinNumberOfBytesNeeded *uint32) bool {
  2918  	ret1 := syscall9(readEventLog, 7,
  2919  		uintptr(hEventLog),
  2920  		uintptr(dwReadFlags),
  2921  		uintptr(dwRecordOffset),
  2922  		uintptr(unsafe.Pointer(lpBuffer)),
  2923  		uintptr(nNumberOfBytesToRead),
  2924  		uintptr(unsafe.Pointer(pnBytesRead)),
  2925  		uintptr(unsafe.Pointer(pnMinNumberOfBytesNeeded)),
  2926  		0,
  2927  		0)
  2928  	return ret1 != 0
  2929  }
  2930  
  2931  func RegCloseKey(hKey HKEY) LONG {
  2932  	ret1 := syscall3(regCloseKey, 1,
  2933  		uintptr(hKey),
  2934  		0,
  2935  		0)
  2936  	return LONG(ret1)
  2937  }
  2938  
  2939  func RegConnectRegistryEx(lpMachineName string, hKey HKEY, flags ULONG, phkResult *HKEY) LONG {
  2940  	lpMachineNameStr := unicode16FromString(lpMachineName)
  2941  	ret1 := syscall6(regConnectRegistryEx, 4,
  2942  		uintptr(unsafe.Pointer(&lpMachineNameStr[0])),
  2943  		uintptr(hKey),
  2944  		uintptr(flags),
  2945  		uintptr(unsafe.Pointer(phkResult)),
  2946  		0,
  2947  		0)
  2948  	return LONG(ret1)
  2949  }
  2950  
  2951  func RegConnectRegistry(lpMachineName string, hKey HKEY, phkResult *HKEY) LONG {
  2952  	lpMachineNameStr := unicode16FromString(lpMachineName)
  2953  	ret1 := syscall3(regConnectRegistry, 3,
  2954  		uintptr(unsafe.Pointer(&lpMachineNameStr[0])),
  2955  		uintptr(hKey),
  2956  		uintptr(unsafe.Pointer(phkResult)))
  2957  	return LONG(ret1)
  2958  }
  2959  
  2960  func RegCopyTree(hKeySrc HKEY, lpSubKey string, hKeyDest HKEY) LONG {
  2961  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2962  	ret1 := syscall3(regCopyTree, 3,
  2963  		uintptr(hKeySrc),
  2964  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2965  		uintptr(hKeyDest))
  2966  	return LONG(ret1)
  2967  }
  2968  
  2969  func RegCreateKeyEx(hKey HKEY, lpSubKey string, reserved DWORD, lpClass LPWSTR, dwOptions DWORD, samDesired REGSAM, lpSecurityAttributes *SECURITY_ATTRIBUTES, phkResult *HKEY, lpdwDisposition *uint32) LONG {
  2970  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2971  	ret1 := syscall9(regCreateKeyEx, 9,
  2972  		uintptr(hKey),
  2973  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2974  		uintptr(reserved),
  2975  		uintptr(unsafe.Pointer(lpClass)),
  2976  		uintptr(dwOptions),
  2977  		uintptr(samDesired),
  2978  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  2979  		uintptr(unsafe.Pointer(phkResult)),
  2980  		uintptr(unsafe.Pointer(lpdwDisposition)))
  2981  	return LONG(ret1)
  2982  }
  2983  
  2984  func RegCreateKeyTransacted(hKey HKEY, lpSubKey string, reserved DWORD, lpClass LPWSTR, dwOptions DWORD, samDesired REGSAM, lpSecurityAttributes /*const*/ *SECURITY_ATTRIBUTES, phkResult *HKEY, lpdwDisposition *uint32, hTransaction HANDLE, pExtendedParemeter uintptr) LONG {
  2985  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2986  	ret1 := syscall12(regCreateKeyTransacted, 11,
  2987  		uintptr(hKey),
  2988  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2989  		uintptr(reserved),
  2990  		uintptr(unsafe.Pointer(lpClass)),
  2991  		uintptr(dwOptions),
  2992  		uintptr(samDesired),
  2993  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  2994  		uintptr(unsafe.Pointer(phkResult)),
  2995  		uintptr(unsafe.Pointer(lpdwDisposition)),
  2996  		uintptr(hTransaction),
  2997  		pExtendedParemeter,
  2998  		0)
  2999  	return LONG(ret1)
  3000  }
  3001  
  3002  func RegCreateKey(hKey HKEY, lpSubKey string, phkResult *HKEY) LONG {
  3003  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3004  	ret1 := syscall3(regCreateKey, 3,
  3005  		uintptr(hKey),
  3006  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3007  		uintptr(unsafe.Pointer(phkResult)))
  3008  	return LONG(ret1)
  3009  }
  3010  
  3011  func RegDeleteKeyEx(hKey HKEY, lpSubKey string, samDesired REGSAM, reserved DWORD) LONG {
  3012  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3013  	ret1 := syscall6(regDeleteKeyEx, 4,
  3014  		uintptr(hKey),
  3015  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3016  		uintptr(samDesired),
  3017  		uintptr(reserved),
  3018  		0,
  3019  		0)
  3020  	return LONG(ret1)
  3021  }
  3022  
  3023  func RegDeleteKeyTransacted(hKey HKEY, lpSubKey string, samDesired REGSAM, reserved DWORD, hTransaction HANDLE, pExtendedParameter uintptr) LONG {
  3024  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3025  	ret1 := syscall6(regDeleteKeyTransacted, 6,
  3026  		uintptr(hKey),
  3027  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3028  		uintptr(samDesired),
  3029  		uintptr(reserved),
  3030  		uintptr(hTransaction),
  3031  		pExtendedParameter)
  3032  	return LONG(ret1)
  3033  }
  3034  
  3035  func RegDeleteKeyValue(hKey HKEY, lpSubKey string, lpValueName string) LONG {
  3036  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3037  	lpValueNameStr := unicode16FromString(lpValueName)
  3038  	ret1 := syscall3(regDeleteKeyValue, 3,
  3039  		uintptr(hKey),
  3040  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3041  		uintptr(unsafe.Pointer(&lpValueNameStr[0])))
  3042  	return LONG(ret1)
  3043  }
  3044  
  3045  func RegDeleteKey(hKey HKEY, lpSubKey string) LONG {
  3046  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3047  	ret1 := syscall3(regDeleteKey, 2,
  3048  		uintptr(hKey),
  3049  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3050  		0)
  3051  	return LONG(ret1)
  3052  }
  3053  
  3054  func RegDeleteTree(hKey HKEY, lpSubKey string) LONG {
  3055  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3056  	ret1 := syscall3(regDeleteTree, 2,
  3057  		uintptr(hKey),
  3058  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3059  		0)
  3060  	return LONG(ret1)
  3061  }
  3062  
  3063  func RegDeleteValue(hKey HKEY, lpValueName string) LONG {
  3064  	lpValueNameStr := unicode16FromString(lpValueName)
  3065  	ret1 := syscall3(regDeleteValue, 2,
  3066  		uintptr(hKey),
  3067  		uintptr(unsafe.Pointer(&lpValueNameStr[0])),
  3068  		0)
  3069  	return LONG(ret1)
  3070  }
  3071  
  3072  func RegDisablePredefinedCache() LONG {
  3073  	ret1 := syscall3(regDisablePredefinedCache, 0,
  3074  		0,
  3075  		0,
  3076  		0)
  3077  	return LONG(ret1)
  3078  }
  3079  
  3080  func RegDisablePredefinedCacheEx() LONG {
  3081  	ret1 := syscall3(regDisablePredefinedCacheEx, 0,
  3082  		0,
  3083  		0,
  3084  		0)
  3085  	return LONG(ret1)
  3086  }
  3087  
  3088  func RegDisableReflectionKey(hBase HKEY) LONG {
  3089  	ret1 := syscall3(regDisableReflectionKey, 1,
  3090  		uintptr(hBase),
  3091  		0,
  3092  		0)
  3093  	return LONG(ret1)
  3094  }
  3095  
  3096  func RegEnableReflectionKey(hBase HKEY) LONG {
  3097  	ret1 := syscall3(regEnableReflectionKey, 1,
  3098  		uintptr(hBase),
  3099  		0,
  3100  		0)
  3101  	return LONG(ret1)
  3102  }
  3103  
  3104  // TODO: Unknown type(s): PFILETIME
  3105  // func RegEnumKeyEx(hKey HKEY, dwIndex DWORD, lpName LPWSTR, lpcchName *uint32, lpReserved *uint32, lpClass LPWSTR, lpcchClass *uint32, lpftLastWriteTime PFILETIME) LONG
  3106  
  3107  func RegEnumKey(hKey HKEY, dwIndex DWORD, lpName LPWSTR, cchName DWORD) LONG {
  3108  	ret1 := syscall6(regEnumKey, 4,
  3109  		uintptr(hKey),
  3110  		uintptr(dwIndex),
  3111  		uintptr(unsafe.Pointer(lpName)),
  3112  		uintptr(cchName),
  3113  		0,
  3114  		0)
  3115  	return LONG(ret1)
  3116  }
  3117  
  3118  func RegEnumValue(hKey HKEY, dwIndex DWORD, lpValueName LPWSTR, lpcchValueName *uint32, lpReserved *uint32, lpType *uint32, lpData *byte, lpcbData *uint32) LONG {
  3119  	ret1 := syscall9(regEnumValue, 8,
  3120  		uintptr(hKey),
  3121  		uintptr(dwIndex),
  3122  		uintptr(unsafe.Pointer(lpValueName)),
  3123  		uintptr(unsafe.Pointer(lpcchValueName)),
  3124  		uintptr(unsafe.Pointer(lpReserved)),
  3125  		uintptr(unsafe.Pointer(lpType)),
  3126  		uintptr(unsafe.Pointer(lpData)),
  3127  		uintptr(unsafe.Pointer(lpcbData)),
  3128  		0)
  3129  	return LONG(ret1)
  3130  }
  3131  
  3132  func RegFlushKey(hKey HKEY) LONG {
  3133  	ret1 := syscall3(regFlushKey, 1,
  3134  		uintptr(hKey),
  3135  		0,
  3136  		0)
  3137  	return LONG(ret1)
  3138  }
  3139  
  3140  func RegGetKeySecurity(hKey HKEY, securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR, lpcbSecurityDescriptor *uint32) LONG {
  3141  	ret1 := syscall6(regGetKeySecurity, 4,
  3142  		uintptr(hKey),
  3143  		uintptr(securityInformation),
  3144  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3145  		uintptr(unsafe.Pointer(lpcbSecurityDescriptor)),
  3146  		0,
  3147  		0)
  3148  	return LONG(ret1)
  3149  }
  3150  
  3151  func RegGetValue(hkey HKEY, lpSubKey string, lpValue string, dwFlags DWORD, pdwType *uint32, pvData uintptr, pcbData *uint32) LONG {
  3152  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3153  	lpValueStr := unicode16FromString(lpValue)
  3154  	ret1 := syscall9(regGetValue, 7,
  3155  		uintptr(hkey),
  3156  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3157  		uintptr(unsafe.Pointer(&lpValueStr[0])),
  3158  		uintptr(dwFlags),
  3159  		uintptr(unsafe.Pointer(pdwType)),
  3160  		pvData,
  3161  		uintptr(unsafe.Pointer(pcbData)),
  3162  		0,
  3163  		0)
  3164  	return LONG(ret1)
  3165  }
  3166  
  3167  func RegLoadAppKey(lpFile string, phkResult *HKEY, samDesired REGSAM, dwOptions DWORD, reserved DWORD) LONG {
  3168  	lpFileStr := unicode16FromString(lpFile)
  3169  	ret1 := syscall6(regLoadAppKey, 5,
  3170  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3171  		uintptr(unsafe.Pointer(phkResult)),
  3172  		uintptr(samDesired),
  3173  		uintptr(dwOptions),
  3174  		uintptr(reserved),
  3175  		0)
  3176  	return LONG(ret1)
  3177  }
  3178  
  3179  func RegLoadKey(hKey HKEY, lpSubKey string, lpFile string) LONG {
  3180  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3181  	lpFileStr := unicode16FromString(lpFile)
  3182  	ret1 := syscall3(regLoadKey, 3,
  3183  		uintptr(hKey),
  3184  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3185  		uintptr(unsafe.Pointer(&lpFileStr[0])))
  3186  	return LONG(ret1)
  3187  }
  3188  
  3189  func RegLoadMUIString(hKey HKEY, pszValue string, pszOutBuf LPWSTR, cbOutBuf DWORD, pcbData *uint32, flags DWORD, pszDirectory string) LONG {
  3190  	pszValueStr := unicode16FromString(pszValue)
  3191  	pszDirectoryStr := unicode16FromString(pszDirectory)
  3192  	ret1 := syscall9(regLoadMUIString, 7,
  3193  		uintptr(hKey),
  3194  		uintptr(unsafe.Pointer(&pszValueStr[0])),
  3195  		uintptr(unsafe.Pointer(pszOutBuf)),
  3196  		uintptr(cbOutBuf),
  3197  		uintptr(unsafe.Pointer(pcbData)),
  3198  		uintptr(flags),
  3199  		uintptr(unsafe.Pointer(&pszDirectoryStr[0])),
  3200  		0,
  3201  		0)
  3202  	return LONG(ret1)
  3203  }
  3204  
  3205  func RegNotifyChangeKeyValue(hKey HKEY, bWatchSubtree bool, dwNotifyFilter DWORD, hEvent HANDLE, fAsynchronous bool) LONG {
  3206  	ret1 := syscall6(regNotifyChangeKeyValue, 5,
  3207  		uintptr(hKey),
  3208  		getUintptrFromBool(bWatchSubtree),
  3209  		uintptr(dwNotifyFilter),
  3210  		uintptr(hEvent),
  3211  		getUintptrFromBool(fAsynchronous),
  3212  		0)
  3213  	return LONG(ret1)
  3214  }
  3215  
  3216  func RegOpenCurrentUser(samDesired REGSAM, phkResult *HKEY) LONG {
  3217  	ret1 := syscall3(regOpenCurrentUser, 2,
  3218  		uintptr(samDesired),
  3219  		uintptr(unsafe.Pointer(phkResult)),
  3220  		0)
  3221  	return LONG(ret1)
  3222  }
  3223  
  3224  func RegOpenKeyEx(hKey HKEY, lpSubKey string, ulOptions DWORD, samDesired REGSAM, phkResult *HKEY) LONG {
  3225  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3226  	ret1 := syscall6(regOpenKeyEx, 5,
  3227  		uintptr(hKey),
  3228  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3229  		uintptr(ulOptions),
  3230  		uintptr(samDesired),
  3231  		uintptr(unsafe.Pointer(phkResult)),
  3232  		0)
  3233  	return LONG(ret1)
  3234  }
  3235  
  3236  func RegOpenKeyTransacted(hKey HKEY, lpSubKey string, ulOptions DWORD, samDesired REGSAM, phkResult *HKEY, hTransaction HANDLE, pExtendedParameter uintptr) LONG {
  3237  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3238  	ret1 := syscall9(regOpenKeyTransacted, 7,
  3239  		uintptr(hKey),
  3240  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3241  		uintptr(ulOptions),
  3242  		uintptr(samDesired),
  3243  		uintptr(unsafe.Pointer(phkResult)),
  3244  		uintptr(hTransaction),
  3245  		pExtendedParameter,
  3246  		0,
  3247  		0)
  3248  	return LONG(ret1)
  3249  }
  3250  
  3251  func RegOpenKey(hKey HKEY, lpSubKey string, phkResult *HKEY) LONG {
  3252  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3253  	ret1 := syscall3(regOpenKey, 3,
  3254  		uintptr(hKey),
  3255  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3256  		uintptr(unsafe.Pointer(phkResult)))
  3257  	return LONG(ret1)
  3258  }
  3259  
  3260  func RegOpenUserClassesRoot(hToken HANDLE, dwOptions DWORD, samDesired REGSAM, phkResult *HKEY) LONG {
  3261  	ret1 := syscall6(regOpenUserClassesRoot, 4,
  3262  		uintptr(hToken),
  3263  		uintptr(dwOptions),
  3264  		uintptr(samDesired),
  3265  		uintptr(unsafe.Pointer(phkResult)),
  3266  		0,
  3267  		0)
  3268  	return LONG(ret1)
  3269  }
  3270  
  3271  func RegOverridePredefKey(hKey HKEY, hNewHKey HKEY) LONG {
  3272  	ret1 := syscall3(regOverridePredefKey, 2,
  3273  		uintptr(hKey),
  3274  		uintptr(hNewHKey),
  3275  		0)
  3276  	return LONG(ret1)
  3277  }
  3278  
  3279  // TODO: Unknown type(s): PFILETIME
  3280  // func RegQueryInfoKey(hKey HKEY, lpClass LPWSTR, lpcchClass *uint32, lpReserved *uint32, lpcSubKeys *uint32, lpcbMaxSubKeyLen *uint32, lpcbMaxClassLen *uint32, lpcValues *uint32, lpcbMaxValueNameLen *uint32, lpcbMaxValueLen *uint32, lpcbSecurityDescriptor *uint32, lpftLastWriteTime PFILETIME) LONG
  3281  
  3282  // TODO: Unknown type(s): PVALENTW
  3283  // func RegQueryMultipleValues(hKey HKEY, val_list PVALENTW, num_vals DWORD, lpValueBuf LPWSTR, ldwTotsize *uint32) LONG
  3284  
  3285  func RegQueryReflectionKey(hBase HKEY, bIsReflectionDisabled *BOOL) LONG {
  3286  	ret1 := syscall3(regQueryReflectionKey, 2,
  3287  		uintptr(hBase),
  3288  		uintptr(unsafe.Pointer(bIsReflectionDisabled)),
  3289  		0)
  3290  	return LONG(ret1)
  3291  }
  3292  
  3293  func RegQueryValueEx(hKey HKEY, lpValueName string, lpReserved *uint32, lpType *uint32, lpData *byte, lpcbData *uint32) LONG {
  3294  	lpValueNameStr := unicode16FromString(lpValueName)
  3295  	ret1 := syscall6(regQueryValueEx, 6,
  3296  		uintptr(hKey),
  3297  		uintptr(unsafe.Pointer(&lpValueNameStr[0])),
  3298  		uintptr(unsafe.Pointer(lpReserved)),
  3299  		uintptr(unsafe.Pointer(lpType)),
  3300  		uintptr(unsafe.Pointer(lpData)),
  3301  		uintptr(unsafe.Pointer(lpcbData)))
  3302  	return LONG(ret1)
  3303  }
  3304  
  3305  func RegQueryValue(hKey HKEY, lpSubKey string, lpData LPWSTR, lpcbData *int32) LONG {
  3306  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3307  	ret1 := syscall6(regQueryValue, 4,
  3308  		uintptr(hKey),
  3309  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3310  		uintptr(unsafe.Pointer(lpData)),
  3311  		uintptr(unsafe.Pointer(lpcbData)),
  3312  		0,
  3313  		0)
  3314  	return LONG(ret1)
  3315  }
  3316  
  3317  func RegReplaceKey(hKey HKEY, lpSubKey string, lpNewFile string, lpOldFile string) LONG {
  3318  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3319  	lpNewFileStr := unicode16FromString(lpNewFile)
  3320  	lpOldFileStr := unicode16FromString(lpOldFile)
  3321  	ret1 := syscall6(regReplaceKey, 4,
  3322  		uintptr(hKey),
  3323  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3324  		uintptr(unsafe.Pointer(&lpNewFileStr[0])),
  3325  		uintptr(unsafe.Pointer(&lpOldFileStr[0])),
  3326  		0,
  3327  		0)
  3328  	return LONG(ret1)
  3329  }
  3330  
  3331  func RegRestoreKey(hKey HKEY, lpFile string, dwFlags DWORD) LONG {
  3332  	lpFileStr := unicode16FromString(lpFile)
  3333  	ret1 := syscall3(regRestoreKey, 3,
  3334  		uintptr(hKey),
  3335  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3336  		uintptr(dwFlags))
  3337  	return LONG(ret1)
  3338  }
  3339  
  3340  func RegSaveKeyEx(hKey HKEY, lpFile string, lpSecurityAttributes *SECURITY_ATTRIBUTES, flags DWORD) LONG {
  3341  	lpFileStr := unicode16FromString(lpFile)
  3342  	ret1 := syscall6(regSaveKeyEx, 4,
  3343  		uintptr(hKey),
  3344  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3345  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  3346  		uintptr(flags),
  3347  		0,
  3348  		0)
  3349  	return LONG(ret1)
  3350  }
  3351  
  3352  func RegSaveKey(hKey HKEY, lpFile string, lpSecurityAttributes *SECURITY_ATTRIBUTES) LONG {
  3353  	lpFileStr := unicode16FromString(lpFile)
  3354  	ret1 := syscall3(regSaveKey, 3,
  3355  		uintptr(hKey),
  3356  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3357  		uintptr(unsafe.Pointer(lpSecurityAttributes)))
  3358  	return LONG(ret1)
  3359  }
  3360  
  3361  func RegSetKeySecurity(hKey HKEY, securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR) LONG {
  3362  	ret1 := syscall3(regSetKeySecurity, 3,
  3363  		uintptr(hKey),
  3364  		uintptr(securityInformation),
  3365  		uintptr(unsafe.Pointer(pSecurityDescriptor)))
  3366  	return LONG(ret1)
  3367  }
  3368  
  3369  func RegSetKeyValue(hKey HKEY, lpSubKey /*const*/ LPCSTR, lpValueName /*const*/ LPCSTR, dwType DWORD, lpData /*const*/ uintptr, cbData DWORD) LONG {
  3370  	ret1 := syscall6(regSetKeyValue, 6,
  3371  		uintptr(hKey),
  3372  		uintptr(unsafe.Pointer(lpSubKey)),
  3373  		uintptr(unsafe.Pointer(lpValueName)),
  3374  		uintptr(dwType),
  3375  		lpData,
  3376  		uintptr(cbData))
  3377  	return LONG(ret1)
  3378  }
  3379  
  3380  func RegSetValueEx(hKey HKEY, lpValueName string, reserved DWORD, dwType DWORD, lpData /*const*/ *byte, cbData DWORD) LONG {
  3381  	lpValueNameStr := unicode16FromString(lpValueName)
  3382  	ret1 := syscall6(regSetValueEx, 6,
  3383  		uintptr(hKey),
  3384  		uintptr(unsafe.Pointer(&lpValueNameStr[0])),
  3385  		uintptr(reserved),
  3386  		uintptr(dwType),
  3387  		uintptr(unsafe.Pointer(lpData)),
  3388  		uintptr(cbData))
  3389  	return LONG(ret1)
  3390  }
  3391  
  3392  func RegSetValue(hKey HKEY, lpSubKey string, dwType DWORD, lpData string, cbData DWORD) LONG {
  3393  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3394  	lpDataStr := unicode16FromString(lpData)
  3395  	ret1 := syscall6(regSetValue, 5,
  3396  		uintptr(hKey),
  3397  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3398  		uintptr(dwType),
  3399  		uintptr(unsafe.Pointer(&lpDataStr[0])),
  3400  		uintptr(cbData),
  3401  		0)
  3402  	return LONG(ret1)
  3403  }
  3404  
  3405  func RegUnLoadKey(hKey HKEY, lpSubKey string) LONG {
  3406  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3407  	ret1 := syscall3(regUnLoadKey, 2,
  3408  		uintptr(hKey),
  3409  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3410  		0)
  3411  	return LONG(ret1)
  3412  }
  3413  
  3414  func RegisterEventSource(lpUNCServerName string, lpSourceName string) HANDLE {
  3415  	lpUNCServerNameStr := unicode16FromString(lpUNCServerName)
  3416  	lpSourceNameStr := unicode16FromString(lpSourceName)
  3417  	ret1 := syscall3(registerEventSource, 2,
  3418  		uintptr(unsafe.Pointer(&lpUNCServerNameStr[0])),
  3419  		uintptr(unsafe.Pointer(&lpSourceNameStr[0])),
  3420  		0)
  3421  	return HANDLE(ret1)
  3422  }
  3423  
  3424  func RegisterServiceCtrlHandlerEx(lpServiceName string, lpHandlerProc HANDLER_FUNCTION_EX, lpContext LPVOID) SERVICE_STATUS_HANDLE {
  3425  	lpServiceNameStr := unicode16FromString(lpServiceName)
  3426  	lpHandlerProcCallback := syscall.NewCallback(func(dwControlRawArg uint32, dwEventTypeRawArg uint32, lpEventDataRawArg uintptr, lpContextRawArg uintptr) uintptr {
  3427  		ret := lpHandlerProc(dwControlRawArg, dwEventTypeRawArg, lpEventDataRawArg, lpContextRawArg)
  3428  		return uintptr(ret)
  3429  	})
  3430  	ret1 := syscall3(registerServiceCtrlHandlerEx, 3,
  3431  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  3432  		lpHandlerProcCallback,
  3433  		uintptr(unsafe.Pointer(lpContext)))
  3434  	return SERVICE_STATUS_HANDLE(ret1)
  3435  }
  3436  
  3437  // TODO: Unknown type(s): LPHANDLER_FUNCTION
  3438  // func RegisterServiceCtrlHandler(lpServiceName string, lpHandlerProc LPHANDLER_FUNCTION) SERVICE_STATUS_HANDLE
  3439  
  3440  // TODO: Unknown type(s): PCOGETACTIVATIONSTATE, PCOGETCALLSTATE
  3441  // func RegisterWaitChainCOMCallback(callStateCallback PCOGETCALLSTATE, activationStateCallback PCOGETACTIVATIONSTATE)
  3442  
  3443  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST
  3444  // func RemoveUsersFromEncryptedFile(lpFileName string, pHashes PENCRYPTION_CERTIFICATE_HASH_LIST) DWORD
  3445  
  3446  func ReportEvent(hEventLog HANDLE, wType WORD, wCategory WORD, dwEventID DWORD, lpUserSid PSID, wNumStrings WORD, dwDataSize DWORD, lpStrings *LPCWSTR, lpRawData LPVOID) bool {
  3447  	ret1 := syscall9(reportEvent, 9,
  3448  		uintptr(hEventLog),
  3449  		uintptr(wType),
  3450  		uintptr(wCategory),
  3451  		uintptr(dwEventID),
  3452  		uintptr(lpUserSid),
  3453  		uintptr(wNumStrings),
  3454  		uintptr(dwDataSize),
  3455  		uintptr(unsafe.Pointer(lpStrings)),
  3456  		uintptr(unsafe.Pointer(lpRawData)))
  3457  	return ret1 != 0
  3458  }
  3459  
  3460  func RevertToSelf() bool {
  3461  	ret1 := syscall3(revertToSelf, 0,
  3462  		0,
  3463  		0,
  3464  		0)
  3465  	return ret1 != 0
  3466  }
  3467  
  3468  func SaferCloseLevel(hLevelHandle SAFER_LEVEL_HANDLE) bool {
  3469  	ret1 := syscall3(saferCloseLevel, 1,
  3470  		uintptr(hLevelHandle),
  3471  		0,
  3472  		0)
  3473  	return ret1 != 0
  3474  }
  3475  
  3476  func SaferComputeTokenFromLevel(levelHandle SAFER_LEVEL_HANDLE, inAccessToken HANDLE, outAccessToken *HANDLE, dwFlags DWORD, lpReserved LPVOID) bool {
  3477  	ret1 := syscall6(saferComputeTokenFromLevel, 5,
  3478  		uintptr(levelHandle),
  3479  		uintptr(inAccessToken),
  3480  		uintptr(unsafe.Pointer(outAccessToken)),
  3481  		uintptr(dwFlags),
  3482  		uintptr(unsafe.Pointer(lpReserved)),
  3483  		0)
  3484  	return ret1 != 0
  3485  }
  3486  
  3487  func SaferCreateLevel(dwScopeId DWORD, dwLevelId DWORD, openFlags DWORD, pLevelHandle *SAFER_LEVEL_HANDLE, lpReserved LPVOID) bool {
  3488  	ret1 := syscall6(saferCreateLevel, 5,
  3489  		uintptr(dwScopeId),
  3490  		uintptr(dwLevelId),
  3491  		uintptr(openFlags),
  3492  		uintptr(unsafe.Pointer(pLevelHandle)),
  3493  		uintptr(unsafe.Pointer(lpReserved)),
  3494  		0)
  3495  	return ret1 != 0
  3496  }
  3497  
  3498  // TODO: Unknown type(s): SAFER_OBJECT_INFO_CLASS
  3499  // func SaferGetLevelInformation(levelHandle SAFER_LEVEL_HANDLE, dwInfoType SAFER_OBJECT_INFO_CLASS, lpQueryBuffer LPVOID, dwInBufferSize DWORD, lpdwOutBufferSize *uint32) bool
  3500  
  3501  // TODO: Unknown type(s): SAFER_POLICY_INFO_CLASS
  3502  // func SaferGetPolicyInformation(dwScopeId DWORD, saferPolicyInfoClass SAFER_POLICY_INFO_CLASS, infoBufferSize DWORD, infoBuffer uintptr, infoBufferRetSize *DWORD, lpReserved LPVOID) bool
  3503  
  3504  // TODO: Unknown type(s): PSAFER_CODE_PROPERTIES
  3505  // func SaferIdentifyLevel(dwNumProperties DWORD, pCodeProperties PSAFER_CODE_PROPERTIES, pLevelHandle *SAFER_LEVEL_HANDLE, lpReserved LPVOID) bool
  3506  
  3507  func SaferRecordEventLogEntry(hLevel SAFER_LEVEL_HANDLE, szTargetPath string, lpReserved LPVOID) bool {
  3508  	szTargetPathStr := unicode16FromString(szTargetPath)
  3509  	ret1 := syscall3(saferRecordEventLogEntry, 3,
  3510  		uintptr(hLevel),
  3511  		uintptr(unsafe.Pointer(&szTargetPathStr[0])),
  3512  		uintptr(unsafe.Pointer(lpReserved)))
  3513  	return ret1 != 0
  3514  }
  3515  
  3516  // TODO: Unknown type(s): SAFER_OBJECT_INFO_CLASS
  3517  // func SaferSetLevelInformation(levelHandle SAFER_LEVEL_HANDLE, dwInfoType SAFER_OBJECT_INFO_CLASS, lpQueryBuffer LPVOID, dwInBufferSize DWORD) bool
  3518  
  3519  // TODO: Unknown type(s): SAFER_POLICY_INFO_CLASS
  3520  // func SaferSetPolicyInformation(dwScopeId DWORD, saferPolicyInfoClass SAFER_POLICY_INFO_CLASS, infoBufferSize DWORD, infoBuffer uintptr, lpReserved LPVOID) bool
  3521  
  3522  func SaferiIsExecutableFileType(szFullPathname string, bFromShellExecute BOOLEAN) bool {
  3523  	szFullPathnameStr := unicode16FromString(szFullPathname)
  3524  	ret1 := syscall3(saferiIsExecutableFileType, 2,
  3525  		uintptr(unsafe.Pointer(&szFullPathnameStr[0])),
  3526  		uintptr(bFromShellExecute),
  3527  		0)
  3528  	return ret1 != 0
  3529  }
  3530  
  3531  // TODO: Unknown type(s): ACL_INFORMATION_CLASS
  3532  // func SetAclInformation(pAcl *ACL, pAclInformation LPVOID, nAclInformationLength DWORD, dwAclInformationClass ACL_INFORMATION_CLASS) bool
  3533  
  3534  // TODO: Unknown type(s): PACL *
  3535  // func SetEntriesInAcl(cCountOfExplicitEntries ULONG, pListOfExplicitEntries *EXPLICIT_ACCESS, oldAcl *ACL, newAcl PACL *) DWORD
  3536  
  3537  func SetFileSecurity(lpFileName string, securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR) bool {
  3538  	lpFileNameStr := unicode16FromString(lpFileName)
  3539  	ret1 := syscall3(setFileSecurity, 3,
  3540  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  3541  		uintptr(securityInformation),
  3542  		uintptr(unsafe.Pointer(pSecurityDescriptor)))
  3543  	return ret1 != 0
  3544  }
  3545  
  3546  func SetKernelObjectSecurity(handle HANDLE, securityInformation SECURITY_INFORMATION, securityDescriptor PSECURITY_DESCRIPTOR) bool {
  3547  	ret1 := syscall3(setKernelObjectSecurity, 3,
  3548  		uintptr(handle),
  3549  		uintptr(securityInformation),
  3550  		uintptr(unsafe.Pointer(securityDescriptor)))
  3551  	return ret1 != 0
  3552  }
  3553  
  3554  func SetNamedSecurityInfo(pObjectName LPWSTR, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, psidOwner PSID, psidGroup PSID, pDacl *ACL, pSacl *ACL) DWORD {
  3555  	ret1 := syscall9(setNamedSecurityInfo, 7,
  3556  		uintptr(unsafe.Pointer(pObjectName)),
  3557  		uintptr(objectType),
  3558  		uintptr(securityInfo),
  3559  		uintptr(psidOwner),
  3560  		uintptr(psidGroup),
  3561  		uintptr(unsafe.Pointer(pDacl)),
  3562  		uintptr(unsafe.Pointer(pSacl)),
  3563  		0,
  3564  		0)
  3565  	return DWORD(ret1)
  3566  }
  3567  
  3568  func SetPrivateObjectSecurity(securityInformation SECURITY_INFORMATION, modificationDescriptor PSECURITY_DESCRIPTOR, objectsSecurityDescriptor *PSECURITY_DESCRIPTOR, genericMapping *GENERIC_MAPPING, token HANDLE) bool {
  3569  	ret1 := syscall6(setPrivateObjectSecurity, 5,
  3570  		uintptr(securityInformation),
  3571  		uintptr(unsafe.Pointer(modificationDescriptor)),
  3572  		uintptr(unsafe.Pointer(objectsSecurityDescriptor)),
  3573  		uintptr(unsafe.Pointer(genericMapping)),
  3574  		uintptr(token),
  3575  		0)
  3576  	return ret1 != 0
  3577  }
  3578  
  3579  func SetPrivateObjectSecurityEx(securityInformation SECURITY_INFORMATION, modificationDescriptor PSECURITY_DESCRIPTOR, objectsSecurityDescriptor *PSECURITY_DESCRIPTOR, autoInheritFlags ULONG, genericMapping *GENERIC_MAPPING, token HANDLE) bool {
  3580  	ret1 := syscall6(setPrivateObjectSecurityEx, 6,
  3581  		uintptr(securityInformation),
  3582  		uintptr(unsafe.Pointer(modificationDescriptor)),
  3583  		uintptr(unsafe.Pointer(objectsSecurityDescriptor)),
  3584  		uintptr(autoInheritFlags),
  3585  		uintptr(unsafe.Pointer(genericMapping)),
  3586  		uintptr(token))
  3587  	return ret1 != 0
  3588  }
  3589  
  3590  func SetSecurityAccessMask(securityInformation SECURITY_INFORMATION, desiredAccess *uint32) {
  3591  	syscall3(setSecurityAccessMask, 2,
  3592  		uintptr(securityInformation),
  3593  		uintptr(unsafe.Pointer(desiredAccess)),
  3594  		0)
  3595  }
  3596  
  3597  func SetSecurityDescriptorControl(pSecurityDescriptor PSECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) bool {
  3598  	ret1 := syscall3(setSecurityDescriptorControl, 3,
  3599  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3600  		uintptr(controlBitsOfInterest),
  3601  		uintptr(controlBitsToSet))
  3602  	return ret1 != 0
  3603  }
  3604  
  3605  func SetSecurityDescriptorDacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, bDaclPresent bool, pDacl *ACL, bDaclDefaulted bool) bool {
  3606  	ret1 := syscall6(setSecurityDescriptorDacl, 4,
  3607  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3608  		getUintptrFromBool(bDaclPresent),
  3609  		uintptr(unsafe.Pointer(pDacl)),
  3610  		getUintptrFromBool(bDaclDefaulted),
  3611  		0,
  3612  		0)
  3613  	return ret1 != 0
  3614  }
  3615  
  3616  func SetSecurityDescriptorGroup(pSecurityDescriptor PSECURITY_DESCRIPTOR, pGroup PSID, bGroupDefaulted bool) bool {
  3617  	ret1 := syscall3(setSecurityDescriptorGroup, 3,
  3618  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3619  		uintptr(pGroup),
  3620  		getUintptrFromBool(bGroupDefaulted))
  3621  	return ret1 != 0
  3622  }
  3623  
  3624  func SetSecurityDescriptorOwner(pSecurityDescriptor PSECURITY_DESCRIPTOR, pOwner PSID, bOwnerDefaulted bool) bool {
  3625  	ret1 := syscall3(setSecurityDescriptorOwner, 3,
  3626  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3627  		uintptr(pOwner),
  3628  		getUintptrFromBool(bOwnerDefaulted))
  3629  	return ret1 != 0
  3630  }
  3631  
  3632  func SetSecurityDescriptorRMControl(securityDescriptor PSECURITY_DESCRIPTOR, rMControl PUCHAR) DWORD {
  3633  	ret1 := syscall3(setSecurityDescriptorRMControl, 2,
  3634  		uintptr(unsafe.Pointer(securityDescriptor)),
  3635  		uintptr(unsafe.Pointer(rMControl)),
  3636  		0)
  3637  	return DWORD(ret1)
  3638  }
  3639  
  3640  func SetSecurityDescriptorSacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, bSaclPresent bool, pSacl *ACL, bSaclDefaulted bool) bool {
  3641  	ret1 := syscall6(setSecurityDescriptorSacl, 4,
  3642  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3643  		getUintptrFromBool(bSaclPresent),
  3644  		uintptr(unsafe.Pointer(pSacl)),
  3645  		getUintptrFromBool(bSaclDefaulted),
  3646  		0,
  3647  		0)
  3648  	return ret1 != 0
  3649  }
  3650  
  3651  func SetSecurityInfo(handle HANDLE, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, psidOwner PSID, psidGroup PSID, pDacl *ACL, pSacl *ACL) DWORD {
  3652  	ret1 := syscall9(setSecurityInfo, 7,
  3653  		uintptr(handle),
  3654  		uintptr(objectType),
  3655  		uintptr(securityInfo),
  3656  		uintptr(psidOwner),
  3657  		uintptr(psidGroup),
  3658  		uintptr(unsafe.Pointer(pDacl)),
  3659  		uintptr(unsafe.Pointer(pSacl)),
  3660  		0,
  3661  		0)
  3662  	return DWORD(ret1)
  3663  }
  3664  
  3665  func SetServiceBits(hServiceStatus SERVICE_STATUS_HANDLE, dwServiceBits DWORD, bSetBitsOn bool, bUpdateImmediately bool) bool {
  3666  	ret1 := syscall6(setServiceBits, 4,
  3667  		uintptr(hServiceStatus),
  3668  		uintptr(dwServiceBits),
  3669  		getUintptrFromBool(bSetBitsOn),
  3670  		getUintptrFromBool(bUpdateImmediately),
  3671  		0,
  3672  		0)
  3673  	return ret1 != 0
  3674  }
  3675  
  3676  func SetServiceObjectSecurity(hService SC_HANDLE, dwSecurityInformation SECURITY_INFORMATION, lpSecurityDescriptor PSECURITY_DESCRIPTOR) bool {
  3677  	ret1 := syscall3(setServiceObjectSecurity, 3,
  3678  		uintptr(hService),
  3679  		uintptr(dwSecurityInformation),
  3680  		uintptr(unsafe.Pointer(lpSecurityDescriptor)))
  3681  	return ret1 != 0
  3682  }
  3683  
  3684  func SetServiceStatus(hServiceStatus SERVICE_STATUS_HANDLE, lpServiceStatus *SERVICE_STATUS) bool {
  3685  	ret1 := syscall3(setServiceStatus, 2,
  3686  		uintptr(hServiceStatus),
  3687  		uintptr(unsafe.Pointer(lpServiceStatus)),
  3688  		0)
  3689  	return ret1 != 0
  3690  }
  3691  
  3692  func SetThreadToken(thread *HANDLE, token HANDLE) bool {
  3693  	ret1 := syscall3(setThreadToken, 2,
  3694  		uintptr(unsafe.Pointer(thread)),
  3695  		uintptr(token),
  3696  		0)
  3697  	return ret1 != 0
  3698  }
  3699  
  3700  // TODO: Unknown type(s): TOKEN_INFORMATION_CLASS
  3701  // func SetTokenInformation(tokenHandle HANDLE, tokenInformationClass TOKEN_INFORMATION_CLASS, tokenInformation LPVOID, tokenInformationLength DWORD) bool
  3702  
  3703  func SetUserFileEncryptionKey(pEncryptionCertificate PENCRYPTION_CERTIFICATE) DWORD {
  3704  	ret1 := syscall3(setUserFileEncryptionKey, 1,
  3705  		uintptr(unsafe.Pointer(pEncryptionCertificate)),
  3706  		0,
  3707  		0)
  3708  	return DWORD(ret1)
  3709  }
  3710  
  3711  // TODO: Unknown type(s): CONST SERVICE_TABLE_ENTRYW *
  3712  // func StartServiceCtrlDispatcher(lpServiceStartTable /*const*/ CONST SERVICE_TABLE_ENTRYW *) bool
  3713  
  3714  func StartService(hService SC_HANDLE, dwNumServiceArgs DWORD, lpServiceArgVectors *LPCWSTR) bool {
  3715  	ret1 := syscall3(startService, 3,
  3716  		uintptr(hService),
  3717  		uintptr(dwNumServiceArgs),
  3718  		uintptr(unsafe.Pointer(lpServiceArgVectors)))
  3719  	return ret1 != 0
  3720  }
  3721  
  3722  // TODO: Unknown type(s): FN_PROGRESS, PROG_INVOKE_SETTING
  3723  // func TreeResetNamedSecurityInfo(pObjectName LPWSTR, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, pOwner PSID, pGroup PSID, pDacl *ACL, pSacl *ACL, keepExplicit bool, fnProgress FN_PROGRESS, progressInvokeSetting PROG_INVOKE_SETTING, args uintptr) DWORD
  3724  
  3725  // TODO: Unknown type(s): FN_PROGRESS, PROG_INVOKE_SETTING
  3726  // func TreeSetNamedSecurityInfo(pObjectName LPWSTR, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, pOwner PSID, pGroup PSID, pDacl *ACL, pSacl *ACL, dwAction DWORD, fnProgress FN_PROGRESS, progressInvokeSetting PROG_INVOKE_SETTING, args uintptr) DWORD
  3727  
  3728  func UninstallApplication(productCode *WCHAR, dwStatus DWORD) DWORD {
  3729  	ret1 := syscall3(uninstallApplication, 2,
  3730  		uintptr(unsafe.Pointer(productCode)),
  3731  		uintptr(dwStatus),
  3732  		0)
  3733  	return DWORD(ret1)
  3734  }
  3735  
  3736  func UnlockServiceDatabase(scLock SC_LOCK) bool {
  3737  	ret1 := syscall3(unlockServiceDatabase, 1,
  3738  		uintptr(scLock),
  3739  		0,
  3740  		0)
  3741  	return ret1 != 0
  3742  }
  3743  
  3744  func Wow64Win32ApiEntry(dwFuncNumber DWORD, dwFlag DWORD, dwRes DWORD) LONG {
  3745  	ret1 := syscall3(wow64Win32ApiEntry, 3,
  3746  		uintptr(dwFuncNumber),
  3747  		uintptr(dwFlag),
  3748  		uintptr(dwRes))
  3749  	return LONG(ret1)
  3750  }
  3751  
  3752  // TODO: Unknown type(s): PFE_IMPORT_FUNC
  3753  // func WriteEncryptedFileRaw(pfImportCallback PFE_IMPORT_FUNC, pvCallbackContext uintptr, pvContext uintptr) DWORD
  3754  
  3755  // TODO: Unknown type(s): PSHA_CTX
  3756  // func A_SHAFinal(context PSHA_CTX, result *uint32)
  3757  
  3758  // TODO: Unknown type(s): PSHA_CTX
  3759  // func A_SHAInit(context PSHA_CTX)
  3760  
  3761  // TODO: Unknown type(s): PSHA_CTX
  3762  // func A_SHAUpdate(context PSHA_CTX, buffer /*const*/ *byte, bufferSize UINT)
  3763  
  3764  // TODO: Unknown type(s): TRACEHANDLE
  3765  // func CloseTrace(handle TRACEHANDLE) ULONG
  3766  
  3767  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3768  // func ControlTrace(hSession TRACEHANDLE, sessionName string, properties PEVENT_TRACE_PROPERTIES, control ULONG) ULONG
  3769  
  3770  // TODO: Unknown type(s): TRACEHANDLE
  3771  // func EnableTrace(enable ULONG, flag ULONG, level ULONG, guid /*const*/ *GUID, hSession TRACEHANDLE) ULONG
  3772  
  3773  // TODO: Unknown type(s): PEVENT_FILTER_DESCRIPTOR, TRACEHANDLE
  3774  // func EnableTraceEx(provider /*const*/ *GUID, source /*const*/ *GUID, hSession TRACEHANDLE, enable ULONG, level UCHAR, anykeyword ULONGLONG, allkeyword ULONGLONG, enableprop ULONG, filterdesc PEVENT_FILTER_DESCRIPTOR) ULONG
  3775  
  3776  // TODO: Unknown type(s): PENABLE_TRACE_PARAMETERS, TRACEHANDLE
  3777  // func EnableTraceEx2(handle TRACEHANDLE, provider /*const*/ *GUID, control ULONG, level UCHAR, match_any ULONGLONG, match_all ULONGLONG, timeout ULONG, params PENABLE_TRACE_PARAMETERS) ULONG
  3778  
  3779  // TODO: Unknown type(s): PTRACE_GUID_PROPERTIES *
  3780  // func EnumerateTraceGuids(propertiesarray PTRACE_GUID_PROPERTIES *, arraycount ULONG, guidcount *uint32) ULONG
  3781  
  3782  func EventActivityIdControl(code ULONG, guid *GUID) ULONG {
  3783  	ret1 := syscall3(eventActivityIdControl, 2,
  3784  		uintptr(code),
  3785  		uintptr(unsafe.Pointer(guid)),
  3786  		0)
  3787  	return ULONG(ret1)
  3788  }
  3789  
  3790  // TODO: Unknown type(s): PCEVENT_DESCRIPTOR, REGHANDLE
  3791  // func EventEnabled(handle REGHANDLE, descriptor PCEVENT_DESCRIPTOR) BOOLEAN
  3792  
  3793  // TODO: Unknown type(s): REGHANDLE
  3794  // func EventProviderEnabled(handle REGHANDLE, level UCHAR, keyword ULONGLONG) BOOLEAN
  3795  
  3796  // TODO: Unknown type(s): PCEVENT_DESCRIPTOR, PEVENT_DATA_DESCRIPTOR, REGHANDLE
  3797  // func EventWrite(handle REGHANDLE, descriptor PCEVENT_DESCRIPTOR, count ULONG, data PEVENT_DATA_DESCRIPTOR) ULONG
  3798  
  3799  // TODO: Unknown type(s): PCEVENT_DESCRIPTOR, PEVENT_DATA_DESCRIPTOR, REGHANDLE
  3800  // func EventWriteTransfer(handle REGHANDLE, descriptor PCEVENT_DESCRIPTOR, activity /*const*/ *GUID, related /*const*/ *GUID, count ULONG, data PEVENT_DATA_DESCRIPTOR) ULONG
  3801  
  3802  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3803  // func FlushTrace(hSession TRACEHANDLE, sessionName string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3804  
  3805  // TODO: Unknown type(s): PACTRL_ACCESSW *, PACTRL_AUDITW *
  3806  // func GetNamedSecurityInfoEx(object string, aType SE_OBJECT_TYPE, info SECURITY_INFORMATION, provider string, property string, access_list PACTRL_ACCESSW *, audit_list PACTRL_AUDITW *, owner *LPWSTR, group *LPWSTR) DWORD
  3807  
  3808  // TODO: Unknown type(s): PACTRL_ACCESSW *, PACTRL_AUDITW *
  3809  // func GetSecurityInfoEx(hObject HANDLE, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, lpProvider string, lpProperty string, ppAccessList PACTRL_ACCESSW *, ppAuditList PACTRL_AUDITW *, lppOwner *LPWSTR, lppGroup *LPWSTR) DWORD
  3810  
  3811  // TODO: Unknown type(s): TRACEHANDLE
  3812  // func GetTraceEnableFlags(handle TRACEHANDLE) ULONG
  3813  
  3814  // TODO: Unknown type(s): TRACEHANDLE
  3815  // func GetTraceEnableLevel(handle TRACEHANDLE) UCHAR
  3816  
  3817  // TODO: Unknown type(s): TRACEHANDLE
  3818  // func GetTraceLoggerHandle(buf uintptr) TRACEHANDLE
  3819  
  3820  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING
  3821  // func LsaAddAccountRights(policy LSA_HANDLE, sid PSID, rights PLSA_UNICODE_STRING, count ULONG) NTSTATUS
  3822  
  3823  // TODO: Unknown type(s): IN LSA_HANDLE
  3824  // func LsaClose(objectHandle IN LSA_HANDLE) NTSTATUS
  3825  
  3826  // TODO: Unknown type(s): LSA_HANDLE, PLSA_HANDLE, PTRUSTED_DOMAIN_AUTH_INFORMATION, PTRUSTED_DOMAIN_INFORMATION_EX
  3827  // func LsaCreateTrustedDomainEx(policy LSA_HANDLE, domain_info PTRUSTED_DOMAIN_INFORMATION_EX, auth_info PTRUSTED_DOMAIN_AUTH_INFORMATION, access ACCESS_MASK, domain PLSA_HANDLE) NTSTATUS
  3828  
  3829  // TODO: Unknown type(s): LSA_HANDLE
  3830  // func LsaDeleteTrustedDomain(policy LSA_HANDLE, sid PSID) NTSTATUS
  3831  
  3832  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING *
  3833  // func LsaEnumerateAccountRights(policy LSA_HANDLE, sid PSID, rights PLSA_UNICODE_STRING *, count *uint32) NTSTATUS
  3834  
  3835  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING
  3836  // func LsaEnumerateAccountsWithUserRight(policy LSA_HANDLE, rights PLSA_UNICODE_STRING, buffer *PVOID, count *uint32) NTSTATUS
  3837  
  3838  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_ENUMERATION_HANDLE, IN ULONG, OUT PULONG, OUT PVOID *
  3839  // func LsaEnumerateTrustedDomains(policyHandle IN LSA_HANDLE, enumerationContext IN PLSA_ENUMERATION_HANDLE, buffer OUT PVOID *, preferredMaximumLength IN ULONG, countReturned OUT PULONG) NTSTATUS
  3840  
  3841  // TODO: Unknown type(s): LSA_HANDLE, PLSA_ENUMERATION_HANDLE
  3842  // func LsaEnumerateTrustedDomainsEx(policy LSA_HANDLE, context PLSA_ENUMERATION_HANDLE, buffer *PVOID, length ULONG, count *uint32) NTSTATUS
  3843  
  3844  // TODO: Unknown type(s): IN PVOID
  3845  // func LsaFreeMemory(buffer IN PVOID) NTSTATUS
  3846  
  3847  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING, IN ULONG, OUT PLSA_REFERENCED_DOMAIN_LIST *, OUT PLSA_TRANSLATED_SID *
  3848  // func LsaLookupNames(policyHandle IN LSA_HANDLE, count IN ULONG, names IN PLSA_UNICODE_STRING, referencedDomains OUT PLSA_REFERENCED_DOMAIN_LIST *, sids OUT PLSA_TRANSLATED_SID *) NTSTATUS
  3849  
  3850  // TODO: Unknown type(s): LSA_HANDLE, PLSA_REFERENCED_DOMAIN_LIST *, PLSA_TRANSLATED_SID2 *, PLSA_UNICODE_STRING
  3851  // func LsaLookupNames2(policy LSA_HANDLE, flags ULONG, count ULONG, names PLSA_UNICODE_STRING, domains PLSA_REFERENCED_DOMAIN_LIST *, sids PLSA_TRANSLATED_SID2 *) NTSTATUS
  3852  
  3853  // TODO: Unknown type(s): LSA_HANDLE, LSA_REFERENCED_DOMAIN_LIST * *, LSA_TRANSLATED_NAME * *
  3854  // func LsaLookupSids(policyHandle LSA_HANDLE, count ULONG, sids *PSID, referencedDomains LSA_REFERENCED_DOMAIN_LIST * *, names LSA_TRANSLATED_NAME * *) NTSTATUS
  3855  
  3856  func LsaNtStatusToWinError(status NTSTATUS) ULONG {
  3857  	ret1 := syscall3(lsaNtStatusToWinError, 1,
  3858  		uintptr(status),
  3859  		0,
  3860  		0)
  3861  	return ULONG(ret1)
  3862  }
  3863  
  3864  // TODO: Unknown type(s): IN ACCESS_MASK, IN OUT PLSA_HANDLE, IN PLSA_OBJECT_ATTRIBUTES, IN PLSA_UNICODE_STRING
  3865  // func LsaOpenPolicy(systemName IN PLSA_UNICODE_STRING, objectAttributes IN PLSA_OBJECT_ATTRIBUTES, desiredAccess IN ACCESS_MASK, policyHandle IN OUT PLSA_HANDLE) NTSTATUS
  3866  
  3867  // TODO: Unknown type(s): LSA_HANDLE, PLSA_HANDLE, PLSA_UNICODE_STRING
  3868  // func LsaOpenTrustedDomainByName(policy LSA_HANDLE, name PLSA_UNICODE_STRING, access ACCESS_MASK, handle PLSA_HANDLE) NTSTATUS
  3869  
  3870  // TODO: Unknown type(s): IN LSA_HANDLE, IN POLICY_INFORMATION_CLASS, OUT PVOID *
  3871  // func LsaQueryInformationPolicy(policyHandle IN LSA_HANDLE, informationClass IN POLICY_INFORMATION_CLASS, buffer OUT PVOID *) NTSTATUS
  3872  
  3873  // TODO: Unknown type(s): LSA_HANDLE, TRUSTED_INFORMATION_CLASS
  3874  // func LsaQueryTrustedDomainInfo(policy LSA_HANDLE, sid PSID, class TRUSTED_INFORMATION_CLASS, buffer *PVOID) NTSTATUS
  3875  
  3876  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING, TRUSTED_INFORMATION_CLASS
  3877  // func LsaQueryTrustedDomainInfoByName(policy LSA_HANDLE, name PLSA_UNICODE_STRING, class TRUSTED_INFORMATION_CLASS, buffer *PVOID) NTSTATUS
  3878  
  3879  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING
  3880  // func LsaRemoveAccountRights(policy LSA_HANDLE, sid PSID, all BOOLEAN, rights PLSA_UNICODE_STRING, count ULONG) NTSTATUS
  3881  
  3882  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING, OUT PLSA_UNICODE_STRING *
  3883  // func LsaRetrievePrivateData(policyHandle IN LSA_HANDLE, keyName IN PLSA_UNICODE_STRING, privateData OUT PLSA_UNICODE_STRING *) NTSTATUS
  3884  
  3885  // TODO: Unknown type(s): IN LSA_HANDLE, IN POLICY_INFORMATION_CLASS, IN PVOID
  3886  // func LsaSetInformationPolicy(policyHandle IN LSA_HANDLE, informationClass IN POLICY_INFORMATION_CLASS, buffer IN PVOID) NTSTATUS
  3887  
  3888  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING
  3889  // func LsaSetSecret(secretHandle IN LSA_HANDLE, encryptedCurrentValue IN PLSA_UNICODE_STRING, encryptedOldValue IN PLSA_UNICODE_STRING) NTSTATUS
  3890  
  3891  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING, TRUSTED_INFORMATION_CLASS
  3892  // func LsaSetTrustedDomainInfoByName(policy LSA_HANDLE, name PLSA_UNICODE_STRING, class TRUSTED_INFORMATION_CLASS, buffer uintptr) NTSTATUS
  3893  
  3894  // TODO: Unknown type(s): LSA_HANDLE, TRUSTED_INFORMATION_CLASS
  3895  // func LsaSetTrustedDomainInformation(policy LSA_HANDLE, sid PSID, class TRUSTED_INFORMATION_CLASS, buffer uintptr) NTSTATUS
  3896  
  3897  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING
  3898  // func LsaStorePrivateData(policyHandle IN LSA_HANDLE, keyName IN PLSA_UNICODE_STRING, privateData IN PLSA_UNICODE_STRING) NTSTATUS
  3899  
  3900  // TODO: Unknown type(s): MD4_CTX *
  3901  // func MD4Final(ctx MD4_CTX *)
  3902  
  3903  // TODO: Unknown type(s): MD4_CTX *
  3904  // func MD4Init(ctx MD4_CTX *)
  3905  
  3906  // TODO: Unknown type(s): MD4_CTX *
  3907  // func MD4Update(ctx MD4_CTX *, buf /*const*/ *byte, aLen uint32)
  3908  
  3909  // TODO: Unknown type(s): MD5_CTX *
  3910  // func MD5Final(ctx MD5_CTX *)
  3911  
  3912  // TODO: Unknown type(s): MD5_CTX *
  3913  // func MD5Init(ctx MD5_CTX *)
  3914  
  3915  // TODO: Unknown type(s): PEVENT_TRACE_LOGFILEW, TRACEHANDLE
  3916  // func OpenTrace(logfile PEVENT_TRACE_LOGFILEW) TRACEHANDLE
  3917  
  3918  // TODO: Unknown type(s): PTRACEHANDLE
  3919  // func ProcessTrace(handleArray PTRACEHANDLE, handleCount ULONG, startTime *FILETIME, endTime *FILETIME) ULONG
  3920  
  3921  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES *
  3922  // func QueryAllTraces(parray PEVENT_TRACE_PROPERTIES *, arraycount ULONG, psessioncount *uint32) ULONG
  3923  
  3924  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3925  // func QueryTrace(handle TRACEHANDLE, sessionname string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3926  
  3927  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, PTRACEHANDLE
  3928  // func StartTrace(pSessionHandle PTRACEHANDLE, sessionName string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3929  
  3930  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3931  // func StopTrace(session TRACEHANDLE, session_name string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3932  
  3933  func SystemFunction001(data /*const*/ *byte, key /*const*/ *byte, output *byte) NTSTATUS {
  3934  	ret1 := syscall3(systemFunction001, 3,
  3935  		uintptr(unsafe.Pointer(data)),
  3936  		uintptr(unsafe.Pointer(key)),
  3937  		uintptr(unsafe.Pointer(output)))
  3938  	return NTSTATUS(ret1)
  3939  }
  3940  
  3941  func SystemFunction002(data /*const*/ *byte, key /*const*/ *byte, output *byte) NTSTATUS {
  3942  	ret1 := syscall3(systemFunction002, 3,
  3943  		uintptr(unsafe.Pointer(data)),
  3944  		uintptr(unsafe.Pointer(key)),
  3945  		uintptr(unsafe.Pointer(output)))
  3946  	return NTSTATUS(ret1)
  3947  }
  3948  
  3949  func SystemFunction003(key /*const*/ *byte, output *byte) NTSTATUS {
  3950  	ret1 := syscall3(systemFunction003, 2,
  3951  		uintptr(unsafe.Pointer(key)),
  3952  		uintptr(unsafe.Pointer(output)),
  3953  		0)
  3954  	return NTSTATUS(ret1)
  3955  }
  3956  
  3957  // TODO: Unknown type(s): const struct ustring *, struct ustring *
  3958  // func SystemFunction004(in /*const*/ const struct ustring *, key /*const*/ const struct ustring *, out struct ustring *) NTSTATUS
  3959  
  3960  // TODO: Unknown type(s): const struct ustring *, struct ustring *
  3961  // func SystemFunction005(in /*const*/ const struct ustring *, key /*const*/ const struct ustring *, out struct ustring *) NTSTATUS
  3962  
  3963  func SystemFunction006(password /*const*/ LPCSTR, hash LPSTR) NTSTATUS {
  3964  	ret1 := syscall3(systemFunction006, 2,
  3965  		uintptr(unsafe.Pointer(password)),
  3966  		uintptr(unsafe.Pointer(hash)),
  3967  		0)
  3968  	return NTSTATUS(ret1)
  3969  }
  3970  
  3971  // TODO: Unknown type(s): const UNICODE_STRING *
  3972  // func SystemFunction007(string /*const*/ const UNICODE_STRING *, hash *byte) NTSTATUS
  3973  
  3974  func SystemFunction008(challenge /*const*/ *byte, hash /*const*/ *byte, response *byte) NTSTATUS {
  3975  	ret1 := syscall3(systemFunction008, 3,
  3976  		uintptr(unsafe.Pointer(challenge)),
  3977  		uintptr(unsafe.Pointer(hash)),
  3978  		uintptr(unsafe.Pointer(response)))
  3979  	return NTSTATUS(ret1)
  3980  }
  3981  
  3982  func SystemFunction009(challenge /*const*/ *byte, hash /*const*/ *byte, response *byte) NTSTATUS {
  3983  	ret1 := syscall3(systemFunction009, 3,
  3984  		uintptr(unsafe.Pointer(challenge)),
  3985  		uintptr(unsafe.Pointer(hash)),
  3986  		uintptr(unsafe.Pointer(response)))
  3987  	return NTSTATUS(ret1)
  3988  }
  3989  
  3990  func SystemFunction010(unknown LPVOID, data /*const*/ *byte, hash *byte) NTSTATUS {
  3991  	ret1 := syscall3(systemFunction010, 3,
  3992  		uintptr(unsafe.Pointer(unknown)),
  3993  		uintptr(unsafe.Pointer(data)),
  3994  		uintptr(unsafe.Pointer(hash)))
  3995  	return NTSTATUS(ret1)
  3996  }
  3997  
  3998  func SystemFunction012(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  3999  	ret1 := syscall3(systemFunction012, 3,
  4000  		uintptr(unsafe.Pointer(in)),
  4001  		uintptr(unsafe.Pointer(key)),
  4002  		uintptr(unsafe.Pointer(out)))
  4003  	return NTSTATUS(ret1)
  4004  }
  4005  
  4006  func SystemFunction013(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  4007  	ret1 := syscall3(systemFunction013, 3,
  4008  		uintptr(unsafe.Pointer(in)),
  4009  		uintptr(unsafe.Pointer(key)),
  4010  		uintptr(unsafe.Pointer(out)))
  4011  	return NTSTATUS(ret1)
  4012  }
  4013  
  4014  func SystemFunction024(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  4015  	ret1 := syscall3(systemFunction024, 3,
  4016  		uintptr(unsafe.Pointer(in)),
  4017  		uintptr(unsafe.Pointer(key)),
  4018  		uintptr(unsafe.Pointer(out)))
  4019  	return NTSTATUS(ret1)
  4020  }
  4021  
  4022  func SystemFunction025(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  4023  	ret1 := syscall3(systemFunction025, 3,
  4024  		uintptr(unsafe.Pointer(in)),
  4025  		uintptr(unsafe.Pointer(key)),
  4026  		uintptr(unsafe.Pointer(out)))
  4027  	return NTSTATUS(ret1)
  4028  }
  4029  
  4030  func SystemFunction030(b1 /*const*/ uintptr, b2 /*const*/ uintptr) bool {
  4031  	ret1 := syscall3(systemFunction030, 2,
  4032  		b1,
  4033  		b2,
  4034  		0)
  4035  	return ret1 != 0
  4036  }
  4037  
  4038  // TODO: Unknown type(s): const struct ustring *, struct ustring *
  4039  // func SystemFunction032(data struct ustring *, key /*const*/ const struct ustring *) NTSTATUS
  4040  
  4041  func SystemFunction035(lpszDllFilePath /*const*/ LPCSTR) bool {
  4042  	ret1 := syscall3(systemFunction035, 1,
  4043  		uintptr(unsafe.Pointer(lpszDllFilePath)),
  4044  		0,
  4045  		0)
  4046  	return ret1 != 0
  4047  }
  4048  
  4049  func SystemFunction036(pbBuffer uintptr, dwLen ULONG) BOOLEAN {
  4050  	ret1 := syscall3(systemFunction036, 2,
  4051  		pbBuffer,
  4052  		uintptr(dwLen),
  4053  		0)
  4054  	return BOOLEAN(ret1)
  4055  }
  4056  
  4057  func SystemFunction040(memory uintptr, length ULONG, flags ULONG) NTSTATUS {
  4058  	ret1 := syscall3(systemFunction040, 3,
  4059  		memory,
  4060  		uintptr(length),
  4061  		uintptr(flags))
  4062  	return NTSTATUS(ret1)
  4063  }
  4064  
  4065  func SystemFunction041(memory uintptr, length ULONG, flags ULONG) NTSTATUS {
  4066  	ret1 := syscall3(systemFunction041, 3,
  4067  		memory,
  4068  		uintptr(length),
  4069  		uintptr(flags))
  4070  	return NTSTATUS(ret1)
  4071  }
  4072  
  4073  // TODO: Unknown type(s): PEVENT_TRACE_HEADER, TRACEHANDLE
  4074  // func TraceEvent(sessionHandle TRACEHANDLE, eventTrace PEVENT_TRACE_HEADER) ULONG
  4075  
  4076  // TODO: Unknown type(s): TRACEHANDLE
  4077  // func UnregisterTraceGuids(registrationHandle TRACEHANDLE) ULONG
  4078  
  4079  // TODO: Unknown type(s): WMIHANDLE *
  4080  // func WmiOpenBlock(guid *GUID, access ULONG, handle WMIHANDLE *) ULONG