@@ -87,22 +87,46 @@ PDHCP_SERVER_NAME_unbind(
8787 }
8888}
8989
90-
90+ /*!
91+ * Initializes the DHCP interface
92+ *
93+ * \param[out] Version
94+ * Returns the DHCP Interface Version
95+ *
96+ * \return ERROR_SUCCESS on success
97+ *
98+ * \remarks DhcpCApiInitialized must be called before any other DHCP Function.
99+ */
91100DWORD
92101APIENTRY
93102DhcpCApiInitialize (
94103 _Out_ LPDWORD Version )
95104{
96105 * Version = 2 ;
97- return NO_ERROR ;
106+ return ERROR_SUCCESS ;
98107}
99108
109+ /*!
110+ * Cleans up the DHCP interface
111+ *
112+ * \remarks Other DHCP Functions must not be called after DhcpCApiCleanup.
113+ */
100114VOID
101115APIENTRY
102116DhcpCApiCleanup (VOID )
103117{
104118}
105119
120+ /*!
121+ * Renews a DHCP Lease
122+ *
123+ * \param[in] AdapterName
124+ * Name (GUID) of the Adapter
125+ *
126+ * \return ERROR_SUCCESS on success
127+ *
128+ * \remarks Undocumented by Microsoft
129+ */
106130DWORD
107131APIENTRY
108132DhcpAcquireParameters (
@@ -125,28 +149,6 @@ DhcpAcquireParameters(
125149 return ret ;
126150}
127151
128- DWORD
129- APIENTRY
130- DhcpReleaseParameters (
131- _In_ PWSTR AdapterName )
132- {
133- DWORD ret ;
134-
135- DPRINT ("DhcpReleaseParameters(%S)\n" , AdapterName );
136-
137- RpcTryExcept
138- {
139- ret = Client_ReleaseParameters (NULL , AdapterName );
140- }
141- RpcExcept (EXCEPTION_EXECUTE_HANDLER )
142- {
143- ret = I_RpcMapWin32Status (RpcExceptionCode ());
144- }
145- RpcEndExcept ;
146-
147- return ret ;
148- }
149-
150152DWORD
151153APIENTRY
152154DhcpEnumClasses (
@@ -174,6 +176,58 @@ DhcpHandlePnPEvent(
174176 return 0 ;
175177}
176178
179+ /*!
180+ * Set new TCP/IP parameters and notify DHCP client service of this
181+ *
182+ * \param[in] ServerName
183+ * NULL for local machine
184+ *
185+ * \param[in] AdapterName
186+ * IPHLPAPI name of adapter to change
187+ *
188+ * \param[in] NewIpAddress
189+ * TRUE if IP address changes
190+
191+ * \param[in] IpIndex
192+ * ...
193+ *
194+ * \param[in] IpAddress
195+ * New IP address (network byte order)
196+ *
197+ * \param[in] SubnetMask
198+ * New subnet mask (network byte order)
199+ *
200+ * \param[in] DhcpAction
201+ * 0 - don't modify
202+ * 1 - enable DHCP
203+ * 2 - disable DHCP
204+ *
205+ * \return ERROR_SUCCESS on success
206+ *
207+ * \remarks Undocumented by Microsoft
208+ */
209+ DWORD
210+ APIENTRY
211+ DhcpNotifyConfigChange (
212+ _In_ LPWSTR ServerName ,
213+ _In_ LPWSTR AdapterName ,
214+ _In_ BOOL NewIpAddress ,
215+ _In_ DWORD IpIndex ,
216+ _In_ DWORD IpAddress ,
217+ _In_ DWORD SubnetMask ,
218+ _In_ INT DhcpAction )
219+ {
220+ DPRINT1 ("DHCPCSVC: DhcpNotifyConfigChange not implemented yet\n" );
221+ DPRINT1 ("DhcpNotifyConfigChange(%S %S %lu %lu %lu %lu %d)\n" ,
222+ ServerName , AdapterName , NewIpAddress , IpIndex , IpAddress , SubnetMask , DhcpAction );
223+
224+ if (AdapterName == NULL )
225+ return ERROR_INVALID_PARAMETER ;
226+
227+ UNIMPLEMENTED ;
228+ return ERROR_SUCCESS ;
229+ }
230+
177231DWORD APIENTRY
178232DhcpQueryHWInfo (DWORD AdapterIndex ,
179233 PDWORD MediaType ,
@@ -197,6 +251,38 @@ DhcpQueryHWInfo(DWORD AdapterIndex,
197251 return (ret == ERROR_SUCCESS ) ? 1 : 0 ;
198252}
199253
254+ /*!
255+ * Releases a DHCP Lease
256+ *
257+ * \param[in] AdapterName
258+ * Name (GUID) of the Adapter
259+ *
260+ * \return ERROR_SUCCESS on success
261+ *
262+ * \remarks Undocumented by Microsoft
263+ */
264+ DWORD
265+ APIENTRY
266+ DhcpReleaseParameters (
267+ _In_ PWSTR AdapterName )
268+ {
269+ DWORD ret ;
270+
271+ DPRINT ("DhcpReleaseParameters(%S)\n" , AdapterName );
272+
273+ RpcTryExcept
274+ {
275+ ret = Client_ReleaseParameters (NULL , AdapterName );
276+ }
277+ RpcExcept (EXCEPTION_EXECUTE_HANDLER )
278+ {
279+ ret = I_RpcMapWin32Status (RpcExceptionCode ());
280+ }
281+ RpcEndExcept ;
282+
283+ return ret ;
284+ }
285+
200286DWORD
201287APIENTRY
202288DhcpStaticRefreshParams (DWORD AdapterIndex ,
@@ -220,45 +306,6 @@ DhcpStaticRefreshParams(DWORD AdapterIndex,
220306 return (ret == ERROR_SUCCESS ) ? 1 : 0 ;
221307}
222308
223- /*!
224- * Set new TCP/IP parameters and notify DHCP client service of this
225- *
226- * \param[in] ServerName
227- * NULL for local machine
228- *
229- * \param[in] AdapterName
230- * IPHLPAPI name of adapter to change
231- *
232- * \param[in] NewIpAddress
233- * TRUE if IP address changes
234- *
235- * \param[in] IpAddress
236- * New IP address (network byte order)
237- *
238- * \param[in] SubnetMask
239- * New subnet mask (network byte order)
240- *
241- * \param[in] DhcpAction
242- * 0 - don't modify
243- * 1 - enable DHCP
244- * 2 - disable DHCP
245- *
246- * \return non-zero on success
247- *
248- * \remarks Undocumented by Microsoft
249- */
250- DWORD APIENTRY
251- DhcpNotifyConfigChange (LPWSTR ServerName ,
252- LPWSTR AdapterName ,
253- BOOL NewIpAddress ,
254- DWORD IpIndex ,
255- DWORD IpAddress ,
256- DWORD SubnetMask ,
257- INT DhcpAction )
258- {
259- DPRINT1 ("DHCPCSVC: DhcpNotifyConfigChange not implemented yet\n" );
260- return 0 ;
261- }
262309
263310DWORD APIENTRY
264311DhcpRequestParams (DWORD Flags ,
0 commit comments