mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
dll: WIP
This commit is contained in:
parent
cc19002437
commit
c3820ff88a
@ -10,6 +10,12 @@
|
|||||||
|
|
||||||
#define GLOBALROOT L"\\\\?\\GLOBALROOT"
|
#define GLOBALROOT L"\\\\?\\GLOBALROOT"
|
||||||
|
|
||||||
|
static inline VOID GlobalDevicePath(PWCHAR DevicePathBuf, size_t DevicePathLen, PWSTR DevicePath)
|
||||||
|
{
|
||||||
|
StringCbPrintf(DevicePathBuf, DevicePathLen,
|
||||||
|
L'\\' == DevicePath[0] ? GLOBALROOT "%S" : GLOBALROOT "\\Device\\%S", DevicePath);
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath, PSECURITY_DESCRIPTOR SecurityDescriptor,
|
NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath, PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
PHANDLE *PVolumeHandle)
|
PHANDLE *PVolumeHandle)
|
||||||
{
|
{
|
||||||
@ -22,8 +28,7 @@ NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath, PSECURITY_DESCRIPTOR SecurityDes
|
|||||||
|
|
||||||
*PVolumeHandle = 0;
|
*PVolumeHandle = 0;
|
||||||
|
|
||||||
DevicePathBuf[0] = L'\0';
|
GlobalDevicePath(DevicePathBuf, sizeof DevicePathBuf, DevicePath);
|
||||||
StringCbPrintf(DevicePathBuf, sizeof DevicePathBuf, GLOBALROOT "%S", DevicePath);
|
|
||||||
|
|
||||||
if (!MakeSelfRelativeSD(SecurityDescriptor, 0, &SecurityDescriptorLen))
|
if (!MakeSelfRelativeSD(SecurityDescriptor, 0, &SecurityDescriptorLen))
|
||||||
{
|
{
|
||||||
@ -74,8 +79,7 @@ NTSTATUS FspFsctlOpenVolume(PWSTR VolumePath,
|
|||||||
|
|
||||||
*PVolumeHandle = 0;
|
*PVolumeHandle = 0;
|
||||||
|
|
||||||
DevicePathBuf[0] = L'\0';
|
GlobalDevicePath(DevicePathBuf, sizeof DevicePathBuf, VolumePath);
|
||||||
StringCbPrintf(DevicePathBuf, sizeof DevicePathBuf, GLOBALROOT "%S", VolumePath);
|
|
||||||
|
|
||||||
VolumeHandle = CreateFileW(DevicePathBuf,
|
VolumeHandle = CreateFileW(DevicePathBuf,
|
||||||
0, FILE_SHARE_WRITE | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, 0, 0);
|
0, FILE_SHARE_WRITE | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user