https://git.reactos.org/?p=reactos.git;a=commitdiff;h=947f60b20716e1581b0785360d2d71363eff3657

commit 947f60b20716e1581b0785360d2d71363eff3657
Author:     Victor Perevertkin <[email protected]>
AuthorDate: Tue Dec 13 01:46:20 2022 +0300
Commit:     Victor Perevertkin <[email protected]>
CommitDate: Tue Dec 13 01:46:20 2022 +0300

    [NTOS:IO] Allow REG_SZ type for ImagePath of a driver
    
    Fixes the load of the Sysinternals FileMon driver.
    
    CORE-18725
---
 ntoskrnl/io/iomgr/driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c
index c81e4714542..adbb14ba445 100644
--- a/ntoskrnl/io/iomgr/driver.c
+++ b/ntoskrnl/io/iomgr/driver.c
@@ -11,7 +11,7 @@
 /* INCLUDES 
*******************************************************************/
 
 #include <ntoskrnl.h>
-#define NDEBUG
+// #define NDEBUG
 #include <debug.h>
 
 /* GLOBALS 
********************************************************************/
@@ -1926,7 +1926,7 @@ IopLoadDriver(
     Status = IopGetRegistryValue(ServiceHandle, L"ImagePath", &kvInfo);
     if (NT_SUCCESS(Status))
     {
-        if (kvInfo->Type != REG_EXPAND_SZ || kvInfo->DataLength == 0)
+        if ((kvInfo->Type != REG_EXPAND_SZ && kvInfo->Type != REG_SZ) || 
kvInfo->DataLength == 0)
         {
             ExFreePool(kvInfo);
             return STATUS_ILL_FORMED_SERVICE_ENTRY;

Reply via email to