diff --git a/base/services/dhcpcsvc/dhcp/api.c b/base/services/dhcpcsvc/dhcp/api.c index 0a2141275ac..87ec8ec0713 100644 --- a/base/services/dhcpcsvc/dhcp/api.c +++ b/base/services/dhcpcsvc/dhcp/api.c @@ -205,40 +205,3 @@ DWORD DSStaticRefreshParams( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ * return Send(CommPipe, &Reply ); } - -DWORD DSGetAdapterInfo( PipeSendFunc Send, HANDLE CommPipe, COMM_DHCP_REQ *Req ) { - COMM_DHCP_REPLY Reply; - PDHCP_ADAPTER Adapter; - - ApiLock(); - - Adapter = AdapterFindIndex( Req->AdapterIndex ); - - Reply.Reply = Adapter ? 1 : 0; - - if( Adapter ) { - Reply.GetAdapterInfo.DhcpEnabled = (S_STATIC != Adapter->DhclientState.state); - if (S_BOUND == Adapter->DhclientState.state) { - if (sizeof(Reply.GetAdapterInfo.DhcpServer) == - Adapter->DhclientState.active->serveraddress.len) { - memcpy(&Reply.GetAdapterInfo.DhcpServer, - Adapter->DhclientState.active->serveraddress.iabuf, - Adapter->DhclientState.active->serveraddress.len); - } else { - DPRINT1("Unexpected server address len %d\n", - Adapter->DhclientState.active->serveraddress.len); - Reply.GetAdapterInfo.DhcpServer = htonl(INADDR_NONE); - } - Reply.GetAdapterInfo.LeaseObtained = Adapter->DhclientState.active->obtained; - Reply.GetAdapterInfo.LeaseExpires = Adapter->DhclientState.active->expiry; - } else { - Reply.GetAdapterInfo.DhcpServer = htonl(INADDR_NONE); - Reply.GetAdapterInfo.LeaseObtained = 0; - Reply.GetAdapterInfo.LeaseExpires = 0; - } - } - - ApiUnlock(); - - return Send(CommPipe, &Reply ); -} diff --git a/base/services/dhcpcsvc/dhcp/pipe.c b/base/services/dhcpcsvc/dhcp/pipe.c index 899b2322cf1..d8a59c07845 100644 --- a/base/services/dhcpcsvc/dhcp/pipe.c +++ b/base/services/dhcpcsvc/dhcp/pipe.c @@ -399,10 +399,6 @@ DWORD WINAPI PipeThreadProc( LPVOID Parameter ) { DSStaticRefreshParams( PipeSend, CommPipe, &Req ); break; - case DhcpReqGetAdapterInfo: - DSGetAdapterInfo( PipeSend, CommPipe, &Req ); - break; - default: DPRINT1("Unrecognized request type %d\n", Req.Type); ZeroMemory( &Reply, sizeof( COMM_DHCP_REPLY ) ); diff --git a/base/services/dhcpcsvc/dhcpcsvc.c b/base/services/dhcpcsvc/dhcpcsvc.c index 661a217e4cf..5e413c277ac 100644 --- a/base/services/dhcpcsvc/dhcpcsvc.c +++ b/base/services/dhcpcsvc/dhcpcsvc.c @@ -272,74 +272,6 @@ DhcpRequestParams(DWORD Flags, return 0; } -/*! - * Get DHCP info for an adapter - * - * \param[in] AdapterIndex - * Index of the adapter (iphlpapi-style) for which info is - * requested - * - * \param[out] DhcpEnabled - * Returns whether DHCP is enabled for the adapter - * - * \param[out] DhcpServer - * Returns DHCP server IP address (255.255.255.255 if no - * server reached yet), in network byte order - * - * \param[out] LeaseObtained - * Returns time at which the lease was obtained - * - * \param[out] LeaseExpires - * Returns time at which the lease will expire - * - * \return non-zero on success - * - * \remarks This is a ReactOS-only routine - */ -DWORD APIENTRY -DhcpRosGetAdapterInfo(DWORD AdapterIndex, - PBOOL DhcpEnabled, - PDWORD DhcpServer, - time_t* LeaseObtained, - time_t* LeaseExpires) -{ - COMM_DHCP_REQ Req; - COMM_DHCP_REPLY Reply; - DWORD BytesRead; - BOOL Result; - - ASSERT(PipeHandle != INVALID_HANDLE_VALUE); - - Req.Type = DhcpReqGetAdapterInfo; - Req.AdapterIndex = AdapterIndex; - - Result = TransactNamedPipe(PipeHandle, - &Req, sizeof(Req), - &Reply, sizeof(Reply), - &BytesRead, NULL); - - if (Result && Reply.Reply != 0) - *DhcpEnabled = Reply.GetAdapterInfo.DhcpEnabled; - else - *DhcpEnabled = FALSE; - - if (*DhcpEnabled) - { - *DhcpServer = Reply.GetAdapterInfo.DhcpServer; - *LeaseObtained = Reply.GetAdapterInfo.LeaseObtained; - *LeaseExpires = Reply.GetAdapterInfo.LeaseExpires; - } - else - { - *DhcpServer = INADDR_NONE; - *LeaseObtained = 0; - *LeaseExpires = 0; - } - - return Reply.Reply; -} - - static VOID UpdateServiceStatus(DWORD dwState) { diff --git a/base/services/dhcpcsvc/dhcpcsvc.spec b/base/services/dhcpcsvc/dhcpcsvc.spec index 277184ebcda..4654e2eafd6 100644 --- a/base/services/dhcpcsvc/dhcpcsvc.spec +++ b/base/services/dhcpcsvc/dhcpcsvc.spec @@ -42,5 +42,4 @@ @ stub McastReleaseAddress @ stub McastRenewAddress @ stub McastRequestAddress -@ stdcall DhcpRosGetAdapterInfo(long ptr ptr ptr ptr) @ stdcall ServiceMain(long ptr) diff --git a/sdk/include/reactos/libs/dhcp/rosdhcp_public.h b/sdk/include/reactos/libs/dhcp/rosdhcp_public.h index 5779184e32f..0883d84032a 100644 --- a/sdk/include/reactos/libs/dhcp/rosdhcp_public.h +++ b/sdk/include/reactos/libs/dhcp/rosdhcp_public.h @@ -7,7 +7,6 @@ enum { DhcpReqReleaseIpAddress, DhcpReqRenewIpAddress, DhcpReqStaticRefreshParams, - DhcpReqGetAdapterInfo, }; typedef struct _COMM_DHCP_REQ { @@ -40,12 +39,6 @@ typedef union _COMM_DHCP_REPLY { DWORD Mtu; DWORD Speed; } QueryHWInfo; - struct { - BOOL DhcpEnabled; - DWORD DhcpServer; - time_t LeaseObtained; - time_t LeaseExpires; - } GetAdapterInfo; } COMM_DHCP_REPLY; #define DHCP_PIPE_NAME L"\\\\.\\pipe\\dhcpclient"