You might not have the header that declares ReadDirectoryChangesW
, or you need to #define _WIN32_WINNT
as greater than or equal to 0x0400
. If it's the former, you can manually get the address to ReadDirectoryChangesW and call that:
HANDLE kernel32_dll_handle= LoadLibrary("kernel32.dll");
FARPROC ReadDirectoryChangesWAddress= GetProcAddress(kernel32_dll_handle, "ReadDirectoryChangesW");
typedef BOOL WINAPI (*ReadDirectoryChangesWDeclaration)(
__in HANDLE hDirectory,
__out LPVOID lpBuffer,
__in DWORD nBufferLength,
__in BOOL bWatchSubtree,
__in DWORD dwNotifyFilter,
__out_opt LPDWORD lpBytesReturned,
__inout_opt LPOVERLAPPED lpOverlapped,
__in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
ReadDirectoryChangesWDeclaration ReadDirectoryChangesW= (ReadDirectoryChangesWDeclaration)ReadDirectoryChangesWAddress;