Skip to content

Instantly share code, notes, and snippets.

@SouhailHammou
Created August 13, 2019 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SouhailHammou/fd307db4e7c079d2e0448bc889ed346d to your computer and use it in GitHub Desktop.
Save SouhailHammou/fd307db4e7c079d2e0448bc889ed346d to your computer and use it in GitHub Desktop.
#include <Windows.h>
#define NTHREADS 5
DWORD WINAPI Thread(LPVOID Parameter)
{
while (1)
CloseHandle(FindFirstChangeNotificationA("C:\\", FALSE, FILE_NOTIFY_CHANGE_FILE_NAME));
}
void main()
{
HANDLE hLastThread;
for(int i = 0; i < NTHREADS; i++)
hLastThread = CreateThread(NULL, 0, Thread, NULL, 0, 0);
WaitForSingleObject(hLastThread, INFINITE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment