Skip to content

Commit 86f0fe1

Browse files
committed
use IoCreateDeviceSecure API
Change-Id: I204385fdc7341ccc90d857e66e310bb85581367b
1 parent 080970f commit 86f0fe1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/WinMSRDriver/msrmain.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ DriverEntry(
6262
RtlInitUnicodeString(&UnicodeString, NT_DEVICE_NAME);
6363
RtlInitUnicodeString(&dosDeviceName, DOS_DEVICE_NAME);
6464

65+
#if 1
66+
status = IoCreateDeviceSecure(DriverObject,
67+
sizeof(struct DeviceExtension),
68+
&UnicodeString,
69+
FILE_DEVICE_UNKNOWN,
70+
FILE_DEVICE_SECURE_OPEN,
71+
FALSE,
72+
&SDDL_DEVOBJ_SYS_ALL_ADM_ALL,
73+
NULL,
74+
&MSRSystemDeviceObject
75+
);
76+
#else
6577
status = IoCreateDevice(DriverObject,
6678
sizeof(struct DeviceExtension),
6779
&UnicodeString,
@@ -70,6 +82,7 @@ DriverEntry(
7082
FALSE,
7183
&MSRSystemDeviceObject
7284
);
85+
#endif
7386

7487
if (!NT_SUCCESS(status))
7588
return status;

0 commit comments

Comments
 (0)