ReactOS 0.4.17-dev-243-g1369312
dhcpcapi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DHCP_PNP_EVENT
 

Typedefs

typedef struct _DHCP_PNP_EVENT DHCP_PNP_EVENT
 
typedef struct _DHCP_PNP_EVENTPDHCP_PNP_EVENT
 

Functions

DWORD APIENTRY DhcpAcquireParameters (_In_ PWSTR AdapterName)
 
DWORD APIENTRY DhcpAcquireParametersByBroadcast (_In_ PWSTR AdapterName)
 
DWORD APIENTRY DhcpEnumClasses (_In_ DWORD Unknown1, _In_ PWSTR AdapterName, _In_ DWORD Unknown3, _In_ DWORD Unknown4)
 
DWORD APIENTRY DhcpFallbackRefreshParams (_In_ PWSTR AdapterName)
 
DWORD APIENTRY DhcpHandlePnPEvent (_In_ DWORD Unknown1, _In_ DWORD Unknown2, _In_ LPWSTR AdapterName, _In_ PDHCP_PNP_EVENT PnpEvent, _In_ DWORD Unknown5)
 
DWORD APIENTRY DhcpNotifyConfigChange (_In_ LPWSTR ServerName, _In_ LPWSTR AdapterName, _In_ BOOL NewIpAddress, _In_ DWORD IpIndex, _In_ DWORD IpAddress, _In_ DWORD SubnetMask, _In_ INT DhcpAction)
 
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)
 
DWORD APIENTRY DhcpReleaseParameters (_In_ PWSTR AdapterName)
 
DWORD APIENTRY DhcpStaticRefreshParams (DWORD AdapterIndex, DWORD Address, DWORD Netmask)
 

Typedef Documentation

◆ DHCP_PNP_EVENT

◆ PDHCP_PNP_EVENT

Function Documentation

◆ DhcpAcquireParameters()

DWORD APIENTRY DhcpAcquireParameters ( _In_ PWSTR  AdapterName)

Renews a DHCP Lease

Parameters
[in]AdapterNameName (GUID) of the Adapter
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 243 of file dhcpcsvc.c.

245{
246 DWORD ret;
247
248 DPRINT("DhcpAcquireParameters(%S)\n", AdapterName);
249
251 {
252 ret = Client_AcquireParameters(NULL, AdapterName);
253 }
255 {
257 }
259
260 return ret;
261}
#define NULL
Definition: types.h:112
return ret
Definition: mutex.c:146
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
_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
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:771
#define RpcEndExcept
Definition: rpc.h:123
#define RpcTryExcept
Definition: rpc.h:121
#define RpcExcept(expr)
Definition: rpc.h:122
#define RpcExceptionCode()
Definition: rpc.h:127
#define DPRINT
Definition: sndvol32.h:73

Referenced by IpRenewAddress(), and Renew().

◆ DhcpAcquireParametersByBroadcast()

DWORD APIENTRY DhcpAcquireParametersByBroadcast ( _In_ PWSTR  AdapterName)

Renews a DHCP Lease

Parameters
[in]AdapterNameName (GUID) of the Adapter
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 275 of file dhcpcsvc.c.

277{
278 DWORD ret;
279
280 DPRINT("DhcpAcquireParametersByBroadcast(%S)\n", AdapterName);
281
283 {
284 ret = Client_AcquireParametersByBroadcast(NULL, AdapterName);
285 }
287 {
289 }
291
292 return ret;
293}

◆ DhcpEnumClasses()

DWORD APIENTRY DhcpEnumClasses ( _In_ DWORD  Unknown1,
_In_ PWSTR  AdapterName,
_In_ DWORD  Unknown3,
_In_ DWORD  Unknown4 
)

Enumerates the DHCP user classes for the given adapter

Parameters
[in]Unknown1Unknown
[in]AdapterNameName (GUID) of the Adapter
[in]Unknown3Unknown
[in]Unknown4Unknown
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 327 of file dhcpcsvc.c.

332{
333 DPRINT1("DhcpEnumClasses(%lx %S %lx %lx)\n",
334 Unknown1, AdapterName, Unknown3, Unknown4);
335 return 0;
336}
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
#define DPRINT1
Definition: precomp.h:8
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:37

◆ DhcpFallbackRefreshParams()

DWORD APIENTRY DhcpFallbackRefreshParams ( _In_ PWSTR  AdapterName)

Notify the DHCP client to refresh its fallback configuration

Parameters
[in]AdapterNameName (GUID) of the Adapter
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 350 of file dhcpcsvc.c.

352{
353 DWORD ret;
354
355 DPRINT("DhcpFallbackRefreshParams(%S)\n", AdapterName);
356
358 {
359 ret = Client_FallbackRefreshParams(NULL, AdapterName);
360 }
362 {
364 }
366
367 return ret;
368}

◆ DhcpHandlePnPEvent()

DWORD APIENTRY DhcpHandlePnPEvent ( _In_ DWORD  Unknown1,
_In_ DWORD  Unknown2,
_In_ PWSTR  AdapterName,
_In_ PDHCP_PNP_EVENT  PnpEvent,
_In_ DWORD  Unknown5 
)

Notify the DHCP client of PNP events

Parameters
[in]Unknown1Unknown
[in]Unknown2Unknown
[in]AdapterNameName (GUID) of the Adapter
[in]PnpEventUnknown
[in]Unknown5Unknown
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 394 of file dhcpcsvc.c.

