zsyscall_windows.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. //go:build windows
  2. // Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT.
  3. package vmcompute
  4. import (
  5. "syscall"
  6. "unsafe"
  7. "golang.org/x/sys/windows"
  8. )
  9. var _ unsafe.Pointer
  10. // Do the interface allocations only once for common
  11. // Errno values.
  12. const (
  13. errnoERROR_IO_PENDING = 997
  14. )
  15. var (
  16. errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
  17. errERROR_EINVAL error = syscall.EINVAL
  18. )
  19. // errnoErr returns common boxed Errno values, to prevent
  20. // allocations at runtime.
  21. func errnoErr(e syscall.Errno) error {
  22. switch e {
  23. case 0:
  24. return errERROR_EINVAL
  25. case errnoERROR_IO_PENDING:
  26. return errERROR_IO_PENDING
  27. }
  28. // TODO: add more here, after collecting data on the common
  29. // error values see on Windows. (perhaps when running
  30. // all.bat?)
  31. return e
  32. }
  33. var (
  34. modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
  35. procHcsCloseComputeSystem = modvmcompute.NewProc("HcsCloseComputeSystem")
  36. procHcsCloseProcess = modvmcompute.NewProc("HcsCloseProcess")
  37. procHcsCreateComputeSystem = modvmcompute.NewProc("HcsCreateComputeSystem")
  38. procHcsCreateProcess = modvmcompute.NewProc("HcsCreateProcess")
  39. procHcsEnumerateComputeSystems = modvmcompute.NewProc("HcsEnumerateComputeSystems")
  40. procHcsGetComputeSystemProperties = modvmcompute.NewProc("HcsGetComputeSystemProperties")
  41. procHcsGetProcessInfo = modvmcompute.NewProc("HcsGetProcessInfo")
  42. procHcsGetProcessProperties = modvmcompute.NewProc("HcsGetProcessProperties")
  43. procHcsGetServiceProperties = modvmcompute.NewProc("HcsGetServiceProperties")
  44. procHcsModifyComputeSystem = modvmcompute.NewProc("HcsModifyComputeSystem")
  45. procHcsModifyProcess = modvmcompute.NewProc("HcsModifyProcess")
  46. procHcsModifyServiceSettings = modvmcompute.NewProc("HcsModifyServiceSettings")
  47. procHcsOpenComputeSystem = modvmcompute.NewProc("HcsOpenComputeSystem")
  48. procHcsOpenProcess = modvmcompute.NewProc("HcsOpenProcess")
  49. procHcsPauseComputeSystem = modvmcompute.NewProc("HcsPauseComputeSystem")
  50. procHcsRegisterComputeSystemCallback = modvmcompute.NewProc("HcsRegisterComputeSystemCallback")
  51. procHcsRegisterProcessCallback = modvmcompute.NewProc("HcsRegisterProcessCallback")
  52. procHcsResumeComputeSystem = modvmcompute.NewProc("HcsResumeComputeSystem")
  53. procHcsSaveComputeSystem = modvmcompute.NewProc("HcsSaveComputeSystem")
  54. procHcsShutdownComputeSystem = modvmcompute.NewProc("HcsShutdownComputeSystem")
  55. procHcsSignalProcess = modvmcompute.NewProc("HcsSignalProcess")
  56. procHcsStartComputeSystem = modvmcompute.NewProc("HcsStartComputeSystem")
  57. procHcsTerminateComputeSystem = modvmcompute.NewProc("HcsTerminateComputeSystem")
  58. procHcsTerminateProcess = modvmcompute.NewProc("HcsTerminateProcess")
  59. procHcsUnregisterComputeSystemCallback = modvmcompute.NewProc("HcsUnregisterComputeSystemCallback")
  60. procHcsUnregisterProcessCallback = modvmcompute.NewProc("HcsUnregisterProcessCallback")
  61. )
  62. func hcsCloseComputeSystem(computeSystem HcsSystem) (hr error) {
  63. hr = procHcsCloseComputeSystem.Find()
  64. if hr != nil {
  65. return
  66. }
  67. r0, _, _ := syscall.Syscall(procHcsCloseComputeSystem.Addr(), 1, uintptr(computeSystem), 0, 0)
  68. if int32(r0) < 0 {
  69. if r0&0x1fff0000 == 0x00070000 {
  70. r0 &= 0xffff
  71. }
  72. hr = syscall.Errno(r0)
  73. }
  74. return
  75. }
  76. func hcsCloseProcess(process HcsProcess) (hr error) {
  77. hr = procHcsCloseProcess.Find()
  78. if hr != nil {
  79. return
  80. }
  81. r0, _, _ := syscall.Syscall(procHcsCloseProcess.Addr(), 1, uintptr(process), 0, 0)
  82. if int32(r0) < 0 {
  83. if r0&0x1fff0000 == 0x00070000 {
  84. r0 &= 0xffff
  85. }
  86. hr = syscall.Errno(r0)
  87. }
  88. return
  89. }
  90. func hcsCreateComputeSystem(id string, configuration string, identity syscall.Handle, computeSystem *HcsSystem, result **uint16) (hr error) {
  91. var _p0 *uint16
  92. _p0, hr = syscall.UTF16PtrFromString(id)
  93. if hr != nil {
  94. return
  95. }
  96. var _p1 *uint16
  97. _p1, hr = syscall.UTF16PtrFromString(configuration)
  98. if hr != nil {
  99. return
  100. }
  101. return _hcsCreateComputeSystem(_p0, _p1, identity, computeSystem, result)
  102. }
  103. func _hcsCreateComputeSystem(id *uint16, configuration *uint16, identity syscall.Handle, computeSystem *HcsSystem, result **uint16) (hr error) {
  104. hr = procHcsCreateComputeSystem.Find()
  105. if hr != nil {
  106. return
  107. }
  108. r0, _, _ := syscall.Syscall6(procHcsCreateComputeSystem.Addr(), 5, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(configuration)), uintptr(identity), uintptr(unsafe.Pointer(computeSystem)), uintptr(unsafe.Pointer(result)), 0)
  109. if int32(r0) < 0 {
  110. if r0&0x1fff0000 == 0x00070000 {
  111. r0 &= 0xffff
  112. }
  113. hr = syscall.Errno(r0)
  114. }
  115. return
  116. }
  117. func hcsCreateProcess(computeSystem HcsSystem, processParameters string, processInformation *HcsProcessInformation, process *HcsProcess, result **uint16) (hr error) {
  118. var _p0 *uint16
  119. _p0, hr = syscall.UTF16PtrFromString(processParameters)
  120. if hr != nil {
  121. return
  122. }
  123. return _hcsCreateProcess(computeSystem, _p0, processInformation, process, result)
  124. }
  125. func _hcsCreateProcess(computeSystem HcsSystem, processParameters *uint16, processInformation *HcsProcessInformation, process *HcsProcess, result **uint16) (hr error) {
  126. hr = procHcsCreateProcess.Find()
  127. if hr != nil {
  128. return
  129. }
  130. r0, _, _ := syscall.Syscall6(procHcsCreateProcess.Addr(), 5, uintptr(computeSystem), uintptr(unsafe.Pointer(processParameters)), uintptr(unsafe.Pointer(processInformation)), uintptr(unsafe.Pointer(process)), uintptr(unsafe.Pointer(result)), 0)
  131. if int32(r0) < 0 {
  132. if r0&0x1fff0000 == 0x00070000 {
  133. r0 &= 0xffff
  134. }
  135. hr = syscall.Errno(r0)
  136. }
  137. return
  138. }
  139. func hcsEnumerateComputeSystems(query string, computeSystems **uint16, result **uint16) (hr error) {
  140. var _p0 *uint16
  141. _p0, hr = syscall.UTF16PtrFromString(query)
  142. if hr != nil {
  143. return
  144. }
  145. return _hcsEnumerateComputeSystems(_p0, computeSystems, result)
  146. }
  147. func _hcsEnumerateComputeSystems(query *uint16, computeSystems **uint16, result **uint16) (hr error) {
  148. hr = procHcsEnumerateComputeSystems.Find()
  149. if hr != nil {
  150. return
  151. }
  152. r0, _, _ := syscall.Syscall(procHcsEnumerateComputeSystems.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(computeSystems)), uintptr(unsafe.Pointer(result)))
  153. if int32(r0) < 0 {
  154. if r0&0x1fff0000 == 0x00070000 {
  155. r0 &= 0xffff
  156. }
  157. hr = syscall.Errno(r0)
  158. }
  159. return
  160. }
  161. func hcsGetComputeSystemProperties(computeSystem HcsSystem, propertyQuery string, properties **uint16, result **uint16) (hr error) {
  162. var _p0 *uint16
  163. _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
  164. if hr != nil {
  165. return
  166. }
  167. return _hcsGetComputeSystemProperties(computeSystem, _p0, properties, result)
  168. }
  169. func _hcsGetComputeSystemProperties(computeSystem HcsSystem, propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
  170. hr = procHcsGetComputeSystemProperties.Find()
  171. if hr != nil {
  172. return
  173. }
  174. r0, _, _ := syscall.Syscall6(procHcsGetComputeSystemProperties.Addr(), 4, uintptr(computeSystem), uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  175. if int32(r0) < 0 {
  176. if r0&0x1fff0000 == 0x00070000 {
  177. r0 &= 0xffff
  178. }
  179. hr = syscall.Errno(r0)
  180. }
  181. return
  182. }
  183. func hcsGetProcessInfo(process HcsProcess, processInformation *HcsProcessInformation, result **uint16) (hr error) {
  184. hr = procHcsGetProcessInfo.Find()
  185. if hr != nil {
  186. return
  187. }
  188. r0, _, _ := syscall.Syscall(procHcsGetProcessInfo.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processInformation)), uintptr(unsafe.Pointer(result)))
  189. if int32(r0) < 0 {
  190. if r0&0x1fff0000 == 0x00070000 {
  191. r0 &= 0xffff
  192. }
  193. hr = syscall.Errno(r0)
  194. }
  195. return
  196. }
  197. func hcsGetProcessProperties(process HcsProcess, processProperties **uint16, result **uint16) (hr error) {
  198. hr = procHcsGetProcessProperties.Find()
  199. if hr != nil {
  200. return
  201. }
  202. r0, _, _ := syscall.Syscall(procHcsGetProcessProperties.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processProperties)), uintptr(unsafe.Pointer(result)))
  203. if int32(r0) < 0 {
  204. if r0&0x1fff0000 == 0x00070000 {
  205. r0 &= 0xffff
  206. }
  207. hr = syscall.Errno(r0)
  208. }
  209. return
  210. }
  211. func hcsGetServiceProperties(propertyQuery string, properties **uint16, result **uint16) (hr error) {
  212. var _p0 *uint16
  213. _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
  214. if hr != nil {
  215. return
  216. }
  217. return _hcsGetServiceProperties(_p0, properties, result)
  218. }
  219. func _hcsGetServiceProperties(propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
  220. hr = procHcsGetServiceProperties.Find()
  221. if hr != nil {
  222. return
  223. }
  224. r0, _, _ := syscall.Syscall(procHcsGetServiceProperties.Addr(), 3, uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)))
  225. if int32(r0) < 0 {
  226. if r0&0x1fff0000 == 0x00070000 {
  227. r0 &= 0xffff
  228. }
  229. hr = syscall.Errno(r0)
  230. }
  231. return
  232. }
  233. func hcsModifyComputeSystem(computeSystem HcsSystem, configuration string, result **uint16) (hr error) {
  234. var _p0 *uint16
  235. _p0, hr = syscall.UTF16PtrFromString(configuration)
  236. if hr != nil {
  237. return
  238. }
  239. return _hcsModifyComputeSystem(computeSystem, _p0, result)
  240. }
  241. func _hcsModifyComputeSystem(computeSystem HcsSystem, configuration *uint16, result **uint16) (hr error) {
  242. hr = procHcsModifyComputeSystem.Find()
  243. if hr != nil {
  244. return
  245. }
  246. r0, _, _ := syscall.Syscall(procHcsModifyComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(configuration)), uintptr(unsafe.Pointer(result)))
  247. if int32(r0) < 0 {
  248. if r0&0x1fff0000 == 0x00070000 {
  249. r0 &= 0xffff
  250. }
  251. hr = syscall.Errno(r0)
  252. }
  253. return
  254. }
  255. func hcsModifyProcess(process HcsProcess, settings string, result **uint16) (hr error) {
  256. var _p0 *uint16
  257. _p0, hr = syscall.UTF16PtrFromString(settings)
  258. if hr != nil {
  259. return
  260. }
  261. return _hcsModifyProcess(process, _p0, result)
  262. }
  263. func _hcsModifyProcess(process HcsProcess, settings *uint16, result **uint16) (hr error) {
  264. hr = procHcsModifyProcess.Find()
  265. if hr != nil {
  266. return
  267. }
  268. r0, _, _ := syscall.Syscall(procHcsModifyProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  269. if int32(r0) < 0 {
  270. if r0&0x1fff0000 == 0x00070000 {
  271. r0 &= 0xffff
  272. }
  273. hr = syscall.Errno(r0)
  274. }
  275. return
  276. }
  277. func hcsModifyServiceSettings(settings string, result **uint16) (hr error) {
  278. var _p0 *uint16
  279. _p0, hr = syscall.UTF16PtrFromString(settings)
  280. if hr != nil {
  281. return
  282. }
  283. return _hcsModifyServiceSettings(_p0, result)
  284. }
  285. func _hcsModifyServiceSettings(settings *uint16, result **uint16) (hr error) {
  286. hr = procHcsModifyServiceSettings.Find()
  287. if hr != nil {
  288. return
  289. }
  290. r0, _, _ := syscall.Syscall(procHcsModifyServiceSettings.Addr(), 2, uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)), 0)
  291. if int32(r0) < 0 {
  292. if r0&0x1fff0000 == 0x00070000 {
  293. r0 &= 0xffff
  294. }
  295. hr = syscall.Errno(r0)
  296. }
  297. return
  298. }
  299. func hcsOpenComputeSystem(id string, computeSystem *HcsSystem, result **uint16) (hr error) {
  300. var _p0 *uint16
  301. _p0, hr = syscall.UTF16PtrFromString(id)
  302. if hr != nil {
  303. return
  304. }
  305. return _hcsOpenComputeSystem(_p0, computeSystem, result)
  306. }
  307. func _hcsOpenComputeSystem(id *uint16, computeSystem *HcsSystem, result **uint16) (hr error) {
  308. hr = procHcsOpenComputeSystem.Find()
  309. if hr != nil {
  310. return
  311. }
  312. r0, _, _ := syscall.Syscall(procHcsOpenComputeSystem.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(computeSystem)), uintptr(unsafe.Pointer(result)))
  313. if int32(r0) < 0 {
  314. if r0&0x1fff0000 == 0x00070000 {
  315. r0 &= 0xffff
  316. }
  317. hr = syscall.Errno(r0)
  318. }
  319. return
  320. }
  321. func hcsOpenProcess(computeSystem HcsSystem, pid uint32, process *HcsProcess, result **uint16) (hr error) {
  322. hr = procHcsOpenProcess.Find()
  323. if hr != nil {
  324. return
  325. }
  326. r0, _, _ := syscall.Syscall6(procHcsOpenProcess.Addr(), 4, uintptr(computeSystem), uintptr(pid), uintptr(unsafe.Pointer(process)), uintptr(unsafe.Pointer(result)), 0, 0)
  327. if int32(r0) < 0 {
  328. if r0&0x1fff0000 == 0x00070000 {
  329. r0 &= 0xffff
  330. }
  331. hr = syscall.Errno(r0)
  332. }
  333. return
  334. }
  335. func hcsPauseComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
  336. var _p0 *uint16
  337. _p0, hr = syscall.UTF16PtrFromString(options)
  338. if hr != nil {
  339. return
  340. }
  341. return _hcsPauseComputeSystem(computeSystem, _p0, result)
  342. }
  343. func _hcsPauseComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
  344. hr = procHcsPauseComputeSystem.Find()
  345. if hr != nil {
  346. return
  347. }
  348. r0, _, _ := syscall.Syscall(procHcsPauseComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  349. if int32(r0) < 0 {
  350. if r0&0x1fff0000 == 0x00070000 {
  351. r0 &= 0xffff
  352. }
  353. hr = syscall.Errno(r0)
  354. }
  355. return
  356. }
  357. func hcsRegisterComputeSystemCallback(computeSystem HcsSystem, callback uintptr, context uintptr, callbackHandle *HcsCallback) (hr error) {
  358. hr = procHcsRegisterComputeSystemCallback.Find()
  359. if hr != nil {
  360. return
  361. }
  362. r0, _, _ := syscall.Syscall6(procHcsRegisterComputeSystemCallback.Addr(), 4, uintptr(computeSystem), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  363. if int32(r0) < 0 {
  364. if r0&0x1fff0000 == 0x00070000 {
  365. r0 &= 0xffff
  366. }
  367. hr = syscall.Errno(r0)
  368. }
  369. return
  370. }
  371. func hcsRegisterProcessCallback(process HcsProcess, callback uintptr, context uintptr, callbackHandle *HcsCallback) (hr error) {
  372. hr = procHcsRegisterProcessCallback.Find()
  373. if hr != nil {
  374. return
  375. }
  376. r0, _, _ := syscall.Syscall6(procHcsRegisterProcessCallback.Addr(), 4, uintptr(process), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  377. if int32(r0) < 0 {
  378. if r0&0x1fff0000 == 0x00070000 {
  379. r0 &= 0xffff
  380. }
  381. hr = syscall.Errno(r0)
  382. }
  383. return
  384. }
  385. func hcsResumeComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
  386. var _p0 *uint16
  387. _p0, hr = syscall.UTF16PtrFromString(options)
  388. if hr != nil {
  389. return
  390. }
  391. return _hcsResumeComputeSystem(computeSystem, _p0, result)
  392. }
  393. func _hcsResumeComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
  394. hr = procHcsResumeComputeSystem.Find()
  395. if hr != nil {
  396. return
  397. }
  398. r0, _, _ := syscall.Syscall(procHcsResumeComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  399. if int32(r0) < 0 {
  400. if r0&0x1fff0000 == 0x00070000 {
  401. r0 &= 0xffff
  402. }
  403. hr = syscall.Errno(r0)
  404. }
  405. return
  406. }
  407. func hcsSaveComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
  408. var _p0 *uint16
  409. _p0, hr = syscall.UTF16PtrFromString(options)
  410. if hr != nil {
  411. return
  412. }
  413. return _hcsSaveComputeSystem(computeSystem, _p0, result)
  414. }
  415. func _hcsSaveComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
  416. hr = procHcsSaveComputeSystem.Find()
  417. if hr != nil {
  418. return
  419. }
  420. r0, _, _ := syscall.Syscall(procHcsSaveComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  421. if int32(r0) < 0 {
  422. if r0&0x1fff0000 == 0x00070000 {
  423. r0 &= 0xffff
  424. }
  425. hr = syscall.Errno(r0)
  426. }
  427. return
  428. }
  429. func hcsShutdownComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
  430. var _p0 *uint16
  431. _p0, hr = syscall.UTF16PtrFromString(options)
  432. if hr != nil {
  433. return
  434. }
  435. return _hcsShutdownComputeSystem(computeSystem, _p0, result)
  436. }
  437. func _hcsShutdownComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
  438. hr = procHcsShutdownComputeSystem.Find()
  439. if hr != nil {
  440. return
  441. }
  442. r0, _, _ := syscall.Syscall(procHcsShutdownComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  443. if int32(r0) < 0 {
  444. if r0&0x1fff0000 == 0x00070000 {
  445. r0 &= 0xffff
  446. }
  447. hr = syscall.Errno(r0)
  448. }
  449. return
  450. }
  451. func hcsSignalProcess(process HcsProcess, options string, result **uint16) (hr error) {
  452. var _p0 *uint16
  453. _p0, hr = syscall.UTF16PtrFromString(options)
  454. if hr != nil {
  455. return
  456. }
  457. return _hcsSignalProcess(process, _p0, result)
  458. }
  459. func _hcsSignalProcess(process HcsProcess, options *uint16, result **uint16) (hr error) {
  460. hr = procHcsSignalProcess.Find()
  461. if hr != nil {
  462. return
  463. }
  464. r0, _, _ := syscall.Syscall(procHcsSignalProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  465. if int32(r0) < 0 {
  466. if r0&0x1fff0000 == 0x00070000 {
  467. r0 &= 0xffff
  468. }
  469. hr = syscall.Errno(r0)
  470. }
  471. return
  472. }
  473. func hcsStartComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
  474. var _p0 *uint16
  475. _p0, hr = syscall.UTF16PtrFromString(options)
  476. if hr != nil {
  477. return
  478. }
  479. return _hcsStartComputeSystem(computeSystem, _p0, result)
  480. }
  481. func _hcsStartComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
  482. hr = procHcsStartComputeSystem.Find()
  483. if hr != nil {
  484. return
  485. }
  486. r0, _, _ := syscall.Syscall(procHcsStartComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  487. if int32(r0) < 0 {
  488. if r0&0x1fff0000 == 0x00070000 {
  489. r0 &= 0xffff
  490. }
  491. hr = syscall.Errno(r0)
  492. }
  493. return
  494. }
  495. func hcsTerminateComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
  496. var _p0 *uint16
  497. _p0, hr = syscall.UTF16PtrFromString(options)
  498. if hr != nil {
  499. return
  500. }
  501. return _hcsTerminateComputeSystem(computeSystem, _p0, result)
  502. }
  503. func _hcsTerminateComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
  504. hr = procHcsTerminateComputeSystem.Find()
  505. if hr != nil {
  506. return
  507. }
  508. r0, _, _ := syscall.Syscall(procHcsTerminateComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  509. if int32(r0) < 0 {
  510. if r0&0x1fff0000 == 0x00070000 {
  511. r0 &= 0xffff
  512. }
  513. hr = syscall.Errno(r0)
  514. }
  515. return
  516. }
  517. func hcsTerminateProcess(process HcsProcess, result **uint16) (hr error) {
  518. hr = procHcsTerminateProcess.Find()
  519. if hr != nil {
  520. return
  521. }
  522. r0, _, _ := syscall.Syscall(procHcsTerminateProcess.Addr(), 2, uintptr(process), uintptr(unsafe.Pointer(result)), 0)
  523. if int32(r0) < 0 {
  524. if r0&0x1fff0000 == 0x00070000 {
  525. r0 &= 0xffff
  526. }
  527. hr = syscall.Errno(r0)
  528. }
  529. return
  530. }
  531. func hcsUnregisterComputeSystemCallback(callbackHandle HcsCallback) (hr error) {
  532. hr = procHcsUnregisterComputeSystemCallback.Find()
  533. if hr != nil {
  534. return
  535. }
  536. r0, _, _ := syscall.Syscall(procHcsUnregisterComputeSystemCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  537. if int32(r0) < 0 {
  538. if r0&0x1fff0000 == 0x00070000 {
  539. r0 &= 0xffff
  540. }
  541. hr = syscall.Errno(r0)
  542. }
  543. return
  544. }
  545. func hcsUnregisterProcessCallback(callbackHandle HcsCallback) (hr error) {
  546. hr = procHcsUnregisterProcessCallback.Find()
  547. if hr != nil {
  548. return
  549. }
  550. r0, _, _ := syscall.Syscall(procHcsUnregisterProcessCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  551. if int32(r0) < 0 {
  552. if r0&0x1fff0000 == 0x00070000 {
  553. r0 &= 0xffff
  554. }
  555. hr = syscall.Errno(r0)
  556. }
  557. return
  558. }