2 * Unit tests for advpack.dll
4 * Copyright (C) 2005 Robert Reif
5 * Copyright (C) 2005 Sami Aario
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/test.h"
28 /* defines for the TranslateInfString/Ex tests */
29 #define TEST_STRING1 "\\Application Name"
30 #define TEST_STRING2 "%49001%\\Application Name"
32 /* defines for the SetPerUserSecValues tests */
33 #define GUID_KEY "SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\guid"
34 #define REG_VAL_EXISTS(key, value) !RegQueryValueEx(key, value, NULL, NULL, NULL, NULL)
35 #define OPEN_GUID_KEY() !RegOpenKey(HKEY_LOCAL_MACHINE, GUID_KEY, &guid)
37 static HRESULT (WINAPI *pCloseINFEngine)(HINF);
38 static HRESULT (WINAPI *pDelNode)(LPCSTR,DWORD);
39 static HRESULT (WINAPI *pGetVersionFromFile)(LPCSTR,LPDWORD,LPDWORD,BOOL);
40 static HRESULT (WINAPI *pOpenINFEngine)(PCSTR,PCSTR,DWORD,HINF*,PVOID);
41 static HRESULT (WINAPI *pSetPerUserSecValues)(PPERUSERSECTION pPerUser);
42 static HRESULT (WINAPI *pTranslateInfString)(LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPSTR,DWORD,LPDWORD,LPVOID);
43 static HRESULT (WINAPI *pTranslateInfStringEx)(HINF,PCSTR,PCSTR,PCSTR,PSTR,DWORD,PDWORD,PVOID);
45 static CHAR inf_file[MAX_PATH];
46 static CHAR PROG_FILES[MAX_PATH];
47 static DWORD PROG_FILES_LEN;
49 static void get_progfiles_dir(void)
52 DWORD size = MAX_PATH;
54 RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey);
55 RegQueryValueExA(hkey, "ProgramFilesDir", NULL, NULL, (LPBYTE)PROG_FILES, &size);
58 lstrcatA(PROG_FILES, TEST_STRING1);
59 PROG_FILES_LEN = lstrlenA(PROG_FILES) + 1;
62 static BOOL init_function_pointers(void)
64 HMODULE hAdvPack = LoadLibraryA("advpack.dll");
69 pCloseINFEngine = (void*)GetProcAddress(hAdvPack, "CloseINFEngine");
70 pDelNode = (void *)GetProcAddress(hAdvPack, "DelNode");
71 pGetVersionFromFile = (void *)GetProcAddress(hAdvPack, "GetVersionFromFile");
72 pOpenINFEngine = (void*)GetProcAddress(hAdvPack, "OpenINFEngine");
73 pSetPerUserSecValues = (void*)GetProcAddress(hAdvPack, "SetPerUserSecValues");
74 pTranslateInfString = (void *)GetProcAddress(hAdvPack, "TranslateInfString");
75 pTranslateInfStringEx = (void*)GetProcAddress(hAdvPack, "TranslateInfStringEx");
77 if (!pCloseINFEngine || !pDelNode || !pGetVersionFromFile ||
78 !pOpenINFEngine || !pSetPerUserSecValues || !pTranslateInfString)
84 static void version_test(void)
90 hr = pGetVersionFromFile("kernel32.dll", &major, &minor, FALSE);
91 ok (hr == S_OK, "GetVersionFromFileEx(kernel32.dll) failed, returned "
93 trace("kernel32.dll Language ID: 0x%08x, Codepage ID: 0x%08x\n",
97 hr = pGetVersionFromFile("kernel32.dll", &major, &minor, TRUE);
98 ok (hr == S_OK, "GetVersionFromFileEx(kernel32.dll) failed, returned "
100 trace("kernel32.dll version: %d.%d.%d.%d\n", HIWORD(major), LOWORD(major),
101 HIWORD(minor), LOWORD(minor));
104 hr = pGetVersionFromFile("advpack.dll", &major, &minor, FALSE);
105 ok (hr == S_OK, "GetVersionFromFileEx(advpack.dll) failed, returned "
107 trace("advpack.dll Language ID: 0x%08x, Codepage ID: 0x%08x\n",
111 hr = pGetVersionFromFile("advpack.dll", &major, &minor, TRUE);
112 ok (hr == S_OK, "GetVersionFromFileEx(advpack.dll) failed, returned "
114 trace("advpack.dll version: %d.%d.%d.%d\n", HIWORD(major), LOWORD(major),
115 HIWORD(minor), LOWORD(minor));
118 static void delnode_test(void)
122 CHAR currDir[MAX_PATH];
125 /* Native DelNode apparently does not support relative paths, so we use
126 absolute paths for testing */
127 currDirLen = GetCurrentDirectoryA(sizeof(currDir) / sizeof(CHAR), currDir);
128 assert(currDirLen > 0 && currDirLen < sizeof(currDir) / sizeof(CHAR));
130 if(currDir[currDirLen - 1] == '\\')
131 currDir[--currDirLen] = 0;
133 /* Simple tests; these should fail. */
134 hr = pDelNode(NULL, 0);
135 ok (hr == E_FAIL, "DelNode called with NULL pathname should return E_FAIL\n");
136 hr = pDelNode("", 0);
137 ok (hr == E_FAIL, "DelNode called with empty pathname should return E_FAIL\n");
139 /* Test deletion of a file. */
140 hn = CreateFile("DelNodeTestFile1", GENERIC_WRITE, 0, NULL,
141 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
142 assert(hn != INVALID_HANDLE_VALUE);
144 hr = pDelNode(lstrcat(currDir, "\\DelNodeTestFile1"), 0);
145 ok (hr == S_OK, "DelNode failed deleting a single file\n");
146 currDir[currDirLen] = '\0';
148 /* Test deletion of an empty directory. */
149 CreateDirectoryA("DelNodeTestDir", NULL);
150 hr = pDelNode(lstrcat(currDir, "\\DelNodeTestDir"), 0);
151 ok (hr == S_OK, "DelNode failed deleting an empty directory\n");
152 currDir[currDirLen] = '\0';
154 /* Test deletion of a directory containing one file. */
155 CreateDirectoryA("DelNodeTestDir", NULL);
156 hn = CreateFile("DelNodeTestDir\\DelNodeTestFile1", GENERIC_WRITE, 0, NULL,
157 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
158 assert(hn != INVALID_HANDLE_VALUE);
160 hr = pDelNode(lstrcat(currDir, "\\DelNodeTestDir"), 0);
161 ok (hr == S_OK, "DelNode failed deleting a directory containing one file\n");
162 currDir[currDirLen] = '\0';
164 /* Test deletion of a directory containing multiple files. */
165 CreateDirectoryA("DelNodeTestDir", NULL);
166 hn = CreateFile("DelNodeTestDir\\DelNodeTestFile1", GENERIC_WRITE, 0, NULL,
167 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
168 assert(hn != INVALID_HANDLE_VALUE);
170 hn = CreateFile("DelNodeTestDir\\DelNodeTestFile2", GENERIC_WRITE, 0, NULL,
171 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
172 assert(hn != INVALID_HANDLE_VALUE);
174 hn = CreateFile("DelNodeTestDir\\DelNodeTestFile3", GENERIC_WRITE, 0, NULL,
175 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
176 assert(hn != INVALID_HANDLE_VALUE);
178 hr = pDelNode(lstrcat(currDir, "\\DelNodeTestDir"), 0);
179 ok (hr == S_OK, "DelNode failed deleting a directory containing multiple files\n");
180 currDir[currDirLen] = '\0';
183 static void append_str(char **str, const char *data)
186 *str += strlen(*str);
189 static void create_inf_file(void)
193 DWORD dwNumberOfBytesWritten;
194 HANDLE hf = CreateFile(inf_file, GENERIC_WRITE, 0, NULL,
195 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
197 append_str(&ptr, "[Version]\n");
198 append_str(&ptr, "Signature=\"$Chicago$\"\n");
199 append_str(&ptr, "[CustInstDestSection]\n");
200 append_str(&ptr, "49001=ProgramFilesDir\n");
201 append_str(&ptr, "[ProgramFilesDir]\n");
202 append_str(&ptr, "HKLM,\"Software\\Microsoft\\Windows\\CurrentVersion\",");
203 append_str(&ptr, "\"ProgramFilesDir\",,\"%%24%%\\%%LProgramF%%\"\n");
204 append_str(&ptr, "[section]\n");
205 append_str(&ptr, "NotACustomDestination=Version\n");
206 append_str(&ptr, "CustomDestination=CustInstDestSection\n");
207 append_str(&ptr, "[Options.NTx86]\n");
208 append_str(&ptr, "49001=ProgramFilesDir\n");
209 append_str(&ptr, "InstallDir=%%49001%%\\%%DefaultAppPath%%\n");
210 append_str(&ptr, "CustomHDestination=CustInstDestSection\n");
211 append_str(&ptr, "[Strings]\n");
212 append_str(&ptr, "DefaultAppPath=\"Application Name\"\n");
213 append_str(&ptr, "LProgramF=\"Program Files\"\n");
215 WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL);
219 static void translateinfstring_test(void)
222 char buffer[MAX_PATH];
227 /* pass in a couple invalid parameters */
228 hr = pTranslateInfString(NULL, NULL, NULL, NULL, buffer, MAX_PATH, &dwSize, NULL);
229 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", (UINT)hr);
231 /* try to open an inf file that doesn't exist */
232 hr = pTranslateInfString("c:\\a.inf", "Options.NTx86", "Options.NTx86",
233 "InstallDir", buffer, MAX_PATH, &dwSize, NULL);
234 ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || hr == E_INVALIDARG ||
235 hr == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND),
236 "Expected E_INVALIDARG, 0x80070002 or 0x8007007e, got 0x%08x\n", (UINT)hr);
238 if(hr == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))
240 trace("WinNT 3.51 detected. Skipping tests for TranslateInfString()\n");
244 /* try a nonexistent section */
246 hr = pTranslateInfString(inf_file, "idontexist", "Options.NTx86",
247 "InstallDir", buffer, MAX_PATH, &dwSize, NULL);
248 ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", (UINT)hr);
249 ok(!strcmp(buffer, TEST_STRING2), "Expected %s, got %s\n", TEST_STRING2, buffer);
250 ok(dwSize == 25, "Expected size 25, got %d\n", dwSize);
253 /* try other nonexistent section */
254 hr = pTranslateInfString(inf_file, "Options.NTx86", "idontexist",
255 "InstallDir", buffer, MAX_PATH, &dwSize, NULL);
256 ok(hr == SPAPI_E_LINE_NOT_FOUND || hr == E_INVALIDARG,
257 "Expected SPAPI_E_LINE_NOT_FOUND or E_INVALIDARG, got 0x%08x\n", (UINT)hr);
260 /* try nonexistent key */
261 hr = pTranslateInfString(inf_file, "Options.NTx86", "Options.NTx86",
262 "notvalid", buffer, MAX_PATH, &dwSize, NULL);
263 ok(hr == SPAPI_E_LINE_NOT_FOUND || hr == E_INVALIDARG,
264 "Expected SPAPI_E_LINE_NOT_FOUND or E_INVALIDARG, got 0x%08x\n", (UINT)hr);
267 /* test the behavior of pszInstallSection */
268 hr = pTranslateInfString(inf_file, "section", "Options.NTx86",
269 "InstallDir", buffer, MAX_PATH, &dwSize, NULL);
270 ok(hr == ERROR_SUCCESS || hr == E_FAIL,
271 "Expected ERROR_SUCCESS or E_FAIL, got 0x%08x\n", (UINT)hr);
273 if(hr == ERROR_SUCCESS)
275 ok(!strcmp(buffer, PROG_FILES), "Expected '%s', got '%s'\n", PROG_FILES, buffer);
276 ok(dwSize == PROG_FILES_LEN, "Expected size %d, got %d\n", PROG_FILES_LEN, dwSize);
280 /* try without a pszInstallSection */
281 hr = pTranslateInfString(inf_file, NULL, "Options.NTx86",
282 "InstallDir", buffer, MAX_PATH, &dwSize, NULL);
283 ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", (UINT)hr);
286 ok(!strcmp(buffer, TEST_STRING2), "Expected %s, got %s\n", TEST_STRING2, buffer);
287 ok(dwSize == 25, "Expected size 25, got %d\n", dwSize);
290 DeleteFile("c:\\a.inf");
291 DeleteFile(inf_file);
294 static void translateinfstringex_test(void)
298 char buffer[MAX_PATH];
299 DWORD size = MAX_PATH;
303 /* need to see if there are any flags */
305 /* try a NULL filename */
306 hr = pOpenINFEngine(NULL, "Options.NTx86", 0, &hinf, NULL);
307 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
309 /* try an empty filename */
310 hr = pOpenINFEngine("", "Options.NTx86", 0, &hinf, NULL);
311 ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
312 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08x\n", hr);
314 /* try a NULL hinf */
315 hr = pOpenINFEngine(inf_file, "Options.NTx86", 0, NULL, NULL);
316 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
318 /* open the INF without the Install section specified */
319 hr = pOpenINFEngine(inf_file, NULL, 0, &hinf, NULL);
320 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
322 /* try a NULL hinf */
323 hr = pTranslateInfStringEx(NULL, inf_file, "Options.NTx86", "InstallDir",
324 buffer, size, &size, NULL);
325 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
327 /* try a NULL filename */
328 hr = pTranslateInfStringEx(hinf, NULL, "Options.NTx86", "InstallDir",
329 buffer, size, &size, NULL);
330 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
332 /* try an empty filename */
333 memset(buffer, 'a', 25);
336 hr = pTranslateInfStringEx(hinf, "", "Options.NTx86", "InstallDir",
337 buffer, size, &size, NULL);
338 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
341 ok(!strcmp(buffer, TEST_STRING2), "Expected %s, got %s\n", TEST_STRING2, buffer);
342 ok(size == 25, "Expected size 25, got %d\n", size);
345 /* try a NULL translate section */
346 hr = pTranslateInfStringEx(hinf, inf_file, NULL, "InstallDir",
347 buffer, size, &size, NULL);
348 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
350 /* try an empty translate section */
351 hr = pTranslateInfStringEx(hinf, inf_file, "", "InstallDir",
352 buffer, size, &size, NULL);
353 ok(hr == SPAPI_E_LINE_NOT_FOUND, "Expected SPAPI_E_LINE_NOT_FOUND, got %08x\n", hr);
355 /* try a NULL translate key */
356 hr = pTranslateInfStringEx(hinf, inf_file, "Options.NTx86", NULL,
357 buffer, size, &size, NULL);
358 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
360 /* try an empty translate key */
361 hr = pTranslateInfStringEx(hinf, inf_file, "Options.NTx86", "",
362 buffer, size, &size, NULL);
363 ok(hr == SPAPI_E_LINE_NOT_FOUND, "Expected SPAPI_E_LINE_NOT_FOUND, got %08x\n", hr);
365 /* successfully translate the string */
366 memset(buffer, 'a', 25);
369 hr = pTranslateInfStringEx(hinf, inf_file, "Options.NTx86", "InstallDir",
370 buffer, size, &size, NULL);
371 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
374 ok(!strcmp(buffer, TEST_STRING2), "Expected %s, got %s\n", TEST_STRING2, buffer);
375 ok(size == 25, "Expected size 25, got %d\n", size);
378 /* try a NULL hinf */
379 hr = pCloseINFEngine(NULL);
380 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
382 /* successfully close the hinf */
383 hr = pCloseINFEngine(hinf);
384 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
386 /* open the inf with the install section */
387 hr = pOpenINFEngine(inf_file, "section", 0, &hinf, NULL);
388 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
390 /* translate the string with the install section specified */
391 memset(buffer, 'a', PROG_FILES_LEN);
392 buffer[PROG_FILES_LEN - 1] = '\0';
394 hr = pTranslateInfStringEx(hinf, inf_file, "Options.NTx86", "InstallDir",
395 buffer, size, &size, NULL);
396 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
397 ok(!strcmp(buffer, PROG_FILES), "Expected %s, got %s\n", PROG_FILES, buffer);
398 ok(size == PROG_FILES_LEN, "Expected size %d, got %d\n", PROG_FILES_LEN, size);
400 /* close the INF again */
401 hr = pCloseINFEngine(hinf);
402 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
404 DeleteFileA(inf_file);
407 static BOOL check_reg_str(HKEY hkey, LPCSTR name, LPCSTR value)
409 DWORD size = MAX_PATH;
410 char check[MAX_PATH];
412 if (RegQueryValueEx(hkey, name, NULL, NULL, (LPBYTE)check, &size))
415 return !lstrcmp(check, value);
418 static BOOL check_reg_dword(HKEY hkey, LPCSTR name, DWORD value)
420 DWORD size = sizeof(DWORD);
423 if (RegQueryValueEx(hkey, name, NULL, NULL, (LPBYTE)&check, &size))
426 return (check == value);
429 static void setperusersecvalues_test(void)
431 PERUSERSECTION peruser;
435 lstrcpy(peruser.szDispName, "displayname");
436 lstrcpy(peruser.szLocale, "locale");
437 lstrcpy(peruser.szStub, "stub");
438 lstrcpy(peruser.szVersion, "1,1,1,1");
439 lstrcpy(peruser.szCompID, "compid");
440 peruser.dwIsInstalled = 1;
441 peruser.bRollback = FALSE;
443 /* try a NULL pPerUser */
446 /* This crashes on systems with IE7 */
447 hr = pSetPerUserSecValues(NULL);
449 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
450 ok(!OPEN_GUID_KEY(), "Expected guid key to not exist\n");
453 /* at the very least, szGUID must be valid */
454 peruser.szGUID[0] = '\0';
455 hr = pSetPerUserSecValues(&peruser);
456 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
457 ok(!OPEN_GUID_KEY(), "Expected guid key to not exist\n");
459 /* set initial values */
460 lstrcpy(peruser.szGUID, "guid");
461 hr = pSetPerUserSecValues(&peruser);
462 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
463 ok(OPEN_GUID_KEY(), "Expected guid key to exist\n");
464 ok(check_reg_str(guid, NULL, "displayname"), "Expected displayname\n");
465 ok(check_reg_str(guid, "ComponentID", "compid"), "Expected compid\n");
466 ok(check_reg_str(guid, "Locale", "locale"), "Expected locale\n");
467 ok(check_reg_str(guid, "StubPath", "stub"), "Expected stub\n");
468 ok(check_reg_str(guid, "Version", "1,1,1,1"), "Expected 1,1,1,1\n");
469 ok(check_reg_dword(guid, "IsInstalled", 1), "Expected 1\n");
470 ok(!REG_VAL_EXISTS(guid, "OldDisplayName"), "Expected OldDisplayName to not exist\n");
471 ok(!REG_VAL_EXISTS(guid, "OldLocale"), "Expected OldLocale to not exist\n");
472 ok(!REG_VAL_EXISTS(guid, "OldStubPath"), "Expected OldStubPath to not exist\n");
473 ok(!REG_VAL_EXISTS(guid, "OldVersion"), "Expected OldVersion to not exist\n");
474 ok(!REG_VAL_EXISTS(guid, "RealStubPath"), "Expected RealStubPath to not exist\n");
476 /* raise the version, but bRollback is FALSE, so vals not saved */
477 lstrcpy(peruser.szVersion, "2,1,1,1");
478 hr = pSetPerUserSecValues(&peruser);
479 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
480 ok(check_reg_str(guid, NULL, "displayname"), "Expected displayname\n");
481 ok(check_reg_str(guid, "ComponentID", "compid"), "Expected compid\n");
482 ok(check_reg_str(guid, "Locale", "locale"), "Expected locale\n");
483 ok(check_reg_str(guid, "StubPath", "stub"), "Expected stub\n");
484 ok(check_reg_str(guid, "Version", "2,1,1,1"), "Expected 2,1,1,1\n");
485 ok(check_reg_dword(guid, "IsInstalled", 1), "Expected 1\n");
486 ok(!REG_VAL_EXISTS(guid, "OldDisplayName"), "Expected OldDisplayName to not exist\n");
487 ok(!REG_VAL_EXISTS(guid, "OldLocale"), "Expected OldLocale to not exist\n");
488 ok(!REG_VAL_EXISTS(guid, "OldStubPath"), "Expected OldStubPath to not exist\n");
489 ok(!REG_VAL_EXISTS(guid, "OldVersion"), "Expected OldVersion to not exist\n");
490 ok(!REG_VAL_EXISTS(guid, "RealStubPath"), "Expected RealStubPath to not exist\n");
492 /* raise the version again, bRollback is TRUE so vals are saved */
493 peruser.bRollback = TRUE;
494 lstrcpy(peruser.szVersion, "3,1,1,1");
495 hr = pSetPerUserSecValues(&peruser);
496 ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
497 ok(check_reg_str(guid, NULL, "displayname"), "Expected displayname\n");
498 ok(check_reg_str(guid, "ComponentID", "compid"), "Expected compid\n");
499 ok(check_reg_str(guid, "Locale", "locale"), "Expected locale\n");
500 ok(check_reg_dword(guid, "IsInstalled", 1), "Expected 1\n");
501 ok(check_reg_str(guid, "Version", "3,1,1,1"), "Expected 3,1,1,1\n");
504 ok(check_reg_str(guid, "OldDisplayName", "displayname"), "Expected displayname\n");
505 ok(check_reg_str(guid, "OldLocale", "locale"), "Expected locale\n");
506 ok(check_reg_str(guid, "RealStubPath", "stub"), "Expected stub\n");
507 ok(check_reg_str(guid, "OldStubPath", "stub"), "Expected stub\n");
508 ok(check_reg_str(guid, "OldVersion", "2,1,1,1"), "Expected 2,1,1,1\n");
509 ok(check_reg_str(guid, "StubPath",
510 "rundll32.exe advpack.dll,UserInstStubWrapper guid"),
511 "Expected real stub\n");
514 RegDeleteKey(HKEY_LOCAL_MACHINE, GUID_KEY);
519 if (!init_function_pointers())
522 /* Make sure we create the temporary file in a directory
523 * were we have enough rights
525 GetTempPath(MAX_PATH, inf_file);
526 lstrcat(inf_file,"test.inf");
532 setperusersecvalues_test();
533 translateinfstring_test();
534 translateinfstringex_test();