[DHCPCSVC] Add the client code and server stub for DhcpFallbackRefreshParams

DhcpFallbackRefreshParams is called by the TCPIP notification object after the alternate configuration has been changed.
This commit is contained in:
Eric Kohl
2026-04-06 13:42:03 +02:00
parent a409e5dcd8
commit 4b9adaa971
5 changed files with 83 additions and 8 deletions

View File

@@ -86,7 +86,7 @@ Server_AcquireParameters(
struct protocol* proto;
DWORD ret = ERROR_SUCCESS;
DPRINT("Server_AcquireParameters()\n");
DPRINT("Server_AcquireParameters(%S)\n", AdapterName);
ApiLock();
@@ -131,7 +131,7 @@ Server_ReleaseParameters(
struct protocol* proto;
DWORD ret = ERROR_SUCCESS;
DPRINT("Server_ReleaseParameters()\n");
DPRINT("Server_ReleaseParameters(%S)\n", AdapterName);
ApiLock();
@@ -162,6 +162,37 @@ done:
/* Function 2 */
DWORD
__stdcall
Server_FallbackRefreshParams(
_In_ PDHCP_SERVER_NAME ServerName,
_In_ LPWSTR AdapterName)
{
PDHCP_ADAPTER Adapter;
DWORD ret = ERROR_SUCCESS;
DPRINT("Server_FallbackRefreshParams(%S)\n", AdapterName);
ApiLock();
Adapter = AdapterFindName(AdapterName);
if (Adapter == NULL)
{
ret = ERROR_FILE_NOT_FOUND;
goto done;
}
DPRINT("Adapter: %p\n", Adapter);
/* FIXME */
done:
ApiUnlock();
return ret;
}
/* Function 3 */
DWORD
__stdcall
Server_QueryHWInfo(
_In_ PDHCP_SERVER_NAME ServerName,
_In_ DWORD AdapterIndex,
@@ -195,7 +226,7 @@ done:
return ret;
}
/* Function 3 */
/* Function 4 */
DWORD
__stdcall
Server_StaticRefreshParams(
@@ -252,7 +283,7 @@ done:
return ret;
}
/* Function 4 */
/* Function 5 */
DWORD
__stdcall
Server_RemoveDNSRegistrations(

View File

@@ -293,7 +293,39 @@ DhcpEnumClasses(
}
/*!
* Enumerates the DHCP user classes for the given adapter
* Notify the DHCP client to refresh its fallback configuration
*
* \param[in] AdapterName
* Name (GUID) of the Adapter
*
* \return ERROR_SUCCESS on success
*
* \remarks Undocumented by Microsoft
*/
DWORD
APIENTRY
DhcpFallbackRefreshParams(
_In_ PWSTR AdapterName)
{
DWORD ret;
DPRINT("DhcpFallbackRefreshParams(%S)\n", AdapterName);
RpcTryExcept
{
ret = Client_FallbackRefreshParams(NULL, AdapterName);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
ret = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return ret;
}
/*!
* Notify the DHCP client of PNP events
*
* \param[in] Unknown1
* Unknown

View File

@@ -13,7 +13,7 @@
@ stub DhcpDeRegisterOptions
@ stub DhcpDeRegisterParamChange
@ stdcall DhcpEnumClasses(long wstr long long)
@ stub DhcpFallbackRefreshParams
@ stdcall DhcpFallbackRefreshParams(wstr)
@ stdcall DhcpHandlePnPEvent(long long wstr long long)
@ stub DhcpLeaseIpAddress
@ stub DhcpLeaseIpAddressEx

View File

@@ -33,6 +33,11 @@ DhcpEnumClasses(
_In_ DWORD Unknown3,
_In_ DWORD Unknown4);
DWORD
APIENTRY
DhcpFallbackRefreshParams(
_In_ PWSTR AdapterName);
DWORD
APIENTRY
DhcpHandlePnPEvent(

View File

@@ -37,6 +37,13 @@ interface dhcpcsvc
/* Function 2 */
DWORD
__stdcall
FallbackRefreshParams(
[in, string, unique] PDHCP_SERVER_NAME ServerName,
[in, string] LPWSTR AdapterName);
/* Function 3 */
DWORD
__stdcall
QueryHWInfo(
[in, string, unique] PDHCP_SERVER_NAME ServerName,
[in] DWORD AdapterIndex,
@@ -44,7 +51,7 @@ interface dhcpcsvc
[out] PDWORD Mtu,
[out] PDWORD Speed);
/* Function 3 */
/* Function 4 */
DWORD
__stdcall
StaticRefreshParams(
@@ -53,7 +60,7 @@ interface dhcpcsvc
[in] DWORD Address,
[in] DWORD Netmask);
/* Function 4 */
/* Function 5 */
DWORD
__stdcall
RemoveDNSRegistrations(