ef6b8de5c7f5e8d453dce91bb8e9e36127ed3b17
[reactos.git] / rostests / apitests / user32 / LoadImage.c
1
2 #include <stdio.h>
3 #include <wine/test.h>
4 #include <windows.h>
5 #include "resource.h"
6
7 START_TEST(LoadImage)
8 {
9 char path[MAX_PATH];
10 PROCESS_INFORMATION pi;
11 STARTUPINFO si;
12 HANDLE handle;
13
14 char **test_argv;
15 int argc = winetest_get_mainargs( &test_argv );
16
17 /* Now check its behaviour regarding Shared icons/cursors */
18 handle = LoadImageW( GetModuleHandle(NULL), L"TESTCURSOR", IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE );
19 ok(handle != 0, "\n");
20
21 if (argc >= 3)
22 {
23 HANDLE arg;
24
25 sscanf (test_argv[2], "%lu", (ULONG_PTR*) &arg);
26
27 ok(handle != arg, "Got same handles\n");
28
29 return;
30 }
31
32 /* Start child process */
33 sprintf( path, "%s LoadImage %lu", test_argv[0], (ULONG_PTR)handle );
34 memset( &si, 0, sizeof(si) );
35 si.cb = sizeof(si);
36 CreateProcessA( NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi );
37 WaitForSingleObject (pi.hProcess, INFINITE);
38 }