dll: FspService: console mode testing

This commit is contained in:
Bill Zissimopoulos 2016-05-09 12:35:51 -07:00
parent 0c18b82cc2
commit 89e4e8a96c

View File

@ -290,6 +290,10 @@ FSP_API NTSTATUS FspServiceLoop(FSP_SERVICE *Service)
goto exit; goto exit;
} }
/* quick check to see if service already stopped */
WaitResult = WaitForSingleObject(FspServiceConsoleModeEvent, 0);
if (WAIT_OBJECT_0 != WaitResult)
{
/* set up our console control handler */ /* set up our console control handler */
if (!SetConsoleCtrlHandler(FspServiceConsoleCtrlHandler, TRUE)) if (!SetConsoleCtrlHandler(FspServiceConsoleCtrlHandler, TRUE))
{ {
@ -309,6 +313,7 @@ FSP_API NTSTATUS FspServiceLoop(FSP_SERVICE *Service)
if (Service->AcceptControl & SERVICE_ACCEPT_STOP) if (Service->AcceptControl & SERVICE_ACCEPT_STOP)
FspServiceCtrlHandler(SERVICE_CONTROL_STOP, 0, 0, Service); FspServiceCtrlHandler(SERVICE_CONTROL_STOP, 0, 0, Service);
} }
}
Result = STATUS_SUCCESS; Result = STATUS_SUCCESS;
@ -466,7 +471,7 @@ static DWORD WINAPI FspServiceConsoleModeThread(PVOID Context)
PWSTR *Argv = Context; PWSTR *Argv = Context;
DWORD Argc; DWORD Argc;
for (Argc = 0; 0 != *Argv; Argc++) for (Argc = 0; 0 != *Argv; Argv++, Argc++)
; ;
Service = FspServiceFromTable(); Service = FspServiceFromTable();