github.com/kbinani/win@v0.3.0/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  // TODO: Unknown type(s): TOKEN_TYPE
  1942  // func DuplicateTokenEx(hExistingToken HANDLE, dwDesiredAccess DWORD, lpTokenAttributes *SECURITY_ATTRIBUTES, impersonationLevel SECURITY_IMPERSONATION_LEVEL, tokenType TOKEN_TYPE, phNewToken *HANDLE) bool
  1943  
  1944  func EncryptFile(lpFileName string) bool {
  1945  	lpFileNameStr := unicode16FromString(lpFileName)
  1946  	ret1 := syscall3(encryptFile, 1,
  1947  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  1948  		0,
  1949  		0)
  1950  	return ret1 != 0
  1951  }
  1952  
  1953  func EncryptionDisable(dirPath string, disable bool) bool {
  1954  	dirPathStr := unicode16FromString(dirPath)
  1955  	ret1 := syscall3(encryptionDisable, 2,
  1956  		uintptr(unsafe.Pointer(&dirPathStr[0])),
  1957  		getUintptrFromBool(disable),
  1958  		0)
  1959  	return ret1 != 0
  1960  }
  1961  
  1962  // TODO: Unknown type(s): LPENUM_SERVICE_STATUSW
  1963  // func EnumDependentServices(hService SC_HANDLE, dwServiceState DWORD, lpServices LPENUM_SERVICE_STATUSW, cbBufSize DWORD, pcbBytesNeeded *uint32, lpServicesReturned *uint32) bool
  1964  
  1965  // TODO: Unknown type(s): SC_ENUM_TYPE
  1966  // 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
  1967  
  1968  // TODO: Unknown type(s): LPENUM_SERVICE_STATUSW
  1969  // func EnumServicesStatus(hSCManager SC_HANDLE, dwServiceType DWORD, dwServiceState DWORD, lpServices LPENUM_SERVICE_STATUSW, cbBufSize DWORD, pcbBytesNeeded *uint32, lpServicesReturned *uint32, lpResumeHandle *uint32) bool
  1970  
  1971  func EqualDomainSid(pSid1 PSID, pSid2 PSID, pfEqual *BOOL) bool {
  1972  	ret1 := syscall3(equalDomainSid, 3,
  1973  		uintptr(pSid1),
  1974  		uintptr(pSid2),
  1975  		uintptr(unsafe.Pointer(pfEqual)))
  1976  	return ret1 != 0
  1977  }
  1978  
  1979  func EqualPrefixSid(pSid1 PSID, pSid2 PSID) bool {
  1980  	ret1 := syscall3(equalPrefixSid, 2,
  1981  		uintptr(pSid1),
  1982  		uintptr(pSid2),
  1983  		0)
  1984  	return ret1 != 0
  1985  }
  1986  
  1987  func EqualSid(pSid1 PSID, pSid2 PSID) bool {
  1988  	ret1 := syscall3(equalSid, 2,
  1989  		uintptr(pSid1),
  1990  		uintptr(pSid2),
  1991  		0)
  1992  	return ret1 != 0
  1993  }
  1994  
  1995  func FileEncryptionStatus(lpFileName string, lpStatus *uint32) bool {
  1996  	lpFileNameStr := unicode16FromString(lpFileName)
  1997  	ret1 := syscall3(fileEncryptionStatus, 2,
  1998  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  1999  		uintptr(unsafe.Pointer(lpStatus)),
  2000  		0)
  2001  	return ret1 != 0
  2002  }
  2003  
  2004  func FindFirstFreeAce(pAcl *ACL, pAce *LPVOID) bool {
  2005  	ret1 := syscall3(findFirstFreeAce, 2,
  2006  		uintptr(unsafe.Pointer(pAcl)),
  2007  		uintptr(unsafe.Pointer(pAce)),
  2008  		0)
  2009  	return ret1 != 0
  2010  }
  2011  
  2012  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST
  2013  // func FreeEncryptionCertificateHashList(pHashes PENCRYPTION_CERTIFICATE_HASH_LIST)
  2014  
  2015  // TODO: Unknown type(s): PFN_OBJECT_MGR_FUNCTS, PINHERITED_FROMW
  2016  // func FreeInheritedFromArray(pInheritArray PINHERITED_FROMW, aceCnt USHORT, pfnArray PFN_OBJECT_MGR_FUNCTS) DWORD
  2017  
  2018  func FreeSid(pSid PSID) uintptr {
  2019  	ret1 := syscall3(freeSid, 1,
  2020  		uintptr(pSid),
  2021  		0,
  2022  		0)
  2023  	return (uintptr)(unsafe.Pointer(ret1))
  2024  }
  2025  
  2026  func GetAce(pAcl *ACL, dwAceIndex DWORD, pAce *LPVOID) bool {
  2027  	ret1 := syscall3(getAce, 3,
  2028  		uintptr(unsafe.Pointer(pAcl)),
  2029  		uintptr(dwAceIndex),
  2030  		uintptr(unsafe.Pointer(pAce)))
  2031  	return ret1 != 0
  2032  }
  2033  
  2034  // TODO: Unknown type(s): ACL_INFORMATION_CLASS
  2035  // func GetAclInformation(pAcl *ACL, pAclInformation LPVOID, nAclInformationLength DWORD, dwAclInformationClass ACL_INFORMATION_CLASS) bool
  2036  
  2037  // TODO: Unknown type(s): PACCESS_MASK
  2038  // func GetAuditedPermissionsFromAcl(pacl *ACL, pTrustee *TRUSTEE, pSuccessfulAuditedRights PACCESS_MASK, pFailedAuditRights PACCESS_MASK) DWORD
  2039  
  2040  // TODO: Unknown type(s): LPHW_PROFILE_INFOW
  2041  // func GetCurrentHwProfile(lpHwProfileInfo LPHW_PROFILE_INFOW) bool
  2042  
  2043  // TODO: Unknown type(s): PACCESS_MASK
  2044  // func GetEffectiveRightsFromAcl(pacl *ACL, pTrustee *TRUSTEE, pAccessRights PACCESS_MASK) DWORD
  2045  
  2046  func GetEventLogInformation(hEventLog HANDLE, dwInfoLevel DWORD, lpBuffer LPVOID, cbBufSize DWORD, pcbBytesNeeded *uint32) bool {
  2047  	ret1 := syscall6(getEventLogInformation, 5,
  2048  		uintptr(hEventLog),
  2049  		uintptr(dwInfoLevel),
  2050  		uintptr(unsafe.Pointer(lpBuffer)),
  2051  		uintptr(cbBufSize),
  2052  		uintptr(unsafe.Pointer(pcbBytesNeeded)),
  2053  		0)
  2054  	return ret1 != 0
  2055  }
  2056  
  2057  // TODO: Unknown type(s): PEXPLICIT_ACCESS_W *
  2058  // func GetExplicitEntriesFromAcl(pacl *ACL, pcCountOfExplicitEntries *uint32, pListOfExplicitEntries PEXPLICIT_ACCESS_W *) DWORD
  2059  
  2060  func GetFileSecurity(lpFileName string, requestedInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR, nLength DWORD, lpnLengthNeeded *uint32) bool {
  2061  	lpFileNameStr := unicode16FromString(lpFileName)
  2062  	ret1 := syscall6(getFileSecurity, 5,
  2063  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2064  		uintptr(requestedInformation),
  2065  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2066  		uintptr(nLength),
  2067  		uintptr(unsafe.Pointer(lpnLengthNeeded)),
  2068  		0)
  2069  	return ret1 != 0
  2070  }
  2071  
  2072  // TODO: Unknown type(s): PFN_OBJECT_MGR_FUNCTS, PINHERITED_FROMW
  2073  // 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
  2074  
  2075  func GetKernelObjectSecurity(handle HANDLE, requestedInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR, nLength DWORD, lpnLengthNeeded *uint32) bool {
  2076  	ret1 := syscall6(getKernelObjectSecurity, 5,
  2077  		uintptr(handle),
  2078  		uintptr(requestedInformation),
  2079  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2080  		uintptr(nLength),
  2081  		uintptr(unsafe.Pointer(lpnLengthNeeded)),
  2082  		0)
  2083  	return ret1 != 0
  2084  }
  2085  
  2086  func GetLengthSid(pSid PSID) DWORD {
  2087  	ret1 := syscall3(getLengthSid, 1,
  2088  		uintptr(pSid),
  2089  		0,
  2090  		0)
  2091  	return DWORD(ret1)
  2092  }
  2093  
  2094  func GetLocalManagedApplicationData(productCode *WCHAR, displayName *LPWSTR, supportUrl *LPWSTR) {
  2095  	syscall3(getLocalManagedApplicationData, 3,
  2096  		uintptr(unsafe.Pointer(productCode)),
  2097  		uintptr(unsafe.Pointer(displayName)),
  2098  		uintptr(unsafe.Pointer(supportUrl)))
  2099  }
  2100  
  2101  // TODO: Unknown type(s): PLOCALMANAGEDAPPLICATION *
  2102  // func GetLocalManagedApplications(bUserApps bool, pdwApps *uint32, prgLocalApps PLOCALMANAGEDAPPLICATION *) DWORD
  2103  
  2104  // TODO: Unknown type(s): APPCATEGORYINFOLIST *
  2105  // func GetManagedApplicationCategories(dwReserved DWORD, pAppCategory APPCATEGORYINFOLIST *) DWORD
  2106  
  2107  // TODO: Unknown type(s): PMANAGEDAPPLICATION *
  2108  // func GetManagedApplications(pCategory *GUID, dwQueryFlags DWORD, dwInfoLevel DWORD, pdwApps *uint32, prgManagedApps PMANAGEDAPPLICATION *) DWORD
  2109  
  2110  func GetMultipleTrusteeOperation(pTrustee *TRUSTEE) MULTIPLE_TRUSTEE_OPERATION {
  2111  	ret1 := syscall3(getMultipleTrusteeOperation, 1,
  2112  		uintptr(unsafe.Pointer(pTrustee)),
  2113  		0,
  2114  		0)
  2115  	return MULTIPLE_TRUSTEE_OPERATION(ret1)
  2116  }
  2117  
  2118  func GetMultipleTrustee(pTrustee *TRUSTEE) *TRUSTEE {
  2119  	ret1 := syscall3(getMultipleTrustee, 1,
  2120  		uintptr(unsafe.Pointer(pTrustee)),
  2121  		0,
  2122  		0)
  2123  	return (*TRUSTEE)(unsafe.Pointer(ret1))
  2124  }
  2125  
  2126  // TODO: Unknown type(s): PACL *
  2127  // func GetNamedSecurityInfo(pObjectName string, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, ppsidOwner *PSID, ppsidGroup *PSID, ppDacl PACL *, ppSacl PACL *, ppSecurityDescriptor *PSECURITY_DESCRIPTOR) DWORD
  2128  
  2129  func GetNumberOfEventLogRecords(hEventLog HANDLE, numberOfRecords *DWORD) bool {
  2130  	ret1 := syscall3(getNumberOfEventLogRecords, 2,
  2131  		uintptr(hEventLog),
  2132  		uintptr(unsafe.Pointer(numberOfRecords)),
  2133  		0)
  2134  	return ret1 != 0
  2135  }
  2136  
  2137  func GetOldestEventLogRecord(hEventLog HANDLE, oldestRecord *DWORD) bool {
  2138  	ret1 := syscall3(getOldestEventLogRecord, 2,
  2139  		uintptr(hEventLog),
  2140  		uintptr(unsafe.Pointer(oldestRecord)),
  2141  		0)
  2142  	return ret1 != 0
  2143  }
  2144  
  2145  func GetPrivateObjectSecurity(objectDescriptor PSECURITY_DESCRIPTOR, securityInformation SECURITY_INFORMATION, resultantDescriptor PSECURITY_DESCRIPTOR, descriptorLength DWORD, returnLength *DWORD) bool {
  2146  	ret1 := syscall6(getPrivateObjectSecurity, 5,
  2147  		uintptr(unsafe.Pointer(objectDescriptor)),
  2148  		uintptr(securityInformation),
  2149  		uintptr(unsafe.Pointer(resultantDescriptor)),
  2150  		uintptr(descriptorLength),
  2151  		uintptr(unsafe.Pointer(returnLength)),
  2152  		0)
  2153  	return ret1 != 0
  2154  }
  2155  
  2156  func GetSecurityDescriptorControl(pSecurityDescriptor PSECURITY_DESCRIPTOR, pControl *SECURITY_DESCRIPTOR_CONTROL, lpdwRevision *uint32) bool {
  2157  	ret1 := syscall3(getSecurityDescriptorControl, 3,
  2158  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2159  		uintptr(unsafe.Pointer(pControl)),
  2160  		uintptr(unsafe.Pointer(lpdwRevision)))
  2161  	return ret1 != 0
  2162  }
  2163  
  2164  // TODO: Unknown type(s): PACL *
  2165  // func GetSecurityDescriptorDacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, lpbDaclPresent *BOOL, pDacl PACL *, lpbDaclDefaulted *BOOL) bool
  2166  
  2167  func GetSecurityDescriptorGroup(pSecurityDescriptor PSECURITY_DESCRIPTOR, pGroup *PSID, lpbGroupDefaulted *BOOL) bool {
  2168  	ret1 := syscall3(getSecurityDescriptorGroup, 3,
  2169  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2170  		uintptr(unsafe.Pointer(pGroup)),
  2171  		uintptr(unsafe.Pointer(lpbGroupDefaulted)))
  2172  	return ret1 != 0
  2173  }
  2174  
  2175  func GetSecurityDescriptorLength(pSecurityDescriptor PSECURITY_DESCRIPTOR) DWORD {
  2176  	ret1 := syscall3(getSecurityDescriptorLength, 1,
  2177  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2178  		0,
  2179  		0)
  2180  	return DWORD(ret1)
  2181  }
  2182  
  2183  func GetSecurityDescriptorOwner(pSecurityDescriptor PSECURITY_DESCRIPTOR, pOwner *PSID, lpbOwnerDefaulted *BOOL) bool {
  2184  	ret1 := syscall3(getSecurityDescriptorOwner, 3,
  2185  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2186  		uintptr(unsafe.Pointer(pOwner)),
  2187  		uintptr(unsafe.Pointer(lpbOwnerDefaulted)))
  2188  	return ret1 != 0
  2189  }
  2190  
  2191  func GetSecurityDescriptorRMControl(securityDescriptor PSECURITY_DESCRIPTOR, rMControl PUCHAR) DWORD {
  2192  	ret1 := syscall3(getSecurityDescriptorRMControl, 2,
  2193  		uintptr(unsafe.Pointer(securityDescriptor)),
  2194  		uintptr(unsafe.Pointer(rMControl)),
  2195  		0)
  2196  	return DWORD(ret1)
  2197  }
  2198  
  2199  // TODO: Unknown type(s): PACL *
  2200  // func GetSecurityDescriptorSacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, lpbSaclPresent *BOOL, pSacl PACL *, lpbSaclDefaulted *BOOL) bool
  2201  
  2202  // TODO: Unknown type(s): PACL *
  2203  // func GetSecurityInfo(handle HANDLE, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, ppsidOwner *PSID, ppsidGroup *PSID, ppDacl PACL *, ppSacl PACL *, ppSecurityDescriptor *PSECURITY_DESCRIPTOR) DWORD
  2204  
  2205  func GetServiceDisplayName(hSCManager SC_HANDLE, lpServiceName string, lpDisplayName LPWSTR, lpcchBuffer *uint32) bool {
  2206  	lpServiceNameStr := unicode16FromString(lpServiceName)
  2207  	ret1 := syscall6(getServiceDisplayName, 4,
  2208  		uintptr(hSCManager),
  2209  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  2210  		uintptr(unsafe.Pointer(lpDisplayName)),
  2211  		uintptr(unsafe.Pointer(lpcchBuffer)),
  2212  		0,
  2213  		0)
  2214  	return ret1 != 0
  2215  }
  2216  
  2217  func GetServiceKeyName(hSCManager SC_HANDLE, lpDisplayName string, lpServiceName LPWSTR, lpcchBuffer *uint32) bool {
  2218  	lpDisplayNameStr := unicode16FromString(lpDisplayName)
  2219  	ret1 := syscall6(getServiceKeyName, 4,
  2220  		uintptr(hSCManager),
  2221  		uintptr(unsafe.Pointer(&lpDisplayNameStr[0])),
  2222  		uintptr(unsafe.Pointer(lpServiceName)),
  2223  		uintptr(unsafe.Pointer(lpcchBuffer)),
  2224  		0,
  2225  		0)
  2226  	return ret1 != 0
  2227  }
  2228  
  2229  func GetSidIdentifierAuthority(pSid PSID) *SID_IDENTIFIER_AUTHORITY {
  2230  	ret1 := syscall3(getSidIdentifierAuthority, 1,
  2231  		uintptr(pSid),
  2232  		0,
  2233  		0)
  2234  	return (*SID_IDENTIFIER_AUTHORITY)(unsafe.Pointer(ret1))
  2235  }
  2236  
  2237  func GetSidLengthRequired(nSubAuthorityCount UCHAR) DWORD {
  2238  	ret1 := syscall3(getSidLengthRequired, 1,
  2239  		uintptr(nSubAuthorityCount),
  2240  		0,
  2241  		0)
  2242  	return DWORD(ret1)
  2243  }
  2244  
  2245  func GetSidSubAuthority(pSid PSID, nSubAuthority DWORD) *DWORD {
  2246  	ret1 := syscall3(getSidSubAuthority, 2,
  2247  		uintptr(pSid),
  2248  		uintptr(nSubAuthority),
  2249  		0)
  2250  	return (*DWORD)(unsafe.Pointer(ret1))
  2251  }
  2252  
  2253  func GetSidSubAuthorityCount(pSid PSID) PUCHAR {
  2254  	ret1 := syscall3(getSidSubAuthorityCount, 1,
  2255  		uintptr(pSid),
  2256  		0,
  2257  		0)
  2258  	return (PUCHAR)(unsafe.Pointer(ret1))
  2259  }
  2260  
  2261  // TODO: Unknown type(s): PWAITCHAIN_NODE_INFO
  2262  // func GetThreadWaitChain(wctHandle HWCT, context *uint32, flags DWORD, threadId DWORD, nodeCount *uint32, nodeInfoArray PWAITCHAIN_NODE_INFO, isCycle *BOOL) bool
  2263  
  2264  // TODO: Unknown type(s): TOKEN_INFORMATION_CLASS
  2265  // func GetTokenInformation(tokenHandle HANDLE, tokenInformationClass TOKEN_INFORMATION_CLASS, tokenInformation LPVOID, tokenInformationLength DWORD, returnLength *DWORD) bool
  2266  
  2267  func GetTrusteeForm(pTrustee *TRUSTEE) TRUSTEE_FORM {
  2268  	ret1 := syscall3(getTrusteeForm, 1,
  2269  		uintptr(unsafe.Pointer(pTrustee)),
  2270  		0,
  2271  		0)
  2272  	return TRUSTEE_FORM(ret1)
  2273  }
  2274  
  2275  func GetTrusteeName(pTrustee *TRUSTEE) LPWSTR {
  2276  	ret1 := syscall3(getTrusteeName, 1,
  2277  		uintptr(unsafe.Pointer(pTrustee)),
  2278  		0,
  2279  		0)
  2280  	return (LPWSTR)(unsafe.Pointer(ret1))
  2281  }
  2282  
  2283  func GetTrusteeType(pTrustee *TRUSTEE) TRUSTEE_TYPE {
  2284  	ret1 := syscall3(getTrusteeType, 1,
  2285  		uintptr(unsafe.Pointer(pTrustee)),
  2286  		0,
  2287  		0)
  2288  	return TRUSTEE_TYPE(ret1)
  2289  }
  2290  
  2291  func GetUserName(lpBuffer LPWSTR, pcbBuffer *uint32) bool {
  2292  	ret1 := syscall3(getUserName, 2,
  2293  		uintptr(unsafe.Pointer(lpBuffer)),
  2294  		uintptr(unsafe.Pointer(pcbBuffer)),
  2295  		0)
  2296  	return ret1 != 0
  2297  }
  2298  
  2299  func GetWindowsAccountDomainSid(pSid PSID, pDomainSid PSID, cbDomainSid *uint32) bool {
  2300  	ret1 := syscall3(getWindowsAccountDomainSid, 3,
  2301  		uintptr(pSid),
  2302  		uintptr(pDomainSid),
  2303  		uintptr(unsafe.Pointer(cbDomainSid)))
  2304  	return ret1 != 0
  2305  }
  2306  
  2307  func ImpersonateAnonymousToken(threadHandle HANDLE) bool {
  2308  	ret1 := syscall3(impersonateAnonymousToken, 1,
  2309  		uintptr(threadHandle),
  2310  		0,
  2311  		0)
  2312  	return ret1 != 0
  2313  }
  2314  
  2315  func ImpersonateLoggedOnUser(hToken HANDLE) bool {
  2316  	ret1 := syscall3(impersonateLoggedOnUser, 1,
  2317  		uintptr(hToken),
  2318  		0,
  2319  		0)
  2320  	return ret1 != 0
  2321  }
  2322  
  2323  func ImpersonateNamedPipeClient(hNamedPipe HANDLE) bool {
  2324  	ret1 := syscall3(impersonateNamedPipeClient, 1,
  2325  		uintptr(hNamedPipe),
  2326  		0,
  2327  		0)
  2328  	return ret1 != 0
  2329  }
  2330  
  2331  func ImpersonateSelf(impersonationLevel SECURITY_IMPERSONATION_LEVEL) bool {
  2332  	ret1 := syscall3(impersonateSelf, 1,
  2333  		uintptr(impersonationLevel),
  2334  		0,
  2335  		0)
  2336  	return ret1 != 0
  2337  }
  2338  
  2339  func InitializeAcl(pAcl *ACL, nAclLength DWORD, dwAclRevision DWORD) bool {
  2340  	ret1 := syscall3(initializeAcl, 3,
  2341  		uintptr(unsafe.Pointer(pAcl)),
  2342  		uintptr(nAclLength),
  2343  		uintptr(dwAclRevision))
  2344  	return ret1 != 0
  2345  }
  2346  
  2347  func InitializeSecurityDescriptor(pSecurityDescriptor PSECURITY_DESCRIPTOR, dwRevision DWORD) bool {
  2348  	ret1 := syscall3(initializeSecurityDescriptor, 2,
  2349  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2350  		uintptr(dwRevision),
  2351  		0)
  2352  	return ret1 != 0
  2353  }
  2354  
  2355  func InitializeSid(sid PSID, pIdentifierAuthority *SID_IDENTIFIER_AUTHORITY, nSubAuthorityCount BYTE) bool {
  2356  	ret1 := syscall3(initializeSid, 3,
  2357  		uintptr(sid),
  2358  		uintptr(unsafe.Pointer(pIdentifierAuthority)),
  2359  		uintptr(nSubAuthorityCount))
  2360  	return ret1 != 0
  2361  }
  2362  
  2363  func InitiateShutdown(lpMachineName LPWSTR, lpMessage LPWSTR, dwGracePeriod DWORD, dwShutdownFlags DWORD, dwReason DWORD) DWORD {
  2364  	ret1 := syscall6(initiateShutdown, 5,
  2365  		uintptr(unsafe.Pointer(lpMachineName)),
  2366  		uintptr(unsafe.Pointer(lpMessage)),
  2367  		uintptr(dwGracePeriod),
  2368  		uintptr(dwShutdownFlags),
  2369  		uintptr(dwReason),
  2370  		0)
  2371  	return DWORD(ret1)
  2372  }
  2373  
  2374  func InitiateSystemShutdownEx(lpMachineName LPWSTR, lpMessage LPWSTR, dwTimeout DWORD, bForceAppsClosed bool, bRebootAfterShutdown bool, dwReason DWORD) bool {
  2375  	ret1 := syscall6(initiateSystemShutdownEx, 6,
  2376  		uintptr(unsafe.Pointer(lpMachineName)),
  2377  		uintptr(unsafe.Pointer(lpMessage)),
  2378  		uintptr(dwTimeout),
  2379  		getUintptrFromBool(bForceAppsClosed),
  2380  		getUintptrFromBool(bRebootAfterShutdown),
  2381  		uintptr(dwReason))
  2382  	return ret1 != 0
  2383  }
  2384  
  2385  func InitiateSystemShutdown(lpMachineName LPWSTR, lpMessage LPWSTR, dwTimeout DWORD, bForceAppsClosed bool, bRebootAfterShutdown bool) bool {
  2386  	ret1 := syscall6(initiateSystemShutdown, 5,
  2387  		uintptr(unsafe.Pointer(lpMachineName)),
  2388  		uintptr(unsafe.Pointer(lpMessage)),
  2389  		uintptr(dwTimeout),
  2390  		getUintptrFromBool(bForceAppsClosed),
  2391  		getUintptrFromBool(bRebootAfterShutdown),
  2392  		0)
  2393  	return ret1 != 0
  2394  }
  2395  
  2396  // TODO: Unknown type(s): PINSTALLDATA
  2397  // func InstallApplication(pInstallInfo PINSTALLDATA) DWORD
  2398  
  2399  func IsTextUnicode(lpv /*const*/ uintptr, iSize int32, lpiResult *int32) bool {
  2400  	ret1 := syscall3(isTextUnicode, 3,
  2401  		lpv,
  2402  		uintptr(iSize),
  2403  		uintptr(unsafe.Pointer(lpiResult)))
  2404  	return ret1 != 0
  2405  }
  2406  
  2407  func IsTokenRestricted(tokenHandle HANDLE) bool {
  2408  	ret1 := syscall3(isTokenRestricted, 1,
  2409  		uintptr(tokenHandle),
  2410  		0,
  2411  		0)
  2412  	return ret1 != 0
  2413  }
  2414  
  2415  func IsTokenUntrusted(tokenHandle HANDLE) bool {
  2416  	ret1 := syscall3(isTokenUntrusted, 1,
  2417  		uintptr(tokenHandle),
  2418  		0,
  2419  		0)
  2420  	return ret1 != 0
  2421  }
  2422  
  2423  func IsValidAcl(pAcl *ACL) bool {
  2424  	ret1 := syscall3(isValidAcl, 1,
  2425  		uintptr(unsafe.Pointer(pAcl)),
  2426  		0,
  2427  		0)
  2428  	return ret1 != 0
  2429  }
  2430  
  2431  func IsValidSecurityDescriptor(pSecurityDescriptor PSECURITY_DESCRIPTOR) bool {
  2432  	ret1 := syscall3(isValidSecurityDescriptor, 1,
  2433  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2434  		0,
  2435  		0)
  2436  	return ret1 != 0
  2437  }
  2438  
  2439  func IsValidSid(pSid PSID) bool {
  2440  	ret1 := syscall3(isValidSid, 1,
  2441  		uintptr(pSid),
  2442  		0,
  2443  		0)
  2444  	return ret1 != 0
  2445  }
  2446  
  2447  // TODO: Unknown type(s): WELL_KNOWN_SID_TYPE
  2448  // func IsWellKnownSid(pSid PSID, wellKnownSidType WELL_KNOWN_SID_TYPE) bool
  2449  
  2450  func LockServiceDatabase(hSCManager SC_HANDLE) SC_LOCK {
  2451  	ret1 := syscall3(lockServiceDatabase, 1,
  2452  		uintptr(hSCManager),
  2453  		0,
  2454  		0)
  2455  	return SC_LOCK(ret1)
  2456  }
  2457  
  2458  // TODO: Unknown type(s): PQUOTA_LIMITS
  2459  // func LogonUserEx(lpszUsername string, lpszDomain string, lpszPassword string, dwLogonType DWORD, dwLogonProvider DWORD, phToken *HANDLE, ppLogonSid *PSID, ppProfileBuffer *PVOID, pdwProfileLength *uint32, pQuotaLimits PQUOTA_LIMITS) bool
  2460  
  2461  func LogonUser(lpszUsername string, lpszDomain string, lpszPassword string, dwLogonType DWORD, dwLogonProvider DWORD, phToken *HANDLE) bool {
  2462  	lpszUsernameStr := unicode16FromString(lpszUsername)
  2463  	lpszDomainStr := unicode16FromString(lpszDomain)
  2464  	lpszPasswordStr := unicode16FromString(lpszPassword)
  2465  	ret1 := syscall6(logonUser, 6,
  2466  		uintptr(unsafe.Pointer(&lpszUsernameStr[0])),
  2467  		uintptr(unsafe.Pointer(&lpszDomainStr[0])),
  2468  		uintptr(unsafe.Pointer(&lpszPasswordStr[0])),
  2469  		uintptr(dwLogonType),
  2470  		uintptr(dwLogonProvider),
  2471  		uintptr(unsafe.Pointer(phToken)))
  2472  	return ret1 != 0
  2473  }
  2474  
  2475  // TODO: Unknown type(s): PSID_NAME_USE
  2476  // func LookupAccountName(lpSystemName string, lpAccountName string, sid PSID, cbSid *uint32, referencedDomainName LPWSTR, cchReferencedDomainName *uint32, peUse PSID_NAME_USE) bool
  2477  
  2478  // TODO: Unknown type(s): PSID_NAME_USE
  2479  // func LookupAccountSid(lpSystemName string, sid PSID, name LPWSTR, cchName *uint32, referencedDomainName LPWSTR, cchReferencedDomainName *uint32, peUse PSID_NAME_USE) bool
  2480  
  2481  func LookupPrivilegeDisplayName(lpSystemName string, lpName string, lpDisplayName LPWSTR, cchDisplayName *uint32, lpLanguageId *uint32) bool {
  2482  	lpSystemNameStr := unicode16FromString(lpSystemName)
  2483  	lpNameStr := unicode16FromString(lpName)
  2484  	ret1 := syscall6(lookupPrivilegeDisplayName, 5,
  2485  		uintptr(unsafe.Pointer(&lpSystemNameStr[0])),
  2486  		uintptr(unsafe.Pointer(&lpNameStr[0])),
  2487  		uintptr(unsafe.Pointer(lpDisplayName)),
  2488  		uintptr(unsafe.Pointer(cchDisplayName)),
  2489  		uintptr(unsafe.Pointer(lpLanguageId)),
  2490  		0)
  2491  	return ret1 != 0
  2492  }
  2493  
  2494  func LookupPrivilegeName(lpSystemName string, lpLuid *LUID, lpName LPWSTR, cchName *uint32) bool {
  2495  	lpSystemNameStr := unicode16FromString(lpSystemName)
  2496  	ret1 := syscall6(lookupPrivilegeName, 4,
  2497  		uintptr(unsafe.Pointer(&lpSystemNameStr[0])),
  2498  		uintptr(unsafe.Pointer(lpLuid)),
  2499  		uintptr(unsafe.Pointer(lpName)),
  2500  		uintptr(unsafe.Pointer(cchName)),
  2501  		0,
  2502  		0)
  2503  	return ret1 != 0
  2504  }
  2505  
  2506  func LookupPrivilegeValue(lpSystemName string, lpName string, lpLuid *LUID) bool {
  2507  	lpSystemNameStr := unicode16FromString(lpSystemName)
  2508  	lpNameStr := unicode16FromString(lpName)
  2509  	ret1 := syscall3(lookupPrivilegeValue, 3,
  2510  		uintptr(unsafe.Pointer(&lpSystemNameStr[0])),
  2511  		uintptr(unsafe.Pointer(&lpNameStr[0])),
  2512  		uintptr(unsafe.Pointer(lpLuid)))
  2513  	return ret1 != 0
  2514  }
  2515  
  2516  // TODO: Unknown type(s): PEXPLICIT_ACCESS_W *, PTRUSTEE_W *
  2517  // func LookupSecurityDescriptorParts(ppOwner PTRUSTEE_W *, ppGroup PTRUSTEE_W *, pcCountOfAccessEntries *uint32, ppListOfAccessEntries PEXPLICIT_ACCESS_W *, pcCountOfAuditEntries *uint32, ppListOfAuditEntries PEXPLICIT_ACCESS_W *, pSD PSECURITY_DESCRIPTOR) DWORD
  2518  
  2519  // TODO: Unknown type(s): PLM_OWF_PASSWORD, PNT_OWF_PASSWORD
  2520  // 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
  2521  
  2522  // TODO: Unknown type(s): PENCRYPTED_LM_OWF_PASSWORD, PENCRYPTED_NT_OWF_PASSWORD, PSAMPR_ENCRYPTED_USER_PASSWORD
  2523  // 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
  2524  
  2525  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 {
  2526  	ret1 := syscall12(makeAbsoluteSD, 11,
  2527  		uintptr(unsafe.Pointer(pSelfRelativeSecurityDescriptor)),
  2528  		uintptr(unsafe.Pointer(pAbsoluteSecurityDescriptor)),
  2529  		uintptr(unsafe.Pointer(lpdwAbsoluteSecurityDescriptorSize)),
  2530  		uintptr(unsafe.Pointer(pDacl)),
  2531  		uintptr(unsafe.Pointer(lpdwDaclSize)),
  2532  		uintptr(unsafe.Pointer(pSacl)),
  2533  		uintptr(unsafe.Pointer(lpdwSaclSize)),
  2534  		uintptr(pOwner),
  2535  		uintptr(unsafe.Pointer(lpdwOwnerSize)),
  2536  		uintptr(pPrimaryGroup),
  2537  		uintptr(unsafe.Pointer(lpdwPrimaryGroupSize)),
  2538  		0)
  2539  	return ret1 != 0
  2540  }
  2541  
  2542  func MakeSelfRelativeSD(pAbsoluteSecurityDescriptor PSECURITY_DESCRIPTOR, pSelfRelativeSecurityDescriptor PSECURITY_DESCRIPTOR, lpdwBufferLength *uint32) bool {
  2543  	ret1 := syscall3(makeSelfRelativeSD, 3,
  2544  		uintptr(unsafe.Pointer(pAbsoluteSecurityDescriptor)),
  2545  		uintptr(unsafe.Pointer(pSelfRelativeSecurityDescriptor)),
  2546  		uintptr(unsafe.Pointer(lpdwBufferLength)))
  2547  	return ret1 != 0
  2548  }
  2549  
  2550  func MapGenericMask(accessMask *DWORD, genericMapping *GENERIC_MAPPING) {
  2551  	syscall3(mapGenericMask, 2,
  2552  		uintptr(unsafe.Pointer(accessMask)),
  2553  		uintptr(unsafe.Pointer(genericMapping)),
  2554  		0)
  2555  }
  2556  
  2557  func NotifyBootConfigStatus(bootAcceptable bool) bool {
  2558  	ret1 := syscall3(notifyBootConfigStatus, 1,
  2559  		getUintptrFromBool(bootAcceptable),
  2560  		0,
  2561  		0)
  2562  	return ret1 != 0
  2563  }
  2564  
  2565  func NotifyChangeEventLog(hEventLog HANDLE, hEvent HANDLE) bool {
  2566  	ret1 := syscall3(notifyChangeEventLog, 2,
  2567  		uintptr(hEventLog),
  2568  		uintptr(hEvent),
  2569  		0)
  2570  	return ret1 != 0
  2571  }
  2572  
  2573  // TODO: Unknown type(s): PSERVICE_NOTIFYW
  2574  // func NotifyServiceStatusChange(hService SC_HANDLE, dwNotifyMask DWORD, pNotifyBuffer PSERVICE_NOTIFYW) DWORD
  2575  
  2576  func ObjectCloseAuditAlarm(subsystemName string, handleId LPVOID, generateOnClose bool) bool {
  2577  	subsystemNameStr := unicode16FromString(subsystemName)
  2578  	ret1 := syscall3(objectCloseAuditAlarm, 3,
  2579  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2580  		uintptr(unsafe.Pointer(handleId)),
  2581  		getUintptrFromBool(generateOnClose))
  2582  	return ret1 != 0
  2583  }
  2584  
  2585  func ObjectDeleteAuditAlarm(subsystemName string, handleId LPVOID, generateOnClose bool) bool {
  2586  	subsystemNameStr := unicode16FromString(subsystemName)
  2587  	ret1 := syscall3(objectDeleteAuditAlarm, 3,
  2588  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2589  		uintptr(unsafe.Pointer(handleId)),
  2590  		getUintptrFromBool(generateOnClose))
  2591  	return ret1 != 0
  2592  }
  2593  
  2594  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 {
  2595  	subsystemNameStr := unicode16FromString(subsystemName)
  2596  	ret1 := syscall12(objectOpenAuditAlarm, 12,
  2597  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2598  		uintptr(unsafe.Pointer(handleId)),
  2599  		uintptr(unsafe.Pointer(objectTypeName)),
  2600  		uintptr(unsafe.Pointer(objectName)),
  2601  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  2602  		uintptr(clientToken),
  2603  		uintptr(desiredAccess),
  2604  		uintptr(grantedAccess),
  2605  		uintptr(unsafe.Pointer(privileges)),
  2606  		getUintptrFromBool(objectCreation),
  2607  		getUintptrFromBool(accessGranted),
  2608  		uintptr(unsafe.Pointer(generateOnClose)))
  2609  	return ret1 != 0
  2610  }
  2611  
  2612  func ObjectPrivilegeAuditAlarm(subsystemName string, handleId LPVOID, clientToken HANDLE, desiredAccess DWORD, privileges *PRIVILEGE_SET, accessGranted bool) bool {
  2613  	subsystemNameStr := unicode16FromString(subsystemName)
  2614  	ret1 := syscall6(objectPrivilegeAuditAlarm, 6,
  2615  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2616  		uintptr(unsafe.Pointer(handleId)),
  2617  		uintptr(clientToken),
  2618  		uintptr(desiredAccess),
  2619  		uintptr(unsafe.Pointer(privileges)),
  2620  		getUintptrFromBool(accessGranted))
  2621  	return ret1 != 0
  2622  }
  2623  
  2624  func OpenBackupEventLog(lpUNCServerName string, lpFileName string) HANDLE {
  2625  	lpUNCServerNameStr := unicode16FromString(lpUNCServerName)
  2626  	lpFileNameStr := unicode16FromString(lpFileName)
  2627  	ret1 := syscall3(openBackupEventLog, 2,
  2628  		uintptr(unsafe.Pointer(&lpUNCServerNameStr[0])),
  2629  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2630  		0)
  2631  	return HANDLE(ret1)
  2632  }
  2633  
  2634  func OpenEncryptedFileRaw(lpFileName string, ulFlags ULONG, pvContext *PVOID) DWORD {
  2635  	lpFileNameStr := unicode16FromString(lpFileName)
  2636  	ret1 := syscall3(openEncryptedFileRaw, 3,
  2637  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  2638  		uintptr(ulFlags),
  2639  		uintptr(unsafe.Pointer(pvContext)))
  2640  	return DWORD(ret1)
  2641  }
  2642  
  2643  func OpenEventLog(lpUNCServerName string, lpSourceName string) HANDLE {
  2644  	lpUNCServerNameStr := unicode16FromString(lpUNCServerName)
  2645  	lpSourceNameStr := unicode16FromString(lpSourceName)
  2646  	ret1 := syscall3(openEventLog, 2,
  2647  		uintptr(unsafe.Pointer(&lpUNCServerNameStr[0])),
  2648  		uintptr(unsafe.Pointer(&lpSourceNameStr[0])),
  2649  		0)
  2650  	return HANDLE(ret1)
  2651  }
  2652  
  2653  func OpenProcessToken(processHandle HANDLE, desiredAccess DWORD, tokenHandle *HANDLE) bool {
  2654  	ret1 := syscall3(openProcessToken, 3,
  2655  		uintptr(processHandle),
  2656  		uintptr(desiredAccess),
  2657  		uintptr(unsafe.Pointer(tokenHandle)))
  2658  	return ret1 != 0
  2659  }
  2660  
  2661  func OpenSCManager(lpMachineName string, lpDatabaseName string, dwDesiredAccess DWORD) SC_HANDLE {
  2662  	lpMachineNameStr := unicode16FromString(lpMachineName)
  2663  	lpDatabaseNameStr := unicode16FromString(lpDatabaseName)
  2664  	ret1 := syscall3(openSCManager, 3,
  2665  		uintptr(unsafe.Pointer(&lpMachineNameStr[0])),
  2666  		uintptr(unsafe.Pointer(&lpDatabaseNameStr[0])),
  2667  		uintptr(dwDesiredAccess))
  2668  	return SC_HANDLE(ret1)
  2669  }
  2670  
  2671  func OpenService(hSCManager SC_HANDLE, lpServiceName string, dwDesiredAccess DWORD) SC_HANDLE {
  2672  	lpServiceNameStr := unicode16FromString(lpServiceName)
  2673  	ret1 := syscall3(openService, 3,
  2674  		uintptr(hSCManager),
  2675  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  2676  		uintptr(dwDesiredAccess))
  2677  	return SC_HANDLE(ret1)
  2678  }
  2679  
  2680  func OpenThreadToken(threadHandle HANDLE, desiredAccess DWORD, openAsSelf bool, tokenHandle *HANDLE) bool {
  2681  	ret1 := syscall6(openThreadToken, 4,
  2682  		uintptr(threadHandle),
  2683  		uintptr(desiredAccess),
  2684  		getUintptrFromBool(openAsSelf),
  2685  		uintptr(unsafe.Pointer(tokenHandle)),
  2686  		0,
  2687  		0)
  2688  	return ret1 != 0
  2689  }
  2690  
  2691  // TODO: Unknown type(s): PWAITCHAINCALLBACK
  2692  // func OpenThreadWaitChainSession(flags DWORD, callback PWAITCHAINCALLBACK) HWCT
  2693  
  2694  func PerfCreateInstance(hProvider HANDLE, counterSetGuid /*const*/ *GUID, szInstanceName string, dwInstance ULONG) *PERF_COUNTERSET_INSTANCE {
  2695  	szInstanceNameStr := unicode16FromString(szInstanceName)
  2696  	ret1 := syscall6(perfCreateInstance, 4,
  2697  		uintptr(hProvider),
  2698  		uintptr(unsafe.Pointer(counterSetGuid)),
  2699  		uintptr(unsafe.Pointer(&szInstanceNameStr[0])),
  2700  		uintptr(dwInstance),
  2701  		0,
  2702  		0)
  2703  	return (*PERF_COUNTERSET_INSTANCE)(unsafe.Pointer(ret1))
  2704  }
  2705  
  2706  func PerfDecrementULongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lValue ULONG) ULONG {
  2707  	ret1 := syscall6(perfDecrementULongCounterValue, 4,
  2708  		uintptr(hProvider),
  2709  		uintptr(unsafe.Pointer(pInstance)),
  2710  		uintptr(counterId),
  2711  		uintptr(lValue),
  2712  		0,
  2713  		0)
  2714  	return ULONG(ret1)
  2715  }
  2716  
  2717  func PerfDecrementULongLongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, llValue ULONGLONG) ULONG {
  2718  	ret1 := syscall6(perfDecrementULongLongCounterValue, 4,
  2719  		uintptr(hProvider),
  2720  		uintptr(unsafe.Pointer(pInstance)),
  2721  		uintptr(counterId),
  2722  		uintptr(llValue),
  2723  		0,
  2724  		0)
  2725  	return ULONG(ret1)
  2726  }
  2727  
  2728  func PerfDeleteInstance(hProvider HANDLE, instanceBlock *PERF_COUNTERSET_INSTANCE) ULONG {
  2729  	ret1 := syscall3(perfDeleteInstance, 2,
  2730  		uintptr(hProvider),
  2731  		uintptr(unsafe.Pointer(instanceBlock)),
  2732  		0)
  2733  	return ULONG(ret1)
  2734  }
  2735  
  2736  func PerfIncrementULongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lValue ULONG) ULONG {
  2737  	ret1 := syscall6(perfIncrementULongCounterValue, 4,
  2738  		uintptr(hProvider),
  2739  		uintptr(unsafe.Pointer(pInstance)),
  2740  		uintptr(counterId),
  2741  		uintptr(lValue),
  2742  		0,
  2743  		0)
  2744  	return ULONG(ret1)
  2745  }
  2746  
  2747  func PerfIncrementULongLongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, llValue ULONGLONG) ULONG {
  2748  	ret1 := syscall6(perfIncrementULongLongCounterValue, 4,
  2749  		uintptr(hProvider),
  2750  		uintptr(unsafe.Pointer(pInstance)),
  2751  		uintptr(counterId),
  2752  		uintptr(llValue),
  2753  		0,
  2754  		0)
  2755  	return ULONG(ret1)
  2756  }
  2757  
  2758  func PerfQueryInstance(hProvider HANDLE, counterSetGuid /*const*/ *GUID, szInstance string, dwInstance ULONG) *PERF_COUNTERSET_INSTANCE {
  2759  	szInstanceStr := unicode16FromString(szInstance)
  2760  	ret1 := syscall6(perfQueryInstance, 4,
  2761  		uintptr(hProvider),
  2762  		uintptr(unsafe.Pointer(counterSetGuid)),
  2763  		uintptr(unsafe.Pointer(&szInstanceStr[0])),
  2764  		uintptr(dwInstance),
  2765  		0,
  2766  		0)
  2767  	return (*PERF_COUNTERSET_INSTANCE)(unsafe.Pointer(ret1))
  2768  }
  2769  
  2770  func PerfSetCounterRefValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lpAddr uintptr) ULONG {
  2771  	ret1 := syscall6(perfSetCounterRefValue, 4,
  2772  		uintptr(hProvider),
  2773  		uintptr(unsafe.Pointer(pInstance)),
  2774  		uintptr(counterId),
  2775  		lpAddr,
  2776  		0,
  2777  		0)
  2778  	return ULONG(ret1)
  2779  }
  2780  
  2781  // TODO: Unknown type(s): PPERF_COUNTERSET_INFO
  2782  // func PerfSetCounterSetInfo(hProvider HANDLE, pTemplate PPERF_COUNTERSET_INFO, dwTemplateSize ULONG) ULONG
  2783  
  2784  func PerfSetULongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, lValue ULONG) ULONG {
  2785  	ret1 := syscall6(perfSetULongCounterValue, 4,
  2786  		uintptr(hProvider),
  2787  		uintptr(unsafe.Pointer(pInstance)),
  2788  		uintptr(counterId),
  2789  		uintptr(lValue),
  2790  		0,
  2791  		0)
  2792  	return ULONG(ret1)
  2793  }
  2794  
  2795  func PerfSetULongLongCounterValue(hProvider HANDLE, pInstance *PERF_COUNTERSET_INSTANCE, counterId ULONG, llValue ULONGLONG) ULONG {
  2796  	ret1 := syscall6(perfSetULongLongCounterValue, 4,
  2797  		uintptr(hProvider),
  2798  		uintptr(unsafe.Pointer(pInstance)),
  2799  		uintptr(counterId),
  2800  		uintptr(llValue),
  2801  		0,
  2802  		0)
  2803  	return ULONG(ret1)
  2804  }
  2805  
  2806  // TODO: Unknown type(s): PERFLIBREQUEST
  2807  // func PerfStartProvider(providerGuid *GUID, controlCallback PERFLIBREQUEST, phProvider *HANDLE) ULONG
  2808  
  2809  // TODO: Unknown type(s): PPERF_PROVIDER_CONTEXT
  2810  // func PerfStartProviderEx(providerGuid *GUID, providerContext PPERF_PROVIDER_CONTEXT, phProvider *HANDLE) ULONG
  2811  
  2812  func PerfStopProvider(hProvider HANDLE) ULONG {
  2813  	ret1 := syscall3(perfStopProvider, 1,
  2814  		uintptr(hProvider),
  2815  		0,
  2816  		0)
  2817  	return ULONG(ret1)
  2818  }
  2819  
  2820  func PrivilegeCheck(clientToken HANDLE, requiredPrivileges *PRIVILEGE_SET, pfResult *BOOL) bool {
  2821  	ret1 := syscall3(privilegeCheck, 3,
  2822  		uintptr(clientToken),
  2823  		uintptr(unsafe.Pointer(requiredPrivileges)),
  2824  		uintptr(unsafe.Pointer(pfResult)))
  2825  	return ret1 != 0
  2826  }
  2827  
  2828  func PrivilegedServiceAuditAlarm(subsystemName string, serviceName string, clientToken HANDLE, privileges *PRIVILEGE_SET, accessGranted bool) bool {
  2829  	subsystemNameStr := unicode16FromString(subsystemName)
  2830  	serviceNameStr := unicode16FromString(serviceName)
  2831  	ret1 := syscall6(privilegedServiceAuditAlarm, 5,
  2832  		uintptr(unsafe.Pointer(&subsystemNameStr[0])),
  2833  		uintptr(unsafe.Pointer(&serviceNameStr[0])),
  2834  		uintptr(clientToken),
  2835  		uintptr(unsafe.Pointer(privileges)),
  2836  		getUintptrFromBool(accessGranted),
  2837  		0)
  2838  	return ret1 != 0
  2839  }
  2840  
  2841  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST *
  2842  // func QueryRecoveryAgentsOnEncryptedFile(lpFileName string, pRecoveryAgents PENCRYPTION_CERTIFICATE_HASH_LIST *) DWORD
  2843  
  2844  func QuerySecurityAccessMask(securityInformation SECURITY_INFORMATION, desiredAccess *uint32) {
  2845  	syscall3(querySecurityAccessMask, 2,
  2846  		uintptr(securityInformation),
  2847  		uintptr(unsafe.Pointer(desiredAccess)),
  2848  		0)
  2849  }
  2850  
  2851  func QueryServiceConfig2(hService SC_HANDLE, dwInfoLevel DWORD, lpBuffer *byte, cbBufSize DWORD, pcbBytesNeeded *uint32) bool {
  2852  	ret1 := syscall6(queryServiceConfig2, 5,
  2853  		uintptr(hService),
  2854  		uintptr(dwInfoLevel),
  2855  		uintptr(unsafe.Pointer(lpBuffer)),
  2856  		uintptr(cbBufSize),
  2857  		uintptr(unsafe.Pointer(pcbBytesNeeded)),
  2858  		0)
  2859  	return ret1 != 0
  2860  }
  2861  
  2862  // TODO: Unknown type(s): LPQUERY_SERVICE_CONFIGW
  2863  // func QueryServiceConfig(hService SC_HANDLE, lpServiceConfig LPQUERY_SERVICE_CONFIGW, cbBufSize DWORD, pcbBytesNeeded *uint32) bool
  2864  
  2865  // TODO: Unknown type(s): LPQUERY_SERVICE_LOCK_STATUSW
  2866  // func QueryServiceLockStatus(hSCManager SC_HANDLE, lpLockStatus LPQUERY_SERVICE_LOCK_STATUSW, cbBufSize DWORD, pcbBytesNeeded *uint32) bool
  2867  
  2868  func QueryServiceObjectSecurity(hService SC_HANDLE, dwSecurityInformation SECURITY_INFORMATION, lpSecurityDescriptor PSECURITY_DESCRIPTOR, cbBufSize DWORD, pcbBytesNeeded *uint32) bool {
  2869  	ret1 := syscall6(queryServiceObjectSecurity, 5,
  2870  		uintptr(hService),
  2871  		uintptr(dwSecurityInformation),
  2872  		uintptr(unsafe.Pointer(lpSecurityDescriptor)),
  2873  		uintptr(cbBufSize),
  2874  		uintptr(unsafe.Pointer(pcbBytesNeeded)),
  2875  		0)
  2876  	return ret1 != 0
  2877  }
  2878  
  2879  func QueryServiceStatus(hService SC_HANDLE, lpServiceStatus *SERVICE_STATUS) bool {
  2880  	ret1 := syscall3(queryServiceStatus, 2,
  2881  		uintptr(hService),
  2882  		uintptr(unsafe.Pointer(lpServiceStatus)),
  2883  		0)
  2884  	return ret1 != 0
  2885  }
  2886  
  2887  // TODO: Unknown type(s): SC_STATUS_TYPE
  2888  // func QueryServiceStatusEx(hService SC_HANDLE, infoLevel SC_STATUS_TYPE, lpBuffer *byte, cbBufSize DWORD, pcbBytesNeeded *uint32) bool
  2889  
  2890  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST *
  2891  // func QueryUsersOnEncryptedFile(lpFileName string, pUsers PENCRYPTION_CERTIFICATE_HASH_LIST *) DWORD
  2892  
  2893  // TODO: Unknown type(s): PFE_EXPORT_FUNC
  2894  // func ReadEncryptedFileRaw(pfExportCallback PFE_EXPORT_FUNC, pvCallbackContext uintptr, pvContext uintptr) DWORD
  2895  
  2896  func ReadEventLog(hEventLog HANDLE, dwReadFlags DWORD, dwRecordOffset DWORD, lpBuffer LPVOID, nNumberOfBytesToRead DWORD, pnBytesRead *uint32, pnMinNumberOfBytesNeeded *uint32) bool {
  2897  	ret1 := syscall9(readEventLog, 7,
  2898  		uintptr(hEventLog),
  2899  		uintptr(dwReadFlags),
  2900  		uintptr(dwRecordOffset),
  2901  		uintptr(unsafe.Pointer(lpBuffer)),
  2902  		uintptr(nNumberOfBytesToRead),
  2903  		uintptr(unsafe.Pointer(pnBytesRead)),
  2904  		uintptr(unsafe.Pointer(pnMinNumberOfBytesNeeded)),
  2905  		0,
  2906  		0)
  2907  	return ret1 != 0
  2908  }
  2909  
  2910  func RegCloseKey(hKey HKEY) LONG {
  2911  	ret1 := syscall3(regCloseKey, 1,
  2912  		uintptr(hKey),
  2913  		0,
  2914  		0)
  2915  	return LONG(ret1)
  2916  }
  2917  
  2918  func RegConnectRegistryEx(lpMachineName string, hKey HKEY, flags ULONG, phkResult *HKEY) LONG {
  2919  	lpMachineNameStr := unicode16FromString(lpMachineName)
  2920  	ret1 := syscall6(regConnectRegistryEx, 4,
  2921  		uintptr(unsafe.Pointer(&lpMachineNameStr[0])),
  2922  		uintptr(hKey),
  2923  		uintptr(flags),
  2924  		uintptr(unsafe.Pointer(phkResult)),
  2925  		0,
  2926  		0)
  2927  	return LONG(ret1)
  2928  }
  2929  
  2930  func RegConnectRegistry(lpMachineName string, hKey HKEY, phkResult *HKEY) LONG {
  2931  	lpMachineNameStr := unicode16FromString(lpMachineName)
  2932  	ret1 := syscall3(regConnectRegistry, 3,
  2933  		uintptr(unsafe.Pointer(&lpMachineNameStr[0])),
  2934  		uintptr(hKey),
  2935  		uintptr(unsafe.Pointer(phkResult)))
  2936  	return LONG(ret1)
  2937  }
  2938  
  2939  func RegCopyTree(hKeySrc HKEY, lpSubKey string, hKeyDest HKEY) LONG {
  2940  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2941  	ret1 := syscall3(regCopyTree, 3,
  2942  		uintptr(hKeySrc),
  2943  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2944  		uintptr(hKeyDest))
  2945  	return LONG(ret1)
  2946  }
  2947  
  2948  func RegCreateKeyEx(hKey HKEY, lpSubKey string, reserved DWORD, lpClass LPWSTR, dwOptions DWORD, samDesired REGSAM, lpSecurityAttributes *SECURITY_ATTRIBUTES, phkResult *HKEY, lpdwDisposition *uint32) LONG {
  2949  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2950  	ret1 := syscall9(regCreateKeyEx, 9,
  2951  		uintptr(hKey),
  2952  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2953  		uintptr(reserved),
  2954  		uintptr(unsafe.Pointer(lpClass)),
  2955  		uintptr(dwOptions),
  2956  		uintptr(samDesired),
  2957  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  2958  		uintptr(unsafe.Pointer(phkResult)),
  2959  		uintptr(unsafe.Pointer(lpdwDisposition)))
  2960  	return LONG(ret1)
  2961  }
  2962  
  2963  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 {
  2964  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2965  	ret1 := syscall12(regCreateKeyTransacted, 11,
  2966  		uintptr(hKey),
  2967  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2968  		uintptr(reserved),
  2969  		uintptr(unsafe.Pointer(lpClass)),
  2970  		uintptr(dwOptions),
  2971  		uintptr(samDesired),
  2972  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  2973  		uintptr(unsafe.Pointer(phkResult)),
  2974  		uintptr(unsafe.Pointer(lpdwDisposition)),
  2975  		uintptr(hTransaction),
  2976  		pExtendedParemeter,
  2977  		0)
  2978  	return LONG(ret1)
  2979  }
  2980  
  2981  func RegCreateKey(hKey HKEY, lpSubKey string, phkResult *HKEY) LONG {
  2982  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2983  	ret1 := syscall3(regCreateKey, 3,
  2984  		uintptr(hKey),
  2985  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2986  		uintptr(unsafe.Pointer(phkResult)))
  2987  	return LONG(ret1)
  2988  }
  2989  
  2990  func RegDeleteKeyEx(hKey HKEY, lpSubKey string, samDesired REGSAM, reserved DWORD) LONG {
  2991  	lpSubKeyStr := unicode16FromString(lpSubKey)
  2992  	ret1 := syscall6(regDeleteKeyEx, 4,
  2993  		uintptr(hKey),
  2994  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  2995  		uintptr(samDesired),
  2996  		uintptr(reserved),
  2997  		0,
  2998  		0)
  2999  	return LONG(ret1)
  3000  }
  3001  
  3002  func RegDeleteKeyTransacted(hKey HKEY, lpSubKey string, samDesired REGSAM, reserved DWORD, hTransaction HANDLE, pExtendedParameter uintptr) LONG {
  3003  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3004  	ret1 := syscall6(regDeleteKeyTransacted, 6,
  3005  		uintptr(hKey),
  3006  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3007  		uintptr(samDesired),
  3008  		uintptr(reserved),
  3009  		uintptr(hTransaction),
  3010  		pExtendedParameter)
  3011  	return LONG(ret1)
  3012  }
  3013  
  3014  func RegDeleteKeyValue(hKey HKEY, lpSubKey string, lpValueName string) LONG {
  3015  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3016  	lpValueNameStr := unicode16FromString(lpValueName)
  3017  	ret1 := syscall3(regDeleteKeyValue, 3,
  3018  		uintptr(hKey),
  3019  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3020  		uintptr(unsafe.Pointer(&lpValueNameStr[0])))
  3021  	return LONG(ret1)
  3022  }
  3023  
  3024  func RegDeleteKey(hKey HKEY, lpSubKey string) LONG {
  3025  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3026  	ret1 := syscall3(regDeleteKey, 2,
  3027  		uintptr(hKey),
  3028  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3029  		0)
  3030  	return LONG(ret1)
  3031  }
  3032  
  3033  func RegDeleteTree(hKey HKEY, lpSubKey string) LONG {
  3034  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3035  	ret1 := syscall3(regDeleteTree, 2,
  3036  		uintptr(hKey),
  3037  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3038  		0)
  3039  	return LONG(ret1)
  3040  }
  3041  
  3042  func RegDeleteValue(hKey HKEY, lpValueName string) LONG {
  3043  	lpValueNameStr := unicode16FromString(lpValueName)
  3044  	ret1 := syscall3(regDeleteValue, 2,
  3045  		uintptr(hKey),
  3046  		uintptr(unsafe.Pointer(&lpValueNameStr[0])),
  3047  		0)
  3048  	return LONG(ret1)
  3049  }
  3050  
  3051  func RegDisablePredefinedCache() LONG {
  3052  	ret1 := syscall3(regDisablePredefinedCache, 0,
  3053  		0,
  3054  		0,
  3055  		0)
  3056  	return LONG(ret1)
  3057  }
  3058  
  3059  func RegDisablePredefinedCacheEx() LONG {
  3060  	ret1 := syscall3(regDisablePredefinedCacheEx, 0,
  3061  		0,
  3062  		0,
  3063  		0)
  3064  	return LONG(ret1)
  3065  }
  3066  
  3067  func RegDisableReflectionKey(hBase HKEY) LONG {
  3068  	ret1 := syscall3(regDisableReflectionKey, 1,
  3069  		uintptr(hBase),
  3070  		0,
  3071  		0)
  3072  	return LONG(ret1)
  3073  }
  3074  
  3075  func RegEnableReflectionKey(hBase HKEY) LONG {
  3076  	ret1 := syscall3(regEnableReflectionKey, 1,
  3077  		uintptr(hBase),
  3078  		0,
  3079  		0)
  3080  	return LONG(ret1)
  3081  }
  3082  
  3083  // TODO: Unknown type(s): PFILETIME
  3084  // func RegEnumKeyEx(hKey HKEY, dwIndex DWORD, lpName LPWSTR, lpcchName *uint32, lpReserved *uint32, lpClass LPWSTR, lpcchClass *uint32, lpftLastWriteTime PFILETIME) LONG
  3085  
  3086  func RegEnumKey(hKey HKEY, dwIndex DWORD, lpName LPWSTR, cchName DWORD) LONG {
  3087  	ret1 := syscall6(regEnumKey, 4,
  3088  		uintptr(hKey),
  3089  		uintptr(dwIndex),
  3090  		uintptr(unsafe.Pointer(lpName)),
  3091  		uintptr(cchName),
  3092  		0,
  3093  		0)
  3094  	return LONG(ret1)
  3095  }
  3096  
  3097  func RegEnumValue(hKey HKEY, dwIndex DWORD, lpValueName LPWSTR, lpcchValueName *uint32, lpReserved *uint32, lpType *uint32, lpData *byte, lpcbData *uint32) LONG {
  3098  	ret1 := syscall9(regEnumValue, 8,
  3099  		uintptr(hKey),
  3100  		uintptr(dwIndex),
  3101  		uintptr(unsafe.Pointer(lpValueName)),
  3102  		uintptr(unsafe.Pointer(lpcchValueName)),
  3103  		uintptr(unsafe.Pointer(lpReserved)),
  3104  		uintptr(unsafe.Pointer(lpType)),
  3105  		uintptr(unsafe.Pointer(lpData)),
  3106  		uintptr(unsafe.Pointer(lpcbData)),
  3107  		0)
  3108  	return LONG(ret1)
  3109  }
  3110  
  3111  func RegFlushKey(hKey HKEY) LONG {
  3112  	ret1 := syscall3(regFlushKey, 1,
  3113  		uintptr(hKey),
  3114  		0,
  3115  		0)
  3116  	return LONG(ret1)
  3117  }
  3118  
  3119  func RegGetKeySecurity(hKey HKEY, securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR, lpcbSecurityDescriptor *uint32) LONG {
  3120  	ret1 := syscall6(regGetKeySecurity, 4,
  3121  		uintptr(hKey),
  3122  		uintptr(securityInformation),
  3123  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3124  		uintptr(unsafe.Pointer(lpcbSecurityDescriptor)),
  3125  		0,
  3126  		0)
  3127  	return LONG(ret1)
  3128  }
  3129  
  3130  func RegGetValue(hkey HKEY, lpSubKey string, lpValue string, dwFlags DWORD, pdwType *uint32, pvData uintptr, pcbData *uint32) LONG {
  3131  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3132  	lpValueStr := unicode16FromString(lpValue)
  3133  	ret1 := syscall9(regGetValue, 7,
  3134  		uintptr(hkey),
  3135  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3136  		uintptr(unsafe.Pointer(&lpValueStr[0])),
  3137  		uintptr(dwFlags),
  3138  		uintptr(unsafe.Pointer(pdwType)),
  3139  		pvData,
  3140  		uintptr(unsafe.Pointer(pcbData)),
  3141  		0,
  3142  		0)
  3143  	return LONG(ret1)
  3144  }
  3145  
  3146  func RegLoadAppKey(lpFile string, phkResult *HKEY, samDesired REGSAM, dwOptions DWORD, reserved DWORD) LONG {
  3147  	lpFileStr := unicode16FromString(lpFile)
  3148  	ret1 := syscall6(regLoadAppKey, 5,
  3149  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3150  		uintptr(unsafe.Pointer(phkResult)),
  3151  		uintptr(samDesired),
  3152  		uintptr(dwOptions),
  3153  		uintptr(reserved),
  3154  		0)
  3155  	return LONG(ret1)
  3156  }
  3157  
  3158  func RegLoadKey(hKey HKEY, lpSubKey string, lpFile string) LONG {
  3159  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3160  	lpFileStr := unicode16FromString(lpFile)
  3161  	ret1 := syscall3(regLoadKey, 3,
  3162  		uintptr(hKey),
  3163  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3164  		uintptr(unsafe.Pointer(&lpFileStr[0])))
  3165  	return LONG(ret1)
  3166  }
  3167  
  3168  func RegLoadMUIString(hKey HKEY, pszValue string, pszOutBuf LPWSTR, cbOutBuf DWORD, pcbData *uint32, flags DWORD, pszDirectory string) LONG {
  3169  	pszValueStr := unicode16FromString(pszValue)
  3170  	pszDirectoryStr := unicode16FromString(pszDirectory)
  3171  	ret1 := syscall9(regLoadMUIString, 7,
  3172  		uintptr(hKey),
  3173  		uintptr(unsafe.Pointer(&pszValueStr[0])),
  3174  		uintptr(unsafe.Pointer(pszOutBuf)),
  3175  		uintptr(cbOutBuf),
  3176  		uintptr(unsafe.Pointer(pcbData)),
  3177  		uintptr(flags),
  3178  		uintptr(unsafe.Pointer(&pszDirectoryStr[0])),
  3179  		0,
  3180  		0)
  3181  	return LONG(ret1)
  3182  }
  3183  
  3184  func RegNotifyChangeKeyValue(hKey HKEY, bWatchSubtree bool, dwNotifyFilter DWORD, hEvent HANDLE, fAsynchronous bool) LONG {
  3185  	ret1 := syscall6(regNotifyChangeKeyValue, 5,
  3186  		uintptr(hKey),
  3187  		getUintptrFromBool(bWatchSubtree),
  3188  		uintptr(dwNotifyFilter),
  3189  		uintptr(hEvent),
  3190  		getUintptrFromBool(fAsynchronous),
  3191  		0)
  3192  	return LONG(ret1)
  3193  }
  3194  
  3195  func RegOpenCurrentUser(samDesired REGSAM, phkResult *HKEY) LONG {
  3196  	ret1 := syscall3(regOpenCurrentUser, 2,
  3197  		uintptr(samDesired),
  3198  		uintptr(unsafe.Pointer(phkResult)),
  3199  		0)
  3200  	return LONG(ret1)
  3201  }
  3202  
  3203  func RegOpenKeyEx(hKey HKEY, lpSubKey string, ulOptions DWORD, samDesired REGSAM, phkResult *HKEY) LONG {
  3204  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3205  	ret1 := syscall6(regOpenKeyEx, 5,
  3206  		uintptr(hKey),
  3207  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3208  		uintptr(ulOptions),
  3209  		uintptr(samDesired),
  3210  		uintptr(unsafe.Pointer(phkResult)),
  3211  		0)
  3212  	return LONG(ret1)
  3213  }
  3214  
  3215  func RegOpenKeyTransacted(hKey HKEY, lpSubKey string, ulOptions DWORD, samDesired REGSAM, phkResult *HKEY, hTransaction HANDLE, pExtendedParameter uintptr) LONG {
  3216  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3217  	ret1 := syscall9(regOpenKeyTransacted, 7,
  3218  		uintptr(hKey),
  3219  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3220  		uintptr(ulOptions),
  3221  		uintptr(samDesired),
  3222  		uintptr(unsafe.Pointer(phkResult)),
  3223  		uintptr(hTransaction),
  3224  		pExtendedParameter,
  3225  		0,
  3226  		0)
  3227  	return LONG(ret1)
  3228  }
  3229  
  3230  func RegOpenKey(hKey HKEY, lpSubKey string, phkResult *HKEY) LONG {
  3231  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3232  	ret1 := syscall3(regOpenKey, 3,
  3233  		uintptr(hKey),
  3234  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3235  		uintptr(unsafe.Pointer(phkResult)))
  3236  	return LONG(ret1)
  3237  }
  3238  
  3239  func RegOpenUserClassesRoot(hToken HANDLE, dwOptions DWORD, samDesired REGSAM, phkResult *HKEY) LONG {
  3240  	ret1 := syscall6(regOpenUserClassesRoot, 4,
  3241  		uintptr(hToken),
  3242  		uintptr(dwOptions),
  3243  		uintptr(samDesired),
  3244  		uintptr(unsafe.Pointer(phkResult)),
  3245  		0,
  3246  		0)
  3247  	return LONG(ret1)
  3248  }
  3249  
  3250  func RegOverridePredefKey(hKey HKEY, hNewHKey HKEY) LONG {
  3251  	ret1 := syscall3(regOverridePredefKey, 2,
  3252  		uintptr(hKey),
  3253  		uintptr(hNewHKey),
  3254  		0)
  3255  	return LONG(ret1)
  3256  }
  3257  
  3258  // TODO: Unknown type(s): PFILETIME
  3259  // 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
  3260  
  3261  // TODO: Unknown type(s): PVALENTW
  3262  // func RegQueryMultipleValues(hKey HKEY, val_list PVALENTW, num_vals DWORD, lpValueBuf LPWSTR, ldwTotsize *uint32) LONG
  3263  
  3264  func RegQueryReflectionKey(hBase HKEY, bIsReflectionDisabled *BOOL) LONG {
  3265  	ret1 := syscall3(regQueryReflectionKey, 2,
  3266  		uintptr(hBase),
  3267  		uintptr(unsafe.Pointer(bIsReflectionDisabled)),
  3268  		0)
  3269  	return LONG(ret1)
  3270  }
  3271  
  3272  func RegQueryValueEx(hKey HKEY, lpValueName string, lpReserved *uint32, lpType *uint32, lpData *byte, lpcbData *uint32) LONG {
  3273  	lpValueNameStr := unicode16FromString(lpValueName)
  3274  	ret1 := syscall6(regQueryValueEx, 6,
  3275  		uintptr(hKey),
  3276  		uintptr(unsafe.Pointer(&lpValueNameStr[0])),
  3277  		uintptr(unsafe.Pointer(lpReserved)),
  3278  		uintptr(unsafe.Pointer(lpType)),
  3279  		uintptr(unsafe.Pointer(lpData)),
  3280  		uintptr(unsafe.Pointer(lpcbData)))
  3281  	return LONG(ret1)
  3282  }
  3283  
  3284  func RegQueryValue(hKey HKEY, lpSubKey string, lpData LPWSTR, lpcbData *int32) LONG {
  3285  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3286  	ret1 := syscall6(regQueryValue, 4,
  3287  		uintptr(hKey),
  3288  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3289  		uintptr(unsafe.Pointer(lpData)),
  3290  		uintptr(unsafe.Pointer(lpcbData)),
  3291  		0,
  3292  		0)
  3293  	return LONG(ret1)
  3294  }
  3295  
  3296  func RegReplaceKey(hKey HKEY, lpSubKey string, lpNewFile string, lpOldFile string) LONG {
  3297  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3298  	lpNewFileStr := unicode16FromString(lpNewFile)
  3299  	lpOldFileStr := unicode16FromString(lpOldFile)
  3300  	ret1 := syscall6(regReplaceKey, 4,
  3301  		uintptr(hKey),
  3302  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3303  		uintptr(unsafe.Pointer(&lpNewFileStr[0])),
  3304  		uintptr(unsafe.Pointer(&lpOldFileStr[0])),
  3305  		0,
  3306  		0)
  3307  	return LONG(ret1)
  3308  }
  3309  
  3310  func RegRestoreKey(hKey HKEY, lpFile string, dwFlags DWORD) LONG {
  3311  	lpFileStr := unicode16FromString(lpFile)
  3312  	ret1 := syscall3(regRestoreKey, 3,
  3313  		uintptr(hKey),
  3314  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3315  		uintptr(dwFlags))
  3316  	return LONG(ret1)
  3317  }
  3318  
  3319  func RegSaveKeyEx(hKey HKEY, lpFile string, lpSecurityAttributes *SECURITY_ATTRIBUTES, flags DWORD) LONG {
  3320  	lpFileStr := unicode16FromString(lpFile)
  3321  	ret1 := syscall6(regSaveKeyEx, 4,
  3322  		uintptr(hKey),
  3323  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3324  		uintptr(unsafe.Pointer(lpSecurityAttributes)),
  3325  		uintptr(flags),
  3326  		0,
  3327  		0)
  3328  	return LONG(ret1)
  3329  }
  3330  
  3331  func RegSaveKey(hKey HKEY, lpFile string, lpSecurityAttributes *SECURITY_ATTRIBUTES) LONG {
  3332  	lpFileStr := unicode16FromString(lpFile)
  3333  	ret1 := syscall3(regSaveKey, 3,
  3334  		uintptr(hKey),
  3335  		uintptr(unsafe.Pointer(&lpFileStr[0])),
  3336  		uintptr(unsafe.Pointer(lpSecurityAttributes)))
  3337  	return LONG(ret1)
  3338  }
  3339  
  3340  func RegSetKeySecurity(hKey HKEY, securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR) LONG {
  3341  	ret1 := syscall3(regSetKeySecurity, 3,
  3342  		uintptr(hKey),
  3343  		uintptr(securityInformation),
  3344  		uintptr(unsafe.Pointer(pSecurityDescriptor)))
  3345  	return LONG(ret1)
  3346  }
  3347  
  3348  func RegSetKeyValue(hKey HKEY, lpSubKey /*const*/ LPCSTR, lpValueName /*const*/ LPCSTR, dwType DWORD, lpData /*const*/ uintptr, cbData DWORD) LONG {
  3349  	ret1 := syscall6(regSetKeyValue, 6,
  3350  		uintptr(hKey),
  3351  		uintptr(unsafe.Pointer(lpSubKey)),
  3352  		uintptr(unsafe.Pointer(lpValueName)),
  3353  		uintptr(dwType),
  3354  		lpData,
  3355  		uintptr(cbData))
  3356  	return LONG(ret1)
  3357  }
  3358  
  3359  func RegSetValueEx(hKey HKEY, lpValueName string, reserved DWORD, dwType DWORD, lpData /*const*/ *byte, cbData DWORD) LONG {
  3360  	lpValueNameStr := unicode16FromString(lpValueName)
  3361  	ret1 := syscall6(regSetValueEx, 6,
  3362  		uintptr(hKey),
  3363  		uintptr(unsafe.Pointer(&lpValueNameStr[0])),
  3364  		uintptr(reserved),
  3365  		uintptr(dwType),
  3366  		uintptr(unsafe.Pointer(lpData)),
  3367  		uintptr(cbData))
  3368  	return LONG(ret1)
  3369  }
  3370  
  3371  func RegSetValue(hKey HKEY, lpSubKey string, dwType DWORD, lpData string, cbData DWORD) LONG {
  3372  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3373  	lpDataStr := unicode16FromString(lpData)
  3374  	ret1 := syscall6(regSetValue, 5,
  3375  		uintptr(hKey),
  3376  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3377  		uintptr(dwType),
  3378  		uintptr(unsafe.Pointer(&lpDataStr[0])),
  3379  		uintptr(cbData),
  3380  		0)
  3381  	return LONG(ret1)
  3382  }
  3383  
  3384  func RegUnLoadKey(hKey HKEY, lpSubKey string) LONG {
  3385  	lpSubKeyStr := unicode16FromString(lpSubKey)
  3386  	ret1 := syscall3(regUnLoadKey, 2,
  3387  		uintptr(hKey),
  3388  		uintptr(unsafe.Pointer(&lpSubKeyStr[0])),
  3389  		0)
  3390  	return LONG(ret1)
  3391  }
  3392  
  3393  func RegisterEventSource(lpUNCServerName string, lpSourceName string) HANDLE {
  3394  	lpUNCServerNameStr := unicode16FromString(lpUNCServerName)
  3395  	lpSourceNameStr := unicode16FromString(lpSourceName)
  3396  	ret1 := syscall3(registerEventSource, 2,
  3397  		uintptr(unsafe.Pointer(&lpUNCServerNameStr[0])),
  3398  		uintptr(unsafe.Pointer(&lpSourceNameStr[0])),
  3399  		0)
  3400  	return HANDLE(ret1)
  3401  }
  3402  
  3403  func RegisterServiceCtrlHandlerEx(lpServiceName string, lpHandlerProc HANDLER_FUNCTION_EX, lpContext LPVOID) SERVICE_STATUS_HANDLE {
  3404  	lpServiceNameStr := unicode16FromString(lpServiceName)
  3405  	lpHandlerProcCallback := syscall.NewCallback(func(dwControlRawArg uint32, dwEventTypeRawArg uint32, lpEventDataRawArg uintptr, lpContextRawArg uintptr) uintptr {
  3406  		ret := lpHandlerProc(dwControlRawArg, dwEventTypeRawArg, lpEventDataRawArg, lpContextRawArg)
  3407  		return uintptr(ret)
  3408  	})
  3409  	ret1 := syscall3(registerServiceCtrlHandlerEx, 3,
  3410  		uintptr(unsafe.Pointer(&lpServiceNameStr[0])),
  3411  		lpHandlerProcCallback,
  3412  		uintptr(unsafe.Pointer(lpContext)))
  3413  	return SERVICE_STATUS_HANDLE(ret1)
  3414  }
  3415  
  3416  // TODO: Unknown type(s): LPHANDLER_FUNCTION
  3417  // func RegisterServiceCtrlHandler(lpServiceName string, lpHandlerProc LPHANDLER_FUNCTION) SERVICE_STATUS_HANDLE
  3418  
  3419  // TODO: Unknown type(s): PCOGETACTIVATIONSTATE, PCOGETCALLSTATE
  3420  // func RegisterWaitChainCOMCallback(callStateCallback PCOGETCALLSTATE, activationStateCallback PCOGETACTIVATIONSTATE)
  3421  
  3422  // TODO: Unknown type(s): PENCRYPTION_CERTIFICATE_HASH_LIST
  3423  // func RemoveUsersFromEncryptedFile(lpFileName string, pHashes PENCRYPTION_CERTIFICATE_HASH_LIST) DWORD
  3424  
  3425  func ReportEvent(hEventLog HANDLE, wType WORD, wCategory WORD, dwEventID DWORD, lpUserSid PSID, wNumStrings WORD, dwDataSize DWORD, lpStrings *LPCWSTR, lpRawData LPVOID) bool {
  3426  	ret1 := syscall9(reportEvent, 9,
  3427  		uintptr(hEventLog),
  3428  		uintptr(wType),
  3429  		uintptr(wCategory),
  3430  		uintptr(dwEventID),
  3431  		uintptr(lpUserSid),
  3432  		uintptr(wNumStrings),
  3433  		uintptr(dwDataSize),
  3434  		uintptr(unsafe.Pointer(lpStrings)),
  3435  		uintptr(unsafe.Pointer(lpRawData)))
  3436  	return ret1 != 0
  3437  }
  3438  
  3439  func RevertToSelf() bool {
  3440  	ret1 := syscall3(revertToSelf, 0,
  3441  		0,
  3442  		0,
  3443  		0)
  3444  	return ret1 != 0
  3445  }
  3446  
  3447  func SaferCloseLevel(hLevelHandle SAFER_LEVEL_HANDLE) bool {
  3448  	ret1 := syscall3(saferCloseLevel, 1,
  3449  		uintptr(hLevelHandle),
  3450  		0,
  3451  		0)
  3452  	return ret1 != 0
  3453  }
  3454  
  3455  func SaferComputeTokenFromLevel(levelHandle SAFER_LEVEL_HANDLE, inAccessToken HANDLE, outAccessToken *HANDLE, dwFlags DWORD, lpReserved LPVOID) bool {
  3456  	ret1 := syscall6(saferComputeTokenFromLevel, 5,
  3457  		uintptr(levelHandle),
  3458  		uintptr(inAccessToken),
  3459  		uintptr(unsafe.Pointer(outAccessToken)),
  3460  		uintptr(dwFlags),
  3461  		uintptr(unsafe.Pointer(lpReserved)),
  3462  		0)
  3463  	return ret1 != 0
  3464  }
  3465  
  3466  func SaferCreateLevel(dwScopeId DWORD, dwLevelId DWORD, openFlags DWORD, pLevelHandle *SAFER_LEVEL_HANDLE, lpReserved LPVOID) bool {
  3467  	ret1 := syscall6(saferCreateLevel, 5,
  3468  		uintptr(dwScopeId),
  3469  		uintptr(dwLevelId),
  3470  		uintptr(openFlags),
  3471  		uintptr(unsafe.Pointer(pLevelHandle)),
  3472  		uintptr(unsafe.Pointer(lpReserved)),
  3473  		0)
  3474  	return ret1 != 0
  3475  }
  3476  
  3477  // TODO: Unknown type(s): SAFER_OBJECT_INFO_CLASS
  3478  // func SaferGetLevelInformation(levelHandle SAFER_LEVEL_HANDLE, dwInfoType SAFER_OBJECT_INFO_CLASS, lpQueryBuffer LPVOID, dwInBufferSize DWORD, lpdwOutBufferSize *uint32) bool
  3479  
  3480  // TODO: Unknown type(s): SAFER_POLICY_INFO_CLASS
  3481  // func SaferGetPolicyInformation(dwScopeId DWORD, saferPolicyInfoClass SAFER_POLICY_INFO_CLASS, infoBufferSize DWORD, infoBuffer uintptr, infoBufferRetSize *DWORD, lpReserved LPVOID) bool
  3482  
  3483  // TODO: Unknown type(s): PSAFER_CODE_PROPERTIES
  3484  // func SaferIdentifyLevel(dwNumProperties DWORD, pCodeProperties PSAFER_CODE_PROPERTIES, pLevelHandle *SAFER_LEVEL_HANDLE, lpReserved LPVOID) bool
  3485  
  3486  func SaferRecordEventLogEntry(hLevel SAFER_LEVEL_HANDLE, szTargetPath string, lpReserved LPVOID) bool {
  3487  	szTargetPathStr := unicode16FromString(szTargetPath)
  3488  	ret1 := syscall3(saferRecordEventLogEntry, 3,
  3489  		uintptr(hLevel),
  3490  		uintptr(unsafe.Pointer(&szTargetPathStr[0])),
  3491  		uintptr(unsafe.Pointer(lpReserved)))
  3492  	return ret1 != 0
  3493  }
  3494  
  3495  // TODO: Unknown type(s): SAFER_OBJECT_INFO_CLASS
  3496  // func SaferSetLevelInformation(levelHandle SAFER_LEVEL_HANDLE, dwInfoType SAFER_OBJECT_INFO_CLASS, lpQueryBuffer LPVOID, dwInBufferSize DWORD) bool
  3497  
  3498  // TODO: Unknown type(s): SAFER_POLICY_INFO_CLASS
  3499  // func SaferSetPolicyInformation(dwScopeId DWORD, saferPolicyInfoClass SAFER_POLICY_INFO_CLASS, infoBufferSize DWORD, infoBuffer uintptr, lpReserved LPVOID) bool
  3500  
  3501  func SaferiIsExecutableFileType(szFullPathname string, bFromShellExecute BOOLEAN) bool {
  3502  	szFullPathnameStr := unicode16FromString(szFullPathname)
  3503  	ret1 := syscall3(saferiIsExecutableFileType, 2,
  3504  		uintptr(unsafe.Pointer(&szFullPathnameStr[0])),
  3505  		uintptr(bFromShellExecute),
  3506  		0)
  3507  	return ret1 != 0
  3508  }
  3509  
  3510  // TODO: Unknown type(s): ACL_INFORMATION_CLASS
  3511  // func SetAclInformation(pAcl *ACL, pAclInformation LPVOID, nAclInformationLength DWORD, dwAclInformationClass ACL_INFORMATION_CLASS) bool
  3512  
  3513  // TODO: Unknown type(s): PACL *
  3514  // func SetEntriesInAcl(cCountOfExplicitEntries ULONG, pListOfExplicitEntries *EXPLICIT_ACCESS, oldAcl *ACL, newAcl PACL *) DWORD
  3515  
  3516  func SetFileSecurity(lpFileName string, securityInformation SECURITY_INFORMATION, pSecurityDescriptor PSECURITY_DESCRIPTOR) bool {
  3517  	lpFileNameStr := unicode16FromString(lpFileName)
  3518  	ret1 := syscall3(setFileSecurity, 3,
  3519  		uintptr(unsafe.Pointer(&lpFileNameStr[0])),
  3520  		uintptr(securityInformation),
  3521  		uintptr(unsafe.Pointer(pSecurityDescriptor)))
  3522  	return ret1 != 0
  3523  }
  3524  
  3525  func SetKernelObjectSecurity(handle HANDLE, securityInformation SECURITY_INFORMATION, securityDescriptor PSECURITY_DESCRIPTOR) bool {
  3526  	ret1 := syscall3(setKernelObjectSecurity, 3,
  3527  		uintptr(handle),
  3528  		uintptr(securityInformation),
  3529  		uintptr(unsafe.Pointer(securityDescriptor)))
  3530  	return ret1 != 0
  3531  }
  3532  
  3533  func SetNamedSecurityInfo(pObjectName LPWSTR, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, psidOwner PSID, psidGroup PSID, pDacl *ACL, pSacl *ACL) DWORD {
  3534  	ret1 := syscall9(setNamedSecurityInfo, 7,
  3535  		uintptr(unsafe.Pointer(pObjectName)),
  3536  		uintptr(objectType),
  3537  		uintptr(securityInfo),
  3538  		uintptr(psidOwner),
  3539  		uintptr(psidGroup),
  3540  		uintptr(unsafe.Pointer(pDacl)),
  3541  		uintptr(unsafe.Pointer(pSacl)),
  3542  		0,
  3543  		0)
  3544  	return DWORD(ret1)
  3545  }
  3546  
  3547  func SetPrivateObjectSecurity(securityInformation SECURITY_INFORMATION, modificationDescriptor PSECURITY_DESCRIPTOR, objectsSecurityDescriptor *PSECURITY_DESCRIPTOR, genericMapping *GENERIC_MAPPING, token HANDLE) bool {
  3548  	ret1 := syscall6(setPrivateObjectSecurity, 5,
  3549  		uintptr(securityInformation),
  3550  		uintptr(unsafe.Pointer(modificationDescriptor)),
  3551  		uintptr(unsafe.Pointer(objectsSecurityDescriptor)),
  3552  		uintptr(unsafe.Pointer(genericMapping)),
  3553  		uintptr(token),
  3554  		0)
  3555  	return ret1 != 0
  3556  }
  3557  
  3558  func SetPrivateObjectSecurityEx(securityInformation SECURITY_INFORMATION, modificationDescriptor PSECURITY_DESCRIPTOR, objectsSecurityDescriptor *PSECURITY_DESCRIPTOR, autoInheritFlags ULONG, genericMapping *GENERIC_MAPPING, token HANDLE) bool {
  3559  	ret1 := syscall6(setPrivateObjectSecurityEx, 6,
  3560  		uintptr(securityInformation),
  3561  		uintptr(unsafe.Pointer(modificationDescriptor)),
  3562  		uintptr(unsafe.Pointer(objectsSecurityDescriptor)),
  3563  		uintptr(autoInheritFlags),
  3564  		uintptr(unsafe.Pointer(genericMapping)),
  3565  		uintptr(token))
  3566  	return ret1 != 0
  3567  }
  3568  
  3569  func SetSecurityAccessMask(securityInformation SECURITY_INFORMATION, desiredAccess *uint32) {
  3570  	syscall3(setSecurityAccessMask, 2,
  3571  		uintptr(securityInformation),
  3572  		uintptr(unsafe.Pointer(desiredAccess)),
  3573  		0)
  3574  }
  3575  
  3576  func SetSecurityDescriptorControl(pSecurityDescriptor PSECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) bool {
  3577  	ret1 := syscall3(setSecurityDescriptorControl, 3,
  3578  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3579  		uintptr(controlBitsOfInterest),
  3580  		uintptr(controlBitsToSet))
  3581  	return ret1 != 0
  3582  }
  3583  
  3584  func SetSecurityDescriptorDacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, bDaclPresent bool, pDacl *ACL, bDaclDefaulted bool) bool {
  3585  	ret1 := syscall6(setSecurityDescriptorDacl, 4,
  3586  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3587  		getUintptrFromBool(bDaclPresent),
  3588  		uintptr(unsafe.Pointer(pDacl)),
  3589  		getUintptrFromBool(bDaclDefaulted),
  3590  		0,
  3591  		0)
  3592  	return ret1 != 0
  3593  }
  3594  
  3595  func SetSecurityDescriptorGroup(pSecurityDescriptor PSECURITY_DESCRIPTOR, pGroup PSID, bGroupDefaulted bool) bool {
  3596  	ret1 := syscall3(setSecurityDescriptorGroup, 3,
  3597  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3598  		uintptr(pGroup),
  3599  		getUintptrFromBool(bGroupDefaulted))
  3600  	return ret1 != 0
  3601  }
  3602  
  3603  func SetSecurityDescriptorOwner(pSecurityDescriptor PSECURITY_DESCRIPTOR, pOwner PSID, bOwnerDefaulted bool) bool {
  3604  	ret1 := syscall3(setSecurityDescriptorOwner, 3,
  3605  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3606  		uintptr(pOwner),
  3607  		getUintptrFromBool(bOwnerDefaulted))
  3608  	return ret1 != 0
  3609  }
  3610  
  3611  func SetSecurityDescriptorRMControl(securityDescriptor PSECURITY_DESCRIPTOR, rMControl PUCHAR) DWORD {
  3612  	ret1 := syscall3(setSecurityDescriptorRMControl, 2,
  3613  		uintptr(unsafe.Pointer(securityDescriptor)),
  3614  		uintptr(unsafe.Pointer(rMControl)),
  3615  		0)
  3616  	return DWORD(ret1)
  3617  }
  3618  
  3619  func SetSecurityDescriptorSacl(pSecurityDescriptor PSECURITY_DESCRIPTOR, bSaclPresent bool, pSacl *ACL, bSaclDefaulted bool) bool {
  3620  	ret1 := syscall6(setSecurityDescriptorSacl, 4,
  3621  		uintptr(unsafe.Pointer(pSecurityDescriptor)),
  3622  		getUintptrFromBool(bSaclPresent),
  3623  		uintptr(unsafe.Pointer(pSacl)),
  3624  		getUintptrFromBool(bSaclDefaulted),
  3625  		0,
  3626  		0)
  3627  	return ret1 != 0
  3628  }
  3629  
  3630  func SetSecurityInfo(handle HANDLE, objectType SE_OBJECT_TYPE, securityInfo SECURITY_INFORMATION, psidOwner PSID, psidGroup PSID, pDacl *ACL, pSacl *ACL) DWORD {
  3631  	ret1 := syscall9(setSecurityInfo, 7,
  3632  		uintptr(handle),
  3633  		uintptr(objectType),
  3634  		uintptr(securityInfo),
  3635  		uintptr(psidOwner),
  3636  		uintptr(psidGroup),
  3637  		uintptr(unsafe.Pointer(pDacl)),
  3638  		uintptr(unsafe.Pointer(pSacl)),
  3639  		0,
  3640  		0)
  3641  	return DWORD(ret1)
  3642  }
  3643  
  3644  func SetServiceBits(hServiceStatus SERVICE_STATUS_HANDLE, dwServiceBits DWORD, bSetBitsOn bool, bUpdateImmediately bool) bool {
  3645  	ret1 := syscall6(setServiceBits, 4,
  3646  		uintptr(hServiceStatus),
  3647  		uintptr(dwServiceBits),
  3648  		getUintptrFromBool(bSetBitsOn),
  3649  		getUintptrFromBool(bUpdateImmediately),
  3650  		0,
  3651  		0)
  3652  	return ret1 != 0
  3653  }
  3654  
  3655  func SetServiceObjectSecurity(hService SC_HANDLE, dwSecurityInformation SECURITY_INFORMATION, lpSecurityDescriptor PSECURITY_DESCRIPTOR) bool {
  3656  	ret1 := syscall3(setServiceObjectSecurity, 3,
  3657  		uintptr(hService),
  3658  		uintptr(dwSecurityInformation),
  3659  		uintptr(unsafe.Pointer(lpSecurityDescriptor)))
  3660  	return ret1 != 0
  3661  }
  3662  
  3663  func SetServiceStatus(hServiceStatus SERVICE_STATUS_HANDLE, lpServiceStatus *SERVICE_STATUS) bool {
  3664  	ret1 := syscall3(setServiceStatus, 2,
  3665  		uintptr(hServiceStatus),
  3666  		uintptr(unsafe.Pointer(lpServiceStatus)),
  3667  		0)
  3668  	return ret1 != 0
  3669  }
  3670  
  3671  func SetThreadToken(thread *HANDLE, token HANDLE) bool {
  3672  	ret1 := syscall3(setThreadToken, 2,
  3673  		uintptr(unsafe.Pointer(thread)),
  3674  		uintptr(token),
  3675  		0)
  3676  	return ret1 != 0
  3677  }
  3678  
  3679  // TODO: Unknown type(s): TOKEN_INFORMATION_CLASS
  3680  // func SetTokenInformation(tokenHandle HANDLE, tokenInformationClass TOKEN_INFORMATION_CLASS, tokenInformation LPVOID, tokenInformationLength DWORD) bool
  3681  
  3682  func SetUserFileEncryptionKey(pEncryptionCertificate PENCRYPTION_CERTIFICATE) DWORD {
  3683  	ret1 := syscall3(setUserFileEncryptionKey, 1,
  3684  		uintptr(unsafe.Pointer(pEncryptionCertificate)),
  3685  		0,
  3686  		0)
  3687  	return DWORD(ret1)
  3688  }
  3689  
  3690  // TODO: Unknown type(s): CONST SERVICE_TABLE_ENTRYW *
  3691  // func StartServiceCtrlDispatcher(lpServiceStartTable /*const*/ CONST SERVICE_TABLE_ENTRYW *) bool
  3692  
  3693  func StartService(hService SC_HANDLE, dwNumServiceArgs DWORD, lpServiceArgVectors *LPCWSTR) bool {
  3694  	ret1 := syscall3(startService, 3,
  3695  		uintptr(hService),
  3696  		uintptr(dwNumServiceArgs),
  3697  		uintptr(unsafe.Pointer(lpServiceArgVectors)))
  3698  	return ret1 != 0
  3699  }
  3700  
  3701  // TODO: Unknown type(s): FN_PROGRESS, PROG_INVOKE_SETTING
  3702  // 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
  3703  
  3704  // TODO: Unknown type(s): FN_PROGRESS, PROG_INVOKE_SETTING
  3705  // 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
  3706  
  3707  func UninstallApplication(productCode *WCHAR, dwStatus DWORD) DWORD {
  3708  	ret1 := syscall3(uninstallApplication, 2,
  3709  		uintptr(unsafe.Pointer(productCode)),
  3710  		uintptr(dwStatus),
  3711  		0)
  3712  	return DWORD(ret1)
  3713  }
  3714  
  3715  func UnlockServiceDatabase(scLock SC_LOCK) bool {
  3716  	ret1 := syscall3(unlockServiceDatabase, 1,
  3717  		uintptr(scLock),
  3718  		0,
  3719  		0)
  3720  	return ret1 != 0
  3721  }
  3722  
  3723  func Wow64Win32ApiEntry(dwFuncNumber DWORD, dwFlag DWORD, dwRes DWORD) LONG {
  3724  	ret1 := syscall3(wow64Win32ApiEntry, 3,
  3725  		uintptr(dwFuncNumber),
  3726  		uintptr(dwFlag),
  3727  		uintptr(dwRes))
  3728  	return LONG(ret1)
  3729  }
  3730  
  3731  // TODO: Unknown type(s): PFE_IMPORT_FUNC
  3732  // func WriteEncryptedFileRaw(pfImportCallback PFE_IMPORT_FUNC, pvCallbackContext uintptr, pvContext uintptr) DWORD
  3733  
  3734  // TODO: Unknown type(s): PSHA_CTX
  3735  // func A_SHAFinal(context PSHA_CTX, result *uint32)
  3736  
  3737  // TODO: Unknown type(s): PSHA_CTX
  3738  // func A_SHAInit(context PSHA_CTX)
  3739  
  3740  // TODO: Unknown type(s): PSHA_CTX
  3741  // func A_SHAUpdate(context PSHA_CTX, buffer /*const*/ *byte, bufferSize UINT)
  3742  
  3743  // TODO: Unknown type(s): TRACEHANDLE
  3744  // func CloseTrace(handle TRACEHANDLE) ULONG
  3745  
  3746  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3747  // func ControlTrace(hSession TRACEHANDLE, sessionName string, properties PEVENT_TRACE_PROPERTIES, control ULONG) ULONG
  3748  
  3749  // TODO: Unknown type(s): TRACEHANDLE
  3750  // func EnableTrace(enable ULONG, flag ULONG, level ULONG, guid /*const*/ *GUID, hSession TRACEHANDLE) ULONG
  3751  
  3752  // TODO: Unknown type(s): PEVENT_FILTER_DESCRIPTOR, TRACEHANDLE
  3753  // 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
  3754  
  3755  // TODO: Unknown type(s): PENABLE_TRACE_PARAMETERS, TRACEHANDLE
  3756  // func EnableTraceEx2(handle TRACEHANDLE, provider /*const*/ *GUID, control ULONG, level UCHAR, match_any ULONGLONG, match_all ULONGLONG, timeout ULONG, params PENABLE_TRACE_PARAMETERS) ULONG
  3757  
  3758  // TODO: Unknown type(s): PTRACE_GUID_PROPERTIES *
  3759  // func EnumerateTraceGuids(propertiesarray PTRACE_GUID_PROPERTIES *, arraycount ULONG, guidcount *uint32) ULONG
  3760  
  3761  func EventActivityIdControl(code ULONG, guid *GUID) ULONG {
  3762  	ret1 := syscall3(eventActivityIdControl, 2,
  3763  		uintptr(code),
  3764  		uintptr(unsafe.Pointer(guid)),
  3765  		0)
  3766  	return ULONG(ret1)
  3767  }
  3768  
  3769  // TODO: Unknown type(s): PCEVENT_DESCRIPTOR, REGHANDLE
  3770  // func EventEnabled(handle REGHANDLE, descriptor PCEVENT_DESCRIPTOR) BOOLEAN
  3771  
  3772  // TODO: Unknown type(s): REGHANDLE
  3773  // func EventProviderEnabled(handle REGHANDLE, level UCHAR, keyword ULONGLONG) BOOLEAN
  3774  
  3775  // TODO: Unknown type(s): PCEVENT_DESCRIPTOR, PEVENT_DATA_DESCRIPTOR, REGHANDLE
  3776  // func EventWrite(handle REGHANDLE, descriptor PCEVENT_DESCRIPTOR, count ULONG, data PEVENT_DATA_DESCRIPTOR) ULONG
  3777  
  3778  // TODO: Unknown type(s): PCEVENT_DESCRIPTOR, PEVENT_DATA_DESCRIPTOR, REGHANDLE
  3779  // func EventWriteTransfer(handle REGHANDLE, descriptor PCEVENT_DESCRIPTOR, activity /*const*/ *GUID, related /*const*/ *GUID, count ULONG, data PEVENT_DATA_DESCRIPTOR) ULONG
  3780  
  3781  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3782  // func FlushTrace(hSession TRACEHANDLE, sessionName string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3783  
  3784  // TODO: Unknown type(s): PACTRL_ACCESSW *, PACTRL_AUDITW *
  3785  // 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
  3786  
  3787  // TODO: Unknown type(s): PACTRL_ACCESSW *, PACTRL_AUDITW *
  3788  // 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
  3789  
  3790  // TODO: Unknown type(s): TRACEHANDLE
  3791  // func GetTraceEnableFlags(handle TRACEHANDLE) ULONG
  3792  
  3793  // TODO: Unknown type(s): TRACEHANDLE
  3794  // func GetTraceEnableLevel(handle TRACEHANDLE) UCHAR
  3795  
  3796  // TODO: Unknown type(s): TRACEHANDLE
  3797  // func GetTraceLoggerHandle(buf uintptr) TRACEHANDLE
  3798  
  3799  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING
  3800  // func LsaAddAccountRights(policy LSA_HANDLE, sid PSID, rights PLSA_UNICODE_STRING, count ULONG) NTSTATUS
  3801  
  3802  // TODO: Unknown type(s): IN LSA_HANDLE
  3803  // func LsaClose(objectHandle IN LSA_HANDLE) NTSTATUS
  3804  
  3805  // TODO: Unknown type(s): LSA_HANDLE, PLSA_HANDLE, PTRUSTED_DOMAIN_AUTH_INFORMATION, PTRUSTED_DOMAIN_INFORMATION_EX
  3806  // func LsaCreateTrustedDomainEx(policy LSA_HANDLE, domain_info PTRUSTED_DOMAIN_INFORMATION_EX, auth_info PTRUSTED_DOMAIN_AUTH_INFORMATION, access ACCESS_MASK, domain PLSA_HANDLE) NTSTATUS
  3807  
  3808  // TODO: Unknown type(s): LSA_HANDLE
  3809  // func LsaDeleteTrustedDomain(policy LSA_HANDLE, sid PSID) NTSTATUS
  3810  
  3811  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING *
  3812  // func LsaEnumerateAccountRights(policy LSA_HANDLE, sid PSID, rights PLSA_UNICODE_STRING *, count *uint32) NTSTATUS
  3813  
  3814  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING
  3815  // func LsaEnumerateAccountsWithUserRight(policy LSA_HANDLE, rights PLSA_UNICODE_STRING, buffer *PVOID, count *uint32) NTSTATUS
  3816  
  3817  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_ENUMERATION_HANDLE, IN ULONG, OUT PULONG, OUT PVOID *
  3818  // func LsaEnumerateTrustedDomains(policyHandle IN LSA_HANDLE, enumerationContext IN PLSA_ENUMERATION_HANDLE, buffer OUT PVOID *, preferredMaximumLength IN ULONG, countReturned OUT PULONG) NTSTATUS
  3819  
  3820  // TODO: Unknown type(s): LSA_HANDLE, PLSA_ENUMERATION_HANDLE
  3821  // func LsaEnumerateTrustedDomainsEx(policy LSA_HANDLE, context PLSA_ENUMERATION_HANDLE, buffer *PVOID, length ULONG, count *uint32) NTSTATUS
  3822  
  3823  // TODO: Unknown type(s): IN PVOID
  3824  // func LsaFreeMemory(buffer IN PVOID) NTSTATUS
  3825  
  3826  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING, IN ULONG, OUT PLSA_REFERENCED_DOMAIN_LIST *, OUT PLSA_TRANSLATED_SID *
  3827  // 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
  3828  
  3829  // TODO: Unknown type(s): LSA_HANDLE, PLSA_REFERENCED_DOMAIN_LIST *, PLSA_TRANSLATED_SID2 *, PLSA_UNICODE_STRING
  3830  // func LsaLookupNames2(policy LSA_HANDLE, flags ULONG, count ULONG, names PLSA_UNICODE_STRING, domains PLSA_REFERENCED_DOMAIN_LIST *, sids PLSA_TRANSLATED_SID2 *) NTSTATUS
  3831  
  3832  // TODO: Unknown type(s): LSA_HANDLE, LSA_REFERENCED_DOMAIN_LIST * *, LSA_TRANSLATED_NAME * *
  3833  // func LsaLookupSids(policyHandle LSA_HANDLE, count ULONG, sids *PSID, referencedDomains LSA_REFERENCED_DOMAIN_LIST * *, names LSA_TRANSLATED_NAME * *) NTSTATUS
  3834  
  3835  func LsaNtStatusToWinError(status NTSTATUS) ULONG {
  3836  	ret1 := syscall3(lsaNtStatusToWinError, 1,
  3837  		uintptr(status),
  3838  		0,
  3839  		0)
  3840  	return ULONG(ret1)
  3841  }
  3842  
  3843  // TODO: Unknown type(s): IN ACCESS_MASK, IN OUT PLSA_HANDLE, IN PLSA_OBJECT_ATTRIBUTES, IN PLSA_UNICODE_STRING
  3844  // func LsaOpenPolicy(systemName IN PLSA_UNICODE_STRING, objectAttributes IN PLSA_OBJECT_ATTRIBUTES, desiredAccess IN ACCESS_MASK, policyHandle IN OUT PLSA_HANDLE) NTSTATUS
  3845  
  3846  // TODO: Unknown type(s): LSA_HANDLE, PLSA_HANDLE, PLSA_UNICODE_STRING
  3847  // func LsaOpenTrustedDomainByName(policy LSA_HANDLE, name PLSA_UNICODE_STRING, access ACCESS_MASK, handle PLSA_HANDLE) NTSTATUS
  3848  
  3849  // TODO: Unknown type(s): IN LSA_HANDLE, IN POLICY_INFORMATION_CLASS, OUT PVOID *
  3850  // func LsaQueryInformationPolicy(policyHandle IN LSA_HANDLE, informationClass IN POLICY_INFORMATION_CLASS, buffer OUT PVOID *) NTSTATUS
  3851  
  3852  // TODO: Unknown type(s): LSA_HANDLE, TRUSTED_INFORMATION_CLASS
  3853  // func LsaQueryTrustedDomainInfo(policy LSA_HANDLE, sid PSID, class TRUSTED_INFORMATION_CLASS, buffer *PVOID) NTSTATUS
  3854  
  3855  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING, TRUSTED_INFORMATION_CLASS
  3856  // func LsaQueryTrustedDomainInfoByName(policy LSA_HANDLE, name PLSA_UNICODE_STRING, class TRUSTED_INFORMATION_CLASS, buffer *PVOID) NTSTATUS
  3857  
  3858  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING
  3859  // func LsaRemoveAccountRights(policy LSA_HANDLE, sid PSID, all BOOLEAN, rights PLSA_UNICODE_STRING, count ULONG) NTSTATUS
  3860  
  3861  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING, OUT PLSA_UNICODE_STRING *
  3862  // func LsaRetrievePrivateData(policyHandle IN LSA_HANDLE, keyName IN PLSA_UNICODE_STRING, privateData OUT PLSA_UNICODE_STRING *) NTSTATUS
  3863  
  3864  // TODO: Unknown type(s): IN LSA_HANDLE, IN POLICY_INFORMATION_CLASS, IN PVOID
  3865  // func LsaSetInformationPolicy(policyHandle IN LSA_HANDLE, informationClass IN POLICY_INFORMATION_CLASS, buffer IN PVOID) NTSTATUS
  3866  
  3867  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING
  3868  // func LsaSetSecret(secretHandle IN LSA_HANDLE, encryptedCurrentValue IN PLSA_UNICODE_STRING, encryptedOldValue IN PLSA_UNICODE_STRING) NTSTATUS
  3869  
  3870  // TODO: Unknown type(s): LSA_HANDLE, PLSA_UNICODE_STRING, TRUSTED_INFORMATION_CLASS
  3871  // func LsaSetTrustedDomainInfoByName(policy LSA_HANDLE, name PLSA_UNICODE_STRING, class TRUSTED_INFORMATION_CLASS, buffer uintptr) NTSTATUS
  3872  
  3873  // TODO: Unknown type(s): LSA_HANDLE, TRUSTED_INFORMATION_CLASS
  3874  // func LsaSetTrustedDomainInformation(policy LSA_HANDLE, sid PSID, class TRUSTED_INFORMATION_CLASS, buffer uintptr) NTSTATUS
  3875  
  3876  // TODO: Unknown type(s): IN LSA_HANDLE, IN PLSA_UNICODE_STRING
  3877  // func LsaStorePrivateData(policyHandle IN LSA_HANDLE, keyName IN PLSA_UNICODE_STRING, privateData IN PLSA_UNICODE_STRING) NTSTATUS
  3878  
  3879  // TODO: Unknown type(s): MD4_CTX *
  3880  // func MD4Final(ctx MD4_CTX *)
  3881  
  3882  // TODO: Unknown type(s): MD4_CTX *
  3883  // func MD4Init(ctx MD4_CTX *)
  3884  
  3885  // TODO: Unknown type(s): MD4_CTX *
  3886  // func MD4Update(ctx MD4_CTX *, buf /*const*/ *byte, aLen uint32)
  3887  
  3888  // TODO: Unknown type(s): MD5_CTX *
  3889  // func MD5Final(ctx MD5_CTX *)
  3890  
  3891  // TODO: Unknown type(s): MD5_CTX *
  3892  // func MD5Init(ctx MD5_CTX *)
  3893  
  3894  // TODO: Unknown type(s): PEVENT_TRACE_LOGFILEW, TRACEHANDLE
  3895  // func OpenTrace(logfile PEVENT_TRACE_LOGFILEW) TRACEHANDLE
  3896  
  3897  // TODO: Unknown type(s): PTRACEHANDLE
  3898  // func ProcessTrace(handleArray PTRACEHANDLE, handleCount ULONG, startTime *FILETIME, endTime *FILETIME) ULONG
  3899  
  3900  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES *
  3901  // func QueryAllTraces(parray PEVENT_TRACE_PROPERTIES *, arraycount ULONG, psessioncount *uint32) ULONG
  3902  
  3903  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3904  // func QueryTrace(handle TRACEHANDLE, sessionname string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3905  
  3906  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, PTRACEHANDLE
  3907  // func StartTrace(pSessionHandle PTRACEHANDLE, sessionName string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3908  
  3909  // TODO: Unknown type(s): PEVENT_TRACE_PROPERTIES, TRACEHANDLE
  3910  // func StopTrace(session TRACEHANDLE, session_name string, properties PEVENT_TRACE_PROPERTIES) ULONG
  3911  
  3912  func SystemFunction001(data /*const*/ *byte, key /*const*/ *byte, output *byte) NTSTATUS {
  3913  	ret1 := syscall3(systemFunction001, 3,
  3914  		uintptr(unsafe.Pointer(data)),
  3915  		uintptr(unsafe.Pointer(key)),
  3916  		uintptr(unsafe.Pointer(output)))
  3917  	return NTSTATUS(ret1)
  3918  }
  3919  
  3920  func SystemFunction002(data /*const*/ *byte, key /*const*/ *byte, output *byte) NTSTATUS {
  3921  	ret1 := syscall3(systemFunction002, 3,
  3922  		uintptr(unsafe.Pointer(data)),
  3923  		uintptr(unsafe.Pointer(key)),
  3924  		uintptr(unsafe.Pointer(output)))
  3925  	return NTSTATUS(ret1)
  3926  }
  3927  
  3928  func SystemFunction003(key /*const*/ *byte, output *byte) NTSTATUS {
  3929  	ret1 := syscall3(systemFunction003, 2,
  3930  		uintptr(unsafe.Pointer(key)),
  3931  		uintptr(unsafe.Pointer(output)),
  3932  		0)
  3933  	return NTSTATUS(ret1)
  3934  }
  3935  
  3936  // TODO: Unknown type(s): const struct ustring *, struct ustring *
  3937  // func SystemFunction004(in /*const*/ const struct ustring *, key /*const*/ const struct ustring *, out struct ustring *) NTSTATUS
  3938  
  3939  // TODO: Unknown type(s): const struct ustring *, struct ustring *
  3940  // func SystemFunction005(in /*const*/ const struct ustring *, key /*const*/ const struct ustring *, out struct ustring *) NTSTATUS
  3941  
  3942  func SystemFunction006(password /*const*/ LPCSTR, hash LPSTR) NTSTATUS {
  3943  	ret1 := syscall3(systemFunction006, 2,
  3944  		uintptr(unsafe.Pointer(password)),
  3945  		uintptr(unsafe.Pointer(hash)),
  3946  		0)
  3947  	return NTSTATUS(ret1)
  3948  }
  3949  
  3950  // TODO: Unknown type(s): const UNICODE_STRING *
  3951  // func SystemFunction007(string /*const*/ const UNICODE_STRING *, hash *byte) NTSTATUS
  3952  
  3953  func SystemFunction008(challenge /*const*/ *byte, hash /*const*/ *byte, response *byte) NTSTATUS {
  3954  	ret1 := syscall3(systemFunction008, 3,
  3955  		uintptr(unsafe.Pointer(challenge)),
  3956  		uintptr(unsafe.Pointer(hash)),
  3957  		uintptr(unsafe.Pointer(response)))
  3958  	return NTSTATUS(ret1)
  3959  }
  3960  
  3961  func SystemFunction009(challenge /*const*/ *byte, hash /*const*/ *byte, response *byte) NTSTATUS {
  3962  	ret1 := syscall3(systemFunction009, 3,
  3963  		uintptr(unsafe.Pointer(challenge)),
  3964  		uintptr(unsafe.Pointer(hash)),
  3965  		uintptr(unsafe.Pointer(response)))
  3966  	return NTSTATUS(ret1)
  3967  }
  3968  
  3969  func SystemFunction010(unknown LPVOID, data /*const*/ *byte, hash *byte) NTSTATUS {
  3970  	ret1 := syscall3(systemFunction010, 3,
  3971  		uintptr(unsafe.Pointer(unknown)),
  3972  		uintptr(unsafe.Pointer(data)),
  3973  		uintptr(unsafe.Pointer(hash)))
  3974  	return NTSTATUS(ret1)
  3975  }
  3976  
  3977  func SystemFunction012(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  3978  	ret1 := syscall3(systemFunction012, 3,
  3979  		uintptr(unsafe.Pointer(in)),
  3980  		uintptr(unsafe.Pointer(key)),
  3981  		uintptr(unsafe.Pointer(out)))
  3982  	return NTSTATUS(ret1)
  3983  }
  3984  
  3985  func SystemFunction013(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  3986  	ret1 := syscall3(systemFunction013, 3,
  3987  		uintptr(unsafe.Pointer(in)),
  3988  		uintptr(unsafe.Pointer(key)),
  3989  		uintptr(unsafe.Pointer(out)))
  3990  	return NTSTATUS(ret1)
  3991  }
  3992  
  3993  func SystemFunction024(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  3994  	ret1 := syscall3(systemFunction024, 3,
  3995  		uintptr(unsafe.Pointer(in)),
  3996  		uintptr(unsafe.Pointer(key)),
  3997  		uintptr(unsafe.Pointer(out)))
  3998  	return NTSTATUS(ret1)
  3999  }
  4000  
  4001  func SystemFunction025(in /*const*/ *byte, key /*const*/ *byte, out *byte) NTSTATUS {
  4002  	ret1 := syscall3(systemFunction025, 3,
  4003  		uintptr(unsafe.Pointer(in)),
  4004  		uintptr(unsafe.Pointer(key)),
  4005  		uintptr(unsafe.Pointer(out)))
  4006  	return NTSTATUS(ret1)
  4007  }
  4008  
  4009  func SystemFunction030(b1 /*const*/ uintptr, b2 /*const*/ uintptr) bool {
  4010  	ret1 := syscall3(systemFunction030, 2,
  4011  		b1,
  4012  		b2,
  4013  		0)
  4014  	return ret1 != 0
  4015  }
  4016  
  4017  // TODO: Unknown type(s): const struct ustring *, struct ustring *
  4018  // func SystemFunction032(data struct ustring *, key /*const*/ const struct ustring *) NTSTATUS
  4019  
  4020  func SystemFunction035(lpszDllFilePath /*const*/ LPCSTR) bool {
  4021  	ret1 := syscall3(systemFunction035, 1,
  4022  		uintptr(unsafe.Pointer(lpszDllFilePath)),
  4023  		0,
  4024  		0)
  4025  	return ret1 != 0
  4026  }
  4027  
  4028  func SystemFunction036(pbBuffer uintptr, dwLen ULONG) BOOLEAN {
  4029  	ret1 := syscall3(systemFunction036, 2,
  4030  		pbBuffer,
  4031  		uintptr(dwLen),
  4032  		0)
  4033  	return BOOLEAN(ret1)
  4034  }
  4035  
  4036  func SystemFunction040(memory uintptr, length ULONG, flags ULONG) NTSTATUS {
  4037  	ret1 := syscall3(systemFunction040, 3,
  4038  		memory,
  4039  		uintptr(length),
  4040  		uintptr(flags))
  4041  	return NTSTATUS(ret1)
  4042  }
  4043  
  4044  func SystemFunction041(memory uintptr, length ULONG, flags ULONG) NTSTATUS {
  4045  	ret1 := syscall3(systemFunction041, 3,
  4046  		memory,
  4047  		uintptr(length),
  4048  		uintptr(flags))
  4049  	return NTSTATUS(ret1)
  4050  }
  4051  
  4052  // TODO: Unknown type(s): PEVENT_TRACE_HEADER, TRACEHANDLE
  4053  // func TraceEvent(sessionHandle TRACEHANDLE, eventTrace PEVENT_TRACE_HEADER) ULONG
  4054  
  4055  // TODO: Unknown type(s): TRACEHANDLE
  4056  // func UnregisterTraceGuids(registrationHandle TRACEHANDLE) ULONG
  4057  
  4058  // TODO: Unknown type(s): WMIHANDLE *
  4059  // func WmiOpenBlock(guid *GUID, access ULONG, handle WMIHANDLE *) ULONG