mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
sys: WIP
This commit is contained in:
parent
552def98aa
commit
d7c43c2f30
@ -75,11 +75,11 @@ DriverEntry(
|
|||||||
FspFastIoDispatch.FastIoUnlockAll = 0;
|
FspFastIoDispatch.FastIoUnlockAll = 0;
|
||||||
FspFastIoDispatch.FastIoUnlockAllByKey = 0;
|
FspFastIoDispatch.FastIoUnlockAllByKey = 0;
|
||||||
FspFastIoDispatch.FastIoDeviceControl = 0;
|
FspFastIoDispatch.FastIoDeviceControl = 0;
|
||||||
FspFastIoDispatch.AcquireFileForNtCreateSection = 0;
|
FspFastIoDispatch.AcquireFileForNtCreateSection = FspAcquireFileForNtCreateSection;
|
||||||
FspFastIoDispatch.ReleaseFileForNtCreateSection = 0;
|
FspFastIoDispatch.ReleaseFileForNtCreateSection = FspReleaseFileForNtCreateSection;
|
||||||
FspFastIoDispatch.FastIoDetachDevice = 0;
|
FspFastIoDispatch.FastIoDetachDevice = 0;
|
||||||
FspFastIoDispatch.FastIoQueryNetworkOpenInfo = 0;
|
FspFastIoDispatch.FastIoQueryNetworkOpenInfo = 0;
|
||||||
FspFastIoDispatch.AcquireForModWrite = 0;
|
FspFastIoDispatch.AcquireForModWrite = FspAcquireForModWrite;
|
||||||
FspFastIoDispatch.MdlRead = FsRtlMdlReadDev;
|
FspFastIoDispatch.MdlRead = FsRtlMdlReadDev;
|
||||||
FspFastIoDispatch.MdlReadComplete = FsRtlMdlReadCompleteDev;
|
FspFastIoDispatch.MdlReadComplete = FsRtlMdlReadCompleteDev;
|
||||||
FspFastIoDispatch.PrepareMdlWrite = FsRtlPrepareMdlWriteDev;
|
FspFastIoDispatch.PrepareMdlWrite = FsRtlPrepareMdlWriteDev;
|
||||||
@ -89,22 +89,11 @@ DriverEntry(
|
|||||||
FspFastIoDispatch.MdlReadCompleteCompressed = 0;
|
FspFastIoDispatch.MdlReadCompleteCompressed = 0;
|
||||||
FspFastIoDispatch.MdlWriteCompleteCompressed = 0;
|
FspFastIoDispatch.MdlWriteCompleteCompressed = 0;
|
||||||
FspFastIoDispatch.FastIoQueryOpen = 0;
|
FspFastIoDispatch.FastIoQueryOpen = 0;
|
||||||
FspFastIoDispatch.ReleaseForModWrite = 0;
|
FspFastIoDispatch.ReleaseForModWrite = FspReleaseForModWrite;
|
||||||
FspFastIoDispatch.AcquireForCcFlush = 0;
|
FspFastIoDispatch.AcquireForCcFlush = FspAcquireForCcFlush;
|
||||||
FspFastIoDispatch.ReleaseForCcFlush = 0;
|
FspFastIoDispatch.ReleaseForCcFlush = FspReleaseForCcFlush;
|
||||||
DriverObject->FastIoDispatch = &FspFastIoDispatch;
|
DriverObject->FastIoDispatch = &FspFastIoDispatch;
|
||||||
|
|
||||||
/* setup filter callbacks */
|
|
||||||
FS_FILTER_CALLBACKS FspFilterCallbacks = { 0 };
|
|
||||||
FspFilterCallbacks.SizeOfFsFilterCallbacks = sizeof FspFilterCallbacks;
|
|
||||||
FspFilterCallbacks.PreAcquireForSectionSynchronization = FspAcquireForSectionSynchronization;
|
|
||||||
Status = FsRtlRegisterFileSystemFilterCallbacks(DriverObject, &FspFilterCallbacks);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
IoDeleteDevice(FspDeviceObject);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* register as a file system; this informs all filter drivers */
|
/* register as a file system; this informs all filter drivers */
|
||||||
IoRegisterFileSystem(FspDeviceObject);
|
IoRegisterFileSystem(FspDeviceObject);
|
||||||
|
|
||||||
|
@ -43,10 +43,12 @@ DRIVER_DISPATCH FspWrite;
|
|||||||
FAST_IO_CHECK_IF_POSSIBLE FspFastIoCheckIfPossible;
|
FAST_IO_CHECK_IF_POSSIBLE FspFastIoCheckIfPossible;
|
||||||
|
|
||||||
/* filter callbacks */
|
/* filter callbacks */
|
||||||
NTSTATUS
|
FAST_IO_ACQUIRE_FILE FspAcquireFileForNtCreateSection;
|
||||||
FspAcquireForSectionSynchronization(
|
FAST_IO_RELEASE_FILE FspReleaseFileForNtCreateSection;
|
||||||
_In_ PFS_FILTER_CALLBACK_DATA Data,
|
FAST_IO_ACQUIRE_FOR_MOD_WRITE FspAcquireForModWrite;
|
||||||
_Out_ PVOID *CompletionContext);
|
FAST_IO_RELEASE_FOR_MOD_WRITE FspReleaseForModWrite;
|
||||||
|
FAST_IO_ACQUIRE_FOR_CCFLUSH FspAcquireForCcFlush;
|
||||||
|
FAST_IO_RELEASE_FOR_CCFLUSH FspReleaseForCcFlush;
|
||||||
|
|
||||||
/* extern */
|
/* extern */
|
||||||
PDEVICE_OBJECT FspDeviceObject;
|
PDEVICE_OBJECT FspDeviceObject;
|
||||||
|
@ -6,22 +6,92 @@
|
|||||||
|
|
||||||
#include <sys/driver.h>
|
#include <sys/driver.h>
|
||||||
|
|
||||||
NTSTATUS
|
FAST_IO_ACQUIRE_FILE FspAcquireFileForNtCreateSection;
|
||||||
FspAcquireForSectionSynchronization(
|
FAST_IO_RELEASE_FILE FspReleaseFileForNtCreateSection;
|
||||||
_In_ PFS_FILTER_CALLBACK_DATA Data,
|
FAST_IO_ACQUIRE_FOR_MOD_WRITE FspAcquireForModWrite;
|
||||||
_Out_ PVOID *CompletionContext);
|
FAST_IO_RELEASE_FOR_MOD_WRITE FspReleaseForModWrite;
|
||||||
|
FAST_IO_ACQUIRE_FOR_CCFLUSH FspAcquireForCcFlush;
|
||||||
|
FAST_IO_RELEASE_FOR_CCFLUSH FspReleaseForCcFlush;
|
||||||
|
|
||||||
#ifdef ALLOC_PRAGMA
|
#ifdef ALLOC_PRAGMA
|
||||||
#pragma alloc_text(PAGE, FspCreate)
|
#pragma alloc_text(PAGE, FspAcquireFileForNtCreateSection)
|
||||||
|
#pragma alloc_text(PAGE, FspReleaseFileForNtCreateSection)
|
||||||
|
#pragma alloc_text(PAGE, FspAcquireForModWrite)
|
||||||
|
#pragma alloc_text(PAGE, FspReleaseForModWrite)
|
||||||
|
#pragma alloc_text(PAGE, FspAcquireForCcFlush)
|
||||||
|
#pragma alloc_text(PAGE, FspReleaseForCcFlush)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NTSTATUS
|
VOID
|
||||||
FspAcquireForSectionSynchronization(
|
FspAcquireFileForNtCreateSection(
|
||||||
_In_ PFS_FILTER_CALLBACK_DATA Data,
|
_In_ PFILE_OBJECT FileObject)
|
||||||
_Out_ PVOID *CompletionContext)
|
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(Data);
|
UNREFERENCED_PARAMETER(FileObject);
|
||||||
UNREFERENCED_PARAMETER(CompletionContext);
|
|
||||||
|
PAGED_CODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FspReleaseFileForNtCreateSection(
|
||||||
|
_In_ PFILE_OBJECT FileObject)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(FileObject);
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
FspAcquireForModWrite(
|
||||||
|
_In_ PFILE_OBJECT FileObject,
|
||||||
|
_In_ PLARGE_INTEGER EndingOffset,
|
||||||
|
_Out_ PERESOURCE *ResourceToRelease,
|
||||||
|
_In_ PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(FileObject);
|
||||||
|
UNREFERENCED_PARAMETER(EndingOffset);
|
||||||
|
UNREFERENCED_PARAMETER(ResourceToRelease);
|
||||||
|
UNREFERENCED_PARAMETER(DeviceObject);
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
FspReleaseForModWrite(
|
||||||
|
_In_ PFILE_OBJECT FileObject,
|
||||||
|
_In_ PERESOURCE ResourceToRelease,
|
||||||
|
_In_ PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(FileObject);
|
||||||
|
UNREFERENCED_PARAMETER(ResourceToRelease);
|
||||||
|
UNREFERENCED_PARAMETER(DeviceObject);
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
FspAcquireForCcFlush(
|
||||||
|
_In_ PFILE_OBJECT FileObject,
|
||||||
|
_In_ PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(FileObject);
|
||||||
|
UNREFERENCED_PARAMETER(DeviceObject);
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
FspReleaseForCcFlush(
|
||||||
|
_In_ PFILE_OBJECT FileObject,
|
||||||
|
_In_ PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(FileObject);
|
||||||
|
UNREFERENCED_PARAMETER(DeviceObject);
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user