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 {
44 } string_table_tests[] =
45 {
47 { 13,
L"&More Windows..." },
57 { 809,
L"&Try Again" },
58 { 810,
L"&Continue" },
59 };
60
61
62
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 }
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",
79
80
81 if(resourcepointer !=
NULL)
82 {
83 memcpy(copiedstringw, resourcepointer, length1 *
sizeof(
WCHAR));
84 copiedstringw[length1] = '\0';
85
88 ok(!
memcmp(copiedstringw, returnedstringw, (length2 + 1)*
sizeof(
WCHAR)),
89 "strings don't match: returnedstring = %s, copiedstring = %s\n", returnedstring, copiedstring);
90 }
91
92
94 ok(!retvalue,
"LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
95
97 ok(!retvalue,
"LoadStringW returned a non-zero value when called with buffer = NULL, retvalue = %d\n", retvalue);
98
99
102 {
103 skip(
"Skip for Non-English system.\n");
104 return;
105 }
106 else
107 {
110
112 {
114
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",
119
121 }
122 }
123
124
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]);
133
135 memset(returnedstringw, 0xcc,
sizeof(returnedstringw));
137 ok(!length1,
"got %d.\n", length1);
140 ok(returnedstringw[0] == 0xcccc,
"got %#x.\n", returnedstringw[1]);
141
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]);
150
151
153 memset(returnedstringw, 0xcc,
sizeof(returnedstringw));
155 ok(!length1,
"got %d.\n", length1);
157#ifdef __REACTOS__
158 ok(!returnedstringw[0] ||
broken(returnedstringw[0] == 0xcccc) ,
"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}
#define ERROR_CALL_NOT_IMPLEMENTED
#define WideCharToMultiByte
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
LCID WINAPI GetThreadLocale(void)
LCID WINAPI GetSystemDefaultLCID(void)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
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)
#define LANGIDFROMLCID(l)
#define ERROR_MUI_FILE_NOT_FOUND
#define ERROR_MUI_FILE_NOT_LOADED
#define ERROR_RESOURCE_NAME_NOT_FOUND