NtQueryDirectoryFile required the FileInformation buffer to be
ULONG-aligned. Declare the aligned buffer explicitly.
/*
* 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)