zhcsshim.go 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
  2. package hcsshim
  3. import (
  4. "syscall"
  5. "unsafe"
  6. "github.com/Microsoft/go-winio"
  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. )
  18. // errnoErr returns common boxed Errno values, to prevent
  19. // allocations at runtime.
  20. func errnoErr(e syscall.Errno) error {
  21. switch e {
  22. case 0:
  23. return nil
  24. case errnoERROR_IO_PENDING:
  25. return errERROR_IO_PENDING
  26. }
  27. // TODO: add more here, after collecting data on the common
  28. // error values see on Windows. (perhaps when running
  29. // all.bat?)
  30. return e
  31. }
  32. var (
  33. modole32 = windows.NewLazySystemDLL("ole32.dll")
  34. modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll")
  35. modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
  36. procCoTaskMemFree = modole32.NewProc("CoTaskMemFree")
  37. procSetCurrentThreadCompartmentId = modiphlpapi.NewProc("SetCurrentThreadCompartmentId")
  38. procActivateLayer = modvmcompute.NewProc("ActivateLayer")
  39. procCopyLayer = modvmcompute.NewProc("CopyLayer")
  40. procCreateLayer = modvmcompute.NewProc("CreateLayer")
  41. procCreateSandboxLayer = modvmcompute.NewProc("CreateSandboxLayer")
  42. procExpandSandboxSize = modvmcompute.NewProc("ExpandSandboxSize")
  43. procDeactivateLayer = modvmcompute.NewProc("DeactivateLayer")
  44. procDestroyLayer = modvmcompute.NewProc("DestroyLayer")
  45. procExportLayer = modvmcompute.NewProc("ExportLayer")
  46. procGetLayerMountPath = modvmcompute.NewProc("GetLayerMountPath")
  47. procGetBaseImages = modvmcompute.NewProc("GetBaseImages")
  48. procImportLayer = modvmcompute.NewProc("ImportLayer")
  49. procLayerExists = modvmcompute.NewProc("LayerExists")
  50. procNameToGuid = modvmcompute.NewProc("NameToGuid")
  51. procPrepareLayer = modvmcompute.NewProc("PrepareLayer")
  52. procUnprepareLayer = modvmcompute.NewProc("UnprepareLayer")
  53. procProcessBaseImage = modvmcompute.NewProc("ProcessBaseImage")
  54. procProcessUtilityImage = modvmcompute.NewProc("ProcessUtilityImage")
  55. procImportLayerBegin = modvmcompute.NewProc("ImportLayerBegin")
  56. procImportLayerNext = modvmcompute.NewProc("ImportLayerNext")
  57. procImportLayerWrite = modvmcompute.NewProc("ImportLayerWrite")
  58. procImportLayerEnd = modvmcompute.NewProc("ImportLayerEnd")
  59. procExportLayerBegin = modvmcompute.NewProc("ExportLayerBegin")
  60. procExportLayerNext = modvmcompute.NewProc("ExportLayerNext")
  61. procExportLayerRead = modvmcompute.NewProc("ExportLayerRead")
  62. procExportLayerEnd = modvmcompute.NewProc("ExportLayerEnd")
  63. procHcsEnumerateComputeSystems = modvmcompute.NewProc("HcsEnumerateComputeSystems")
  64. procHcsCreateComputeSystem = modvmcompute.NewProc("HcsCreateComputeSystem")
  65. procHcsOpenComputeSystem = modvmcompute.NewProc("HcsOpenComputeSystem")
  66. procHcsCloseComputeSystem = modvmcompute.NewProc("HcsCloseComputeSystem")
  67. procHcsStartComputeSystem = modvmcompute.NewProc("HcsStartComputeSystem")
  68. procHcsShutdownComputeSystem = modvmcompute.NewProc("HcsShutdownComputeSystem")
  69. procHcsTerminateComputeSystem = modvmcompute.NewProc("HcsTerminateComputeSystem")
  70. procHcsPauseComputeSystem = modvmcompute.NewProc("HcsPauseComputeSystem")
  71. procHcsResumeComputeSystem = modvmcompute.NewProc("HcsResumeComputeSystem")
  72. procHcsGetComputeSystemProperties = modvmcompute.NewProc("HcsGetComputeSystemProperties")
  73. procHcsModifyComputeSystem = modvmcompute.NewProc("HcsModifyComputeSystem")
  74. procHcsRegisterComputeSystemCallback = modvmcompute.NewProc("HcsRegisterComputeSystemCallback")
  75. procHcsUnregisterComputeSystemCallback = modvmcompute.NewProc("HcsUnregisterComputeSystemCallback")
  76. procHcsCreateProcess = modvmcompute.NewProc("HcsCreateProcess")
  77. procHcsOpenProcess = modvmcompute.NewProc("HcsOpenProcess")
  78. procHcsCloseProcess = modvmcompute.NewProc("HcsCloseProcess")
  79. procHcsTerminateProcess = modvmcompute.NewProc("HcsTerminateProcess")
  80. procHcsGetProcessInfo = modvmcompute.NewProc("HcsGetProcessInfo")
  81. procHcsGetProcessProperties = modvmcompute.NewProc("HcsGetProcessProperties")
  82. procHcsModifyProcess = modvmcompute.NewProc("HcsModifyProcess")
  83. procHcsGetServiceProperties = modvmcompute.NewProc("HcsGetServiceProperties")
  84. procHcsRegisterProcessCallback = modvmcompute.NewProc("HcsRegisterProcessCallback")
  85. procHcsUnregisterProcessCallback = modvmcompute.NewProc("HcsUnregisterProcessCallback")
  86. procHcsModifyServiceSettings = modvmcompute.NewProc("HcsModifyServiceSettings")
  87. procHNSCall = modvmcompute.NewProc("HNSCall")
  88. )
  89. func coTaskMemFree(buffer unsafe.Pointer) {
  90. syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(buffer), 0, 0)
  91. return
  92. }
  93. func SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) {
  94. r0, _, _ := syscall.Syscall(procSetCurrentThreadCompartmentId.Addr(), 1, uintptr(compartmentId), 0, 0)
  95. if int32(r0) < 0 {
  96. hr = syscall.Errno(win32FromHresult(r0))
  97. }
  98. return
  99. }
  100. func activateLayer(info *driverInfo, id string) (hr error) {
  101. var _p0 *uint16
  102. _p0, hr = syscall.UTF16PtrFromString(id)
  103. if hr != nil {
  104. return
  105. }
  106. return _activateLayer(info, _p0)
  107. }
  108. func _activateLayer(info *driverInfo, id *uint16) (hr error) {
  109. if hr = procActivateLayer.Find(); hr != nil {
  110. return
  111. }
  112. r0, _, _ := syscall.Syscall(procActivateLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  113. if int32(r0) < 0 {
  114. hr = syscall.Errno(win32FromHresult(r0))
  115. }
  116. return
  117. }
  118. func copyLayer(info *driverInfo, srcId string, dstId string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  119. var _p0 *uint16
  120. _p0, hr = syscall.UTF16PtrFromString(srcId)
  121. if hr != nil {
  122. return
  123. }
  124. var _p1 *uint16
  125. _p1, hr = syscall.UTF16PtrFromString(dstId)
  126. if hr != nil {
  127. return
  128. }
  129. return _copyLayer(info, _p0, _p1, descriptors)
  130. }
  131. func _copyLayer(info *driverInfo, srcId *uint16, dstId *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  132. var _p2 *WC_LAYER_DESCRIPTOR
  133. if len(descriptors) > 0 {
  134. _p2 = &descriptors[0]
  135. }
  136. if hr = procCopyLayer.Find(); hr != nil {
  137. return
  138. }
  139. r0, _, _ := syscall.Syscall6(procCopyLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(srcId)), uintptr(unsafe.Pointer(dstId)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
  140. if int32(r0) < 0 {
  141. hr = syscall.Errno(win32FromHresult(r0))
  142. }
  143. return
  144. }
  145. func createLayer(info *driverInfo, id string, parent string) (hr error) {
  146. var _p0 *uint16
  147. _p0, hr = syscall.UTF16PtrFromString(id)
  148. if hr != nil {
  149. return
  150. }
  151. var _p1 *uint16
  152. _p1, hr = syscall.UTF16PtrFromString(parent)
  153. if hr != nil {
  154. return
  155. }
  156. return _createLayer(info, _p0, _p1)
  157. }
  158. func _createLayer(info *driverInfo, id *uint16, parent *uint16) (hr error) {
  159. if hr = procCreateLayer.Find(); hr != nil {
  160. return
  161. }
  162. r0, _, _ := syscall.Syscall(procCreateLayer.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(parent)))
  163. if int32(r0) < 0 {
  164. hr = syscall.Errno(win32FromHresult(r0))
  165. }
  166. return
  167. }
  168. func createSandboxLayer(info *driverInfo, id string, parent string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  169. var _p0 *uint16
  170. _p0, hr = syscall.UTF16PtrFromString(id)
  171. if hr != nil {
  172. return
  173. }
  174. var _p1 *uint16
  175. _p1, hr = syscall.UTF16PtrFromString(parent)
  176. if hr != nil {
  177. return
  178. }
  179. return _createSandboxLayer(info, _p0, _p1, descriptors)
  180. }
  181. func _createSandboxLayer(info *driverInfo, id *uint16, parent *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  182. var _p2 *WC_LAYER_DESCRIPTOR
  183. if len(descriptors) > 0 {
  184. _p2 = &descriptors[0]
  185. }
  186. if hr = procCreateSandboxLayer.Find(); hr != nil {
  187. return
  188. }
  189. r0, _, _ := syscall.Syscall6(procCreateSandboxLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(parent)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
  190. if int32(r0) < 0 {
  191. hr = syscall.Errno(win32FromHresult(r0))
  192. }
  193. return
  194. }
  195. func expandSandboxSize(info *driverInfo, id string, size uint64) (hr error) {
  196. var _p0 *uint16
  197. _p0, hr = syscall.UTF16PtrFromString(id)
  198. if hr != nil {
  199. return
  200. }
  201. return _expandSandboxSize(info, _p0, size)
  202. }
  203. func _expandSandboxSize(info *driverInfo, id *uint16, size uint64) (hr error) {
  204. if hr = procExpandSandboxSize.Find(); hr != nil {
  205. return
  206. }
  207. r0, _, _ := syscall.Syscall(procExpandSandboxSize.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(size))
  208. if int32(r0) < 0 {
  209. hr = syscall.Errno(win32FromHresult(r0))
  210. }
  211. return
  212. }
  213. func deactivateLayer(info *driverInfo, id string) (hr error) {
  214. var _p0 *uint16
  215. _p0, hr = syscall.UTF16PtrFromString(id)
  216. if hr != nil {
  217. return
  218. }
  219. return _deactivateLayer(info, _p0)
  220. }
  221. func _deactivateLayer(info *driverInfo, id *uint16) (hr error) {
  222. if hr = procDeactivateLayer.Find(); hr != nil {
  223. return
  224. }
  225. r0, _, _ := syscall.Syscall(procDeactivateLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  226. if int32(r0) < 0 {
  227. hr = syscall.Errno(win32FromHresult(r0))
  228. }
  229. return
  230. }
  231. func destroyLayer(info *driverInfo, id string) (hr error) {
  232. var _p0 *uint16
  233. _p0, hr = syscall.UTF16PtrFromString(id)
  234. if hr != nil {
  235. return
  236. }
  237. return _destroyLayer(info, _p0)
  238. }
  239. func _destroyLayer(info *driverInfo, id *uint16) (hr error) {
  240. if hr = procDestroyLayer.Find(); hr != nil {
  241. return
  242. }
  243. r0, _, _ := syscall.Syscall(procDestroyLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  244. if int32(r0) < 0 {
  245. hr = syscall.Errno(win32FromHresult(r0))
  246. }
  247. return
  248. }
  249. func exportLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  250. var _p0 *uint16
  251. _p0, hr = syscall.UTF16PtrFromString(id)
  252. if hr != nil {
  253. return
  254. }
  255. var _p1 *uint16
  256. _p1, hr = syscall.UTF16PtrFromString(path)
  257. if hr != nil {
  258. return
  259. }
  260. return _exportLayer(info, _p0, _p1, descriptors)
  261. }
  262. func _exportLayer(info *driverInfo, id *uint16, path *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  263. var _p2 *WC_LAYER_DESCRIPTOR
  264. if len(descriptors) > 0 {
  265. _p2 = &descriptors[0]
  266. }
  267. if hr = procExportLayer.Find(); hr != nil {
  268. return
  269. }
  270. r0, _, _ := syscall.Syscall6(procExportLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
  271. if int32(r0) < 0 {
  272. hr = syscall.Errno(win32FromHresult(r0))
  273. }
  274. return
  275. }
  276. func getLayerMountPath(info *driverInfo, id string, length *uintptr, buffer *uint16) (hr error) {
  277. var _p0 *uint16
  278. _p0, hr = syscall.UTF16PtrFromString(id)
  279. if hr != nil {
  280. return
  281. }
  282. return _getLayerMountPath(info, _p0, length, buffer)
  283. }
  284. func _getLayerMountPath(info *driverInfo, id *uint16, length *uintptr, buffer *uint16) (hr error) {
  285. if hr = procGetLayerMountPath.Find(); hr != nil {
  286. return
  287. }
  288. r0, _, _ := syscall.Syscall6(procGetLayerMountPath.Addr(), 4, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(length)), uintptr(unsafe.Pointer(buffer)), 0, 0)
  289. if int32(r0) < 0 {
  290. hr = syscall.Errno(win32FromHresult(r0))
  291. }
  292. return
  293. }
  294. func getBaseImages(buffer **uint16) (hr error) {
  295. if hr = procGetBaseImages.Find(); hr != nil {
  296. return
  297. }
  298. r0, _, _ := syscall.Syscall(procGetBaseImages.Addr(), 1, uintptr(unsafe.Pointer(buffer)), 0, 0)
  299. if int32(r0) < 0 {
  300. hr = syscall.Errno(win32FromHresult(r0))
  301. }
  302. return
  303. }
  304. func importLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  305. var _p0 *uint16
  306. _p0, hr = syscall.UTF16PtrFromString(id)
  307. if hr != nil {
  308. return
  309. }
  310. var _p1 *uint16
  311. _p1, hr = syscall.UTF16PtrFromString(path)
  312. if hr != nil {
  313. return
  314. }
  315. return _importLayer(info, _p0, _p1, descriptors)
  316. }
  317. func _importLayer(info *driverInfo, id *uint16, path *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  318. var _p2 *WC_LAYER_DESCRIPTOR
  319. if len(descriptors) > 0 {
  320. _p2 = &descriptors[0]
  321. }
  322. if hr = procImportLayer.Find(); hr != nil {
  323. return
  324. }
  325. r0, _, _ := syscall.Syscall6(procImportLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
  326. if int32(r0) < 0 {
  327. hr = syscall.Errno(win32FromHresult(r0))
  328. }
  329. return
  330. }
  331. func layerExists(info *driverInfo, id string, exists *uint32) (hr error) {
  332. var _p0 *uint16
  333. _p0, hr = syscall.UTF16PtrFromString(id)
  334. if hr != nil {
  335. return
  336. }
  337. return _layerExists(info, _p0, exists)
  338. }
  339. func _layerExists(info *driverInfo, id *uint16, exists *uint32) (hr error) {
  340. if hr = procLayerExists.Find(); hr != nil {
  341. return
  342. }
  343. r0, _, _ := syscall.Syscall(procLayerExists.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(exists)))
  344. if int32(r0) < 0 {
  345. hr = syscall.Errno(win32FromHresult(r0))
  346. }
  347. return
  348. }
  349. func nameToGuid(name string, guid *GUID) (hr error) {
  350. var _p0 *uint16
  351. _p0, hr = syscall.UTF16PtrFromString(name)
  352. if hr != nil {
  353. return
  354. }
  355. return _nameToGuid(_p0, guid)
  356. }
  357. func _nameToGuid(name *uint16, guid *GUID) (hr error) {
  358. if hr = procNameToGuid.Find(); hr != nil {
  359. return
  360. }
  361. r0, _, _ := syscall.Syscall(procNameToGuid.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(guid)), 0)
  362. if int32(r0) < 0 {
  363. hr = syscall.Errno(win32FromHresult(r0))
  364. }
  365. return
  366. }
  367. func prepareLayer(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  368. var _p0 *uint16
  369. _p0, hr = syscall.UTF16PtrFromString(id)
  370. if hr != nil {
  371. return
  372. }
  373. return _prepareLayer(info, _p0, descriptors)
  374. }
  375. func _prepareLayer(info *driverInfo, id *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  376. var _p1 *WC_LAYER_DESCRIPTOR
  377. if len(descriptors) > 0 {
  378. _p1 = &descriptors[0]
  379. }
  380. if hr = procPrepareLayer.Find(); hr != nil {
  381. return
  382. }
  383. r0, _, _ := syscall.Syscall6(procPrepareLayer.Addr(), 4, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), 0, 0)
  384. if int32(r0) < 0 {
  385. hr = syscall.Errno(win32FromHresult(r0))
  386. }
  387. return
  388. }
  389. func unprepareLayer(info *driverInfo, id string) (hr error) {
  390. var _p0 *uint16
  391. _p0, hr = syscall.UTF16PtrFromString(id)
  392. if hr != nil {
  393. return
  394. }
  395. return _unprepareLayer(info, _p0)
  396. }
  397. func _unprepareLayer(info *driverInfo, id *uint16) (hr error) {
  398. if hr = procUnprepareLayer.Find(); hr != nil {
  399. return
  400. }
  401. r0, _, _ := syscall.Syscall(procUnprepareLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  402. if int32(r0) < 0 {
  403. hr = syscall.Errno(win32FromHresult(r0))
  404. }
  405. return
  406. }
  407. func processBaseImage(path string) (hr error) {
  408. var _p0 *uint16
  409. _p0, hr = syscall.UTF16PtrFromString(path)
  410. if hr != nil {
  411. return
  412. }
  413. return _processBaseImage(_p0)
  414. }
  415. func _processBaseImage(path *uint16) (hr error) {
  416. if hr = procProcessBaseImage.Find(); hr != nil {
  417. return
  418. }
  419. r0, _, _ := syscall.Syscall(procProcessBaseImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
  420. if int32(r0) < 0 {
  421. hr = syscall.Errno(win32FromHresult(r0))
  422. }
  423. return
  424. }
  425. func processUtilityImage(path string) (hr error) {
  426. var _p0 *uint16
  427. _p0, hr = syscall.UTF16PtrFromString(path)
  428. if hr != nil {
  429. return
  430. }
  431. return _processUtilityImage(_p0)
  432. }
  433. func _processUtilityImage(path *uint16) (hr error) {
  434. if hr = procProcessUtilityImage.Find(); hr != nil {
  435. return
  436. }
  437. r0, _, _ := syscall.Syscall(procProcessUtilityImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
  438. if int32(r0) < 0 {
  439. hr = syscall.Errno(win32FromHresult(r0))
  440. }
  441. return
  442. }
  443. func importLayerBegin(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR, context *uintptr) (hr error) {
  444. var _p0 *uint16
  445. _p0, hr = syscall.UTF16PtrFromString(id)
  446. if hr != nil {
  447. return
  448. }
  449. return _importLayerBegin(info, _p0, descriptors, context)
  450. }
  451. func _importLayerBegin(info *driverInfo, id *uint16, descriptors []WC_LAYER_DESCRIPTOR, context *uintptr) (hr error) {
  452. var _p1 *WC_LAYER_DESCRIPTOR
  453. if len(descriptors) > 0 {
  454. _p1 = &descriptors[0]
  455. }
  456. if hr = procImportLayerBegin.Find(); hr != nil {
  457. return
  458. }
  459. r0, _, _ := syscall.Syscall6(procImportLayerBegin.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), uintptr(unsafe.Pointer(context)), 0)
  460. if int32(r0) < 0 {
  461. hr = syscall.Errno(win32FromHresult(r0))
  462. }
  463. return
  464. }
  465. func importLayerNext(context uintptr, fileName string, fileInfo *winio.FileBasicInfo) (hr error) {
  466. var _p0 *uint16
  467. _p0, hr = syscall.UTF16PtrFromString(fileName)
  468. if hr != nil {
  469. return
  470. }
  471. return _importLayerNext(context, _p0, fileInfo)
  472. }
  473. func _importLayerNext(context uintptr, fileName *uint16, fileInfo *winio.FileBasicInfo) (hr error) {
  474. if hr = procImportLayerNext.Find(); hr != nil {
  475. return
  476. }
  477. r0, _, _ := syscall.Syscall(procImportLayerNext.Addr(), 3, uintptr(context), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(fileInfo)))
  478. if int32(r0) < 0 {
  479. hr = syscall.Errno(win32FromHresult(r0))
  480. }
  481. return
  482. }
  483. func importLayerWrite(context uintptr, buffer []byte) (hr error) {
  484. var _p0 *byte
  485. if len(buffer) > 0 {
  486. _p0 = &buffer[0]
  487. }
  488. if hr = procImportLayerWrite.Find(); hr != nil {
  489. return
  490. }
  491. r0, _, _ := syscall.Syscall(procImportLayerWrite.Addr(), 3, uintptr(context), uintptr(unsafe.Pointer(_p0)), uintptr(len(buffer)))
  492. if int32(r0) < 0 {
  493. hr = syscall.Errno(win32FromHresult(r0))
  494. }
  495. return
  496. }
  497. func importLayerEnd(context uintptr) (hr error) {
  498. if hr = procImportLayerEnd.Find(); hr != nil {
  499. return
  500. }
  501. r0, _, _ := syscall.Syscall(procImportLayerEnd.Addr(), 1, uintptr(context), 0, 0)
  502. if int32(r0) < 0 {
  503. hr = syscall.Errno(win32FromHresult(r0))
  504. }
  505. return
  506. }
  507. func exportLayerBegin(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR, context *uintptr) (hr error) {
  508. var _p0 *uint16
  509. _p0, hr = syscall.UTF16PtrFromString(id)
  510. if hr != nil {
  511. return
  512. }
  513. return _exportLayerBegin(info, _p0, descriptors, context)
  514. }
  515. func _exportLayerBegin(info *driverInfo, id *uint16, descriptors []WC_LAYER_DESCRIPTOR, context *uintptr) (hr error) {
  516. var _p1 *WC_LAYER_DESCRIPTOR
  517. if len(descriptors) > 0 {
  518. _p1 = &descriptors[0]
  519. }
  520. if hr = procExportLayerBegin.Find(); hr != nil {
  521. return
  522. }
  523. r0, _, _ := syscall.Syscall6(procExportLayerBegin.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), uintptr(unsafe.Pointer(context)), 0)
  524. if int32(r0) < 0 {
  525. hr = syscall.Errno(win32FromHresult(r0))
  526. }
  527. return
  528. }
  529. func exportLayerNext(context uintptr, fileName **uint16, fileInfo *winio.FileBasicInfo, fileSize *int64, deleted *uint32) (hr error) {
  530. if hr = procExportLayerNext.Find(); hr != nil {
  531. return
  532. }
  533. r0, _, _ := syscall.Syscall6(procExportLayerNext.Addr(), 5, uintptr(context), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(fileInfo)), uintptr(unsafe.Pointer(fileSize)), uintptr(unsafe.Pointer(deleted)), 0)
  534. if int32(r0) < 0 {
  535. hr = syscall.Errno(win32FromHresult(r0))
  536. }
  537. return
  538. }
  539. func exportLayerRead(context uintptr, buffer []byte, bytesRead *uint32) (hr error) {
  540. var _p0 *byte
  541. if len(buffer) > 0 {
  542. _p0 = &buffer[0]
  543. }
  544. if hr = procExportLayerRead.Find(); hr != nil {
  545. return
  546. }
  547. r0, _, _ := syscall.Syscall6(procExportLayerRead.Addr(), 4, uintptr(context), uintptr(unsafe.Pointer(_p0)), uintptr(len(buffer)), uintptr(unsafe.Pointer(bytesRead)), 0, 0)
  548. if int32(r0) < 0 {
  549. hr = syscall.Errno(win32FromHresult(r0))
  550. }
  551. return
  552. }
  553. func exportLayerEnd(context uintptr) (hr error) {
  554. if hr = procExportLayerEnd.Find(); hr != nil {
  555. return
  556. }
  557. r0, _, _ := syscall.Syscall(procExportLayerEnd.Addr(), 1, uintptr(context), 0, 0)
  558. if int32(r0) < 0 {
  559. hr = syscall.Errno(win32FromHresult(r0))
  560. }
  561. return
  562. }
  563. func hcsEnumerateComputeSystems(query string, computeSystems **uint16, result **uint16) (hr error) {
  564. var _p0 *uint16
  565. _p0, hr = syscall.UTF16PtrFromString(query)
  566. if hr != nil {
  567. return
  568. }
  569. return _hcsEnumerateComputeSystems(_p0, computeSystems, result)
  570. }
  571. func _hcsEnumerateComputeSystems(query *uint16, computeSystems **uint16, result **uint16) (hr error) {
  572. if hr = procHcsEnumerateComputeSystems.Find(); hr != nil {
  573. return
  574. }
  575. r0, _, _ := syscall.Syscall(procHcsEnumerateComputeSystems.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(computeSystems)), uintptr(unsafe.Pointer(result)))
  576. if int32(r0) < 0 {
  577. hr = syscall.Errno(win32FromHresult(r0))
  578. }
  579. return
  580. }
  581. func hcsCreateComputeSystem(id string, configuration string, identity syscall.Handle, computeSystem *hcsSystem, result **uint16) (hr error) {
  582. var _p0 *uint16
  583. _p0, hr = syscall.UTF16PtrFromString(id)
  584. if hr != nil {
  585. return
  586. }
  587. var _p1 *uint16
  588. _p1, hr = syscall.UTF16PtrFromString(configuration)
  589. if hr != nil {
  590. return
  591. }
  592. return _hcsCreateComputeSystem(_p0, _p1, identity, computeSystem, result)
  593. }
  594. func _hcsCreateComputeSystem(id *uint16, configuration *uint16, identity syscall.Handle, computeSystem *hcsSystem, result **uint16) (hr error) {
  595. if hr = procHcsCreateComputeSystem.Find(); hr != nil {
  596. return
  597. }
  598. 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)
  599. if int32(r0) < 0 {
  600. hr = syscall.Errno(win32FromHresult(r0))
  601. }
  602. return
  603. }
  604. func hcsOpenComputeSystem(id string, computeSystem *hcsSystem, result **uint16) (hr error) {
  605. var _p0 *uint16
  606. _p0, hr = syscall.UTF16PtrFromString(id)
  607. if hr != nil {
  608. return
  609. }
  610. return _hcsOpenComputeSystem(_p0, computeSystem, result)
  611. }
  612. func _hcsOpenComputeSystem(id *uint16, computeSystem *hcsSystem, result **uint16) (hr error) {
  613. if hr = procHcsOpenComputeSystem.Find(); hr != nil {
  614. return
  615. }
  616. r0, _, _ := syscall.Syscall(procHcsOpenComputeSystem.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(computeSystem)), uintptr(unsafe.Pointer(result)))
  617. if int32(r0) < 0 {
  618. hr = syscall.Errno(win32FromHresult(r0))
  619. }
  620. return
  621. }
  622. func hcsCloseComputeSystem(computeSystem hcsSystem) (hr error) {
  623. if hr = procHcsCloseComputeSystem.Find(); hr != nil {
  624. return
  625. }
  626. r0, _, _ := syscall.Syscall(procHcsCloseComputeSystem.Addr(), 1, uintptr(computeSystem), 0, 0)
  627. if int32(r0) < 0 {
  628. hr = syscall.Errno(win32FromHresult(r0))
  629. }
  630. return
  631. }
  632. func hcsStartComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  633. var _p0 *uint16
  634. _p0, hr = syscall.UTF16PtrFromString(options)
  635. if hr != nil {
  636. return
  637. }
  638. return _hcsStartComputeSystem(computeSystem, _p0, result)
  639. }
  640. func _hcsStartComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  641. if hr = procHcsStartComputeSystem.Find(); hr != nil {
  642. return
  643. }
  644. r0, _, _ := syscall.Syscall(procHcsStartComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  645. if int32(r0) < 0 {
  646. hr = syscall.Errno(win32FromHresult(r0))
  647. }
  648. return
  649. }
  650. func hcsShutdownComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  651. var _p0 *uint16
  652. _p0, hr = syscall.UTF16PtrFromString(options)
  653. if hr != nil {
  654. return
  655. }
  656. return _hcsShutdownComputeSystem(computeSystem, _p0, result)
  657. }
  658. func _hcsShutdownComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  659. if hr = procHcsShutdownComputeSystem.Find(); hr != nil {
  660. return
  661. }
  662. r0, _, _ := syscall.Syscall(procHcsShutdownComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  663. if int32(r0) < 0 {
  664. hr = syscall.Errno(win32FromHresult(r0))
  665. }
  666. return
  667. }
  668. func hcsTerminateComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  669. var _p0 *uint16
  670. _p0, hr = syscall.UTF16PtrFromString(options)
  671. if hr != nil {
  672. return
  673. }
  674. return _hcsTerminateComputeSystem(computeSystem, _p0, result)
  675. }
  676. func _hcsTerminateComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  677. if hr = procHcsTerminateComputeSystem.Find(); hr != nil {
  678. return
  679. }
  680. r0, _, _ := syscall.Syscall(procHcsTerminateComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  681. if int32(r0) < 0 {
  682. hr = syscall.Errno(win32FromHresult(r0))
  683. }
  684. return
  685. }
  686. func hcsPauseComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  687. var _p0 *uint16
  688. _p0, hr = syscall.UTF16PtrFromString(options)
  689. if hr != nil {
  690. return
  691. }
  692. return _hcsPauseComputeSystem(computeSystem, _p0, result)
  693. }
  694. func _hcsPauseComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  695. if hr = procHcsPauseComputeSystem.Find(); hr != nil {
  696. return
  697. }
  698. r0, _, _ := syscall.Syscall(procHcsPauseComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  699. if int32(r0) < 0 {
  700. hr = syscall.Errno(win32FromHresult(r0))
  701. }
  702. return
  703. }
  704. func hcsResumeComputeSystem(computeSystem hcsSystem, options string, result **uint16) (hr error) {
  705. var _p0 *uint16
  706. _p0, hr = syscall.UTF16PtrFromString(options)
  707. if hr != nil {
  708. return
  709. }
  710. return _hcsResumeComputeSystem(computeSystem, _p0, result)
  711. }
  712. func _hcsResumeComputeSystem(computeSystem hcsSystem, options *uint16, result **uint16) (hr error) {
  713. if hr = procHcsResumeComputeSystem.Find(); hr != nil {
  714. return
  715. }
  716. r0, _, _ := syscall.Syscall(procHcsResumeComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
  717. if int32(r0) < 0 {
  718. hr = syscall.Errno(win32FromHresult(r0))
  719. }
  720. return
  721. }
  722. func hcsGetComputeSystemProperties(computeSystem hcsSystem, propertyQuery string, properties **uint16, result **uint16) (hr error) {
  723. var _p0 *uint16
  724. _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
  725. if hr != nil {
  726. return
  727. }
  728. return _hcsGetComputeSystemProperties(computeSystem, _p0, properties, result)
  729. }
  730. func _hcsGetComputeSystemProperties(computeSystem hcsSystem, propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
  731. if hr = procHcsGetComputeSystemProperties.Find(); hr != nil {
  732. return
  733. }
  734. r0, _, _ := syscall.Syscall6(procHcsGetComputeSystemProperties.Addr(), 4, uintptr(computeSystem), uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  735. if int32(r0) < 0 {
  736. hr = syscall.Errno(win32FromHresult(r0))
  737. }
  738. return
  739. }
  740. func hcsModifyComputeSystem(computeSystem hcsSystem, configuration string, result **uint16) (hr error) {
  741. var _p0 *uint16
  742. _p0, hr = syscall.UTF16PtrFromString(configuration)
  743. if hr != nil {
  744. return
  745. }
  746. return _hcsModifyComputeSystem(computeSystem, _p0, result)
  747. }
  748. func _hcsModifyComputeSystem(computeSystem hcsSystem, configuration *uint16, result **uint16) (hr error) {
  749. if hr = procHcsModifyComputeSystem.Find(); hr != nil {
  750. return
  751. }
  752. r0, _, _ := syscall.Syscall(procHcsModifyComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(configuration)), uintptr(unsafe.Pointer(result)))
  753. if int32(r0) < 0 {
  754. hr = syscall.Errno(win32FromHresult(r0))
  755. }
  756. return
  757. }
  758. func hcsRegisterComputeSystemCallback(computeSystem hcsSystem, callback uintptr, context uintptr, callbackHandle *hcsCallback) (hr error) {
  759. if hr = procHcsRegisterComputeSystemCallback.Find(); hr != nil {
  760. return
  761. }
  762. r0, _, _ := syscall.Syscall6(procHcsRegisterComputeSystemCallback.Addr(), 4, uintptr(computeSystem), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  763. if int32(r0) < 0 {
  764. hr = syscall.Errno(win32FromHresult(r0))
  765. }
  766. return
  767. }
  768. func hcsUnregisterComputeSystemCallback(callbackHandle hcsCallback) (hr error) {
  769. if hr = procHcsUnregisterComputeSystemCallback.Find(); hr != nil {
  770. return
  771. }
  772. r0, _, _ := syscall.Syscall(procHcsUnregisterComputeSystemCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  773. if int32(r0) < 0 {
  774. hr = syscall.Errno(win32FromHresult(r0))
  775. }
  776. return
  777. }
  778. func hcsCreateProcess(computeSystem hcsSystem, processParameters string, processInformation *hcsProcessInformation, process *hcsProcess, result **uint16) (hr error) {
  779. var _p0 *uint16
  780. _p0, hr = syscall.UTF16PtrFromString(processParameters)
  781. if hr != nil {
  782. return
  783. }
  784. return _hcsCreateProcess(computeSystem, _p0, processInformation, process, result)
  785. }
  786. func _hcsCreateProcess(computeSystem hcsSystem, processParameters *uint16, processInformation *hcsProcessInformation, process *hcsProcess, result **uint16) (hr error) {
  787. if hr = procHcsCreateProcess.Find(); hr != nil {
  788. return
  789. }
  790. 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)
  791. if int32(r0) < 0 {
  792. hr = syscall.Errno(win32FromHresult(r0))
  793. }
  794. return
  795. }
  796. func hcsOpenProcess(computeSystem hcsSystem, pid uint32, process *hcsProcess, result **uint16) (hr error) {
  797. if hr = procHcsOpenProcess.Find(); hr != nil {
  798. return
  799. }
  800. r0, _, _ := syscall.Syscall6(procHcsOpenProcess.Addr(), 4, uintptr(computeSystem), uintptr(pid), uintptr(unsafe.Pointer(process)), uintptr(unsafe.Pointer(result)), 0, 0)
  801. if int32(r0) < 0 {
  802. hr = syscall.Errno(win32FromHresult(r0))
  803. }
  804. return
  805. }
  806. func hcsCloseProcess(process hcsProcess) (hr error) {
  807. if hr = procHcsCloseProcess.Find(); hr != nil {
  808. return
  809. }
  810. r0, _, _ := syscall.Syscall(procHcsCloseProcess.Addr(), 1, uintptr(process), 0, 0)
  811. if int32(r0) < 0 {
  812. hr = syscall.Errno(win32FromHresult(r0))
  813. }
  814. return
  815. }
  816. func hcsTerminateProcess(process hcsProcess, result **uint16) (hr error) {
  817. if hr = procHcsTerminateProcess.Find(); hr != nil {
  818. return
  819. }
  820. r0, _, _ := syscall.Syscall(procHcsTerminateProcess.Addr(), 2, uintptr(process), uintptr(unsafe.Pointer(result)), 0)
  821. if int32(r0) < 0 {
  822. hr = syscall.Errno(win32FromHresult(r0))
  823. }
  824. return
  825. }
  826. func hcsGetProcessInfo(process hcsProcess, processInformation *hcsProcessInformation, result **uint16) (hr error) {
  827. if hr = procHcsGetProcessInfo.Find(); hr != nil {
  828. return
  829. }
  830. r0, _, _ := syscall.Syscall(procHcsGetProcessInfo.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processInformation)), uintptr(unsafe.Pointer(result)))
  831. if int32(r0) < 0 {
  832. hr = syscall.Errno(win32FromHresult(r0))
  833. }
  834. return
  835. }
  836. func hcsGetProcessProperties(process hcsProcess, processProperties **uint16, result **uint16) (hr error) {
  837. if hr = procHcsGetProcessProperties.Find(); hr != nil {
  838. return
  839. }
  840. r0, _, _ := syscall.Syscall(procHcsGetProcessProperties.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processProperties)), uintptr(unsafe.Pointer(result)))
  841. if int32(r0) < 0 {
  842. hr = syscall.Errno(win32FromHresult(r0))
  843. }
  844. return
  845. }
  846. func hcsModifyProcess(process hcsProcess, settings string, result **uint16) (hr error) {
  847. var _p0 *uint16
  848. _p0, hr = syscall.UTF16PtrFromString(settings)
  849. if hr != nil {
  850. return
  851. }
  852. return _hcsModifyProcess(process, _p0, result)
  853. }
  854. func _hcsModifyProcess(process hcsProcess, settings *uint16, result **uint16) (hr error) {
  855. if hr = procHcsModifyProcess.Find(); hr != nil {
  856. return
  857. }
  858. r0, _, _ := syscall.Syscall(procHcsModifyProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  859. if int32(r0) < 0 {
  860. hr = syscall.Errno(win32FromHresult(r0))
  861. }
  862. return
  863. }
  864. func hcsGetServiceProperties(propertyQuery string, properties **uint16, result **uint16) (hr error) {
  865. var _p0 *uint16
  866. _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
  867. if hr != nil {
  868. return
  869. }
  870. return _hcsGetServiceProperties(_p0, properties, result)
  871. }
  872. func _hcsGetServiceProperties(propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
  873. if hr = procHcsGetServiceProperties.Find(); hr != nil {
  874. return
  875. }
  876. r0, _, _ := syscall.Syscall(procHcsGetServiceProperties.Addr(), 3, uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)))
  877. if int32(r0) < 0 {
  878. hr = syscall.Errno(win32FromHresult(r0))
  879. }
  880. return
  881. }
  882. func hcsRegisterProcessCallback(process hcsProcess, callback uintptr, context uintptr, callbackHandle *hcsCallback) (hr error) {
  883. if hr = procHcsRegisterProcessCallback.Find(); hr != nil {
  884. return
  885. }
  886. r0, _, _ := syscall.Syscall6(procHcsRegisterProcessCallback.Addr(), 4, uintptr(process), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  887. if int32(r0) < 0 {
  888. hr = syscall.Errno(win32FromHresult(r0))
  889. }
  890. return
  891. }
  892. func hcsUnregisterProcessCallback(callbackHandle hcsCallback) (hr error) {
  893. if hr = procHcsUnregisterProcessCallback.Find(); hr != nil {
  894. return
  895. }
  896. r0, _, _ := syscall.Syscall(procHcsUnregisterProcessCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  897. if int32(r0) < 0 {
  898. hr = syscall.Errno(win32FromHresult(r0))
  899. }
  900. return
  901. }
  902. func hcsModifyServiceSettings(settings string, result **uint16) (hr error) {
  903. var _p0 *uint16
  904. _p0, hr = syscall.UTF16PtrFromString(settings)
  905. if hr != nil {
  906. return
  907. }
  908. return _hcsModifyServiceSettings(_p0, result)
  909. }
  910. func _hcsModifyServiceSettings(settings *uint16, result **uint16) (hr error) {
  911. if hr = procHcsModifyServiceSettings.Find(); hr != nil {
  912. return
  913. }
  914. r0, _, _ := syscall.Syscall(procHcsModifyServiceSettings.Addr(), 2, uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)), 0)
  915. if int32(r0) < 0 {
  916. hr = syscall.Errno(win32FromHresult(r0))
  917. }
  918. return
  919. }
  920. func _hnsCall(method string, path string, object string, response **uint16) (hr error) {
  921. var _p0 *uint16
  922. _p0, hr = syscall.UTF16PtrFromString(method)
  923. if hr != nil {
  924. return
  925. }
  926. var _p1 *uint16
  927. _p1, hr = syscall.UTF16PtrFromString(path)
  928. if hr != nil {
  929. return
  930. }
  931. var _p2 *uint16
  932. _p2, hr = syscall.UTF16PtrFromString(object)
  933. if hr != nil {
  934. return
  935. }
  936. return __hnsCall(_p0, _p1, _p2, response)
  937. }
  938. func __hnsCall(method *uint16, path *uint16, object *uint16, response **uint16) (hr error) {
  939. if hr = procHNSCall.Find(); hr != nil {
  940. return
  941. }
  942. r0, _, _ := syscall.Syscall6(procHNSCall.Addr(), 4, uintptr(unsafe.Pointer(method)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(object)), uintptr(unsafe.Pointer(response)), 0, 0)
  943. if int32(r0) < 0 {
  944. hr = syscall.Errno(win32FromHresult(r0))
  945. }
  946. return
  947. }