ReactOS 0.4.16-dev-2613-g9533ad7
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 316 of file dhcpcsvc.c.

321{
322 DPRINT1("DhcpEnumClasses(%lx %S %lx %lx)\n",
323 Unknown1, AdapterName, Unknown3, Unknown4);
324 return 0;
325}
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 339 of file dhcpcsvc.c.

341{
342 DWORD ret;
343
344 DPRINT("DhcpFallbackRefreshParams(%S)\n", AdapterName);
345
347 {
348 ret = Client_FallbackRefreshParams(NULL, AdapterName);
349 }
351 {
353 }
355
356 return ret;
357}

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

389{
390 DWORD dwError = ERROR_SUCCESS;
391
392 DPRINT1("DhcpHandlePnPEvent(%lx %lx %S %p %lx)\n",
393 Unknown1, Unknown2, AdapterName, PnpEvent, Unknown5);
394
395 if ((Unknown1 != 0) || (Unknown2 != 1) || (PnpEvent == NULL) || (Unknown5 != 0))
397
398 if (PnpEvent->Unknown5)
399 {
400 dwError = SetBinaryClassId(AdapterName);
401 }
402
403 return dwError;
404}
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 438 of file dhcpcsvc.c.

446{
447 DPRINT("DhcpNotifyConfigChange(%S %S %lu %lu %lu %lu %d)\n",
448 ServerName, AdapterName, NewIpAddress, IpIndex, IpAddress, SubnetMask, DhcpAction);
449 return DhcpNotifyConfigChangeEx(ServerName, AdapterName, NewIpAddress,
450 IpIndex, IpAddress, SubnetMask, DhcpAction, 0);
451}
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:488

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

497{
499
500 DPRINT1("DHCPCSVC: DhcpNotifyConfigChangeEx not implemented yet\n");
501 DPRINT1("DhcpNotifyConfigChangeEx(%S %S %lu %lu %lu %lu %d %lu)\n",
502 ServerName, AdapterName, NewIpAddress, IpIndex, IpAddress, SubnetMask, DhcpAction, Unknown8);
503
504 if (AdapterName == NULL)
506
507 if (DhcpAction == 1) // Enable DHCP
508 {
509 if ((NewIpAddress != FALSE) ||
510 (IpIndex != 0) ||
511 (IpAddress != 0) ||
512 (SubnetMask != 0))
514 }
515 else if (DhcpAction == 2) // Disable DHCP
516 {
517 if ((NewIpAddress == FALSE) ||
518 (IpIndex != 0) ||
519 (IpAddress == 0) ||
520 (SubnetMask == 0))
522 }
523 else if (DhcpAction == 0) // Do not modify
524 {
525
526 }
527 else
528 {
530 }
531
532 if (DhcpAction == 1) // Enable DHCP
533 {
534 /* TODO: Remove static IP address(es) */
535
537 {
538 ret = Server_EnableDhcp(ServerName, AdapterName, TRUE);
539 }
541 {
543 }
545 }
546 else if (DhcpAction == 2) // Disable DHCP
547 {
549 {
550 ret = Server_EnableDhcp(ServerName, AdapterName, FALSE);
551 }
553 {
555 }
557 }
558 else if (DhcpAction == 0) // Do not modify
559 {
560
561 }
562
563 return ret;
564}
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 578 of file dhcpcsvc.c.

580{
581 DWORD ret;
582
583 DPRINT("DhcpReleaseParameters(%S)\n", AdapterName);
584
586 {
587 ret = Client_ReleaseParameters(NULL, AdapterName);
588 }
590 {
592 }
594
595 return ret;
596}

Referenced by IpReleaseAddress(), and Release().

◆ DhcpStaticRefreshParams()

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

Definition at line 626 of file dhcpcsvc.c.

629{
630 DWORD ret;
631
632 DPRINT("DhcpStaticRefreshParams()\n");
633
635 {
636 ret = Client_StaticRefreshParams(NULL, AdapterIndex, Address, Netmask);
637 }
639 {
641 }
643
644 return (ret == ERROR_SUCCESS) ? 1 : 0;
645}
static WCHAR Address[46]
Definition: ping.c:68

Referenced by INetCfgComponentControl_fnApplyPnpChanges().