https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5391eaadff005718cb2b4…
commit 5391eaadff005718cb2b434207678c4a9d23ca74
Author: Muhammad Faathin Abdurrahman <kaw411gh0st(a)gmail.com>
AuthorDate: Thu Jan 11 18:31:12 2024 +0700
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Jan 11 12:31:12 2024 +0100
[KERNEL32] OpenFile(): Use InitializeObjectAttributes (#6323)
Use InitializeObjectAttributes macro instead of initializing the members manually.
---
dll/win32/kernel32/client/file/create.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dll/win32/kernel32/client/file/create.c
b/dll/win32/kernel32/client/file/create.c
index ec6411e4ec2..9a9c97d6839 100644
--- a/dll/win32/kernel32/client/file/create.c
+++ b/dll/win32/kernel32/client/file/create.c
@@ -513,12 +513,11 @@ OpenFile(LPCSTR lpFileName,
// FILE_SHARE_READ
// FILE_NO_INTERMEDIATE_BUFFERING
- ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
- ObjectAttributes.RootDirectory = NULL;
- ObjectAttributes.ObjectName = &FileNameString;
- ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE| OBJ_INHERIT;
- ObjectAttributes.SecurityDescriptor = NULL;
- ObjectAttributes.SecurityQualityOfService = NULL;
+ InitializeObjectAttributes(&ObjectAttributes,
+ &FileNameString,
+ OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
+ NULL,
+ NULL);
errCode = NtOpenFile (&FileHandle,
GENERIC_READ | SYNCHRONIZE,