2 * Unit test for setupapi.dll install functions
4 * Copyright 2007 Misha Koshelev
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
35 #include "wine/test.h"
37 static const char inffile[] = "test.inf";
38 static const WCHAR inffileW[] = {'t','e','s','t','.','i','n','f',0};
39 static char CURR_DIR[MAX_PATH];
41 /* Notes on InstallHinfSectionA/W:
42 * - InstallHinfSectionW on Win98 and InstallHinfSectionA on WinXP seem to be stubs - they do not do anything
43 * and simply return without displaying any error message or setting last error. We test whether
44 * InstallHinfSectionA sets last error, and if it doesn't we set it to NULL and use the W version if available.
45 * - These functions do not return a value and do not always set last error to ERROR_SUCCESS when installation still
46 * occurs (e.g., unquoted inf file with spaces, registry keys are written but last error is 6). Also, on Win98 last error
47 * is set to ERROR_SUCCESS even if install fails (e.g., quoted inf file with spaces, no registry keys set, MessageBox with
48 * "Installation Error" displayed). Thus, we must use functional tests (e.g., is registry key created) to determine whether
49 * or not installation occurred.
50 * - On installation problems, a MessageBox() is displayed and a Beep() is issued. The MessageBox() is disabled with a
54 static void (WINAPI *pInstallHinfSectionA)(HWND, HINSTANCE, LPCSTR, INT);
55 static void (WINAPI *pInstallHinfSectionW)(HWND, HINSTANCE, LPCWSTR, INT);
56 static BOOL (WINAPI *pSetupGetInfFileListW)(PCWSTR, DWORD, PWSTR, DWORD, PDWORD);
62 static void create_inf_file(LPCSTR filename, const char *data)
65 HANDLE handle = CreateFile(filename, GENERIC_WRITE, 0, NULL,
66 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
67 assert(handle != INVALID_HANDLE_VALUE);
68 assert(WriteFile(handle, data, strlen(data), &res, NULL));
72 /* CBT hook to ensure a window (e.g., MessageBox) cannot be created */
74 static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
76 return nCode == HCBT_CREATEWND ? 1: CallNextHookEx(hhook, nCode, wParam, lParam);
83 static const char *cmdline_inf = "[Version]\n"
84 "Signature=\"$Chicago$\"\n"
86 "AddReg=Add.Settings\n"
88 "HKCU,Software\\Wine\\setupapitest,,\n";
90 static void run_cmdline(LPCSTR section, int mode, LPCSTR path)
92 CHAR cmdline[MAX_PATH * 2];
94 sprintf(cmdline, "%s %d %s", section, mode, path);
95 if (pInstallHinfSectionA) pInstallHinfSectionA(NULL, NULL, cmdline, 0);
98 WCHAR cmdlinew[MAX_PATH * 2];
99 MultiByteToWideChar(CP_ACP, 0, cmdline, -1, cmdlinew, MAX_PATH*2);
100 pInstallHinfSectionW(NULL, NULL, cmdlinew, 0);
104 static void ok_registry(BOOL expectsuccess)
108 /* Functional tests for success of install and clean up */
109 ret = RegDeleteKey(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
110 ok((expectsuccess && ret == ERROR_SUCCESS) ||
111 (!expectsuccess && ret == ERROR_FILE_NOT_FOUND),
112 "Expected registry key Software\\Wine\\setupapitest to %s, RegDeleteKey returned %d\n",
113 expectsuccess ? "exist" : "not exist",
117 /* Test command line processing */
118 static void test_cmdline(void)
120 static const char infwithspaces[] = "test file.inf";
123 create_inf_file(inffile, cmdline_inf);
124 sprintf(path, "%s\\%s", CURR_DIR, inffile);
125 run_cmdline("DefaultInstall", 128, path);
127 ok(DeleteFile(inffile), "Expected source inf to exist, last error was %d\n", GetLastError());
129 /* Test handling of spaces in path, unquoted and quoted */
130 create_inf_file(infwithspaces, cmdline_inf);
132 sprintf(path, "%s\\%s", CURR_DIR, infwithspaces);
133 run_cmdline("DefaultInstall", 128, path);
136 sprintf(path, "\"%s\\%s\"", CURR_DIR, infwithspaces);
137 run_cmdline("DefaultInstall", 128, path);
140 ok(DeleteFile(infwithspaces), "Expected source inf to exist, last error was %d\n", GetLastError());
143 static const char *cmdline_inf_reg = "[Version]\n"
144 "Signature=\"$Chicago$\"\n"
146 "DelReg=Del.Settings\n"
148 "HKCU,Software\\Wine\\setupapitest\n";
150 static void test_registry(void)
156 /* First create a registry structure we would like to be deleted */
157 ok(!RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest\\setupapitest", &key),
158 "Expected RegCreateKeyA to succeed\n");
160 /* Doublecheck if the registry key is present */
161 ok(!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest\\setupapitest", &key),
162 "Expected registry key to exist\n");
164 create_inf_file(inffile, cmdline_inf_reg);
165 sprintf(path, "%s\\%s", CURR_DIR, inffile);
166 run_cmdline("DefaultInstall", 128, path);
168 /* Check if the registry key is recursively deleted */
169 res = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest", &key);
171 ok(res == ERROR_FILE_NOT_FOUND, "Didn't expect the registry key to exist\n");
173 if (res == ERROR_SUCCESS)
175 RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest\\setupapitest");
176 RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
178 ok(DeleteFile(inffile), "Expected source inf to exist, last error was %d\n", GetLastError());
181 static void test_install_svc_from(void)
187 SC_HANDLE scm_handle, svc_handle;
189 /* Bail out if we are on win98 */
190 SetLastError(0xdeadbeef);
191 scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL);
193 if (!scm_handle && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
195 win_skip("OpenSCManagerA is not implemented, we are most likely on win9x\n");
198 CloseServiceHandle(scm_handle);
200 /* Basic inf file to satisfy SetupOpenInfFileA */
201 strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n");
202 create_inf_file(inffile, inf);
203 sprintf(path, "%s\\%s", CURR_DIR, inffile);
204 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
206 /* Nothing but the Version section */
207 SetLastError(0xdeadbeef);
208 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
209 ok(!ret, "Expected failure\n");
210 ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
211 "Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
212 SetupCloseInfFile(infhandle);
215 /* Add the section */
216 strcat(inf, "[Winetest.Services]\n");
217 create_inf_file(inffile, inf);
218 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
219 SetLastError(0xdeadbeef);
220 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
221 ok(!ret, "Expected failure\n");
222 ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
223 "Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
224 SetupCloseInfFile(infhandle);
227 /* Add a reference */
228 strcat(inf, "AddService=Winetest,,Winetest.Service\n");
229 create_inf_file(inffile, inf);
230 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
231 SetLastError(0xdeadbeef);
232 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
233 ok(!ret, "Expected failure\n");
234 ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
235 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
236 SetupCloseInfFile(infhandle);
239 /* Add the section */
240 strcat(inf, "[Winetest.Service]\n");
241 create_inf_file(inffile, inf);
242 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
243 SetLastError(0xdeadbeef);
244 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
245 ok(!ret, "Expected failure\n");
246 ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
247 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
248 SetupCloseInfFile(infhandle);
251 /* Just the ServiceBinary */
252 strcat(inf, "ServiceBinary=%12%\\winetest.sys\n");
253 create_inf_file(inffile, inf);
254 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
255 SetLastError(0xdeadbeef);
256 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
257 ok(!ret, "Expected failure\n");
258 ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
259 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
260 SetupCloseInfFile(infhandle);
263 /* Add the ServiceType */
264 strcat(inf, "ServiceType=1\n");
265 create_inf_file(inffile, inf);
266 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
267 SetLastError(0xdeadbeef);
268 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
269 ok(!ret, "Expected failure\n");
270 ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
271 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
272 SetupCloseInfFile(infhandle);
275 /* Add the StartType */
276 strcat(inf, "StartType=4\n");
277 create_inf_file(inffile, inf);
278 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
279 SetLastError(0xdeadbeef);
280 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
281 ok(!ret, "Expected failure\n");
282 ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
283 "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
284 SetupCloseInfFile(infhandle);
287 /* This should be it, the minimal entries to install a service */
288 strcat(inf, "ErrorControl=1");
289 create_inf_file(inffile, inf);
290 infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
291 SetLastError(0xdeadbeef);
292 ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
293 if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
295 skip("Not enough rights to install the service\n");
296 SetupCloseInfFile(infhandle);
300 ok(ret, "Expected success\n");
301 ok(GetLastError() == ERROR_SUCCESS,
302 "Expected ERROR_SUCCESS, got %08x\n", GetLastError());
303 SetupCloseInfFile(infhandle);
306 scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL);
308 /* Open the service to see if it's really there */
309 svc_handle = OpenServiceA(scm_handle, "Winetest", DELETE);
310 ok(svc_handle != NULL, "Service was not created\n");
312 SetLastError(0xdeadbeef);
313 ret = DeleteService(svc_handle);
314 ok(ret, "Service could not be deleted : %d\n", GetLastError());
316 CloseServiceHandle(svc_handle);
317 CloseServiceHandle(scm_handle);
319 /* TODO: Test the Flags */
322 static void test_driver_install(void)
325 SC_HANDLE scm_handle, svc_handle;
327 char path[MAX_PATH], windir[MAX_PATH], driver[MAX_PATH];
329 /* Minimal stuff needed */
330 static const char *inf =
332 "Signature=\"$Chicago$\"\n"
333 "[DestinationDirs]\n"
334 "Winetest.DriverFiles=12\n"
336 "CopyFiles=Winetest.DriverFiles\n"
337 "[DefaultInstall.Services]\n"
338 "AddService=Winetest,,Winetest.Service\n"
339 "[Winetest.Service]\n"
340 "ServiceBinary=%12%\\winetest.sys\n"
344 "[Winetest.DriverFiles]\n"
347 /* Bail out if we are on win98 */
348 SetLastError(0xdeadbeef);
349 scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL);
351 if (!scm_handle && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
353 win_skip("OpenSCManagerA is not implemented, we are most likely on win9x\n");
356 else if (!scm_handle && (GetLastError() == ERROR_ACCESS_DENIED))
358 skip("Not enough rights to install the service\n");
361 CloseServiceHandle(scm_handle);
363 /* Place where we expect the driver to be installed */
364 GetWindowsDirectoryA(windir, MAX_PATH);
365 lstrcpyA(driver, windir);
366 lstrcatA(driver, "\\system32\\drivers\\winetest.sys");
368 /* Create a dummy driver file */
369 handle = CreateFileA("winetest.sys", GENERIC_WRITE, 0, NULL,
370 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
373 create_inf_file(inffile, inf);
374 sprintf(path, "%s\\%s", CURR_DIR, inffile);
375 run_cmdline("DefaultInstall", 128, path);
377 /* Driver should have been installed */
378 attrs = GetFileAttributes(driver);
379 ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected driver to exist\n");
381 scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL);
383 /* Open the service to see if it's really there */
384 svc_handle = OpenServiceA(scm_handle, "Winetest", DELETE);
385 ok(svc_handle != NULL, "Service was not created\n");
387 SetLastError(0xdeadbeef);
388 ret = DeleteService(svc_handle);
389 ok(ret, "Service could not be deleted : %d\n", GetLastError());
391 CloseServiceHandle(svc_handle);
392 CloseServiceHandle(scm_handle);
396 DeleteFile("winetest.sys");
400 static void test_profile_items(void)
402 char path[MAX_PATH], commonprogs[MAX_PATH];
404 BOOL (WINAPI *pSHGetFolderPathA)(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
406 static const char *inf =
408 "Signature=\"$Chicago$\"\n"
410 "ProfileItems=TestItem,TestItem2,TestGroup\n"
413 "CmdLine=11,,notepad.exe\n"
416 "CmdLine=11,,notepad.exe\n"
422 hShell32 = LoadLibraryA("shell32");
423 pSHGetFolderPathA = (void*)GetProcAddress(hShell32, "SHGetFolderPathA");
424 if (!pSHGetFolderPathA)
426 win_skip("SHGetFolderPathA is not available\n");
430 if (S_OK != pSHGetFolderPathA(NULL, CSIDL_COMMON_PROGRAMS, NULL, SHGFP_TYPE_CURRENT, commonprogs))
432 skip("No common program files directory exists\n");
436 create_inf_file(inffile, inf);
437 sprintf(path, "%s\\%s", CURR_DIR, inffile);
438 run_cmdline("DefaultInstall", 128, path);
440 snprintf(path, MAX_PATH, "%s\\TestItem.lnk", commonprogs);
441 if (INVALID_FILE_ATTRIBUTES == GetFileAttributes(path))
443 win_skip("ProfileItems not implemented on this system\n");
447 snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs);
448 ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "directory not created\n");
449 snprintf(path, MAX_PATH, "%s\\TestDir\\TestItem2.lnk", commonprogs);
450 ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "link not created\n");
451 snprintf(path, MAX_PATH, "%s\\TestGroup", commonprogs);
452 ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "group not created\n");
455 snprintf(path, MAX_PATH, "%s\\TestItem.lnk", commonprogs);
457 snprintf(path, MAX_PATH, "%s\\TestDir\\TestItem2.lnk", commonprogs);
459 snprintf(path, MAX_PATH, "%s\\TestItem2.lnk", commonprogs);
461 snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs);
462 RemoveDirectory(path);
463 snprintf(path, MAX_PATH, "%s\\TestGroup", commonprogs);
464 RemoveDirectory(path);
467 if (hShell32) FreeLibrary(hShell32);
471 static void test_inffilelist(void)
473 static const char inffile2[] = "test2.inf";
474 static const WCHAR inffile2W[] = {'t','e','s','t','2','.','i','n','f',0};
475 static const char invalid_inf[] = "invalid.inf";
476 static const char *inf =
478 "Signature=\"$Chicago$\"";
481 WCHAR dir[MAX_PATH] = { 0 };
482 WCHAR buffer[MAX_PATH] = { 0 };
483 DWORD expected, outsize;
486 if(!pSetupGetInfFileListW)
488 win_skip("SetupGetInfFileListW not present\n");
492 /* NULL means %windir%\\inf
493 * get the value as reference
496 SetLastError(0xdeadbeef);
497 ret = pSetupGetInfFileListW(NULL, INF_STYLE_WIN4, NULL, 0, &expected);
498 if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
500 win_skip("SetupGetInfFileListW not implemented\n");
503 ok(ret, "expected SetupGetInfFileListW to succeed! Error: %d\n", GetLastError());
504 ok(expected > 0, "expected required buffersize to be at least 1\n");
506 /* check if an empty string doesn't behaves like NULL */
508 SetLastError(0xdeadbeef);
509 ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
511 ok(!ret, "expected SetupGetInfFileListW to fail!\n");
513 /* check a not existing directory
515 MultiByteToWideChar(CP_ACP, 0, CURR_DIR, -1, dir, MAX_PATH);
516 ptr = dir + lstrlenW(dir);
517 MultiByteToWideChar(CP_ACP, 0, "\\not_existent", -1, ptr, MAX_PATH - lstrlenW(dir));
518 outsize = 0xffffffff;
519 SetLastError(0xdeadbeef);
520 ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
521 ok(ret, "expected SetupGetInfFileListW to succeed!\n");
522 ok(outsize == 1, "expected required buffersize to be 1, got %d\n", outsize);
524 ok(ERROR_PATH_NOT_FOUND == GetLastError(),
525 "expected error ERROR_PATH_NOT_FOUND, got %d\n", GetLastError());
527 create_inf_file(inffile, inf);
528 create_inf_file(inffile2, inf);
529 create_inf_file(invalid_inf, "This content does not match the inf file format");
531 /* pass a filename instead of a directory
534 MultiByteToWideChar(CP_ACP, 0, invalid_inf, -1, ptr+1, MAX_PATH - lstrlenW(dir));
535 outsize = 0xffffffff;
536 SetLastError(0xdeadbeef);
537 ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
539 ok(!ret, "expected SetupGetInfFileListW to fail!\n");
541 ok(ERROR_DIRECTORY == GetLastError(),
542 "expected error ERROR_DIRECTORY, got %d\n", GetLastError());
544 /* make the filename look like directory
546 dir[1 + lstrlenW(dir)] = 0;
547 dir[lstrlenW(dir)] = '\\';
548 SetLastError(0xdeadbeef);
549 ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
551 ok(!ret, "expected SetupGetInfFileListW to fail!\n");
553 ok(ERROR_DIRECTORY == GetLastError(),
554 "expected error ERROR_DIRECTORY, got %d\n", GetLastError());
556 /* now check the buffer content of a vaild call
559 expected = 3 + strlen(inffile) + strlen(inffile2);
560 ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, buffer, MAX_PATH, &outsize);
561 ok(ret, "expected SetupGetInfFileListW to succeed!\n");
563 ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
565 for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
566 ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
567 "unexpected filename %s\n",wine_dbgstr_w(p));
570 DeleteFile(inffile2);
571 DeleteFile(invalid_inf);
576 HMODULE hsetupapi = GetModuleHandle("setupapi.dll");
577 char temp_path[MAX_PATH], prev_path[MAX_PATH];
580 GetCurrentDirectory(MAX_PATH, prev_path);
581 GetTempPath(MAX_PATH, temp_path);
582 SetCurrentDirectory(temp_path);
584 strcpy(CURR_DIR, temp_path);
585 len = strlen(CURR_DIR);
586 if(len && (CURR_DIR[len - 1] == '\\'))
587 CURR_DIR[len - 1] = 0;
589 pInstallHinfSectionA = (void *)GetProcAddress(hsetupapi, "InstallHinfSectionA");
590 pInstallHinfSectionW = (void *)GetProcAddress(hsetupapi, "InstallHinfSectionW");
591 pSetupGetInfFileListW = (void *)GetProcAddress(hsetupapi, "SetupGetInfFileListW");
593 if (pInstallHinfSectionA)
595 /* Check if pInstallHinfSectionA sets last error or is a stub (as on WinXP) */
596 static const char *minimal_inf = "[Version]\nSignature=\"$Chicago$\"\n";
597 char cmdline[MAX_PATH*2];
598 create_inf_file(inffile, minimal_inf);
599 sprintf(cmdline, "DefaultInstall 128 %s\\%s", CURR_DIR, inffile);
600 SetLastError(0xdeadbeef);
601 pInstallHinfSectionA(NULL, NULL, cmdline, 0);
602 if (GetLastError() == 0xdeadbeef)
604 skip("InstallHinfSectionA is broken (stub)\n");
605 pInstallHinfSectionA = NULL;
607 ok(DeleteFile(inffile), "Expected source inf to exist, last error was %d\n", GetLastError());
609 if (!pInstallHinfSectionW && !pInstallHinfSectionA)
610 win_skip("InstallHinfSectionA and InstallHinfSectionW are not available\n");
613 /* Set CBT hook to disallow MessageBox creation in current thread */
614 hhook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId());
619 test_install_svc_from();
620 test_driver_install();
622 UnhookWindowsHookEx(hhook);
624 /* We have to run this test after the CBT hook is disabled because
625 ProfileItems needs to create a window on Windows XP. */
626 test_profile_items();
631 SetCurrentDirectory(prev_path);