400{
401 DWORD dwError = ERROR_SUCCESS;
402
403 DPRINT1("DhcpHandlePnPEvent(%lx %lx %S %p %lx)\n",
404 Unknown1, Unknown2, AdapterName, PnpEvent, Unknown5);
405
406 if ((Unknown1 != 0) || (Unknown2 != 1) || (PnpEvent == NULL) || (Unknown5 != 0))
408
409 if (PnpEvent->Unknown5)
410 {
411 dwError = SetBinaryClassId(AdapterName);
412 }
413
414 return dwError;
415}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
Definition: conport.c:39
#define ERROR_SUCCESS
Definition: deptool.c:10
static DWORD SetBinaryClassId(_In_ PWSTR pszAdapterName)
Definition: dhcpcsvc.c:93
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101

Referenced by SetClassId().

◆ DhcpNotifyConfigChange()

DWORD APIENTRY DhcpNotifyConfigChange ( _In_ LPWSTR  ServerName,
_In_ LPWSTR  AdapterName,
_In_ BOOL  NewIpAddress,
_In_ DWORD  IpIndex,
_In_ DWORD  IpAddress,
_In_ DWORD  SubnetMask,
_In_ INT  DhcpAction 
)

Set new TCP/IP parameters and notify DHCP client service of this

Parameters
[in]ServerNameNULL for local machine
[in]AdapterNameIPHLPAPI name of adapter to change
[in]NewIpAddressTRUE if IP address changes
[in]IpIndex...
[in]IpAddressNew IP address (network byte order)
[in]SubnetMaskNew subnet mask (network byte order)
[in]DhcpAction0 - don't modify 1 - enable DHCP 2 - disable DHCP
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 449 of file dhcpcsvc.c.

457{
458 DPRINT("DhcpNotifyConfigChange(%S %S %lu %lu %lu %lu %d)\n",
459 ServerName, AdapterName, NewIpAddress, IpIndex, IpAddress, SubnetMask, DhcpAction);
460 return DhcpNotifyConfigChangeEx(ServerName, AdapterName, NewIpAddress,
461 IpIndex, IpAddress, SubnetMask, DhcpAction, 0);
462}
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:499

◆ DhcpNotifyConfigChangeEx()

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 
)

Set new TCP/IP parameters and notify DHCP client service of this

Parameters
[in]ServerNameNULL for local machine
[in]AdapterNameIPHLPAPI name of adapter to change
[in]NewIpAddressTRUE if IP address changes
[in]IpIndex...
[in]IpAddressNew IP address (network byte order)
[in]SubnetMaskNew subnet mask (network byte order)
[in]DhcpAction0 - don't modify 1 - enable DHCP 2 - disable DHCP
[in]Unknown8Unknown
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 499 of file dhcpcsvc.c.

508{
510
511 DPRINT1("DHCPCSVC: DhcpNotifyConfigChangeEx not implemented yet\n");
512 DPRINT1("DhcpNotifyConfigChangeEx(%S %S %lu %lu %lu %lu %d %lu)\n",
513 ServerName, AdapterName, NewIpAddress, IpIndex, IpAddress, SubnetMask, DhcpAction, Unknown8);
514
515 if (AdapterName == NULL)
517
518 if (DhcpAction == 1) // Enable DHCP
519 {
520 if ((NewIpAddress != FALSE) ||
521 (IpIndex != 0) ||
522 (IpAddress != 0) ||
523 (SubnetMask != 0))
525 }
526 else if (DhcpAction == 2) // Disable DHCP
527 {
528 if ((NewIpAddress == FALSE) ||
529 (IpIndex != 0) ||
530 (IpAddress == 0) ||
531 (SubnetMask == 0))
533 }
534 else if (DhcpAction == 0) // Do not modify
535 {
536
537 }
538 else
539 {
541 }
542
543 if (DhcpAction == 1) // Enable DHCP
544 {
545 /* TODO: Remove static IP address(es) */
546
548 {
549 ret = Server_EnableDhcp(ServerName, AdapterName, TRUE);
550 }
552 {
554 }
556 }
557 else if (DhcpAction == 2) // Disable DHCP
558 {
560 {
561 ret = Server_EnableDhcp(ServerName, AdapterName, FALSE);
562 }
564 {
566 }
568 }
569 else if (DhcpAction == 0) // Do not modify
570 {
571
572 }
573
574 return ret;
575}
DWORD __stdcall Server_EnableDhcp(_In_ PDHCP_SERVER_NAME ServerName, _In_ LPWSTR AdapterName, _In_ BOOL Enable)
Definition: api.c:81
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by DhcpNotifyConfigChange().

◆ DhcpReleaseParameters()

DWORD APIENTRY DhcpReleaseParameters ( _In_ PWSTR  AdapterName)

Releases a DHCP Lease

Parameters
[in]AdapterNameName (GUID) of the Adapter
Returns
ERROR_SUCCESS on success
Remarks
Undocumented by Microsoft

Definition at line 611 of file dhcpcsvc.c.

613{
614 DWORD ret;
615
616 DPRINT("DhcpReleaseParameters(%S)\n", AdapterName);
617
619 {
620 ret = Client_ReleaseParameters(NULL, AdapterName);
621 }
623 {
625 }
627
628 return ret;
629}

Referenced by IpReleaseAddress(), and Release().

◆ DhcpStaticRefreshParams()

DWORD APIENTRY DhcpStaticRefreshParams ( DWORD  AdapterIndex,
DWORD  Address,
DWORD  Netmask 
)

Definition at line 719 of file dhcpcsvc.c.

722{
723 DWORD ret;
724
725 DPRINT("DhcpStaticRefreshParams()\n");
726
728 {
729 ret = Client_StaticRefreshParams(NULL, AdapterIndex, Address, Netmask);
730 }
732 {
734 }
736
737 return (ret == ERROR_SUCCESS) ? 1 : 0;
738}
static WCHAR Address[46]
Definition: ping.c:68

Referenced by INetCfgComponentControl_fnApplyPnpChanges().