https://git.reactos.org/?p=reactos.git;a=commitdiff;h=46db6573ab98b87e6b684…
commit 46db6573ab98b87e6b68484e3b5db0e80159719f
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sat May 7 21:12:19 2022 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat May 7 22:12:19 2022 +0300
[DRIVERS] Add some missing OBJ_KERNEL_HANDLE (#4493)
Match Zw*() uses. CORE-10207
---
drivers/filesystems/fs_rec/fs_rec.c | 2 +-
drivers/filesystems/udfs/Include/regtools.cpp | 3 +--
drivers/filesystems/udfs/udfinit.cpp | 2 +-
drivers/ksfilter/ks/connectivity.c | 3 +--
drivers/ksfilter/ks/image.c | 5 +----
drivers/serial/serial/pnp.c | 2 +-
drivers/wdm/audio/legacy/wdmaud/mmixer.c | 2 +-
drivers/wdm/audio/legacy/wdmaud/sup.c | 4 ++--
8 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/filesystems/fs_rec/fs_rec.c b/drivers/filesystems/fs_rec/fs_rec.c
index 4ccb99f5952..e350fac5ceb 100644
--- a/drivers/filesystems/fs_rec/fs_rec.c
+++ b/drivers/filesystems/fs_rec/fs_rec.c
@@ -238,7 +238,7 @@ FsRecRegisterFs(IN PDRIVER_OBJECT DriverObject,
RtlInitUnicodeString(&DeviceName, FsName);
InitializeObjectAttributes(&ObjectAttributes,
&DeviceName,
- OBJ_CASE_INSENSITIVE,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
0,
NULL);
diff --git a/drivers/filesystems/udfs/Include/regtools.cpp
b/drivers/filesystems/udfs/Include/regtools.cpp
index 41113a117e2..3c5e78aba15 100644
--- a/drivers/filesystems/udfs/Include/regtools.cpp
+++ b/drivers/filesystems/udfs/Include/regtools.cpp
@@ -26,7 +26,7 @@ RegTGetKeyHandle(
InitializeObjectAttributes(
&ObjectAttributes,
&NameString,
- OBJ_CASE_INSENSITIVE,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
hRootKey,
NULL
);
@@ -276,4 +276,3 @@ RegTGetStringValue(
}
return retval;
} // end RegTGetStringValue()
-
diff --git a/drivers/filesystems/udfs/udfinit.cpp b/drivers/filesystems/udfs/udfinit.cpp
index 4eaa1c96455..9030ecf79c0 100644
--- a/drivers/filesystems/udfs/udfinit.cpp
+++ b/drivers/filesystems/udfs/udfinit.cpp
@@ -649,7 +649,7 @@ UDFDismountDevice(
InitializeObjectAttributes ( &ObjectAttributes,
unicodeCdRomDeviceName,
- OBJ_CASE_INSENSITIVE,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
NULL,
NULL );
diff --git a/drivers/ksfilter/ks/connectivity.c b/drivers/ksfilter/ks/connectivity.c
index b5d348106b6..ba7db56d8b5 100644
--- a/drivers/ksfilter/ks/connectivity.c
+++ b/drivers/ksfilter/ks/connectivity.c
@@ -265,7 +265,7 @@ KspReadMediaCategory(
RtlFreeUnicodeString(&GuidString);
/* initialize object attributes */
- InitializeObjectAttributes(&ObjectAttributes, &Path, OBJ_CASE_INSENSITIVE,
NULL, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &Path, OBJ_CASE_INSENSITIVE |
OBJ_KERNEL_HANDLE, NULL, NULL);
/* open the key */
Status = ZwOpenKey(&hKey, GENERIC_READ, &ObjectAttributes);
@@ -839,4 +839,3 @@ KsHandleSizedListQuery(
return STATUS_BUFFER_TOO_SMALL;
}
}
-
diff --git a/drivers/ksfilter/ks/image.c b/drivers/ksfilter/ks/image.c
index 6634b9989fc..c35728fea92 100644
--- a/drivers/ksfilter/ks/image.c
+++ b/drivers/ksfilter/ks/image.c
@@ -239,7 +239,7 @@ KsMapModuleName(
RtlAppendUnicodeStringToString(&SubKeyName, ModuleName);
/* initialize subkey attributes */
- InitializeObjectAttributes(&ObjectAttributes, &SubKeyName,
OBJ_CASE_INSENSITIVE, hKey, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &SubKeyName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, hKey, NULL);
/* now open the subkey */
Status = ZwOpenKey(&hSubKey, GENERIC_READ, &ObjectAttributes);
@@ -263,6 +263,3 @@ KsMapModuleName(
/* return status */
return Status;
}
-
-
-
diff --git a/drivers/serial/serial/pnp.c b/drivers/serial/serial/pnp.c
index 94dcc1b8931..a55e5376b59 100644
--- a/drivers/serial/serial/pnp.c
+++ b/drivers/serial/serial/pnp.c
@@ -296,7 +296,7 @@ SerialPnpStartDevice(
/* Write an entry value under HKLM\HARDWARE\DeviceMap\SERIALCOMM */
/* This step is not mandatory, so don't exit in case of error */
RtlInitUnicodeString(&KeyName,
L"\\Registry\\Machine\\HARDWARE\\DeviceMap\\SERIALCOMM");
- InitializeObjectAttributes(&objectAttributes, &KeyName, OBJ_CASE_INSENSITIVE,
NULL, NULL);
+ InitializeObjectAttributes(&objectAttributes, &KeyName, OBJ_CASE_INSENSITIVE |
OBJ_KERNEL_HANDLE, NULL, NULL);
Status = ZwCreateKey(&hKey, KEY_SET_VALUE, &objectAttributes, 0, NULL,
REG_OPTION_VOLATILE, NULL);
if (NT_SUCCESS(Status))
{
diff --git a/drivers/wdm/audio/legacy/wdmaud/mmixer.c
b/drivers/wdm/audio/legacy/wdmaud/mmixer.c
index 12536830be1..dbf97ba5608 100644
--- a/drivers/wdm/audio/legacy/wdmaud/mmixer.c
+++ b/drivers/wdm/audio/legacy/wdmaud/mmixer.c
@@ -129,7 +129,7 @@ OpenKey(
RtlInitUnicodeString(&SubKeyName, lpSubKeyName);
/* initialize key attributes */
- InitializeObjectAttributes(&ObjectAttributes, &SubKeyName,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF, hKey, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &SubKeyName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE | OBJ_OPENIF, hKey, NULL);
/* open the key */
Status = ZwOpenKey(OutKey, DesiredAccess, &ObjectAttributes);
diff --git a/drivers/wdm/audio/legacy/wdmaud/sup.c
b/drivers/wdm/audio/legacy/wdmaud/sup.c
index d3b53086a49..91334c09bb3 100644
--- a/drivers/wdm/audio/legacy/wdmaud/sup.c
+++ b/drivers/wdm/audio/legacy/wdmaud/sup.c
@@ -274,7 +274,7 @@ FindProductName(
/* initialize key attributes */
- InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
| OBJ_OPENIF, NULL, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
| OBJ_KERNEL_HANDLE | OBJ_OPENIF, NULL, NULL);
/* open the key */
Status = ZwOpenKey(&hKey, GENERIC_READ, &ObjectAttributes);
@@ -324,7 +324,7 @@ FindProductName(
RtlInitUnicodeString(&SubKeyName, SubKey);
/* initialize key attributes */
- InitializeObjectAttributes(&ObjectAttributes, &SubKeyName,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF, hKey, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &SubKeyName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE | OBJ_OPENIF, hKey, NULL);
/* open the sub key */
Status = ZwOpenKey(&hSubKey, GENERIC_READ, &ObjectAttributes);