mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
sys, dll: FSP_FSCTL_STOP
This commit is contained in:
@ -98,10 +98,6 @@ static DWORD WINAPI FspFileSystemDispatcherThread(PVOID FileSystem0)
|
||||
if (!NT_SUCCESS(Result))
|
||||
goto exit;
|
||||
|
||||
FspFileSystemGetDispatcherResult(FileSystem, &Result);
|
||||
if (!NT_SUCCESS(Result))
|
||||
goto exit;
|
||||
|
||||
memset(Response, 0, sizeof *Response);
|
||||
if (0 == RequestSize)
|
||||
continue;
|
||||
@ -123,10 +119,6 @@ static DWORD WINAPI FspFileSystemDispatcherThread(PVOID FileSystem0)
|
||||
}
|
||||
else
|
||||
Response->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||
|
||||
FspFileSystemGetDispatcherResult(FileSystem, &Result);
|
||||
if (!NT_SUCCESS(Result))
|
||||
goto exit;
|
||||
}
|
||||
|
||||
exit:
|
||||
@ -135,6 +127,8 @@ exit:
|
||||
|
||||
FspFileSystemSetDispatcherResult(FileSystem, Result);
|
||||
|
||||
FspFsctlStop(FileSystem->VolumeHandle);
|
||||
|
||||
if (0 != DispatcherThread)
|
||||
{
|
||||
WaitForSingleObject(DispatcherThread, INFINITE);
|
||||
@ -177,7 +171,7 @@ FSP_API VOID FspFileSystemStopDispatcher(FSP_FILE_SYSTEM *FileSystem)
|
||||
if (0 == FileSystem->DispatcherThread)
|
||||
return;
|
||||
|
||||
FspFileSystemSetDispatcherResult(FileSystem, STATUS_CANCELLED);
|
||||
FspFsctlStop(FileSystem->VolumeHandle);
|
||||
|
||||
WaitForSingleObject(FileSystem->DispatcherThread, INFINITE);
|
||||
CloseHandle(FileSystem->DispatcherThread);
|
||||
|
@ -111,3 +111,11 @@ FSP_API NTSTATUS FspFsctlTransact(HANDLE VolumeHandle,
|
||||
exit:
|
||||
return Result;
|
||||
}
|
||||
|
||||
FSP_API NTSTATUS FspFsctlStop(HANDLE VolumeHandle)
|
||||
{
|
||||
if (!DeviceIoControl(VolumeHandle, FSP_FSCTL_STOP, 0, 0, 0, 0, 0, 0))
|
||||
return FspNtStatusFromWin32(GetLastError());
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user