Author: spetreolle
Date: Thu Mar 11 17:36:11 2010
New Revision: 46099
URL:
http://svn.reactos.org/svn/reactos?rev=46099&view=rev
Log:
[WLANSVC]
Correctly start and report status to the service manager.
Modified:
trunk/reactos/base/services/wlansvc/wlansvc.c
Modified: trunk/reactos/base/services/wlansvc/wlansvc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/wlansvc/wlan…
==============================================================================
--- trunk/reactos/base/services/wlansvc/wlansvc.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/wlansvc/wlansvc.c [iso-8859-1] Thu Mar 11 17:36:11 2010
@@ -21,6 +21,7 @@
SERVICE_STATUS_HANDLE ServiceStatusHandle;
SERVICE_STATUS SvcStatus;
+static WCHAR ServiceName[] = L"WlanSvc";
/* FUNCTIONS *****************************************************************/
static DWORD WINAPI RpcThreadRoutine(LPVOID lpParameter)
@@ -94,13 +95,14 @@
DPRINT("ServiceMain() called\n");
SvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ SvcStatus.dwCurrentState = SERVICE_START_PENDING;
SvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
SvcStatus.dwCheckPoint = 0;
- SvcStatus.dwWin32ExitCode = 0;
+ SvcStatus.dwWin32ExitCode = NO_ERROR;
SvcStatus.dwServiceSpecificExitCode = 0;
SvcStatus.dwWaitHint = 4000;
- ServiceStatusHandle = RegisterServiceCtrlHandlerExW(SERVICE_NAME,
+ ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
ServiceControlHandler,
NULL);
@@ -115,14 +117,14 @@
NULL);
if (!hThread)
+ {
DPRINT("Can't create RpcThread\n");
+ UpdateServiceStatus(ServiceStatusHandle, SERVICE_STOPPED, 0);
+ }
else
{
- WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
-
- UpdateServiceStatus(ServiceStatusHandle, SERVICE_STOPPED, 0);
DPRINT("ServiceMain() done\n");
}
@@ -132,7 +134,7 @@
{
SERVICE_TABLE_ENTRYW ServiceTable[2] =
{
- {SERVICE_NAME, ServiceMain},
+ {ServiceName, ServiceMain},
{NULL, NULL}
};