mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-25 01:42:24 -05:00
sys: FspDeviceCreateSecure: add DeviceCharacteristics parameter
This commit is contained in:
parent
e973274d1c
commit
f3c6609308
@ -7,11 +7,11 @@
|
|||||||
#include <sys/driver.h>
|
#include <sys/driver.h>
|
||||||
|
|
||||||
NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
||||||
PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType,
|
PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics,
|
||||||
PUNICODE_STRING DeviceSddl, LPCGUID DeviceClassGuid,
|
PUNICODE_STRING DeviceSddl, LPCGUID DeviceClassGuid,
|
||||||
PDEVICE_OBJECT *PDeviceObject);
|
PDEVICE_OBJECT *PDeviceObject);
|
||||||
NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
||||||
DEVICE_TYPE DeviceType,
|
DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics,
|
||||||
PDEVICE_OBJECT *PDeviceObject);
|
PDEVICE_OBJECT *PDeviceObject);
|
||||||
NTSTATUS FspDeviceInitialize(PDEVICE_OBJECT DeviceObject);
|
NTSTATUS FspDeviceInitialize(PDEVICE_OBJECT DeviceObject);
|
||||||
VOID FspDeviceDelete(PDEVICE_OBJECT DeviceObject);
|
VOID FspDeviceDelete(PDEVICE_OBJECT DeviceObject);
|
||||||
@ -97,7 +97,7 @@ VOID FspDeviceDeleteAll(VOID);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
||||||
PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType,
|
PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics,
|
||||||
PUNICODE_STRING DeviceSddl, LPCGUID DeviceClassGuid,
|
PUNICODE_STRING DeviceSddl, LPCGUID DeviceClassGuid,
|
||||||
PDEVICE_OBJECT *PDeviceObject)
|
PDEVICE_OBJECT *PDeviceObject)
|
||||||
{
|
{
|
||||||
@ -127,13 +127,13 @@ NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
|||||||
if (0 != DeviceSddl)
|
if (0 != DeviceSddl)
|
||||||
Result = IoCreateDeviceSecure(FspDriverObject,
|
Result = IoCreateDeviceSecure(FspDriverObject,
|
||||||
DeviceExtensionSize + ExtraSize, DeviceName, DeviceType,
|
DeviceExtensionSize + ExtraSize, DeviceName, DeviceType,
|
||||||
FILE_DEVICE_SECURE_OPEN, FALSE,
|
DeviceCharacteristics, FALSE,
|
||||||
DeviceSddl, DeviceClassGuid,
|
DeviceSddl, DeviceClassGuid,
|
||||||
&DeviceObject);
|
&DeviceObject);
|
||||||
else
|
else
|
||||||
Result = IoCreateDevice(FspDriverObject,
|
Result = IoCreateDevice(FspDriverObject,
|
||||||
DeviceExtensionSize + ExtraSize, DeviceName, DeviceType,
|
DeviceExtensionSize + ExtraSize, DeviceName, DeviceType,
|
||||||
0, FALSE,
|
DeviceCharacteristics, FALSE,
|
||||||
&DeviceObject);
|
&DeviceObject);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
@ -149,12 +149,13 @@ NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
||||||
DEVICE_TYPE DeviceType,
|
DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics,
|
||||||
PDEVICE_OBJECT *PDeviceObject)
|
PDEVICE_OBJECT *PDeviceObject)
|
||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
return FspDeviceCreateSecure(Kind, ExtraSize, 0, DeviceType, 0, 0, PDeviceObject);
|
return FspDeviceCreateSecure(Kind, ExtraSize, 0, DeviceType, DeviceCharacteristics,
|
||||||
|
0, 0, PDeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS FspDeviceInitialize(PDEVICE_OBJECT DeviceObject)
|
NTSTATUS FspDeviceInitialize(PDEVICE_OBJECT DeviceObject)
|
||||||
|
@ -43,14 +43,14 @@ NTSTATUS DriverEntry(
|
|||||||
RtlInitUnicodeString(&DeviceSddl, L"" FSP_FSCTL_DEVICE_SDDL);
|
RtlInitUnicodeString(&DeviceSddl, L"" FSP_FSCTL_DEVICE_SDDL);
|
||||||
RtlInitUnicodeString(&DeviceName, L"\\Device\\" FSP_FSCTL_DISK_DEVICE_NAME);
|
RtlInitUnicodeString(&DeviceName, L"\\Device\\" FSP_FSCTL_DISK_DEVICE_NAME);
|
||||||
Result = FspDeviceCreateSecure(FspFsctlDeviceExtensionKind, 0,
|
Result = FspDeviceCreateSecure(FspFsctlDeviceExtensionKind, 0,
|
||||||
&DeviceName, FILE_DEVICE_DISK_FILE_SYSTEM,
|
&DeviceName, FILE_DEVICE_DISK_FILE_SYSTEM, FILE_DEVICE_SECURE_OPEN,
|
||||||
&DeviceSddl, &FspFsctlDeviceClassGuid,
|
&DeviceSddl, &FspFsctlDeviceClassGuid,
|
||||||
&FspFsctlDiskDeviceObject);
|
&FspFsctlDiskDeviceObject);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
FSP_RETURN();
|
FSP_RETURN();
|
||||||
RtlInitUnicodeString(&DeviceName, L"\\Device\\" FSP_FSCTL_NET_DEVICE_NAME);
|
RtlInitUnicodeString(&DeviceName, L"\\Device\\" FSP_FSCTL_NET_DEVICE_NAME);
|
||||||
Result = FspDeviceCreateSecure(FspFsctlDeviceExtensionKind, 0,
|
Result = FspDeviceCreateSecure(FspFsctlDeviceExtensionKind, 0,
|
||||||
&DeviceName, FILE_DEVICE_NETWORK_FILE_SYSTEM,
|
&DeviceName, FILE_DEVICE_NETWORK_FILE_SYSTEM, FILE_DEVICE_SECURE_OPEN,
|
||||||
&DeviceSddl, &FspFsctlDeviceClassGuid,
|
&DeviceSddl, &FspFsctlDeviceClassGuid,
|
||||||
&FspFsctlNetDeviceObject);
|
&FspFsctlNetDeviceObject);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
|
@ -757,11 +757,11 @@ FSP_FSVOL_DEVICE_EXTENSION *FspFsvolDeviceExtension(PDEVICE_OBJECT DeviceObject)
|
|||||||
return DeviceObject->DeviceExtension;
|
return DeviceObject->DeviceExtension;
|
||||||
}
|
}
|
||||||
NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
NTSTATUS FspDeviceCreateSecure(UINT32 Kind, ULONG ExtraSize,
|
||||||
PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType,
|
PUNICODE_STRING DeviceName, DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics,
|
||||||
PUNICODE_STRING DeviceSddl, LPCGUID DeviceClassGuid,
|
PUNICODE_STRING DeviceSddl, LPCGUID DeviceClassGuid,
|
||||||
PDEVICE_OBJECT *PDeviceObject);
|
PDEVICE_OBJECT *PDeviceObject);
|
||||||
NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
||||||
DEVICE_TYPE DeviceType,
|
DEVICE_TYPE DeviceType, ULONG DeviceCharacteristics,
|
||||||
PDEVICE_OBJECT *PDeviceObject);
|
PDEVICE_OBJECT *PDeviceObject);
|
||||||
NTSTATUS FspDeviceInitialize(PDEVICE_OBJECT DeviceObject);
|
NTSTATUS FspDeviceInitialize(PDEVICE_OBJECT DeviceObject);
|
||||||
VOID FspDeviceDelete(PDEVICE_OBJECT DeviceObject);
|
VOID FspDeviceDelete(PDEVICE_OBJECT DeviceObject);
|
||||||
|
@ -136,14 +136,14 @@ NTSTATUS FspVolumeCreate(
|
|||||||
|
|
||||||
/* create the volume (and virtual disk) device(s) */
|
/* create the volume (and virtual disk) device(s) */
|
||||||
Result = FspDeviceCreate(FspFsvolDeviceExtensionKind, 0,
|
Result = FspDeviceCreate(FspFsvolDeviceExtensionKind, 0,
|
||||||
FsctlDeviceObject->DeviceType,
|
FsctlDeviceObject->DeviceType, 0,
|
||||||
&FsvolDeviceObject);
|
&FsvolDeviceObject);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
if (FILE_DEVICE_DISK_FILE_SYSTEM == FsctlDeviceObject->DeviceType)
|
if (FILE_DEVICE_DISK_FILE_SYSTEM == FsctlDeviceObject->DeviceType)
|
||||||
{
|
{
|
||||||
Result = FspDeviceCreateSecure(FspFsvrtDeviceExtensionKind, 0,
|
Result = FspDeviceCreateSecure(FspFsvrtDeviceExtensionKind, 0,
|
||||||
&VolumeName, FILE_DEVICE_VIRTUAL_DISK,
|
&VolumeName, FILE_DEVICE_VIRTUAL_DISK, 0,
|
||||||
&DeviceSddl, &FspFsvrtDeviceClassGuid,
|
&DeviceSddl, &FspFsvrtDeviceClassGuid,
|
||||||
&FsvrtDeviceObject);
|
&FsvrtDeviceObject);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user