diff --git a/build/VStudio/winfsp.vcxproj b/build/VStudio/winfsp.vcxproj
index 7de2a52d..c78a834a 100644
--- a/build/VStudio/winfsp.vcxproj
+++ b/build/VStudio/winfsp.vcxproj
@@ -98,21 +98,33 @@
..\..\inc;..\..\src;%(AdditionalIncludeDirectories)
+
+ wdmsec.lib;%(AdditionalDependencies)
+
..\..\inc;..\..\src;%(AdditionalIncludeDirectories)
+
+ wdmsec.lib;%(AdditionalDependencies)
+
..\..\inc;..\..\src;%(AdditionalIncludeDirectories)
+
+ wdmsec.lib;%(AdditionalDependencies)
+
..\..\inc;..\..\src;%(AdditionalIncludeDirectories)
+
+ wdmsec.lib;%(AdditionalDependencies)
+
@@ -139,7 +151,7 @@
-
+
diff --git a/build/VStudio/winfsp.vcxproj.filters b/build/VStudio/winfsp.vcxproj.filters
index ad1f2ca1..a144f466 100644
--- a/build/VStudio/winfsp.vcxproj.filters
+++ b/build/VStudio/winfsp.vcxproj.filters
@@ -9,6 +9,9 @@
{93995380-89BD-4b04-88EB-625FBE52EBFB}
h;hpp;hxx;hm;inl;inc;xsd
+
+ {904f0df1-2fb8-4f84-aa46-fa929488c39a}
+
@@ -73,8 +76,8 @@
Source
-
- Include
+
+ Include\winfsp
\ No newline at end of file
diff --git a/inc/fsctl.h b/inc/winfsp/fsctl.h
similarity index 77%
rename from inc/fsctl.h
rename to inc/winfsp/fsctl.h
index 699ce8f7..6ff2a3b3 100644
--- a/inc/fsctl.h
+++ b/inc/winfsp/fsctl.h
@@ -1,5 +1,5 @@
/**
- * @file sys/fsctl.h
+ * @file winfsp/fsctl.h
*
* @copyright 2015 Bill Zissimopoulos
*/
@@ -9,6 +9,10 @@
#include
+// {6F9D25FA-6DEE-4A9D-80F5-E98E14F35E54}
+extern const __declspec(selectany) GUID FspDeviceClassGuid =
+ { 0x6f9d25fa, 0x6dee, 0x4a9d, { 0x80, 0xf5, 0xe9, 0x8e, 0x14, 0xf3, 0x5e, 0x54 } };
+
#define FSP_FSCTL_DISK_DEVICE_NAME "WinFsp.Disk"
#define FSP_FSCTL_NET_DEVICE_NAME "WinFsp.Net"
diff --git a/src/sys/driver.c b/src/sys/driver.c
index afb1207d..56f08009 100644
--- a/src/sys/driver.c
+++ b/src/sys/driver.c
@@ -22,16 +22,20 @@ DriverEntry(
FSP_ENTER();
/* create the file system control device objects */
+ UNICODE_STRING DeviceSddl;
UNICODE_STRING DeviceName;
+ RtlInitUnicodeString(&DeviceSddl, L"" DRIVER_SDDL);
RtlInitUnicodeString(&DeviceName, L"\\Device\\" FSP_FSCTL_DISK_DEVICE_NAME);
- Result = IoCreateDevice(DriverObject,
+ Result = IoCreateDeviceSecure(DriverObject,
sizeof(FSP_FSCTL_DEVICE_EXTENSION), &DeviceName, FILE_DEVICE_DISK_FILE_SYSTEM, 0, FALSE,
+ &DeviceSddl, &FspDeviceClassGuid,
&FspFsctlDiskDeviceObject);
if (!NT_SUCCESS(Result))
FSP_RETURN();
RtlInitUnicodeString(&DeviceName, L"\\Device\\" FSP_FSCTL_NET_DEVICE_NAME);
- Result = IoCreateDevice(DriverObject,
+ Result = IoCreateDeviceSecure(DriverObject,
sizeof(FSP_FSCTL_DEVICE_EXTENSION), &DeviceName, FILE_DEVICE_NETWORK_FILE_SYSTEM, 0, FALSE,
+ &DeviceSddl, &FspDeviceClassGuid,
&FspFsctlNetDeviceObject);
if (!NT_SUCCESS(Result))
FSP_RETURN(IoDeleteDevice(FspFsctlDiskDeviceObject));
diff --git a/src/sys/driver.h b/src/sys/driver.h
index 9c7eb740..f201a5d8 100644
--- a/src/sys/driver.h
+++ b/src/sys/driver.h
@@ -8,9 +8,12 @@
#define WINFSP_SYS_DRIVER_H_INCLUDED
#include
-#include
+#include
+#include
#define DRIVER_NAME "WinFsp"
+#define DRIVER_SDDL "D:P(A;;GA;;;SY)(A;;GA;;;BA)"
+ /* system and builtin administrators have full access */
/* DEBUGLOG */
#if DBG