41#define ST_CASE_SENSITIVE_COMPARE 0x00000001
54static WCHAR string[] = {
's',
't',
'r',
'i',
'n',
'g',0};
62#define X(f) if (!(p##f = (void*)GetProcAddress(hdll, #f))) \
63 p##f = (void*)GetProcAddress(hdll, "pSetup"#f);
64 X(StringTableInitialize);
65 X(StringTableInitializeEx);
66 X(StringTableAddString);
67 X(StringTableAddStringEx);
68 X(StringTableDuplicate);
69 X(StringTableDestroy);
70 X(StringTableLookUpString);
71 X(StringTableLookUpStringEx);
72 X(StringTableStringFromId);
73 X(StringTableGetExtraData);
82 table = pStringTableInitialize();
83 ok(
table !=
NULL,
"failed to initialize string table\n");
86 hstring=pStringTableAddString(
table,
string,0);
87 ok(hstring!=-1,
"Failed to add string to String Table\n");
90 ok(
retval!=-1,
"Failed to add String to String Table\n");
91 ok(hstring==
retval,
"string handle %x != String handle %x in String Table\n", hstring,
retval);
93 hfoo=pStringTableAddString(
table,
foo,0);
94 ok(hfoo!=-1,
"Failed to add foo to String Table\n");
95 ok(hfoo!=hstring,
"foo and string share the same ID %x in String Table\n", hfoo);
99 ok(hstring!=hString,
"String handle and string share same ID %x in Table\n", hstring);
101 pStringTableDestroy(
table);
110 table = pStringTableInitialize();
111 ok(
table !=
NULL,
"Failed to Initialize String Table\n");
114 hstring = pStringTableAddStringEx(
table,
string, 0,
NULL, 0);
115 ok(hstring != -1,
"Failed to add string to String Table\n");
118 ok(
retval != -1,
"Failed to add String to String Table\n");
119 ok(hstring ==
retval,
"string handle %x != String handle %x in String Table\n", hstring,
retval);
122 ok(hfoo != -1,
"Failed to add foo to String Table\n");
123 ok(hfoo != hstring,
"foo and string share the same ID %x in String Table\n", hfoo);
127 ok(hstring != hString,
"String handle and string share same ID %x in Table\n", hstring);
129 pStringTableDestroy(
table);
132 table = pStringTableInitializeEx(4, 0);
133 ok(
table !=
NULL,
"Failed to Initialize String Table\n");
136 hstring = pStringTableAddStringEx(
table,
string, 0, &
extra, 4);
137 ok(hstring != -1,
"failed to add string, %d\n", hstring);
144 hstring = pStringTableAddStringEx(
table,
string, 0, &
extra, 4);
145 ok(hstring != -1,
"failed to add string, %d\n", hstring);
151 pStringTableDestroy(
table);
158 table = pStringTableInitialize();
159 ok(
table !=
NULL,
"Failed to Initialize String Table\n");
161 table2=pStringTableDuplicate(
table);
162 ok(table2!=
NULL,
"Failed to duplicate String Table\n");
164 pStringTableDestroy(
table);
165 pStringTableDestroy(table2);
173 table = pStringTableInitialize();
174 ok(
table !=
NULL,
"failed to initialize string table\n");
176 hstring = pStringTableAddString(
table,
string, 0);
177 ok(hstring != ~0
u,
"failed to add 'string' to string table\n");
180 ok(hString != ~0
u,
"failed to add 'String' to string table\n");
182 hfoo = pStringTableAddString(
table,
foo, 0);
183 ok(hfoo != ~0
u,
"failed to add 'foo' to string table\n");
185 table2 = pStringTableDuplicate(
table);
186 ok(table2 !=
NULL,
"Failed to duplicate String Table\n");
190 ok(
retval!=-1,
"Failed find string in String Table 1\n");
192 "Lookup for string (%x) does not match previous handle (%x) in String Table 1\n",
195 retval=pStringTableLookUpString(table2,
string,0);
196 ok(
retval!=-1,
"Failed find string in String Table 2\n");
199 ok(
retval!=-1,
"Failed find String in String Table 1\n");
202 ok(
retval!=-1,
"Failed find String in String Table 2\n");
205 ok(
retval!=-1,
"Failed find foo in String Table 1\n");
207 "Lookup for foo (%x) does not match previous handle (%x) in String Table 1\n",
210 retval=pStringTableLookUpString(table2,
foo,0);
211 ok(
retval!=-1,
"Failed find foo in String Table 2\n");
216 ok(
retval!=retval2,
"Lookup of string equals String in Table 1\n");
218 "Lookup for String (%x) does not match previous handle (%x) in String Table 1\n",
221 pStringTableDestroy(
table);
222 pStringTableDestroy(table2);
227 static WCHAR uilevel[] = {
'U',
'I',
'L',
'E',
'V',
'E',
'L',0};
232 table = pStringTableInitialize();
233 ok(
table !=
NULL,
"Failed to Initialize String Table\n");
235 hstring = pStringTableAddString(
table,
string, 0);
236 ok(hstring != ~0
u,
"failed to add 'string' to string table\n");
239 ok(hString != ~0
u,
"failed to add 'String' to string table\n");
241 hfoo = pStringTableAddString(
table,
foo, 0);
242 ok(hfoo != ~0
u,
"failed to add 'foo' to string table\n");
244 table2 = pStringTableDuplicate(
table);
245 ok(table2 !=
NULL,
"Failed to duplicate String Table\n");
249 ok(
retval != ~0
u,
"Failed find string in String Table 1\n");
251 "Lookup for string (%x) does not match previous handle (%x) in String Table 1\n",
254 retval = pStringTableLookUpStringEx(table2,
string, 0,
NULL, 0);
255 ok(
retval != ~0
u,
"Failed find string in String Table 2\n");
258 ok(
retval != ~0
u,
"Failed find String in String Table 1\n");
261 ok(
retval != ~0
u,
"Failed find String in String Table 2\n");
264 ok(
retval != ~0
u,
"Failed find foo in String Table 1\n");
266 "Lookup for foo (%x) does not match previous handle (%x) in String Table 1\n",
269 retval = pStringTableLookUpStringEx(table2,
foo, 0,
NULL, 0);
270 ok(
retval != ~0
u,
"Failed find foo in String Table 2\n");
275 ok(
retval != retval2,
"Lookup of string equals String in Table 1\n");
277 "Lookup for String (%x) does not match previous handle (%x) in String Table 1\n",
280 pStringTableDestroy(
table);
282 table = pStringTableInitializeEx(0x1000, 0);
283 ok(
table !=
NULL,
"failed to initialize string table\n");
287 ok(
retval != ~0
u,
"failed to add 'UILEVEL' to string table\n");
291 ok(
retval != ~0
u,
"failed find 'UILEVEL' in string table\n");
296 ok(
retval != ~0
u,
"failed find 'UILEVEL' in string table\n");
301 ok(
retval != ~0
u,
"failed find 'UILEVEL' in string table\n");
304 pStringTableDestroy(
table);
305 pStringTableDestroy(table2);
314 table = pStringTableInitialize();
315 ok(
table !=
NULL,
"Failed to Initialize String Table\n");
317 id = pStringTableAddString(
table,
string, 0);
318 ok(
id != -1,
"failed to add 'string' to string table\n");
321 id2 = pStringTableLookUpString(
table,
string, 0);
322 ok(id2 ==
id,
"got %d and %d\n", id2,
id);
328 pStringTableDestroy(
table);
345 table = pStringTableInitialize();
346 ok(
table !=
NULL,
"failed to initialize string table\n");
351 ok(
ptr->nextoffset == 509*
sizeof(
DWORD),
"got %d\n",
ptr->nextoffset);
352 ok(
ptr->allocated != 0,
"got %d\n",
ptr->allocated);
354 ok(
ptr->unk[0] != 0,
"got %lx\n",
ptr->unk[0]);
355 ok(
ptr->unk[1] != 0,
"got %lx\n",
ptr->unk[1]);
357 ok(
ptr->max_extra_size == 0,
"got %d\n",
ptr->max_extra_size);
360 pStringTableDestroy(
table);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
LCID WINAPI GetThreadLocale(void)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
static CHAR string2[MAX_PATH]
static void test_StringTableAddString(void)
static void test_stringtable_layout(void)
static void test_StringTableAddStringEx(void)
static void test_StringTableLookUpStringEx(void)
static void load_it_up(void)
static void test_StringTableLookUpString(void)
#define ST_CASE_SENSITIVE_COMPARE
static void test_StringTableDuplicate(void)
static void test_StringTableStringFromId(void)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String