mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:56:00 +00:00
[DHCPCSVC]
- Code formatting - Move ROS service functionalities from BSD module to where it really belongs. svn path=/trunk/; revision=64291
This commit is contained in:
parent
52858fdcec
commit
12afcc85bd
3 changed files with 214 additions and 183 deletions
|
@ -55,8 +55,6 @@
|
||||||
|
|
||||||
#include <rosdhcp.h>
|
#include <rosdhcp.h>
|
||||||
|
|
||||||
#include <winsvc.h>
|
|
||||||
|
|
||||||
#define PERIOD 0x2e
|
#define PERIOD 0x2e
|
||||||
#define hyphenchar(c) ((c) == 0x2d)
|
#define hyphenchar(c) ((c) == 0x2d)
|
||||||
#define bslashchar(c) ((c) == 0x5c)
|
#define bslashchar(c) ((c) == 0x5c)
|
||||||
|
@ -108,95 +106,10 @@ int check_arp( struct interface_info *ip, struct client_lease *lp )
|
||||||
|
|
||||||
time_t scripttime;
|
time_t scripttime;
|
||||||
|
|
||||||
static WCHAR ServiceName[] = L"DHCP";
|
|
||||||
|
|
||||||
SERVICE_STATUS_HANDLE ServiceStatusHandle = 0;
|
int
|
||||||
SERVICE_STATUS ServiceStatus;
|
init_client(void)
|
||||||
|
|
||||||
|
|
||||||
/* XXX Implement me */
|
|
||||||
int check_arp( struct interface_info *ip, struct client_lease *lp ) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
|
||||||
UpdateServiceStatus(DWORD dwState)
|
|
||||||
{
|
{
|
||||||
ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
|
||||||
ServiceStatus.dwCurrentState = dwState;
|
|
||||||
|
|
||||||
ServiceStatus.dwControlsAccepted = 0;
|
|
||||||
|
|
||||||
ServiceStatus.dwWin32ExitCode = 0;
|
|
||||||
ServiceStatus.dwServiceSpecificExitCode = 0;
|
|
||||||
ServiceStatus.dwCheckPoint = 0;
|
|
||||||
|
|
||||||
if (dwState == SERVICE_START_PENDING ||
|
|
||||||
dwState == SERVICE_STOP_PENDING ||
|
|
||||||
dwState == SERVICE_PAUSE_PENDING ||
|
|
||||||
dwState == SERVICE_CONTINUE_PENDING)
|
|
||||||
ServiceStatus.dwWaitHint = 10000;
|
|
||||||
else
|
|
||||||
ServiceStatus.dwWaitHint = 0;
|
|
||||||
|
|
||||||
SetServiceStatus(ServiceStatusHandle,
|
|
||||||
&ServiceStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static DWORD WINAPI
|
|
||||||
ServiceControlHandler(DWORD dwControl,
|
|
||||||
DWORD dwEventType,
|
|
||||||
LPVOID lpEventData,
|
|
||||||
LPVOID lpContext)
|
|
||||||
{
|
|
||||||
switch (dwControl)
|
|
||||||
{
|
|
||||||
case SERVICE_CONTROL_STOP:
|
|
||||||
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
|
||||||
UpdateServiceStatus(SERVICE_STOPPED);
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
|
|
||||||
case SERVICE_CONTROL_PAUSE:
|
|
||||||
UpdateServiceStatus(SERVICE_PAUSED);
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
|
|
||||||
case SERVICE_CONTROL_CONTINUE:
|
|
||||||
UpdateServiceStatus(SERVICE_START_PENDING);
|
|
||||||
UpdateServiceStatus(SERVICE_RUNNING);
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
|
|
||||||
case SERVICE_CONTROL_INTERROGATE:
|
|
||||||
SetServiceStatus(ServiceStatusHandle,
|
|
||||||
&ServiceStatus);
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
|
|
||||||
case SERVICE_CONTROL_SHUTDOWN:
|
|
||||||
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
|
||||||
UpdateServiceStatus(SERVICE_STOPPED);
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
|
|
||||||
default :
|
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID NTAPI
|
|
||||||
ServiceMain(DWORD argc, LPWSTR *argv)
|
|
||||||
{
|
|
||||||
ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
|
|
||||||
ServiceControlHandler,
|
|
||||||
NULL);
|
|
||||||
if (!ServiceStatusHandle)
|
|
||||||
{
|
|
||||||
DbgPrint("DHCPCSVC: Unable to register service control handler (%lx)\n", GetLastError());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateServiceStatus(SERVICE_START_PENDING);
|
|
||||||
|
|
||||||
ApiInit();
|
ApiInit();
|
||||||
AdapterInit();
|
AdapterInit();
|
||||||
|
|
||||||
|
@ -214,26 +127,23 @@ ServiceMain(DWORD argc, LPWSTR *argv)
|
||||||
DbgPrint("DHCPCSVC: PipeInit() failed!\n");
|
DbgPrint("DHCPCSVC: PipeInit() failed!\n");
|
||||||
AdapterStop();
|
AdapterStop();
|
||||||
ApiFree();
|
ApiFree();
|
||||||
UpdateServiceStatus(SERVICE_STOPPED);
|
return 0; // FALSE
|
||||||
}
|
}
|
||||||
|
|
||||||
DH_DbgPrint(MID_TRACE,("DHCP Service Started\n"));
|
return 1; // TRUE
|
||||||
|
}
|
||||||
|
|
||||||
UpdateServiceStatus(SERVICE_RUNNING);
|
void
|
||||||
|
stop_client(void)
|
||||||
DH_DbgPrint(MID_TRACE,("Going into dispatch()\n"));
|
{
|
||||||
|
// AdapterStop();
|
||||||
DH_DbgPrint(MID_TRACE, ("DHCPCSVC: DHCP service is starting up\n"));
|
// ApiFree();
|
||||||
|
|
||||||
dispatch();
|
|
||||||
|
|
||||||
DbgPrint("DHCPCSVC: DHCP service is shutting down\n");
|
|
||||||
|
|
||||||
//AdapterStop();
|
|
||||||
//ApiFree();
|
|
||||||
/* FIXME: Close pipe and kill pipe thread */
|
/* FIXME: Close pipe and kill pipe thread */
|
||||||
|
}
|
||||||
|
|
||||||
UpdateServiceStatus(SERVICE_STOPPED);
|
/* XXX Implement me */
|
||||||
|
int check_arp( struct interface_info *ip, struct client_lease *lp ) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -7,18 +7,30 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rosdhcp.h>
|
#include <rosdhcp.h>
|
||||||
|
#include <winsvc.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
static WCHAR ServiceName[] = L"DHCP";
|
||||||
|
|
||||||
|
SERVICE_STATUS_HANDLE ServiceStatusHandle = 0;
|
||||||
|
SERVICE_STATUS ServiceStatus;
|
||||||
|
|
||||||
static HANDLE PipeHandle = INVALID_HANDLE_VALUE;
|
static HANDLE PipeHandle = INVALID_HANDLE_VALUE;
|
||||||
|
|
||||||
DWORD APIENTRY DhcpCApiInitialize(LPDWORD Version) {
|
DWORD APIENTRY
|
||||||
|
DhcpCApiInitialize(LPDWORD Version)
|
||||||
|
{
|
||||||
DWORD PipeMode;
|
DWORD PipeMode;
|
||||||
|
|
||||||
/* Wait for the pipe to be available */
|
/* Wait for the pipe to be available */
|
||||||
if (WaitNamedPipeW(DHCP_PIPE_NAME, NMPWAIT_USE_DEFAULT_WAIT))
|
if (!WaitNamedPipeW(DHCP_PIPE_NAME, NMPWAIT_USE_DEFAULT_WAIT))
|
||||||
{
|
{
|
||||||
|
/* No good, we failed */
|
||||||
|
return GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
/* It's available, let's try to open it */
|
/* It's available, let's try to open it */
|
||||||
PipeHandle = CreateFileW(DHCP_PIPE_NAME,
|
PipeHandle = CreateFileW(DHCP_PIPE_NAME,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
|
@ -34,8 +46,7 @@ DWORD APIENTRY DhcpCApiInitialize(LPDWORD Version) {
|
||||||
/* We didn't */
|
/* We didn't */
|
||||||
return GetLastError();
|
return GetLastError();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Change the pipe into message mode */
|
/* Change the pipe into message mode */
|
||||||
PipeMode = PIPE_READMODE_MESSAGE;
|
PipeMode = PIPE_READMODE_MESSAGE;
|
||||||
if (!SetNamedPipeHandleState(PipeHandle, &PipeMode, NULL, NULL))
|
if (!SetNamedPipeHandleState(PipeHandle, &PipeMode, NULL, NULL))
|
||||||
|
@ -51,24 +62,21 @@ DWORD APIENTRY DhcpCApiInitialize(LPDWORD Version) {
|
||||||
*Version = 2;
|
*Version = 2;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* No good, we failed */
|
|
||||||
return GetLastError();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID APIENTRY DhcpCApiCleanup() {
|
VOID APIENTRY
|
||||||
|
DhcpCApiCleanup(VOID)
|
||||||
|
{
|
||||||
CloseHandle(PipeHandle);
|
CloseHandle(PipeHandle);
|
||||||
PipeHandle = INVALID_HANDLE_VALUE;
|
PipeHandle = INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex,
|
DWORD APIENTRY
|
||||||
|
DhcpQueryHWInfo(DWORD AdapterIndex,
|
||||||
PDWORD MediaType,
|
PDWORD MediaType,
|
||||||
PDWORD Mtu,
|
PDWORD Mtu,
|
||||||
PDWORD Speed ) {
|
PDWORD Speed)
|
||||||
|
{
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
COMM_DHCP_REPLY Reply;
|
||||||
DWORD BytesRead;
|
DWORD BytesRead;
|
||||||
|
@ -89,16 +97,18 @@ DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !Reply.Reply ) return 0;
|
if (Reply.Reply == 0)
|
||||||
else {
|
return 0;
|
||||||
|
|
||||||
*MediaType = Reply.QueryHWInfo.MediaType;
|
*MediaType = Reply.QueryHWInfo.MediaType;
|
||||||
*Mtu = Reply.QueryHWInfo.Mtu;
|
*Mtu = Reply.QueryHWInfo.Mtu;
|
||||||
*Speed = Reply.QueryHWInfo.Speed;
|
*Speed = Reply.QueryHWInfo.Speed;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD APIENTRY DhcpLeaseIpAddress( DWORD AdapterIndex ) {
|
DWORD APIENTRY
|
||||||
|
DhcpLeaseIpAddress(DWORD AdapterIndex)
|
||||||
|
{
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
COMM_DHCP_REPLY Reply;
|
||||||
DWORD BytesRead;
|
DWORD BytesRead;
|
||||||
|
@ -122,7 +132,9 @@ DWORD APIENTRY DhcpLeaseIpAddress( DWORD AdapterIndex ) {
|
||||||
return Reply.Reply;
|
return Reply.Reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD APIENTRY DhcpReleaseIpAddressLease( DWORD AdapterIndex ) {
|
DWORD APIENTRY
|
||||||
|
DhcpReleaseIpAddressLease(DWORD AdapterIndex)
|
||||||
|
{
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
COMM_DHCP_REPLY Reply;
|
||||||
DWORD BytesRead;
|
DWORD BytesRead;
|
||||||
|
@ -146,7 +158,9 @@ DWORD APIENTRY DhcpReleaseIpAddressLease( DWORD AdapterIndex ) {
|
||||||
return Reply.Reply;
|
return Reply.Reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD APIENTRY DhcpRenewIpAddressLease( DWORD AdapterIndex ) {
|
DWORD APIENTRY
|
||||||
|
DhcpRenewIpAddressLease(DWORD AdapterIndex)
|
||||||
|
{
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
COMM_DHCP_REPLY Reply;
|
||||||
DWORD BytesRead;
|
DWORD BytesRead;
|
||||||
|
@ -170,9 +184,11 @@ DWORD APIENTRY DhcpRenewIpAddressLease( DWORD AdapterIndex ) {
|
||||||
return Reply.Reply;
|
return Reply.Reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD APIENTRY DhcpStaticRefreshParams( DWORD AdapterIndex,
|
DWORD APIENTRY
|
||||||
|
DhcpStaticRefreshParams(DWORD AdapterIndex,
|
||||||
DWORD Address,
|
DWORD Address,
|
||||||
DWORD Netmask ) {
|
DWORD Netmask)
|
||||||
|
{
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
COMM_DHCP_REPLY Reply;
|
||||||
DWORD BytesRead;
|
DWORD BytesRead;
|
||||||
|
@ -232,9 +248,9 @@ DhcpNotifyConfigChange(LPWSTR ServerName,
|
||||||
DWORD IpIndex,
|
DWORD IpIndex,
|
||||||
DWORD IpAddress,
|
DWORD IpAddress,
|
||||||
DWORD SubnetMask,
|
DWORD SubnetMask,
|
||||||
int DhcpAction)
|
INT DhcpAction)
|
||||||
{
|
{
|
||||||
DbgPrint("DHCPCSVC: DhcpNotifyConfigChange not implemented yet\n");
|
DPRINT1("DHCPCSVC: DhcpNotifyConfigChange not implemented yet\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,11 +278,12 @@ DhcpNotifyConfigChange(LPWSTR ServerName,
|
||||||
*
|
*
|
||||||
* \remarks This is a ReactOS-only routine
|
* \remarks This is a ReactOS-only routine
|
||||||
*/
|
*/
|
||||||
DWORD APIENTRY DhcpRosGetAdapterInfo( DWORD AdapterIndex,
|
DWORD APIENTRY
|
||||||
|
DhcpRosGetAdapterInfo(DWORD AdapterIndex,
|
||||||
PBOOL DhcpEnabled,
|
PBOOL DhcpEnabled,
|
||||||
PDWORD DhcpServer,
|
PDWORD DhcpServer,
|
||||||
time_t *LeaseObtained,
|
time_t* LeaseObtained,
|
||||||
time_t *LeaseExpires )
|
time_t* LeaseExpires)
|
||||||
{
|
{
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
COMM_DHCP_REPLY Reply;
|
||||||
|
@ -283,16 +300,19 @@ DWORD APIENTRY DhcpRosGetAdapterInfo( DWORD AdapterIndex,
|
||||||
&Reply, sizeof(Reply),
|
&Reply, sizeof(Reply),
|
||||||
&BytesRead, NULL);
|
&BytesRead, NULL);
|
||||||
|
|
||||||
if ( 0 != Result && 0 != Reply.Reply ) {
|
if (Result && Reply.Reply != 0)
|
||||||
*DhcpEnabled = Reply.GetAdapterInfo.DhcpEnabled;
|
*DhcpEnabled = Reply.GetAdapterInfo.DhcpEnabled;
|
||||||
} else {
|
else
|
||||||
*DhcpEnabled = FALSE;
|
*DhcpEnabled = FALSE;
|
||||||
}
|
|
||||||
if ( *DhcpEnabled ) {
|
if (*DhcpEnabled)
|
||||||
|
{
|
||||||
*DhcpServer = Reply.GetAdapterInfo.DhcpServer;
|
*DhcpServer = Reply.GetAdapterInfo.DhcpServer;
|
||||||
*LeaseObtained = Reply.GetAdapterInfo.LeaseObtained;
|
*LeaseObtained = Reply.GetAdapterInfo.LeaseObtained;
|
||||||
*LeaseExpires = Reply.GetAdapterInfo.LeaseExpires;
|
*LeaseExpires = Reply.GetAdapterInfo.LeaseExpires;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
*DhcpServer = INADDR_NONE;
|
*DhcpServer = INADDR_NONE;
|
||||||
*LeaseObtained = 0;
|
*LeaseObtained = 0;
|
||||||
*LeaseExpires = 0;
|
*LeaseExpires = 0;
|
||||||
|
@ -301,6 +321,104 @@ DWORD APIENTRY DhcpRosGetAdapterInfo( DWORD AdapterIndex,
|
||||||
return Reply.Reply;
|
return Reply.Reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
UpdateServiceStatus(DWORD dwState)
|
||||||
|
{
|
||||||
|
ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
||||||
|
ServiceStatus.dwCurrentState = dwState;
|
||||||
|
|
||||||
|
ServiceStatus.dwControlsAccepted = 0;
|
||||||
|
|
||||||
|
ServiceStatus.dwWin32ExitCode = 0;
|
||||||
|
ServiceStatus.dwServiceSpecificExitCode = 0;
|
||||||
|
ServiceStatus.dwCheckPoint = 0;
|
||||||
|
|
||||||
|
if (dwState == SERVICE_START_PENDING ||
|
||||||
|
dwState == SERVICE_STOP_PENDING ||
|
||||||
|
dwState == SERVICE_PAUSE_PENDING ||
|
||||||
|
dwState == SERVICE_CONTINUE_PENDING)
|
||||||
|
ServiceStatus.dwWaitHint = 10000;
|
||||||
|
else
|
||||||
|
ServiceStatus.dwWaitHint = 0;
|
||||||
|
|
||||||
|
SetServiceStatus(ServiceStatusHandle,
|
||||||
|
&ServiceStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD WINAPI
|
||||||
|
ServiceControlHandler(DWORD dwControl,
|
||||||
|
DWORD dwEventType,
|
||||||
|
LPVOID lpEventData,
|
||||||
|
LPVOID lpContext)
|
||||||
|
{
|
||||||
|
switch (dwControl)
|
||||||
|
{
|
||||||
|
case SERVICE_CONTROL_STOP:
|
||||||
|
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
||||||
|
UpdateServiceStatus(SERVICE_STOPPED);
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
case SERVICE_CONTROL_PAUSE:
|
||||||
|
UpdateServiceStatus(SERVICE_PAUSED);
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
case SERVICE_CONTROL_CONTINUE:
|
||||||
|
UpdateServiceStatus(SERVICE_START_PENDING);
|
||||||
|
UpdateServiceStatus(SERVICE_RUNNING);
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
case SERVICE_CONTROL_INTERROGATE:
|
||||||
|
SetServiceStatus(ServiceStatusHandle,
|
||||||
|
&ServiceStatus);
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
case SERVICE_CONTROL_SHUTDOWN:
|
||||||
|
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
||||||
|
UpdateServiceStatus(SERVICE_STOPPED);
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
default :
|
||||||
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID WINAPI
|
||||||
|
ServiceMain(DWORD argc, LPWSTR* argv)
|
||||||
|
{
|
||||||
|
ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
|
||||||
|
ServiceControlHandler,
|
||||||
|
NULL);
|
||||||
|
if (!ServiceStatusHandle)
|
||||||
|
{
|
||||||
|
DPRINT1("DHCPCSVC: Unable to register service control handler (%lx)\n", GetLastError());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateServiceStatus(SERVICE_START_PENDING);
|
||||||
|
|
||||||
|
if (!init_client())
|
||||||
|
{
|
||||||
|
DPRINT1("DHCPCSVC: init_client() failed!\n");
|
||||||
|
UpdateServiceStatus(SERVICE_STOPPED);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DH_DbgPrint(MID_TRACE,("DHCP Service Started\n"));
|
||||||
|
|
||||||
|
UpdateServiceStatus(SERVICE_RUNNING);
|
||||||
|
|
||||||
|
DH_DbgPrint(MID_TRACE,("Going into dispatch()\n"));
|
||||||
|
DH_DbgPrint(MID_TRACE,("DHCPCSVC: DHCP service is starting up\n"));
|
||||||
|
|
||||||
|
dispatch();
|
||||||
|
|
||||||
|
DH_DbgPrint(MID_TRACE,("DHCPCSVC: DHCP service is shutting down\n"));
|
||||||
|
stop_client();
|
||||||
|
|
||||||
|
UpdateServiceStatus(SERVICE_STOPPED);
|
||||||
|
}
|
||||||
|
|
||||||
INT WINAPI
|
INT WINAPI
|
||||||
DllMain(PVOID hinstDll,
|
DllMain(PVOID hinstDll,
|
||||||
ULONG dwReason,
|
ULONG dwReason,
|
||||||
|
|
|
@ -81,6 +81,9 @@ typedef DWORD (*PipeSendFunc)( COMM_DHCP_REPLY *Reply );
|
||||||
#define random rand
|
#define random rand
|
||||||
#define srandom srand
|
#define srandom srand
|
||||||
|
|
||||||
|
int init_client(void);
|
||||||
|
void stop_client(void);
|
||||||
|
|
||||||
void AdapterInit(VOID);
|
void AdapterInit(VOID);
|
||||||
HANDLE StartAdapterDiscovery(VOID);
|
HANDLE StartAdapterDiscovery(VOID);
|
||||||
void AdapterStop(VOID);
|
void AdapterStop(VOID);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue