I was looking at
ReadDirectoryChangesW and came across something I've not seen in the MS documentation.
Quote[out] lpBuffer
A pointer to the DWORD-aligned formatted buffer in which the read results are to be returned.
I thought Windows was pretty relaxed about buffer alignment, but later
QuoteReadDirectoryChangesW fails with ERROR_NOACCESS when the buffer is not aligned on a DWORD boundary.
Wonder why align 4 is so important?
The alignment is important because the FILE_NOTIFY_INFORMATION structure is variable in length, because of it's last member FileName.
The other structure members are DWORDs, so you must align at 4 bytes (at least?).
8 byte and 16 byte alignment should also work ?! But this is just a guess by myself.