ReactOS 0.4.17-dev-684-ga6524ef
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 304 of file dhcpcsvc.c.

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}
#define NULL
Definition: types.h:112
return ret
Definition: mutex.c:147
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 336 of file dhcpcsvc.c.

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}

◆ 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 388 of file dhcpcsvc.c.

393{
394 DPRINT1("DhcpEnumClasses(%lx %S %lx %lx)\n",
395 Unknown1, AdapterName, Unknown3, Unknown4);
396 return 0;
397}
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 411 of file dhcpcsvc.c.

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}

◆ 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 455 of file dhcpcsvc.c.

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}
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 510 of file dhcpcsvc.c.

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}
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

◆ 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 560 of file dhcpcsvc.c.

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}
DWORD __stdcall Server_EnableDhcp(_In_ PDHCP_SERVER_NAME ServerName, _In_ LPWSTR AdapterName, _In_ BOOL Enable)
Definition: api.c:106
#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 672 of file dhcpcsvc.c.

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}

Referenced by IpReleaseAddress(), and Release().

◆ DhcpStaticRefreshParams()

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

Definition at line 809 of file dhcpcsvc.c.

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}
static WCHAR Address[46]
Definition: ping.c:68

Referenced by INetCfgComponentControl_fnApplyPnpChanges().