Skip to content

Instantly share code, notes, and snippets.

@iljavs
Last active July 16, 2020 15:44
Show Gist options
  • Save iljavs/04e12ad06529c25964d6fe73940136ca to your computer and use it in GitHub Desktop.
Save iljavs/04e12ad06529c25964d6fe73940136ca to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <stdio.h>
int main() {
DWORD hcount = 0;
int end = 0;
printf("starting handle loop (this could take a while) ");
fflush(stdout);
while (!end) {
if (!(hcount % 10000)) {
printf(".");
fflush(stdout);
}
HANDLE h = CreateMutex(NULL, 0, NULL);
if (h == NULL)
end = 1;
else
hcount++;
}
printf("\nhandle count: %u\n", hcount);
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment