https://git.reactos.org/?p=reactos.git;a=commitdiff;h=655ddfa8e2ffb3de5c2a8…
commit 655ddfa8e2ffb3de5c2a8e2ad09606209c2e7a66
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Mon Sep 13 21:13:14 2021 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Tue Sep 14 17:58:22 2021 +0300
[KERNEL32] FindFirstFileExW: fix syscall buffer alignment
NtQueryDirectoryFile required the FileInformation buffer to be
ULONG-aligned. Declare the aligned buffer explicitly.
---
dll/win32/kernel32/client/file/find.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dll/win32/kernel32/client/file/find.c
b/dll/win32/kernel32/client/file/find.c
index b5fe7713e53..0fa21ae34be 100644
--- a/dll/win32/kernel32/client/file/find.c
+++ b/dll/win32/kernel32/client/file/find.c
@@ -687,9 +687,10 @@ FindFirstFileExW(IN LPCWSTR lpFileName,
/*
* May represent many FILE_BOTH_DIR_INFORMATION
* or many FILE_FULL_DIR_INFORMATION structures.
+ * NOTE: NtQueryDirectoryFile requires the buffer to be ULONG-aligned
*/
- BYTE DirectoryInfo[FIND_DATA_SIZE];
- DIR_INFORMATION DirInfo = {&DirectoryInfo};
+ DECLSPEC_ALIGN(4) BYTE DirectoryInfo[FIND_DATA_SIZE];
+ DIR_INFORMATION DirInfo = { .DirInfo = &DirectoryInfo };
/* The search filter is always unused */
if (lpSearchFilter)