1 /***********************************************************************\
2 *                               dhcpcsdk.d                              *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.dhcpcsdk;
12 
13 private import win32.w32api, win32.windef;
14 
15 static assert (_WIN32_WINNT_ONLY && _WIN32_WINNT >= 0x500,
16 "win32.dhcpcsdk is available only if version WindowsXP, Windows2003
17 or WindowsVista is set, or both Windows2000 and WindowsNTonly are set");
18 
19 //#if (_WIN32_WINNT >= 0x0500)
20 
21 // FIXME: check type
22 const DHCPCAPI_REGISTER_HANDLE_EVENT = 1;
23 const DHCPCAPI_REQUEST_PERSISTENT    = 1;
24 const DHCPCAPI_REQUEST_SYNCHRONOUS   = 2;
25 
26 struct DHCPCAPI_CLASSID {
27 	ULONG  Flags;
28 	LPBYTE Data;
29 	ULONG  nBytesData;
30 }
31 alias DHCPCAPI_CLASSID* PDHCPCAPI_CLASSID, LPDHCPCAPI_CLASSID;
32 
33 struct DHCPAPI_PARAMS {
34 	ULONG  Flags;
35 	ULONG  OptionId;
36 	BOOL   IsVendor;
37 	LPBYTE Data;
38 	DWORD  nBytesData;
39 }
40 alias DHCPAPI_PARAMS* PDHCPAPI_PARAMS, LPDHCPAPI_PARAMS;
41 
42 struct DHCPCAPI_PARAMS_ARRAY {
43 	ULONG            nParams;
44 	LPDHCPAPI_PARAMS Params;
45 }
46 alias DHCPCAPI_PARAMS_ARRAY* PDHCPCAPI_PARAMS_ARRAY, LPDHCPCAPI_PARAMS_ARRAY;
47 
48 extern (Windows) {
49 	void DhcpCApiCleanup();
50 	DWORD DhcpCApiInitialize(LPDWORD);
51 	DWORD DhcpDeRegisterParamChange(DWORD, LPVOID, LPVOID);
52 	DWORD DhcpRegisterParamChange(DWORD, LPVOID, PWSTR, LPDHCPCAPI_CLASSID,
53 	  DHCPCAPI_PARAMS_ARRAY, LPVOID);
54 	DWORD DhcpRemoveDNSRegistrations();
55 	DWORD DhcpUndoRequestParams(DWORD, LPVOID, LPWSTR, LPWSTR);
56 }
57 
58 //#endif // (_WIN32_WINNT >= 0x0500)