[KERNEL32] FindFirstFileExW: fix syscall buffer alignment

NtQueryDirectoryFile required the FileInformation buffer to be
ULONG-aligned. Declare the aligned buffer explicitly.
This commit is contained in:
Victor Perevertkin 2021-09-13 21:13:14 +03:00
parent 4e389a992d
commit 655ddfa8e2
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -687,9 +687,10 @@ FindFirstFileExW(IN LPCWSTR lpFileName,
/* /*
* May represent many FILE_BOTH_DIR_INFORMATION * May represent many FILE_BOTH_DIR_INFORMATION
* or many FILE_FULL_DIR_INFORMATION structures. * or many FILE_FULL_DIR_INFORMATION structures.
* NOTE: NtQueryDirectoryFile requires the buffer to be ULONG-aligned
*/ */
BYTE DirectoryInfo[FIND_DATA_SIZE]; DECLSPEC_ALIGN(4) BYTE DirectoryInfo[FIND_DATA_SIZE];
DIR_INFORMATION DirInfo = {&DirectoryInfo}; DIR_INFORMATION DirInfo = { .DirInfo = &DirectoryInfo };
/* The search filter is always unused */ /* The search filter is always unused */
if (lpSearchFilter) if (lpSearchFilter)