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. procHcsGetProcessInfo = modvmcompute.NewProc("HcsGetProcessInfo")
  51. procHcsGetProcessProperties = modvmcompute.NewProc("HcsGetProcessProperties")
  52. procHcsModifyProcess = modvmcompute.NewProc("HcsModifyProcess")
  53. procHcsGetServiceProperties = modvmcompute.NewProc("HcsGetServiceProperties")
  54. procHcsRegisterProcessCallback = modvmcompute.NewProc("HcsRegisterProcessCallback")
  55. procHcsUnregisterProcessCallback = modvmcompute.NewProc("HcsUnregisterProcessCallback")
  56. )
  57. func hcsEnumerateComputeSystems(query string, computeSystems **uint16, result **uint16) (hr error) {
  58. var _p0 *uint16
  59. _p0, hr = syscall.UTF16PtrFromString(query)
  60. if hr != nil {
  61. return
  62. }
  63. return _hcsEnumerateComputeSystems(_p0, computeSystems, result)
  64. }
  65. func _hcsEnumerateComputeSystems(query *uint16, computeSystems **uint16, result **uint16) (hr error) {
  66. if hr = procHcsEnumerateComputeSystems.Find(); hr != nil {
  67. return
  68. }
  69. r0, _, _ := syscall.Syscall(procHcsEnumerateComputeSystems.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(computeSystems)), uintptr(unsafe.Pointer(result)))
  70. if int32(r0) < 0 {
  71. if r0&0x1fff0000 == 0x00070000 {
  72. r0 &= 0xffff
  73. }
  74. hr = syscall.Errno(r0)
  75. }
  76. return
  77. }
  78. func hcsCreateComputeSystem(id string, configuration string, identity syscall.Handle, computeSystem *hcsSystem, result **uint16) (hr error) {
  79. var _p0 *uint16
  80. _p0, hr = syscall.UTF16PtrFromString(id)
  81. if hr != nil {
  82. return
  83. }
  84. var _p1 *uint16
  85. _p1, hr = syscall.UTF16PtrFromString(configuration)
  86. if hr != nil {
  87. return
  88. }
  89. return _hcsCreateComputeSystem(_p0, _p1, identity, computeSystem, result)
  90. }
  91. func _hcsCreateComputeSystem(id *uint16, configuration *uint16, identity syscall.Handle, computeSystem *hcsSystem, result **uint16) (hr error) {
  92. if hr = procHcsCreateComputeSystem.Find(); hr != nil {
  93. return
  94. }
  95. 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)
  96. if int32(r0) < 0 {
  97. if r0&0x1fff0000 == 0x00070000 {
  98. r0 &= 0xffff
  99. }
  100. hr = syscall.Errno(r0)
  101. }
  102. return
  103. }
  104. func hcsOpenComputeSystem(id string, computeSystem *hcsSystem, result **uint16) (hr error) {
  105. var _p0 *uint16
  106. _p0, hr = syscall.UTF16PtrFromString(id)
  107. if hr != nil {
  108. return
  109. }
  110. return _hcsOpenComputeSystem(_p0, computeSystem, result)
  111. }
  112. func _hcsOpenComputeSystem(id *uint16, computeSystem *hcsSystem, result **uint16) (hr error) {
  113. if hr = procHcsOpenComputeSystem.Find(); hr != nil {
  114. return
  115. }
  116. r0, _, _ := syscall.Syscall(procHcsOpenComputeSystem.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(computeSystem)), uintptr(unsafe.Pointer(result)))
  117. if int32(r0) < 0 {
  118. if r0&0x1fff0000 == 0x00070000 {
  119. r0 &= 0xffff
  120. }
  121. hr = syscall.Errno(r0)
  122. }
  123. return
  124. }
  125. func hcsCloseComputeSystem(computeSystem hcsSystem) (hr error) {
  126. if hr = procHcsCloseComputeSystem.Find(); hr != nil {
  127. return
  128. }
  129. r0, _, _ := syscall.Syscall(procHcsCloseComputeSystem.Addr(), 1, uintptr(computeSystem), 0, 0)
  130. if int32(r0) < 0 {
  131. if r0&0x1fff0000 == 0x00070000 {
  132. r0 &= 0xffff
  133. }
  134. hr = syscall.Errno(r0)
  135. }
  136. return
  137. }
  138. func hcsStartComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  139. var _p0 *uint16
  140. _p0, hr = syscall.UTF16PtrFromString(options)
  141. if hr != nil {
  142. return
  143. }
  144. return _hcsStartComputeSystem(computeSystem, _p0, result)
  145. }
  146. func _hcsStartComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  147. if hr = procHcsStartComputeSystem.Find(); hr != nil {
  148. return
  149. }
  150. r0, _, _ := syscall.Syscall(procHcsStartComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  151. if int32(r0) < 0 {
  152. if r0&0x1fff0000 == 0x00070000 {
  153. r0 &= 0xffff
  154. }
  155. hr = syscall.Errno(r0)
  156. }
  157. return
  158. }
  159. func hcsShutdownComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  160. var _p0 *uint16
  161. _p0, hr = syscall.UTF16PtrFromString(options)
  162. if hr != nil {
  163. return
  164. }
  165. return _hcsShutdownComputeSystem(computeSystem, _p0, result)
  166. }
  167. func _hcsShutdownComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  168. if hr = procHcsShutdownComputeSystem.Find(); hr != nil {
  169. return
  170. }
  171. r0, _, _ := syscall.Syscall(procHcsShutdownComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  172. if int32(r0) < 0 {
  173. if r0&0x1fff0000 == 0x00070000 {
  174. r0 &= 0xffff
  175. }
  176. hr = syscall.Errno(r0)
  177. }
  178. return
  179. }
  180. func hcsTerminateComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  181. var _p0 *uint16
  182. _p0, hr = syscall.UTF16PtrFromString(options)
  183. if hr != nil {
  184. return
  185. }
  186. return _hcsTerminateComputeSystem(computeSystem, _p0, result)
  187. }
  188. func _hcsTerminateComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  189. if hr = procHcsTerminateComputeSystem.Find(); hr != nil {
  190. return
  191. }
  192. r0, _, _ := syscall.Syscall(procHcsTerminateComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  193. if int32(r0) < 0 {
  194. if r0&0x1fff0000 == 0x00070000 {
  195. r0 &= 0xffff
  196. }
  197. hr = syscall.Errno(r0)
  198. }
  199. return
  200. }
  201. func hcsPauseComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  202. var _p0 *uint16
  203. _p0, hr = syscall.UTF16PtrFromString(options)
  204. if hr != nil {
  205. return
  206. }
  207. return _hcsPauseComputeSystem(computeSystem, _p0, result)
  208. }
  209. func _hcsPauseComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  210. if hr = procHcsPauseComputeSystem.Find(); hr != nil {
  211. return
  212. }
  213. r0, _, _ := syscall.Syscall(procHcsPauseComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  214. if int32(r0) < 0 {
  215. if r0&0x1fff0000 == 0x00070000 {
  216. r0 &= 0xffff
  217. }
  218. hr = syscall.Errno(r0)
  219. }
  220. return
  221. }
  222. func hcsResumeComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  223. var _p0 *uint16
  224. _p0, hr = syscall.UTF16PtrFromString(options)
  225. if hr != nil {
  226. return
  227. }
  228. return _hcsResumeComputeSystem(computeSystem, _p0, result)
  229. }
  230. func _hcsResumeComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  231. if hr = procHcsResumeComputeSystem.Find(); hr != nil {
  232. return
  233. }
  234. r0, _, _ := syscall.Syscall(procHcsResumeComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  235. if int32(r0) < 0 {
  236. if r0&0x1fff0000 == 0x00070000 {
  237. r0 &= 0xffff
  238. }
  239. hr = syscall.Errno(r0)
  240. }
  241. return
  242. }
  243. func hcsGetComputeSystemProperties(computeSystem hcsSystem, propertyQuery string, properties **uint16, result **uint16) (hr error) {
  244. var _p0 *uint16
  245. _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
  246. if hr != nil {
  247. return
  248. }
  249. return _hcsGetComputeSystemProperties(computeSystem, _p0, properties, result)
  250. }
  251. func _hcsGetComputeSystemProperties(computeSystem hcsSystem, propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
  252. if hr = procHcsGetComputeSystemProperties.Find(); hr != nil {
  253. return
  254. }
  255. r0, _, _ := syscall.Syscall6(procHcsGetComputeSystemProperties.Addr(), 4, uintptr(computeSystem), uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  256. if int32(r0) < 0 {
  257. if r0&0x1fff0000 == 0x00070000 {
  258. r0 &= 0xffff
  259. }
  260. hr = syscall.Errno(r0)
  261. }
  262. return
  263. }
  264. func hcsModifyComputeSystem(computeSystem hcsSystem, configuration string, result **uint16) (hr error) {
  265. var _p0 *uint16
  266. _p0, hr = syscall.UTF16PtrFromString(configuration)
  267. if hr != nil {
  268. return
  269. }
  270. return _hcsModifyComputeSystem(computeSystem, _p0, result)
  271. }
  272. func _hcsModifyComputeSystem(computeSystem hcsSystem, configuration *uint16, result **uint16) (hr error) {
  273. if hr = procHcsModifyComputeSystem.Find(); hr != nil {
  274. return
  275. }
  276. r0, _, _ := syscall.Syscall(procHcsModifyComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(configuration)), uintptr(unsafe.Pointer(result)))
  277. if int32(r0) < 0 {
  278. if r0&0x1fff0000 == 0x00070000 {
  279. r0 &= 0xffff
  280. }
  281. hr = syscall.Errno(r0)
  282. }
  283. return
  284. }
  285. func hcsRegisterComputeSystemCallback(computeSystem hcsSystem, callback uintptr, context uintptr, callbackHandle *hcsCallback) (hr error) {
  286. if hr = procHcsRegisterComputeSystemCallback.Find(); hr != nil {
  287. return
  288. }
  289. r0, _, _ := syscall.Syscall6(procHcsRegisterComputeSystemCallback.Addr(), 4, uintptr(computeSystem), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  290. if int32(r0) < 0 {
  291. if r0&0x1fff0000 == 0x00070000 {
  292. r0 &= 0xffff
  293. }
  294. hr = syscall.Errno(r0)
  295. }
  296. return
  297. }
  298. func hcsUnregisterComputeSystemCallback(callbackHandle hcsCallback) (hr error) {
  299. if hr = procHcsUnregisterComputeSystemCallback.Find(); hr != nil {
  300. return
  301. }
  302. r0, _, _ := syscall.Syscall(procHcsUnregisterComputeSystemCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  303. if int32(r0) < 0 {
  304. if r0&0x1fff0000 == 0x00070000 {
  305. r0 &= 0xffff
  306. }
  307. hr = syscall.Errno(r0)
  308. }
  309. return
  310. }
  311. func hcsCreateProcess(computeSystem hcsSystem, processParameters string, processInformation *hcsProcessInformation, process *hcsProcess, result **uint16) (hr error) {
  312. var _p0 *uint16
  313. _p0, hr = syscall.UTF16PtrFromString(processParameters)
  314. if hr != nil {
  315. return
  316. }
  317. return _hcsCreateProcess(computeSystem, _p0, processInformation, process, result)
  318. }
  319. func _hcsCreateProcess(computeSystem hcsSystem, processParameters *uint16, processInformation *hcsProcessInformation, process *hcsProcess, result **uint16) (hr error) {
  320. if hr = procHcsCreateProcess.Find(); hr != nil {
  321. return
  322. }
  323. 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)
  324. if int32(r0) < 0 {
  325. if r0&0x1fff0000 == 0x00070000 {
  326. r0 &= 0xffff
  327. }
  328. hr = syscall.Errno(r0)
  329. }
  330. return
  331. }
  332. func hcsOpenProcess(computeSystem hcsSystem, pid uint32, process *hcsProcess, result **uint16) (hr error) {
  333. if hr = procHcsOpenProcess.Find(); hr != nil {
  334. return
  335. }
  336. r0, _, _ := syscall.Syscall6(procHcsOpenProcess.Addr(), 4, uintptr(computeSystem), uintptr(pid), uintptr(unsafe.Pointer(process)), uintptr(unsafe.Pointer(result)), 0, 0)
  337. if int32(r0) < 0 {
  338. if r0&0x1fff0000 == 0x00070000 {
  339. r0 &= 0xffff
  340. }
  341. hr = syscall.Errno(r0)
  342. }
  343. return
  344. }
  345. func hcsCloseProcess(process hcsProcess) (hr error) {
  346. if hr = procHcsCloseProcess.Find(); hr != nil {
  347. return
  348. }
  349. r0, _, _ := syscall.Syscall(procHcsCloseProcess.Addr(), 1, uintptr(process), 0, 0)
  350. if int32(r0) < 0 {
  351. if r0&0x1fff0000 == 0x00070000 {
  352. r0 &= 0xffff
  353. }
  354. hr = syscall.Errno(r0)
  355. }
  356. return
  357. }
  358. func hcsTerminateProcess(process hcsProcess, result **uint16) (hr error) {
  359. if hr = procHcsTerminateProcess.Find(); hr != nil {
  360. return
  361. }
  362. r0, _, _ := syscall.Syscall(procHcsTerminateProcess.Addr(), 2, uintptr(process), uintptr(unsafe.Pointer(result)), 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 hcsSignalProcess(process hcsProcess, options string, result **uint16) (hr error) {
  372. var _p0 *uint16
  373. _p0, hr = syscall.UTF16PtrFromString(options)
  374. if hr != nil {
  375. return
  376. }
  377. return _hcsSignalProcess(process, _p0, result)
  378. }
  379. func _hcsSignalProcess(process hcsProcess, options *uint16, result **uint16) (hr error) {
  380. if hr = procHcsTerminateProcess.Find(); hr != nil {
  381. return
  382. }
  383. r0, _, _ := syscall.Syscall(procHcsTerminateProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  384. if int32(r0) < 0 {
  385. if r0&0x1fff0000 == 0x00070000 {
  386. r0 &= 0xffff
  387. }
  388. hr = syscall.Errno(r0)
  389. }
  390. return
  391. }
  392. func hcsGetProcessInfo(process hcsProcess, processInformation *hcsProcessInformation, result **uint16) (hr error) {
  393. if hr = procHcsGetProcessInfo.Find(); hr != nil {
  394. return
  395. }
  396. r0, _, _ := syscall.Syscall(procHcsGetProcessInfo.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processInformation)), uintptr(unsafe.Pointer(result)))
  397. if int32(r0) < 0 {
  398. if r0&0x1fff0000 == 0x00070000 {
  399. r0 &= 0xffff
  400. }
  401. hr = syscall.Errno(r0)
  402. }
  403. return
  404. }
  405. func hcsGetProcessProperties(process hcsProcess, processProperties **uint16, result **uint16) (hr error) {
  406. if hr = procHcsGetProcessProperties.Find(); hr != nil {
  407. return
  408. }
  409. r0, _, _ := syscall.Syscall(procHcsGetProcessProperties.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processProperties)), uintptr(unsafe.Pointer(result)))
  410. if int32(r0) < 0 {
  411. if r0&0x1fff0000 == 0x00070000 {
  412. r0 &= 0xffff
  413. }
  414. hr = syscall.Errno(r0)
  415. }
  416. return
  417. }
  418. func hcsModifyProcess(process hcsProcess, settings string, result **uint16) (hr error) {
  419. var _p0 *uint16
  420. _p0, hr = syscall.UTF16PtrFromString(settings)
  421. if hr != nil {
  422. return
  423. }
  424. return _hcsModifyProcess(process, _p0, result)
  425. }
  426. func _hcsModifyProcess(process hcsProcess, settings *uint16, result **uint16) (hr error) {
  427. if hr = procHcsModifyProcess.Find(); hr != nil {
  428. return
  429. }
  430. r0, _, _ := syscall.Syscall(procHcsModifyProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  431. if int32(r0) < 0 {
  432. if r0&0x1fff0000 == 0x00070000 {
  433. r0 &= 0xffff
  434. }
  435. hr = syscall.Errno(r0)
  436. }
  437. return
  438. }
  439. func hcsGetServiceProperties(propertyQuery string, properties **uint16, result **uint16) (hr error) {
  440. var _p0 *uint16
  441. _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
  442. if hr != nil {
  443. return
  444. }
  445. return _hcsGetServiceProperties(_p0, properties, result)
  446. }
  447. func _hcsGetServiceProperties(propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
  448. if hr = procHcsGetServiceProperties.Find(); hr != nil {
  449. return
  450. }
  451. r0, _, _ := syscall.Syscall(procHcsGetServiceProperties.Addr(), 3, uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)))
  452. if int32(r0) < 0 {
  453. if r0&0x1fff0000 == 0x00070000 {
  454. r0 &= 0xffff
  455. }
  456. hr = syscall.Errno(r0)
  457. }
  458. return
  459. }
  460. func hcsRegisterProcessCallback(process hcsProcess, callback uintptr, context uintptr, callbackHandle *hcsCallback) (hr error) {
  461. if hr = procHcsRegisterProcessCallback.Find(); hr != nil {
  462. return
  463. }
  464. r0, _, _ := syscall.Syscall6(procHcsRegisterProcessCallback.Addr(), 4, uintptr(process), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  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 hcsUnregisterProcessCallback(callbackHandle hcsCallback) (hr error) {
  474. if hr = procHcsUnregisterProcessCallback.Find(); hr != nil {
  475. return
  476. }
  477. r0, _, _ := syscall.Syscall(procHcsUnregisterProcessCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  478. if int32(r0) < 0 {
  479. if r0&0x1fff0000 == 0x00070000 {
  480. r0 &= 0xffff
  481. }
  482. hr = syscall.Errno(r0)
  483. }
  484. return
  485. }