New issue
Advanced search Search tips

Issue 888 attachment: testopen.c (402 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <windows.h>
#include <stdio.h>

#pragma comment(lib, "advapi32.lib")

int main(int argc, char **argv)
{
if (OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_DUP_HANDLE | PROCESS_VM_READ, 0, atoi(argv[1]))) {
fprintf(stderr, "successfully opened pid specified\n");
return 0;
}

fprintf(stderr, "failed to open pid specified, %#x\n", GetLastError());

return 1;
}