mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
launcher: AllocConsole if we are running as a service without one (DETACHED_PROCESS)
This commit is contained in:
parent
1a7d3b8f9e
commit
22d1f86ac1
@ -608,6 +608,13 @@ static NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
||||
{
|
||||
SECURITY_ATTRIBUTES SecurityAttributes = { 0 };
|
||||
|
||||
/*
|
||||
* Allocate a console in case we are running as a service without one.
|
||||
* This will ensure that we can send console control events to service instances.
|
||||
*/
|
||||
if (AllocConsole())
|
||||
ShowWindow(GetConsoleWindow(), SW_HIDE);
|
||||
|
||||
InitializeCriticalSection(&SvcInstanceLock);
|
||||
|
||||
SecurityAttributes.nLength = sizeof SecurityAttributes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user