ReactOS 0.4.17-dev-684-ga6524ef
dhcpcsvc.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/dhcpcapi/dhcpcapi.c
5 * PURPOSE: Client API for DHCP
6 * COPYRIGHT: Copyright 2005 Art Yerkes <ayerkes@speakeasy.net>
7 */
8
9#include <rosdhcp.h>
10#include <winsvc.h>
11#include <dhcpcapi.h>
12
13#define NDEBUG
14#include <debug.h>
15
16static WCHAR ServiceName[] = L"DHCP";
17
22
23extern SOCKET DhcpSocket;
24
25
27{
29}
30
32{
34}
35
38 _In_ PDHCP_SERVER_NAME pszServerName)
39{
41 LPWSTR pszStringBinding;
43
44 DPRINT("PDHCP_SERVER_NAME_bind() called\n");
45
47 L"ncacn_np",
48 pszServerName,
49 L"\\pipe\\dhcpcsvc",
50 NULL,
51 &pszStringBinding);
52 if (status)
53 {
54 DPRINT1("RpcStringBindingCompose returned 0x%x\n", status);
55 return NULL;
56 }
57
58 /* Set the binding handle that will be used to bind to the server. */
59 status = RpcBindingFromStringBindingW(pszStringBinding,
60 &hBinding);
61 if (status)
62 {
63 DPRINT1("RpcBindingFromStringBinding returned 0x%x\n", status);
64 }
65
66 status = RpcStringFreeW(&pszStringBinding);
67 if (status)
68 {
69 DPRINT1("RpcStringFree returned 0x%x\n", status);
70 }
71
72 return hBinding;
73}
74
75void __RPC_USER
77 _In_ PDHCP_SERVER_NAME pszServerName,
79{
81
82 DPRINT("PDHCP_SERVER_NAME_unbind() called\n");
83
85 if (status)
86 {
87 DPRINT1("RpcBindingFree returned 0x%x\n", status);
88 }
89}
90
91static
94 _In_ PWSTR pszAdapterName)
95{
96 WCHAR szKeyName[256];
97 PWSTR pszUnicodeBuffer = NULL;
98 PSZ pszAnsiBuffer = NULL;
99 DWORD dwUnicodeSize = 0, dwAnsiSize = 0;
100 HKEY hKey = NULL;
101 DWORD dwError = ERROR_SUCCESS;
102
103 DPRINT("SetBinaryClassId(%S)\n", pszAdapterName);
104
105 _swprintf(szKeyName,
106 L"System\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s",
107 pszAdapterName);
108 DPRINT("KeyName %S\n", szKeyName);
109
111 szKeyName,
112 0,
114 &hKey);
115 if (dwError != ERROR_SUCCESS)
116 {
117 DPRINT1("Error %lu\n", dwError);
118 return dwError;
119 }
120
122 L"DhcpClassId",
123 NULL,
124 NULL,
125 NULL,
126 &dwUnicodeSize);
127 DPRINT("UnicodeSize %lu\n", dwUnicodeSize);
128
129 pszUnicodeBuffer = HeapAlloc(GetProcessHeap(), 0, dwUnicodeSize);
130 if (pszUnicodeBuffer == NULL)
131 {
132 dwError = ERROR_NOT_ENOUGH_MEMORY;
133 DPRINT1("Error %lu\n", dwError);
134 goto done;
135 }
136
137 dwError = RegQueryValueExW(hKey,
138 L"DhcpClassId",
139 NULL,
140 NULL,
141 (PBYTE)pszUnicodeBuffer,
142 &dwUnicodeSize);
143 if (dwError != ERROR_SUCCESS)
144 {
145 DPRINT1("Error %lu\n", dwError);
146 goto done;
147 }
148
149 dwAnsiSize = WideCharToMultiByte(CP_ACP,
150 0,
151 pszUnicodeBuffer,
152 -1,
153 NULL,
154 0,
155 NULL,
156 NULL);
157 DPRINT("AnsiSize %lu\n", dwAnsiSize);
158
159 pszAnsiBuffer = HeapAlloc(GetProcessHeap(), 0, dwAnsiSize);
160 if (pszAnsiBuffer == NULL)
161 {
162 dwError = ERROR_NOT_ENOUGH_MEMORY;
163 DPRINT1("Error %lu\n", dwError);
164 goto done;
165 }
166
168 0,
169 pszUnicodeBuffer,
170 -1,
171 pszAnsiBuffer,
172 dwAnsiSize,
173 NULL,
174 NULL);
175 DPRINT("AnsiBuffer %s\n", pszAnsiBuffer);
176
177 dwError = RegSetValueExW(hKey,
178 L"DhcpClassIdBin",
179 0,
181 (PBYTE)pszAnsiBuffer,
182 strlen(pszAnsiBuffer));
183 if (dwError != ERROR_SUCCESS)
184 {
185 DPRINT1("Error %lu\n", dwError);
186 }
187
188done:
189 if (hKey)
191
192 if (pszAnsiBuffer)
193 HeapFree(GetProcessHeap(), 0, pszAnsiBuffer);
194
195 if (pszUnicodeBuffer)
196 HeapFree(GetProcessHeap(), 0, pszUnicodeBuffer);
197
198 return dwError;
199}
200
201static
204 _In_ LPDHCPCAPI_PARAMS_ARRAY ParamsArray,
205 _In_ ULONG OptionId,
206 _In_ BOOL IsVendor)
207{
208 ULONG i;
209
210 for (i = 0; i < ParamsArray->nParams; i++)
211 {
212 if ((ParamsArray->Params[i].OptionId == OptionId) &&
213 (ParamsArray->Params[i].IsVendor == IsVendor))
214 return &ParamsArray->Params[i];
215 }
216
217 return NULL;
218}
219
220static
221DWORD
226 _Inout_ LPDWORD pSize)
227{
228 PDHCPAPI_PARAMS Param;
229 LPBYTE Ptr;
230 ULONG i;
231
232 if (Results->DataSize > *pSize)
233 {
234 *pSize = Results->DataSize;
235 return ERROR_MORE_DATA;
236 }
237
238 Ptr = Buffer;
239 for (i = 0; i < Results->ResultsCount; i++)
240 {
241 Param = FindParam(RecdParams,
242 Results->Results[i].OptionId,
243 Results->Results[i].IsVendor);
244 if (Param)
245 {
247 &Results->Data[Results->Results[i].DataOffset],
248 Results->Results[i].DataSize);
249
250 Param->nBytesData = Results->Results[i].DataSize;
251 Param->Data = Ptr;
252
253 Ptr += Results->Results[i].DataSize;
254 }
255 }
256
257 *pSize = Results->DataSize;
258
259 return ERROR_SUCCESS;
260}
261
272DWORD
276{
277 *Version = 2;
278 return ERROR_SUCCESS;
279}
280
286VOID
289{
290}
291
302DWORD
306{
307 DWORD ret;
308
309 DPRINT("DhcpAcquireParameters(%S)\n", AdapterName);
310
312 {
313 ret = Client_AcquireParameters(NULL, AdapterName);
314 }
316 {
318 }
320
321 return ret;
322}
323
334DWORD
338{
339 DWORD ret;
340
341 DPRINT("DhcpAcquireParametersByBroadcast(%S)\n", AdapterName);
342
344 {
345 ret = Client_AcquireParametersByBroadcast(NULL, AdapterName);
346 }
348 {
350 }
352
353 return ret;
354}
355
356DWORD
362{
364 return 0;
365}
366
386DWORD
389 _In_ DWORD Unknown1,
393{
394 DPRINT1("DhcpEnumClasses(%lx %S %lx %lx)\n",
395 Unknown1, AdapterName, Unknown3, Unknown4);
396 return 0;
397}
398
409DWORD
413{
414 DWORD ret;
415
416 DPRINT("DhcpFallbackRefreshParams(%S)\n", AdapterName);
417
419 {
420 ret = Client_FallbackRefreshParams(NULL, AdapterName);
421 }
423 {
425 }
427
428 return ret;
429}
430
453DWORD
456 _In_ DWORD Unknown1,
457 _In_ DWORD Unknown2,
459 _In_ PDHCP_PNP_EVENT PnpEvent,
461{
462 DWORD dwError = ERROR_SUCCESS;
463
464 DPRINT1("DhcpHandlePnPEvent(%lx %lx %S %p %lx)\n",
465 Unknown1, Unknown2, AdapterName, PnpEvent, Unknown5);
466
467 if ((Unknown1 != 0) || (Unknown2 != 1) || (PnpEvent == NULL) || (Unknown5 != 0))
469
470 if (PnpEvent->Unknown5)
471 {
472 dwError = SetBinaryClassId(AdapterName);
473 }
474
475 return dwError;
476}
477
508DWORD
511 _In_ LPWSTR ServerName,
513 _In_ BOOL NewIpAddress,
514 _In_ DWORD IpIndex,
515 _In_ DWORD IpAddress,
516 _In_ DWORD SubnetMask,
517 _In_ INT DhcpAction)
518{
519 DPRINT("DhcpNotifyConfigChange(%S %S %lu %lu %lu %lu %d)\n",
520 ServerName, AdapterName, NewIpAddress, IpIndex, IpAddress, SubnetMask, DhcpAction);
521 return DhcpNotifyConfigChangeEx(ServerName, AdapterName, NewIpAddress,
522 IpIndex, IpAddress, SubnetMask, DhcpAction, 0);
523}
524
558DWORD
561 _In_ LPWSTR ServerName,
563 _In_ BOOL NewIpAddress,
564 _In_ DWORD IpIndex,
565 _In_ DWORD IpAddress,
566 _In_ DWORD SubnetMask,
567 _In_ INT DhcpAction,
568 _In_ DWORD Unknown8)
569{
571
572 DPRINT1("DHCPCSVC: DhcpNotifyConfigChangeEx not implemented yet\n");
573 DPRINT1("DhcpNotifyConfigChangeEx(%S %S %lu %lu %lu %lu %d %lu)\n",
574 ServerName, AdapterName, NewIpAddress, IpIndex, IpAddress, SubnetMask, DhcpAction, Unknown8);
575
576 if (AdapterName == NULL)
578
579 if (DhcpAction == 1) // Enable DHCP
580 {
581 if ((NewIpAddress != FALSE) ||
582 (IpIndex != 0) ||
583 (IpAddress != 0) ||
584 (SubnetMask != 0))
586 }
587 else if (DhcpAction == 2) // Disable DHCP
588 {
589 if ((NewIpAddress == FALSE) ||
590 (IpIndex != 0) ||
591 (IpAddress == 0) ||
592 (SubnetMask == 0))
594 }
595 else if (DhcpAction == 0) // Do not modify
596 {
597
598 }
599 else
600 {
602 }
603
604 if (DhcpAction == 1) // Enable DHCP
605 {
606 /* TODO: Remove static IP address(es) */
607
609 {
610 ret = Server_EnableDhcp(ServerName, AdapterName, TRUE);
611 }
613 {
615 }
617 }
618 else if (DhcpAction == 2) // Disable DHCP
619 {
621 {
622 ret = Server_EnableDhcp(ServerName, AdapterName, FALSE);
623 }
625 {
627 }
629 }
630 else if (DhcpAction == 0) // Do not modify
631 {
632
633 }
634
635 return ret;
636}
637
638DWORD
644 _In_ LPDHCPCAPI_CLASSID ClassId,
647{
648 DPRINT1("DhcpRegisterParamChange(%lx %p %S)\n", Flags, Reserved, AdapterName);
649
652
653 if ((Reserved != NULL) || (AdapterName == NULL) || (Handle == NULL))
655
657 return 0;
658}
659
670DWORD
674{
675 DWORD ret;
676
677 DPRINT("DhcpReleaseParameters(%S)\n", AdapterName);
678
680 {
681 ret = Client_ReleaseParameters(NULL, AdapterName);
682 }
684 {
686 }
688
689 return ret;
690}
691
697DWORD
700{
701 DWORD ret;
702
703 DPRINT("DhcpRemoveDNSRegistrations()\n");
704
706 {
707 ret = Client_RemoveDNSRegistrations(NULL);
708 }
710 {
712 }
714
715 return ret;
716}
717
718DWORD
724 _In_ LPDHCPCAPI_CLASSID ClassId,
725 _In_ DHCPCAPI_PARAMS_ARRAY SendParams,
728 _Inout_ LPDWORD pSize,
729 _In_ LPWSTR RequestIdStr)
730{
733
734 DPRINT("DhcpRequestParams(%lx %p %S %p %lu %p %lu %p %p %p %S)\n",
735 Flags, Reserved, AdapterName, ClassId, SendParams.nParams, SendParams.Params,
736 RecdParams.nParams, RecdParams.Params, Buffer, pSize, RequestIdStr);
737
742
743 if ((Reserved != NULL) || (AdapterName == NULL))
745
746 if (ClassId != NULL)
747 {
748 if (ClassId->Flags != 0)
750
751 if ((ClassId->Data == NULL) || (ClassId->nBytesData == 0))
753 }
754
755 if ((SendParams.nParams != 0) && (SendParams.Params == NULL))
757
758 if (RecdParams.Params == NULL)
760
762 {
764 {
765 ret = Client_RequestParams(NULL,
767 ClassId,
768 &SendParams,
769 &RecdParams,
770 &Results);
771 }
773 {
775 }
777 }
778
779 if (Results)
780 {
781 DPRINT("Results: Count %lu DataSize %lu\n", Results->ResultsCount, Results->DataSize);
782
783 ret = MapRequestResultData(Results,
784 &RecdParams,
785 Buffer,
786 pSize);
787
788 if (Results->Results)
789 MIDL_user_free(Results->Results);
790 if (Results->Data)
791 MIDL_user_free(Results->Data);
792 MIDL_user_free(Results);
793 }
794
795 if (ret != ERROR_SUCCESS)
796 return ret;
797
799 {
800 /* FIXME: Store the request */
801 DPRINT1("DHCPCAPI_REQUEST_PERSISTENT is not supported yet!\n");
802 }
803
804 return ret;
805}
806
807DWORD
811 DWORD Netmask)
812{
813 DWORD ret;
814
815 DPRINT("DhcpStaticRefreshParams()\n");
816
818 {
819 ret = Client_StaticRefreshParams(NULL, AdapterIndex, Address, Netmask);
820 }
822 {
824 }
826
827 return (ret == ERROR_SUCCESS) ? 1 : 0;
828}
829
830DWORD
836 _In_ LPWSTR RequestIdStr)
837{
838 DPRINT1("DhcpUndoRequestParams(%lx %p %S %S)\n",
839 Flags, Reserved, AdapterName, RequestIdStr);
840
841 if ((Flags != 0) || (Reserved != NULL) || (RequestIdStr == NULL))
843
845 return STATUS_SUCCESS;
846}
847
848static VOID
850{
853
854 if (dwState == SERVICE_RUNNING)
856 else
858
862
863 if (dwState == SERVICE_START_PENDING ||
864 dwState == SERVICE_STOP_PENDING)
866 else
868
871}
872
873static DWORD WINAPI
875 DWORD dwEventType,
876 LPVOID lpEventData,
877 LPVOID lpContext)
878{
879 switch (dwControl)
880 {
884 if (hStopEvent != NULL)
886 return ERROR_SUCCESS;
887
891 return ERROR_SUCCESS;
892
893 default:
895 }
896}
897
900{
901 HANDLE hPipeThread = INVALID_HANDLE_VALUE;
902 HANDLE hDiscoveryThread = INVALID_HANDLE_VALUE;
903 DWORD ret;
904
907 NULL);
909 {
910 DPRINT1("DHCPCSVC: Unable to register service control handler (%lx)\n", GetLastError());
911 return;
912 }
913
915
916 /* Create the stop event */
918 if (hStopEvent == NULL)
919 {
921 return;
922 }
923
926 {
929 return;
930 }
931
933
934 if (!init_client())
935 {
936 DbgPrint("DHCPCSVC: init_client() failed!\n");
940 return;
941 }
942
944
945 hPipeThread = InitRpc();
946 if (hPipeThread == INVALID_HANDLE_VALUE)
947 {
948 DbgPrint("DHCPCSVC: PipeInit() failed!\n");
949 stop_client();
953 return;
954 }
955
956 hDiscoveryThread = StartAdapterDiscovery(hStopEvent);
957 if (hDiscoveryThread == INVALID_HANDLE_VALUE)
958 {
959 DbgPrint("DHCPCSVC: StartAdapterDiscovery() failed!\n");
960 ShutdownRpc();
961 stop_client();
965 return;
966 }
967
968 DH_DbgPrint(MID_TRACE,("DHCP Service Started\n"));
969
971
972 DH_DbgPrint(MID_TRACE,("Going into dispatch()\n"));
973 DH_DbgPrint(MID_TRACE,("DHCPCSVC: DHCP service is starting up\n"));
974
976
977 DH_DbgPrint(MID_TRACE,("DHCPCSVC: DHCP service is shutting down\n"));
978
979 ShutdownRpc();
980 stop_client();
981
982 DPRINT("Wait for pipe thread to close! %p\n", hPipeThread);
983 if (hPipeThread != INVALID_HANDLE_VALUE)
984 {
985 DPRINT("Waiting for pipe thread\n");
986 ret = WaitForSingleObject(hPipeThread, 5000);
987 DPRINT("Done %lx\n", ret);
988 }
989
990 DPRINT("Wait for discovery thread to close! %p\n", hDiscoveryThread);
991 if (hDiscoveryThread != INVALID_HANDLE_VALUE)
992 {
993 DPRINT("Waiting for discovery thread\n");
994 ret = WaitForSingleObject(hDiscoveryThread, 5000);
995 DPRINT("Done %lx\n", ret);
996 }
997
998 DPRINT("Closing events!\n");
1001
1004
1005 CloseHandle(hDiscoveryThread);
1006 CloseHandle(hPipeThread);
1007
1008 DPRINT("Done!\n");
1009
1011}
1012
1017{
1018 switch (fdwReason)
1019 {
1020 case DLL_PROCESS_ATTACH:
1021 DisableThreadLibraryCalls(hinstDLL);
1022 break;
1023
1024 case DLL_PROCESS_DETACH:
1025 break;
1026 }
1027
1028 return TRUE;
1029}
1030
1031/* EOF */
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
static DWORD const fdwReason
#define DPRINT1
Definition: precomp.h:8
HANDLE StartAdapterDiscovery(HANDLE hStopEvent)
Definition: adapter.c:591
VOID ShutdownRpc(VOID)
Definition: api.c:71
DWORD __stdcall Server_EnableDhcp(_In_ PDHCP_SERVER_NAME ServerName, _In_ LPWSTR AdapterName, _In_ BOOL Enable)
Definition: api.c:106
HANDLE InitRpc(VOID)
Definition: api.c:65
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
#define MID_TRACE
Definition: debug.h:15
#define DH_DbgPrint(_t_, _x_)
Definition: debug.h:49
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define RegCloseKey(hKey)
Definition: registry.h:49
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
Definition: conport.c:39
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:37
handle_t hBinding
Definition: ctx_c.c:54
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_SUCCESS
Definition: deptool.c:10
int init_client(void)
Definition: dhclient.c:111
void stop_client(void)
Definition: dhclient.c:129
#define DHCPCAPI_REQUEST_SYNCHRONOUS
Definition: dhcpcsdk.h:129
#define DHCPCAPI_REQUEST_PERSISTENT
Definition: dhcpcsdk.h:128
#define DHCPCAPI_REGISTER_HANDLE_EVENT
Definition: dhcpcsdk.h:126
static WCHAR ServiceName[]
Definition: dhcpcsvc.c:16
DWORD APIENTRY DhcpCApiInitialize(_Out_ LPDWORD Version)
Definition: dhcpcsvc.c:274
DWORD APIENTRY DhcpHandlePnPEvent(_In_ DWORD Unknown1, _In_ DWORD Unknown2, _In_ PWSTR AdapterName, _In_ PDHCP_PNP_EVENT PnpEvent, _In_ DWORD Unknown5)
Definition: dhcpcsvc.c:455
DWORD APIENTRY DhcpRemoveDNSRegistrations(VOID)
Definition: dhcpcsvc.c:699
HANDLE hAdapterStateChangedEvent
Definition: dhcpcsvc.c:21
static DWORD SetBinaryClassId(_In_ PWSTR pszAdapterName)
Definition: dhcpcsvc.c:93
SOCKET DhcpSocket
Definition: adapter.c:8
DWORD APIENTRY DhcpReleaseParameters(_In_ PWSTR AdapterName)
Definition: dhcpcsvc.c:672
DWORD APIENTRY DhcpUndoRequestParams(_In_ DWORD Flags, _In_ LPVOID Reserved, _In_ LPWSTR AdapterName, _In_ LPWSTR RequestIdStr)
Definition: dhcpcsvc.c:832
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: dhcpcsvc.c:1014
DWORD APIENTRY DhcpFallbackRefreshParams(_In_ PWSTR AdapterName)
Definition: dhcpcsvc.c:411
void __RPC_USER MIDL_user_free(void __RPC_FAR *ptr)
Definition: dhcpcsvc.c:31
VOID WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
Definition: dhcpcsvc.c:899
static DWORD WINAPI ServiceControlHandler(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
Definition: dhcpcsvc.c:874
static VOID UpdateServiceStatus(DWORD dwState)
Definition: dhcpcsvc.c:849
SERVICE_STATUS_HANDLE ServiceStatusHandle
Definition: dhcpcsvc.c:18
DWORD APIENTRY DhcpAcquireParametersByBroadcast(_In_ PWSTR AdapterName)
Definition: dhcpcsvc.c:336
DWORD APIENTRY DhcpStaticRefreshParams(DWORD AdapterIndex, DWORD Address, DWORD Netmask)
Definition: dhcpcsvc.c:809
DWORD APIENTRY DhcpNotifyConfigChangeEx(_In_ LPWSTR ServerName, _In_ LPWSTR AdapterName, _In_ BOOL NewIpAddress, _In_ DWORD IpIndex, _In_ DWORD IpAddress, _In_ DWORD SubnetMask, _In_ INT DhcpAction, _In_ DWORD Unknown8)
Definition: dhcpcsvc.c:560
handle_t __RPC_USER PDHCP_SERVER_NAME_bind(_In_ PDHCP_SERVER_NAME pszServerName)
Definition: dhcpcsvc.c:37
HANDLE hStopEvent
Definition: dhcpcsvc.c:20
DWORD APIENTRY DhcpRegisterParamChange(_In_ DWORD Flags, _In_ LPVOID Reserved, _In_ LPWSTR AdapterName, _In_ LPDHCPCAPI_CLASSID ClassId, _In_ DHCPCAPI_PARAMS_ARRAY Params, _Inout_ LPVOID Handle)
Definition: dhcpcsvc.c:640
static DWORD MapRequestResultData(_In_ LPDHCPCAPI_RESULT_ARRAY Results, _Inout_ LPDHCPCAPI_PARAMS_ARRAY RecdParams, _In_ LPBYTE Buffer, _Inout_ LPDWORD pSize)
Definition: dhcpcsvc.c:222
SERVICE_STATUS ServiceStatus
Definition: dhcpcsvc.c:19
DWORD APIENTRY DhcpAcquireParameters(_In_ PWSTR AdapterName)
Definition: dhcpcsvc.c:304
DWORD APIENTRY DhcpRequestParams(_In_ DWORD Flags, _In_ PVOID Reserved, _In_ LPWSTR AdapterName, _In_ LPDHCPCAPI_CLASSID ClassId, _In_ DHCPCAPI_PARAMS_ARRAY SendParams, _Inout_ DHCPCAPI_PARAMS_ARRAY RecdParams, _In_ LPBYTE Buffer, _Inout_ LPDWORD pSize, _In_ LPWSTR RequestIdStr)
Definition: dhcpcsvc.c:720
DWORD APIENTRY DhcpNotifyConfigChange(_In_ LPWSTR ServerName, _In_ LPWSTR AdapterName, _In_ BOOL NewIpAddress, _In_ DWORD IpIndex, _In_ DWORD IpAddress, _In_ DWORD SubnetMask, _In_ INT DhcpAction)
Definition: dhcpcsvc.c:510
DWORD APIENTRY DhcpEnumClasses(_In_ DWORD Unknown1, _In_ PWSTR AdapterName, _In_ DWORD Unknown3, _In_ DWORD Unknown4)
Definition: dhcpcsvc.c:388
DWORD APIENTRY DhcpDeRegisterParamChange(_In_ DWORD Flags, _In_ LPVOID Reserved, _In_ LPVOID Event)
Definition: dhcpcsvc.c:358
void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T len)
Definition: dhcpcsvc.c:26
VOID APIENTRY DhcpCApiCleanup(VOID)
Definition: dhcpcsvc.c:288
static PDHCPAPI_PARAMS FindParam(_In_ LPDHCPCAPI_PARAMS_ARRAY ParamsArray, _In_ ULONG OptionId, _In_ BOOL IsVendor)
Definition: dhcpcsvc.c:203
void __RPC_USER PDHCP_SERVER_NAME_unbind(_In_ PDHCP_SERVER_NAME pszServerName, _In_ handle_t hBinding)
Definition: dhcpcsvc.c:76
wchar_t * PDHCP_SERVER_NAME
Definition: dhcpcsvc.idl:7
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APIENTRY
Definition: api.h:79
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define CP_ACP
Definition: compat.h:109
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define WideCharToMultiByte
Definition: compat.h:111
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
MonoAssembly int argc
Definition: metahost.c:107
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
FxAutoRegKey hKey
ULONG Handle
Definition: gdb_input.c:15
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DbgPrint
Definition: hal.h:12
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
static IN DWORD IN LPVOID lpvReserved
#define CopyMemory
Definition: minwinbase.h:29
_Null_terminated_ char * PSZ
Definition: minwindef.h:56
static PVOID ptr
Definition: dispmode.c:27
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define argv
Definition: mplay32.c:18
#define closesocket
Definition: ncftp.h:477
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE _In_ PNDIS_STRING AdapterName
Definition: ndis.h:6016
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define REG_BINARY
Definition: nt_native.h:1499
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define KEY_SET_VALUE
Definition: nt_native.h:1020
BYTE * PBYTE
Definition: pedump.c:66
short WCHAR
Definition: pedump.c:58
static WCHAR Address[46]
Definition: ping.c:68
#define SERVICE_STOPPED
Definition: winsvc.h:21
#define SERVICE_ACCEPT_STOP
Definition: winsvc.h:28
#define SERVICE_STOP_PENDING
Definition: winsvc.h:23
#define SERVICE_CONTROL_SHUTDOWN
Definition: winsvc.h:46
#define SERVICE_START_PENDING
Definition: winsvc.h:22
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:42
#define SERVICE_ACCEPT_SHUTDOWN
Definition: winsvc.h:30
#define SERVICE_CONTROL_INTERROGATE
Definition: winsvc.h:45
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:862
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:493
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:771
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:181
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
Definition: sctrl.c:831
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
Definition: sctrl.c:1016
#define RpcEndExcept
Definition: rpc.h:123
#define __RPC_FAR
Definition: rpc.h:52
#define RpcTryExcept
Definition: rpc.h:121
#define RpcExcept(expr)
Definition: rpc.h:122
long RPC_STATUS
Definition: rpc.h:48
#define __RPC_USER
Definition: rpc.h:61
#define RpcExceptionCode()
Definition: rpc.h:127
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
LPBYTE Data
Definition: dhcpcsdk.h:98
DWORD nBytesData
Definition: dhcpcsdk.h:100
LPDHCPCAPI_RESULTS Results
Definition: dhcpcsvc.idl:63
DWORD dwServiceType
Definition: winsvc.h:105
DWORD dwWin32ExitCode
Definition: winsvc.h:108
DWORD dwControlsAccepted
Definition: winsvc.h:107
DWORD dwWaitHint
Definition: winsvc.h:111
DWORD dwCurrentState
Definition: winsvc.h:106
DWORD dwCheckPoint
Definition: winsvc.h:110
DWORD dwServiceSpecificExitCode
Definition: winsvc.h:109
Definition: ps.c:97
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
uint16_t * PWSTR
Definition: typedefs.h:56
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CreateEvent
Definition: winbase.h:3469
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define WINAPI
Definition: msvc.h:6
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define INVALID_SOCKET
Definition: winsock.h:326
UINT_PTR SOCKET
Definition: winsock.h:41
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define SERVICE_WIN32_SHARE_PROCESS
Definition: cmtypes.h:964