ReactOS 0.4.16-dev-2491-g3dc6630
resource.c
Go to the documentation of this file.
1/* Unit test suite for resources.
2 *
3 * Copyright 2004 Ferenc Wagner
4 * Copyright 2003, 2004 Mike McCormack
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <assert.h>
22#include <windows.h>
23
24#include "wine/test.h"
25
26static UINT (WINAPI *pPrivateExtractIconsA)(LPCSTR, int, int, int, HICON *, UINT *, UINT, UINT) = NULL;
27
28static void init_function_pointers(void)
29{
30 HMODULE hmod = GetModuleHandleA("user32.dll");
31 pPrivateExtractIconsA = (void*)GetProcAddress(hmod, "PrivateExtractIconsA");
32}
33
34static void test_LoadStringW(void)
35{
37 WCHAR copiedstringw[128], returnedstringw[128], *resourcepointer = NULL;
38 char copiedstring[128], returnedstring[128];
39 int length1, length2, retvalue, i;
40 static struct
41 {
42 int id;
43 const WCHAR *string;
44 } string_table_tests[] =
45 {
46 { 2, L"Error" },
47 { 13, L"&More Windows..." },
48 { 800, L"OK" },
49 { 801, L"Cancel" },
50 { 802, L"&Abort" },
51 { 803, L"&Retry" },
52 { 804, L"&Ignore" },
53 { 805, L"&Yes" },
54 { 806, L"&No" },
55 { 807, L"&Close" },
56 { 808, L"Help" },
57 { 809, L"&Try Again" },
58 { 810, L"&Continue" },
59 };
60
61 /* Check that the string which is returned by LoadStringW matches
62 the string at the pointer returned by LoadStringW when called with buflen = 0 */
63 SetLastError(0xdeadbeef);
64 length1 = LoadStringW(hInst, 2, (WCHAR *) &resourcepointer, 0); /* get pointer to resource. */
65 if (!length1)
66 {
68 win_skip( "LoadStringW not implemented\n" );
69 else
70 win_skip( "LoadStringW does not return a pointer to the resource\n" );
71 return;
72 }
73 length2 = LoadStringW(hInst, 2, returnedstringw, ARRAY_SIZE(returnedstringw)); /* get resource string */
74 ok(length2 > 0, "LoadStringW failed to load resource 2, ret %d, err %ld\n", length2, GetLastError());
75 ok(length1 == length2, "LoadStringW returned different values dependent on buflen. ret1 %d, ret2 %d\n",
76 length1, length2);
77 ok(length1 > 0 && resourcepointer != NULL, "LoadStringW failed to get pointer to resource 2, ret %d, err %ld\n",
78 length1, GetLastError());
79
80 /* Copy the resource since it is not '\0' terminated, and add '\0' to the end */
81 if(resourcepointer != NULL) /* Check that the resource pointer was loaded to avoid access violation */
82 {
83 memcpy(copiedstringw, resourcepointer, length1 * sizeof(WCHAR));
84 copiedstringw[length1] = '\0';
85 /* check that strings match */
86 WideCharToMultiByte( CP_ACP, 0, returnedstringw, -1, returnedstring, 128, NULL, NULL );
87 WideCharToMultiByte( CP_ACP, 0, copiedstringw, -1, copiedstring, 128, NULL, NULL );
88 ok(!memcmp(copiedstringw, returnedstringw, (length2 + 1)*sizeof(WCHAR)),
89 "strings don't match: returnedstring = %s, copiedstring = %s\n", returnedstring, copiedstring);
90 }
91
92 /* check that calling LoadStringW with buffer = NULL returns zero */
93 retvalue = LoadStringW(hInst, 2, NULL, 0);
94 ok(!retvalue, "LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
95 /* check again, with a different buflen value, that calling LoadStringW with buffer = NULL returns zero */
96 retvalue = LoadStringW(hInst, 2, NULL, 128);
97 ok(!retvalue, "LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
98
99 /* Test builtin string table in user32. */
102 {
103 skip("Skip for Non-English system.\n");
104 return;
105 }
106 else
107 {
108 hInst = GetModuleHandleW(L"user32.dll");
109 ok(!!hInst, "Can't get module %#lx.\n", GetLastError());
110
111 for (i = 0; i < ARRAYSIZE(string_table_tests); i++)
112 {
113 winetest_push_context("Test %u", i);
114
115 length1 = LoadStringW(hInst, string_table_tests[i].id, returnedstringw, ARRAY_SIZE(returnedstringw));
116 ok(length1 == wcslen(string_table_tests[i].string), "Got wrong length %d.\n", length1);
117 ok(!wcscmp(returnedstringw, string_table_tests[i].string), "Got wrong string %s.\n",
118 debugstr_w(returnedstringw));
119
121 }
122 }
123
124 /* Test missing resource. */
125 SetLastError(0xdeadbeef);
126 memset(returnedstringw, 0xcc, sizeof(returnedstringw));
127 length1 = LoadStringW(hInst, 0xdeadbeef, returnedstringw, ARRAY_SIZE(returnedstringw));
128 ok(!length1, "got %d.\n", length1);
130 "got %lu.\n", GetLastError());
131 ok(!returnedstringw[0], "got %#x.\n", returnedstringw[0]);
132 ok(returnedstringw[1] == 0xcccc, "got %#x.\n", returnedstringw[1]);
133
134 SetLastError(0xdeadbeef);
135 memset(returnedstringw, 0xcc, sizeof(returnedstringw));
136 length1 = LoadStringW(hInst, 0xdeadbeef, returnedstringw, 0);
137 ok(!length1, "got %d.\n", length1);
139 "got %lu.\n", GetLastError());
140 ok(returnedstringw[0] == 0xcccc, "got %#x.\n", returnedstringw[1]);
141
142 SetLastError(0xdeadbeef);
143 memset(returnedstringw, 0xcc, sizeof(returnedstringw));
144 length1 = LoadStringW(hInst, 0xdeadbeef, returnedstringw, 1);
145 ok(!length1, "got %d.\n", length1);
147 "got %lu.\n", GetLastError());
148 ok(!returnedstringw[0], "got %#x.\n", returnedstringw[0]);
149 ok(returnedstringw[1] == 0xcccc, "got %#x.\n", returnedstringw[1]);
150
151 /* Test short buffer */
152 SetLastError(0xdeadbeef);
153 memset(returnedstringw, 0xcc, sizeof(returnedstringw));
154 length1 = LoadStringW(hInst, 2, returnedstringw, 1); /* get resource string */
155 ok(!length1, "got %d.\n", length1);
156 ok(GetLastError() == 0xdeadbeef, "got %lu.\n", GetLastError());
157#ifdef __REACTOS__
158 ok(!returnedstringw[0] || broken(returnedstringw[0] == 0xcccc) /* WS03 */, "got %#x.\n", returnedstringw[0]);
159#else
160 ok(!returnedstringw[0], "got %#x.\n", returnedstringw[0]);
161#endif
162 ok(returnedstringw[1] == 0xcccc, "got %#x.\n", returnedstringw[1]);
163}
164
165static void test_LoadStringA (void)
166{
167#if defined(__REACTOS__) && defined(_M_AMD64)
168 skip("LoadStringA test broken on amd64!\n");
169#else
171 static const char str[] = "String resource"; /* same in resource.rc */
172 char buf[128];
173 struct string_test {
174 unsigned int bufsiz;
175 unsigned int expected;
176 };
177 struct string_test tests[] = {{sizeof buf, sizeof str - 1},
178 {sizeof str, sizeof str - 1},
179 {sizeof str - 1, sizeof str - 2}};
180 unsigned int i;
181 int ret, ret2;
182
183 assert (sizeof str < sizeof buf);
184 for (i = 0; i < ARRAY_SIZE(tests); i++) {
185 const unsigned int bufsiz = tests[i].bufsiz;
186 const unsigned int expected = tests[i].expected;
187 const int len = LoadStringA (hInst, 0, buf, bufsiz);
188
189 ok (len == expected, "bufsiz=%d: got %d, expected %d\n",
190 bufsiz, len, expected);
191 if (len != expected) continue;
192 ok (!memcmp (buf, str, len),
193 "bufsiz=%d: got '%s', expected '%.*s'\n",
194 bufsiz, buf, len, str);
195 ok (buf[len] == 0, "bufsiz=%d: NUL termination missing\n",
196 bufsiz);
197 }
198
199 ret = LoadStringA(hInst, 1, buf, sizeof(buf) );
200 ok( ret > 0, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
201 ret2 = LoadStringA( hInst, MAKELONG( 1, 0x8000 ), buf, sizeof(buf));
202 ok( ret2 == ret, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
203 ret2 = LoadStringA( hInst, MAKELONG( 1, 0xffff ), buf, sizeof(buf));
204 ok( ret2 == ret, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
205
206 ret = LoadStringA(hInst, 65534, buf, sizeof(buf) );
207 ok( ret > 0, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
208 ret2 = LoadStringA( hInst, MAKELONG( 65534, 0x8000 ), buf, sizeof(buf));
209 ok( ret2 == ret, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
210 ret2 = LoadStringA( hInst, MAKELONG( 65534, 0xffff ), buf, sizeof(buf));
211 ok( ret2 == ret, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
212
213 ret = LoadStringA(hInst, 0, buf, 0);
214 ok( ret == -1 || broken(ret == 0),
215 "LoadStringA did not return -1 when called with buflen = 0, got %d, err %ld\n",
216 ret, GetLastError());
217
218 SetLastError(0xdeadbeef);
219 buf[0] = 'a';
220 ret = LoadStringA(hInst, 1, buf, 1);
221 ok( !ret, "LoadString returned %d\n", ret);
222 ok( buf[0] == 0, "buf[0] = %c (%x)\n", buf[0], buf[0]);
223 ok( GetLastError() == 0xdeadbeef, "GetLastError() = %ld\n", GetLastError());
224#endif
225}
226
227static void test_accel1(void)
228{
229 UINT r, n;
230 HACCEL hAccel;
231 ACCEL ac[10];
232
233 /* now create our own valid accelerator table */
234 n = 0;
235 ac[n].cmd = 1000;
236 ac[n].key = 'A';
237 ac[n++].fVirt = FVIRTKEY | FNOINVERT;
238
239 ac[n].cmd = 1001;
240 ac[n].key = 'B';
241 ac[n++].fVirt = FNOINVERT;
242
243 ac[n].cmd = 0;
244 ac[n].key = 0;
245 ac[n++].fVirt = 0;
246
247 hAccel = CreateAcceleratorTableA( &ac[0], n );
248 ok( hAccel != NULL, "create accelerator table\n");
249
251 ok( r, "destroy accelerator table\n");
252
253 /* now try create an invalid one */
254 n = 0;
255 ac[n].cmd = 1000;
256 ac[n].key = 'A';
257 ac[n++].fVirt = FVIRTKEY | FNOINVERT;
258
259 ac[n].cmd = 0xffff;
260 ac[n].key = 0xffff;
261 ac[n++].fVirt = (SHORT) 0xffff;
262
263 ac[n].cmd = 0xfff0;
264 ac[n].key = 'B';
265 ac[n++].fVirt = (SHORT) 0xfff0;
266
267 ac[n].cmd = 0xfff0;
268 ac[n].key = 'C';
269 ac[n++].fVirt = 0x0000;
270
271 ac[n].cmd = 0xfff0;
272 ac[n].key = 0xffff;
273 ac[n++].fVirt = 0x0001;
274
275 hAccel = CreateAcceleratorTableA( &ac[0], n );
276 ok( hAccel != NULL, "create accelerator table\n");
277
279 ok( r == n, "two entries in table %u/%u\n", r, n);
280
281 r = CopyAcceleratorTableA( hAccel, &ac[0], n );
282 ok( r == n, "still should be two entries in table %u/%u\n", r, n);
283
284 n=0;
285 ok( ac[n].cmd == 1000, "cmd 0 not preserved got %x\n", ac[n].cmd);
286 ok( ac[n].key == 'A', "key 0 not preserved got %x\n", ac[n].key);
287 ok( ac[n].fVirt == (FVIRTKEY | FNOINVERT), "fVirt 0 not preserved got %x\n", ac[n].fVirt);
288
289 if (++n == r) goto done;
290 ok( ac[n].cmd == 0xffff, "cmd 1 not preserved got %x\n", ac[n].cmd);
291 ok( ac[n].key == 0xffff, "key 1 not preserved got %x\n", ac[n].key);
292 ok( ac[n].fVirt == 0x007f, "fVirt 1 wrong got %x\n", ac[n].fVirt);
293
294 if (++n == r) goto done;
295 ok( ac[n].cmd == 0xfff0, "cmd 2 not preserved got %x\n", ac[n].cmd);
296 ok( ac[n].key == 'B', "key 2 not preserved got %x\n", ac[n].key);
297 ok( ac[n].fVirt == 0x0070, "fVirt 2 wrong got %x\n", ac[n].fVirt);
298
299 if (++n == r) goto done;
300 ok( ac[n].cmd == 0xfff0, "cmd 3 not preserved got %x\n", ac[n].cmd);
301 ok( ac[n].key == 'C', "key 3 not preserved got %x\n", ac[n].key);
302 ok( ac[n].fVirt == 0x0000, "fVirt 3 wrong got %x\n", ac[n].fVirt);
303
304 if (++n == r) goto done;
305 ok( ac[n].cmd == 0xfff0, "cmd 4 not preserved got %x\n", ac[n].cmd);
306 ok( ac[n].key == 0xffff, "key 4 not preserved got %x\n", ac[n].key);
307 ok( ac[n].fVirt == 0x0001, "fVirt 4 wrong got %x\n", ac[n].fVirt);
308done:
310 ok( r, "destroy accelerator table\n");
311
312 hAccel = CreateAcceleratorTableA( &ac[0], 0 );
313 ok( !hAccel || broken(hAccel != NULL), /* nt4 */ "zero elements should fail\n");
314
315 /* these will on crash win2k
316 hAccel = CreateAcceleratorTable( NULL, 1 );
317 hAccel = CreateAcceleratorTable( &ac[0], -1 );
318 */
319}
320
321/*
322 * memcmp on the tables works in Windows, but does not work in wine, as
323 * there is an extra undefined and unused byte between fVirt and the key
324 */
325static void test_accel2(void)
326{
327 ACCEL ac[2], out[2];
328 HACCEL hac;
329 int res;
330
331 ac[0].cmd = 0;
332 ac[0].fVirt = 0;
333 ac[0].key = 0;
334
335 ac[1].cmd = 0;
336 ac[1].fVirt = 0;
337 ac[1].key = 0;
338
339 /*
340 * crashes on win2k
341 * hac = CreateAcceleratorTable( NULL, 1 );
342 */
343
344 /* try a zero count */
345 hac = CreateAcceleratorTableA( &ac[0], 0 );
346 ok( !hac || broken(hac != NULL), /* nt4 */ "fail\n");
347 if (!hac) ok( !DestroyAcceleratorTable( hac ), "destroy failed\n");
348
349 /* creating one accelerator should work */
350 hac = CreateAcceleratorTableA( &ac[0], 1 );
351 ok( hac != NULL , "fail\n");
352 ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy failed\n");
353 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
354
355 /* how about two of the same type? */
356 hac = CreateAcceleratorTableA( &ac[0], 2);
357 ok( hac != NULL , "fail\n");
358 res = CopyAcceleratorTableA( hac, NULL, 100 );
359 ok( res == 2, "copy null failed %d\n", res);
360 res = CopyAcceleratorTableA( hac, NULL, 0 );
361 ok( res == 2, "copy null failed %d\n", res);
362 res = CopyAcceleratorTableA( hac, NULL, 1 );
363 ok( res == 2, "copy null failed %d\n", res);
364 ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy 1 failed\n");
365 ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
366 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
367 /* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
368
369 /* how about two of the same type with a non-zero key? */
370 ac[0].key = 0x20;
371 ac[1].key = 0x20;
372 hac = CreateAcceleratorTableA( &ac[0], 2);
373 ok( hac != NULL , "fail\n");
374 ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
375 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
376 /* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
377
378 /* how about two of the same type with a non-zero virtual key? */
379 ac[0].fVirt = FVIRTKEY;
380 ac[0].key = 0x40;
381 ac[1].fVirt = FVIRTKEY;
382 ac[1].key = 0x40;
383 hac = CreateAcceleratorTableA( &ac[0], 2);
384 ok( hac != NULL , "fail\n");
385 ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
386 /* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
387 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
388
389 /* how virtual key codes */
390 ac[0].fVirt = FVIRTKEY;
391 hac = CreateAcceleratorTableA( &ac[0], 1);
392 ok( hac != NULL , "fail\n");
393 ok( 1 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
394 /* ok( !memcmp( ac, out, sizeof ac/2 ), "tables different\n"); */
395 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
396
397 /* how turning on all bits? */
398 ac[0].cmd = 0xffff;
399 ac[0].fVirt = 0xff;
400 ac[0].key = 0xffff;
401 hac = CreateAcceleratorTableA( &ac[0], 1);
402 ok( hac != NULL , "fail\n");
403 ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy 1 failed\n");
404 /* ok( memcmp( ac, out, sizeof ac/2 ), "tables not different\n"); */
405 ok( out[0].cmd == ac[0].cmd, "cmd modified\n");
406 ok( out[0].fVirt == (ac[0].fVirt&0x7f), "fVirt not modified\n");
407 ok( out[0].key == ac[0].key, "key modified\n");
408 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
409
410 /* how turning on all bits? */
411 memset( ac, 0xff, sizeof ac );
412 hac = CreateAcceleratorTableA( &ac[0], 2);
413 ok( hac != NULL , "fail\n");
414 res = CopyAcceleratorTableA( hac, out, 2 );
415 ok( res == 2, "copy 2 failed %d\n", res);
416 /* ok( memcmp( ac, out, sizeof ac ), "tables not different\n"); */
417 ok( out[0].cmd == ac[0].cmd, "cmd modified\n");
418 ok( out[0].fVirt == (ac[0].fVirt&0x7f), "fVirt not modified\n");
419 ok( out[0].key == ac[0].key, "key modified\n");
420 if (res == 2)
421 {
422 ok( out[1].cmd == ac[1].cmd, "cmd modified\n");
423 ok( out[1].fVirt == (ac[1].fVirt&0x7f), "fVirt not modified\n");
424 ok( out[1].key == ac[1].key, "key modified\n");
425 }
426 ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
427}
428
429static void test_PrivateExtractIcons(void) {
430 const CHAR szShell32Dll[] = "shell32.dll";
431 HICON ahIcon[256];
432 UINT i, aIconId[256], cIcons, cIcons2;
433
434 if (!pPrivateExtractIconsA) return;
435
436 cIcons = pPrivateExtractIconsA("", 0, 16, 16, ahIcon, aIconId, 1, 0);
437 ok(cIcons == ~0u, "got %u\n", cIcons);
438
439 cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, NULL, NULL, 1, 0);
440 ok(cIcons == 1 || broken(cIcons == 4) /* win11 */ ||
441 broken(cIcons == 2) /* win2k */, "got %u\n", cIcons);
442
443 ahIcon[0] = (HICON)0xdeadbeef;
444 cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, ahIcon, NULL, 1, 0);
445 ok(cIcons == 1, "got %u\n", cIcons);
446 ok(ahIcon[0] != (HICON)0xdeadbeef, "icon not set\n");
447 DestroyIcon(ahIcon[0]);
448
449 ahIcon[0] = (HICON)0xdeadbeef;
450 aIconId[0] = 0xdeadbeef;
451 cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, ahIcon, aIconId, 1, 0);
452 ok(cIcons == 1, "got %u\n", cIcons);
453 ok(ahIcon[0] != (HICON)0xdeadbeef, "icon not set\n");
454 ok(aIconId[0] != 0xdeadbeef, "id not set\n");
455 DestroyIcon(ahIcon[0]);
456
457 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, NULL, NULL, 0, 0);
458 cIcons2 = pPrivateExtractIconsA(szShell32Dll, 4, MAKELONG(32,16), MAKELONG(32,16),
459 NULL, NULL, 256, 0);
460 ok((cIcons == cIcons2) && (cIcons > 0),
461 "Icon count should be independent of requested icon sizes and base icon index! "
462 "(cIcons=%d, cIcons2=%d)\n", cIcons, cIcons2);
463
464 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 0, 0);
465 ok(cIcons == 0, "Zero icons requested, got cIcons=%d\n", cIcons);
466
467 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 3, 0);
468 ok(cIcons == 3, "Three icons requested got cIcons=%d\n", cIcons);
469 for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]);
470
471 /* count must be a multiple of two when getting two sizes */
472 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32),
473 ahIcon, aIconId, 3, 0);
474 ok(cIcons == 0 /* vista */ || cIcons == 4, "Three icons requested got cIcons=%d\n", cIcons);
475 for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]);
476
477 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32),
478 ahIcon, aIconId, 4, 0);
479 ok(cIcons == 4, "Four icons requested got cIcons=%d\n", cIcons);
480 for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]);
481}
482
483static void test_LoadImage(void)
484{
485 HBITMAP bmp;
486 HRSRC hres;
487
489 ok(bmp != NULL, "Could not load a bitmap resource\n");
490 if (bmp) DeleteObject(bmp);
491
493 ok(hres != NULL, "Could not find a bitmap resource with a numeric string\n");
494
496 ok(bmp != NULL, "Could not load a bitmap resource with a numeric string\n");
497 if (bmp) DeleteObject(bmp);
498}
499
501{
505 test_accel1();
506 test_accel2();
509}
UINT cIcons
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ARRAY_SIZE(A)
Definition: main.h:20
#define NULL
Definition: types.h:112
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define CP_ACP
Definition: compat.h:109
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define WideCharToMultiByte
Definition: compat.h:111
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2803
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1235
INT WINAPI DECLSPEC_HOTPATCH LoadStringA(HINSTANCE instance, UINT resource_id, LPSTR buffer, INT buflen)
Definition: string.c:1263
#define assert(_expr)
Definition: assert.h:32
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
HINSTANCE hInst
Definition: dxdiag.c:13
pKey DeleteObject()
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define debugstr_w
Definition: kernel32.h:32
#define win_skip
Definition: minitest.h:67
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
Definition: test.h:537
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char string[160]
Definition: util.h:11
HACCEL hAccel
Definition: main.c:47
static struct test_info tests[]
BITMAP bmp
Definition: alphablend.c:62
static NTSTATUS *static PWSTR CURDIR *static HMODULE hmod
Definition: security.c:134
static HBITMAP
Definition: button.c:44
static HICON
Definition: imagelist.c:80
BOOL expected
Definition: store.c:2000
HRESULT hres
Definition: protocol.c:465
static HICON UINT UINT
Definition: resource.c:26
static void test_LoadStringA(void)
Definition: resource.c:165
static void test_LoadImage(void)
Definition: resource.c:483
static void init_function_pointers(void)
Definition: resource.c:28
static int
Definition: resource.c:26
static void test_LoadStringW(void)
Definition: resource.c:34
static void test_accel2(void)
Definition: resource.c:325
static void test_PrivateExtractIcons(void)
Definition: resource.c:429
static void test_accel1(void)
Definition: resource.c:227
unsigned int UINT
Definition: ndis.h:50
#define RT_BITMAP
Definition: pedump.c:364
short SHORT
Definition: pedump.c:59
const WCHAR * str
#define LANG_ENGLISH
Definition: nls.h:52
#define LANGIDFROMLCID(l)
Definition: nls.h:18
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define LoadStringW
Definition: utils.h:64
#define memset(x, y, z)
Definition: compat.h:39
Definition: ftp_var.h:139
Definition: copy.c:22
WORD cmd
Definition: winuser.h:3033
BYTE fVirt
Definition: winuser.h:3031
WORD key
Definition: winuser.h:3032
#define MAKELONG(a, b)
Definition: typedefs.h:249
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define ERROR_MUI_FILE_NOT_FOUND
Definition: winerror.h:3250
#define ERROR_MUI_FILE_NOT_LOADED
Definition: winerror.h:3255
#define ERROR_RESOURCE_NAME_NOT_FOUND
Definition: winerror.h:1478
int WINAPI CopyAcceleratorTableA(_In_ HACCEL hAccelSrc, _Out_writes_to_opt_(cAccelEntries, return) LPACCEL lpAccelDst, _In_ int cAccelEntries)
HBITMAP WINAPI LoadBitmapA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2517
#define FVIRTKEY
Definition: winuser.h:24
HACCEL WINAPI CreateAcceleratorTableA(_In_reads_(cAccel) LPACCEL paccel, _In_ int cAccel)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define FNOINVERT
Definition: winuser.h:22
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175