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