37 WCHAR copiedstringw[128], returnedstringw[128], *resourcepointer =
NULL;
38 char copiedstring[128], returnedstring[128];
39 int length1, length2, retvalue;
48 win_skip(
"LoadStringW not implemented\n" );
50 win_skip(
"LoadStringW does not return a pointer to the resource\n" );
54 ok(length2 > 0,
"LoadStringW failed to load resource 2, ret %d, err %d\n", length2,
GetLastError());
55 ok(length1 == length2,
"LoadStringW returned different values dependent on buflen. ret1 %d, ret2 %d\n",
57 ok(length1 > 0 && resourcepointer !=
NULL,
"LoadStringW failed to get pointer to resource 2, ret %d, err %d\n",
61 if(resourcepointer !=
NULL)
63 memcpy(copiedstringw, resourcepointer, length1 *
sizeof(
WCHAR));
64 copiedstringw[length1] =
'\0';
68 ok(!
memcmp(copiedstringw, returnedstringw, (length2 + 1)*
sizeof(
WCHAR)),
69 "strings don't match: returnedstring = %s, copiedstring = %s\n", returnedstring, copiedstring);
74 ok(!retvalue,
"LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
77 ok(!retvalue,
"LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
83 static const char str[] =
"String resource";
89 struct string_test
tests[] = {{
sizeof buf,
sizeof str - 1},
90 {
sizeof str,
sizeof str - 1},
91 {
sizeof str - 1,
sizeof str - 2}};
97 const unsigned int bufsiz =
tests[
i].bufsiz;
105 "bufsiz=%d: got '%s', expected '%.*s'\n",
107 ok (
buf[
len] == 0,
"bufsiz=%d: NUL termination missing\n",
127 "LoadStringA did not return -1 when called with buflen = 0, got %d, err %d\n",
133 ok( !
ret,
"LoadString returned %d\n",
ret);
134 ok(
buf[0] == 0,
"buf[0] = %c (%x)\n",
buf[0],
buf[0]);
162 ok(
r,
"destroy accelerator table\n");
190 ok(
r ==
n,
"two entries in table %u/%u\n",
r,
n);
193 ok(
r ==
n,
"still should be two entries in table %u/%u\n",
r,
n);
196 ok( ac[
n].
cmd == 1000,
"cmd 0 not preserved got %x\n", ac[
n].
cmd);
197 ok( ac[
n].
key ==
'A',
"key 0 not preserved got %x\n", ac[
n].
key);
200 if (++
n ==
r)
goto done;
201 ok( ac[
n].
cmd == 0xffff,
"cmd 1 not preserved got %x\n", ac[
n].
cmd);
202 ok( ac[
n].
key == 0xffff,
"key 1 not preserved got %x\n", ac[
n].
key);
203 ok( ac[
n].fVirt == 0x007f,
"fVirt 1 wrong got %x\n", ac[
n].fVirt);
205 if (++
n ==
r)
goto done;
206 ok( ac[
n].
cmd == 0xfff0,
"cmd 2 not preserved got %x\n", ac[
n].
cmd);
207 ok( (ac[
n].
key & 0xff) == 0xff,
"key 2 not preserved got %x\n", ac[
n].
key);
208 ok( ac[
n].fVirt == 0x0070,
"fVirt 2 wrong got %x\n", ac[
n].fVirt);
210 if (++
n ==
r)
goto done;
211 ok( ac[
n].
cmd == 0xfff0,
"cmd 3 not preserved got %x\n", ac[
n].
cmd);
212 ok( (ac[
n].
key & 0xff) == 0xff,
"key 3 not preserved got %x\n", ac[
n].
key);
213 ok( ac[
n].fVirt == 0x0000,
"fVirt 3 wrong got %x\n", ac[
n].fVirt);
215 if (++
n ==
r)
goto done;
216 ok( ac[
n].
cmd == 0xfff0,
"cmd 4 not preserved got %x\n", ac[
n].
cmd);
217 ok( ac[
n].
key == 0xffff,
"key 4 not preserved got %x\n", ac[
n].
key);
218 ok( ac[
n].fVirt == 0x0001,
"fVirt 4 wrong got %x\n", ac[
n].fVirt);
221 ok(
r,
"destroy accelerator table\n");
262 ok( hac !=
NULL ,
"fail\n");
268 ok( hac !=
NULL ,
"fail\n");
270 ok(
res == 2,
"copy null failed %d\n",
res);
272 ok(
res == 2,
"copy null failed %d\n",
res);
274 ok(
res == 2,
"copy null failed %d\n",
res);
284 ok( hac !=
NULL ,
"fail\n");
295 ok( hac !=
NULL ,
"fail\n");
303 ok( hac !=
NULL ,
"fail\n");
313 ok( hac !=
NULL ,
"fail\n");
317 ok(
out[0].fVirt == (ac[0].fVirt&0x7f),
"fVirt not modified\n");
322 memset( ac, 0xff,
sizeof ac );
324 ok( hac !=
NULL ,
"fail\n");
326 ok(
res == 2,
"copy 2 failed %d\n",
res);
329 ok(
out[0].fVirt == (ac[0].fVirt&0x7f),
"fVirt not modified\n");
334 ok(
out[1].fVirt == (ac[1].fVirt&0x7f),
"fVirt not modified\n");
341 const CHAR szShell32Dll[] =
"shell32.dll";
345 if (!pPrivateExtractIconsA)
return;
347 cIcons = pPrivateExtractIconsA(
"", 0, 16, 16, ahIcon, aIconId, 1, 0);
350 cIcons = pPrivateExtractIconsA(
"notepad.exe", 0, 16, 16,
NULL,
NULL, 1, 0);
353 ahIcon[0] = (
HICON)0xdeadbeef;
354 cIcons = pPrivateExtractIconsA(
"notepad.exe", 0, 16, 16, ahIcon,
NULL, 1, 0);
356 ok(ahIcon[0] != (
HICON)0xdeadbeef,
"icon not set\n");
359 ahIcon[0] = (
HICON)0xdeadbeef;
360 aIconId[0] = 0xdeadbeef;
361 cIcons = pPrivateExtractIconsA(
"notepad.exe", 0, 16, 16, ahIcon, aIconId, 1, 0);
363 ok(ahIcon[0] != (
HICON)0xdeadbeef,
"icon not set\n");
364 ok(aIconId[0] != 0xdeadbeef,
"id not set\n");
367 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16,
NULL,
NULL, 0, 0);
368 cIcons2 = pPrivateExtractIconsA(szShell32Dll, 4,
MAKELONG(32,16),
MAKELONG(32,16),
371 "Icon count should be independent of requested icon sizes and base icon index! "
372 "(cIcons=%d, cIcons2=%d)\n",
cIcons, cIcons2);
374 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 0, 0);
377 cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 3, 0);
383 ahIcon, aIconId, 3, 0);
388 ahIcon, aIconId, 4, 0);
399 ok(
bmp !=
NULL,
"Could not load a bitmap resource\n");
403 ok(
hres !=
NULL,
"Could not find a bitmap resource with a numeric string\n");
406 ok(
bmp !=
NULL,
"Could not load a bitmap resource with a numeric string\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define ERROR_CALL_NOT_IMPLEMENTED
#define GetProcAddress(x, y)
#define WideCharToMultiByte
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
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
#define memcpy(s1, s2, n)
static struct test_info tests[]
static PEXPLICIT_ACCESSW *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)
DWORD WINAPI GetLastError(void)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
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)
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
HACCEL WINAPI CreateAcceleratorTableA(_In_reads_(cAccel) LPACCEL paccel, _In_ int cAccel)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
BOOL WINAPI DestroyIcon(_In_ HICON)