From 8dd5a03b515b9842a1f07fe58fddbc1740360827 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sat, 7 May 2016 13:30:12 -0700 Subject: [PATCH] dll: FSP_SERVICE: rename interactive mode to console mode --- inc/winfsp/winfsp.h | 6 +++--- src/dll/service.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/inc/winfsp/winfsp.h b/inc/winfsp/winfsp.h index 451a4fed..75bd629b 100644 --- a/inc/winfsp/winfsp.h +++ b/inc/winfsp/winfsp.h @@ -859,8 +859,8 @@ typedef struct _FSP_SERVICE SERVICE_STATUS_HANDLE StatusHandle; CRITICAL_SECTION ServiceStatusGuard; SERVICE_STATUS ServiceStatus; - BOOLEAN AllowInteractive; - HANDLE InteractiveEvent; + BOOLEAN AllowConsoleMode; + HANDLE ConsoleModeEvent; WCHAR ServiceName[]; } FSP_SERVICE; #pragma warning(pop) @@ -870,7 +870,7 @@ FSP_API NTSTATUS FspServiceCreate(PWSTR ServiceName, FSP_SERVICE_CONTROL *OnControl, FSP_SERVICE **PService); FSP_API VOID FspServiceDelete(FSP_SERVICE *Service); -FSP_API VOID FspServiceAllowInteractive(FSP_SERVICE *Service); +FSP_API VOID FspServiceAllowConsoleMode(FSP_SERVICE *Service); FSP_API VOID FspServiceAcceptControl(FSP_SERVICE *Service, ULONG Control); FSP_API VOID FspServiceRequestTime(FSP_SERVICE *Service, ULONG Time); FSP_API VOID FspServiceSetExitCode(FSP_SERVICE *Service, ULONG ExitCode); diff --git a/src/dll/service.c b/src/dll/service.c index d536495e..b60bac65 100644 --- a/src/dll/service.c +++ b/src/dll/service.c @@ -92,8 +92,8 @@ FSP_API NTSTATUS FspServiceCreate(PWSTR ServiceName, FSP_API VOID FspServiceDelete(FSP_SERVICE *Service) { - if (0 != Service->InteractiveEvent) - CloseHandle(Service->InteractiveEvent); + if (0 != Service->ConsoleModeEvent) + CloseHandle(Service->ConsoleModeEvent); DeleteCriticalSection(&Service->ServiceStatusGuard); MemFree(Service); @@ -137,10 +137,10 @@ static VOID FspServiceSetStatus(FSP_SERVICE *Service, ULONG Flags, SERVICE_STATU FspEventLog(EVENTLOG_ERROR_TYPE, L"" __FUNCTION__ ": error = %ld", GetLastError()); } - else if (0 != Service->InteractiveEvent && + else if (0 != Service->ConsoleModeEvent && SERVICE_STOPPED == Service->ServiceStatus.dwCurrentState) { - SetEvent(Service->InteractiveEvent); + SetEvent(Service->ConsoleModeEvent); } LeaveCriticalSection(&Service->ServiceStatusGuard); @@ -148,9 +148,9 @@ static VOID FspServiceSetStatus(FSP_SERVICE *Service, ULONG Flags, SERVICE_STATU #undef XCHG } -FSP_API VOID FspServiceAllowInteractive(FSP_SERVICE *Service) +FSP_API VOID FspServiceAllowConsoleMode(FSP_SERVICE *Service) { - Service->AllowInteractive = TRUE; + Service->AllowConsoleMode = TRUE; } FSP_API VOID FspServiceAcceptControl(FSP_SERVICE *Service, ULONG Control) @@ -199,19 +199,19 @@ FSP_API NTSTATUS FspServiceRun(FSP_SERVICE *Service) DWORD LastError; LastError = GetLastError(); - if (!Service->AllowInteractive || ERROR_FAILED_SERVICE_CONTROLLER_CONNECT != LastError) + if (!Service->AllowConsoleMode || ERROR_FAILED_SERVICE_CONTROLLER_CONNECT != LastError) return FspNtStatusFromWin32(LastError); - /* enter INTERACTIVE mode! */ + /* enter console mode! */ - if (0 == Service->InteractiveEvent) + if (0 == Service->ConsoleModeEvent) { - Service->InteractiveEvent = CreateEventW(0, TRUE, FALSE, 0); - if (0 == Service->InteractiveEvent) + Service->ConsoleModeEvent = CreateEventW(0, TRUE, FALSE, 0); + if (0 == Service->ConsoleModeEvent) return FspNtStatusFromWin32(GetLastError()); } else - ResetEvent(Service->InteractiveEvent); + ResetEvent(Service->ConsoleModeEvent); /* create a thread to mimic what StartServiceCtrlDispatcherW does */ Thread = CreateThread(0, 0, FspServiceInteractiveThread, Service, 0, 0); @@ -225,7 +225,7 @@ FSP_API NTSTATUS FspServiceRun(FSP_SERVICE *Service) if (!SetConsoleCtrlHandler(FspServiceConsoleCtrlHandler, TRUE)) return FspNtStatusFromWin32(GetLastError()); - WaitResult = WaitForSingleObject(Service->InteractiveEvent, INFINITE); + WaitResult = WaitForSingleObject(Service->ConsoleModeEvent, INFINITE); if (WAIT_OBJECT_0 != WaitResult) return FspNtStatusFromWin32(GetLastError()); }