sys, dll: FSP_FSCTL_STOP

This commit is contained in:
Bill Zissimopoulos
2016-02-16 20:37:13 -08:00
parent 8164ebf370
commit 1b533512d3
7 changed files with 42 additions and 9 deletions

View File

@ -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);

View File

@ -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;
}