zsyscall_windows.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. //go:build windows
  2. // Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT.
  3. package wclayer
  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. modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
  35. modvirtdisk = windows.NewLazySystemDLL("virtdisk.dll")
  36. modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
  37. procGetDiskFreeSpaceExW = modkernel32.NewProc("GetDiskFreeSpaceExW")
  38. procAttachVirtualDisk = modvirtdisk.NewProc("AttachVirtualDisk")
  39. procOpenVirtualDisk = modvirtdisk.NewProc("OpenVirtualDisk")
  40. procActivateLayer = modvmcompute.NewProc("ActivateLayer")
  41. procCopyLayer = modvmcompute.NewProc("CopyLayer")
  42. procCreateLayer = modvmcompute.NewProc("CreateLayer")
  43. procCreateSandboxLayer = modvmcompute.NewProc("CreateSandboxLayer")
  44. procDeactivateLayer = modvmcompute.NewProc("DeactivateLayer")
  45. procDestroyLayer = modvmcompute.NewProc("DestroyLayer")
  46. procExpandSandboxSize = modvmcompute.NewProc("ExpandSandboxSize")
  47. procExportLayer = modvmcompute.NewProc("ExportLayer")
  48. procGetBaseImages = modvmcompute.NewProc("GetBaseImages")
  49. procGetLayerMountPath = modvmcompute.NewProc("GetLayerMountPath")
  50. procGrantVmAccess = modvmcompute.NewProc("GrantVmAccess")
  51. procImportLayer = modvmcompute.NewProc("ImportLayer")
  52. procLayerExists = modvmcompute.NewProc("LayerExists")
  53. procNameToGuid = modvmcompute.NewProc("NameToGuid")
  54. procPrepareLayer = modvmcompute.NewProc("PrepareLayer")
  55. procProcessBaseImage = modvmcompute.NewProc("ProcessBaseImage")
  56. procProcessUtilityImage = modvmcompute.NewProc("ProcessUtilityImage")
  57. procUnprepareLayer = modvmcompute.NewProc("UnprepareLayer")
  58. )
  59. func getDiskFreeSpaceEx(directoryName string, freeBytesAvailableToCaller *int64, totalNumberOfBytes *int64, totalNumberOfFreeBytes *int64) (err error) {
  60. var _p0 *uint16
  61. _p0, err = syscall.UTF16PtrFromString(directoryName)
  62. if err != nil {
  63. return
  64. }
  65. return _getDiskFreeSpaceEx(_p0, freeBytesAvailableToCaller, totalNumberOfBytes, totalNumberOfFreeBytes)
  66. }
  67. func _getDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *int64, totalNumberOfBytes *int64, totalNumberOfFreeBytes *int64) (err error) {
  68. r1, _, e1 := syscall.Syscall6(procGetDiskFreeSpaceExW.Addr(), 4, uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes)), 0, 0)
  69. if r1 == 0 {
  70. err = errnoErr(e1)
  71. }
  72. return
  73. }
  74. func attachVirtualDisk(handle syscall.Handle, sd uintptr, flags uint32, providerFlags uint32, params uintptr, overlapped uintptr) (err error) {
  75. r1, _, e1 := syscall.Syscall6(procAttachVirtualDisk.Addr(), 6, uintptr(handle), uintptr(sd), uintptr(flags), uintptr(providerFlags), uintptr(params), uintptr(overlapped))
  76. if r1 != 0 {
  77. err = errnoErr(e1)
  78. }
  79. return
  80. }
  81. func openVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) {
  82. var _p0 *uint16
  83. _p0, err = syscall.UTF16PtrFromString(path)
  84. if err != nil {
  85. return
  86. }
  87. return _openVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, flags, parameters, handle)
  88. }
  89. func _openVirtualDisk(virtualStorageType *virtualStorageType, path *uint16, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) {
  90. r1, _, e1 := syscall.Syscall6(procOpenVirtualDisk.Addr(), 6, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(flags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(handle)))
  91. if r1 != 0 {
  92. err = errnoErr(e1)
  93. }
  94. return
  95. }
  96. func activateLayer(info *driverInfo, id string) (hr error) {
  97. var _p0 *uint16
  98. _p0, hr = syscall.UTF16PtrFromString(id)
  99. if hr != nil {
  100. return
  101. }
  102. return _activateLayer(info, _p0)
  103. }
  104. func _activateLayer(info *driverInfo, id *uint16) (hr error) {
  105. hr = procActivateLayer.Find()
  106. if hr != nil {
  107. return
  108. }
  109. r0, _, _ := syscall.Syscall(procActivateLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  110. if int32(r0) < 0 {
  111. if r0&0x1fff0000 == 0x00070000 {
  112. r0 &= 0xffff
  113. }
  114. hr = syscall.Errno(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. hr = procCopyLayer.Find()
  133. if hr != nil {
  134. return
  135. }
  136. var _p2 *WC_LAYER_DESCRIPTOR
  137. if len(descriptors) > 0 {
  138. _p2 = &descriptors[0]
  139. }
  140. 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)
  141. if int32(r0) < 0 {
  142. if r0&0x1fff0000 == 0x00070000 {
  143. r0 &= 0xffff
  144. }
  145. hr = syscall.Errno(r0)
  146. }
  147. return
  148. }
  149. func createLayer(info *driverInfo, id string, parent string) (hr error) {
  150. var _p0 *uint16
  151. _p0, hr = syscall.UTF16PtrFromString(id)
  152. if hr != nil {
  153. return
  154. }
  155. var _p1 *uint16
  156. _p1, hr = syscall.UTF16PtrFromString(parent)
  157. if hr != nil {
  158. return
  159. }
  160. return _createLayer(info, _p0, _p1)
  161. }
  162. func _createLayer(info *driverInfo, id *uint16, parent *uint16) (hr error) {
  163. hr = procCreateLayer.Find()
  164. if hr != nil {
  165. return
  166. }
  167. r0, _, _ := syscall.Syscall(procCreateLayer.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(parent)))
  168. if int32(r0) < 0 {
  169. if r0&0x1fff0000 == 0x00070000 {
  170. r0 &= 0xffff
  171. }
  172. hr = syscall.Errno(r0)
  173. }
  174. return
  175. }
  176. func createSandboxLayer(info *driverInfo, id string, parent uintptr, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  177. var _p0 *uint16
  178. _p0, hr = syscall.UTF16PtrFromString(id)
  179. if hr != nil {
  180. return
  181. }
  182. return _createSandboxLayer(info, _p0, parent, descriptors)
  183. }
  184. func _createSandboxLayer(info *driverInfo, id *uint16, parent uintptr, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  185. hr = procCreateSandboxLayer.Find()
  186. if hr != nil {
  187. return
  188. }
  189. var _p1 *WC_LAYER_DESCRIPTOR
  190. if len(descriptors) > 0 {
  191. _p1 = &descriptors[0]
  192. }
  193. r0, _, _ := syscall.Syscall6(procCreateSandboxLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(parent), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), 0)
  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 deactivateLayer(info *driverInfo, id string) (hr error) {
  203. var _p0 *uint16
  204. _p0, hr = syscall.UTF16PtrFromString(id)
  205. if hr != nil {
  206. return
  207. }
  208. return _deactivateLayer(info, _p0)
  209. }
  210. func _deactivateLayer(info *driverInfo, id *uint16) (hr error) {
  211. hr = procDeactivateLayer.Find()
  212. if hr != nil {
  213. return
  214. }
  215. r0, _, _ := syscall.Syscall(procDeactivateLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  216. if int32(r0) < 0 {
  217. if r0&0x1fff0000 == 0x00070000 {
  218. r0 &= 0xffff
  219. }
  220. hr = syscall.Errno(r0)
  221. }
  222. return
  223. }
  224. func destroyLayer(info *driverInfo, id string) (hr error) {
  225. var _p0 *uint16
  226. _p0, hr = syscall.UTF16PtrFromString(id)
  227. if hr != nil {
  228. return
  229. }
  230. return _destroyLayer(info, _p0)
  231. }
  232. func _destroyLayer(info *driverInfo, id *uint16) (hr error) {
  233. hr = procDestroyLayer.Find()
  234. if hr != nil {
  235. return
  236. }
  237. r0, _, _ := syscall.Syscall(procDestroyLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  238. if int32(r0) < 0 {
  239. if r0&0x1fff0000 == 0x00070000 {
  240. r0 &= 0xffff
  241. }
  242. hr = syscall.Errno(r0)
  243. }
  244. return
  245. }
  246. func expandSandboxSize(info *driverInfo, id string, size uint64) (hr error) {
  247. var _p0 *uint16
  248. _p0, hr = syscall.UTF16PtrFromString(id)
  249. if hr != nil {
  250. return
  251. }
  252. return _expandSandboxSize(info, _p0, size)
  253. }
  254. func _expandSandboxSize(info *driverInfo, id *uint16, size uint64) (hr error) {
  255. hr = procExpandSandboxSize.Find()
  256. if hr != nil {
  257. return
  258. }
  259. r0, _, _ := syscall.Syscall(procExpandSandboxSize.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(size))
  260. if int32(r0) < 0 {
  261. if r0&0x1fff0000 == 0x00070000 {
  262. r0 &= 0xffff
  263. }
  264. hr = syscall.Errno(r0)
  265. }
  266. return
  267. }
  268. func exportLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  269. var _p0 *uint16
  270. _p0, hr = syscall.UTF16PtrFromString(id)
  271. if hr != nil {
  272. return
  273. }
  274. var _p1 *uint16
  275. _p1, hr = syscall.UTF16PtrFromString(path)
  276. if hr != nil {
  277. return
  278. }
  279. return _exportLayer(info, _p0, _p1, descriptors)
  280. }
  281. func _exportLayer(info *driverInfo, id *uint16, path *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  282. hr = procExportLayer.Find()
  283. if hr != nil {
  284. return
  285. }
  286. var _p2 *WC_LAYER_DESCRIPTOR
  287. if len(descriptors) > 0 {
  288. _p2 = &descriptors[0]
  289. }
  290. 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)
  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 getBaseImages(buffer **uint16) (hr error) {
  300. hr = procGetBaseImages.Find()
  301. if hr != nil {
  302. return
  303. }
  304. r0, _, _ := syscall.Syscall(procGetBaseImages.Addr(), 1, uintptr(unsafe.Pointer(buffer)), 0, 0)
  305. if int32(r0) < 0 {
  306. if r0&0x1fff0000 == 0x00070000 {
  307. r0 &= 0xffff
  308. }
  309. hr = syscall.Errno(r0)
  310. }
  311. return
  312. }
  313. func getLayerMountPath(info *driverInfo, id string, length *uintptr, buffer *uint16) (hr error) {
  314. var _p0 *uint16
  315. _p0, hr = syscall.UTF16PtrFromString(id)
  316. if hr != nil {
  317. return
  318. }
  319. return _getLayerMountPath(info, _p0, length, buffer)
  320. }
  321. func _getLayerMountPath(info *driverInfo, id *uint16, length *uintptr, buffer *uint16) (hr error) {
  322. hr = procGetLayerMountPath.Find()
  323. if hr != nil {
  324. return
  325. }
  326. r0, _, _ := syscall.Syscall6(procGetLayerMountPath.Addr(), 4, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(length)), uintptr(unsafe.Pointer(buffer)), 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 grantVmAccess(vmid string, filepath string) (hr error) {
  336. var _p0 *uint16
  337. _p0, hr = syscall.UTF16PtrFromString(vmid)
  338. if hr != nil {
  339. return
  340. }
  341. var _p1 *uint16
  342. _p1, hr = syscall.UTF16PtrFromString(filepath)
  343. if hr != nil {
  344. return
  345. }
  346. return _grantVmAccess(_p0, _p1)
  347. }
  348. func _grantVmAccess(vmid *uint16, filepath *uint16) (hr error) {
  349. hr = procGrantVmAccess.Find()
  350. if hr != nil {
  351. return
  352. }
  353. r0, _, _ := syscall.Syscall(procGrantVmAccess.Addr(), 2, uintptr(unsafe.Pointer(vmid)), uintptr(unsafe.Pointer(filepath)), 0)
  354. if int32(r0) < 0 {
  355. if r0&0x1fff0000 == 0x00070000 {
  356. r0 &= 0xffff
  357. }
  358. hr = syscall.Errno(r0)
  359. }
  360. return
  361. }
  362. func importLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  363. var _p0 *uint16
  364. _p0, hr = syscall.UTF16PtrFromString(id)
  365. if hr != nil {
  366. return
  367. }
  368. var _p1 *uint16
  369. _p1, hr = syscall.UTF16PtrFromString(path)
  370. if hr != nil {
  371. return
  372. }
  373. return _importLayer(info, _p0, _p1, descriptors)
  374. }
  375. func _importLayer(info *driverInfo, id *uint16, path *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  376. hr = procImportLayer.Find()
  377. if hr != nil {
  378. return
  379. }
  380. var _p2 *WC_LAYER_DESCRIPTOR
  381. if len(descriptors) > 0 {
  382. _p2 = &descriptors[0]
  383. }
  384. 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)
  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 layerExists(info *driverInfo, id string, exists *uint32) (hr error) {
  394. var _p0 *uint16
  395. _p0, hr = syscall.UTF16PtrFromString(id)
  396. if hr != nil {
  397. return
  398. }
  399. return _layerExists(info, _p0, exists)
  400. }
  401. func _layerExists(info *driverInfo, id *uint16, exists *uint32) (hr error) {
  402. hr = procLayerExists.Find()
  403. if hr != nil {
  404. return
  405. }
  406. r0, _, _ := syscall.Syscall(procLayerExists.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(exists)))
  407. if int32(r0) < 0 {
  408. if r0&0x1fff0000 == 0x00070000 {
  409. r0 &= 0xffff
  410. }
  411. hr = syscall.Errno(r0)
  412. }
  413. return
  414. }
  415. func nameToGuid(name string, guid *_guid) (hr error) {
  416. var _p0 *uint16
  417. _p0, hr = syscall.UTF16PtrFromString(name)
  418. if hr != nil {
  419. return
  420. }
  421. return _nameToGuid(_p0, guid)
  422. }
  423. func _nameToGuid(name *uint16, guid *_guid) (hr error) {
  424. hr = procNameToGuid.Find()
  425. if hr != nil {
  426. return
  427. }
  428. r0, _, _ := syscall.Syscall(procNameToGuid.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(guid)), 0)
  429. if int32(r0) < 0 {
  430. if r0&0x1fff0000 == 0x00070000 {
  431. r0 &= 0xffff
  432. }
  433. hr = syscall.Errno(r0)
  434. }
  435. return
  436. }
  437. func prepareLayer(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  438. var _p0 *uint16
  439. _p0, hr = syscall.UTF16PtrFromString(id)
  440. if hr != nil {
  441. return
  442. }
  443. return _prepareLayer(info, _p0, descriptors)
  444. }
  445. func _prepareLayer(info *driverInfo, id *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
  446. hr = procPrepareLayer.Find()
  447. if hr != nil {
  448. return
  449. }
  450. var _p1 *WC_LAYER_DESCRIPTOR
  451. if len(descriptors) > 0 {
  452. _p1 = &descriptors[0]
  453. }
  454. r0, _, _ := syscall.Syscall6(procPrepareLayer.Addr(), 4, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), 0, 0)
  455. if int32(r0) < 0 {
  456. if r0&0x1fff0000 == 0x00070000 {
  457. r0 &= 0xffff
  458. }
  459. hr = syscall.Errno(r0)
  460. }
  461. return
  462. }
  463. func processBaseImage(path string) (hr error) {
  464. var _p0 *uint16
  465. _p0, hr = syscall.UTF16PtrFromString(path)
  466. if hr != nil {
  467. return
  468. }
  469. return _processBaseImage(_p0)
  470. }
  471. func _processBaseImage(path *uint16) (hr error) {
  472. hr = procProcessBaseImage.Find()
  473. if hr != nil {
  474. return
  475. }
  476. r0, _, _ := syscall.Syscall(procProcessBaseImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
  477. if int32(r0) < 0 {
  478. if r0&0x1fff0000 == 0x00070000 {
  479. r0 &= 0xffff
  480. }
  481. hr = syscall.Errno(r0)
  482. }
  483. return
  484. }
  485. func processUtilityImage(path string) (hr error) {
  486. var _p0 *uint16
  487. _p0, hr = syscall.UTF16PtrFromString(path)
  488. if hr != nil {
  489. return
  490. }
  491. return _processUtilityImage(_p0)
  492. }
  493. func _processUtilityImage(path *uint16) (hr error) {
  494. hr = procProcessUtilityImage.Find()
  495. if hr != nil {
  496. return
  497. }
  498. r0, _, _ := syscall.Syscall(procProcessUtilityImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
  499. if int32(r0) < 0 {
  500. if r0&0x1fff0000 == 0x00070000 {
  501. r0 &= 0xffff
  502. }
  503. hr = syscall.Errno(r0)
  504. }
  505. return
  506. }
  507. func unprepareLayer(info *driverInfo, id string) (hr error) {
  508. var _p0 *uint16
  509. _p0, hr = syscall.UTF16PtrFromString(id)
  510. if hr != nil {
  511. return
  512. }
  513. return _unprepareLayer(info, _p0)
  514. }
  515. func _unprepareLayer(info *driverInfo, id *uint16) (hr error) {
  516. hr = procUnprepareLayer.Find()
  517. if hr != nil {
  518. return
  519. }
  520. r0, _, _ := syscall.Syscall(procUnprepareLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
  521. if int32(r0) < 0 {
  522. if r0&0x1fff0000 == 0x00070000 {
  523. r0 &= 0xffff
  524. }
  525. hr = syscall.Errno(r0)
  526. }
  527. return
  528. }