rss-tools/vendor/golang.org/x/sys/windows/zsyscall_windows.go (view raw)
| 1 | // Code generated by 'go generate'; DO NOT EDIT. |
| 2 | |
| 3 | package windows |
| 4 | |
| 5 | import ( |
| 6 | "syscall" |
| 7 | "unsafe" |
| 8 | ) |
| 9 | |
| 10 | var _ unsafe.Pointer |
| 11 | |
| 12 | // Do the interface allocations only once for common |
| 13 | // Errno values. |
| 14 | const ( |
| 15 | errnoERROR_IO_PENDING = 997 |
| 16 | ) |
| 17 | |
| 18 | var ( |
| 19 | errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) |
| 20 | errERROR_EINVAL error = syscall.EINVAL |
| 21 | ) |
| 22 | |
| 23 | // errnoErr returns common boxed Errno values, to prevent |
| 24 | // allocations at runtime. |
| 25 | func errnoErr(e syscall.Errno) error { |
| 26 | switch e { |
| 27 | case 0: |
| 28 | return errERROR_EINVAL |
| 29 | case errnoERROR_IO_PENDING: |
| 30 | return errERROR_IO_PENDING |
| 31 | } |
| 32 | // TODO: add more here, after collecting data on the common |
| 33 | // error values see on Windows. (perhaps when running |
| 34 | // all.bat?) |
| 35 | return e |
| 36 | } |
| 37 | |
| 38 | var ( |
| 39 | modCfgMgr32 = NewLazySystemDLL("CfgMgr32.dll") |
| 40 | modadvapi32 = NewLazySystemDLL("advapi32.dll") |
| 41 | modcrypt32 = NewLazySystemDLL("crypt32.dll") |
| 42 | moddnsapi = NewLazySystemDLL("dnsapi.dll") |
| 43 | moddwmapi = NewLazySystemDLL("dwmapi.dll") |
| 44 | modiphlpapi = NewLazySystemDLL("iphlpapi.dll") |
| 45 | modkernel32 = NewLazySystemDLL("kernel32.dll") |
| 46 | modmswsock = NewLazySystemDLL("mswsock.dll") |
| 47 | modnetapi32 = NewLazySystemDLL("netapi32.dll") |
| 48 | modntdll = NewLazySystemDLL("ntdll.dll") |
| 49 | modole32 = NewLazySystemDLL("ole32.dll") |
| 50 | modpsapi = NewLazySystemDLL("psapi.dll") |
| 51 | modsechost = NewLazySystemDLL("sechost.dll") |
| 52 | modsecur32 = NewLazySystemDLL("secur32.dll") |
| 53 | modsetupapi = NewLazySystemDLL("setupapi.dll") |
| 54 | modshell32 = NewLazySystemDLL("shell32.dll") |
| 55 | moduser32 = NewLazySystemDLL("user32.dll") |
| 56 | moduserenv = NewLazySystemDLL("userenv.dll") |
| 57 | modversion = NewLazySystemDLL("version.dll") |
| 58 | modwinmm = NewLazySystemDLL("winmm.dll") |
| 59 | modwintrust = NewLazySystemDLL("wintrust.dll") |
| 60 | modws2_32 = NewLazySystemDLL("ws2_32.dll") |
| 61 | modwtsapi32 = NewLazySystemDLL("wtsapi32.dll") |
| 62 | |
| 63 | procCM_Get_DevNode_Status = modCfgMgr32.NewProc("CM_Get_DevNode_Status") |
| 64 | procCM_Get_Device_Interface_ListW = modCfgMgr32.NewProc("CM_Get_Device_Interface_ListW") |
| 65 | procCM_Get_Device_Interface_List_SizeW = modCfgMgr32.NewProc("CM_Get_Device_Interface_List_SizeW") |
| 66 | procCM_MapCrToWin32Err = modCfgMgr32.NewProc("CM_MapCrToWin32Err") |
| 67 | procAdjustTokenGroups = modadvapi32.NewProc("AdjustTokenGroups") |
| 68 | procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") |
| 69 | procAllocateAndInitializeSid = modadvapi32.NewProc("AllocateAndInitializeSid") |
| 70 | procBuildSecurityDescriptorW = modadvapi32.NewProc("BuildSecurityDescriptorW") |
| 71 | procChangeServiceConfig2W = modadvapi32.NewProc("ChangeServiceConfig2W") |
| 72 | procChangeServiceConfigW = modadvapi32.NewProc("ChangeServiceConfigW") |
| 73 | procCheckTokenMembership = modadvapi32.NewProc("CheckTokenMembership") |
| 74 | procCloseServiceHandle = modadvapi32.NewProc("CloseServiceHandle") |
| 75 | procControlService = modadvapi32.NewProc("ControlService") |
| 76 | procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") |
| 77 | procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") |
| 78 | procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") |
| 79 | procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") |
| 80 | procCopySid = modadvapi32.NewProc("CopySid") |
| 81 | procCreateProcessAsUserW = modadvapi32.NewProc("CreateProcessAsUserW") |
| 82 | procCreateServiceW = modadvapi32.NewProc("CreateServiceW") |
| 83 | procCreateWellKnownSid = modadvapi32.NewProc("CreateWellKnownSid") |
| 84 | procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW") |
| 85 | procCryptGenRandom = modadvapi32.NewProc("CryptGenRandom") |
| 86 | procCryptReleaseContext = modadvapi32.NewProc("CryptReleaseContext") |
| 87 | procDeleteService = modadvapi32.NewProc("DeleteService") |
| 88 | procDeregisterEventSource = modadvapi32.NewProc("DeregisterEventSource") |
| 89 | procDuplicateTokenEx = modadvapi32.NewProc("DuplicateTokenEx") |
| 90 | procEnumDependentServicesW = modadvapi32.NewProc("EnumDependentServicesW") |
| 91 | procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") |
| 92 | procEqualSid = modadvapi32.NewProc("EqualSid") |
| 93 | procFreeSid = modadvapi32.NewProc("FreeSid") |
| 94 | procGetAce = modadvapi32.NewProc("GetAce") |
| 95 | procGetLengthSid = modadvapi32.NewProc("GetLengthSid") |
| 96 | procGetNamedSecurityInfoW = modadvapi32.NewProc("GetNamedSecurityInfoW") |
| 97 | procGetSecurityDescriptorControl = modadvapi32.NewProc("GetSecurityDescriptorControl") |
| 98 | procGetSecurityDescriptorDacl = modadvapi32.NewProc("GetSecurityDescriptorDacl") |
| 99 | procGetSecurityDescriptorGroup = modadvapi32.NewProc("GetSecurityDescriptorGroup") |
| 100 | procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") |
| 101 | procGetSecurityDescriptorOwner = modadvapi32.NewProc("GetSecurityDescriptorOwner") |
| 102 | procGetSecurityDescriptorRMControl = modadvapi32.NewProc("GetSecurityDescriptorRMControl") |
| 103 | procGetSecurityDescriptorSacl = modadvapi32.NewProc("GetSecurityDescriptorSacl") |
| 104 | procGetSecurityInfo = modadvapi32.NewProc("GetSecurityInfo") |
| 105 | procGetSidIdentifierAuthority = modadvapi32.NewProc("GetSidIdentifierAuthority") |
| 106 | procGetSidSubAuthority = modadvapi32.NewProc("GetSidSubAuthority") |
| 107 | procGetSidSubAuthorityCount = modadvapi32.NewProc("GetSidSubAuthorityCount") |
| 108 | procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation") |
| 109 | procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") |
| 110 | procInitializeSecurityDescriptor = modadvapi32.NewProc("InitializeSecurityDescriptor") |
| 111 | procInitiateSystemShutdownExW = modadvapi32.NewProc("InitiateSystemShutdownExW") |
| 112 | procIsTokenRestricted = modadvapi32.NewProc("IsTokenRestricted") |
| 113 | procIsValidSecurityDescriptor = modadvapi32.NewProc("IsValidSecurityDescriptor") |
| 114 | procIsValidSid = modadvapi32.NewProc("IsValidSid") |
| 115 | procIsWellKnownSid = modadvapi32.NewProc("IsWellKnownSid") |
| 116 | procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") |
| 117 | procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") |
| 118 | procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") |
| 119 | procMakeAbsoluteSD = modadvapi32.NewProc("MakeAbsoluteSD") |
| 120 | procMakeSelfRelativeSD = modadvapi32.NewProc("MakeSelfRelativeSD") |
| 121 | procNotifyServiceStatusChangeW = modadvapi32.NewProc("NotifyServiceStatusChangeW") |
| 122 | procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken") |
| 123 | procOpenSCManagerW = modadvapi32.NewProc("OpenSCManagerW") |
| 124 | procOpenServiceW = modadvapi32.NewProc("OpenServiceW") |
| 125 | procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") |
| 126 | procQueryServiceConfig2W = modadvapi32.NewProc("QueryServiceConfig2W") |
| 127 | procQueryServiceConfigW = modadvapi32.NewProc("QueryServiceConfigW") |
| 128 | procQueryServiceDynamicInformation = modadvapi32.NewProc("QueryServiceDynamicInformation") |
| 129 | procQueryServiceLockStatusW = modadvapi32.NewProc("QueryServiceLockStatusW") |
| 130 | procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus") |
| 131 | procQueryServiceStatusEx = modadvapi32.NewProc("QueryServiceStatusEx") |
| 132 | procRegCloseKey = modadvapi32.NewProc("RegCloseKey") |
| 133 | procRegEnumKeyExW = modadvapi32.NewProc("RegEnumKeyExW") |
| 134 | procRegNotifyChangeKeyValue = modadvapi32.NewProc("RegNotifyChangeKeyValue") |
| 135 | procRegOpenKeyExW = modadvapi32.NewProc("RegOpenKeyExW") |
| 136 | procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW") |
| 137 | procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW") |
| 138 | procRegisterEventSourceW = modadvapi32.NewProc("RegisterEventSourceW") |
| 139 | procRegisterServiceCtrlHandlerExW = modadvapi32.NewProc("RegisterServiceCtrlHandlerExW") |
| 140 | procReportEventW = modadvapi32.NewProc("ReportEventW") |
| 141 | procRevertToSelf = modadvapi32.NewProc("RevertToSelf") |
| 142 | procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW") |
| 143 | procSetKernelObjectSecurity = modadvapi32.NewProc("SetKernelObjectSecurity") |
| 144 | procSetNamedSecurityInfoW = modadvapi32.NewProc("SetNamedSecurityInfoW") |
| 145 | procSetSecurityDescriptorControl = modadvapi32.NewProc("SetSecurityDescriptorControl") |
| 146 | procSetSecurityDescriptorDacl = modadvapi32.NewProc("SetSecurityDescriptorDacl") |
| 147 | procSetSecurityDescriptorGroup = modadvapi32.NewProc("SetSecurityDescriptorGroup") |
| 148 | procSetSecurityDescriptorOwner = modadvapi32.NewProc("SetSecurityDescriptorOwner") |
| 149 | procSetSecurityDescriptorRMControl = modadvapi32.NewProc("SetSecurityDescriptorRMControl") |
| 150 | procSetSecurityDescriptorSacl = modadvapi32.NewProc("SetSecurityDescriptorSacl") |
| 151 | procSetSecurityInfo = modadvapi32.NewProc("SetSecurityInfo") |
| 152 | procSetServiceStatus = modadvapi32.NewProc("SetServiceStatus") |
| 153 | procSetThreadToken = modadvapi32.NewProc("SetThreadToken") |
| 154 | procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation") |
| 155 | procStartServiceCtrlDispatcherW = modadvapi32.NewProc("StartServiceCtrlDispatcherW") |
| 156 | procStartServiceW = modadvapi32.NewProc("StartServiceW") |
| 157 | procCertAddCertificateContextToStore = modcrypt32.NewProc("CertAddCertificateContextToStore") |
| 158 | procCertCloseStore = modcrypt32.NewProc("CertCloseStore") |
| 159 | procCertCreateCertificateContext = modcrypt32.NewProc("CertCreateCertificateContext") |
| 160 | procCertDeleteCertificateFromStore = modcrypt32.NewProc("CertDeleteCertificateFromStore") |
| 161 | procCertDuplicateCertificateContext = modcrypt32.NewProc("CertDuplicateCertificateContext") |
| 162 | procCertEnumCertificatesInStore = modcrypt32.NewProc("CertEnumCertificatesInStore") |
| 163 | procCertFindCertificateInStore = modcrypt32.NewProc("CertFindCertificateInStore") |
| 164 | procCertFindChainInStore = modcrypt32.NewProc("CertFindChainInStore") |
| 165 | procCertFindExtension = modcrypt32.NewProc("CertFindExtension") |
| 166 | procCertFreeCertificateChain = modcrypt32.NewProc("CertFreeCertificateChain") |
| 167 | procCertFreeCertificateContext = modcrypt32.NewProc("CertFreeCertificateContext") |
| 168 | procCertGetCertificateChain = modcrypt32.NewProc("CertGetCertificateChain") |
| 169 | procCertGetNameStringW = modcrypt32.NewProc("CertGetNameStringW") |
| 170 | procCertOpenStore = modcrypt32.NewProc("CertOpenStore") |
| 171 | procCertOpenSystemStoreW = modcrypt32.NewProc("CertOpenSystemStoreW") |
| 172 | procCertVerifyCertificateChainPolicy = modcrypt32.NewProc("CertVerifyCertificateChainPolicy") |
| 173 | procCryptAcquireCertificatePrivateKey = modcrypt32.NewProc("CryptAcquireCertificatePrivateKey") |
| 174 | procCryptDecodeObject = modcrypt32.NewProc("CryptDecodeObject") |
| 175 | procCryptProtectData = modcrypt32.NewProc("CryptProtectData") |
| 176 | procCryptQueryObject = modcrypt32.NewProc("CryptQueryObject") |
| 177 | procCryptUnprotectData = modcrypt32.NewProc("CryptUnprotectData") |
| 178 | procPFXImportCertStore = modcrypt32.NewProc("PFXImportCertStore") |
| 179 | procDnsNameCompare_W = moddnsapi.NewProc("DnsNameCompare_W") |
| 180 | procDnsQuery_W = moddnsapi.NewProc("DnsQuery_W") |
| 181 | procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree") |
| 182 | procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute") |
| 183 | procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute") |
| 184 | procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2") |
| 185 | procFreeMibTable = modiphlpapi.NewProc("FreeMibTable") |
| 186 | procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") |
| 187 | procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") |
| 188 | procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") |
| 189 | procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") |
| 190 | procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") |
| 191 | procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2") |
| 192 | procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2") |
| 193 | procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") |
| 194 | procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") |
| 195 | procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2") |
| 196 | procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") |
| 197 | procAddDllDirectory = modkernel32.NewProc("AddDllDirectory") |
| 198 | procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") |
| 199 | procCancelIo = modkernel32.NewProc("CancelIo") |
| 200 | procCancelIoEx = modkernel32.NewProc("CancelIoEx") |
| 201 | procClearCommBreak = modkernel32.NewProc("ClearCommBreak") |
| 202 | procClearCommError = modkernel32.NewProc("ClearCommError") |
| 203 | procCloseHandle = modkernel32.NewProc("CloseHandle") |
| 204 | procClosePseudoConsole = modkernel32.NewProc("ClosePseudoConsole") |
| 205 | procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") |
| 206 | procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW") |
| 207 | procCreateEventExW = modkernel32.NewProc("CreateEventExW") |
| 208 | procCreateEventW = modkernel32.NewProc("CreateEventW") |
| 209 | procCreateFileMappingW = modkernel32.NewProc("CreateFileMappingW") |
| 210 | procCreateFileW = modkernel32.NewProc("CreateFileW") |
| 211 | procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW") |
| 212 | procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") |
| 213 | procCreateJobObjectW = modkernel32.NewProc("CreateJobObjectW") |
| 214 | procCreateMutexExW = modkernel32.NewProc("CreateMutexExW") |
| 215 | procCreateMutexW = modkernel32.NewProc("CreateMutexW") |
| 216 | procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") |
| 217 | procCreatePipe = modkernel32.NewProc("CreatePipe") |
| 218 | procCreateProcessW = modkernel32.NewProc("CreateProcessW") |
| 219 | procCreatePseudoConsole = modkernel32.NewProc("CreatePseudoConsole") |
| 220 | procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW") |
| 221 | procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot") |
| 222 | procDefineDosDeviceW = modkernel32.NewProc("DefineDosDeviceW") |
| 223 | procDeleteFileW = modkernel32.NewProc("DeleteFileW") |
| 224 | procDeleteProcThreadAttributeList = modkernel32.NewProc("DeleteProcThreadAttributeList") |
| 225 | procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW") |
| 226 | procDeviceIoControl = modkernel32.NewProc("DeviceIoControl") |
| 227 | procDisconnectNamedPipe = modkernel32.NewProc("DisconnectNamedPipe") |
| 228 | procDuplicateHandle = modkernel32.NewProc("DuplicateHandle") |
| 229 | procEscapeCommFunction = modkernel32.NewProc("EscapeCommFunction") |
| 230 | procExitProcess = modkernel32.NewProc("ExitProcess") |
| 231 | procExpandEnvironmentStringsW = modkernel32.NewProc("ExpandEnvironmentStringsW") |
| 232 | procFindClose = modkernel32.NewProc("FindClose") |
| 233 | procFindCloseChangeNotification = modkernel32.NewProc("FindCloseChangeNotification") |
| 234 | procFindFirstChangeNotificationW = modkernel32.NewProc("FindFirstChangeNotificationW") |
| 235 | procFindFirstFileW = modkernel32.NewProc("FindFirstFileW") |
| 236 | procFindFirstVolumeMountPointW = modkernel32.NewProc("FindFirstVolumeMountPointW") |
| 237 | procFindFirstVolumeW = modkernel32.NewProc("FindFirstVolumeW") |
| 238 | procFindNextChangeNotification = modkernel32.NewProc("FindNextChangeNotification") |
| 239 | procFindNextFileW = modkernel32.NewProc("FindNextFileW") |
| 240 | procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW") |
| 241 | procFindNextVolumeW = modkernel32.NewProc("FindNextVolumeW") |
| 242 | procFindResourceW = modkernel32.NewProc("FindResourceW") |
| 243 | procFindVolumeClose = modkernel32.NewProc("FindVolumeClose") |
| 244 | procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose") |
| 245 | procFlushConsoleInputBuffer = modkernel32.NewProc("FlushConsoleInputBuffer") |
| 246 | procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers") |
| 247 | procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile") |
| 248 | procFormatMessageW = modkernel32.NewProc("FormatMessageW") |
| 249 | procFreeEnvironmentStringsW = modkernel32.NewProc("FreeEnvironmentStringsW") |
| 250 | procFreeLibrary = modkernel32.NewProc("FreeLibrary") |
| 251 | procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent") |
| 252 | procGetACP = modkernel32.NewProc("GetACP") |
| 253 | procGetActiveProcessorCount = modkernel32.NewProc("GetActiveProcessorCount") |
| 254 | procGetCommModemStatus = modkernel32.NewProc("GetCommModemStatus") |
| 255 | procGetCommState = modkernel32.NewProc("GetCommState") |
| 256 | procGetCommTimeouts = modkernel32.NewProc("GetCommTimeouts") |
| 257 | procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") |
| 258 | procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") |
| 259 | procGetComputerNameW = modkernel32.NewProc("GetComputerNameW") |
| 260 | procGetConsoleCP = modkernel32.NewProc("GetConsoleCP") |
| 261 | procGetConsoleMode = modkernel32.NewProc("GetConsoleMode") |
| 262 | procGetConsoleOutputCP = modkernel32.NewProc("GetConsoleOutputCP") |
| 263 | procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo") |
| 264 | procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW") |
| 265 | procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId") |
| 266 | procGetCurrentThreadId = modkernel32.NewProc("GetCurrentThreadId") |
| 267 | procGetDiskFreeSpaceExW = modkernel32.NewProc("GetDiskFreeSpaceExW") |
| 268 | procGetDriveTypeW = modkernel32.NewProc("GetDriveTypeW") |
| 269 | procGetEnvironmentStringsW = modkernel32.NewProc("GetEnvironmentStringsW") |
| 270 | procGetEnvironmentVariableW = modkernel32.NewProc("GetEnvironmentVariableW") |
| 271 | procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess") |
| 272 | procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW") |
| 273 | procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW") |
| 274 | procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle") |
| 275 | procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx") |
| 276 | procGetFileTime = modkernel32.NewProc("GetFileTime") |
| 277 | procGetFileType = modkernel32.NewProc("GetFileType") |
| 278 | procGetFinalPathNameByHandleW = modkernel32.NewProc("GetFinalPathNameByHandleW") |
| 279 | procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW") |
| 280 | procGetLargePageMinimum = modkernel32.NewProc("GetLargePageMinimum") |
| 281 | procGetLastError = modkernel32.NewProc("GetLastError") |
| 282 | procGetLogicalDriveStringsW = modkernel32.NewProc("GetLogicalDriveStringsW") |
| 283 | procGetLogicalDrives = modkernel32.NewProc("GetLogicalDrives") |
| 284 | procGetLongPathNameW = modkernel32.NewProc("GetLongPathNameW") |
| 285 | procGetMaximumProcessorCount = modkernel32.NewProc("GetMaximumProcessorCount") |
| 286 | procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW") |
| 287 | procGetModuleHandleExW = modkernel32.NewProc("GetModuleHandleExW") |
| 288 | procGetNamedPipeClientProcessId = modkernel32.NewProc("GetNamedPipeClientProcessId") |
| 289 | procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") |
| 290 | procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") |
| 291 | procGetNamedPipeServerProcessId = modkernel32.NewProc("GetNamedPipeServerProcessId") |
| 292 | procGetNumberOfConsoleInputEvents = modkernel32.NewProc("GetNumberOfConsoleInputEvents") |
| 293 | procGetOverlappedResult = modkernel32.NewProc("GetOverlappedResult") |
| 294 | procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") |
| 295 | procGetProcAddress = modkernel32.NewProc("GetProcAddress") |
| 296 | procGetProcessId = modkernel32.NewProc("GetProcessId") |
| 297 | procGetProcessPreferredUILanguages = modkernel32.NewProc("GetProcessPreferredUILanguages") |
| 298 | procGetProcessShutdownParameters = modkernel32.NewProc("GetProcessShutdownParameters") |
| 299 | procGetProcessTimes = modkernel32.NewProc("GetProcessTimes") |
| 300 | procGetProcessWorkingSetSizeEx = modkernel32.NewProc("GetProcessWorkingSetSizeEx") |
| 301 | procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") |
| 302 | procGetShortPathNameW = modkernel32.NewProc("GetShortPathNameW") |
| 303 | procGetStartupInfoW = modkernel32.NewProc("GetStartupInfoW") |
| 304 | procGetStdHandle = modkernel32.NewProc("GetStdHandle") |
| 305 | procGetSystemDirectoryW = modkernel32.NewProc("GetSystemDirectoryW") |
| 306 | procGetSystemPreferredUILanguages = modkernel32.NewProc("GetSystemPreferredUILanguages") |
| 307 | procGetSystemTimeAsFileTime = modkernel32.NewProc("GetSystemTimeAsFileTime") |
| 308 | procGetSystemTimePreciseAsFileTime = modkernel32.NewProc("GetSystemTimePreciseAsFileTime") |
| 309 | procGetSystemWindowsDirectoryW = modkernel32.NewProc("GetSystemWindowsDirectoryW") |
| 310 | procGetTempPathW = modkernel32.NewProc("GetTempPathW") |
| 311 | procGetThreadPreferredUILanguages = modkernel32.NewProc("GetThreadPreferredUILanguages") |
| 312 | procGetTickCount64 = modkernel32.NewProc("GetTickCount64") |
| 313 | procGetTimeZoneInformation = modkernel32.NewProc("GetTimeZoneInformation") |
| 314 | procGetUserPreferredUILanguages = modkernel32.NewProc("GetUserPreferredUILanguages") |
| 315 | procGetVersion = modkernel32.NewProc("GetVersion") |
| 316 | procGetVolumeInformationByHandleW = modkernel32.NewProc("GetVolumeInformationByHandleW") |
| 317 | procGetVolumeInformationW = modkernel32.NewProc("GetVolumeInformationW") |
| 318 | procGetVolumeNameForVolumeMountPointW = modkernel32.NewProc("GetVolumeNameForVolumeMountPointW") |
| 319 | procGetVolumePathNameW = modkernel32.NewProc("GetVolumePathNameW") |
| 320 | procGetVolumePathNamesForVolumeNameW = modkernel32.NewProc("GetVolumePathNamesForVolumeNameW") |
| 321 | procGetWindowsDirectoryW = modkernel32.NewProc("GetWindowsDirectoryW") |
| 322 | procInitializeProcThreadAttributeList = modkernel32.NewProc("InitializeProcThreadAttributeList") |
| 323 | procIsProcessorFeaturePresent = modkernel32.NewProc("IsProcessorFeaturePresent") |
| 324 | procIsWow64Process = modkernel32.NewProc("IsWow64Process") |
| 325 | procIsWow64Process2 = modkernel32.NewProc("IsWow64Process2") |
| 326 | procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW") |
| 327 | procLoadLibraryW = modkernel32.NewProc("LoadLibraryW") |
| 328 | procLoadResource = modkernel32.NewProc("LoadResource") |
| 329 | procLocalAlloc = modkernel32.NewProc("LocalAlloc") |
| 330 | procLocalFree = modkernel32.NewProc("LocalFree") |
| 331 | procLockFileEx = modkernel32.NewProc("LockFileEx") |
| 332 | procLockResource = modkernel32.NewProc("LockResource") |
| 333 | procMapViewOfFile = modkernel32.NewProc("MapViewOfFile") |
| 334 | procModule32FirstW = modkernel32.NewProc("Module32FirstW") |
| 335 | procModule32NextW = modkernel32.NewProc("Module32NextW") |
| 336 | procMoveFileExW = modkernel32.NewProc("MoveFileExW") |
| 337 | procMoveFileW = modkernel32.NewProc("MoveFileW") |
| 338 | procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar") |
| 339 | procOpenEventW = modkernel32.NewProc("OpenEventW") |
| 340 | procOpenMutexW = modkernel32.NewProc("OpenMutexW") |
| 341 | procOpenProcess = modkernel32.NewProc("OpenProcess") |
| 342 | procOpenThread = modkernel32.NewProc("OpenThread") |
| 343 | procPostQueuedCompletionStatus = modkernel32.NewProc("PostQueuedCompletionStatus") |
| 344 | procProcess32FirstW = modkernel32.NewProc("Process32FirstW") |
| 345 | procProcess32NextW = modkernel32.NewProc("Process32NextW") |
| 346 | procProcessIdToSessionId = modkernel32.NewProc("ProcessIdToSessionId") |
| 347 | procPulseEvent = modkernel32.NewProc("PulseEvent") |
| 348 | procPurgeComm = modkernel32.NewProc("PurgeComm") |
| 349 | procQueryDosDeviceW = modkernel32.NewProc("QueryDosDeviceW") |
| 350 | procQueryFullProcessImageNameW = modkernel32.NewProc("QueryFullProcessImageNameW") |
| 351 | procQueryInformationJobObject = modkernel32.NewProc("QueryInformationJobObject") |
| 352 | procReadConsoleW = modkernel32.NewProc("ReadConsoleW") |
| 353 | procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW") |
| 354 | procReadFile = modkernel32.NewProc("ReadFile") |
| 355 | procReadProcessMemory = modkernel32.NewProc("ReadProcessMemory") |
| 356 | procReleaseMutex = modkernel32.NewProc("ReleaseMutex") |
| 357 | procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW") |
| 358 | procRemoveDllDirectory = modkernel32.NewProc("RemoveDllDirectory") |
| 359 | procResetEvent = modkernel32.NewProc("ResetEvent") |
| 360 | procResizePseudoConsole = modkernel32.NewProc("ResizePseudoConsole") |
| 361 | procResumeThread = modkernel32.NewProc("ResumeThread") |
| 362 | procSetCommBreak = modkernel32.NewProc("SetCommBreak") |
| 363 | procSetCommMask = modkernel32.NewProc("SetCommMask") |
| 364 | procSetCommState = modkernel32.NewProc("SetCommState") |
| 365 | procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts") |
| 366 | procSetConsoleCP = modkernel32.NewProc("SetConsoleCP") |
| 367 | procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition") |
| 368 | procSetConsoleMode = modkernel32.NewProc("SetConsoleMode") |
| 369 | procSetConsoleOutputCP = modkernel32.NewProc("SetConsoleOutputCP") |
| 370 | procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") |
| 371 | procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") |
| 372 | procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") |
| 373 | procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") |
| 374 | procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") |
| 375 | procSetErrorMode = modkernel32.NewProc("SetErrorMode") |
| 376 | procSetEvent = modkernel32.NewProc("SetEvent") |
| 377 | procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW") |
| 378 | procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") |
| 379 | procSetFileInformationByHandle = modkernel32.NewProc("SetFileInformationByHandle") |
| 380 | procSetFilePointer = modkernel32.NewProc("SetFilePointer") |
| 381 | procSetFileTime = modkernel32.NewProc("SetFileTime") |
| 382 | procSetFileValidData = modkernel32.NewProc("SetFileValidData") |
| 383 | procSetHandleInformation = modkernel32.NewProc("SetHandleInformation") |
| 384 | procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject") |
| 385 | procSetNamedPipeHandleState = modkernel32.NewProc("SetNamedPipeHandleState") |
| 386 | procSetPriorityClass = modkernel32.NewProc("SetPriorityClass") |
| 387 | procSetProcessPriorityBoost = modkernel32.NewProc("SetProcessPriorityBoost") |
| 388 | procSetProcessShutdownParameters = modkernel32.NewProc("SetProcessShutdownParameters") |
| 389 | procSetProcessWorkingSetSizeEx = modkernel32.NewProc("SetProcessWorkingSetSizeEx") |
| 390 | procSetStdHandle = modkernel32.NewProc("SetStdHandle") |
| 391 | procSetVolumeLabelW = modkernel32.NewProc("SetVolumeLabelW") |
| 392 | procSetVolumeMountPointW = modkernel32.NewProc("SetVolumeMountPointW") |
| 393 | procSetupComm = modkernel32.NewProc("SetupComm") |
| 394 | procSizeofResource = modkernel32.NewProc("SizeofResource") |
| 395 | procSleepEx = modkernel32.NewProc("SleepEx") |
| 396 | procTerminateJobObject = modkernel32.NewProc("TerminateJobObject") |
| 397 | procTerminateProcess = modkernel32.NewProc("TerminateProcess") |
| 398 | procThread32First = modkernel32.NewProc("Thread32First") |
| 399 | procThread32Next = modkernel32.NewProc("Thread32Next") |
| 400 | procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") |
| 401 | procUnmapViewOfFile = modkernel32.NewProc("UnmapViewOfFile") |
| 402 | procUpdateProcThreadAttribute = modkernel32.NewProc("UpdateProcThreadAttribute") |
| 403 | procVirtualAlloc = modkernel32.NewProc("VirtualAlloc") |
| 404 | procVirtualFree = modkernel32.NewProc("VirtualFree") |
| 405 | procVirtualLock = modkernel32.NewProc("VirtualLock") |
| 406 | procVirtualProtect = modkernel32.NewProc("VirtualProtect") |
| 407 | procVirtualProtectEx = modkernel32.NewProc("VirtualProtectEx") |
| 408 | procVirtualQuery = modkernel32.NewProc("VirtualQuery") |
| 409 | procVirtualQueryEx = modkernel32.NewProc("VirtualQueryEx") |
| 410 | procVirtualUnlock = modkernel32.NewProc("VirtualUnlock") |
| 411 | procWTSGetActiveConsoleSessionId = modkernel32.NewProc("WTSGetActiveConsoleSessionId") |
| 412 | procWaitCommEvent = modkernel32.NewProc("WaitCommEvent") |
| 413 | procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects") |
| 414 | procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject") |
| 415 | procWriteConsoleW = modkernel32.NewProc("WriteConsoleW") |
| 416 | procWriteFile = modkernel32.NewProc("WriteFile") |
| 417 | procWriteProcessMemory = modkernel32.NewProc("WriteProcessMemory") |
| 418 | procAcceptEx = modmswsock.NewProc("AcceptEx") |
| 419 | procGetAcceptExSockaddrs = modmswsock.NewProc("GetAcceptExSockaddrs") |
| 420 | procTransmitFile = modmswsock.NewProc("TransmitFile") |
| 421 | procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") |
| 422 | procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") |
| 423 | procNetUserEnum = modnetapi32.NewProc("NetUserEnum") |
| 424 | procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") |
| 425 | procNtCreateFile = modntdll.NewProc("NtCreateFile") |
| 426 | procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") |
| 427 | procNtQueryInformationProcess = modntdll.NewProc("NtQueryInformationProcess") |
| 428 | procNtQuerySystemInformation = modntdll.NewProc("NtQuerySystemInformation") |
| 429 | procNtSetInformationFile = modntdll.NewProc("NtSetInformationFile") |
| 430 | procNtSetInformationProcess = modntdll.NewProc("NtSetInformationProcess") |
| 431 | procNtSetSystemInformation = modntdll.NewProc("NtSetSystemInformation") |
| 432 | procRtlAddFunctionTable = modntdll.NewProc("RtlAddFunctionTable") |
| 433 | procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") |
| 434 | procRtlDeleteFunctionTable = modntdll.NewProc("RtlDeleteFunctionTable") |
| 435 | procRtlDosPathNameToNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToNtPathName_U_WithStatus") |
| 436 | procRtlDosPathNameToRelativeNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToRelativeNtPathName_U_WithStatus") |
| 437 | procRtlGetCurrentPeb = modntdll.NewProc("RtlGetCurrentPeb") |
| 438 | procRtlGetNtVersionNumbers = modntdll.NewProc("RtlGetNtVersionNumbers") |
| 439 | procRtlGetVersion = modntdll.NewProc("RtlGetVersion") |
| 440 | procRtlInitString = modntdll.NewProc("RtlInitString") |
| 441 | procRtlInitUnicodeString = modntdll.NewProc("RtlInitUnicodeString") |
| 442 | procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") |
| 443 | procCLSIDFromString = modole32.NewProc("CLSIDFromString") |
| 444 | procCoCreateGuid = modole32.NewProc("CoCreateGuid") |
| 445 | procCoGetObject = modole32.NewProc("CoGetObject") |
| 446 | procCoInitializeEx = modole32.NewProc("CoInitializeEx") |
| 447 | procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") |
| 448 | procCoUninitialize = modole32.NewProc("CoUninitialize") |
| 449 | procStringFromGUID2 = modole32.NewProc("StringFromGUID2") |
| 450 | procEnumProcessModules = modpsapi.NewProc("EnumProcessModules") |
| 451 | procEnumProcessModulesEx = modpsapi.NewProc("EnumProcessModulesEx") |
| 452 | procEnumProcesses = modpsapi.NewProc("EnumProcesses") |
| 453 | procGetModuleBaseNameW = modpsapi.NewProc("GetModuleBaseNameW") |
| 454 | procGetModuleFileNameExW = modpsapi.NewProc("GetModuleFileNameExW") |
| 455 | procGetModuleInformation = modpsapi.NewProc("GetModuleInformation") |
| 456 | procQueryWorkingSetEx = modpsapi.NewProc("QueryWorkingSetEx") |
| 457 | procSubscribeServiceChangeNotifications = modsechost.NewProc("SubscribeServiceChangeNotifications") |
| 458 | procUnsubscribeServiceChangeNotifications = modsechost.NewProc("UnsubscribeServiceChangeNotifications") |
| 459 | procGetUserNameExW = modsecur32.NewProc("GetUserNameExW") |
| 460 | procTranslateNameW = modsecur32.NewProc("TranslateNameW") |
| 461 | procSetupDiBuildDriverInfoList = modsetupapi.NewProc("SetupDiBuildDriverInfoList") |
| 462 | procSetupDiCallClassInstaller = modsetupapi.NewProc("SetupDiCallClassInstaller") |
| 463 | procSetupDiCancelDriverInfoSearch = modsetupapi.NewProc("SetupDiCancelDriverInfoSearch") |
| 464 | procSetupDiClassGuidsFromNameExW = modsetupapi.NewProc("SetupDiClassGuidsFromNameExW") |
| 465 | procSetupDiClassNameFromGuidExW = modsetupapi.NewProc("SetupDiClassNameFromGuidExW") |
| 466 | procSetupDiCreateDeviceInfoListExW = modsetupapi.NewProc("SetupDiCreateDeviceInfoListExW") |
| 467 | procSetupDiCreateDeviceInfoW = modsetupapi.NewProc("SetupDiCreateDeviceInfoW") |
| 468 | procSetupDiDestroyDeviceInfoList = modsetupapi.NewProc("SetupDiDestroyDeviceInfoList") |
| 469 | procSetupDiDestroyDriverInfoList = modsetupapi.NewProc("SetupDiDestroyDriverInfoList") |
| 470 | procSetupDiEnumDeviceInfo = modsetupapi.NewProc("SetupDiEnumDeviceInfo") |
| 471 | procSetupDiEnumDriverInfoW = modsetupapi.NewProc("SetupDiEnumDriverInfoW") |
| 472 | procSetupDiGetClassDevsExW = modsetupapi.NewProc("SetupDiGetClassDevsExW") |
| 473 | procSetupDiGetClassInstallParamsW = modsetupapi.NewProc("SetupDiGetClassInstallParamsW") |
| 474 | procSetupDiGetDeviceInfoListDetailW = modsetupapi.NewProc("SetupDiGetDeviceInfoListDetailW") |
| 475 | procSetupDiGetDeviceInstallParamsW = modsetupapi.NewProc("SetupDiGetDeviceInstallParamsW") |
| 476 | procSetupDiGetDeviceInstanceIdW = modsetupapi.NewProc("SetupDiGetDeviceInstanceIdW") |
| 477 | procSetupDiGetDevicePropertyW = modsetupapi.NewProc("SetupDiGetDevicePropertyW") |
| 478 | procSetupDiGetDeviceRegistryPropertyW = modsetupapi.NewProc("SetupDiGetDeviceRegistryPropertyW") |
| 479 | procSetupDiGetDriverInfoDetailW = modsetupapi.NewProc("SetupDiGetDriverInfoDetailW") |
| 480 | procSetupDiGetSelectedDevice = modsetupapi.NewProc("SetupDiGetSelectedDevice") |
| 481 | procSetupDiGetSelectedDriverW = modsetupapi.NewProc("SetupDiGetSelectedDriverW") |
| 482 | procSetupDiOpenDevRegKey = modsetupapi.NewProc("SetupDiOpenDevRegKey") |
| 483 | procSetupDiSetClassInstallParamsW = modsetupapi.NewProc("SetupDiSetClassInstallParamsW") |
| 484 | procSetupDiSetDeviceInstallParamsW = modsetupapi.NewProc("SetupDiSetDeviceInstallParamsW") |
| 485 | procSetupDiSetDeviceRegistryPropertyW = modsetupapi.NewProc("SetupDiSetDeviceRegistryPropertyW") |
| 486 | procSetupDiSetSelectedDevice = modsetupapi.NewProc("SetupDiSetSelectedDevice") |
| 487 | procSetupDiSetSelectedDriverW = modsetupapi.NewProc("SetupDiSetSelectedDriverW") |
| 488 | procSetupUninstallOEMInfW = modsetupapi.NewProc("SetupUninstallOEMInfW") |
| 489 | procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW") |
| 490 | procSHGetKnownFolderPath = modshell32.NewProc("SHGetKnownFolderPath") |
| 491 | procShellExecuteW = modshell32.NewProc("ShellExecuteW") |
| 492 | procEnumChildWindows = moduser32.NewProc("EnumChildWindows") |
| 493 | procEnumWindows = moduser32.NewProc("EnumWindows") |
| 494 | procExitWindowsEx = moduser32.NewProc("ExitWindowsEx") |
| 495 | procGetClassNameW = moduser32.NewProc("GetClassNameW") |
| 496 | procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow") |
| 497 | procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow") |
| 498 | procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo") |
| 499 | procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") |
| 500 | procGetShellWindow = moduser32.NewProc("GetShellWindow") |
| 501 | procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId") |
| 502 | procIsWindow = moduser32.NewProc("IsWindow") |
| 503 | procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode") |
| 504 | procIsWindowVisible = moduser32.NewProc("IsWindowVisible") |
| 505 | procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW") |
| 506 | procMessageBoxW = moduser32.NewProc("MessageBoxW") |
| 507 | procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") |
| 508 | procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout") |
| 509 | procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") |
| 510 | procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") |
| 511 | procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") |
| 512 | procGetFileVersionInfoSizeW = modversion.NewProc("GetFileVersionInfoSizeW") |
| 513 | procGetFileVersionInfoW = modversion.NewProc("GetFileVersionInfoW") |
| 514 | procVerQueryValueW = modversion.NewProc("VerQueryValueW") |
| 515 | proctimeBeginPeriod = modwinmm.NewProc("timeBeginPeriod") |
| 516 | proctimeEndPeriod = modwinmm.NewProc("timeEndPeriod") |
| 517 | procWinVerifyTrustEx = modwintrust.NewProc("WinVerifyTrustEx") |
| 518 | procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW") |
| 519 | procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") |
| 520 | procWSACleanup = modws2_32.NewProc("WSACleanup") |
| 521 | procWSADuplicateSocketW = modws2_32.NewProc("WSADuplicateSocketW") |
| 522 | procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW") |
| 523 | procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") |
| 524 | procWSAIoctl = modws2_32.NewProc("WSAIoctl") |
| 525 | procWSALookupServiceBeginW = modws2_32.NewProc("WSALookupServiceBeginW") |
| 526 | procWSALookupServiceEnd = modws2_32.NewProc("WSALookupServiceEnd") |
| 527 | procWSALookupServiceNextW = modws2_32.NewProc("WSALookupServiceNextW") |
| 528 | procWSARecv = modws2_32.NewProc("WSARecv") |
| 529 | procWSARecvFrom = modws2_32.NewProc("WSARecvFrom") |
| 530 | procWSASend = modws2_32.NewProc("WSASend") |
| 531 | procWSASendTo = modws2_32.NewProc("WSASendTo") |
| 532 | procWSASocketW = modws2_32.NewProc("WSASocketW") |
| 533 | procWSAStartup = modws2_32.NewProc("WSAStartup") |
| 534 | procbind = modws2_32.NewProc("bind") |
| 535 | procclosesocket = modws2_32.NewProc("closesocket") |
| 536 | procconnect = modws2_32.NewProc("connect") |
| 537 | procgethostbyname = modws2_32.NewProc("gethostbyname") |
| 538 | procgetpeername = modws2_32.NewProc("getpeername") |
| 539 | procgetprotobyname = modws2_32.NewProc("getprotobyname") |
| 540 | procgetservbyname = modws2_32.NewProc("getservbyname") |
| 541 | procgetsockname = modws2_32.NewProc("getsockname") |
| 542 | procgetsockopt = modws2_32.NewProc("getsockopt") |
| 543 | proclisten = modws2_32.NewProc("listen") |
| 544 | procntohs = modws2_32.NewProc("ntohs") |
| 545 | procrecvfrom = modws2_32.NewProc("recvfrom") |
| 546 | procsendto = modws2_32.NewProc("sendto") |
| 547 | procsetsockopt = modws2_32.NewProc("setsockopt") |
| 548 | procshutdown = modws2_32.NewProc("shutdown") |
| 549 | procsocket = modws2_32.NewProc("socket") |
| 550 | procWTSEnumerateSessionsW = modwtsapi32.NewProc("WTSEnumerateSessionsW") |
| 551 | procWTSFreeMemory = modwtsapi32.NewProc("WTSFreeMemory") |
| 552 | procWTSQueryUserToken = modwtsapi32.NewProc("WTSQueryUserToken") |
| 553 | ) |
| 554 | |
| 555 | func cm_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) (ret CONFIGRET) { |
| 556 | r0, _, _ := syscall.SyscallN(procCM_Get_DevNode_Status.Addr(), uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags)) |
| 557 | ret = CONFIGRET(r0) |
| 558 | return |
| 559 | } |
| 560 | |
| 561 | func cm_Get_Device_Interface_List(interfaceClass *GUID, deviceID *uint16, buffer *uint16, bufferLen uint32, flags uint32) (ret CONFIGRET) { |
| 562 | r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_ListW.Addr(), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags)) |
| 563 | ret = CONFIGRET(r0) |
| 564 | return |
| 565 | } |
| 566 | |
| 567 | func cm_Get_Device_Interface_List_Size(len *uint32, interfaceClass *GUID, deviceID *uint16, flags uint32) (ret CONFIGRET) { |
| 568 | r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_List_SizeW.Addr(), uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags)) |
| 569 | ret = CONFIGRET(r0) |
| 570 | return |
| 571 | } |
| 572 | |
| 573 | func cm_MapCrToWin32Err(configRet CONFIGRET, defaultWin32Error Errno) (ret Errno) { |
| 574 | r0, _, _ := syscall.SyscallN(procCM_MapCrToWin32Err.Addr(), uintptr(configRet), uintptr(defaultWin32Error)) |
| 575 | ret = Errno(r0) |
| 576 | return |
| 577 | } |
| 578 | |
| 579 | func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, buflen uint32, prevstate *Tokengroups, returnlen *uint32) (err error) { |
| 580 | var _p0 uint32 |
| 581 | if resetToDefault { |
| 582 | _p0 = 1 |
| 583 | } |
| 584 | r1, _, e1 := syscall.SyscallN(procAdjustTokenGroups.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) |
| 585 | if r1 == 0 { |
| 586 | err = errnoErr(e1) |
| 587 | } |
| 588 | return |
| 589 | } |
| 590 | |
| 591 | func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tokenprivileges, buflen uint32, prevstate *Tokenprivileges, returnlen *uint32) (err error) { |
| 592 | var _p0 uint32 |
| 593 | if disableAllPrivileges { |
| 594 | _p0 = 1 |
| 595 | } |
| 596 | r1, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) |
| 597 | if r1 == 0 { |
| 598 | err = errnoErr(e1) |
| 599 | } |
| 600 | return |
| 601 | } |
| 602 | |
| 603 | func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) { |
| 604 | r1, _, e1 := syscall.SyscallN(procAllocateAndInitializeSid.Addr(), uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid))) |
| 605 | if r1 == 0 { |
| 606 | err = errnoErr(e1) |
| 607 | } |
| 608 | return |
| 609 | } |
| 610 | |
| 611 | func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) { |
| 612 | r0, _, _ := syscall.SyscallN(procBuildSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) |
| 613 | if r0 != 0 { |
| 614 | ret = syscall.Errno(r0) |
| 615 | } |
| 616 | return |
| 617 | } |
| 618 | |
| 619 | func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) { |
| 620 | r1, _, e1 := syscall.SyscallN(procChangeServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) |
| 621 | if r1 == 0 { |
| 622 | err = errnoErr(e1) |
| 623 | } |
| 624 | return |
| 625 | } |
| 626 | |
| 627 | func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) { |
| 628 | r1, _, e1 := syscall.SyscallN(procChangeServiceConfigW.Addr(), uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName))) |
| 629 | if r1 == 0 { |
| 630 | err = errnoErr(e1) |
| 631 | } |
| 632 | return |
| 633 | } |
| 634 | |
| 635 | func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) { |
| 636 | r1, _, e1 := syscall.SyscallN(procCheckTokenMembership.Addr(), uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) |
| 637 | if r1 == 0 { |
| 638 | err = errnoErr(e1) |
| 639 | } |
| 640 | return |
| 641 | } |
| 642 | |
| 643 | func CloseServiceHandle(handle Handle) (err error) { |
| 644 | r1, _, e1 := syscall.SyscallN(procCloseServiceHandle.Addr(), uintptr(handle)) |
| 645 | if r1 == 0 { |
| 646 | err = errnoErr(e1) |
| 647 | } |
| 648 | return |
| 649 | } |
| 650 | |
| 651 | func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { |
| 652 | r1, _, e1 := syscall.SyscallN(procControlService.Addr(), uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) |
| 653 | if r1 == 0 { |
| 654 | err = errnoErr(e1) |
| 655 | } |
| 656 | return |
| 657 | } |
| 658 | |
| 659 | func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) { |
| 660 | r1, _, e1 := syscall.SyscallN(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen))) |
| 661 | if r1 == 0 { |
| 662 | err = errnoErr(e1) |
| 663 | } |
| 664 | return |
| 665 | } |
| 666 | |
| 667 | func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) { |
| 668 | r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid))) |
| 669 | if r1 == 0 { |
| 670 | err = errnoErr(e1) |
| 671 | } |
| 672 | return |
| 673 | } |
| 674 | |
| 675 | func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { |
| 676 | var _p0 *uint16 |
| 677 | _p0, err = syscall.UTF16PtrFromString(str) |
| 678 | if err != nil { |
| 679 | return |
| 680 | } |
| 681 | return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) |
| 682 | } |
| 683 | |
| 684 | func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { |
| 685 | r1, _, e1 := syscall.SyscallN(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size))) |
| 686 | if r1 == 0 { |
| 687 | err = errnoErr(e1) |
| 688 | } |
| 689 | return |
| 690 | } |
| 691 | |
| 692 | func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { |
| 693 | r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid))) |
| 694 | if r1 == 0 { |
| 695 | err = errnoErr(e1) |
| 696 | } |
| 697 | return |
| 698 | } |
| 699 | |
| 700 | func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) { |
| 701 | r1, _, e1 := syscall.SyscallN(procCopySid.Addr(), uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) |
| 702 | if r1 == 0 { |
| 703 | err = errnoErr(e1) |
| 704 | } |
| 705 | return |
| 706 | } |
| 707 | |
| 708 | func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) { |
| 709 | var _p0 uint32 |
| 710 | if inheritHandles { |
| 711 | _p0 = 1 |
| 712 | } |
| 713 | r1, _, e1 := syscall.SyscallN(procCreateProcessAsUserW.Addr(), uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) |
| 714 | if r1 == 0 { |
| 715 | err = errnoErr(e1) |
| 716 | } |
| 717 | return |
| 718 | } |
| 719 | |
| 720 | func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) { |
| 721 | r0, _, e1 := syscall.SyscallN(procCreateServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password))) |
| 722 | handle = Handle(r0) |
| 723 | if handle == 0 { |
| 724 | err = errnoErr(e1) |
| 725 | } |
| 726 | return |
| 727 | } |
| 728 | |
| 729 | func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) { |
| 730 | r1, _, e1 := syscall.SyscallN(procCreateWellKnownSid.Addr(), uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid))) |
| 731 | if r1 == 0 { |
| 732 | err = errnoErr(e1) |
| 733 | } |
| 734 | return |
| 735 | } |
| 736 | |
| 737 | func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) { |
| 738 | r1, _, e1 := syscall.SyscallN(procCryptAcquireContextW.Addr(), uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags)) |
| 739 | if r1 == 0 { |
| 740 | err = errnoErr(e1) |
| 741 | } |
| 742 | return |
| 743 | } |
| 744 | |
| 745 | func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { |
| 746 | r1, _, e1 := syscall.SyscallN(procCryptGenRandom.Addr(), uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) |
| 747 | if r1 == 0 { |
| 748 | err = errnoErr(e1) |
| 749 | } |
| 750 | return |
| 751 | } |
| 752 | |
| 753 | func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { |
| 754 | r1, _, e1 := syscall.SyscallN(procCryptReleaseContext.Addr(), uintptr(provhandle), uintptr(flags)) |
| 755 | if r1 == 0 { |
| 756 | err = errnoErr(e1) |
| 757 | } |
| 758 | return |
| 759 | } |
| 760 | |
| 761 | func DeleteService(service Handle) (err error) { |
| 762 | r1, _, e1 := syscall.SyscallN(procDeleteService.Addr(), uintptr(service)) |
| 763 | if r1 == 0 { |
| 764 | err = errnoErr(e1) |
| 765 | } |
| 766 | return |
| 767 | } |
| 768 | |
| 769 | func DeregisterEventSource(handle Handle) (err error) { |
| 770 | r1, _, e1 := syscall.SyscallN(procDeregisterEventSource.Addr(), uintptr(handle)) |
| 771 | if r1 == 0 { |
| 772 | err = errnoErr(e1) |
| 773 | } |
| 774 | return |
| 775 | } |
| 776 | |
| 777 | func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) { |
| 778 | r1, _, e1 := syscall.SyscallN(procDuplicateTokenEx.Addr(), uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) |
| 779 | if r1 == 0 { |
| 780 | err = errnoErr(e1) |
| 781 | } |
| 782 | return |
| 783 | } |
| 784 | |
| 785 | func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) { |
| 786 | r1, _, e1 := syscall.SyscallN(procEnumDependentServicesW.Addr(), uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) |
| 787 | if r1 == 0 { |
| 788 | err = errnoErr(e1) |
| 789 | } |
| 790 | return |
| 791 | } |
| 792 | |
| 793 | func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) { |
| 794 | r1, _, e1 := syscall.SyscallN(procEnumServicesStatusExW.Addr(), uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName))) |
| 795 | if r1 == 0 { |
| 796 | err = errnoErr(e1) |
| 797 | } |
| 798 | return |
| 799 | } |
| 800 | |
| 801 | func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { |
| 802 | r0, _, _ := syscall.SyscallN(procEqualSid.Addr(), uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2))) |
| 803 | isEqual = r0 != 0 |
| 804 | return |
| 805 | } |
| 806 | |
| 807 | func FreeSid(sid *SID) (err error) { |
| 808 | r1, _, e1 := syscall.SyscallN(procFreeSid.Addr(), uintptr(unsafe.Pointer(sid))) |
| 809 | if r1 != 0 { |
| 810 | err = errnoErr(e1) |
| 811 | } |
| 812 | return |
| 813 | } |
| 814 | |
| 815 | func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { |
| 816 | r1, _, e1 := syscall.SyscallN(procGetAce.Addr(), uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) |
| 817 | if r1 == 0 { |
| 818 | err = errnoErr(e1) |
| 819 | } |
| 820 | return |
| 821 | } |
| 822 | |
| 823 | func GetLengthSid(sid *SID) (len uint32) { |
| 824 | r0, _, _ := syscall.SyscallN(procGetLengthSid.Addr(), uintptr(unsafe.Pointer(sid))) |
| 825 | len = uint32(r0) |
| 826 | return |
| 827 | } |
| 828 | |
| 829 | func getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { |
| 830 | var _p0 *uint16 |
| 831 | _p0, ret = syscall.UTF16PtrFromString(objectName) |
| 832 | if ret != nil { |
| 833 | return |
| 834 | } |
| 835 | return _getNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl, sd) |
| 836 | } |
| 837 | |
| 838 | func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { |
| 839 | r0, _, _ := syscall.SyscallN(procGetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) |
| 840 | if r0 != 0 { |
| 841 | ret = syscall.Errno(r0) |
| 842 | } |
| 843 | return |
| 844 | } |
| 845 | |
| 846 | func getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) { |
| 847 | r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) |
| 848 | if r1 == 0 { |
| 849 | err = errnoErr(e1) |
| 850 | } |
| 851 | return |
| 852 | } |
| 853 | |
| 854 | func getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl **ACL, daclDefaulted *bool) (err error) { |
| 855 | var _p0 uint32 |
| 856 | if *daclPresent { |
| 857 | _p0 = 1 |
| 858 | } |
| 859 | var _p1 uint32 |
| 860 | if *daclDefaulted { |
| 861 | _p1 = 1 |
| 862 | } |
| 863 | r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1))) |
| 864 | *daclPresent = _p0 != 0 |
| 865 | *daclDefaulted = _p1 != 0 |
| 866 | if r1 == 0 { |
| 867 | err = errnoErr(e1) |
| 868 | } |
| 869 | return |
| 870 | } |
| 871 | |
| 872 | func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefaulted *bool) (err error) { |
| 873 | var _p0 uint32 |
| 874 | if *groupDefaulted { |
| 875 | _p0 = 1 |
| 876 | } |
| 877 | r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) |
| 878 | *groupDefaulted = _p0 != 0 |
| 879 | if r1 == 0 { |
| 880 | err = errnoErr(e1) |
| 881 | } |
| 882 | return |
| 883 | } |
| 884 | |
| 885 | func getSecurityDescriptorLength(sd *SECURITY_DESCRIPTOR) (len uint32) { |
| 886 | r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorLength.Addr(), uintptr(unsafe.Pointer(sd))) |
| 887 | len = uint32(r0) |
| 888 | return |
| 889 | } |
| 890 | |
| 891 | func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefaulted *bool) (err error) { |
| 892 | var _p0 uint32 |
| 893 | if *ownerDefaulted { |
| 894 | _p0 = 1 |
| 895 | } |
| 896 | r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) |
| 897 | *ownerDefaulted = _p0 != 0 |
| 898 | if r1 == 0 { |
| 899 | err = errnoErr(e1) |
| 900 | } |
| 901 | return |
| 902 | } |
| 903 | |
| 904 | func getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) { |
| 905 | r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) |
| 906 | if r0 != 0 { |
| 907 | ret = syscall.Errno(r0) |
| 908 | } |
| 909 | return |
| 910 | } |
| 911 | |
| 912 | func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl **ACL, saclDefaulted *bool) (err error) { |
| 913 | var _p0 uint32 |
| 914 | if *saclPresent { |
| 915 | _p0 = 1 |
| 916 | } |
| 917 | var _p1 uint32 |
| 918 | if *saclDefaulted { |
| 919 | _p1 = 1 |
| 920 | } |
| 921 | r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1))) |
| 922 | *saclPresent = _p0 != 0 |
| 923 | *saclDefaulted = _p1 != 0 |
| 924 | if r1 == 0 { |
| 925 | err = errnoErr(e1) |
| 926 | } |
| 927 | return |
| 928 | } |
| 929 | |
| 930 | func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { |
| 931 | r0, _, _ := syscall.SyscallN(procGetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) |
| 932 | if r0 != 0 { |
| 933 | ret = syscall.Errno(r0) |
| 934 | } |
| 935 | return |
| 936 | } |
| 937 | |
| 938 | func getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) { |
| 939 | r0, _, _ := syscall.SyscallN(procGetSidIdentifierAuthority.Addr(), uintptr(unsafe.Pointer(sid))) |
| 940 | authority = (*SidIdentifierAuthority)(unsafe.Pointer(r0)) |
| 941 | return |
| 942 | } |
| 943 | |
| 944 | func getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) { |
| 945 | r0, _, _ := syscall.SyscallN(procGetSidSubAuthority.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(index)) |
| 946 | subAuthority = (*uint32)(unsafe.Pointer(r0)) |
| 947 | return |
| 948 | } |
| 949 | |
| 950 | func getSidSubAuthorityCount(sid *SID) (count *uint8) { |
| 951 | r0, _, _ := syscall.SyscallN(procGetSidSubAuthorityCount.Addr(), uintptr(unsafe.Pointer(sid))) |
| 952 | count = (*uint8)(unsafe.Pointer(r0)) |
| 953 | return |
| 954 | } |
| 955 | |
| 956 | func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) { |
| 957 | r1, _, e1 := syscall.SyscallN(procGetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen))) |
| 958 | if r1 == 0 { |
| 959 | err = errnoErr(e1) |
| 960 | } |
| 961 | return |
| 962 | } |
| 963 | |
| 964 | func ImpersonateSelf(impersonationlevel uint32) (err error) { |
| 965 | r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(impersonationlevel)) |
| 966 | if r1 == 0 { |
| 967 | err = errnoErr(e1) |
| 968 | } |
| 969 | return |
| 970 | } |
| 971 | |
| 972 | func initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) { |
| 973 | r1, _, e1 := syscall.SyscallN(procInitializeSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision)) |
| 974 | if r1 == 0 { |
| 975 | err = errnoErr(e1) |
| 976 | } |
| 977 | return |
| 978 | } |
| 979 | |
| 980 | func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint32, forceAppsClosed bool, rebootAfterShutdown bool, reason uint32) (err error) { |
| 981 | var _p0 uint32 |
| 982 | if forceAppsClosed { |
| 983 | _p0 = 1 |
| 984 | } |
| 985 | var _p1 uint32 |
| 986 | if rebootAfterShutdown { |
| 987 | _p1 = 1 |
| 988 | } |
| 989 | r1, _, e1 := syscall.SyscallN(procInitiateSystemShutdownExW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) |
| 990 | if r1 == 0 { |
| 991 | err = errnoErr(e1) |
| 992 | } |
| 993 | return |
| 994 | } |
| 995 | |
| 996 | func isTokenRestricted(tokenHandle Token) (ret bool, err error) { |
| 997 | r0, _, e1 := syscall.SyscallN(procIsTokenRestricted.Addr(), uintptr(tokenHandle)) |
| 998 | ret = r0 != 0 |
| 999 | if !ret { |
| 1000 | err = errnoErr(e1) |
| 1001 | } |
| 1002 | return |
| 1003 | } |
| 1004 | |
| 1005 | func isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) { |
| 1006 | r0, _, _ := syscall.SyscallN(procIsValidSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(sd))) |
| 1007 | isValid = r0 != 0 |
| 1008 | return |
| 1009 | } |
| 1010 | |
| 1011 | func isValidSid(sid *SID) (isValid bool) { |
| 1012 | r0, _, _ := syscall.SyscallN(procIsValidSid.Addr(), uintptr(unsafe.Pointer(sid))) |
| 1013 | isValid = r0 != 0 |
| 1014 | return |
| 1015 | } |
| 1016 | |
| 1017 | func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) { |
| 1018 | r0, _, _ := syscall.SyscallN(procIsWellKnownSid.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(sidType)) |
| 1019 | isWellKnown = r0 != 0 |
| 1020 | return |
| 1021 | } |
| 1022 | |
| 1023 | func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { |
| 1024 | r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) |
| 1025 | if r1 == 0 { |
| 1026 | err = errnoErr(e1) |
| 1027 | } |
| 1028 | return |
| 1029 | } |
| 1030 | |
| 1031 | func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { |
| 1032 | r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) |
| 1033 | if r1 == 0 { |
| 1034 | err = errnoErr(e1) |
| 1035 | } |
| 1036 | return |
| 1037 | } |
| 1038 | |
| 1039 | func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) { |
| 1040 | r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) |
| 1041 | if r1 == 0 { |
| 1042 | err = errnoErr(e1) |
| 1043 | } |
| 1044 | return |
| 1045 | } |
| 1046 | |
| 1047 | func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) { |
| 1048 | r1, _, e1 := syscall.SyscallN(procMakeAbsoluteSD.Addr(), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize))) |
| 1049 | if r1 == 0 { |
| 1050 | err = errnoErr(e1) |
| 1051 | } |
| 1052 | return |
| 1053 | } |
| 1054 | |
| 1055 | func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) { |
| 1056 | r1, _, e1 := syscall.SyscallN(procMakeSelfRelativeSD.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) |
| 1057 | if r1 == 0 { |
| 1058 | err = errnoErr(e1) |
| 1059 | } |
| 1060 | return |
| 1061 | } |
| 1062 | |
| 1063 | func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) { |
| 1064 | r0, _, _ := syscall.SyscallN(procNotifyServiceStatusChangeW.Addr(), uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) |
| 1065 | if r0 != 0 { |
| 1066 | ret = syscall.Errno(r0) |
| 1067 | } |
| 1068 | return |
| 1069 | } |
| 1070 | |
| 1071 | func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { |
| 1072 | r1, _, e1 := syscall.SyscallN(procOpenProcessToken.Addr(), uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) |
| 1073 | if r1 == 0 { |
| 1074 | err = errnoErr(e1) |
| 1075 | } |
| 1076 | return |
| 1077 | } |
| 1078 | |
| 1079 | func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) { |
| 1080 | r0, _, e1 := syscall.SyscallN(procOpenSCManagerW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) |
| 1081 | handle = Handle(r0) |
| 1082 | if handle == 0 { |
| 1083 | err = errnoErr(e1) |
| 1084 | } |
| 1085 | return |
| 1086 | } |
| 1087 | |
| 1088 | func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) { |
| 1089 | r0, _, e1 := syscall.SyscallN(procOpenServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) |
| 1090 | handle = Handle(r0) |
| 1091 | if handle == 0 { |
| 1092 | err = errnoErr(e1) |
| 1093 | } |
| 1094 | return |
| 1095 | } |
| 1096 | |
| 1097 | func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token) (err error) { |
| 1098 | var _p0 uint32 |
| 1099 | if openAsSelf { |
| 1100 | _p0 = 1 |
| 1101 | } |
| 1102 | r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token))) |
| 1103 | if r1 == 0 { |
| 1104 | err = errnoErr(e1) |
| 1105 | } |
| 1106 | return |
| 1107 | } |
| 1108 | |
| 1109 | func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { |
| 1110 | r1, _, e1 := syscall.SyscallN(procQueryServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) |
| 1111 | if r1 == 0 { |
| 1112 | err = errnoErr(e1) |
| 1113 | } |
| 1114 | return |
| 1115 | } |
| 1116 | |
| 1117 | func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) { |
| 1118 | r1, _, e1 := syscall.SyscallN(procQueryServiceConfigW.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) |
| 1119 | if r1 == 0 { |
| 1120 | err = errnoErr(e1) |
| 1121 | } |
| 1122 | return |
| 1123 | } |
| 1124 | |
| 1125 | func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInfo unsafe.Pointer) (err error) { |
| 1126 | err = procQueryServiceDynamicInformation.Find() |
| 1127 | if err != nil { |
| 1128 | return |
| 1129 | } |
| 1130 | r1, _, e1 := syscall.SyscallN(procQueryServiceDynamicInformation.Addr(), uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) |
| 1131 | if r1 == 0 { |
| 1132 | err = errnoErr(e1) |
| 1133 | } |
| 1134 | return |
| 1135 | } |
| 1136 | |
| 1137 | func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) { |
| 1138 | r1, _, e1 := syscall.SyscallN(procQueryServiceLockStatusW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) |
| 1139 | if r1 == 0 { |
| 1140 | err = errnoErr(e1) |
| 1141 | } |
| 1142 | return |
| 1143 | } |
| 1144 | |
| 1145 | func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { |
| 1146 | r1, _, e1 := syscall.SyscallN(procQueryServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(status))) |
| 1147 | if r1 == 0 { |
| 1148 | err = errnoErr(e1) |
| 1149 | } |
| 1150 | return |
| 1151 | } |
| 1152 | |
| 1153 | func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { |
| 1154 | r1, _, e1 := syscall.SyscallN(procQueryServiceStatusEx.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) |
| 1155 | if r1 == 0 { |
| 1156 | err = errnoErr(e1) |
| 1157 | } |
| 1158 | return |
| 1159 | } |
| 1160 | |
| 1161 | func RegCloseKey(key Handle) (regerrno error) { |
| 1162 | r0, _, _ := syscall.SyscallN(procRegCloseKey.Addr(), uintptr(key)) |
| 1163 | if r0 != 0 { |
| 1164 | regerrno = syscall.Errno(r0) |
| 1165 | } |
| 1166 | return |
| 1167 | } |
| 1168 | |
| 1169 | func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) { |
| 1170 | r0, _, _ := syscall.SyscallN(procRegEnumKeyExW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime))) |
| 1171 | if r0 != 0 { |
| 1172 | regerrno = syscall.Errno(r0) |
| 1173 | } |
| 1174 | return |
| 1175 | } |
| 1176 | |
| 1177 | func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, event Handle, asynchronous bool) (regerrno error) { |
| 1178 | var _p0 uint32 |
| 1179 | if watchSubtree { |
| 1180 | _p0 = 1 |
| 1181 | } |
| 1182 | var _p1 uint32 |
| 1183 | if asynchronous { |
| 1184 | _p1 = 1 |
| 1185 | } |
| 1186 | r0, _, _ := syscall.SyscallN(procRegNotifyChangeKeyValue.Addr(), uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1)) |
| 1187 | if r0 != 0 { |
| 1188 | regerrno = syscall.Errno(r0) |
| 1189 | } |
| 1190 | return |
| 1191 | } |
| 1192 | |
| 1193 | func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) { |
| 1194 | r0, _, _ := syscall.SyscallN(procRegOpenKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result))) |
| 1195 | if r0 != 0 { |
| 1196 | regerrno = syscall.Errno(r0) |
| 1197 | } |
| 1198 | return |
| 1199 | } |
| 1200 | |
| 1201 | func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) { |
| 1202 | r0, _, _ := syscall.SyscallN(procRegQueryInfoKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) |
| 1203 | if r0 != 0 { |
| 1204 | regerrno = syscall.Errno(r0) |
| 1205 | } |
| 1206 | return |
| 1207 | } |
| 1208 | |
| 1209 | func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { |
| 1210 | r0, _, _ := syscall.SyscallN(procRegQueryValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) |
| 1211 | if r0 != 0 { |
| 1212 | regerrno = syscall.Errno(r0) |
| 1213 | } |
| 1214 | return |
| 1215 | } |
| 1216 | |
| 1217 | func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) { |
| 1218 | r0, _, e1 := syscall.SyscallN(procRegisterEventSourceW.Addr(), uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName))) |
| 1219 | handle = Handle(r0) |
| 1220 | if handle == 0 { |
| 1221 | err = errnoErr(e1) |
| 1222 | } |
| 1223 | return |
| 1224 | } |
| 1225 | |
| 1226 | func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) { |
| 1227 | r0, _, e1 := syscall.SyscallN(procRegisterServiceCtrlHandlerExW.Addr(), uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) |
| 1228 | handle = Handle(r0) |
| 1229 | if handle == 0 { |
| 1230 | err = errnoErr(e1) |
| 1231 | } |
| 1232 | return |
| 1233 | } |
| 1234 | |
| 1235 | func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { |
| 1236 | r1, _, e1 := syscall.SyscallN(procReportEventW.Addr(), uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) |
| 1237 | if r1 == 0 { |
| 1238 | err = errnoErr(e1) |
| 1239 | } |
| 1240 | return |
| 1241 | } |
| 1242 | |
| 1243 | func RevertToSelf() (err error) { |
| 1244 | r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) |
| 1245 | if r1 == 0 { |
| 1246 | err = errnoErr(e1) |
| 1247 | } |
| 1248 | return |
| 1249 | } |
| 1250 | |
| 1251 | func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) { |
| 1252 | r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL))) |
| 1253 | if r0 != 0 { |
| 1254 | ret = syscall.Errno(r0) |
| 1255 | } |
| 1256 | return |
| 1257 | } |
| 1258 | |
| 1259 | func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { |
| 1260 | r1, _, e1 := syscall.SyscallN(procSetKernelObjectSecurity.Addr(), uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) |
| 1261 | if r1 == 0 { |
| 1262 | err = errnoErr(e1) |
| 1263 | } |
| 1264 | return |
| 1265 | } |
| 1266 | |
| 1267 | func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { |
| 1268 | var _p0 *uint16 |
| 1269 | _p0, ret = syscall.UTF16PtrFromString(objectName) |
| 1270 | if ret != nil { |
| 1271 | return |
| 1272 | } |
| 1273 | return _SetNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl) |
| 1274 | } |
| 1275 | |
| 1276 | func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { |
| 1277 | r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) |
| 1278 | if r0 != 0 { |
| 1279 | ret = syscall.Errno(r0) |
| 1280 | } |
| 1281 | return |
| 1282 | } |
| 1283 | |
| 1284 | func setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) { |
| 1285 | r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) |
| 1286 | if r1 == 0 { |
| 1287 | err = errnoErr(e1) |
| 1288 | } |
| 1289 | return |
| 1290 | } |
| 1291 | |
| 1292 | func setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl *ACL, daclDefaulted bool) (err error) { |
| 1293 | var _p0 uint32 |
| 1294 | if daclPresent { |
| 1295 | _p0 = 1 |
| 1296 | } |
| 1297 | var _p1 uint32 |
| 1298 | if daclDefaulted { |
| 1299 | _p1 = 1 |
| 1300 | } |
| 1301 | r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1)) |
| 1302 | if r1 == 0 { |
| 1303 | err = errnoErr(e1) |
| 1304 | } |
| 1305 | return |
| 1306 | } |
| 1307 | |
| 1308 | func setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaulted bool) (err error) { |
| 1309 | var _p0 uint32 |
| 1310 | if groupDefaulted { |
| 1311 | _p0 = 1 |
| 1312 | } |
| 1313 | r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) |
| 1314 | if r1 == 0 { |
| 1315 | err = errnoErr(e1) |
| 1316 | } |
| 1317 | return |
| 1318 | } |
| 1319 | |
| 1320 | func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaulted bool) (err error) { |
| 1321 | var _p0 uint32 |
| 1322 | if ownerDefaulted { |
| 1323 | _p0 = 1 |
| 1324 | } |
| 1325 | r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) |
| 1326 | if r1 == 0 { |
| 1327 | err = errnoErr(e1) |
| 1328 | } |
| 1329 | return |
| 1330 | } |
| 1331 | |
| 1332 | func setSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) { |
| 1333 | syscall.SyscallN(procSetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) |
| 1334 | return |
| 1335 | } |
| 1336 | |
| 1337 | func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl *ACL, saclDefaulted bool) (err error) { |
| 1338 | var _p0 uint32 |
| 1339 | if saclPresent { |
| 1340 | _p0 = 1 |
| 1341 | } |
| 1342 | var _p1 uint32 |
| 1343 | if saclDefaulted { |
| 1344 | _p1 = 1 |
| 1345 | } |
| 1346 | r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1)) |
| 1347 | if r1 == 0 { |
| 1348 | err = errnoErr(e1) |
| 1349 | } |
| 1350 | return |
| 1351 | } |
| 1352 | |
| 1353 | func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { |
| 1354 | r0, _, _ := syscall.SyscallN(procSetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) |
| 1355 | if r0 != 0 { |
| 1356 | ret = syscall.Errno(r0) |
| 1357 | } |
| 1358 | return |
| 1359 | } |
| 1360 | |
| 1361 | func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) { |
| 1362 | r1, _, e1 := syscall.SyscallN(procSetServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceStatus))) |
| 1363 | if r1 == 0 { |
| 1364 | err = errnoErr(e1) |
| 1365 | } |
| 1366 | return |
| 1367 | } |
| 1368 | |
| 1369 | func SetThreadToken(thread *Handle, token Token) (err error) { |
| 1370 | r1, _, e1 := syscall.SyscallN(procSetThreadToken.Addr(), uintptr(unsafe.Pointer(thread)), uintptr(token)) |
| 1371 | if r1 == 0 { |
| 1372 | err = errnoErr(e1) |
| 1373 | } |
| 1374 | return |
| 1375 | } |
| 1376 | |
| 1377 | func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) { |
| 1378 | r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen)) |
| 1379 | if r1 == 0 { |
| 1380 | err = errnoErr(e1) |
| 1381 | } |
| 1382 | return |
| 1383 | } |
| 1384 | |
| 1385 | func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { |
| 1386 | r1, _, e1 := syscall.SyscallN(procStartServiceCtrlDispatcherW.Addr(), uintptr(unsafe.Pointer(serviceTable))) |
| 1387 | if r1 == 0 { |
| 1388 | err = errnoErr(e1) |
| 1389 | } |
| 1390 | return |
| 1391 | } |
| 1392 | |
| 1393 | func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) { |
| 1394 | r1, _, e1 := syscall.SyscallN(procStartServiceW.Addr(), uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) |
| 1395 | if r1 == 0 { |
| 1396 | err = errnoErr(e1) |
| 1397 | } |
| 1398 | return |
| 1399 | } |
| 1400 | |
| 1401 | func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) { |
| 1402 | r1, _, e1 := syscall.SyscallN(procCertAddCertificateContextToStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext))) |
| 1403 | if r1 == 0 { |
| 1404 | err = errnoErr(e1) |
| 1405 | } |
| 1406 | return |
| 1407 | } |
| 1408 | |
| 1409 | func CertCloseStore(store Handle, flags uint32) (err error) { |
| 1410 | r1, _, e1 := syscall.SyscallN(procCertCloseStore.Addr(), uintptr(store), uintptr(flags)) |
| 1411 | if r1 == 0 { |
| 1412 | err = errnoErr(e1) |
| 1413 | } |
| 1414 | return |
| 1415 | } |
| 1416 | |
| 1417 | func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) { |
| 1418 | r0, _, e1 := syscall.SyscallN(procCertCreateCertificateContext.Addr(), uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) |
| 1419 | context = (*CertContext)(unsafe.Pointer(r0)) |
| 1420 | if context == nil { |
| 1421 | err = errnoErr(e1) |
| 1422 | } |
| 1423 | return |
| 1424 | } |
| 1425 | |
| 1426 | func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { |
| 1427 | r1, _, e1 := syscall.SyscallN(procCertDeleteCertificateFromStore.Addr(), uintptr(unsafe.Pointer(certContext))) |
| 1428 | if r1 == 0 { |
| 1429 | err = errnoErr(e1) |
| 1430 | } |
| 1431 | return |
| 1432 | } |
| 1433 | |
| 1434 | func CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) { |
| 1435 | r0, _, _ := syscall.SyscallN(procCertDuplicateCertificateContext.Addr(), uintptr(unsafe.Pointer(certContext))) |
| 1436 | dupContext = (*CertContext)(unsafe.Pointer(r0)) |
| 1437 | return |
| 1438 | } |
| 1439 | |
| 1440 | func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) { |
| 1441 | r0, _, e1 := syscall.SyscallN(procCertEnumCertificatesInStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(prevContext))) |
| 1442 | context = (*CertContext)(unsafe.Pointer(r0)) |
| 1443 | if context == nil { |
| 1444 | err = errnoErr(e1) |
| 1445 | } |
| 1446 | return |
| 1447 | } |
| 1448 | |
| 1449 | func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) { |
| 1450 | r0, _, e1 := syscall.SyscallN(procCertFindCertificateInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext))) |
| 1451 | cert = (*CertContext)(unsafe.Pointer(r0)) |
| 1452 | if cert == nil { |
| 1453 | err = errnoErr(e1) |
| 1454 | } |
| 1455 | return |
| 1456 | } |
| 1457 | |
| 1458 | func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) { |
| 1459 | r0, _, e1 := syscall.SyscallN(procCertFindChainInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext))) |
| 1460 | certchain = (*CertChainContext)(unsafe.Pointer(r0)) |
| 1461 | if certchain == nil { |
| 1462 | err = errnoErr(e1) |
| 1463 | } |
| 1464 | return |
| 1465 | } |
| 1466 | |
| 1467 | func CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) { |
| 1468 | r0, _, _ := syscall.SyscallN(procCertFindExtension.Addr(), uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions))) |
| 1469 | ret = (*CertExtension)(unsafe.Pointer(r0)) |
| 1470 | return |
| 1471 | } |
| 1472 | |
| 1473 | func CertFreeCertificateChain(ctx *CertChainContext) { |
| 1474 | syscall.SyscallN(procCertFreeCertificateChain.Addr(), uintptr(unsafe.Pointer(ctx))) |
| 1475 | return |
| 1476 | } |
| 1477 | |
| 1478 | func CertFreeCertificateContext(ctx *CertContext) (err error) { |
| 1479 | r1, _, e1 := syscall.SyscallN(procCertFreeCertificateContext.Addr(), uintptr(unsafe.Pointer(ctx))) |
| 1480 | if r1 == 0 { |
| 1481 | err = errnoErr(e1) |
| 1482 | } |
| 1483 | return |
| 1484 | } |
| 1485 | |
| 1486 | func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) { |
| 1487 | r1, _, e1 := syscall.SyscallN(procCertGetCertificateChain.Addr(), uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx))) |
| 1488 | if r1 == 0 { |
| 1489 | err = errnoErr(e1) |
| 1490 | } |
| 1491 | return |
| 1492 | } |
| 1493 | |
| 1494 | func CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) { |
| 1495 | r0, _, _ := syscall.SyscallN(procCertGetNameStringW.Addr(), uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size)) |
| 1496 | chars = uint32(r0) |
| 1497 | return |
| 1498 | } |
| 1499 | |
| 1500 | func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) { |
| 1501 | r0, _, e1 := syscall.SyscallN(procCertOpenStore.Addr(), uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para)) |
| 1502 | handle = Handle(r0) |
| 1503 | if handle == 0 { |
| 1504 | err = errnoErr(e1) |
| 1505 | } |
| 1506 | return |
| 1507 | } |
| 1508 | |
| 1509 | func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { |
| 1510 | r0, _, e1 := syscall.SyscallN(procCertOpenSystemStoreW.Addr(), uintptr(hprov), uintptr(unsafe.Pointer(name))) |
| 1511 | store = Handle(r0) |
| 1512 | if store == 0 { |
| 1513 | err = errnoErr(e1) |
| 1514 | } |
| 1515 | return |
| 1516 | } |
| 1517 | |
| 1518 | func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) { |
| 1519 | r1, _, e1 := syscall.SyscallN(procCertVerifyCertificateChainPolicy.Addr(), uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status))) |
| 1520 | if r1 == 0 { |
| 1521 | err = errnoErr(e1) |
| 1522 | } |
| 1523 | return |
| 1524 | } |
| 1525 | |
| 1526 | func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, parameters unsafe.Pointer, cryptProvOrNCryptKey *Handle, keySpec *uint32, callerFreeProvOrNCryptKey *bool) (err error) { |
| 1527 | var _p0 uint32 |
| 1528 | if *callerFreeProvOrNCryptKey { |
| 1529 | _p0 = 1 |
| 1530 | } |
| 1531 | r1, _, e1 := syscall.SyscallN(procCryptAcquireCertificatePrivateKey.Addr(), uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) |
| 1532 | *callerFreeProvOrNCryptKey = _p0 != 0 |
| 1533 | if r1 == 0 { |
| 1534 | err = errnoErr(e1) |
| 1535 | } |
| 1536 | return |
| 1537 | } |
| 1538 | |
| 1539 | func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) { |
| 1540 | r1, _, e1 := syscall.SyscallN(procCryptDecodeObject.Addr(), uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen))) |
| 1541 | if r1 == 0 { |
| 1542 | err = errnoErr(e1) |
| 1543 | } |
| 1544 | return |
| 1545 | } |
| 1546 | |
| 1547 | func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { |
| 1548 | r1, _, e1 := syscall.SyscallN(procCryptProtectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) |
| 1549 | if r1 == 0 { |
| 1550 | err = errnoErr(e1) |
| 1551 | } |
| 1552 | return |
| 1553 | } |
| 1554 | |
| 1555 | func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) { |
| 1556 | r1, _, e1 := syscall.SyscallN(procCryptQueryObject.Addr(), uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context))) |
| 1557 | if r1 == 0 { |
| 1558 | err = errnoErr(e1) |
| 1559 | } |
| 1560 | return |
| 1561 | } |
| 1562 | |
| 1563 | func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { |
| 1564 | r1, _, e1 := syscall.SyscallN(procCryptUnprotectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) |
| 1565 | if r1 == 0 { |
| 1566 | err = errnoErr(e1) |
| 1567 | } |
| 1568 | return |
| 1569 | } |
| 1570 | |
| 1571 | func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) { |
| 1572 | r0, _, e1 := syscall.SyscallN(procPFXImportCertStore.Addr(), uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags)) |
| 1573 | store = Handle(r0) |
| 1574 | if store == 0 { |
| 1575 | err = errnoErr(e1) |
| 1576 | } |
| 1577 | return |
| 1578 | } |
| 1579 | |
| 1580 | func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) { |
| 1581 | r0, _, _ := syscall.SyscallN(procDnsNameCompare_W.Addr(), uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2))) |
| 1582 | same = r0 != 0 |
| 1583 | return |
| 1584 | } |
| 1585 | |
| 1586 | func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { |
| 1587 | var _p0 *uint16 |
| 1588 | _p0, status = syscall.UTF16PtrFromString(name) |
| 1589 | if status != nil { |
| 1590 | return |
| 1591 | } |
| 1592 | return _DnsQuery(_p0, qtype, options, extra, qrs, pr) |
| 1593 | } |
| 1594 | |
| 1595 | func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { |
| 1596 | r0, _, _ := syscall.SyscallN(procDnsQuery_W.Addr(), uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) |
| 1597 | if r0 != 0 { |
| 1598 | status = syscall.Errno(r0) |
| 1599 | } |
| 1600 | return |
| 1601 | } |
| 1602 | |
| 1603 | func DnsRecordListFree(rl *DNSRecord, freetype uint32) { |
| 1604 | syscall.SyscallN(procDnsRecordListFree.Addr(), uintptr(unsafe.Pointer(rl)), uintptr(freetype)) |
| 1605 | return |
| 1606 | } |
| 1607 | |
| 1608 | func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { |
| 1609 | r0, _, _ := syscall.SyscallN(procDwmGetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) |
| 1610 | if r0 != 0 { |
| 1611 | ret = syscall.Errno(r0) |
| 1612 | } |
| 1613 | return |
| 1614 | } |
| 1615 | |
| 1616 | func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { |
| 1617 | r0, _, _ := syscall.SyscallN(procDwmSetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) |
| 1618 | if r0 != 0 { |
| 1619 | ret = syscall.Errno(r0) |
| 1620 | } |
| 1621 | return |
| 1622 | } |
| 1623 | |
| 1624 | func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { |
| 1625 | r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle)) |
| 1626 | if r0 != 0 { |
| 1627 | errcode = syscall.Errno(r0) |
| 1628 | } |
| 1629 | return |
| 1630 | } |
| 1631 | |
| 1632 | func FreeMibTable(memory unsafe.Pointer) { |
| 1633 | syscall.SyscallN(procFreeMibTable.Addr(), uintptr(memory)) |
| 1634 | return |
| 1635 | } |
| 1636 | |
| 1637 | func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { |
| 1638 | r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer))) |
| 1639 | if r0 != 0 { |
| 1640 | errcode = syscall.Errno(r0) |
| 1641 | } |
| 1642 | return |
| 1643 | } |
| 1644 | |
| 1645 | func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { |
| 1646 | r0, _, _ := syscall.SyscallN(procGetAdaptersInfo.Addr(), uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol))) |
| 1647 | if r0 != 0 { |
| 1648 | errcode = syscall.Errno(r0) |
| 1649 | } |
| 1650 | return |
| 1651 | } |
| 1652 | |
| 1653 | func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) { |
| 1654 | r0, _, _ := syscall.SyscallN(procGetBestInterfaceEx.Addr(), uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex))) |
| 1655 | if r0 != 0 { |
| 1656 | errcode = syscall.Errno(r0) |
| 1657 | } |
| 1658 | return |
| 1659 | } |
| 1660 | |
| 1661 | func GetIfEntry(pIfRow *MibIfRow) (errcode error) { |
| 1662 | r0, _, _ := syscall.SyscallN(procGetIfEntry.Addr(), uintptr(unsafe.Pointer(pIfRow))) |
| 1663 | if r0 != 0 { |
| 1664 | errcode = syscall.Errno(r0) |
| 1665 | } |
| 1666 | return |
| 1667 | } |
| 1668 | |
| 1669 | func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { |
| 1670 | r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row))) |
| 1671 | if r0 != 0 { |
| 1672 | errcode = syscall.Errno(r0) |
| 1673 | } |
| 1674 | return |
| 1675 | } |
| 1676 | |
| 1677 | func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { |
| 1678 | r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) |
| 1679 | if r0 != 0 { |
| 1680 | errcode = syscall.Errno(r0) |
| 1681 | } |
| 1682 | return |
| 1683 | } |
| 1684 | |
| 1685 | func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) { |
| 1686 | r0, _, _ := syscall.SyscallN(procGetIpForwardTable2.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) |
| 1687 | if r0 != 0 { |
| 1688 | errcode = syscall.Errno(r0) |
| 1689 | } |
| 1690 | return |
| 1691 | } |
| 1692 | |
| 1693 | func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { |
| 1694 | r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) |
| 1695 | if r0 != 0 { |
| 1696 | errcode = syscall.Errno(r0) |
| 1697 | } |
| 1698 | return |
| 1699 | } |
| 1700 | |
| 1701 | func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { |
| 1702 | var _p0 uint32 |
| 1703 | if initialNotification { |
| 1704 | _p0 = 1 |
| 1705 | } |
| 1706 | r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) |
| 1707 | if r0 != 0 { |
| 1708 | errcode = syscall.Errno(r0) |
| 1709 | } |
| 1710 | return |
| 1711 | } |
| 1712 | |
| 1713 | func NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { |
| 1714 | var _p0 uint32 |
| 1715 | if initialNotification { |
| 1716 | _p0 = 1 |
| 1717 | } |
| 1718 | r0, _, _ := syscall.SyscallN(procNotifyRouteChange2.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) |
| 1719 | if r0 != 0 { |
| 1720 | errcode = syscall.Errno(r0) |
| 1721 | } |
| 1722 | return |
| 1723 | } |
| 1724 | |
| 1725 | func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { |
| 1726 | var _p0 uint32 |
| 1727 | if initialNotification { |
| 1728 | _p0 = 1 |
| 1729 | } |
| 1730 | r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) |
| 1731 | if r0 != 0 { |
| 1732 | errcode = syscall.Errno(r0) |
| 1733 | } |
| 1734 | return |
| 1735 | } |
| 1736 | |
| 1737 | func AddDllDirectory(path *uint16) (cookie uintptr, err error) { |
| 1738 | r0, _, e1 := syscall.SyscallN(procAddDllDirectory.Addr(), uintptr(unsafe.Pointer(path))) |
| 1739 | cookie = uintptr(r0) |
| 1740 | if cookie == 0 { |
| 1741 | err = errnoErr(e1) |
| 1742 | } |
| 1743 | return |
| 1744 | } |
| 1745 | |
| 1746 | func AssignProcessToJobObject(job Handle, process Handle) (err error) { |
| 1747 | r1, _, e1 := syscall.SyscallN(procAssignProcessToJobObject.Addr(), uintptr(job), uintptr(process)) |
| 1748 | if r1 == 0 { |
| 1749 | err = errnoErr(e1) |
| 1750 | } |
| 1751 | return |
| 1752 | } |
| 1753 | |
| 1754 | func CancelIo(s Handle) (err error) { |
| 1755 | r1, _, e1 := syscall.SyscallN(procCancelIo.Addr(), uintptr(s)) |
| 1756 | if r1 == 0 { |
| 1757 | err = errnoErr(e1) |
| 1758 | } |
| 1759 | return |
| 1760 | } |
| 1761 | |
| 1762 | func CancelIoEx(s Handle, o *Overlapped) (err error) { |
| 1763 | r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(s), uintptr(unsafe.Pointer(o))) |
| 1764 | if r1 == 0 { |
| 1765 | err = errnoErr(e1) |
| 1766 | } |
| 1767 | return |
| 1768 | } |
| 1769 | |
| 1770 | func ClearCommBreak(handle Handle) (err error) { |
| 1771 | r1, _, e1 := syscall.SyscallN(procClearCommBreak.Addr(), uintptr(handle)) |
| 1772 | if r1 == 0 { |
| 1773 | err = errnoErr(e1) |
| 1774 | } |
| 1775 | return |
| 1776 | } |
| 1777 | |
| 1778 | func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { |
| 1779 | r1, _, e1 := syscall.SyscallN(procClearCommError.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) |
| 1780 | if r1 == 0 { |
| 1781 | err = errnoErr(e1) |
| 1782 | } |
| 1783 | return |
| 1784 | } |
| 1785 | |
| 1786 | func CloseHandle(handle Handle) (err error) { |
| 1787 | r1, _, e1 := syscall.SyscallN(procCloseHandle.Addr(), uintptr(handle)) |
| 1788 | if r1 == 0 { |
| 1789 | err = errnoErr(e1) |
| 1790 | } |
| 1791 | return |
| 1792 | } |
| 1793 | |
| 1794 | func ClosePseudoConsole(console Handle) { |
| 1795 | syscall.SyscallN(procClosePseudoConsole.Addr(), uintptr(console)) |
| 1796 | return |
| 1797 | } |
| 1798 | |
| 1799 | func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { |
| 1800 | r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(overlapped))) |
| 1801 | if r1 == 0 { |
| 1802 | err = errnoErr(e1) |
| 1803 | } |
| 1804 | return |
| 1805 | } |
| 1806 | |
| 1807 | func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { |
| 1808 | r1, _, e1 := syscall.SyscallN(procCreateDirectoryW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa))) |
| 1809 | if r1 == 0 { |
| 1810 | err = errnoErr(e1) |
| 1811 | } |
| 1812 | return |
| 1813 | } |
| 1814 | |
| 1815 | func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { |
| 1816 | r0, _, e1 := syscall.SyscallN(procCreateEventExW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) |
| 1817 | handle = Handle(r0) |
| 1818 | if handle == 0 || e1 == ERROR_ALREADY_EXISTS { |
| 1819 | err = errnoErr(e1) |
| 1820 | } |
| 1821 | return |
| 1822 | } |
| 1823 | |
| 1824 | func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) { |
| 1825 | r0, _, e1 := syscall.SyscallN(procCreateEventW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name))) |
| 1826 | handle = Handle(r0) |
| 1827 | if handle == 0 || e1 == ERROR_ALREADY_EXISTS { |
| 1828 | err = errnoErr(e1) |
| 1829 | } |
| 1830 | return |
| 1831 | } |
| 1832 | |
| 1833 | func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) { |
| 1834 | r0, _, e1 := syscall.SyscallN(procCreateFileMappingW.Addr(), uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) |
| 1835 | handle = Handle(r0) |
| 1836 | if handle == 0 || e1 == ERROR_ALREADY_EXISTS { |
| 1837 | err = errnoErr(e1) |
| 1838 | } |
| 1839 | return |
| 1840 | } |
| 1841 | |
| 1842 | func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) { |
| 1843 | r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) |
| 1844 | handle = Handle(r0) |
| 1845 | if handle == InvalidHandle { |
| 1846 | err = errnoErr(e1) |
| 1847 | } |
| 1848 | return |
| 1849 | } |
| 1850 | |
| 1851 | func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) { |
| 1852 | r1, _, e1 := syscall.SyscallN(procCreateHardLinkW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) |
| 1853 | if r1&0xff == 0 { |
| 1854 | err = errnoErr(e1) |
| 1855 | } |
| 1856 | return |
| 1857 | } |
| 1858 | |
| 1859 | func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) { |
| 1860 | r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt)) |
| 1861 | handle = Handle(r0) |
| 1862 | if handle == 0 { |
| 1863 | err = errnoErr(e1) |
| 1864 | } |
| 1865 | return |
| 1866 | } |
| 1867 | |
| 1868 | func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) { |
| 1869 | r0, _, e1 := syscall.SyscallN(procCreateJobObjectW.Addr(), uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name))) |
| 1870 | handle = Handle(r0) |
| 1871 | if handle == 0 { |
| 1872 | err = errnoErr(e1) |
| 1873 | } |
| 1874 | return |
| 1875 | } |
| 1876 | |
| 1877 | func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { |
| 1878 | r0, _, e1 := syscall.SyscallN(procCreateMutexExW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) |
| 1879 | handle = Handle(r0) |
| 1880 | if handle == 0 || e1 == ERROR_ALREADY_EXISTS { |
| 1881 | err = errnoErr(e1) |
| 1882 | } |
| 1883 | return |
| 1884 | } |
| 1885 | |
| 1886 | func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) { |
| 1887 | var _p0 uint32 |
| 1888 | if initialOwner { |
| 1889 | _p0 = 1 |
| 1890 | } |
| 1891 | r0, _, e1 := syscall.SyscallN(procCreateMutexW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) |
| 1892 | handle = Handle(r0) |
| 1893 | if handle == 0 || e1 == ERROR_ALREADY_EXISTS { |
| 1894 | err = errnoErr(e1) |
| 1895 | } |
| 1896 | return |
| 1897 | } |
| 1898 | |
| 1899 | func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) { |
| 1900 | r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) |
| 1901 | handle = Handle(r0) |
| 1902 | if handle == InvalidHandle { |
| 1903 | err = errnoErr(e1) |
| 1904 | } |
| 1905 | return |
| 1906 | } |
| 1907 | |
| 1908 | func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) { |
| 1909 | r1, _, e1 := syscall.SyscallN(procCreatePipe.Addr(), uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size)) |
| 1910 | if r1 == 0 { |
| 1911 | err = errnoErr(e1) |
| 1912 | } |
| 1913 | return |
| 1914 | } |
| 1915 | |
| 1916 | func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) { |
| 1917 | var _p0 uint32 |
| 1918 | if inheritHandles { |
| 1919 | _p0 = 1 |
| 1920 | } |
| 1921 | r1, _, e1 := syscall.SyscallN(procCreateProcessW.Addr(), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) |
| 1922 | if r1 == 0 { |
| 1923 | err = errnoErr(e1) |
| 1924 | } |
| 1925 | return |
| 1926 | } |
| 1927 | |
| 1928 | func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) { |
| 1929 | r0, _, _ := syscall.SyscallN(procCreatePseudoConsole.Addr(), uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole))) |
| 1930 | if r0 != 0 { |
| 1931 | hr = syscall.Errno(r0) |
| 1932 | } |
| 1933 | return |
| 1934 | } |
| 1935 | |
| 1936 | func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) { |
| 1937 | r1, _, e1 := syscall.SyscallN(procCreateSymbolicLinkW.Addr(), uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) |
| 1938 | if r1&0xff == 0 { |
| 1939 | err = errnoErr(e1) |
| 1940 | } |
| 1941 | return |
| 1942 | } |
| 1943 | |
| 1944 | func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) { |
| 1945 | r0, _, e1 := syscall.SyscallN(procCreateToolhelp32Snapshot.Addr(), uintptr(flags), uintptr(processId)) |
| 1946 | handle = Handle(r0) |
| 1947 | if handle == InvalidHandle { |
| 1948 | err = errnoErr(e1) |
| 1949 | } |
| 1950 | return |
| 1951 | } |
| 1952 | |
| 1953 | func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) { |
| 1954 | r1, _, e1 := syscall.SyscallN(procDefineDosDeviceW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) |
| 1955 | if r1 == 0 { |
| 1956 | err = errnoErr(e1) |
| 1957 | } |
| 1958 | return |
| 1959 | } |
| 1960 | |
| 1961 | func DeleteFile(path *uint16) (err error) { |
| 1962 | r1, _, e1 := syscall.SyscallN(procDeleteFileW.Addr(), uintptr(unsafe.Pointer(path))) |
| 1963 | if r1 == 0 { |
| 1964 | err = errnoErr(e1) |
| 1965 | } |
| 1966 | return |
| 1967 | } |
| 1968 | |
| 1969 | func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) { |
| 1970 | syscall.SyscallN(procDeleteProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist))) |
| 1971 | return |
| 1972 | } |
| 1973 | |
| 1974 | func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { |
| 1975 | r1, _, e1 := syscall.SyscallN(procDeleteVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint))) |
| 1976 | if r1 == 0 { |
| 1977 | err = errnoErr(e1) |
| 1978 | } |
| 1979 | return |
| 1980 | } |
| 1981 | |
| 1982 | func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { |
| 1983 | r1, _, e1 := syscall.SyscallN(procDeviceIoControl.Addr(), uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped))) |
| 1984 | if r1 == 0 { |
| 1985 | err = errnoErr(e1) |
| 1986 | } |
| 1987 | return |
| 1988 | } |
| 1989 | |
| 1990 | func DisconnectNamedPipe(pipe Handle) (err error) { |
| 1991 | r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) |
| 1992 | if r1 == 0 { |
| 1993 | err = errnoErr(e1) |
| 1994 | } |
| 1995 | return |
| 1996 | } |
| 1997 | |
| 1998 | func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) { |
| 1999 | var _p0 uint32 |
| 2000 | if bInheritHandle { |
| 2001 | _p0 = 1 |
| 2002 | } |
| 2003 | r1, _, e1 := syscall.SyscallN(procDuplicateHandle.Addr(), uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions)) |
| 2004 | if r1 == 0 { |
| 2005 | err = errnoErr(e1) |
| 2006 | } |
| 2007 | return |
| 2008 | } |
| 2009 | |
| 2010 | func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { |
| 2011 | r1, _, e1 := syscall.SyscallN(procEscapeCommFunction.Addr(), uintptr(handle), uintptr(dwFunc)) |
| 2012 | if r1 == 0 { |
| 2013 | err = errnoErr(e1) |
| 2014 | } |
| 2015 | return |
| 2016 | } |
| 2017 | |
| 2018 | func ExitProcess(exitcode uint32) { |
| 2019 | syscall.SyscallN(procExitProcess.Addr(), uintptr(exitcode)) |
| 2020 | return |
| 2021 | } |
| 2022 | |
| 2023 | func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) { |
| 2024 | r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) |
| 2025 | n = uint32(r0) |
| 2026 | if n == 0 { |
| 2027 | err = errnoErr(e1) |
| 2028 | } |
| 2029 | return |
| 2030 | } |
| 2031 | |
| 2032 | func FindClose(handle Handle) (err error) { |
| 2033 | r1, _, e1 := syscall.SyscallN(procFindClose.Addr(), uintptr(handle)) |
| 2034 | if r1 == 0 { |
| 2035 | err = errnoErr(e1) |
| 2036 | } |
| 2037 | return |
| 2038 | } |
| 2039 | |
| 2040 | func FindCloseChangeNotification(handle Handle) (err error) { |
| 2041 | r1, _, e1 := syscall.SyscallN(procFindCloseChangeNotification.Addr(), uintptr(handle)) |
| 2042 | if r1 == 0 { |
| 2043 | err = errnoErr(e1) |
| 2044 | } |
| 2045 | return |
| 2046 | } |
| 2047 | |
| 2048 | func FindFirstChangeNotification(path string, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) { |
| 2049 | var _p0 *uint16 |
| 2050 | _p0, err = syscall.UTF16PtrFromString(path) |
| 2051 | if err != nil { |
| 2052 | return |
| 2053 | } |
| 2054 | return _FindFirstChangeNotification(_p0, watchSubtree, notifyFilter) |
| 2055 | } |
| 2056 | |
| 2057 | func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) { |
| 2058 | var _p1 uint32 |
| 2059 | if watchSubtree { |
| 2060 | _p1 = 1 |
| 2061 | } |
| 2062 | r0, _, e1 := syscall.SyscallN(procFindFirstChangeNotificationW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter)) |
| 2063 | handle = Handle(r0) |
| 2064 | if handle == InvalidHandle { |
| 2065 | err = errnoErr(e1) |
| 2066 | } |
| 2067 | return |
| 2068 | } |
| 2069 | |
| 2070 | func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) { |
| 2071 | r0, _, e1 := syscall.SyscallN(procFindFirstFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data))) |
| 2072 | handle = Handle(r0) |
| 2073 | if handle == InvalidHandle { |
| 2074 | err = errnoErr(e1) |
| 2075 | } |
| 2076 | return |
| 2077 | } |
| 2078 | |
| 2079 | func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, bufferLength uint32) (handle Handle, err error) { |
| 2080 | r0, _, e1 := syscall.SyscallN(procFindFirstVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) |
| 2081 | handle = Handle(r0) |
| 2082 | if handle == InvalidHandle { |
| 2083 | err = errnoErr(e1) |
| 2084 | } |
| 2085 | return |
| 2086 | } |
| 2087 | |
| 2088 | func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, err error) { |
| 2089 | r0, _, e1 := syscall.SyscallN(procFindFirstVolumeW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) |
| 2090 | handle = Handle(r0) |
| 2091 | if handle == InvalidHandle { |
| 2092 | err = errnoErr(e1) |
| 2093 | } |
| 2094 | return |
| 2095 | } |
| 2096 | |
| 2097 | func FindNextChangeNotification(handle Handle) (err error) { |
| 2098 | r1, _, e1 := syscall.SyscallN(procFindNextChangeNotification.Addr(), uintptr(handle)) |
| 2099 | if r1 == 0 { |
| 2100 | err = errnoErr(e1) |
| 2101 | } |
| 2102 | return |
| 2103 | } |
| 2104 | |
| 2105 | func findNextFile1(handle Handle, data *win32finddata1) (err error) { |
| 2106 | r1, _, e1 := syscall.SyscallN(procFindNextFileW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) |
| 2107 | if r1 == 0 { |
| 2108 | err = errnoErr(e1) |
| 2109 | } |
| 2110 | return |
| 2111 | } |
| 2112 | |
| 2113 | func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) { |
| 2114 | r1, _, e1 := syscall.SyscallN(procFindNextVolumeMountPointW.Addr(), uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) |
| 2115 | if r1 == 0 { |
| 2116 | err = errnoErr(e1) |
| 2117 | } |
| 2118 | return |
| 2119 | } |
| 2120 | |
| 2121 | func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) { |
| 2122 | r1, _, e1 := syscall.SyscallN(procFindNextVolumeW.Addr(), uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) |
| 2123 | if r1 == 0 { |
| 2124 | err = errnoErr(e1) |
| 2125 | } |
| 2126 | return |
| 2127 | } |
| 2128 | |
| 2129 | func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) { |
| 2130 | r0, _, e1 := syscall.SyscallN(procFindResourceW.Addr(), uintptr(module), uintptr(name), uintptr(resType)) |
| 2131 | resInfo = Handle(r0) |
| 2132 | if resInfo == 0 { |
| 2133 | err = errnoErr(e1) |
| 2134 | } |
| 2135 | return |
| 2136 | } |
| 2137 | |
| 2138 | func FindVolumeClose(findVolume Handle) (err error) { |
| 2139 | r1, _, e1 := syscall.SyscallN(procFindVolumeClose.Addr(), uintptr(findVolume)) |
| 2140 | if r1 == 0 { |
| 2141 | err = errnoErr(e1) |
| 2142 | } |
| 2143 | return |
| 2144 | } |
| 2145 | |
| 2146 | func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { |
| 2147 | r1, _, e1 := syscall.SyscallN(procFindVolumeMountPointClose.Addr(), uintptr(findVolumeMountPoint)) |
| 2148 | if r1 == 0 { |
| 2149 | err = errnoErr(e1) |
| 2150 | } |
| 2151 | return |
| 2152 | } |
| 2153 | |
| 2154 | func FlushConsoleInputBuffer(console Handle) (err error) { |
| 2155 | r1, _, e1 := syscall.SyscallN(procFlushConsoleInputBuffer.Addr(), uintptr(console)) |
| 2156 | if r1 == 0 { |
| 2157 | err = errnoErr(e1) |
| 2158 | } |
| 2159 | return |
| 2160 | } |
| 2161 | |
| 2162 | func FlushFileBuffers(handle Handle) (err error) { |
| 2163 | r1, _, e1 := syscall.SyscallN(procFlushFileBuffers.Addr(), uintptr(handle)) |
| 2164 | if r1 == 0 { |
| 2165 | err = errnoErr(e1) |
| 2166 | } |
| 2167 | return |
| 2168 | } |
| 2169 | |
| 2170 | func FlushViewOfFile(addr uintptr, length uintptr) (err error) { |
| 2171 | r1, _, e1 := syscall.SyscallN(procFlushViewOfFile.Addr(), uintptr(addr), uintptr(length)) |
| 2172 | if r1 == 0 { |
| 2173 | err = errnoErr(e1) |
| 2174 | } |
| 2175 | return |
| 2176 | } |
| 2177 | |
| 2178 | func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) { |
| 2179 | var _p0 *uint16 |
| 2180 | if len(buf) > 0 { |
| 2181 | _p0 = &buf[0] |
| 2182 | } |
| 2183 | r0, _, e1 := syscall.SyscallN(procFormatMessageW.Addr(), uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args))) |
| 2184 | n = uint32(r0) |
| 2185 | if n == 0 { |
| 2186 | err = errnoErr(e1) |
| 2187 | } |
| 2188 | return |
| 2189 | } |
| 2190 | |
| 2191 | func FreeEnvironmentStrings(envs *uint16) (err error) { |
| 2192 | r1, _, e1 := syscall.SyscallN(procFreeEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(envs))) |
| 2193 | if r1 == 0 { |
| 2194 | err = errnoErr(e1) |
| 2195 | } |
| 2196 | return |
| 2197 | } |
| 2198 | |
| 2199 | func FreeLibrary(handle Handle) (err error) { |
| 2200 | r1, _, e1 := syscall.SyscallN(procFreeLibrary.Addr(), uintptr(handle)) |
| 2201 | if r1 == 0 { |
| 2202 | err = errnoErr(e1) |
| 2203 | } |
| 2204 | return |
| 2205 | } |
| 2206 | |
| 2207 | func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) { |
| 2208 | r1, _, e1 := syscall.SyscallN(procGenerateConsoleCtrlEvent.Addr(), uintptr(ctrlEvent), uintptr(processGroupID)) |
| 2209 | if r1 == 0 { |
| 2210 | err = errnoErr(e1) |
| 2211 | } |
| 2212 | return |
| 2213 | } |
| 2214 | |
| 2215 | func GetACP() (acp uint32) { |
| 2216 | r0, _, _ := syscall.SyscallN(procGetACP.Addr()) |
| 2217 | acp = uint32(r0) |
| 2218 | return |
| 2219 | } |
| 2220 | |
| 2221 | func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { |
| 2222 | r0, _, _ := syscall.SyscallN(procGetActiveProcessorCount.Addr(), uintptr(groupNumber)) |
| 2223 | ret = uint32(r0) |
| 2224 | return |
| 2225 | } |
| 2226 | |
| 2227 | func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { |
| 2228 | r1, _, e1 := syscall.SyscallN(procGetCommModemStatus.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpModemStat))) |
| 2229 | if r1 == 0 { |
| 2230 | err = errnoErr(e1) |
| 2231 | } |
| 2232 | return |
| 2233 | } |
| 2234 | |
| 2235 | func GetCommState(handle Handle, lpDCB *DCB) (err error) { |
| 2236 | r1, _, e1 := syscall.SyscallN(procGetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) |
| 2237 | if r1 == 0 { |
| 2238 | err = errnoErr(e1) |
| 2239 | } |
| 2240 | return |
| 2241 | } |
| 2242 | |
| 2243 | func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { |
| 2244 | r1, _, e1 := syscall.SyscallN(procGetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) |
| 2245 | if r1 == 0 { |
| 2246 | err = errnoErr(e1) |
| 2247 | } |
| 2248 | return |
| 2249 | } |
| 2250 | |
| 2251 | func GetCommandLine() (cmd *uint16) { |
| 2252 | r0, _, _ := syscall.SyscallN(procGetCommandLineW.Addr()) |
| 2253 | cmd = (*uint16)(unsafe.Pointer(r0)) |
| 2254 | return |
| 2255 | } |
| 2256 | |
| 2257 | func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { |
| 2258 | r1, _, e1 := syscall.SyscallN(procGetComputerNameExW.Addr(), uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) |
| 2259 | if r1 == 0 { |
| 2260 | err = errnoErr(e1) |
| 2261 | } |
| 2262 | return |
| 2263 | } |
| 2264 | |
| 2265 | func GetComputerName(buf *uint16, n *uint32) (err error) { |
| 2266 | r1, _, e1 := syscall.SyscallN(procGetComputerNameW.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) |
| 2267 | if r1 == 0 { |
| 2268 | err = errnoErr(e1) |
| 2269 | } |
| 2270 | return |
| 2271 | } |
| 2272 | |
| 2273 | func GetConsoleCP() (cp uint32, err error) { |
| 2274 | r0, _, e1 := syscall.SyscallN(procGetConsoleCP.Addr()) |
| 2275 | cp = uint32(r0) |
| 2276 | if cp == 0 { |
| 2277 | err = errnoErr(e1) |
| 2278 | } |
| 2279 | return |
| 2280 | } |
| 2281 | |
| 2282 | func GetConsoleMode(console Handle, mode *uint32) (err error) { |
| 2283 | r1, _, e1 := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(console), uintptr(unsafe.Pointer(mode))) |
| 2284 | if r1 == 0 { |
| 2285 | err = errnoErr(e1) |
| 2286 | } |
| 2287 | return |
| 2288 | } |
| 2289 | |
| 2290 | func GetConsoleOutputCP() (cp uint32, err error) { |
| 2291 | r0, _, e1 := syscall.SyscallN(procGetConsoleOutputCP.Addr()) |
| 2292 | cp = uint32(r0) |
| 2293 | if cp == 0 { |
| 2294 | err = errnoErr(e1) |
| 2295 | } |
| 2296 | return |
| 2297 | } |
| 2298 | |
| 2299 | func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { |
| 2300 | r1, _, e1 := syscall.SyscallN(procGetConsoleScreenBufferInfo.Addr(), uintptr(console), uintptr(unsafe.Pointer(info))) |
| 2301 | if r1 == 0 { |
| 2302 | err = errnoErr(e1) |
| 2303 | } |
| 2304 | return |
| 2305 | } |
| 2306 | |
| 2307 | func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { |
| 2308 | r0, _, e1 := syscall.SyscallN(procGetCurrentDirectoryW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) |
| 2309 | n = uint32(r0) |
| 2310 | if n == 0 { |
| 2311 | err = errnoErr(e1) |
| 2312 | } |
| 2313 | return |
| 2314 | } |
| 2315 | |
| 2316 | func GetCurrentProcessId() (pid uint32) { |
| 2317 | r0, _, _ := syscall.SyscallN(procGetCurrentProcessId.Addr()) |
| 2318 | pid = uint32(r0) |
| 2319 | return |
| 2320 | } |
| 2321 | |
| 2322 | func GetCurrentThreadId() (id uint32) { |
| 2323 | r0, _, _ := syscall.SyscallN(procGetCurrentThreadId.Addr()) |
| 2324 | id = uint32(r0) |
| 2325 | return |
| 2326 | } |
| 2327 | |
| 2328 | func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) { |
| 2329 | r1, _, e1 := syscall.SyscallN(procGetDiskFreeSpaceExW.Addr(), uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes))) |
| 2330 | if r1 == 0 { |
| 2331 | err = errnoErr(e1) |
| 2332 | } |
| 2333 | return |
| 2334 | } |
| 2335 | |
| 2336 | func GetDriveType(rootPathName *uint16) (driveType uint32) { |
| 2337 | r0, _, _ := syscall.SyscallN(procGetDriveTypeW.Addr(), uintptr(unsafe.Pointer(rootPathName))) |
| 2338 | driveType = uint32(r0) |
| 2339 | return |
| 2340 | } |
| 2341 | |
| 2342 | func GetEnvironmentStrings() (envs *uint16, err error) { |
| 2343 | r0, _, e1 := syscall.SyscallN(procGetEnvironmentStringsW.Addr()) |
| 2344 | envs = (*uint16)(unsafe.Pointer(r0)) |
| 2345 | if envs == nil { |
| 2346 | err = errnoErr(e1) |
| 2347 | } |
| 2348 | return |
| 2349 | } |
| 2350 | |
| 2351 | func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) { |
| 2352 | r0, _, e1 := syscall.SyscallN(procGetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) |
| 2353 | n = uint32(r0) |
| 2354 | if n == 0 { |
| 2355 | err = errnoErr(e1) |
| 2356 | } |
| 2357 | return |
| 2358 | } |
| 2359 | |
| 2360 | func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { |
| 2361 | r1, _, e1 := syscall.SyscallN(procGetExitCodeProcess.Addr(), uintptr(handle), uintptr(unsafe.Pointer(exitcode))) |
| 2362 | if r1 == 0 { |
| 2363 | err = errnoErr(e1) |
| 2364 | } |
| 2365 | return |
| 2366 | } |
| 2367 | |
| 2368 | func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { |
| 2369 | r1, _, e1 := syscall.SyscallN(procGetFileAttributesExW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) |
| 2370 | if r1 == 0 { |
| 2371 | err = errnoErr(e1) |
| 2372 | } |
| 2373 | return |
| 2374 | } |
| 2375 | |
| 2376 | func GetFileAttributes(name *uint16) (attrs uint32, err error) { |
| 2377 | r0, _, e1 := syscall.SyscallN(procGetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name))) |
| 2378 | attrs = uint32(r0) |
| 2379 | if attrs == INVALID_FILE_ATTRIBUTES { |
| 2380 | err = errnoErr(e1) |
| 2381 | } |
| 2382 | return |
| 2383 | } |
| 2384 | |
| 2385 | func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) { |
| 2386 | r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandle.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) |
| 2387 | if r1 == 0 { |
| 2388 | err = errnoErr(e1) |
| 2389 | } |
| 2390 | return |
| 2391 | } |
| 2392 | |
| 2393 | func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) { |
| 2394 | r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandleEx.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen)) |
| 2395 | if r1 == 0 { |
| 2396 | err = errnoErr(e1) |
| 2397 | } |
| 2398 | return |
| 2399 | } |
| 2400 | |
| 2401 | func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { |
| 2402 | r1, _, e1 := syscall.SyscallN(procGetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) |
| 2403 | if r1 == 0 { |
| 2404 | err = errnoErr(e1) |
| 2405 | } |
| 2406 | return |
| 2407 | } |
| 2408 | |
| 2409 | func GetFileType(filehandle Handle) (n uint32, err error) { |
| 2410 | r0, _, e1 := syscall.SyscallN(procGetFileType.Addr(), uintptr(filehandle)) |
| 2411 | n = uint32(r0) |
| 2412 | if n == 0 { |
| 2413 | err = errnoErr(e1) |
| 2414 | } |
| 2415 | return |
| 2416 | } |
| 2417 | |
| 2418 | func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) { |
| 2419 | r0, _, e1 := syscall.SyscallN(procGetFinalPathNameByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags)) |
| 2420 | n = uint32(r0) |
| 2421 | if n == 0 { |
| 2422 | err = errnoErr(e1) |
| 2423 | } |
| 2424 | return |
| 2425 | } |
| 2426 | |
| 2427 | func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) { |
| 2428 | r0, _, e1 := syscall.SyscallN(procGetFullPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname))) |
| 2429 | n = uint32(r0) |
| 2430 | if n == 0 { |
| 2431 | err = errnoErr(e1) |
| 2432 | } |
| 2433 | return |
| 2434 | } |
| 2435 | |
| 2436 | func GetLargePageMinimum() (size uintptr) { |
| 2437 | r0, _, _ := syscall.SyscallN(procGetLargePageMinimum.Addr()) |
| 2438 | size = uintptr(r0) |
| 2439 | return |
| 2440 | } |
| 2441 | |
| 2442 | func GetLastError() (lasterr error) { |
| 2443 | r0, _, _ := syscall.SyscallN(procGetLastError.Addr()) |
| 2444 | if r0 != 0 { |
| 2445 | lasterr = syscall.Errno(r0) |
| 2446 | } |
| 2447 | return |
| 2448 | } |
| 2449 | |
| 2450 | func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) { |
| 2451 | r0, _, e1 := syscall.SyscallN(procGetLogicalDriveStringsW.Addr(), uintptr(bufferLength), uintptr(unsafe.Pointer(buffer))) |
| 2452 | n = uint32(r0) |
| 2453 | if n == 0 { |
| 2454 | err = errnoErr(e1) |
| 2455 | } |
| 2456 | return |
| 2457 | } |
| 2458 | |
| 2459 | func GetLogicalDrives() (drivesBitMask uint32, err error) { |
| 2460 | r0, _, e1 := syscall.SyscallN(procGetLogicalDrives.Addr()) |
| 2461 | drivesBitMask = uint32(r0) |
| 2462 | if drivesBitMask == 0 { |
| 2463 | err = errnoErr(e1) |
| 2464 | } |
| 2465 | return |
| 2466 | } |
| 2467 | |
| 2468 | func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) { |
| 2469 | r0, _, e1 := syscall.SyscallN(procGetLongPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) |
| 2470 | n = uint32(r0) |
| 2471 | if n == 0 { |
| 2472 | err = errnoErr(e1) |
| 2473 | } |
| 2474 | return |
| 2475 | } |
| 2476 | |
| 2477 | func GetMaximumProcessorCount(groupNumber uint16) (ret uint32) { |
| 2478 | r0, _, _ := syscall.SyscallN(procGetMaximumProcessorCount.Addr(), uintptr(groupNumber)) |
| 2479 | ret = uint32(r0) |
| 2480 | return |
| 2481 | } |
| 2482 | |
| 2483 | func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) { |
| 2484 | r0, _, e1 := syscall.SyscallN(procGetModuleFileNameW.Addr(), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) |
| 2485 | n = uint32(r0) |
| 2486 | if n == 0 { |
| 2487 | err = errnoErr(e1) |
| 2488 | } |
| 2489 | return |
| 2490 | } |
| 2491 | |
| 2492 | func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) { |
| 2493 | r1, _, e1 := syscall.SyscallN(procGetModuleHandleExW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) |
| 2494 | if r1 == 0 { |
| 2495 | err = errnoErr(e1) |
| 2496 | } |
| 2497 | return |
| 2498 | } |
| 2499 | |
| 2500 | func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) { |
| 2501 | r1, _, e1 := syscall.SyscallN(procGetNamedPipeClientProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID))) |
| 2502 | if r1 == 0 { |
| 2503 | err = errnoErr(e1) |
| 2504 | } |
| 2505 | return |
| 2506 | } |
| 2507 | |
| 2508 | func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { |
| 2509 | r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) |
| 2510 | if r1 == 0 { |
| 2511 | err = errnoErr(e1) |
| 2512 | } |
| 2513 | return |
| 2514 | } |
| 2515 | |
| 2516 | func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { |
| 2517 | r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) |
| 2518 | if r1 == 0 { |
| 2519 | err = errnoErr(e1) |
| 2520 | } |
| 2521 | return |
| 2522 | } |
| 2523 | |
| 2524 | func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) { |
| 2525 | r1, _, e1 := syscall.SyscallN(procGetNamedPipeServerProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID))) |
| 2526 | if r1 == 0 { |
| 2527 | err = errnoErr(e1) |
| 2528 | } |
| 2529 | return |
| 2530 | } |
| 2531 | |
| 2532 | func GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) { |
| 2533 | r1, _, e1 := syscall.SyscallN(procGetNumberOfConsoleInputEvents.Addr(), uintptr(console), uintptr(unsafe.Pointer(numevents))) |
| 2534 | if r1 == 0 { |
| 2535 | err = errnoErr(e1) |
| 2536 | } |
| 2537 | return |
| 2538 | } |
| 2539 | |
| 2540 | func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) { |
| 2541 | var _p0 uint32 |
| 2542 | if wait { |
| 2543 | _p0 = 1 |
| 2544 | } |
| 2545 | r1, _, e1 := syscall.SyscallN(procGetOverlappedResult.Addr(), uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0)) |
| 2546 | if r1 == 0 { |
| 2547 | err = errnoErr(e1) |
| 2548 | } |
| 2549 | return |
| 2550 | } |
| 2551 | |
| 2552 | func GetPriorityClass(process Handle) (ret uint32, err error) { |
| 2553 | r0, _, e1 := syscall.SyscallN(procGetPriorityClass.Addr(), uintptr(process)) |
| 2554 | ret = uint32(r0) |
| 2555 | if ret == 0 { |
| 2556 | err = errnoErr(e1) |
| 2557 | } |
| 2558 | return |
| 2559 | } |
| 2560 | |
| 2561 | func GetProcAddress(module Handle, procname string) (proc uintptr, err error) { |
| 2562 | var _p0 *byte |
| 2563 | _p0, err = syscall.BytePtrFromString(procname) |
| 2564 | if err != nil { |
| 2565 | return |
| 2566 | } |
| 2567 | return _GetProcAddress(module, _p0) |
| 2568 | } |
| 2569 | |
| 2570 | func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { |
| 2571 | r0, _, e1 := syscall.SyscallN(procGetProcAddress.Addr(), uintptr(module), uintptr(unsafe.Pointer(procname))) |
| 2572 | proc = uintptr(r0) |
| 2573 | if proc == 0 { |
| 2574 | err = errnoErr(e1) |
| 2575 | } |
| 2576 | return |
| 2577 | } |
| 2578 | |
| 2579 | func GetProcessId(process Handle) (id uint32, err error) { |
| 2580 | r0, _, e1 := syscall.SyscallN(procGetProcessId.Addr(), uintptr(process)) |
| 2581 | id = uint32(r0) |
| 2582 | if id == 0 { |
| 2583 | err = errnoErr(e1) |
| 2584 | } |
| 2585 | return |
| 2586 | } |
| 2587 | |
| 2588 | func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { |
| 2589 | r1, _, e1 := syscall.SyscallN(procGetProcessPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) |
| 2590 | if r1 == 0 { |
| 2591 | err = errnoErr(e1) |
| 2592 | } |
| 2593 | return |
| 2594 | } |
| 2595 | |
| 2596 | func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { |
| 2597 | r1, _, e1 := syscall.SyscallN(procGetProcessShutdownParameters.Addr(), uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags))) |
| 2598 | if r1 == 0 { |
| 2599 | err = errnoErr(e1) |
| 2600 | } |
| 2601 | return |
| 2602 | } |
| 2603 | |
| 2604 | func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) { |
| 2605 | r1, _, e1 := syscall.SyscallN(procGetProcessTimes.Addr(), uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime))) |
| 2606 | if r1 == 0 { |
| 2607 | err = errnoErr(e1) |
| 2608 | } |
| 2609 | return |
| 2610 | } |
| 2611 | |
| 2612 | func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) { |
| 2613 | syscall.SyscallN(procGetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags))) |
| 2614 | return |
| 2615 | } |
| 2616 | |
| 2617 | func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) { |
| 2618 | r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout)) |
| 2619 | if r1 == 0 { |
| 2620 | err = errnoErr(e1) |
| 2621 | } |
| 2622 | return |
| 2623 | } |
| 2624 | |
| 2625 | func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) { |
| 2626 | r0, _, e1 := syscall.SyscallN(procGetShortPathNameW.Addr(), uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) |
| 2627 | n = uint32(r0) |
| 2628 | if n == 0 { |
| 2629 | err = errnoErr(e1) |
| 2630 | } |
| 2631 | return |
| 2632 | } |
| 2633 | |
| 2634 | func getStartupInfo(startupInfo *StartupInfo) { |
| 2635 | syscall.SyscallN(procGetStartupInfoW.Addr(), uintptr(unsafe.Pointer(startupInfo))) |
| 2636 | return |
| 2637 | } |
| 2638 | |
| 2639 | func GetStdHandle(stdhandle uint32) (handle Handle, err error) { |
| 2640 | r0, _, e1 := syscall.SyscallN(procGetStdHandle.Addr(), uintptr(stdhandle)) |
| 2641 | handle = Handle(r0) |
| 2642 | if handle == InvalidHandle { |
| 2643 | err = errnoErr(e1) |
| 2644 | } |
| 2645 | return |
| 2646 | } |
| 2647 | |
| 2648 | func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { |
| 2649 | r0, _, e1 := syscall.SyscallN(procGetSystemDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) |
| 2650 | len = uint32(r0) |
| 2651 | if len == 0 { |
| 2652 | err = errnoErr(e1) |
| 2653 | } |
| 2654 | return |
| 2655 | } |
| 2656 | |
| 2657 | func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { |
| 2658 | r1, _, e1 := syscall.SyscallN(procGetSystemPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) |
| 2659 | if r1 == 0 { |
| 2660 | err = errnoErr(e1) |
| 2661 | } |
| 2662 | return |
| 2663 | } |
| 2664 | |
| 2665 | func GetSystemTimeAsFileTime(time *Filetime) { |
| 2666 | syscall.SyscallN(procGetSystemTimeAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) |
| 2667 | return |
| 2668 | } |
| 2669 | |
| 2670 | func GetSystemTimePreciseAsFileTime(time *Filetime) { |
| 2671 | syscall.SyscallN(procGetSystemTimePreciseAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) |
| 2672 | return |
| 2673 | } |
| 2674 | |
| 2675 | func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { |
| 2676 | r0, _, e1 := syscall.SyscallN(procGetSystemWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) |
| 2677 | len = uint32(r0) |
| 2678 | if len == 0 { |
| 2679 | err = errnoErr(e1) |
| 2680 | } |
| 2681 | return |
| 2682 | } |
| 2683 | |
| 2684 | func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { |
| 2685 | r0, _, e1 := syscall.SyscallN(procGetTempPathW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) |
| 2686 | n = uint32(r0) |
| 2687 | if n == 0 { |
| 2688 | err = errnoErr(e1) |
| 2689 | } |
| 2690 | return |
| 2691 | } |
| 2692 | |
| 2693 | func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { |
| 2694 | r1, _, e1 := syscall.SyscallN(procGetThreadPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) |
| 2695 | if r1 == 0 { |
| 2696 | err = errnoErr(e1) |
| 2697 | } |
| 2698 | return |
| 2699 | } |
| 2700 | |
| 2701 | func getTickCount64() (ms uint64) { |
| 2702 | r0, _, _ := syscall.SyscallN(procGetTickCount64.Addr()) |
| 2703 | ms = uint64(r0) |
| 2704 | return |
| 2705 | } |
| 2706 | |
| 2707 | func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { |
| 2708 | r0, _, e1 := syscall.SyscallN(procGetTimeZoneInformation.Addr(), uintptr(unsafe.Pointer(tzi))) |
| 2709 | rc = uint32(r0) |
| 2710 | if rc == 0xffffffff { |
| 2711 | err = errnoErr(e1) |
| 2712 | } |
| 2713 | return |
| 2714 | } |
| 2715 | |
| 2716 | func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { |
| 2717 | r1, _, e1 := syscall.SyscallN(procGetUserPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) |
| 2718 | if r1 == 0 { |
| 2719 | err = errnoErr(e1) |
| 2720 | } |
| 2721 | return |
| 2722 | } |
| 2723 | |
| 2724 | func GetVersion() (ver uint32, err error) { |
| 2725 | r0, _, e1 := syscall.SyscallN(procGetVersion.Addr()) |
| 2726 | ver = uint32(r0) |
| 2727 | if ver == 0 { |
| 2728 | err = errnoErr(e1) |
| 2729 | } |
| 2730 | return |
| 2731 | } |
| 2732 | |
| 2733 | func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { |
| 2734 | r1, _, e1 := syscall.SyscallN(procGetVolumeInformationByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) |
| 2735 | if r1 == 0 { |
| 2736 | err = errnoErr(e1) |
| 2737 | } |
| 2738 | return |
| 2739 | } |
| 2740 | |
| 2741 | func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { |
| 2742 | r1, _, e1 := syscall.SyscallN(procGetVolumeInformationW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) |
| 2743 | if r1 == 0 { |
| 2744 | err = errnoErr(e1) |
| 2745 | } |
| 2746 | return |
| 2747 | } |
| 2748 | |
| 2749 | func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) { |
| 2750 | r1, _, e1 := syscall.SyscallN(procGetVolumeNameForVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) |
| 2751 | if r1 == 0 { |
| 2752 | err = errnoErr(e1) |
| 2753 | } |
| 2754 | return |
| 2755 | } |
| 2756 | |
| 2757 | func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) { |
| 2758 | r1, _, e1 := syscall.SyscallN(procGetVolumePathNameW.Addr(), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) |
| 2759 | if r1 == 0 { |
| 2760 | err = errnoErr(e1) |
| 2761 | } |
| 2762 | return |
| 2763 | } |
| 2764 | |
| 2765 | func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) { |
| 2766 | r1, _, e1 := syscall.SyscallN(procGetVolumePathNamesForVolumeNameW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength))) |
| 2767 | if r1 == 0 { |
| 2768 | err = errnoErr(e1) |
| 2769 | } |
| 2770 | return |
| 2771 | } |
| 2772 | |
| 2773 | func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { |
| 2774 | r0, _, e1 := syscall.SyscallN(procGetWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) |
| 2775 | len = uint32(r0) |
| 2776 | if len == 0 { |
| 2777 | err = errnoErr(e1) |
| 2778 | } |
| 2779 | return |
| 2780 | } |
| 2781 | |
| 2782 | func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) { |
| 2783 | r1, _, e1 := syscall.SyscallN(procInitializeProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size))) |
| 2784 | if r1 == 0 { |
| 2785 | err = errnoErr(e1) |
| 2786 | } |
| 2787 | return |
| 2788 | } |
| 2789 | |
| 2790 | func IsProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { |
| 2791 | r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) |
| 2792 | ret = r0 != 0 |
| 2793 | return |
| 2794 | } |
| 2795 | |
| 2796 | func IsWow64Process(handle Handle, isWow64 *bool) (err error) { |
| 2797 | var _p0 uint32 |
| 2798 | if *isWow64 { |
| 2799 | _p0 = 1 |
| 2800 | } |
| 2801 | r1, _, e1 := syscall.SyscallN(procIsWow64Process.Addr(), uintptr(handle), uintptr(unsafe.Pointer(&_p0))) |
| 2802 | *isWow64 = _p0 != 0 |
| 2803 | if r1 == 0 { |
| 2804 | err = errnoErr(e1) |
| 2805 | } |
| 2806 | return |
| 2807 | } |
| 2808 | |
| 2809 | func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint16) (err error) { |
| 2810 | err = procIsWow64Process2.Find() |
| 2811 | if err != nil { |
| 2812 | return |
| 2813 | } |
| 2814 | r1, _, e1 := syscall.SyscallN(procIsWow64Process2.Addr(), uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) |
| 2815 | if r1 == 0 { |
| 2816 | err = errnoErr(e1) |
| 2817 | } |
| 2818 | return |
| 2819 | } |
| 2820 | |
| 2821 | func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, err error) { |
| 2822 | var _p0 *uint16 |
| 2823 | _p0, err = syscall.UTF16PtrFromString(libname) |
| 2824 | if err != nil { |
| 2825 | return |
| 2826 | } |
| 2827 | return _LoadLibraryEx(_p0, zero, flags) |
| 2828 | } |
| 2829 | |
| 2830 | func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) { |
| 2831 | r0, _, e1 := syscall.SyscallN(procLoadLibraryExW.Addr(), uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags)) |
| 2832 | handle = Handle(r0) |
| 2833 | if handle == 0 { |
| 2834 | err = errnoErr(e1) |
| 2835 | } |
| 2836 | return |
| 2837 | } |
| 2838 | |
| 2839 | func LoadLibrary(libname string) (handle Handle, err error) { |
| 2840 | var _p0 *uint16 |
| 2841 | _p0, err = syscall.UTF16PtrFromString(libname) |
| 2842 | if err != nil { |
| 2843 | return |
| 2844 | } |
| 2845 | return _LoadLibrary(_p0) |
| 2846 | } |
| 2847 | |
| 2848 | func _LoadLibrary(libname *uint16) (handle Handle, err error) { |
| 2849 | r0, _, e1 := syscall.SyscallN(procLoadLibraryW.Addr(), uintptr(unsafe.Pointer(libname))) |
| 2850 | handle = Handle(r0) |
| 2851 | if handle == 0 { |
| 2852 | err = errnoErr(e1) |
| 2853 | } |
| 2854 | return |
| 2855 | } |
| 2856 | |
| 2857 | func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { |
| 2858 | r0, _, e1 := syscall.SyscallN(procLoadResource.Addr(), uintptr(module), uintptr(resInfo)) |
| 2859 | resData = Handle(r0) |
| 2860 | if resData == 0 { |
| 2861 | err = errnoErr(e1) |
| 2862 | } |
| 2863 | return |
| 2864 | } |
| 2865 | |
| 2866 | func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { |
| 2867 | r0, _, e1 := syscall.SyscallN(procLocalAlloc.Addr(), uintptr(flags), uintptr(length)) |
| 2868 | ptr = uintptr(r0) |
| 2869 | if ptr == 0 { |
| 2870 | err = errnoErr(e1) |
| 2871 | } |
| 2872 | return |
| 2873 | } |
| 2874 | |
| 2875 | func LocalFree(hmem Handle) (handle Handle, err error) { |
| 2876 | r0, _, e1 := syscall.SyscallN(procLocalFree.Addr(), uintptr(hmem)) |
| 2877 | handle = Handle(r0) |
| 2878 | if handle != 0 { |
| 2879 | err = errnoErr(e1) |
| 2880 | } |
| 2881 | return |
| 2882 | } |
| 2883 | |
| 2884 | func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { |
| 2885 | r1, _, e1 := syscall.SyscallN(procLockFileEx.Addr(), uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) |
| 2886 | if r1 == 0 { |
| 2887 | err = errnoErr(e1) |
| 2888 | } |
| 2889 | return |
| 2890 | } |
| 2891 | |
| 2892 | func LockResource(resData Handle) (addr uintptr, err error) { |
| 2893 | r0, _, e1 := syscall.SyscallN(procLockResource.Addr(), uintptr(resData)) |
| 2894 | addr = uintptr(r0) |
| 2895 | if addr == 0 { |
| 2896 | err = errnoErr(e1) |
| 2897 | } |
| 2898 | return |
| 2899 | } |
| 2900 | |
| 2901 | func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { |
| 2902 | r0, _, e1 := syscall.SyscallN(procMapViewOfFile.Addr(), uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length)) |
| 2903 | addr = uintptr(r0) |
| 2904 | if addr == 0 { |
| 2905 | err = errnoErr(e1) |
| 2906 | } |
| 2907 | return |
| 2908 | } |
| 2909 | |
| 2910 | func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { |
| 2911 | r1, _, e1 := syscall.SyscallN(procModule32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) |
| 2912 | if r1 == 0 { |
| 2913 | err = errnoErr(e1) |
| 2914 | } |
| 2915 | return |
| 2916 | } |
| 2917 | |
| 2918 | func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { |
| 2919 | r1, _, e1 := syscall.SyscallN(procModule32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) |
| 2920 | if r1 == 0 { |
| 2921 | err = errnoErr(e1) |
| 2922 | } |
| 2923 | return |
| 2924 | } |
| 2925 | |
| 2926 | func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { |
| 2927 | r1, _, e1 := syscall.SyscallN(procMoveFileExW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) |
| 2928 | if r1 == 0 { |
| 2929 | err = errnoErr(e1) |
| 2930 | } |
| 2931 | return |
| 2932 | } |
| 2933 | |
| 2934 | func MoveFile(from *uint16, to *uint16) (err error) { |
| 2935 | r1, _, e1 := syscall.SyscallN(procMoveFileW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to))) |
| 2936 | if r1 == 0 { |
| 2937 | err = errnoErr(e1) |
| 2938 | } |
| 2939 | return |
| 2940 | } |
| 2941 | |
| 2942 | func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) { |
| 2943 | r0, _, e1 := syscall.SyscallN(procMultiByteToWideChar.Addr(), uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) |
| 2944 | nwrite = int32(r0) |
| 2945 | if nwrite == 0 { |
| 2946 | err = errnoErr(e1) |
| 2947 | } |
| 2948 | return |
| 2949 | } |
| 2950 | |
| 2951 | func OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) { |
| 2952 | var _p0 uint32 |
| 2953 | if inheritHandle { |
| 2954 | _p0 = 1 |
| 2955 | } |
| 2956 | r0, _, e1 := syscall.SyscallN(procOpenEventW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) |
| 2957 | handle = Handle(r0) |
| 2958 | if handle == 0 { |
| 2959 | err = errnoErr(e1) |
| 2960 | } |
| 2961 | return |
| 2962 | } |
| 2963 | |
| 2964 | func OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) { |
| 2965 | var _p0 uint32 |
| 2966 | if inheritHandle { |
| 2967 | _p0 = 1 |
| 2968 | } |
| 2969 | r0, _, e1 := syscall.SyscallN(procOpenMutexW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) |
| 2970 | handle = Handle(r0) |
| 2971 | if handle == 0 { |
| 2972 | err = errnoErr(e1) |
| 2973 | } |
| 2974 | return |
| 2975 | } |
| 2976 | |
| 2977 | func OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) { |
| 2978 | var _p0 uint32 |
| 2979 | if inheritHandle { |
| 2980 | _p0 = 1 |
| 2981 | } |
| 2982 | r0, _, e1 := syscall.SyscallN(procOpenProcess.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) |
| 2983 | handle = Handle(r0) |
| 2984 | if handle == 0 { |
| 2985 | err = errnoErr(e1) |
| 2986 | } |
| 2987 | return |
| 2988 | } |
| 2989 | |
| 2990 | func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) { |
| 2991 | var _p0 uint32 |
| 2992 | if inheritHandle { |
| 2993 | _p0 = 1 |
| 2994 | } |
| 2995 | r0, _, e1 := syscall.SyscallN(procOpenThread.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) |
| 2996 | handle = Handle(r0) |
| 2997 | if handle == 0 { |
| 2998 | err = errnoErr(e1) |
| 2999 | } |
| 3000 | return |
| 3001 | } |
| 3002 | |
| 3003 | func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) { |
| 3004 | r1, _, e1 := syscall.SyscallN(procPostQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped))) |
| 3005 | if r1 == 0 { |
| 3006 | err = errnoErr(e1) |
| 3007 | } |
| 3008 | return |
| 3009 | } |
| 3010 | |
| 3011 | func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { |
| 3012 | r1, _, e1 := syscall.SyscallN(procProcess32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) |
| 3013 | if r1 == 0 { |
| 3014 | err = errnoErr(e1) |
| 3015 | } |
| 3016 | return |
| 3017 | } |
| 3018 | |
| 3019 | func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { |
| 3020 | r1, _, e1 := syscall.SyscallN(procProcess32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) |
| 3021 | if r1 == 0 { |
| 3022 | err = errnoErr(e1) |
| 3023 | } |
| 3024 | return |
| 3025 | } |
| 3026 | |
| 3027 | func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { |
| 3028 | r1, _, e1 := syscall.SyscallN(procProcessIdToSessionId.Addr(), uintptr(pid), uintptr(unsafe.Pointer(sessionid))) |
| 3029 | if r1 == 0 { |
| 3030 | err = errnoErr(e1) |
| 3031 | } |
| 3032 | return |
| 3033 | } |
| 3034 | |
| 3035 | func PulseEvent(event Handle) (err error) { |
| 3036 | r1, _, e1 := syscall.SyscallN(procPulseEvent.Addr(), uintptr(event)) |
| 3037 | if r1 == 0 { |
| 3038 | err = errnoErr(e1) |
| 3039 | } |
| 3040 | return |
| 3041 | } |
| 3042 | |
| 3043 | func PurgeComm(handle Handle, dwFlags uint32) (err error) { |
| 3044 | r1, _, e1 := syscall.SyscallN(procPurgeComm.Addr(), uintptr(handle), uintptr(dwFlags)) |
| 3045 | if r1 == 0 { |
| 3046 | err = errnoErr(e1) |
| 3047 | } |
| 3048 | return |
| 3049 | } |
| 3050 | |
| 3051 | func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) { |
| 3052 | r0, _, e1 := syscall.SyscallN(procQueryDosDeviceW.Addr(), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) |
| 3053 | n = uint32(r0) |
| 3054 | if n == 0 { |
| 3055 | err = errnoErr(e1) |
| 3056 | } |
| 3057 | return |
| 3058 | } |
| 3059 | |
| 3060 | func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { |
| 3061 | r1, _, e1 := syscall.SyscallN(procQueryFullProcessImageNameW.Addr(), uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size))) |
| 3062 | if r1 == 0 { |
| 3063 | err = errnoErr(e1) |
| 3064 | } |
| 3065 | return |
| 3066 | } |
| 3067 | |
| 3068 | func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { |
| 3069 | r1, _, e1 := syscall.SyscallN(procQueryInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen))) |
| 3070 | if r1 == 0 { |
| 3071 | err = errnoErr(e1) |
| 3072 | } |
| 3073 | return |
| 3074 | } |
| 3075 | |
| 3076 | func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) { |
| 3077 | r1, _, e1 := syscall.SyscallN(procReadConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl))) |
| 3078 | if r1 == 0 { |
| 3079 | err = errnoErr(e1) |
| 3080 | } |
| 3081 | return |
| 3082 | } |
| 3083 | |
| 3084 | func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { |
| 3085 | var _p0 uint32 |
| 3086 | if watchSubTree { |
| 3087 | _p0 = 1 |
| 3088 | } |
| 3089 | r1, _, e1 := syscall.SyscallN(procReadDirectoryChangesW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) |
| 3090 | if r1 == 0 { |
| 3091 | err = errnoErr(e1) |
| 3092 | } |
| 3093 | return |
| 3094 | } |
| 3095 | |
| 3096 | func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) { |
| 3097 | var _p0 *byte |
| 3098 | if len(buf) > 0 { |
| 3099 | _p0 = &buf[0] |
| 3100 | } |
| 3101 | r1, _, e1 := syscall.SyscallN(procReadFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) |
| 3102 | if r1 == 0 { |
| 3103 | err = errnoErr(e1) |
| 3104 | } |
| 3105 | return |
| 3106 | } |
| 3107 | |
| 3108 | func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) { |
| 3109 | r1, _, e1 := syscall.SyscallN(procReadProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead))) |
| 3110 | if r1 == 0 { |
| 3111 | err = errnoErr(e1) |
| 3112 | } |
| 3113 | return |
| 3114 | } |
| 3115 | |
| 3116 | func ReleaseMutex(mutex Handle) (err error) { |
| 3117 | r1, _, e1 := syscall.SyscallN(procReleaseMutex.Addr(), uintptr(mutex)) |
| 3118 | if r1 == 0 { |
| 3119 | err = errnoErr(e1) |
| 3120 | } |
| 3121 | return |
| 3122 | } |
| 3123 | |
| 3124 | func RemoveDirectory(path *uint16) (err error) { |
| 3125 | r1, _, e1 := syscall.SyscallN(procRemoveDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) |
| 3126 | if r1 == 0 { |
| 3127 | err = errnoErr(e1) |
| 3128 | } |
| 3129 | return |
| 3130 | } |
| 3131 | |
| 3132 | func RemoveDllDirectory(cookie uintptr) (err error) { |
| 3133 | r1, _, e1 := syscall.SyscallN(procRemoveDllDirectory.Addr(), uintptr(cookie)) |
| 3134 | if r1 == 0 { |
| 3135 | err = errnoErr(e1) |
| 3136 | } |
| 3137 | return |
| 3138 | } |
| 3139 | |
| 3140 | func ResetEvent(event Handle) (err error) { |
| 3141 | r1, _, e1 := syscall.SyscallN(procResetEvent.Addr(), uintptr(event)) |
| 3142 | if r1 == 0 { |
| 3143 | err = errnoErr(e1) |
| 3144 | } |
| 3145 | return |
| 3146 | } |
| 3147 | |
| 3148 | func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { |
| 3149 | r0, _, _ := syscall.SyscallN(procResizePseudoConsole.Addr(), uintptr(pconsole), uintptr(size)) |
| 3150 | if r0 != 0 { |
| 3151 | hr = syscall.Errno(r0) |
| 3152 | } |
| 3153 | return |
| 3154 | } |
| 3155 | |
| 3156 | func ResumeThread(thread Handle) (ret uint32, err error) { |
| 3157 | r0, _, e1 := syscall.SyscallN(procResumeThread.Addr(), uintptr(thread)) |
| 3158 | ret = uint32(r0) |
| 3159 | if ret == 0xffffffff { |
| 3160 | err = errnoErr(e1) |
| 3161 | } |
| 3162 | return |
| 3163 | } |
| 3164 | |
| 3165 | func SetCommBreak(handle Handle) (err error) { |
| 3166 | r1, _, e1 := syscall.SyscallN(procSetCommBreak.Addr(), uintptr(handle)) |
| 3167 | if r1 == 0 { |
| 3168 | err = errnoErr(e1) |
| 3169 | } |
| 3170 | return |
| 3171 | } |
| 3172 | |
| 3173 | func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { |
| 3174 | r1, _, e1 := syscall.SyscallN(procSetCommMask.Addr(), uintptr(handle), uintptr(dwEvtMask)) |
| 3175 | if r1 == 0 { |
| 3176 | err = errnoErr(e1) |
| 3177 | } |
| 3178 | return |
| 3179 | } |
| 3180 | |
| 3181 | func SetCommState(handle Handle, lpDCB *DCB) (err error) { |
| 3182 | r1, _, e1 := syscall.SyscallN(procSetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) |
| 3183 | if r1 == 0 { |
| 3184 | err = errnoErr(e1) |
| 3185 | } |
| 3186 | return |
| 3187 | } |
| 3188 | |
| 3189 | func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { |
| 3190 | r1, _, e1 := syscall.SyscallN(procSetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) |
| 3191 | if r1 == 0 { |
| 3192 | err = errnoErr(e1) |
| 3193 | } |
| 3194 | return |
| 3195 | } |
| 3196 | |
| 3197 | func SetConsoleCP(cp uint32) (err error) { |
| 3198 | r1, _, e1 := syscall.SyscallN(procSetConsoleCP.Addr(), uintptr(cp)) |
| 3199 | if r1 == 0 { |
| 3200 | err = errnoErr(e1) |
| 3201 | } |
| 3202 | return |
| 3203 | } |
| 3204 | |
| 3205 | func setConsoleCursorPosition(console Handle, position uint32) (err error) { |
| 3206 | r1, _, e1 := syscall.SyscallN(procSetConsoleCursorPosition.Addr(), uintptr(console), uintptr(position)) |
| 3207 | if r1 == 0 { |
| 3208 | err = errnoErr(e1) |
| 3209 | } |
| 3210 | return |
| 3211 | } |
| 3212 | |
| 3213 | func SetConsoleMode(console Handle, mode uint32) (err error) { |
| 3214 | r1, _, e1 := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(console), uintptr(mode)) |
| 3215 | if r1 == 0 { |
| 3216 | err = errnoErr(e1) |
| 3217 | } |
| 3218 | return |
| 3219 | } |
| 3220 | |
| 3221 | func SetConsoleOutputCP(cp uint32) (err error) { |
| 3222 | r1, _, e1 := syscall.SyscallN(procSetConsoleOutputCP.Addr(), uintptr(cp)) |
| 3223 | if r1 == 0 { |
| 3224 | err = errnoErr(e1) |
| 3225 | } |
| 3226 | return |
| 3227 | } |
| 3228 | |
| 3229 | func SetCurrentDirectory(path *uint16) (err error) { |
| 3230 | r1, _, e1 := syscall.SyscallN(procSetCurrentDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) |
| 3231 | if r1 == 0 { |
| 3232 | err = errnoErr(e1) |
| 3233 | } |
| 3234 | return |
| 3235 | } |
| 3236 | |
| 3237 | func SetDefaultDllDirectories(directoryFlags uint32) (err error) { |
| 3238 | r1, _, e1 := syscall.SyscallN(procSetDefaultDllDirectories.Addr(), uintptr(directoryFlags)) |
| 3239 | if r1 == 0 { |
| 3240 | err = errnoErr(e1) |
| 3241 | } |
| 3242 | return |
| 3243 | } |
| 3244 | |
| 3245 | func SetDllDirectory(path string) (err error) { |
| 3246 | var _p0 *uint16 |
| 3247 | _p0, err = syscall.UTF16PtrFromString(path) |
| 3248 | if err != nil { |
| 3249 | return |
| 3250 | } |
| 3251 | return _SetDllDirectory(_p0) |
| 3252 | } |
| 3253 | |
| 3254 | func _SetDllDirectory(path *uint16) (err error) { |
| 3255 | r1, _, e1 := syscall.SyscallN(procSetDllDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) |
| 3256 | if r1 == 0 { |
| 3257 | err = errnoErr(e1) |
| 3258 | } |
| 3259 | return |
| 3260 | } |
| 3261 | |
| 3262 | func SetEndOfFile(handle Handle) (err error) { |
| 3263 | r1, _, e1 := syscall.SyscallN(procSetEndOfFile.Addr(), uintptr(handle)) |
| 3264 | if r1 == 0 { |
| 3265 | err = errnoErr(e1) |
| 3266 | } |
| 3267 | return |
| 3268 | } |
| 3269 | |
| 3270 | func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { |
| 3271 | r1, _, e1 := syscall.SyscallN(procSetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value))) |
| 3272 | if r1 == 0 { |
| 3273 | err = errnoErr(e1) |
| 3274 | } |
| 3275 | return |
| 3276 | } |
| 3277 | |
| 3278 | func SetErrorMode(mode uint32) (ret uint32) { |
| 3279 | r0, _, _ := syscall.SyscallN(procSetErrorMode.Addr(), uintptr(mode)) |
| 3280 | ret = uint32(r0) |
| 3281 | return |
| 3282 | } |
| 3283 | |
| 3284 | func SetEvent(event Handle) (err error) { |
| 3285 | r1, _, e1 := syscall.SyscallN(procSetEvent.Addr(), uintptr(event)) |
| 3286 | if r1 == 0 { |
| 3287 | err = errnoErr(e1) |
| 3288 | } |
| 3289 | return |
| 3290 | } |
| 3291 | |
| 3292 | func SetFileAttributes(name *uint16, attrs uint32) (err error) { |
| 3293 | r1, _, e1 := syscall.SyscallN(procSetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(attrs)) |
| 3294 | if r1 == 0 { |
| 3295 | err = errnoErr(e1) |
| 3296 | } |
| 3297 | return |
| 3298 | } |
| 3299 | |
| 3300 | func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) { |
| 3301 | r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(handle), uintptr(flags)) |
| 3302 | if r1 == 0 { |
| 3303 | err = errnoErr(e1) |
| 3304 | } |
| 3305 | return |
| 3306 | } |
| 3307 | |
| 3308 | func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) { |
| 3309 | r1, _, e1 := syscall.SyscallN(procSetFileInformationByHandle.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) |
| 3310 | if r1 == 0 { |
| 3311 | err = errnoErr(e1) |
| 3312 | } |
| 3313 | return |
| 3314 | } |
| 3315 | |
| 3316 | func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) { |
| 3317 | r0, _, e1 := syscall.SyscallN(procSetFilePointer.Addr(), uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence)) |
| 3318 | newlowoffset = uint32(r0) |
| 3319 | if newlowoffset == 0xffffffff { |
| 3320 | err = errnoErr(e1) |
| 3321 | } |
| 3322 | return |
| 3323 | } |
| 3324 | |
| 3325 | func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { |
| 3326 | r1, _, e1 := syscall.SyscallN(procSetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) |
| 3327 | if r1 == 0 { |
| 3328 | err = errnoErr(e1) |
| 3329 | } |
| 3330 | return |
| 3331 | } |
| 3332 | |
| 3333 | func SetFileValidData(handle Handle, validDataLength int64) (err error) { |
| 3334 | r1, _, e1 := syscall.SyscallN(procSetFileValidData.Addr(), uintptr(handle), uintptr(validDataLength)) |
| 3335 | if r1 == 0 { |
| 3336 | err = errnoErr(e1) |
| 3337 | } |
| 3338 | return |
| 3339 | } |
| 3340 | |
| 3341 | func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { |
| 3342 | r1, _, e1 := syscall.SyscallN(procSetHandleInformation.Addr(), uintptr(handle), uintptr(mask), uintptr(flags)) |
| 3343 | if r1 == 0 { |
| 3344 | err = errnoErr(e1) |
| 3345 | } |
| 3346 | return |
| 3347 | } |
| 3348 | |
| 3349 | func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) { |
| 3350 | r0, _, e1 := syscall.SyscallN(procSetInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength)) |
| 3351 | ret = int(r0) |
| 3352 | if ret == 0 { |
| 3353 | err = errnoErr(e1) |
| 3354 | } |
| 3355 | return |
| 3356 | } |
| 3357 | |
| 3358 | func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) { |
| 3359 | r1, _, e1 := syscall.SyscallN(procSetNamedPipeHandleState.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout))) |
| 3360 | if r1 == 0 { |
| 3361 | err = errnoErr(e1) |
| 3362 | } |
| 3363 | return |
| 3364 | } |
| 3365 | |
| 3366 | func SetPriorityClass(process Handle, priorityClass uint32) (err error) { |
| 3367 | r1, _, e1 := syscall.SyscallN(procSetPriorityClass.Addr(), uintptr(process), uintptr(priorityClass)) |
| 3368 | if r1 == 0 { |
| 3369 | err = errnoErr(e1) |
| 3370 | } |
| 3371 | return |
| 3372 | } |
| 3373 | |
| 3374 | func SetProcessPriorityBoost(process Handle, disable bool) (err error) { |
| 3375 | var _p0 uint32 |
| 3376 | if disable { |
| 3377 | _p0 = 1 |
| 3378 | } |
| 3379 | r1, _, e1 := syscall.SyscallN(procSetProcessPriorityBoost.Addr(), uintptr(process), uintptr(_p0)) |
| 3380 | if r1 == 0 { |
| 3381 | err = errnoErr(e1) |
| 3382 | } |
| 3383 | return |
| 3384 | } |
| 3385 | |
| 3386 | func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { |
| 3387 | r1, _, e1 := syscall.SyscallN(procSetProcessShutdownParameters.Addr(), uintptr(level), uintptr(flags)) |
| 3388 | if r1 == 0 { |
| 3389 | err = errnoErr(e1) |
| 3390 | } |
| 3391 | return |
| 3392 | } |
| 3393 | |
| 3394 | func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) { |
| 3395 | r1, _, e1 := syscall.SyscallN(procSetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags)) |
| 3396 | if r1 == 0 { |
| 3397 | err = errnoErr(e1) |
| 3398 | } |
| 3399 | return |
| 3400 | } |
| 3401 | |
| 3402 | func SetStdHandle(stdhandle uint32, handle Handle) (err error) { |
| 3403 | r1, _, e1 := syscall.SyscallN(procSetStdHandle.Addr(), uintptr(stdhandle), uintptr(handle)) |
| 3404 | if r1 == 0 { |
| 3405 | err = errnoErr(e1) |
| 3406 | } |
| 3407 | return |
| 3408 | } |
| 3409 | |
| 3410 | func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { |
| 3411 | r1, _, e1 := syscall.SyscallN(procSetVolumeLabelW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName))) |
| 3412 | if r1 == 0 { |
| 3413 | err = errnoErr(e1) |
| 3414 | } |
| 3415 | return |
| 3416 | } |
| 3417 | |
| 3418 | func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) { |
| 3419 | r1, _, e1 := syscall.SyscallN(procSetVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName))) |
| 3420 | if r1 == 0 { |
| 3421 | err = errnoErr(e1) |
| 3422 | } |
| 3423 | return |
| 3424 | } |
| 3425 | |
| 3426 | func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { |
| 3427 | r1, _, e1 := syscall.SyscallN(procSetupComm.Addr(), uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) |
| 3428 | if r1 == 0 { |
| 3429 | err = errnoErr(e1) |
| 3430 | } |
| 3431 | return |
| 3432 | } |
| 3433 | |
| 3434 | func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { |
| 3435 | r0, _, e1 := syscall.SyscallN(procSizeofResource.Addr(), uintptr(module), uintptr(resInfo)) |
| 3436 | size = uint32(r0) |
| 3437 | if size == 0 { |
| 3438 | err = errnoErr(e1) |
| 3439 | } |
| 3440 | return |
| 3441 | } |
| 3442 | |
| 3443 | func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { |
| 3444 | var _p0 uint32 |
| 3445 | if alertable { |
| 3446 | _p0 = 1 |
| 3447 | } |
| 3448 | r0, _, _ := syscall.SyscallN(procSleepEx.Addr(), uintptr(milliseconds), uintptr(_p0)) |
| 3449 | ret = uint32(r0) |
| 3450 | return |
| 3451 | } |
| 3452 | |
| 3453 | func TerminateJobObject(job Handle, exitCode uint32) (err error) { |
| 3454 | r1, _, e1 := syscall.SyscallN(procTerminateJobObject.Addr(), uintptr(job), uintptr(exitCode)) |
| 3455 | if r1 == 0 { |
| 3456 | err = errnoErr(e1) |
| 3457 | } |
| 3458 | return |
| 3459 | } |
| 3460 | |
| 3461 | func TerminateProcess(handle Handle, exitcode uint32) (err error) { |
| 3462 | r1, _, e1 := syscall.SyscallN(procTerminateProcess.Addr(), uintptr(handle), uintptr(exitcode)) |
| 3463 | if r1 == 0 { |
| 3464 | err = errnoErr(e1) |
| 3465 | } |
| 3466 | return |
| 3467 | } |
| 3468 | |
| 3469 | func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { |
| 3470 | r1, _, e1 := syscall.SyscallN(procThread32First.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) |
| 3471 | if r1 == 0 { |
| 3472 | err = errnoErr(e1) |
| 3473 | } |
| 3474 | return |
| 3475 | } |
| 3476 | |
| 3477 | func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { |
| 3478 | r1, _, e1 := syscall.SyscallN(procThread32Next.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) |
| 3479 | if r1 == 0 { |
| 3480 | err = errnoErr(e1) |
| 3481 | } |
| 3482 | return |
| 3483 | } |
| 3484 | |
| 3485 | func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { |
| 3486 | r1, _, e1 := syscall.SyscallN(procUnlockFileEx.Addr(), uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) |
| 3487 | if r1 == 0 { |
| 3488 | err = errnoErr(e1) |
| 3489 | } |
| 3490 | return |
| 3491 | } |
| 3492 | |
| 3493 | func UnmapViewOfFile(addr uintptr) (err error) { |
| 3494 | r1, _, e1 := syscall.SyscallN(procUnmapViewOfFile.Addr(), uintptr(addr)) |
| 3495 | if r1 == 0 { |
| 3496 | err = errnoErr(e1) |
| 3497 | } |
| 3498 | return |
| 3499 | } |
| 3500 | |
| 3501 | func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) { |
| 3502 | r1, _, e1 := syscall.SyscallN(procUpdateProcThreadAttribute.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize))) |
| 3503 | if r1 == 0 { |
| 3504 | err = errnoErr(e1) |
| 3505 | } |
| 3506 | return |
| 3507 | } |
| 3508 | |
| 3509 | func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) { |
| 3510 | r0, _, e1 := syscall.SyscallN(procVirtualAlloc.Addr(), uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect)) |
| 3511 | value = uintptr(r0) |
| 3512 | if value == 0 { |
| 3513 | err = errnoErr(e1) |
| 3514 | } |
| 3515 | return |
| 3516 | } |
| 3517 | |
| 3518 | func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { |
| 3519 | r1, _, e1 := syscall.SyscallN(procVirtualFree.Addr(), uintptr(address), uintptr(size), uintptr(freetype)) |
| 3520 | if r1 == 0 { |
| 3521 | err = errnoErr(e1) |
| 3522 | } |
| 3523 | return |
| 3524 | } |
| 3525 | |
| 3526 | func VirtualLock(addr uintptr, length uintptr) (err error) { |
| 3527 | r1, _, e1 := syscall.SyscallN(procVirtualLock.Addr(), uintptr(addr), uintptr(length)) |
| 3528 | if r1 == 0 { |
| 3529 | err = errnoErr(e1) |
| 3530 | } |
| 3531 | return |
| 3532 | } |
| 3533 | |
| 3534 | func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) { |
| 3535 | r1, _, e1 := syscall.SyscallN(procVirtualProtect.Addr(), uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect))) |
| 3536 | if r1 == 0 { |
| 3537 | err = errnoErr(e1) |
| 3538 | } |
| 3539 | return |
| 3540 | } |
| 3541 | |
| 3542 | func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) { |
| 3543 | r1, _, e1 := syscall.SyscallN(procVirtualProtectEx.Addr(), uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect))) |
| 3544 | if r1 == 0 { |
| 3545 | err = errnoErr(e1) |
| 3546 | } |
| 3547 | return |
| 3548 | } |
| 3549 | |
| 3550 | func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { |
| 3551 | r1, _, e1 := syscall.SyscallN(procVirtualQuery.Addr(), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) |
| 3552 | if r1 == 0 { |
| 3553 | err = errnoErr(e1) |
| 3554 | } |
| 3555 | return |
| 3556 | } |
| 3557 | |
| 3558 | func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { |
| 3559 | r1, _, e1 := syscall.SyscallN(procVirtualQueryEx.Addr(), uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) |
| 3560 | if r1 == 0 { |
| 3561 | err = errnoErr(e1) |
| 3562 | } |
| 3563 | return |
| 3564 | } |
| 3565 | |
| 3566 | func VirtualUnlock(addr uintptr, length uintptr) (err error) { |
| 3567 | r1, _, e1 := syscall.SyscallN(procVirtualUnlock.Addr(), uintptr(addr), uintptr(length)) |
| 3568 | if r1 == 0 { |
| 3569 | err = errnoErr(e1) |
| 3570 | } |
| 3571 | return |
| 3572 | } |
| 3573 | |
| 3574 | func WTSGetActiveConsoleSessionId() (sessionID uint32) { |
| 3575 | r0, _, _ := syscall.SyscallN(procWTSGetActiveConsoleSessionId.Addr()) |
| 3576 | sessionID = uint32(r0) |
| 3577 | return |
| 3578 | } |
| 3579 | |
| 3580 | func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { |
| 3581 | r1, _, e1 := syscall.SyscallN(procWaitCommEvent.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) |
| 3582 | if r1 == 0 { |
| 3583 | err = errnoErr(e1) |
| 3584 | } |
| 3585 | return |
| 3586 | } |
| 3587 | |
| 3588 | func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) { |
| 3589 | var _p0 uint32 |
| 3590 | if waitAll { |
| 3591 | _p0 = 1 |
| 3592 | } |
| 3593 | r0, _, e1 := syscall.SyscallN(procWaitForMultipleObjects.Addr(), uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds)) |
| 3594 | event = uint32(r0) |
| 3595 | if event == 0xffffffff { |
| 3596 | err = errnoErr(e1) |
| 3597 | } |
| 3598 | return |
| 3599 | } |
| 3600 | |
| 3601 | func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) { |
| 3602 | r0, _, e1 := syscall.SyscallN(procWaitForSingleObject.Addr(), uintptr(handle), uintptr(waitMilliseconds)) |
| 3603 | event = uint32(r0) |
| 3604 | if event == 0xffffffff { |
| 3605 | err = errnoErr(e1) |
| 3606 | } |
| 3607 | return |
| 3608 | } |
| 3609 | |
| 3610 | func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) { |
| 3611 | r1, _, e1 := syscall.SyscallN(procWriteConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved))) |
| 3612 | if r1 == 0 { |
| 3613 | err = errnoErr(e1) |
| 3614 | } |
| 3615 | return |
| 3616 | } |
| 3617 | |
| 3618 | func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) { |
| 3619 | var _p0 *byte |
| 3620 | if len(buf) > 0 { |
| 3621 | _p0 = &buf[0] |
| 3622 | } |
| 3623 | r1, _, e1 := syscall.SyscallN(procWriteFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) |
| 3624 | if r1 == 0 { |
| 3625 | err = errnoErr(e1) |
| 3626 | } |
| 3627 | return |
| 3628 | } |
| 3629 | |
| 3630 | func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) { |
| 3631 | r1, _, e1 := syscall.SyscallN(procWriteProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten))) |
| 3632 | if r1 == 0 { |
| 3633 | err = errnoErr(e1) |
| 3634 | } |
| 3635 | return |
| 3636 | } |
| 3637 | |
| 3638 | func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) { |
| 3639 | r1, _, e1 := syscall.SyscallN(procAcceptEx.Addr(), uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped))) |
| 3640 | if r1 == 0 { |
| 3641 | err = errnoErr(e1) |
| 3642 | } |
| 3643 | return |
| 3644 | } |
| 3645 | |
| 3646 | func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) { |
| 3647 | syscall.SyscallN(procGetAcceptExSockaddrs.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen))) |
| 3648 | return |
| 3649 | } |
| 3650 | |
| 3651 | func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) { |
| 3652 | r1, _, e1 := syscall.SyscallN(procTransmitFile.Addr(), uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags)) |
| 3653 | if r1 == 0 { |
| 3654 | err = errnoErr(e1) |
| 3655 | } |
| 3656 | return |
| 3657 | } |
| 3658 | |
| 3659 | func NetApiBufferFree(buf *byte) (neterr error) { |
| 3660 | r0, _, _ := syscall.SyscallN(procNetApiBufferFree.Addr(), uintptr(unsafe.Pointer(buf))) |
| 3661 | if r0 != 0 { |
| 3662 | neterr = syscall.Errno(r0) |
| 3663 | } |
| 3664 | return |
| 3665 | } |
| 3666 | |
| 3667 | func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) { |
| 3668 | r0, _, _ := syscall.SyscallN(procNetGetJoinInformation.Addr(), uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) |
| 3669 | if r0 != 0 { |
| 3670 | neterr = syscall.Errno(r0) |
| 3671 | } |
| 3672 | return |
| 3673 | } |
| 3674 | |
| 3675 | func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { |
| 3676 | r0, _, _ := syscall.SyscallN(procNetUserEnum.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle))) |
| 3677 | if r0 != 0 { |
| 3678 | neterr = syscall.Errno(r0) |
| 3679 | } |
| 3680 | return |
| 3681 | } |
| 3682 | |
| 3683 | func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { |
| 3684 | r0, _, _ := syscall.SyscallN(procNetUserGetInfo.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf))) |
| 3685 | if r0 != 0 { |
| 3686 | neterr = syscall.Errno(r0) |
| 3687 | } |
| 3688 | return |
| 3689 | } |
| 3690 | |
| 3691 | func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) { |
| 3692 | r0, _, _ := syscall.SyscallN(procNtCreateFile.Addr(), uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength)) |
| 3693 | if r0 != 0 { |
| 3694 | ntstatus = NTStatus(r0) |
| 3695 | } |
| 3696 | return |
| 3697 | } |
| 3698 | |
| 3699 | func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) { |
| 3700 | r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) |
| 3701 | if r0 != 0 { |
| 3702 | ntstatus = NTStatus(r0) |
| 3703 | } |
| 3704 | return |
| 3705 | } |
| 3706 | |
| 3707 | func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { |
| 3708 | r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) |
| 3709 | if r0 != 0 { |
| 3710 | ntstatus = NTStatus(r0) |
| 3711 | } |
| 3712 | return |
| 3713 | } |
| 3714 | |
| 3715 | func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) { |
| 3716 | r0, _, _ := syscall.SyscallN(procNtQuerySystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen))) |
| 3717 | if r0 != 0 { |
| 3718 | ntstatus = NTStatus(r0) |
| 3719 | } |
| 3720 | return |
| 3721 | } |
| 3722 | |
| 3723 | func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { |
| 3724 | r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) |
| 3725 | if r0 != 0 { |
| 3726 | ntstatus = NTStatus(r0) |
| 3727 | } |
| 3728 | return |
| 3729 | } |
| 3730 | |
| 3731 | func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { |
| 3732 | r0, _, _ := syscall.SyscallN(procNtSetInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen)) |
| 3733 | if r0 != 0 { |
| 3734 | ntstatus = NTStatus(r0) |
| 3735 | } |
| 3736 | return |
| 3737 | } |
| 3738 | |
| 3739 | func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) { |
| 3740 | r0, _, _ := syscall.SyscallN(procNtSetSystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) |
| 3741 | if r0 != 0 { |
| 3742 | ntstatus = NTStatus(r0) |
| 3743 | } |
| 3744 | return |
| 3745 | } |
| 3746 | |
| 3747 | func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) { |
| 3748 | r0, _, _ := syscall.SyscallN(procRtlAddFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) |
| 3749 | ret = r0 != 0 |
| 3750 | return |
| 3751 | } |
| 3752 | |
| 3753 | func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { |
| 3754 | r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(acl))) |
| 3755 | if r0 != 0 { |
| 3756 | ntstatus = NTStatus(r0) |
| 3757 | } |
| 3758 | return |
| 3759 | } |
| 3760 | |
| 3761 | func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) { |
| 3762 | r0, _, _ := syscall.SyscallN(procRtlDeleteFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable))) |
| 3763 | ret = r0 != 0 |
| 3764 | return |
| 3765 | } |
| 3766 | |
| 3767 | func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { |
| 3768 | r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) |
| 3769 | if r0 != 0 { |
| 3770 | ntstatus = NTStatus(r0) |
| 3771 | } |
| 3772 | return |
| 3773 | } |
| 3774 | |
| 3775 | func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { |
| 3776 | r0, _, _ := syscall.SyscallN(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) |
| 3777 | if r0 != 0 { |
| 3778 | ntstatus = NTStatus(r0) |
| 3779 | } |
| 3780 | return |
| 3781 | } |
| 3782 | |
| 3783 | func RtlGetCurrentPeb() (peb *PEB) { |
| 3784 | r0, _, _ := syscall.SyscallN(procRtlGetCurrentPeb.Addr()) |
| 3785 | peb = (*PEB)(unsafe.Pointer(r0)) |
| 3786 | return |
| 3787 | } |
| 3788 | |
| 3789 | func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) { |
| 3790 | syscall.SyscallN(procRtlGetNtVersionNumbers.Addr(), uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) |
| 3791 | return |
| 3792 | } |
| 3793 | |
| 3794 | func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { |
| 3795 | r0, _, _ := syscall.SyscallN(procRtlGetVersion.Addr(), uintptr(unsafe.Pointer(info))) |
| 3796 | if r0 != 0 { |
| 3797 | ntstatus = NTStatus(r0) |
| 3798 | } |
| 3799 | return |
| 3800 | } |
| 3801 | |
| 3802 | func RtlInitString(destinationString *NTString, sourceString *byte) { |
| 3803 | syscall.SyscallN(procRtlInitString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) |
| 3804 | return |
| 3805 | } |
| 3806 | |
| 3807 | func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) { |
| 3808 | syscall.SyscallN(procRtlInitUnicodeString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) |
| 3809 | return |
| 3810 | } |
| 3811 | |
| 3812 | func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) { |
| 3813 | r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(ntstatus)) |
| 3814 | ret = syscall.Errno(r0) |
| 3815 | return |
| 3816 | } |
| 3817 | |
| 3818 | func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { |
| 3819 | r0, _, _ := syscall.SyscallN(procCLSIDFromString.Addr(), uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid))) |
| 3820 | if r0 != 0 { |
| 3821 | ret = syscall.Errno(r0) |
| 3822 | } |
| 3823 | return |
| 3824 | } |
| 3825 | |
| 3826 | func coCreateGuid(pguid *GUID) (ret error) { |
| 3827 | r0, _, _ := syscall.SyscallN(procCoCreateGuid.Addr(), uintptr(unsafe.Pointer(pguid))) |
| 3828 | if r0 != 0 { |
| 3829 | ret = syscall.Errno(r0) |
| 3830 | } |
| 3831 | return |
| 3832 | } |
| 3833 | |
| 3834 | func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { |
| 3835 | r0, _, _ := syscall.SyscallN(procCoGetObject.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable))) |
| 3836 | if r0 != 0 { |
| 3837 | ret = syscall.Errno(r0) |
| 3838 | } |
| 3839 | return |
| 3840 | } |
| 3841 | |
| 3842 | func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { |
| 3843 | r0, _, _ := syscall.SyscallN(procCoInitializeEx.Addr(), uintptr(reserved), uintptr(coInit)) |
| 3844 | if r0 != 0 { |
| 3845 | ret = syscall.Errno(r0) |
| 3846 | } |
| 3847 | return |
| 3848 | } |
| 3849 | |
| 3850 | func CoTaskMemFree(address unsafe.Pointer) { |
| 3851 | syscall.SyscallN(procCoTaskMemFree.Addr(), uintptr(address)) |
| 3852 | return |
| 3853 | } |
| 3854 | |
| 3855 | func CoUninitialize() { |
| 3856 | syscall.SyscallN(procCoUninitialize.Addr()) |
| 3857 | return |
| 3858 | } |
| 3859 | |
| 3860 | func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { |
| 3861 | r0, _, _ := syscall.SyscallN(procStringFromGUID2.Addr(), uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) |
| 3862 | chars = int32(r0) |
| 3863 | return |
| 3864 | } |
| 3865 | |
| 3866 | func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) { |
| 3867 | r1, _, e1 := syscall.SyscallN(procEnumProcessModules.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded))) |
| 3868 | if r1 == 0 { |
| 3869 | err = errnoErr(e1) |
| 3870 | } |
| 3871 | return |
| 3872 | } |
| 3873 | |
| 3874 | func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) { |
| 3875 | r1, _, e1 := syscall.SyscallN(procEnumProcessModulesEx.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag)) |
| 3876 | if r1 == 0 { |
| 3877 | err = errnoErr(e1) |
| 3878 | } |
| 3879 | return |
| 3880 | } |
| 3881 | |
| 3882 | func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) { |
| 3883 | r1, _, e1 := syscall.SyscallN(procEnumProcesses.Addr(), uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) |
| 3884 | if r1 == 0 { |
| 3885 | err = errnoErr(e1) |
| 3886 | } |
| 3887 | return |
| 3888 | } |
| 3889 | |
| 3890 | func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) { |
| 3891 | r1, _, e1 := syscall.SyscallN(procGetModuleBaseNameW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size)) |
| 3892 | if r1 == 0 { |
| 3893 | err = errnoErr(e1) |
| 3894 | } |
| 3895 | return |
| 3896 | } |
| 3897 | |
| 3898 | func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) { |
| 3899 | r1, _, e1 := syscall.SyscallN(procGetModuleFileNameExW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) |
| 3900 | if r1 == 0 { |
| 3901 | err = errnoErr(e1) |
| 3902 | } |
| 3903 | return |
| 3904 | } |
| 3905 | |
| 3906 | func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) { |
| 3907 | r1, _, e1 := syscall.SyscallN(procGetModuleInformation.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb)) |
| 3908 | if r1 == 0 { |
| 3909 | err = errnoErr(e1) |
| 3910 | } |
| 3911 | return |
| 3912 | } |
| 3913 | |
| 3914 | func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) { |
| 3915 | r1, _, e1 := syscall.SyscallN(procQueryWorkingSetEx.Addr(), uintptr(process), uintptr(pv), uintptr(cb)) |
| 3916 | if r1 == 0 { |
| 3917 | err = errnoErr(e1) |
| 3918 | } |
| 3919 | return |
| 3920 | } |
| 3921 | |
| 3922 | func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callback uintptr, callbackCtx uintptr, subscription *uintptr) (ret error) { |
| 3923 | ret = procSubscribeServiceChangeNotifications.Find() |
| 3924 | if ret != nil { |
| 3925 | return |
| 3926 | } |
| 3927 | r0, _, _ := syscall.SyscallN(procSubscribeServiceChangeNotifications.Addr(), uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription))) |
| 3928 | if r0 != 0 { |
| 3929 | ret = syscall.Errno(r0) |
| 3930 | } |
| 3931 | return |
| 3932 | } |
| 3933 | |
| 3934 | func UnsubscribeServiceChangeNotifications(subscription uintptr) (err error) { |
| 3935 | err = procUnsubscribeServiceChangeNotifications.Find() |
| 3936 | if err != nil { |
| 3937 | return |
| 3938 | } |
| 3939 | syscall.SyscallN(procUnsubscribeServiceChangeNotifications.Addr(), uintptr(subscription)) |
| 3940 | return |
| 3941 | } |
| 3942 | |
| 3943 | func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) { |
| 3944 | r1, _, e1 := syscall.SyscallN(procGetUserNameExW.Addr(), uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) |
| 3945 | if r1&0xff == 0 { |
| 3946 | err = errnoErr(e1) |
| 3947 | } |
| 3948 | return |
| 3949 | } |
| 3950 | |
| 3951 | func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) { |
| 3952 | r1, _, e1 := syscall.SyscallN(procTranslateNameW.Addr(), uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize))) |
| 3953 | if r1&0xff == 0 { |
| 3954 | err = errnoErr(e1) |
| 3955 | } |
| 3956 | return |
| 3957 | } |
| 3958 | |
| 3959 | func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { |
| 3960 | r1, _, e1 := syscall.SyscallN(procSetupDiBuildDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) |
| 3961 | if r1 == 0 { |
| 3962 | err = errnoErr(e1) |
| 3963 | } |
| 3964 | return |
| 3965 | } |
| 3966 | |
| 3967 | func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { |
| 3968 | r1, _, e1 := syscall.SyscallN(procSetupDiCallClassInstaller.Addr(), uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) |
| 3969 | if r1 == 0 { |
| 3970 | err = errnoErr(e1) |
| 3971 | } |
| 3972 | return |
| 3973 | } |
| 3974 | |
| 3975 | func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { |
| 3976 | r1, _, e1 := syscall.SyscallN(procSetupDiCancelDriverInfoSearch.Addr(), uintptr(deviceInfoSet)) |
| 3977 | if r1 == 0 { |
| 3978 | err = errnoErr(e1) |
| 3979 | } |
| 3980 | return |
| 3981 | } |
| 3982 | |
| 3983 | func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { |
| 3984 | r1, _, e1 := syscall.SyscallN(procSetupDiClassGuidsFromNameExW.Addr(), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) |
| 3985 | if r1 == 0 { |
| 3986 | err = errnoErr(e1) |
| 3987 | } |
| 3988 | return |
| 3989 | } |
| 3990 | |
| 3991 | func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { |
| 3992 | r1, _, e1 := syscall.SyscallN(procSetupDiClassNameFromGuidExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) |
| 3993 | if r1 == 0 { |
| 3994 | err = errnoErr(e1) |
| 3995 | } |
| 3996 | return |
| 3997 | } |
| 3998 | |
| 3999 | func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { |
| 4000 | r0, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoListExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) |
| 4001 | handle = DevInfo(r0) |
| 4002 | if handle == DevInfo(InvalidHandle) { |
| 4003 | err = errnoErr(e1) |
| 4004 | } |
| 4005 | return |
| 4006 | } |
| 4007 | |
| 4008 | func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) { |
| 4009 | r1, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData))) |
| 4010 | if r1 == 0 { |
| 4011 | err = errnoErr(e1) |
| 4012 | } |
| 4013 | return |
| 4014 | } |
| 4015 | |
| 4016 | func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { |
| 4017 | r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDeviceInfoList.Addr(), uintptr(deviceInfoSet)) |
| 4018 | if r1 == 0 { |
| 4019 | err = errnoErr(e1) |
| 4020 | } |
| 4021 | return |
| 4022 | } |
| 4023 | |
| 4024 | func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { |
| 4025 | r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) |
| 4026 | if r1 == 0 { |
| 4027 | err = errnoErr(e1) |
| 4028 | } |
| 4029 | return |
| 4030 | } |
| 4031 | |
| 4032 | func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) { |
| 4033 | r1, _, e1 := syscall.SyscallN(procSetupDiEnumDeviceInfo.Addr(), uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) |
| 4034 | if r1 == 0 { |
| 4035 | err = errnoErr(e1) |
| 4036 | } |
| 4037 | return |
| 4038 | } |
| 4039 | |
| 4040 | func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) { |
| 4041 | r1, _, e1 := syscall.SyscallN(procSetupDiEnumDriverInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData))) |
| 4042 | if r1 == 0 { |
| 4043 | err = errnoErr(e1) |
| 4044 | } |
| 4045 | return |
| 4046 | } |
| 4047 | |
| 4048 | func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, deviceInfoSet DevInfo, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { |
| 4049 | r0, _, e1 := syscall.SyscallN(procSetupDiGetClassDevsExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) |
| 4050 | handle = DevInfo(r0) |
| 4051 | if handle == DevInfo(InvalidHandle) { |
| 4052 | err = errnoErr(e1) |
| 4053 | } |
| 4054 | return |
| 4055 | } |
| 4056 | |
| 4057 | func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) { |
| 4058 | r1, _, e1 := syscall.SyscallN(procSetupDiGetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize))) |
| 4059 | if r1 == 0 { |
| 4060 | err = errnoErr(e1) |
| 4061 | } |
| 4062 | return |
| 4063 | } |
| 4064 | |
| 4065 | func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) { |
| 4066 | r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInfoListDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData))) |
| 4067 | if r1 == 0 { |
| 4068 | err = errnoErr(e1) |
| 4069 | } |
| 4070 | return |
| 4071 | } |
| 4072 | |
| 4073 | func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { |
| 4074 | r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) |
| 4075 | if r1 == 0 { |
| 4076 | err = errnoErr(e1) |
| 4077 | } |
| 4078 | return |
| 4079 | } |
| 4080 | |
| 4081 | func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) { |
| 4082 | r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstanceIdW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize))) |
| 4083 | if r1 == 0 { |
| 4084 | err = errnoErr(e1) |
| 4085 | } |
| 4086 | return |
| 4087 | } |
| 4088 | |
| 4089 | func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) { |
| 4090 | r1, _, e1 := syscall.SyscallN(procSetupDiGetDevicePropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags)) |
| 4091 | if r1 == 0 { |
| 4092 | err = errnoErr(e1) |
| 4093 | } |
| 4094 | return |
| 4095 | } |
| 4096 | |
| 4097 | func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) { |
| 4098 | r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize))) |
| 4099 | if r1 == 0 { |
| 4100 | err = errnoErr(e1) |
| 4101 | } |
| 4102 | return |
| 4103 | } |
| 4104 | |
| 4105 | func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) { |
| 4106 | r1, _, e1 := syscall.SyscallN(procSetupDiGetDriverInfoDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) |
| 4107 | if r1 == 0 { |
| 4108 | err = errnoErr(e1) |
| 4109 | } |
| 4110 | return |
| 4111 | } |
| 4112 | |
| 4113 | func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { |
| 4114 | r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) |
| 4115 | if r1 == 0 { |
| 4116 | err = errnoErr(e1) |
| 4117 | } |
| 4118 | return |
| 4119 | } |
| 4120 | |
| 4121 | func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { |
| 4122 | r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) |
| 4123 | if r1 == 0 { |
| 4124 | err = errnoErr(e1) |
| 4125 | } |
| 4126 | return |
| 4127 | } |
| 4128 | |
| 4129 | func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (key Handle, err error) { |
| 4130 | r0, _, e1 := syscall.SyscallN(procSetupDiOpenDevRegKey.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired)) |
| 4131 | key = Handle(r0) |
| 4132 | if key == InvalidHandle { |
| 4133 | err = errnoErr(e1) |
| 4134 | } |
| 4135 | return |
| 4136 | } |
| 4137 | |
| 4138 | func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) { |
| 4139 | r1, _, e1 := syscall.SyscallN(procSetupDiSetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize)) |
| 4140 | if r1 == 0 { |
| 4141 | err = errnoErr(e1) |
| 4142 | } |
| 4143 | return |
| 4144 | } |
| 4145 | |
| 4146 | func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { |
| 4147 | r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) |
| 4148 | if r1 == 0 { |
| 4149 | err = errnoErr(e1) |
| 4150 | } |
| 4151 | return |
| 4152 | } |
| 4153 | |
| 4154 | func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) { |
| 4155 | r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize)) |
| 4156 | if r1 == 0 { |
| 4157 | err = errnoErr(e1) |
| 4158 | } |
| 4159 | return |
| 4160 | } |
| 4161 | |
| 4162 | func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { |
| 4163 | r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) |
| 4164 | if r1 == 0 { |
| 4165 | err = errnoErr(e1) |
| 4166 | } |
| 4167 | return |
| 4168 | } |
| 4169 | |
| 4170 | func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { |
| 4171 | r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) |
| 4172 | if r1 == 0 { |
| 4173 | err = errnoErr(e1) |
| 4174 | } |
| 4175 | return |
| 4176 | } |
| 4177 | |
| 4178 | func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) { |
| 4179 | r1, _, e1 := syscall.SyscallN(procSetupUninstallOEMInfW.Addr(), uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) |
| 4180 | if r1 == 0 { |
| 4181 | err = errnoErr(e1) |
| 4182 | } |
| 4183 | return |
| 4184 | } |
| 4185 | |
| 4186 | func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { |
| 4187 | r0, _, e1 := syscall.SyscallN(procCommandLineToArgvW.Addr(), uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc))) |
| 4188 | argv = (**uint16)(unsafe.Pointer(r0)) |
| 4189 | if argv == nil { |
| 4190 | err = errnoErr(e1) |
| 4191 | } |
| 4192 | return |
| 4193 | } |
| 4194 | |
| 4195 | func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) { |
| 4196 | r0, _, _ := syscall.SyscallN(procSHGetKnownFolderPath.Addr(), uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path))) |
| 4197 | if r0 != 0 { |
| 4198 | ret = syscall.Errno(r0) |
| 4199 | } |
| 4200 | return |
| 4201 | } |
| 4202 | |
| 4203 | func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) { |
| 4204 | r1, _, e1 := syscall.SyscallN(procShellExecuteW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) |
| 4205 | if r1 <= 32 { |
| 4206 | err = errnoErr(e1) |
| 4207 | } |
| 4208 | return |
| 4209 | } |
| 4210 | |
| 4211 | func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) { |
| 4212 | syscall.SyscallN(procEnumChildWindows.Addr(), uintptr(hwnd), uintptr(enumFunc), uintptr(param)) |
| 4213 | return |
| 4214 | } |
| 4215 | |
| 4216 | func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { |
| 4217 | r1, _, e1 := syscall.SyscallN(procEnumWindows.Addr(), uintptr(enumFunc), uintptr(param)) |
| 4218 | if r1 == 0 { |
| 4219 | err = errnoErr(e1) |
| 4220 | } |
| 4221 | return |
| 4222 | } |
| 4223 | |
| 4224 | func ExitWindowsEx(flags uint32, reason uint32) (err error) { |
| 4225 | r1, _, e1 := syscall.SyscallN(procExitWindowsEx.Addr(), uintptr(flags), uintptr(reason)) |
| 4226 | if r1 == 0 { |
| 4227 | err = errnoErr(e1) |
| 4228 | } |
| 4229 | return |
| 4230 | } |
| 4231 | |
| 4232 | func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error) { |
| 4233 | r0, _, e1 := syscall.SyscallN(procGetClassNameW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount)) |
| 4234 | copied = int32(r0) |
| 4235 | if copied == 0 { |
| 4236 | err = errnoErr(e1) |
| 4237 | } |
| 4238 | return |
| 4239 | } |
| 4240 | |
| 4241 | func GetDesktopWindow() (hwnd HWND) { |
| 4242 | r0, _, _ := syscall.SyscallN(procGetDesktopWindow.Addr()) |
| 4243 | hwnd = HWND(r0) |
| 4244 | return |
| 4245 | } |
| 4246 | |
| 4247 | func GetForegroundWindow() (hwnd HWND) { |
| 4248 | r0, _, _ := syscall.SyscallN(procGetForegroundWindow.Addr()) |
| 4249 | hwnd = HWND(r0) |
| 4250 | return |
| 4251 | } |
| 4252 | |
| 4253 | func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { |
| 4254 | r1, _, e1 := syscall.SyscallN(procGetGUIThreadInfo.Addr(), uintptr(thread), uintptr(unsafe.Pointer(info))) |
| 4255 | if r1 == 0 { |
| 4256 | err = errnoErr(e1) |
| 4257 | } |
| 4258 | return |
| 4259 | } |
| 4260 | |
| 4261 | func GetKeyboardLayout(tid uint32) (hkl Handle) { |
| 4262 | r0, _, _ := syscall.SyscallN(procGetKeyboardLayout.Addr(), uintptr(tid)) |
| 4263 | hkl = Handle(r0) |
| 4264 | return |
| 4265 | } |
| 4266 | |
| 4267 | func GetShellWindow() (shellWindow HWND) { |
| 4268 | r0, _, _ := syscall.SyscallN(procGetShellWindow.Addr()) |
| 4269 | shellWindow = HWND(r0) |
| 4270 | return |
| 4271 | } |
| 4272 | |
| 4273 | func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { |
| 4274 | r0, _, e1 := syscall.SyscallN(procGetWindowThreadProcessId.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(pid))) |
| 4275 | tid = uint32(r0) |
| 4276 | if tid == 0 { |
| 4277 | err = errnoErr(e1) |
| 4278 | } |
| 4279 | return |
| 4280 | } |
| 4281 | |
| 4282 | func IsWindow(hwnd HWND) (isWindow bool) { |
| 4283 | r0, _, _ := syscall.SyscallN(procIsWindow.Addr(), uintptr(hwnd)) |
| 4284 | isWindow = r0 != 0 |
| 4285 | return |
| 4286 | } |
| 4287 | |
| 4288 | func IsWindowUnicode(hwnd HWND) (isUnicode bool) { |
| 4289 | r0, _, _ := syscall.SyscallN(procIsWindowUnicode.Addr(), uintptr(hwnd)) |
| 4290 | isUnicode = r0 != 0 |
| 4291 | return |
| 4292 | } |
| 4293 | |
| 4294 | func IsWindowVisible(hwnd HWND) (isVisible bool) { |
| 4295 | r0, _, _ := syscall.SyscallN(procIsWindowVisible.Addr(), uintptr(hwnd)) |
| 4296 | isVisible = r0 != 0 |
| 4297 | return |
| 4298 | } |
| 4299 | |
| 4300 | func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { |
| 4301 | r0, _, e1 := syscall.SyscallN(procLoadKeyboardLayoutW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags)) |
| 4302 | hkl = Handle(r0) |
| 4303 | if hkl == 0 { |
| 4304 | err = errnoErr(e1) |
| 4305 | } |
| 4306 | return |
| 4307 | } |
| 4308 | |
| 4309 | func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { |
| 4310 | r0, _, e1 := syscall.SyscallN(procMessageBoxW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype)) |
| 4311 | ret = int32(r0) |
| 4312 | if ret == 0 { |
| 4313 | err = errnoErr(e1) |
| 4314 | } |
| 4315 | return |
| 4316 | } |
| 4317 | |
| 4318 | func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { |
| 4319 | r0, _, _ := syscall.SyscallN(procToUnicodeEx.Addr(), uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl)) |
| 4320 | ret = int32(r0) |
| 4321 | return |
| 4322 | } |
| 4323 | |
| 4324 | func UnloadKeyboardLayout(hkl Handle) (err error) { |
| 4325 | r1, _, e1 := syscall.SyscallN(procUnloadKeyboardLayout.Addr(), uintptr(hkl)) |
| 4326 | if r1 == 0 { |
| 4327 | err = errnoErr(e1) |
| 4328 | } |
| 4329 | return |
| 4330 | } |
| 4331 | |
| 4332 | func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) { |
| 4333 | var _p0 uint32 |
| 4334 | if inheritExisting { |
| 4335 | _p0 = 1 |
| 4336 | } |
| 4337 | r1, _, e1 := syscall.SyscallN(procCreateEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) |
| 4338 | if r1 == 0 { |
| 4339 | err = errnoErr(e1) |
| 4340 | } |
| 4341 | return |
| 4342 | } |
| 4343 | |
| 4344 | func DestroyEnvironmentBlock(block *uint16) (err error) { |
| 4345 | r1, _, e1 := syscall.SyscallN(procDestroyEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block))) |
| 4346 | if r1 == 0 { |
| 4347 | err = errnoErr(e1) |
| 4348 | } |
| 4349 | return |
| 4350 | } |
| 4351 | |
| 4352 | func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { |
| 4353 | r1, _, e1 := syscall.SyscallN(procGetUserProfileDirectoryW.Addr(), uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) |
| 4354 | if r1 == 0 { |
| 4355 | err = errnoErr(e1) |
| 4356 | } |
| 4357 | return |
| 4358 | } |
| 4359 | |
| 4360 | func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32, err error) { |
| 4361 | var _p0 *uint16 |
| 4362 | _p0, err = syscall.UTF16PtrFromString(filename) |
| 4363 | if err != nil { |
| 4364 | return |
| 4365 | } |
| 4366 | return _GetFileVersionInfoSize(_p0, zeroHandle) |
| 4367 | } |
| 4368 | |
| 4369 | func _GetFileVersionInfoSize(filename *uint16, zeroHandle *Handle) (bufSize uint32, err error) { |
| 4370 | r0, _, e1 := syscall.SyscallN(procGetFileVersionInfoSizeW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle))) |
| 4371 | bufSize = uint32(r0) |
| 4372 | if bufSize == 0 { |
| 4373 | err = errnoErr(e1) |
| 4374 | } |
| 4375 | return |
| 4376 | } |
| 4377 | |
| 4378 | func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { |
| 4379 | var _p0 *uint16 |
| 4380 | _p0, err = syscall.UTF16PtrFromString(filename) |
| 4381 | if err != nil { |
| 4382 | return |
| 4383 | } |
| 4384 | return _GetFileVersionInfo(_p0, handle, bufSize, buffer) |
| 4385 | } |
| 4386 | |
| 4387 | func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { |
| 4388 | r1, _, e1 := syscall.SyscallN(procGetFileVersionInfoW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer)) |
| 4389 | if r1 == 0 { |
| 4390 | err = errnoErr(e1) |
| 4391 | } |
| 4392 | return |
| 4393 | } |
| 4394 | |
| 4395 | func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { |
| 4396 | var _p0 *uint16 |
| 4397 | _p0, err = syscall.UTF16PtrFromString(subBlock) |
| 4398 | if err != nil { |
| 4399 | return |
| 4400 | } |
| 4401 | return _VerQueryValue(block, _p0, pointerToBufferPointer, bufSize) |
| 4402 | } |
| 4403 | |
| 4404 | func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { |
| 4405 | r1, _, e1 := syscall.SyscallN(procVerQueryValueW.Addr(), uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize))) |
| 4406 | if r1 == 0 { |
| 4407 | err = errnoErr(e1) |
| 4408 | } |
| 4409 | return |
| 4410 | } |
| 4411 | |
| 4412 | func TimeBeginPeriod(period uint32) (err error) { |
| 4413 | r1, _, e1 := syscall.SyscallN(proctimeBeginPeriod.Addr(), uintptr(period)) |
| 4414 | if r1 != 0 { |
| 4415 | err = errnoErr(e1) |
| 4416 | } |
| 4417 | return |
| 4418 | } |
| 4419 | |
| 4420 | func TimeEndPeriod(period uint32) (err error) { |
| 4421 | r1, _, e1 := syscall.SyscallN(proctimeEndPeriod.Addr(), uintptr(period)) |
| 4422 | if r1 != 0 { |
| 4423 | err = errnoErr(e1) |
| 4424 | } |
| 4425 | return |
| 4426 | } |
| 4427 | |
| 4428 | func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) { |
| 4429 | r0, _, _ := syscall.SyscallN(procWinVerifyTrustEx.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) |
| 4430 | if r0 != 0 { |
| 4431 | ret = syscall.Errno(r0) |
| 4432 | } |
| 4433 | return |
| 4434 | } |
| 4435 | |
| 4436 | func FreeAddrInfoW(addrinfo *AddrinfoW) { |
| 4437 | syscall.SyscallN(procFreeAddrInfoW.Addr(), uintptr(unsafe.Pointer(addrinfo))) |
| 4438 | return |
| 4439 | } |
| 4440 | |
| 4441 | func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) { |
| 4442 | r0, _, _ := syscall.SyscallN(procGetAddrInfoW.Addr(), uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result))) |
| 4443 | if r0 != 0 { |
| 4444 | sockerr = syscall.Errno(r0) |
| 4445 | } |
| 4446 | return |
| 4447 | } |
| 4448 | |
| 4449 | func WSACleanup() (err error) { |
| 4450 | r1, _, e1 := syscall.SyscallN(procWSACleanup.Addr()) |
| 4451 | if r1 == socket_error { |
| 4452 | err = errnoErr(e1) |
| 4453 | } |
| 4454 | return |
| 4455 | } |
| 4456 | |
| 4457 | func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) { |
| 4458 | r1, _, e1 := syscall.SyscallN(procWSADuplicateSocketW.Addr(), uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info))) |
| 4459 | if r1 != 0 { |
| 4460 | err = errnoErr(e1) |
| 4461 | } |
| 4462 | return |
| 4463 | } |
| 4464 | |
| 4465 | func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) { |
| 4466 | r0, _, e1 := syscall.SyscallN(procWSAEnumProtocolsW.Addr(), uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) |
| 4467 | n = int32(r0) |
| 4468 | if n == -1 { |
| 4469 | err = errnoErr(e1) |
| 4470 | } |
| 4471 | return |
| 4472 | } |
| 4473 | |
| 4474 | func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { |
| 4475 | var _p0 uint32 |
| 4476 | if wait { |
| 4477 | _p0 = 1 |
| 4478 | } |
| 4479 | r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) |
| 4480 | if r1 == 0 { |
| 4481 | err = errnoErr(e1) |
| 4482 | } |
| 4483 | return |
| 4484 | } |
| 4485 | |
| 4486 | func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { |
| 4487 | r1, _, e1 := syscall.SyscallN(procWSAIoctl.Addr(), uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) |
| 4488 | if r1 == socket_error { |
| 4489 | err = errnoErr(e1) |
| 4490 | } |
| 4491 | return |
| 4492 | } |
| 4493 | |
| 4494 | func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) (err error) { |
| 4495 | r1, _, e1 := syscall.SyscallN(procWSALookupServiceBeginW.Addr(), uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle))) |
| 4496 | if r1 == socket_error { |
| 4497 | err = errnoErr(e1) |
| 4498 | } |
| 4499 | return |
| 4500 | } |
| 4501 | |
| 4502 | func WSALookupServiceEnd(handle Handle) (err error) { |
| 4503 | r1, _, e1 := syscall.SyscallN(procWSALookupServiceEnd.Addr(), uintptr(handle)) |
| 4504 | if r1 == socket_error { |
| 4505 | err = errnoErr(e1) |
| 4506 | } |
| 4507 | return |
| 4508 | } |
| 4509 | |
| 4510 | func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WSAQUERYSET) (err error) { |
| 4511 | r1, _, e1 := syscall.SyscallN(procWSALookupServiceNextW.Addr(), uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet))) |
| 4512 | if r1 == socket_error { |
| 4513 | err = errnoErr(e1) |
| 4514 | } |
| 4515 | return |
| 4516 | } |
| 4517 | |
| 4518 | func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) { |
| 4519 | r1, _, e1 := syscall.SyscallN(procWSARecv.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) |
| 4520 | if r1 == socket_error { |
| 4521 | err = errnoErr(e1) |
| 4522 | } |
| 4523 | return |
| 4524 | } |
| 4525 | |
| 4526 | func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) { |
| 4527 | r1, _, e1 := syscall.SyscallN(procWSARecvFrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) |
| 4528 | if r1 == socket_error { |
| 4529 | err = errnoErr(e1) |
| 4530 | } |
| 4531 | return |
| 4532 | } |
| 4533 | |
| 4534 | func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) { |
| 4535 | r1, _, e1 := syscall.SyscallN(procWSASend.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) |
| 4536 | if r1 == socket_error { |
| 4537 | err = errnoErr(e1) |
| 4538 | } |
| 4539 | return |
| 4540 | } |
| 4541 | |
| 4542 | func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) { |
| 4543 | r1, _, e1 := syscall.SyscallN(procWSASendTo.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) |
| 4544 | if r1 == socket_error { |
| 4545 | err = errnoErr(e1) |
| 4546 | } |
| 4547 | return |
| 4548 | } |
| 4549 | |
| 4550 | func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) { |
| 4551 | r0, _, e1 := syscall.SyscallN(procWSASocketW.Addr(), uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags)) |
| 4552 | handle = Handle(r0) |
| 4553 | if handle == InvalidHandle { |
| 4554 | err = errnoErr(e1) |
| 4555 | } |
| 4556 | return |
| 4557 | } |
| 4558 | |
| 4559 | func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { |
| 4560 | r0, _, _ := syscall.SyscallN(procWSAStartup.Addr(), uintptr(verreq), uintptr(unsafe.Pointer(data))) |
| 4561 | if r0 != 0 { |
| 4562 | sockerr = syscall.Errno(r0) |
| 4563 | } |
| 4564 | return |
| 4565 | } |
| 4566 | |
| 4567 | func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { |
| 4568 | r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) |
| 4569 | if r1 == socket_error { |
| 4570 | err = errnoErr(e1) |
| 4571 | } |
| 4572 | return |
| 4573 | } |
| 4574 | |
| 4575 | func Closesocket(s Handle) (err error) { |
| 4576 | r1, _, e1 := syscall.SyscallN(procclosesocket.Addr(), uintptr(s)) |
| 4577 | if r1 == socket_error { |
| 4578 | err = errnoErr(e1) |
| 4579 | } |
| 4580 | return |
| 4581 | } |
| 4582 | |
| 4583 | func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) { |
| 4584 | r1, _, e1 := syscall.SyscallN(procconnect.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) |
| 4585 | if r1 == socket_error { |
| 4586 | err = errnoErr(e1) |
| 4587 | } |
| 4588 | return |
| 4589 | } |
| 4590 | |
| 4591 | func GetHostByName(name string) (h *Hostent, err error) { |
| 4592 | var _p0 *byte |
| 4593 | _p0, err = syscall.BytePtrFromString(name) |
| 4594 | if err != nil { |
| 4595 | return |
| 4596 | } |
| 4597 | return _GetHostByName(_p0) |
| 4598 | } |
| 4599 | |
| 4600 | func _GetHostByName(name *byte) (h *Hostent, err error) { |
| 4601 | r0, _, e1 := syscall.SyscallN(procgethostbyname.Addr(), uintptr(unsafe.Pointer(name))) |
| 4602 | h = (*Hostent)(unsafe.Pointer(r0)) |
| 4603 | if h == nil { |
| 4604 | err = errnoErr(e1) |
| 4605 | } |
| 4606 | return |
| 4607 | } |
| 4608 | |
| 4609 | func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { |
| 4610 | r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) |
| 4611 | if r1 == socket_error { |
| 4612 | err = errnoErr(e1) |
| 4613 | } |
| 4614 | return |
| 4615 | } |
| 4616 | |
| 4617 | func GetProtoByName(name string) (p *Protoent, err error) { |
| 4618 | var _p0 *byte |
| 4619 | _p0, err = syscall.BytePtrFromString(name) |
| 4620 | if err != nil { |
| 4621 | return |
| 4622 | } |
| 4623 | return _GetProtoByName(_p0) |
| 4624 | } |
| 4625 | |
| 4626 | func _GetProtoByName(name *byte) (p *Protoent, err error) { |
| 4627 | r0, _, e1 := syscall.SyscallN(procgetprotobyname.Addr(), uintptr(unsafe.Pointer(name))) |
| 4628 | p = (*Protoent)(unsafe.Pointer(r0)) |
| 4629 | if p == nil { |
| 4630 | err = errnoErr(e1) |
| 4631 | } |
| 4632 | return |
| 4633 | } |
| 4634 | |
| 4635 | func GetServByName(name string, proto string) (s *Servent, err error) { |
| 4636 | var _p0 *byte |
| 4637 | _p0, err = syscall.BytePtrFromString(name) |
| 4638 | if err != nil { |
| 4639 | return |
| 4640 | } |
| 4641 | var _p1 *byte |
| 4642 | _p1, err = syscall.BytePtrFromString(proto) |
| 4643 | if err != nil { |
| 4644 | return |
| 4645 | } |
| 4646 | return _GetServByName(_p0, _p1) |
| 4647 | } |
| 4648 | |
| 4649 | func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { |
| 4650 | r0, _, e1 := syscall.SyscallN(procgetservbyname.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto))) |
| 4651 | s = (*Servent)(unsafe.Pointer(r0)) |
| 4652 | if s == nil { |
| 4653 | err = errnoErr(e1) |
| 4654 | } |
| 4655 | return |
| 4656 | } |
| 4657 | |
| 4658 | func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { |
| 4659 | r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) |
| 4660 | if r1 == socket_error { |
| 4661 | err = errnoErr(e1) |
| 4662 | } |
| 4663 | return |
| 4664 | } |
| 4665 | |
| 4666 | func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) { |
| 4667 | r1, _, e1 := syscall.SyscallN(procgetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen))) |
| 4668 | if r1 == socket_error { |
| 4669 | err = errnoErr(e1) |
| 4670 | } |
| 4671 | return |
| 4672 | } |
| 4673 | |
| 4674 | func listen(s Handle, backlog int32) (err error) { |
| 4675 | r1, _, e1 := syscall.SyscallN(proclisten.Addr(), uintptr(s), uintptr(backlog)) |
| 4676 | if r1 == socket_error { |
| 4677 | err = errnoErr(e1) |
| 4678 | } |
| 4679 | return |
| 4680 | } |
| 4681 | |
| 4682 | func Ntohs(netshort uint16) (u uint16) { |
| 4683 | r0, _, _ := syscall.SyscallN(procntohs.Addr(), uintptr(netshort)) |
| 4684 | u = uint16(r0) |
| 4685 | return |
| 4686 | } |
| 4687 | |
| 4688 | func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *int32) (n int32, err error) { |
| 4689 | var _p0 *byte |
| 4690 | if len(buf) > 0 { |
| 4691 | _p0 = &buf[0] |
| 4692 | } |
| 4693 | r0, _, e1 := syscall.SyscallN(procrecvfrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) |
| 4694 | n = int32(r0) |
| 4695 | if n == -1 { |
| 4696 | err = errnoErr(e1) |
| 4697 | } |
| 4698 | return |
| 4699 | } |
| 4700 | |
| 4701 | func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (err error) { |
| 4702 | var _p0 *byte |
| 4703 | if len(buf) > 0 { |
| 4704 | _p0 = &buf[0] |
| 4705 | } |
| 4706 | r1, _, e1 := syscall.SyscallN(procsendto.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) |
| 4707 | if r1 == socket_error { |
| 4708 | err = errnoErr(e1) |
| 4709 | } |
| 4710 | return |
| 4711 | } |
| 4712 | |
| 4713 | func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) { |
| 4714 | r1, _, e1 := syscall.SyscallN(procsetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen)) |
| 4715 | if r1 == socket_error { |
| 4716 | err = errnoErr(e1) |
| 4717 | } |
| 4718 | return |
| 4719 | } |
| 4720 | |
| 4721 | func shutdown(s Handle, how int32) (err error) { |
| 4722 | r1, _, e1 := syscall.SyscallN(procshutdown.Addr(), uintptr(s), uintptr(how)) |
| 4723 | if r1 == socket_error { |
| 4724 | err = errnoErr(e1) |
| 4725 | } |
| 4726 | return |
| 4727 | } |
| 4728 | |
| 4729 | func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { |
| 4730 | r0, _, e1 := syscall.SyscallN(procsocket.Addr(), uintptr(af), uintptr(typ), uintptr(protocol)) |
| 4731 | handle = Handle(r0) |
| 4732 | if handle == InvalidHandle { |
| 4733 | err = errnoErr(e1) |
| 4734 | } |
| 4735 | return |
| 4736 | } |
| 4737 | |
| 4738 | func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) { |
| 4739 | r1, _, e1 := syscall.SyscallN(procWTSEnumerateSessionsW.Addr(), uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count))) |
| 4740 | if r1 == 0 { |
| 4741 | err = errnoErr(e1) |
| 4742 | } |
| 4743 | return |
| 4744 | } |
| 4745 | |
| 4746 | func WTSFreeMemory(ptr uintptr) { |
| 4747 | syscall.SyscallN(procWTSFreeMemory.Addr(), uintptr(ptr)) |
| 4748 | return |
| 4749 | } |
| 4750 | |
| 4751 | func WTSQueryUserToken(session uint32, token *Token) (err error) { |
| 4752 | r1, _, e1 := syscall.SyscallN(procWTSQueryUserToken.Addr(), uintptr(session), uintptr(unsafe.Pointer(token))) |
| 4753 | if r1 == 0 { |
| 4754 | err = errnoErr(e1) |
| 4755 | } |
| 4756 | return |
| 4757 | } |