[NTOS:IO] Allow REG_SZ type for ImagePath of a driver

Fixes the load of the Sysinternals FileMon driver.

CORE-18725
This commit is contained in:
Victor Perevertkin 2022-12-13 01:46:20 +03:00
parent 475c0d1b4d
commit 947f60b207
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -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;