mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
dll: FspFileSystemRegister: handle the case where service already exists better
This commit is contained in:
parent
3f7ebe7996
commit
a99e8ac9d2
12
src/dll/fs.c
12
src/dll/fs.c
@ -411,14 +411,12 @@ NTSTATUS FspFileSystemRegister(VOID)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
SvcHandle = OpenServiceW(ScmHandle, DriverName, DELETE);
|
SvcHandle = OpenServiceW(ScmHandle, DriverName, SERVICE_CHANGE_CONFIG);
|
||||||
if (0 != SvcHandle)
|
if (0 != SvcHandle)
|
||||||
{
|
ChangeServiceConfigW(SvcHandle,
|
||||||
DeleteService(SvcHandle);
|
SERVICE_FILE_SYSTEM_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, DriverPath,
|
||||||
CloseServiceHandle(SvcHandle);
|
0, 0, 0, 0, 0, DriverName);
|
||||||
SvcHandle = 0;
|
else
|
||||||
}
|
|
||||||
|
|
||||||
SvcHandle = CreateServiceW(ScmHandle, DriverName, DriverName,
|
SvcHandle = CreateServiceW(ScmHandle, DriverName, DriverName,
|
||||||
SERVICE_CHANGE_CONFIG,
|
SERVICE_CHANGE_CONFIG,
|
||||||
SERVICE_FILE_SYSTEM_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, DriverPath,
|
SERVICE_FILE_SYSTEM_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, DriverPath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user