zsyscall_windows.go 17 KB

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