37 WCHAR copiedstringw[128], returnedstringw[128], *resourcepointer =
NULL;
38 char copiedstring[128], returnedstring[128];
39 int length1, length2, retvalue,
i;
44 } string_table_tests[] =
47 { 13,
L"&More Windows..." },
57 { 809,
L"&Try Again" },
58 { 810,
L"&Continue" },
68 win_skip(
"LoadStringW not implemented\n" );
70 win_skip(
"LoadStringW does not return a pointer to the resource\n" );
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",
77 ok(length1 > 0 && resourcepointer !=
NULL,
"LoadStringW failed to get pointer to resource 2, ret %d, err %ld\n",
81 if(resourcepointer !=
NULL)
83 memcpy(copiedstringw, resourcepointer, length1 *
sizeof(
WCHAR));
84 copiedstringw[length1] =
'\0';
88 ok(!
memcmp(copiedstringw, returnedstringw, (length2 + 1)*
sizeof(
WCHAR)),
89 "strings don't match: returnedstring = %s, copiedstring = %s\n", returnedstring, copiedstring);
94 ok(!retvalue,
"LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
97 ok(!retvalue,
"LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
103 skip(
"Skip for Non-English system.\n");
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",
126 memset(returnedstringw, 0xcc,
sizeof(returnedstringw));
128 ok(!length1,
"got %d.\n", length1);
131 ok(!returnedstringw[0],
"got %#x.\n", returnedstringw[0]);
132 ok(returnedstringw[1] == 0xcccc,
"got %#x.\n", returnedstringw[1]);
135 memset(returnedstringw, 0xcc,
sizeof(returnedstringw));
137 ok(!length1,
"got %d.\n", length1);
140 ok(returnedstringw[0] == 0xcccc,
"got %#x.\n", returnedstringw[1]);
143 memset(returnedstringw, 0xcc,
sizeof(returnedstringw));
145 ok(!length1,
"got %d.\n", length1);
148 ok(!returnedstringw[0],
"got %#x.\n", returnedstringw[0]);
149 ok(returnedstringw[1] == 0xcccc,
"got %#x.\n", returnedstringw[1]);
153 memset(returnedstringw, 0xcc,
sizeof(returnedstringw));
155 ok(!length1,
"got %d.\n", length1);
158 ok(!returnedstringw[0] ||
broken(returnedstringw[0] == 0xcccc) ,
"got %#x.\n", returnedstringw[0]);
160 ok(!returnedstringw[0],
"got %#x.\n", returnedstringw[0]);
162 ok(returnedstringw[1] == 0xcccc,
"got %#x.\n", returnedstringw[1]);
167#if defined(__REACTOS__) && defined(_M_AMD64)
168 skip(
"LoadStringA test broken on amd64!\n");
171 static const char str[] =
"String resource";
177 struct string_test
tests[] = {{
sizeof buf,
sizeof str - 1},
178 {
sizeof str,
sizeof str - 1},
179 {
sizeof str - 1,
sizeof str - 2}};
185 const unsigned int bufsiz =
tests[
i].bufsiz;
193 "bufsiz=%d: got '%s', expected '%.*s'\n",
195 ok (
buf[
len] == 0,
"bufsiz=%d: NUL termination missing\n",
215 "LoadStringA did not return -1 when called with buflen = 0, got %d, err %ld\n",
221 ok( !
ret,
"LoadString returned %d\n",
ret);
222 ok(
buf[0] == 0,
"buf[0] = %c (%x)\n",
buf[0],
buf[0]);
251 ok(
r,
"destroy accelerator table\n");
279 ok(
r ==
n,
"two entries in table %u/%u\n",
r,
n);
282 ok(
r ==
n,
"still should be two entries in table %u/%u\n",
r,
n);
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);
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);
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);
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);
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);
310 ok(
r,
"destroy accelerator table\n");
351 ok( hac !=
NULL ,
"fail\n");
357 ok( hac !=
NULL ,
"fail\n");
359 ok(
res == 2,
"copy null failed %d\n",
res);
361 ok(
res == 2,
"copy null failed %d\n",
res);
363 ok(
res == 2,
"copy null failed %d\n",
res);
373 ok( hac !=
NULL ,
"fail\n");
384 ok( hac !=
NULL ,
"fail\n");
392 ok( hac !=
NULL ,
"fail\n");
402 ok( hac !=
NULL ,
"fail\n");
406 ok(
out[0].fVirt == (ac[0].fVirt&0x7f),
"fVirt not modified\n");
411 memset( ac, 0xff,
sizeof ac );
413 ok( hac !=
NULL ,
"fail\n");
415 ok(
res == 2,
"copy 2 failed %d\n",
res);
418 ok(
out[0].fVirt == (ac[0].fVirt&0x7f),
"fVirt not modified\n");
423 ok(
out[1].fVirt == (ac[1].fVirt&0x7f),
"fVirt not modified\n");
430 const CHAR szShell32Dll[] =
"shell32.dll";
434 if (!pPrivateExtractIconsA)
return;
436 cIcons = pPrivateExtractIconsA(
"", 0, 16, 16, ahIcon, aIconId, 1, 0);
439 cIcons = pPrivateExtractIconsA(
"notepad.exe", 0, 16, 16,
NULL,
NULL, 1, 0);
443 ahIcon[0] = (
HICON)0xdeadbeef;
444 cIcons = pPrivateExtractIconsA(
"notepad.exe", 0, 16, 16, ahIcon,
NULL, 1, 0);
446 ok(ahIcon[0] != (
HICON)0xdeadbeef,
"icon not set\n");
449 ahIcon[0] = (
HICON)0xdeadbeef;
450 aIconId[0] = 0xdeadbeef;
451 cIcons = pPrivateExtractIconsA(
"notepad.exe", 0, 16, 16, ahIcon, aIconId, 1, 0);
453 ok(ahIcon[0] != (
HICON)0xdeadbeef,
"icon not set\n");
454 ok(aIconId[0] != 0xdeadbeef,
"id not set\n");
457 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16,
NULL,
NULL, 0, 0);
458 cIcons2 = pPrivateExtractIconsA(szShell32Dll, 4,
MAKELONG(32,16),
MAKELONG(32,16),
461 "Icon count should be independent of requested icon sizes and base icon index! "
462 "(cIcons=%d, cIcons2=%d)\n",
cIcons, cIcons2);
464 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 0, 0);
467 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 3, 0);
473 ahIcon, aIconId, 3, 0);
478 ahIcon, aIconId, 4, 0);
489 ok(
bmp !=
NULL,
"Could not load a bitmap resource\n");
493 ok(
hres !=
NULL,
"Could not find a bitmap resource with a numeric string\n");
496 ok(
bmp !=
NULL,
"Could not load a bitmap resource with a numeric string\n");
#define ERROR_CALL_NOT_IMPLEMENTED
#define GetProcAddress(x, y)
#define WideCharToMultiByte
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
LCID WINAPI GetThreadLocale(void)
LCID WINAPI GetSystemDefaultLCID(void)
INT WINAPI DECLSPEC_HOTPATCH LoadStringA(HINSTANCE instance, UINT resource_id, LPSTR buffer, INT buflen)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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
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
#define memcpy(s1, s2, n)
static struct test_info tests[]
static NTSTATUS *static PWSTR CURDIR *static HMODULE hmod
static void test_LoadStringA(void)
static void test_LoadImage(void)
static void init_function_pointers(void)
static void test_LoadStringW(void)
static void test_accel2(void)
static void test_PrivateExtractIcons(void)
static void test_accel1(void)
#define LANGIDFROMLCID(l)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)
#define ERROR_MUI_FILE_NOT_FOUND
#define ERROR_MUI_FILE_NOT_LOADED
#define ERROR_RESOURCE_NAME_NOT_FOUND
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)
HACCEL WINAPI CreateAcceleratorTableA(_In_reads_(cAccel) LPACCEL paccel, _In_ int cAccel)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
BOOL WINAPI DestroyIcon(_In_ HICON)