zsyscall_windows.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. // Code generated mksyscall_windows.exe DO NOT EDIT
  2. package hcn
  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. modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll")
  33. modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
  34. modcomputenetwork = windows.NewLazySystemDLL("computenetwork.dll")
  35. procSetCurrentThreadCompartmentId = modiphlpapi.NewProc("SetCurrentThreadCompartmentId")
  36. procHNSCall = modvmcompute.NewProc("HNSCall")
  37. procHcnEnumerateNetworks = modcomputenetwork.NewProc("HcnEnumerateNetworks")
  38. procHcnCreateNetwork = modcomputenetwork.NewProc("HcnCreateNetwork")
  39. procHcnOpenNetwork = modcomputenetwork.NewProc("HcnOpenNetwork")
  40. procHcnModifyNetwork = modcomputenetwork.NewProc("HcnModifyNetwork")
  41. procHcnQueryNetworkProperties = modcomputenetwork.NewProc("HcnQueryNetworkProperties")
  42. procHcnDeleteNetwork = modcomputenetwork.NewProc("HcnDeleteNetwork")
  43. procHcnCloseNetwork = modcomputenetwork.NewProc("HcnCloseNetwork")
  44. procHcnEnumerateEndpoints = modcomputenetwork.NewProc("HcnEnumerateEndpoints")
  45. procHcnCreateEndpoint = modcomputenetwork.NewProc("HcnCreateEndpoint")
  46. procHcnOpenEndpoint = modcomputenetwork.NewProc("HcnOpenEndpoint")
  47. procHcnModifyEndpoint = modcomputenetwork.NewProc("HcnModifyEndpoint")
  48. procHcnQueryEndpointProperties = modcomputenetwork.NewProc("HcnQueryEndpointProperties")
  49. procHcnDeleteEndpoint = modcomputenetwork.NewProc("HcnDeleteEndpoint")
  50. procHcnCloseEndpoint = modcomputenetwork.NewProc("HcnCloseEndpoint")
  51. procHcnEnumerateNamespaces = modcomputenetwork.NewProc("HcnEnumerateNamespaces")
  52. procHcnCreateNamespace = modcomputenetwork.NewProc("HcnCreateNamespace")
  53. procHcnOpenNamespace = modcomputenetwork.NewProc("HcnOpenNamespace")
  54. procHcnModifyNamespace = modcomputenetwork.NewProc("HcnModifyNamespace")
  55. procHcnQueryNamespaceProperties = modcomputenetwork.NewProc("HcnQueryNamespaceProperties")
  56. procHcnDeleteNamespace = modcomputenetwork.NewProc("HcnDeleteNamespace")
  57. procHcnCloseNamespace = modcomputenetwork.NewProc("HcnCloseNamespace")
  58. procHcnEnumerateLoadBalancers = modcomputenetwork.NewProc("HcnEnumerateLoadBalancers")
  59. procHcnCreateLoadBalancer = modcomputenetwork.NewProc("HcnCreateLoadBalancer")
  60. procHcnOpenLoadBalancer = modcomputenetwork.NewProc("HcnOpenLoadBalancer")
  61. procHcnModifyLoadBalancer = modcomputenetwork.NewProc("HcnModifyLoadBalancer")
  62. procHcnQueryLoadBalancerProperties = modcomputenetwork.NewProc("HcnQueryLoadBalancerProperties")
  63. procHcnDeleteLoadBalancer = modcomputenetwork.NewProc("HcnDeleteLoadBalancer")
  64. procHcnCloseLoadBalancer = modcomputenetwork.NewProc("HcnCloseLoadBalancer")
  65. procHcnOpenService = modcomputenetwork.NewProc("HcnOpenService")
  66. procHcnRegisterServiceCallback = modcomputenetwork.NewProc("HcnRegisterServiceCallback")
  67. procHcnUnregisterServiceCallback = modcomputenetwork.NewProc("HcnUnregisterServiceCallback")
  68. procHcnCloseService = modcomputenetwork.NewProc("HcnCloseService")
  69. )
  70. func SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) {
  71. r0, _, _ := syscall.Syscall(procSetCurrentThreadCompartmentId.Addr(), 1, uintptr(compartmentId), 0, 0)
  72. if int32(r0) < 0 {
  73. if r0&0x1fff0000 == 0x00070000 {
  74. r0 &= 0xffff
  75. }
  76. hr = syscall.Errno(r0)
  77. }
  78. return
  79. }
  80. func _hnsCall(method string, path string, object string, response **uint16) (hr error) {
  81. var _p0 *uint16
  82. _p0, hr = syscall.UTF16PtrFromString(method)
  83. if hr != nil {
  84. return
  85. }
  86. var _p1 *uint16
  87. _p1, hr = syscall.UTF16PtrFromString(path)
  88. if hr != nil {
  89. return
  90. }
  91. var _p2 *uint16
  92. _p2, hr = syscall.UTF16PtrFromString(object)
  93. if hr != nil {
  94. return
  95. }
  96. return __hnsCall(_p0, _p1, _p2, response)
  97. }
  98. func __hnsCall(method *uint16, path *uint16, object *uint16, response **uint16) (hr error) {
  99. if hr = procHNSCall.Find(); hr != nil {
  100. return
  101. }
  102. r0, _, _ := syscall.Syscall6(procHNSCall.Addr(), 4, uintptr(unsafe.Pointer(method)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(object)), uintptr(unsafe.Pointer(response)), 0, 0)
  103. if int32(r0) < 0 {
  104. if r0&0x1fff0000 == 0x00070000 {
  105. r0 &= 0xffff
  106. }
  107. hr = syscall.Errno(r0)
  108. }
  109. return
  110. }
  111. func hcnEnumerateNetworks(query string, networks **uint16, result **uint16) (hr error) {
  112. var _p0 *uint16
  113. _p0, hr = syscall.UTF16PtrFromString(query)
  114. if hr != nil {
  115. return
  116. }
  117. return _hcnEnumerateNetworks(_p0, networks, result)
  118. }
  119. func _hcnEnumerateNetworks(query *uint16, networks **uint16, result **uint16) (hr error) {
  120. if hr = procHcnEnumerateNetworks.Find(); hr != nil {
  121. return
  122. }
  123. r0, _, _ := syscall.Syscall(procHcnEnumerateNetworks.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(networks)), uintptr(unsafe.Pointer(result)))
  124. if int32(r0) < 0 {
  125. if r0&0x1fff0000 == 0x00070000 {
  126. r0 &= 0xffff
  127. }
  128. hr = syscall.Errno(r0)
  129. }
  130. return
  131. }
  132. func hcnCreateNetwork(id *_guid, settings string, network *hcnNetwork, result **uint16) (hr error) {
  133. var _p0 *uint16
  134. _p0, hr = syscall.UTF16PtrFromString(settings)
  135. if hr != nil {
  136. return
  137. }
  138. return _hcnCreateNetwork(id, _p0, network, result)
  139. }
  140. func _hcnCreateNetwork(id *_guid, settings *uint16, network *hcnNetwork, result **uint16) (hr error) {
  141. if hr = procHcnCreateNetwork.Find(); hr != nil {
  142. return
  143. }
  144. r0, _, _ := syscall.Syscall6(procHcnCreateNetwork.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(network)), uintptr(unsafe.Pointer(result)), 0, 0)
  145. if int32(r0) < 0 {
  146. if r0&0x1fff0000 == 0x00070000 {
  147. r0 &= 0xffff
  148. }
  149. hr = syscall.Errno(r0)
  150. }
  151. return
  152. }
  153. func hcnOpenNetwork(id *_guid, network *hcnNetwork, result **uint16) (hr error) {
  154. if hr = procHcnOpenNetwork.Find(); hr != nil {
  155. return
  156. }
  157. r0, _, _ := syscall.Syscall(procHcnOpenNetwork.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(network)), uintptr(unsafe.Pointer(result)))
  158. if int32(r0) < 0 {
  159. if r0&0x1fff0000 == 0x00070000 {
  160. r0 &= 0xffff
  161. }
  162. hr = syscall.Errno(r0)
  163. }
  164. return
  165. }
  166. func hcnModifyNetwork(network hcnNetwork, settings string, result **uint16) (hr error) {
  167. var _p0 *uint16
  168. _p0, hr = syscall.UTF16PtrFromString(settings)
  169. if hr != nil {
  170. return
  171. }
  172. return _hcnModifyNetwork(network, _p0, result)
  173. }
  174. func _hcnModifyNetwork(network hcnNetwork, settings *uint16, result **uint16) (hr error) {
  175. if hr = procHcnModifyNetwork.Find(); hr != nil {
  176. return
  177. }
  178. r0, _, _ := syscall.Syscall(procHcnModifyNetwork.Addr(), 3, uintptr(network), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  179. if int32(r0) < 0 {
  180. if r0&0x1fff0000 == 0x00070000 {
  181. r0 &= 0xffff
  182. }
  183. hr = syscall.Errno(r0)
  184. }
  185. return
  186. }
  187. func hcnQueryNetworkProperties(network hcnNetwork, query string, properties **uint16, result **uint16) (hr error) {
  188. var _p0 *uint16
  189. _p0, hr = syscall.UTF16PtrFromString(query)
  190. if hr != nil {
  191. return
  192. }
  193. return _hcnQueryNetworkProperties(network, _p0, properties, result)
  194. }
  195. func _hcnQueryNetworkProperties(network hcnNetwork, query *uint16, properties **uint16, result **uint16) (hr error) {
  196. if hr = procHcnQueryNetworkProperties.Find(); hr != nil {
  197. return
  198. }
  199. r0, _, _ := syscall.Syscall6(procHcnQueryNetworkProperties.Addr(), 4, uintptr(network), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  200. if int32(r0) < 0 {
  201. if r0&0x1fff0000 == 0x00070000 {
  202. r0 &= 0xffff
  203. }
  204. hr = syscall.Errno(r0)
  205. }
  206. return
  207. }
  208. func hcnDeleteNetwork(id *_guid, result **uint16) (hr error) {
  209. if hr = procHcnDeleteNetwork.Find(); hr != nil {
  210. return
  211. }
  212. r0, _, _ := syscall.Syscall(procHcnDeleteNetwork.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
  213. if int32(r0) < 0 {
  214. if r0&0x1fff0000 == 0x00070000 {
  215. r0 &= 0xffff
  216. }
  217. hr = syscall.Errno(r0)
  218. }
  219. return
  220. }
  221. func hcnCloseNetwork(network hcnNetwork) (hr error) {
  222. if hr = procHcnCloseNetwork.Find(); hr != nil {
  223. return
  224. }
  225. r0, _, _ := syscall.Syscall(procHcnCloseNetwork.Addr(), 1, uintptr(network), 0, 0)
  226. if int32(r0) < 0 {
  227. if r0&0x1fff0000 == 0x00070000 {
  228. r0 &= 0xffff
  229. }
  230. hr = syscall.Errno(r0)
  231. }
  232. return
  233. }
  234. func hcnEnumerateEndpoints(query string, endpoints **uint16, result **uint16) (hr error) {
  235. var _p0 *uint16
  236. _p0, hr = syscall.UTF16PtrFromString(query)
  237. if hr != nil {
  238. return
  239. }
  240. return _hcnEnumerateEndpoints(_p0, endpoints, result)
  241. }
  242. func _hcnEnumerateEndpoints(query *uint16, endpoints **uint16, result **uint16) (hr error) {
  243. if hr = procHcnEnumerateEndpoints.Find(); hr != nil {
  244. return
  245. }
  246. r0, _, _ := syscall.Syscall(procHcnEnumerateEndpoints.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(endpoints)), uintptr(unsafe.Pointer(result)))
  247. if int32(r0) < 0 {
  248. if r0&0x1fff0000 == 0x00070000 {
  249. r0 &= 0xffff
  250. }
  251. hr = syscall.Errno(r0)
  252. }
  253. return
  254. }
  255. func hcnCreateEndpoint(network hcnNetwork, id *_guid, settings string, endpoint *hcnEndpoint, result **uint16) (hr error) {
  256. var _p0 *uint16
  257. _p0, hr = syscall.UTF16PtrFromString(settings)
  258. if hr != nil {
  259. return
  260. }
  261. return _hcnCreateEndpoint(network, id, _p0, endpoint, result)
  262. }
  263. func _hcnCreateEndpoint(network hcnNetwork, id *_guid, settings *uint16, endpoint *hcnEndpoint, result **uint16) (hr error) {
  264. if hr = procHcnCreateEndpoint.Find(); hr != nil {
  265. return
  266. }
  267. r0, _, _ := syscall.Syscall6(procHcnCreateEndpoint.Addr(), 5, uintptr(network), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(endpoint)), uintptr(unsafe.Pointer(result)), 0)
  268. if int32(r0) < 0 {
  269. if r0&0x1fff0000 == 0x00070000 {
  270. r0 &= 0xffff
  271. }
  272. hr = syscall.Errno(r0)
  273. }
  274. return
  275. }
  276. func hcnOpenEndpoint(id *_guid, endpoint *hcnEndpoint, result **uint16) (hr error) {
  277. if hr = procHcnOpenEndpoint.Find(); hr != nil {
  278. return
  279. }
  280. r0, _, _ := syscall.Syscall(procHcnOpenEndpoint.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(endpoint)), uintptr(unsafe.Pointer(result)))
  281. if int32(r0) < 0 {
  282. if r0&0x1fff0000 == 0x00070000 {
  283. r0 &= 0xffff
  284. }
  285. hr = syscall.Errno(r0)
  286. }
  287. return
  288. }
  289. func hcnModifyEndpoint(endpoint hcnEndpoint, settings string, result **uint16) (hr error) {
  290. var _p0 *uint16
  291. _p0, hr = syscall.UTF16PtrFromString(settings)
  292. if hr != nil {
  293. return
  294. }
  295. return _hcnModifyEndpoint(endpoint, _p0, result)
  296. }
  297. func _hcnModifyEndpoint(endpoint hcnEndpoint, settings *uint16, result **uint16) (hr error) {
  298. if hr = procHcnModifyEndpoint.Find(); hr != nil {
  299. return
  300. }
  301. r0, _, _ := syscall.Syscall(procHcnModifyEndpoint.Addr(), 3, uintptr(endpoint), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  302. if int32(r0) < 0 {
  303. if r0&0x1fff0000 == 0x00070000 {
  304. r0 &= 0xffff
  305. }
  306. hr = syscall.Errno(r0)
  307. }
  308. return
  309. }
  310. func hcnQueryEndpointProperties(endpoint hcnEndpoint, query string, properties **uint16, result **uint16) (hr error) {
  311. var _p0 *uint16
  312. _p0, hr = syscall.UTF16PtrFromString(query)
  313. if hr != nil {
  314. return
  315. }
  316. return _hcnQueryEndpointProperties(endpoint, _p0, properties, result)
  317. }
  318. func _hcnQueryEndpointProperties(endpoint hcnEndpoint, query *uint16, properties **uint16, result **uint16) (hr error) {
  319. if hr = procHcnQueryEndpointProperties.Find(); hr != nil {
  320. return
  321. }
  322. r0, _, _ := syscall.Syscall6(procHcnQueryEndpointProperties.Addr(), 4, uintptr(endpoint), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  323. if int32(r0) < 0 {
  324. if r0&0x1fff0000 == 0x00070000 {
  325. r0 &= 0xffff
  326. }
  327. hr = syscall.Errno(r0)
  328. }
  329. return
  330. }
  331. func hcnDeleteEndpoint(id *_guid, result **uint16) (hr error) {
  332. if hr = procHcnDeleteEndpoint.Find(); hr != nil {
  333. return
  334. }
  335. r0, _, _ := syscall.Syscall(procHcnDeleteEndpoint.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
  336. if int32(r0) < 0 {
  337. if r0&0x1fff0000 == 0x00070000 {
  338. r0 &= 0xffff
  339. }
  340. hr = syscall.Errno(r0)
  341. }
  342. return
  343. }
  344. func hcnCloseEndpoint(endpoint hcnEndpoint) (hr error) {
  345. if hr = procHcnCloseEndpoint.Find(); hr != nil {
  346. return
  347. }
  348. r0, _, _ := syscall.Syscall(procHcnCloseEndpoint.Addr(), 1, uintptr(endpoint), 0, 0)
  349. if int32(r0) < 0 {
  350. if r0&0x1fff0000 == 0x00070000 {
  351. r0 &= 0xffff
  352. }
  353. hr = syscall.Errno(r0)
  354. }
  355. return
  356. }
  357. func hcnEnumerateNamespaces(query string, namespaces **uint16, result **uint16) (hr error) {
  358. var _p0 *uint16
  359. _p0, hr = syscall.UTF16PtrFromString(query)
  360. if hr != nil {
  361. return
  362. }
  363. return _hcnEnumerateNamespaces(_p0, namespaces, result)
  364. }
  365. func _hcnEnumerateNamespaces(query *uint16, namespaces **uint16, result **uint16) (hr error) {
  366. if hr = procHcnEnumerateNamespaces.Find(); hr != nil {
  367. return
  368. }
  369. r0, _, _ := syscall.Syscall(procHcnEnumerateNamespaces.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(namespaces)), uintptr(unsafe.Pointer(result)))
  370. if int32(r0) < 0 {
  371. if r0&0x1fff0000 == 0x00070000 {
  372. r0 &= 0xffff
  373. }
  374. hr = syscall.Errno(r0)
  375. }
  376. return
  377. }
  378. func hcnCreateNamespace(id *_guid, settings string, namespace *hcnNamespace, result **uint16) (hr error) {
  379. var _p0 *uint16
  380. _p0, hr = syscall.UTF16PtrFromString(settings)
  381. if hr != nil {
  382. return
  383. }
  384. return _hcnCreateNamespace(id, _p0, namespace, result)
  385. }
  386. func _hcnCreateNamespace(id *_guid, settings *uint16, namespace *hcnNamespace, result **uint16) (hr error) {
  387. if hr = procHcnCreateNamespace.Find(); hr != nil {
  388. return
  389. }
  390. r0, _, _ := syscall.Syscall6(procHcnCreateNamespace.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(namespace)), uintptr(unsafe.Pointer(result)), 0, 0)
  391. if int32(r0) < 0 {
  392. if r0&0x1fff0000 == 0x00070000 {
  393. r0 &= 0xffff
  394. }
  395. hr = syscall.Errno(r0)
  396. }
  397. return
  398. }
  399. func hcnOpenNamespace(id *_guid, namespace *hcnNamespace, result **uint16) (hr error) {
  400. if hr = procHcnOpenNamespace.Find(); hr != nil {
  401. return
  402. }
  403. r0, _, _ := syscall.Syscall(procHcnOpenNamespace.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(namespace)), uintptr(unsafe.Pointer(result)))
  404. if int32(r0) < 0 {
  405. if r0&0x1fff0000 == 0x00070000 {
  406. r0 &= 0xffff
  407. }
  408. hr = syscall.Errno(r0)
  409. }
  410. return
  411. }
  412. func hcnModifyNamespace(namespace hcnNamespace, settings string, result **uint16) (hr error) {
  413. var _p0 *uint16
  414. _p0, hr = syscall.UTF16PtrFromString(settings)
  415. if hr != nil {
  416. return
  417. }
  418. return _hcnModifyNamespace(namespace, _p0, result)
  419. }
  420. func _hcnModifyNamespace(namespace hcnNamespace, settings *uint16, result **uint16) (hr error) {
  421. if hr = procHcnModifyNamespace.Find(); hr != nil {
  422. return
  423. }
  424. r0, _, _ := syscall.Syscall(procHcnModifyNamespace.Addr(), 3, uintptr(namespace), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  425. if int32(r0) < 0 {
  426. if r0&0x1fff0000 == 0x00070000 {
  427. r0 &= 0xffff
  428. }
  429. hr = syscall.Errno(r0)
  430. }
  431. return
  432. }
  433. func hcnQueryNamespaceProperties(namespace hcnNamespace, query string, properties **uint16, result **uint16) (hr error) {
  434. var _p0 *uint16
  435. _p0, hr = syscall.UTF16PtrFromString(query)
  436. if hr != nil {
  437. return
  438. }
  439. return _hcnQueryNamespaceProperties(namespace, _p0, properties, result)
  440. }
  441. func _hcnQueryNamespaceProperties(namespace hcnNamespace, query *uint16, properties **uint16, result **uint16) (hr error) {
  442. if hr = procHcnQueryNamespaceProperties.Find(); hr != nil {
  443. return
  444. }
  445. r0, _, _ := syscall.Syscall6(procHcnQueryNamespaceProperties.Addr(), 4, uintptr(namespace), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  446. if int32(r0) < 0 {
  447. if r0&0x1fff0000 == 0x00070000 {
  448. r0 &= 0xffff
  449. }
  450. hr = syscall.Errno(r0)
  451. }
  452. return
  453. }
  454. func hcnDeleteNamespace(id *_guid, result **uint16) (hr error) {
  455. if hr = procHcnDeleteNamespace.Find(); hr != nil {
  456. return
  457. }
  458. r0, _, _ := syscall.Syscall(procHcnDeleteNamespace.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
  459. if int32(r0) < 0 {
  460. if r0&0x1fff0000 == 0x00070000 {
  461. r0 &= 0xffff
  462. }
  463. hr = syscall.Errno(r0)
  464. }
  465. return
  466. }
  467. func hcnCloseNamespace(namespace hcnNamespace) (hr error) {
  468. if hr = procHcnCloseNamespace.Find(); hr != nil {
  469. return
  470. }
  471. r0, _, _ := syscall.Syscall(procHcnCloseNamespace.Addr(), 1, uintptr(namespace), 0, 0)
  472. if int32(r0) < 0 {
  473. if r0&0x1fff0000 == 0x00070000 {
  474. r0 &= 0xffff
  475. }
  476. hr = syscall.Errno(r0)
  477. }
  478. return
  479. }
  480. func hcnEnumerateLoadBalancers(query string, loadBalancers **uint16, result **uint16) (hr error) {
  481. var _p0 *uint16
  482. _p0, hr = syscall.UTF16PtrFromString(query)
  483. if hr != nil {
  484. return
  485. }
  486. return _hcnEnumerateLoadBalancers(_p0, loadBalancers, result)
  487. }
  488. func _hcnEnumerateLoadBalancers(query *uint16, loadBalancers **uint16, result **uint16) (hr error) {
  489. if hr = procHcnEnumerateLoadBalancers.Find(); hr != nil {
  490. return
  491. }
  492. r0, _, _ := syscall.Syscall(procHcnEnumerateLoadBalancers.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(loadBalancers)), uintptr(unsafe.Pointer(result)))
  493. if int32(r0) < 0 {
  494. if r0&0x1fff0000 == 0x00070000 {
  495. r0 &= 0xffff
  496. }
  497. hr = syscall.Errno(r0)
  498. }
  499. return
  500. }
  501. func hcnCreateLoadBalancer(id *_guid, settings string, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) {
  502. var _p0 *uint16
  503. _p0, hr = syscall.UTF16PtrFromString(settings)
  504. if hr != nil {
  505. return
  506. }
  507. return _hcnCreateLoadBalancer(id, _p0, loadBalancer, result)
  508. }
  509. func _hcnCreateLoadBalancer(id *_guid, settings *uint16, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) {
  510. if hr = procHcnCreateLoadBalancer.Find(); hr != nil {
  511. return
  512. }
  513. r0, _, _ := syscall.Syscall6(procHcnCreateLoadBalancer.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(loadBalancer)), uintptr(unsafe.Pointer(result)), 0, 0)
  514. if int32(r0) < 0 {
  515. if r0&0x1fff0000 == 0x00070000 {
  516. r0 &= 0xffff
  517. }
  518. hr = syscall.Errno(r0)
  519. }
  520. return
  521. }
  522. func hcnOpenLoadBalancer(id *_guid, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) {
  523. if hr = procHcnOpenLoadBalancer.Find(); hr != nil {
  524. return
  525. }
  526. r0, _, _ := syscall.Syscall(procHcnOpenLoadBalancer.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(loadBalancer)), uintptr(unsafe.Pointer(result)))
  527. if int32(r0) < 0 {
  528. if r0&0x1fff0000 == 0x00070000 {
  529. r0 &= 0xffff
  530. }
  531. hr = syscall.Errno(r0)
  532. }
  533. return
  534. }
  535. func hcnModifyLoadBalancer(loadBalancer hcnLoadBalancer, settings string, result **uint16) (hr error) {
  536. var _p0 *uint16
  537. _p0, hr = syscall.UTF16PtrFromString(settings)
  538. if hr != nil {
  539. return
  540. }
  541. return _hcnModifyLoadBalancer(loadBalancer, _p0, result)
  542. }
  543. func _hcnModifyLoadBalancer(loadBalancer hcnLoadBalancer, settings *uint16, result **uint16) (hr error) {
  544. if hr = procHcnModifyLoadBalancer.Find(); hr != nil {
  545. return
  546. }
  547. r0, _, _ := syscall.Syscall(procHcnModifyLoadBalancer.Addr(), 3, uintptr(loadBalancer), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
  548. if int32(r0) < 0 {
  549. if r0&0x1fff0000 == 0x00070000 {
  550. r0 &= 0xffff
  551. }
  552. hr = syscall.Errno(r0)
  553. }
  554. return
  555. }
  556. func hcnQueryLoadBalancerProperties(loadBalancer hcnLoadBalancer, query string, properties **uint16, result **uint16) (hr error) {
  557. var _p0 *uint16
  558. _p0, hr = syscall.UTF16PtrFromString(query)
  559. if hr != nil {
  560. return
  561. }
  562. return _hcnQueryLoadBalancerProperties(loadBalancer, _p0, properties, result)
  563. }
  564. func _hcnQueryLoadBalancerProperties(loadBalancer hcnLoadBalancer, query *uint16, properties **uint16, result **uint16) (hr error) {
  565. if hr = procHcnQueryLoadBalancerProperties.Find(); hr != nil {
  566. return
  567. }
  568. r0, _, _ := syscall.Syscall6(procHcnQueryLoadBalancerProperties.Addr(), 4, uintptr(loadBalancer), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
  569. if int32(r0) < 0 {
  570. if r0&0x1fff0000 == 0x00070000 {
  571. r0 &= 0xffff
  572. }
  573. hr = syscall.Errno(r0)
  574. }
  575. return
  576. }
  577. func hcnDeleteLoadBalancer(id *_guid, result **uint16) (hr error) {
  578. if hr = procHcnDeleteLoadBalancer.Find(); hr != nil {
  579. return
  580. }
  581. r0, _, _ := syscall.Syscall(procHcnDeleteLoadBalancer.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
  582. if int32(r0) < 0 {
  583. if r0&0x1fff0000 == 0x00070000 {
  584. r0 &= 0xffff
  585. }
  586. hr = syscall.Errno(r0)
  587. }
  588. return
  589. }
  590. func hcnCloseLoadBalancer(loadBalancer hcnLoadBalancer) (hr error) {
  591. if hr = procHcnCloseLoadBalancer.Find(); hr != nil {
  592. return
  593. }
  594. r0, _, _ := syscall.Syscall(procHcnCloseLoadBalancer.Addr(), 1, uintptr(loadBalancer), 0, 0)
  595. if int32(r0) < 0 {
  596. if r0&0x1fff0000 == 0x00070000 {
  597. r0 &= 0xffff
  598. }
  599. hr = syscall.Errno(r0)
  600. }
  601. return
  602. }
  603. func hcnOpenService(service *hcnService, result **uint16) (hr error) {
  604. if hr = procHcnOpenService.Find(); hr != nil {
  605. return
  606. }
  607. r0, _, _ := syscall.Syscall(procHcnOpenService.Addr(), 2, uintptr(unsafe.Pointer(service)), uintptr(unsafe.Pointer(result)), 0)
  608. if int32(r0) < 0 {
  609. if r0&0x1fff0000 == 0x00070000 {
  610. r0 &= 0xffff
  611. }
  612. hr = syscall.Errno(r0)
  613. }
  614. return
  615. }
  616. func hcnRegisterServiceCallback(service hcnService, callback int32, context int32, callbackHandle *hcnCallbackHandle) (hr error) {
  617. if hr = procHcnRegisterServiceCallback.Find(); hr != nil {
  618. return
  619. }
  620. r0, _, _ := syscall.Syscall6(procHcnRegisterServiceCallback.Addr(), 4, uintptr(service), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
  621. if int32(r0) < 0 {
  622. if r0&0x1fff0000 == 0x00070000 {
  623. r0 &= 0xffff
  624. }
  625. hr = syscall.Errno(r0)
  626. }
  627. return
  628. }
  629. func hcnUnregisterServiceCallback(callbackHandle hcnCallbackHandle) (hr error) {
  630. if hr = procHcnUnregisterServiceCallback.Find(); hr != nil {
  631. return
  632. }
  633. r0, _, _ := syscall.Syscall(procHcnUnregisterServiceCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
  634. if int32(r0) < 0 {
  635. if r0&0x1fff0000 == 0x00070000 {
  636. r0 &= 0xffff
  637. }
  638. hr = syscall.Errno(r0)
  639. }
  640. return
  641. }
  642. func hcnCloseService(service hcnService) (hr error) {
  643. if hr = procHcnCloseService.Find(); hr != nil {
  644. return
  645. }
  646. r0, _, _ := syscall.Syscall(procHcnCloseService.Addr(), 1, uintptr(service), 0, 0)
  647. if int32(r0) < 0 {
  648. if r0&0x1fff0000 == 0x00070000 {
  649. r0 &= 0xffff
  650. }
  651. hr = syscall.Errno(r0)
  652. }
  653. return
  654. }