mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-25 01:42:24 -05:00
dll, sys: WIP
This commit is contained in:
parent
76af18e4d0
commit
567cf3e8eb
@ -33,8 +33,7 @@ FSP_API NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath,
|
|||||||
GlobalDevicePath(DevicePathBuf, sizeof DevicePathBuf, DevicePath);
|
GlobalDevicePath(DevicePathBuf, sizeof DevicePathBuf, DevicePath);
|
||||||
|
|
||||||
SecurityDescriptorSize = 0;
|
SecurityDescriptorSize = 0;
|
||||||
if (!MakeSelfRelativeSD(SecurityDescriptor, 0, &SecurityDescriptorSize))
|
MakeSelfRelativeSD(SecurityDescriptor, 0, &SecurityDescriptorSize);
|
||||||
{
|
|
||||||
ParamsBuf = malloc(sizeof *ParamsBuf + SecurityDescriptorSize);
|
ParamsBuf = malloc(sizeof *ParamsBuf + SecurityDescriptorSize);
|
||||||
if (0 == ParamsBuf)
|
if (0 == ParamsBuf)
|
||||||
{
|
{
|
||||||
@ -48,7 +47,6 @@ FSP_API NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
*ParamsBuf = *Params;
|
*ParamsBuf = *Params;
|
||||||
}
|
|
||||||
|
|
||||||
DeviceHandle = CreateFileW(DevicePathBuf,
|
DeviceHandle = CreateFileW(DevicePathBuf,
|
||||||
0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, 0, 0);
|
0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, 0, 0);
|
||||||
|
@ -295,7 +295,7 @@ NTSTATUS FspCreateDeviceObjectList(
|
|||||||
PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT **PDeviceObjects, PULONG PDeviceObjectCount);
|
PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT **PDeviceObjects, PULONG PDeviceObjectCount);
|
||||||
VOID FspDeleteDeviceObjectList(
|
VOID FspDeleteDeviceObjectList(
|
||||||
PDEVICE_OBJECT *DeviceObjects, ULONG DeviceObjectCount);
|
PDEVICE_OBJECT *DeviceObjects, ULONG DeviceObjectCount);
|
||||||
NTSTATUS FspHasDeviceObject(
|
NTSTATUS FspLookupDeviceObject(
|
||||||
PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject);
|
PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject);
|
||||||
|
|
||||||
/* debug */
|
/* debug */
|
||||||
|
@ -108,10 +108,10 @@ static NTSTATUS FspFsctlMountVolume(
|
|||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
NTSTATUS Result;
|
NTSTATUS Result;
|
||||||
PDEVICE_OBJECT RealDevice = IrpSp->Parameters.MountVolume.DeviceObject;
|
PDEVICE_OBJECT RealDevice = IrpSp->Parameters.MountVolume.Vpb->RealDevice;
|
||||||
|
|
||||||
/* check the passed in volume object; it must be one of our own */
|
/* check the passed in volume object; it must be one of our own */
|
||||||
Result = FspHasDeviceObject(DeviceObject->DriverObject, RealDevice);
|
Result = FspLookupDeviceObject(DeviceObject->DriverObject, RealDevice);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
if (STATUS_NO_SUCH_DEVICE == Result)
|
if (STATUS_NO_SUCH_DEVICE == Result)
|
||||||
|
@ -83,7 +83,7 @@ VOID FspDeleteDeviceObjectList(
|
|||||||
ExFreePoolWithTag(DeviceObjects, FSP_TAG);
|
ExFreePoolWithTag(DeviceObjects, FSP_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS FspHasDeviceObject(
|
NTSTATUS FspLookupDeviceObject(
|
||||||
PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject)
|
PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject)
|
||||||
{
|
{
|
||||||
NTSTATUS Result = STATUS_NO_SUCH_DEVICE;
|
NTSTATUS Result = STATUS_NO_SUCH_DEVICE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user