Changeset 6712 for trunk/src/setupapi
- Timestamp:
- Sep 15, 2001, 11:47:44 AM (24 years ago)
- Location:
- trunk/src/setupapi
- Files:
-
- 4 edited
-
devinst.c (modified) (2 diffs)
-
infparse.c (modified) (8 diffs)
-
setupx_main.c (modified) (51 diffs)
-
stubs.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/setupapi/devinst.c
r6649 r6712 1 /* $Id: devinst.c,v 1.2 2001-09-05 13:38:23 bird Exp $ */2 1 /* 3 2 * SetupAPI device installer … … 13 12 14 13 /*********************************************************************** 15 * DiGetClassDevs (SETUPX.304)14 * DiGetClassDevs (SETUPX.304) 16 15 * Return a list of installed system devices. 17 16 * Uses HKLM\\ENUM to list devices. -
trunk/src/setupapi/infparse.c
r6649 r6712 1 /* $Id: infparse.c,v 1.2 2001-09-05 13:38:23 bird Exp $ */2 1 /* 3 2 * SetupX .inf file parsing functions … … 30 29 31 30 if (!lphInf) 32 return IP_ERROR;31 return IP_ERROR; 33 32 34 33 /* this could be improved by checking for already freed handles */ 35 if (IP_curr_handle == 0xffff) 36 return ERR_IP_OUT_OF_HANDLES; 34 if (IP_curr_handle == 0xffff) 35 return ERR_IP_OUT_OF_HANDLES; 37 36 38 37 if (hFile != HFILE_ERROR) 39 38 { 40 InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries+1);41 InfList[InfNumEntries].hInf = IP_curr_handle++;42 InfList[InfNumEntries].hInfFile = hFile;43 InfList[InfNumEntries].lpInfFileName = HeapAlloc( GetProcessHeap(), 0,39 InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries+1); 40 InfList[InfNumEntries].hInf = IP_curr_handle++; 41 InfList[InfNumEntries].hInfFile = hFile; 42 InfList[InfNumEntries].lpInfFileName = HeapAlloc( GetProcessHeap(), 0, 44 43 strlen(lpInfFileName)+1); 45 44 strcpy( InfList[InfNumEntries].lpInfFileName, lpInfFileName ); 46 45 *lphInf = InfList[InfNumEntries].hInf; 47 InfNumEntries++;48 TRACE("ret handle %d.\n", *lphInf);49 return OK;46 InfNumEntries++; 47 TRACE("ret handle %d.\n", *lphInf); 48 return OK; 50 49 } 51 50 *lphInf = 0xffff; … … 58 57 59 58 for (n=0; n < InfNumEntries; n++) 60 if (InfList[n].hInf == hInf)61 {62 *ret = n;63 return TRUE;64 }59 if (InfList[n].hInf == hInf) 60 { 61 *ret = n; 62 return TRUE; 63 } 65 64 return FALSE; 66 65 } 67 66 68 67 69 68 LPCSTR IP_GetFileName(HINF16 hInf) … … 72 71 if (IP_FindInf(hInf, &n)) 73 72 { 74 return InfList[n].lpInfFileName;73 return InfList[n].lpInfFileName; 75 74 } 76 75 return NULL; … … 85 84 if (IP_FindInf(hInf, &n)) 86 85 { 87 _lclose(InfList[n].hInfFile);88 HeapFree(GetProcessHeap(), 0, InfList[n].lpInfFileName);89 for (i=n; i < InfNumEntries-1; i++)90 InfList[i] = InfList[i+1];91 InfNumEntries--;92 InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries);93 res = OK;86 _lclose(InfList[n].hInfFile); 87 HeapFree(GetProcessHeap(), 0, InfList[n].lpInfFileName); 88 for (i=n; i < InfNumEntries-1; i++) 89 InfList[i] = InfList[i+1]; 90 InfNumEntries--; 91 InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries); 92 res = OK; 94 93 } 95 94 return res; … … 97 96 98 97 /*********************************************************************** 99 * IpOpen1698 * IpOpen16 100 99 * 101 100 */ … … 107 106 108 107 /*********************************************************************** 109 * IpClose16108 * IpClose16 110 109 */ 111 110 RETERR16 WINAPI IpClose16(HINF16 hInf) … … 115 114 116 115 /*********************************************************************** 117 * IpGetProfileString16116 * IpGetProfileString16 118 117 */ 119 RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen) 118 RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen) 120 119 { 121 120 TRACE("'%s': section '%s' entry '%s'\n", IP_GetFileName(hInf), section, entry); -
trunk/src/setupapi/setupx_main.c
r6649 r6712 1 /* $Id: setupx_main.c,v 1.2 2001-09-05 13:38:23 bird Exp $ */2 1 /* 3 2 * SETUPX library … … 27 26 * 28 27 * SETUPX consists of several parts with the following acronyms/prefixes: 29 * Di device installer (devinst.c ?)30 * Gen generic installer (geninst.c ?)31 * Ip .INF parsing (infparse.c)32 * LDD logical device descriptor (ldd.c ?)33 * LDID logical device ID28 * Di device installer (devinst.c ?) 29 * Gen generic installer (geninst.c ?) 30 * Ip .INF parsing (infparse.c) 31 * LDD logical device descriptor (ldd.c ?) 32 * LDID logical device ID 34 33 * SU setup (setup.c ?) 35 * Tp text processing (textproc.c ?)36 * Vcp virtual copy module (vcp.c ?)34 * Tp text processing (textproc.c ?) 35 * Vcp virtual copy module (vcp.c ?) 37 36 * ... 38 37 * … … 56 55 57 56 /*********************************************************************** 58 * SURegOpenKey57 * SURegOpenKey 59 58 */ 60 59 DWORD WINAPI SURegOpenKey( HKEY hkey, LPCSTR lpszSubKey, LPHKEY retkey ) … … 65 64 66 65 /*********************************************************************** 67 * SURegQueryValueEx66 * SURegQueryValueEx 68 67 */ 69 68 DWORD WINAPI SURegQueryValueEx( HKEY hkey, LPSTR lpszValueName, … … 95 94 while (1) 96 95 { 97 /* find beginning of real substring */98 while ( (*p == ' ') || (*p == '\t') || (*p == '"') ) p++;99 100 /* find end of real substring */101 q = p;102 while ( (*q)103 &&(*q != ' ') && (*q != '\t') && (*q != '"')104 && (*q != ';') && (*q != delimiter) ) q++;105 if (q == p)106 break;107 len = (int)q - (int)p;108 109 /* alloc entry for new substring in steps of 32 units and copy over */110 if (count % 32 == 0)111 { /* 1 for count field + current count + 32 */112 res = HeapReAlloc(GetProcessHeap(), 0, res, (1+count+32)*sizeof(LPSTR));113 }114 *(res+1+count) = HeapAlloc(GetProcessHeap(), 0, len+1);115 strncpy(*(res+1+count), p, len);116 (*(res+1+count))[len] = '\0';117 count++;118 119 /* we are still within last substring (before delimiter),120 * so get out of it */121 while ((*q) && (*q != ';') && (*q != delimiter)) q++;122 if ((!*q) || (*q == ';'))123 break;124 p = q+1;125 } 126 96 /* find beginning of real substring */ 97 while ( (*p == ' ') || (*p == '\t') || (*p == '"') ) p++; 98 99 /* find end of real substring */ 100 q = p; 101 while ( (*q) 102 && (*q != ' ') && (*q != '\t') && (*q != '"') 103 && (*q != ';') && (*q != delimiter) ) q++; 104 if (q == p) 105 break; 106 len = (int)q - (int)p; 107 108 /* alloc entry for new substring in steps of 32 units and copy over */ 109 if (count % 32 == 0) 110 { /* 1 for count field + current count + 32 */ 111 res = HeapReAlloc(GetProcessHeap(), 0, res, (1+count+32)*sizeof(LPSTR)); 112 } 113 *(res+1+count) = HeapAlloc(GetProcessHeap(), 0, len+1); 114 strncpy(*(res+1+count), p, len); 115 (*(res+1+count))[len] = '\0'; 116 count++; 117 118 /* we are still within last substring (before delimiter), 119 * so get out of it */ 120 while ((*q) && (*q != ';') && (*q != delimiter)) q++; 121 if ((!*q) || (*q == ';')) 122 break; 123 p = q+1; 124 } 125 127 126 /* put number of entries at beginning of list */ 128 127 *(DWORD *)res = count; … … 137 136 138 137 for (n=0; n < count; n++) 139 HeapFree(GetProcessHeap(), 0, *pStrings++);138 HeapFree(GetProcessHeap(), 0, *pStrings++); 140 139 141 140 HeapFree(GetProcessHeap(), 0, substr); … … 164 163 * Hmm, but on the other hand SETUPX_GetSubStrings() will probably 165 164 * soon be replaced by InitSubstrData() etc. anyway. 166 * 165 * 167 166 */ 168 167 static BOOL SETUPX_LookupRegistryString(LPSTR regstr, LPSTR buffer, DWORD buflen) … … 182 181 for (n=0; n < 5; n++) 183 182 { 184 q = strchr(p, ',');185 if (!q)186 {187 if (n == 4)188 q = p+strlen(p);189 else190 return FALSE;191 }192 next = q+1;193 if (q < regstr)183 q = strchr(p, ','); 184 if (!q) 185 { 186 if (n == 4) 187 q = p+strlen(p); 188 else 189 return FALSE; 190 } 191 next = q+1; 192 if (q < regstr) 194 193 return FALSE; 195 194 SETUPX_IsolateSubString(&p, &q); … … 198 197 strncpy(items[n], p, len); 199 198 items[n][len] = '\0'; 200 p = next;199 p = next; 201 200 } 202 201 TRACE("got '%s','%s','%s','%s','%s'\n", 203 items[0], items[1], items[2], items[3], items[4]);204 202 items[0], items[1], items[2], items[3], items[4]); 203 205 204 /* check root key */ 206 205 if (!strcasecmp(items[0], "HKCR")) 207 hkey = HKEY_CLASSES_ROOT;206 hkey = HKEY_CLASSES_ROOT; 208 207 else 209 208 if (!strcasecmp(items[0], "HKCU")) 210 hkey = HKEY_CURRENT_USER;209 hkey = HKEY_CURRENT_USER; 211 210 else 212 211 if (!strcasecmp(items[0], "HKLM")) 213 hkey = HKEY_LOCAL_MACHINE;212 hkey = HKEY_LOCAL_MACHINE; 214 213 else 215 214 if (!strcasecmp(items[0], "HKU")) 216 hkey = HKEY_USERS;215 hkey = HKEY_USERS; 217 216 else 218 217 { /* HKR ? -> relative to key passed to GenInstallEx */ 219 FIXME("unsupported regkey '%s'\n", items[0]);218 FIXME("unsupported regkey '%s'\n", items[0]); 220 219 goto regfailed; 221 220 } … … 225 224 226 225 if (RegQueryValueExA(hsubkey, items[2], NULL, &dwType, buffer, &buflen) 227 != ERROR_SUCCESS)226 != ERROR_SUCCESS) 228 227 goto regfailed; 229 228 goto done; … … 235 234 HeapFree(heap, 0, items[n]); 236 235 if (buffer) 237 TRACE("return '%s'\n", buffer);236 TRACE("return '%s'\n", buffer); 238 237 return TRUE; 239 238 } … … 245 244 246 245 do { 247 buf = HeapReAlloc(GetProcessHeap(), 0, buf, len);248 res = GetPrivateProfileStringA(NULL, NULL, NULL, buf, len, filename);249 len *= 2;246 buf = HeapReAlloc(GetProcessHeap(), 0, buf, len); 247 res = GetPrivateProfileStringA(NULL, NULL, NULL, buf, len, filename); 248 len *= 2; 250 249 } while ((!res) && (len < 1048576)); 251 250 if (!res) 252 251 { 253 HeapFree(GetProcessHeap(), 0, buf);254 return NULL;252 HeapFree(GetProcessHeap(), 0, buf); 253 return NULL; 255 254 } 256 255 return buf; … … 263 262 264 263 do { 265 buf = HeapReAlloc(GetProcessHeap(), 0, buf, len);266 res = GetPrivateProfileSectionA(section, buf, len, filename);267 len *= 2;264 buf = HeapReAlloc(GetProcessHeap(), 0, buf, len); 265 res = GetPrivateProfileSectionA(section, buf, len, filename); 266 len *= 2; 268 267 } while ((!res) && (len < 1048576)); 269 268 if (!res) 270 269 { 271 HeapFree(GetProcessHeap(), 0, buf);272 return NULL;270 HeapFree(GetProcessHeap(), 0, buf); 271 return NULL; 273 272 } 274 273 return buf; … … 277 276 278 277 /*********************************************************************** 279 * InstallHinfSection278 * InstallHinfSection 280 279 * 281 280 * hwnd = parent window … … 284 283 * Here "DefaultInstall" is the .inf file section to be installed (optional). 285 284 * The 132 value is made of the HOW_xxx flags and sometimes 128 (-> setupx16.h). 286 * 285 * 287 286 * nCmdShow = nCmdShow of CreateProcess 288 287 */ … … 298 297 HMODULE hMod; 299 298 MSGBOX_PROC pMessageBoxA; 300 299 301 300 TRACE("(%04x, %04x, %s, %d);\n", hwnd, hinst, lpszCmdLine, nCmdShow); 302 301 303 302 pSub = SETUPX_GetSubStrings((LPSTR)lpszCmdLine, ' '); 304 303 305 304 count = *(DWORD *)pSub; 306 305 if (count < 2) /* invalid number of arguments ? */ 307 goto end;306 goto end; 308 307 if (IpOpen16(*(pSub+count), &hInf) != OK) 309 308 { 310 res = ERROR_FILE_NOT_FOUND; /* yes, correct */311 goto end;309 res = ERROR_FILE_NOT_FOUND; /* yes, correct */ 310 goto end; 312 311 } 313 312 if (GenInstall16(hInf, *(pSub+count-2), GENINSTALL_DO_ALL) != OK) 314 goto end;313 goto end; 315 314 wFlags = atoi(*(pSub+count-1)) & ~128; 316 315 switch (wFlags) 317 316 { 318 case HOW_ALWAYS_SILENT_REBOOT:319 case HOW_SILENT_REBOOT:320 reboot = TRUE;321 break;322 case HOW_ALWAYS_PROMPT_REBOOT:323 case HOW_PROMPT_REBOOT:324 if ((hMod = GetModuleHandleA("user32.dll")))325 {326 if ((pMessageBoxA = (MSGBOX_PROC)GetProcAddress( hMod, "MessageBoxA" )))327 {328 329 if (pMessageBoxA(hwnd, "You must restart Wine before the new settings will take effect.\n\nDo you want to exit Wine now ?", "Systems Settings Change", MB_YESNO|MB_ICONQUESTION) == IDYES)330 reboot = TRUE;331 }332 }333 break;334 default:335 ERR("invalid flags %d !\n", wFlags);336 goto end;337 } 338 317 case HOW_ALWAYS_SILENT_REBOOT: 318 case HOW_SILENT_REBOOT: 319 reboot = TRUE; 320 break; 321 case HOW_ALWAYS_PROMPT_REBOOT: 322 case HOW_PROMPT_REBOOT: 323 if ((hMod = GetModuleHandleA("user32.dll"))) 324 { 325 if ((pMessageBoxA = (MSGBOX_PROC)GetProcAddress( hMod, "MessageBoxA" ))) 326 { 327 328 if (pMessageBoxA(hwnd, "You must restart Wine before the new settings will take effect.\n\nDo you want to exit Wine now ?", "Systems Settings Change", MB_YESNO|MB_ICONQUESTION) == IDYES) 329 reboot = TRUE; 330 } 331 } 332 break; 333 default: 334 ERR("invalid flags %d !\n", wFlags); 335 goto end; 336 } 337 339 338 res = OK; 340 339 end: … … 343 342 if (reboot) 344 343 { 345 /* FIXME: we should have a means of terminating all wine + wineserver */346 MESSAGE("Program or user told me to restart. Exiting Wine...\n");347 ExitProcess(1);344 /* FIXME: we should have a means of terminating all wine + wineserver */ 345 MESSAGE("Program or user told me to restart. Exiting Wine...\n"); 346 ExitProcess(1); 348 347 } 349 348 … … 360 359 { 361 360 { /* 0 (LDID_NULL) -- not defined */ 362 NULL,363 NULL361 NULL, 362 NULL 364 363 }, 365 364 { /* 1 (LDID_SRCPATH) = source of installation. hmm, what to do here ? */ 366 "SourcePath", /* hmm, does SETUPX have to care about updating it ?? */367 NULL365 "SourcePath", /* hmm, does SETUPX have to care about updating it ?? */ 366 NULL 368 367 }, 369 368 { /* 2 (LDID_SETUPTEMP) = setup temp dir */ 370 "SetupTempDir",371 NULL369 "SetupTempDir", 370 NULL 372 371 }, 373 372 { /* 3 (LDID_UNINSTALL) = uninstall backup dir */ 374 "UninstallDir",375 NULL373 "UninstallDir", 374 NULL 376 375 }, 377 376 { /* 4 (LDID_BACKUP) = backup dir */ 378 "BackupDir",379 NULL377 "BackupDir", 378 NULL 380 379 }, 381 380 { /* 5 (LDID_SETUPSCRATCH) = setup scratch dir */ 382 "SetupScratchDir",383 NULL381 "SetupScratchDir", 382 NULL 384 383 }, 385 384 { /* 6 -- not defined */ 386 NULL,387 NULL385 NULL, 386 NULL 388 387 }, 389 388 { /* 7 -- not defined */ 390 NULL,391 NULL389 NULL, 390 NULL 392 391 }, 393 392 { /* 8 -- not defined */ 394 NULL,395 NULL393 NULL, 394 NULL 396 395 }, 397 396 { /* 9 -- not defined */ 398 NULL,399 NULL397 NULL, 398 NULL 400 399 }, 401 400 { /* 10 (LDID_WIN) = windows dir */ 402 "WinDir",401 "WinDir", 403 402 "" 404 403 }, 405 404 { /* 11 (LDID_SYS) = system dir */ 406 "SysDir",407 NULL /* call GetSystemDirectory() instead */405 "SysDir", 406 NULL /* call GetSystemDirectory() instead */ 408 407 }, 409 408 { /* 12 (LDID_IOS) = IOSubSys dir */ 410 409 NULL, /* FIXME: registry string ? */ 411 "SYSTEM\\IOSUBSYS"410 "SYSTEM\\IOSUBSYS" 412 411 }, 413 412 { /* 13 (LDID_CMD) = COMMAND dir */ 414 NULL, /* FIXME: registry string ? */415 "COMMAND"413 NULL, /* FIXME: registry string ? */ 414 "COMMAND" 416 415 }, 417 416 { /* 14 (LDID_CPL) = control panel dir */ 418 NULL,419 ""417 NULL, 418 "" 420 419 }, 421 420 { /* 15 (LDID_PRINT) = windows printer dir */ 422 NULL,423 "SYSTEM" /* correct ?? */421 NULL, 422 "SYSTEM" /* correct ?? */ 424 423 }, 425 424 { /* 16 (LDID_MAIL) = destination mail dir */ 426 NULL,427 ""425 NULL, 426 "" 428 427 }, 429 428 { /* 17 (LDID_INF) = INF dir */ 430 "SetupScratchDir", /* correct ? */431 "INF"429 "SetupScratchDir", /* correct ? */ 430 "INF" 432 431 }, 433 432 { /* 18 (LDID_HELP) = HELP dir */ 434 NULL, /* ??? */435 "HELP"433 NULL, /* ??? */ 434 "HELP" 436 435 }, 437 436 { /* 19 (LDID_WINADMIN) = Admin dir */ 438 "WinAdminDir",439 ""437 "WinAdminDir", 438 "" 440 439 }, 441 440 { /* 20 (LDID_FONTS) = Fonts dir */ 442 NULL, /* ??? */443 "FONTS"441 NULL, /* ??? */ 442 "FONTS" 444 443 }, 445 444 { /* 21 (LDID_VIEWERS) = Viewers */ 446 NULL, /* ??? */447 "SYSTEM\\VIEWERS"445 NULL, /* ??? */ 446 "SYSTEM\\VIEWERS" 448 447 }, 449 448 { /* 22 (LDID_VMM32) = VMM32 dir */ 450 NULL, /* ??? */451 "SYSTEM\\VMM32"449 NULL, /* ??? */ 450 "SYSTEM\\VMM32" 452 451 }, 453 452 { /* 23 (LDID_COLOR) = ICM dir */ 454 "ICMPath",455 "SYSTEM\\COLOR"453 "ICMPath", 454 "SYSTEM\\COLOR" 456 455 }, 457 456 { /* 24 (LDID_APPS) = root of boot drive ? */ 458 "AppsDir",459 "C:\\"457 "AppsDir", 458 "C:\\" 460 459 }, 461 460 { /* 25 (LDID_SHARED) = shared dir */ 462 "SharedDir",463 ""461 "SharedDir", 462 "" 464 463 }, 465 464 { /* 26 (LDID_WINBOOT) = Windows boot dir */ 466 "WinBootDir",467 ""465 "WinBootDir", 466 "" 468 467 }, 469 468 { /* 27 (LDID_MACHINE) = machine specific files */ 470 "MachineDir",471 NULL469 "MachineDir", 470 NULL 472 471 }, 473 472 { /* 28 (LDID_HOST_WINBOOT) = Host Windows boot dir */ 474 "HostWinBootDir",475 NULL473 "HostWinBootDir", 474 NULL 476 475 }, 477 476 { /* 29 -- not defined */ 478 NULL,479 NULL477 NULL, 478 NULL 480 479 }, 481 480 { /* 30 (LDID_BOOT) = Root of boot drive */ 482 "BootDir",483 NULL481 "BootDir", 482 NULL 484 483 }, 485 484 { /* 31 (LDID_BOOT_HOST) = Root of boot drive host */ 486 "BootHost",487 NULL485 "BootHost", 486 NULL 488 487 }, 489 488 { /* 32 (LDID_OLD_WINBOOT) = subdir of root */ 490 "OldWinBootDir",491 NULL489 "OldWinBootDir", 490 NULL 492 491 }, 493 492 { /* 33 (LDID_OLD_WIN) = old win dir */ 494 "OldWinDir",495 NULL493 "OldWinDir", 494 NULL 496 495 } 497 496 /* the rest (34-38) isn't too interesting, so I'll forget about it */ 498 497 }; 499 498 500 /* 499 /* 501 500 * LDD == Logical Device Descriptor 502 501 * LDID == Logical Device ID … … 528 527 for (n=0; n < sizeof(LDID_Data)/sizeof(LDID_DATA); n++) 529 528 { 530 buffer[0] = '\0';531 532 len = MAX_PATH;533 if ( (hKey) && (LDID_Data[n].RegValName)534 && (RegQueryValueExA(hKey, LDID_Data[n].RegValName,535 NULL, &type, buffer, &len) == ERROR_SUCCESS)536 && (type == REG_SZ) )537 {538 TRACE("found value '%s' for LDID %d\n", buffer, n);539 }540 else529 buffer[0] = '\0'; 530 531 len = MAX_PATH; 532 if ( (hKey) && (LDID_Data[n].RegValName) 533 && (RegQueryValueExA(hKey, LDID_Data[n].RegValName, 534 NULL, &type, buffer, &len) == ERROR_SUCCESS) 535 && (type == REG_SZ) ) 536 { 537 TRACE("found value '%s' for LDID %d\n", buffer, n); 538 } 539 else 541 540 switch(n) 542 { 543 case LDID_SRCPATH: 544 FIXME("LDID_SRCPATH: what exactly do we have to do here ?\n"); 545 strcpy(buffer, "X:\\FIXME"); 546 break; 547 case LDID_SYS: 548 GetSystemDirectoryA(buffer, MAX_PATH); 549 break; 550 case LDID_APPS: 551 case LDID_MACHINE: 552 case LDID_HOST_WINBOOT: 553 case LDID_BOOT: 554 case LDID_BOOT_HOST: 555 strcpy(buffer, "C:\\"); 556 break; 557 default: 558 if (LDID_Data[n].StdString) 559 { 560 DWORD len = GetWindowsDirectoryA(buffer, MAX_PATH); 561 LPSTR p; 562 p = buffer + len; 563 *p++ = '\\'; 564 strcpy(p, LDID_Data[n].StdString); 541 { 542 case LDID_SRCPATH: 543 FIXME("LDID_SRCPATH: what exactly do we have to do here ?\n"); 544 strcpy(buffer, "X:\\FIXME"); 545 break; 546 case LDID_SYS: 547 GetSystemDirectoryA(buffer, MAX_PATH); 548 break; 549 case LDID_APPS: 550 case LDID_MACHINE: 551 case LDID_HOST_WINBOOT: 552 case LDID_BOOT: 553 case LDID_BOOT_HOST: 554 strcpy(buffer, "C:\\"); 555 break; 556 default: 557 if (LDID_Data[n].StdString) 558 { 559 DWORD len = GetWindowsDirectoryA(buffer, MAX_PATH); 560 LPSTR p; 561 p = buffer + len; 562 *p++ = '\\'; 563 strcpy(p, LDID_Data[n].StdString); 564 } 565 break; 565 566 } 566 break; 567 } 568 if (buffer[0]) 569 { 570 INIT_LDD(ldd, n); 571 ldd.pszPath = buffer; 572 TRACE("LDID %d -> '%s'\n", ldd.ldid, ldd.pszPath); 573 CtlSetLdd16(&ldd); 574 } 567 if (buffer[0]) 568 { 569 INIT_LDD(ldd, n); 570 ldd.pszPath = buffer; 571 TRACE("LDID %d -> '%s'\n", ldd.ldid, ldd.pszPath); 572 CtlSetLdd16(&ldd); 573 } 575 574 } 576 575 if (hKey) RegCloseKey(hKey); 577 576 } 578 579 /*********************************************************************** 580 * CtlDelLdd (SETUPX.37)577 578 /*********************************************************************** 579 * CtlDelLdd (SETUPX.37) 581 580 * 582 581 * RETURN … … 590 589 591 590 if (!std_LDDs_done) 592 SETUPX_CreateStandardLDDs();591 SETUPX_CreateStandardLDDs(); 593 592 594 593 if (ldid < LDID_ASSIGN_START) 595 return ERR_VCP_LDDINVALID;594 return ERR_VCP_LDDINVALID; 596 595 597 596 pCurr = pFirstLDD; … … 599 598 while ((pCurr != NULL) && (ldid > pCurr->pldd->ldid)) 600 599 { 601 pPrev = pCurr;602 pCurr = pCurr->next;600 pPrev = pCurr; 601 pCurr = pCurr->next; 603 602 } 604 603 if ( (pCurr == NULL) /* hit end of list */ 605 604 || (ldid != pCurr->pldd->ldid) ) 606 return ERR_VCP_LDDFIND; /* correct ? */605 return ERR_VCP_LDDFIND; /* correct ? */ 607 606 608 607 /* ok, found our victim: eliminate it */ 609 608 610 609 if (pPrev) 611 pPrev->next = pCurr->next;610 pPrev->next = pCurr->next; 612 611 613 612 if (pCurr == pFirstLDD) 614 pFirstLDD = NULL;613 pFirstLDD = NULL; 615 614 HeapFree(GetProcessHeap(), 0, pCurr); 616 615 617 616 return OK; 618 617 } 619 618 620 619 /*********************************************************************** 621 * CtlDelLdd (SETUPX.37)620 * CtlDelLdd (SETUPX.37) 622 621 */ 623 622 RETERR16 WINAPI CtlDelLdd16(LOGDISKID16 ldid) … … 628 627 629 628 /*********************************************************************** 630 * CtlFindLdd (SETUPX.35)629 * CtlFindLdd (SETUPX.35) 631 630 * 632 631 * doesn't check pldd ptr validity: crash (W98SE) … … 635 634 * ERR_VCP_LDDINVALID if pldd->cbSize != structsize 636 635 * 1 in all other cases ?? 637 * 636 * 638 637 */ 639 638 RETERR16 WINAPI CtlFindLdd16(LPLOGDISKDESC pldd) … … 642 641 643 642 TRACE("(%p)\n", pldd); 644 643 645 644 if (!std_LDDs_done) 646 SETUPX_CreateStandardLDDs();645 SETUPX_CreateStandardLDDs(); 647 646 648 647 if (pldd->cbSize != sizeof(LOGDISKDESC_S)) … … 653 652 while ((pCurr != NULL) && (pldd->ldid > pCurr->pldd->ldid)) 654 653 { 655 pPrev = pCurr;656 pCurr = pCurr->next;654 pPrev = pCurr; 655 pCurr = pCurr->next; 657 656 } 658 657 if ( (pCurr == NULL) /* hit end of list */ 659 658 || (pldd->ldid != pCurr->pldd->ldid) ) 660 return ERR_VCP_LDDFIND; /* correct ? */659 return ERR_VCP_LDDFIND; /* correct ? */ 661 660 662 661 memcpy(pldd, pCurr->pldd, pldd->cbSize); 663 662 /* hmm, we probably ought to strcpy() the string ptrs here */ 664 663 665 664 return 1; /* what is this ?? */ 666 665 } 667 666 668 667 /*********************************************************************** 669 * CtlSetLdd (SETUPX.33)668 * CtlSetLdd (SETUPX.33) 670 669 * 671 670 * Set an LDD entry. … … 685 684 686 685 if (!std_LDDs_done) 687 SETUPX_CreateStandardLDDs();686 SETUPX_CreateStandardLDDs(); 688 687 689 688 if (pldd->cbSize != sizeof(LOGDISKDESC_S)) 690 return ERR_VCP_LDDINVALID;689 return ERR_VCP_LDDINVALID; 691 690 692 691 heap = GetProcessHeap(); … … 695 694 while ((pCurr != NULL) && (pldd->ldid > pCurr->pldd->ldid)) 696 695 { 697 pPrev = pCurr;698 pCurr = pCurr->next;696 pPrev = pCurr; 697 pCurr = pCurr->next; 699 698 } 700 699 if (pCurr == NULL) /* hit end of list */ 701 700 { 702 is_new = TRUE;701 is_new = TRUE; 703 702 pCurr = HeapAlloc(heap, 0, sizeof(LDD_LIST)); 704 703 pCurr->pldd = HeapAlloc(heap, 0, sizeof(LOGDISKDESC_S)); … … 709 708 { 710 709 pCurrLDD = pCurr->pldd; 711 if (pCurrLDD->pszPath)HeapFree(heap, 0, pCurrLDD->pszPath);712 if (pCurrLDD->pszVolLabel)HeapFree(heap, 0, pCurrLDD->pszVolLabel);713 if (pCurrLDD->pszDiskName)HeapFree(heap, 0, pCurrLDD->pszDiskName);710 if (pCurrLDD->pszPath) HeapFree(heap, 0, pCurrLDD->pszPath); 711 if (pCurrLDD->pszVolLabel) HeapFree(heap, 0, pCurrLDD->pszVolLabel); 712 if (pCurrLDD->pszDiskName) HeapFree(heap, 0, pCurrLDD->pszDiskName); 714 713 } 715 714 … … 717 716 718 717 if (pldd->pszPath) 719 pCurrLDD->pszPath = HEAP_strdupA(heap, 0, pldd->pszPath);718 pCurrLDD->pszPath = HEAP_strdupA(heap, 0, pldd->pszPath); 720 719 if (pldd->pszVolLabel) 721 pCurrLDD->pszVolLabel= HEAP_strdupA(heap, 0, pldd->pszVolLabel);720 pCurrLDD->pszVolLabel = HEAP_strdupA(heap, 0, pldd->pszVolLabel); 722 721 if (pldd->pszDiskName) 723 pCurrLDD->pszDiskName= HEAP_strdupA(heap, 0, pldd->pszDiskName);722 pCurrLDD->pszDiskName = HEAP_strdupA(heap, 0, pldd->pszDiskName); 724 723 725 724 if (is_new) /* link into list */ 726 725 { 727 726 if (pPrev) 728 {729 pCurr->next = pPrev->next;727 { 728 pCurr->next = pPrev->next; 730 729 pPrev->next = pCurr; 731 }732 if (!pFirstLDD)733 pFirstLDD = pCurr;734 } 735 730 } 731 if (!pFirstLDD) 732 pFirstLDD = pCurr; 733 } 734 736 735 return OK; 737 736 } … … 739 738 740 739 /*********************************************************************** 741 * CtlAddLdd (SETUPX.36)740 * CtlAddLdd (SETUPX.36) 742 741 * 743 742 * doesn't check pldd ptr validity: crash (W98SE) … … 752 751 753 752 /*********************************************************************** 754 * CtlGetLdd (SETUPX.34)753 * CtlGetLdd (SETUPX.34) 755 754 * 756 755 * doesn't check pldd ptr validity: crash (W98SE) … … 759 758 * RETURN 760 759 * ERR_VCP_LDDINVALID if pldd->cbSize != structsize 761 * 760 * 762 761 */ 763 762 static RETERR16 SETUPX_GetLdd(LPLOGDISKDESC pldd) … … 766 765 767 766 if (!std_LDDs_done) 768 SETUPX_CreateStandardLDDs();767 SETUPX_CreateStandardLDDs(); 769 768 770 769 if (pldd->cbSize != sizeof(LOGDISKDESC_S)) … … 775 774 while ((pCurr != NULL) && (pldd->ldid > pCurr->pldd->ldid)) 776 775 { 777 pPrev = pCurr;778 pCurr = pCurr->next;776 pPrev = pCurr; 777 pCurr = pCurr->next; 779 778 } 780 779 if (pCurr == NULL) /* hit end of list */ 781 return ERR_VCP_LDDFIND; /* correct ? */780 return ERR_VCP_LDDFIND; /* correct ? */ 782 781 783 782 memcpy(pldd, pCurr->pldd, pldd->cbSize); … … 796 795 797 796 /*********************************************************************** 798 * CtlGetLddPath(SETUPX.38)797 * CtlGetLddPath (SETUPX.38) 799 798 * 800 799 * Gets the path of an LDD. … … 810 809 if (szPath) 811 810 { 812 LOGDISKDESC_S ldd;813 INIT_LDD(ldd, ldid);814 if (CtlFindLdd16(&ldd) == ERR_VCP_LDDFIND)815 return ERR_VCP_LDDUNINIT;816 SETUPX_GetLdd(&ldd);811 LOGDISKDESC_S ldd; 812 INIT_LDD(ldd, ldid); 813 if (CtlFindLdd16(&ldd) == ERR_VCP_LDDFIND) 814 return ERR_VCP_LDDUNINIT; 815 SETUPX_GetLdd(&ldd); 817 816 strcpy(szPath, ldd.pszPath); 818 TRACE("ret '%s' for LDID %d\n", szPath, ldid);817 TRACE("ret '%s' for LDID %d\n", szPath, ldid); 819 818 } 820 819 return OK; … … 822 821 823 822 /*********************************************************************** 824 * CtlSetLddPath(SETUPX.508)823 * CtlSetLddPath (SETUPX.508) 825 824 * 826 825 * Sets the path of an LDD. … … 831 830 LOGDISKDESC_S ldd; 832 831 TRACE("(%d, '%s');\n", ldid, szPath); 833 832 834 833 INIT_LDD(ldd, ldid); 835 834 ldd.pszPath = szPath; … … 848 847 * -- registry lookup --> 849 848 * C:\Program Files (or C:\ if not found in registry) 850 * 849 * 851 850 * FIXME: 852 851 * - maybe we ought to add a caching array for speed ? - I don't care :) … … 854 853 * LDIDs for both install and removal sections. 855 854 * - probably the whole function can be removed as installers add that on their 856 * own 855 * own 857 856 */ 858 857 static BOOL SETUPX_AddCustomLDID(int ldid, INT16 hInf) … … 870 869 if (!(sectionbuf = SETUPX_GetSections(filename))) 871 870 { 872 ERR("couldn't get sections !\n");873 return FALSE;871 ERR("couldn't get sections !\n"); 872 return FALSE; 874 873 } 875 874 for (pSec=sectionbuf; *pSec; pSec += strlen(pSec)+1) 876 875 { 877 if (!(entrybuf = SETUPX_GetSectionEntries(filename, pSec)))878 {879 ERR("couldn't get section entries !\n");880 goto end;881 }882 for (pEnt=entrybuf; *pEnt; pEnt += strlen(pEnt)+1)883 {884 if (strstr(pEnt, ldidstr))885 {886 pEqual = strchr(pEnt, '=');887 if (!pEqual) /* crippled entry ?? */888 continue;889 890 /* make sure we found the LDID on left side of the equation */891 if (pEnt+strlen(ldidstr) <= pEqual)892 { /* found */893 894 /* but we don't want entries in the strings section */895 if (!strcasecmp(pSec, "Strings"))896 goto next_section;897 p = pEqual+1;898 goto found;899 }900 }901 }876 if (!(entrybuf = SETUPX_GetSectionEntries(filename, pSec))) 877 { 878 ERR("couldn't get section entries !\n"); 879 goto end; 880 } 881 for (pEnt=entrybuf; *pEnt; pEnt += strlen(pEnt)+1) 882 { 883 if (strstr(pEnt, ldidstr)) 884 { 885 pEqual = strchr(pEnt, '='); 886 if (!pEqual) /* crippled entry ?? */ 887 continue; 888 889 /* make sure we found the LDID on left side of the equation */ 890 if (pEnt+strlen(ldidstr) <= pEqual) 891 { /* found */ 892 893 /* but we don't want entries in the strings section */ 894 if (!strcasecmp(pSec, "Strings")) 895 goto next_section; 896 p = pEqual+1; 897 goto found; 898 } 899 } 900 } 902 901 next_section: 903 902 } … … 908 907 if (*(DWORD *)pSub > 2) 909 908 { 910 ERR("malformed entry '%s' ?\n", p);911 goto end;909 ERR("malformed entry '%s' ?\n", p); 910 goto end; 912 911 } 913 912 TRACE("found section '%s'\n", *(pSub+1)); … … 917 916 if (!(regsectionbuf = SETUPX_GetSectionEntries(filename, *(pSub+1)))) 918 917 { 919 ERR("couldn't get registry section entries !\n");920 goto end;918 ERR("couldn't get registry section entries !\n"); 919 goto end; 921 920 } 922 921 /* sectionbuf is > 1024 bytes anyway, so use it */ … … 929 928 end: 930 929 SETUPX_FreeSubStrings(pSub); 931 if (sectionbuf) HeapFree(GetProcessHeap(), 0, sectionbuf);932 if (entrybuf) HeapFree(GetProcessHeap(), 0, entrybuf);933 if (regsectionbuf) HeapFree(GetProcessHeap(), 0, regsectionbuf);930 if (sectionbuf) HeapFree(GetProcessHeap(), 0, sectionbuf); 931 if (entrybuf) HeapFree(GetProcessHeap(), 0, entrybuf); 932 if (regsectionbuf) HeapFree(GetProcessHeap(), 0, regsectionbuf); 934 933 return ret; 935 934 } … … 948 947 if (CtlFindLdd16(&ldd) == ERR_VCP_LDDFIND) 949 948 { 950 /* hmm, it seems the installers already do the work for us951 * (by calling CtlSetLddPath) that SETUPX_AddCustomLDID952 * is supposed to do. Grmbl ;-)953 * Well, I'll leave it here anyway, but print error... */954 ERR("hmm, LDID %d not registered yet !?\n", ldid);955 handled = SETUPX_AddCustomLDID(ldid, hInf);949 /* hmm, it seems the installers already do the work for us 950 * (by calling CtlSetLddPath) that SETUPX_AddCustomLDID 951 * is supposed to do. Grmbl ;-) 952 * Well, I'll leave it here anyway, but print error... */ 953 ERR("hmm, LDID %d not registered yet !?\n", ldid); 954 handled = SETUPX_AddCustomLDID(ldid, hInf); 956 955 } 957 956 else 958 handled = TRUE;959 957 handled = TRUE; 958 960 959 SETUPX_GetLdd(&ldd); 961 960 962 961 if (!handled) 963 962 { 964 963 FIXME("What is LDID %d ??\n", ldid); 965 *p = "LDID_FIXME";964 *p = "LDID_FIXME"; 966 965 } 967 966 else 968 *p = ldd.pszPath;967 *p = ldd.pszPath; 969 968 970 969 return handled; … … 972 971 973 972 /*********************************************************************** 974 * GenFormStrWithoutPlaceHolders973 * GenFormStrWithoutPlaceHolders 975 974 * 976 975 * ought to be pretty much implemented, I guess... … … 981 980 LPSTR pDst = szDst, p, pPHBegin; 982 981 int count; 983 982 984 983 TRACE("(%p, '%s', %04x);\n", szDst, szSrc, hInf); 985 984 while (pSrc < pSrcEnd) 986 985 { 987 p = strchr(pSrc, '%');988 if (p)989 {990 count = (int)p - (int)pSrc;991 strncpy(pDst, pSrc, count);992 pSrc += count;993 pDst += count;994 pPHBegin = p+1;995 p = strchr(pPHBegin, '%');996 if (p)997 {998 char placeholder[80]; /* that really ought to be enough ;) */999 int ldid;1000 BOOL done = TRUE;1001 count = (int)p - (int)pPHBegin;1002 strncpy(placeholder, pPHBegin, count);1003 placeholder[count] = '\0';1004 ldid = atoi(placeholder);1005 if (ldid)1006 {1007 LPSTR p;1008 done = SETUPX_IP_TranslateLDID(ldid, &p, hInf);1009 strcpy(pDst, p);1010 if (done)1011 pDst += strlen(pDst);1012 }1013 else1014 { /* hmm, string placeholder. Need to look up1015 in the [strings] section of the hInf */1016 DWORD ret;1017 char buf[256]; /* long enough ? */1018 1019 ret = GetPrivateProfileStringA("strings", placeholder, "",1020 buf, 256, IP_GetFileName(hInf));1021 if (ret)1022 {1023 strcpy(pDst, buf);1024 pDst += strlen(buf);1025 }1026 else1027 {1028 ERR("placeholder string '%s' not found !\n", placeholder);1029 done = FALSE;1030 }1031 }1032 if (!done)1033 { /* copy raw placeholder string over */1034 count = (int)p - (int)pPHBegin + 2;1035 strncpy(pDst, pPHBegin-1, count);1036 pDst += count;1037 1038 }1039 pSrc = p+1;1040 continue;1041 }1042 }1043 1044 /* copy the remaining source string over */1045 strncpy(pDst, pSrc, (int)pSrcEnd - (int)pSrc + 1);1046 break;986 p = strchr(pSrc, '%'); 987 if (p) 988 { 989 count = (int)p - (int)pSrc; 990 strncpy(pDst, pSrc, count); 991 pSrc += count; 992 pDst += count; 993 pPHBegin = p+1; 994 p = strchr(pPHBegin, '%'); 995 if (p) 996 { 997 char placeholder[80]; /* that really ought to be enough ;) */ 998 int ldid; 999 BOOL done = TRUE; 1000 count = (int)p - (int)pPHBegin; 1001 strncpy(placeholder, pPHBegin, count); 1002 placeholder[count] = '\0'; 1003 ldid = atoi(placeholder); 1004 if (ldid) 1005 { 1006 LPSTR p; 1007 done = SETUPX_IP_TranslateLDID(ldid, &p, hInf); 1008 strcpy(pDst, p); 1009 if (done) 1010 pDst += strlen(pDst); 1011 } 1012 else 1013 { /* hmm, string placeholder. Need to look up 1014 in the [strings] section of the hInf */ 1015 DWORD ret; 1016 char buf[256]; /* long enough ? */ 1017 1018 ret = GetPrivateProfileStringA("strings", placeholder, "", 1019 buf, 256, IP_GetFileName(hInf)); 1020 if (ret) 1021 { 1022 strcpy(pDst, buf); 1023 pDst += strlen(buf); 1024 } 1025 else 1026 { 1027 ERR("placeholder string '%s' not found !\n", placeholder); 1028 done = FALSE; 1029 } 1030 } 1031 if (!done) 1032 { /* copy raw placeholder string over */ 1033 count = (int)p - (int)pPHBegin + 2; 1034 strncpy(pDst, pPHBegin-1, count); 1035 pDst += count; 1036 1037 } 1038 pSrc = p+1; 1039 continue; 1040 } 1041 } 1042 1043 /* copy the remaining source string over */ 1044 strncpy(pDst, pSrc, (int)pSrcEnd - (int)pSrc + 1); 1045 break; 1047 1046 } 1048 1047 TRACE("ret '%s'\n", szDst); … … 1050 1049 1051 1050 /*********************************************************************** 1052 * VcpOpen1051 * VcpOpen 1053 1052 * 1054 1053 * No idea what to do here. … … 1061 1060 1062 1061 /*********************************************************************** 1063 * VcpClose1062 * VcpClose 1064 1063 * 1065 1064 * Is fl related to VCPDISKINFO.fl ? … … 1092 1091 for (n=0; n < *(DWORD *)pSub; n++) 1093 1092 { 1094 pCopyEntry = *(pSub+1+n);1095 if (*pCopyEntry == '@')1096 {1097 ERR("single file not handled yet !\n");1098 continue;1099 }1100 1101 /* get source directory for that entry */1102 INIT_LDD(ldd, LDID_SRCPATH);1103 SETUPX_GetLdd(&ldd);1104 pSrcDir = ldd.pszPath;1105 1093 pCopyEntry = *(pSub+1+n); 1094 if (*pCopyEntry == '@') 1095 { 1096 ERR("single file not handled yet !\n"); 1097 continue; 1098 } 1099 1100 /* get source directory for that entry */ 1101 INIT_LDD(ldd, LDID_SRCPATH); 1102 SETUPX_GetLdd(&ldd); 1103 pSrcDir = ldd.pszPath; 1104 1106 1105 /* get destination directory for that entry */ 1107 if (!(GetPrivateProfileStringA("DestinationDirs", pCopyEntry, "",1108 pDestStr, sizeof(pDestStr), filename)))1109 continue;1110 1111 /* translate destination dir if given as LDID */1112 ldid = atoi(pDestStr);1113 if (ldid)1114 {1115 if (!(SETUPX_IP_TranslateLDID(ldid, &pDstDir, hInf)))1116 continue;1117 }1118 else1119 pDstDir = pDestStr;1120 1121 /* now that we have the destination dir, iterate over files to copy */1122 pFileEntries = SETUPX_GetSectionEntries(filename, pCopyEntry);1106 if (!(GetPrivateProfileStringA("DestinationDirs", pCopyEntry, "", 1107 pDestStr, sizeof(pDestStr), filename))) 1108 continue; 1109 1110 /* translate destination dir if given as LDID */ 1111 ldid = atoi(pDestStr); 1112 if (ldid) 1113 { 1114 if (!(SETUPX_IP_TranslateLDID(ldid, &pDstDir, hInf))) 1115 continue; 1116 } 1117 else 1118 pDstDir = pDestStr; 1119 1120 /* now that we have the destination dir, iterate over files to copy */ 1121 pFileEntries = SETUPX_GetSectionEntries(filename, pCopyEntry); 1123 1122 for (p=pFileEntries; *p; p +=strlen(p)+1) 1124 {1125 pSubFile = SETUPX_GetSubStrings(p, ',');1126 pSrcFile = *(pSubFile+1);1127 pDstFile = (*(DWORD *)pSubFile > 1) ? *(pSubFile+2) : pSrcFile;1128 TRACE("copying file '%s\\%s' to '%s\\%s'\n", pSrcDir, pSrcFile, pDstDir, pDstFile);1129 if (*(DWORD *)pSubFile > 2)1130 {1131 WORD flag;1132 if ((flag = atoi(*(pSubFile+3)))) /* ah, flag */1133 {1134 if (flag & 0x2c)1135 FIXME("VNLP_xxx flag %d not handled yet.\n", flag);1136 }1137 else1138 FIXME("temp file name '%s' given. Need to register in wininit.ini !\n", *(pSubFile+3)); /* strong guess that this is VcpQueueCopy() */1139 }1140 SETUPX_FreeSubStrings(pSubFile);1141 /* we don't copy ANYTHING yet ! (I'm too lazy and want to verify1142 * this first before destroying whole partitions ;-) */1143 }1144 } 1145 1123 { 1124 pSubFile = SETUPX_GetSubStrings(p, ','); 1125 pSrcFile = *(pSubFile+1); 1126 pDstFile = (*(DWORD *)pSubFile > 1) ? *(pSubFile+2) : pSrcFile; 1127 TRACE("copying file '%s\\%s' to '%s\\%s'\n", pSrcDir, pSrcFile, pDstDir, pDstFile); 1128 if (*(DWORD *)pSubFile > 2) 1129 { 1130 WORD flag; 1131 if ((flag = atoi(*(pSubFile+3)))) /* ah, flag */ 1132 { 1133 if (flag & 0x2c) 1134 FIXME("VNLP_xxx flag %d not handled yet.\n", flag); 1135 } 1136 else 1137 FIXME("temp file name '%s' given. Need to register in wininit.ini !\n", *(pSubFile+3)); /* strong guess that this is VcpQueueCopy() */ 1138 } 1139 SETUPX_FreeSubStrings(pSubFile); 1140 /* we don't copy ANYTHING yet ! (I'm too lazy and want to verify 1141 * this first before destroying whole partitions ;-) */ 1142 } 1143 } 1144 1146 1145 return res; 1147 1146 } 1148 1147 1149 1148 /*********************************************************************** 1150 * GenInstall1149 * GenInstall 1151 1150 * 1152 1151 * general install function for .INF file sections 1153 1152 * 1154 1153 * This is not perfect - patch whenever you can ! 1155 * 1154 * 1156 1155 * wFlags == GENINSTALL_DO_xxx 1157 1156 * e.g. NetMeeting: … … 1170 1169 if (!pEntries) 1171 1170 { 1172 ERR("couldn't find entries for section '%s' !\n", szInstallSection);1173 return ERR_IP_SECT_NOT_FOUND;1171 ERR("couldn't find entries for section '%s' !\n", szInstallSection); 1172 return ERR_IP_SECT_NOT_FOUND; 1174 1173 } 1175 1174 for (p=pEntries; *p; p +=strlen(p)+1) 1176 1175 { 1177 pEnd = strchr(p, '=');1178 if (!pEnd) continue;1179 pSub = SETUPX_GetSubStrings(pEnd+1, ','); /* split entries after the '=' */1180 SETUPX_IsolateSubString(&p, &pEnd);1181 len = (int)pEnd - (int)p;1182 1183 if (wFlags & GENINSTALL_DO_FILES)1184 {1185 if (!strncasecmp(p, "CopyFiles", len))1186 {1187 SETUPX_CopyFiles(pSub, hInfFile);1188 continue;1189 }1176 pEnd = strchr(p, '='); 1177 if (!pEnd) continue; 1178 pSub = SETUPX_GetSubStrings(pEnd+1, ','); /* split entries after the '=' */ 1179 SETUPX_IsolateSubString(&p, &pEnd); 1180 len = (int)pEnd - (int)p; 1181 1182 if (wFlags & GENINSTALL_DO_FILES) 1183 { 1184 if (!strncasecmp(p, "CopyFiles", len)) 1185 { 1186 SETUPX_CopyFiles(pSub, hInfFile); 1187 continue; 1188 } 1190 1189 #if IMPLEMENT_THAT 1191 else1192 if (!strncasecmp(p, "DelFiles", len))1193 {1194 SETUPX_DelFiles(filename, szInstallSection, pSub);1195 continue;1196 }1190 else 1191 if (!strncasecmp(p, "DelFiles", len)) 1192 { 1193 SETUPX_DelFiles(filename, szInstallSection, pSub); 1194 continue; 1195 } 1197 1196 #endif 1198 }1199 if (wFlags & GENINSTALL_DO_INI)1200 {1197 } 1198 if (wFlags & GENINSTALL_DO_INI) 1199 { 1201 1200 #if IMPLEMENT_THAT 1202 if (!strncasecmp(p, "UpdateInis", len))1203 {1204 SETUPX_UpdateInis(filename, szInstallSection, pSub);1205 continue;1206 }1201 if (!strncasecmp(p, "UpdateInis", len)) 1202 { 1203 SETUPX_UpdateInis(filename, szInstallSection, pSub); 1204 continue; 1205 } 1207 1206 #endif 1208 }1209 if (wFlags & GENINSTALL_DO_REG)1210 {1207 } 1208 if (wFlags & GENINSTALL_DO_REG) 1209 { 1211 1210 #if IMPLEMENT_THAT 1212 /* probably use SUReg*() functions here */1213 if (!strncasecmp(p, "AddReg", len))1214 {1215 SETUPX_AddReg(filename, szInstallSection, pSub);1216 continue;1217 }1218 else1219 if (!strncasecmp(p, "DelReg", len))1220 {1221 SETUPX_DelReg(filename, szInstallSection, pSub);1222 continue;1223 }1211 /* probably use SUReg*() functions here */ 1212 if (!strncasecmp(p, "AddReg", len)) 1213 { 1214 SETUPX_AddReg(filename, szInstallSection, pSub); 1215 continue; 1216 } 1217 else 1218 if (!strncasecmp(p, "DelReg", len)) 1219 { 1220 SETUPX_DelReg(filename, szInstallSection, pSub); 1221 continue; 1222 } 1224 1223 #endif 1225 }1226 1227 SETUPX_FreeSubStrings(pSub);1224 } 1225 1226 SETUPX_FreeSubStrings(pSub); 1228 1227 } 1229 1228 HeapFree(GetProcessHeap(), 0, pEntries); -
trunk/src/setupapi/stubs.c
r6649 r6712 1 1 /* -*- tab-width: 8; c-basic-offset: 8 -*- */ 2 /* $Id: stubs.c,v 1.2 2001-09-05 13:38:24 bird Exp $ */3 2 /* 4 3 * SetupAPI stubs … … 17 16 18 17 /*********************************************************************** 19 * SetupCloseFileQueue18 * SetupCloseFileQueue 20 19 */ 21 20 VOID WINAPI SetupCloseFileQueue(HSPFILEQ QueueHandle) 22 21 { 23 FIXME("not implemented (setupapi.dll) \n");24 } 25 26 /*********************************************************************** 27 * SetupCommitFileQueueA22 FIXME("not implemented (setupapi.dll) \n"); 23 } 24 25 /*********************************************************************** 26 * SetupCommitFileQueueA 28 27 */ 29 28 BOOL WINAPI SetupCommitFileQueueA(HWND Owner, HSPFILEQ QueueHandle, 30 PSP_FILE_CALLBACK_A MsgHandler,31 PVOID Context)32 { 33 FIXME("not implemented (setupapi.dll) \n");34 return FALSE;35 } 36 37 /*********************************************************************** 38 * SetupIterateCabinetA29 PSP_FILE_CALLBACK_A MsgHandler, 30 PVOID Context) 31 { 32 FIXME("not implemented (setupapi.dll) \n"); 33 return FALSE; 34 } 35 36 /*********************************************************************** 37 * SetupIterateCabinetA 39 38 */ 40 39 BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved, 41 40 PSP_FILE_CALLBACK_A MsgHandler, PVOID Context) 42 41 { 43 FIXME("not implemented (setupapi.dll) \n");44 return 0;45 } 46 47 /*********************************************************************** 48 * SetupIterateCabinetW42 FIXME("not implemented (setupapi.dll) \n"); 43 return 0; 44 } 45 46 /*********************************************************************** 47 * SetupIterateCabinetW 49 48 */ 50 49 BOOL WINAPI SetupIterateCabinetW(PWSTR CabinetFile, DWORD Reserved, 51 PSP_FILE_CALLBACK_W MsgHandler, PVOID Context) 52 { 53 FIXME("not implemented (setupapi.dll) \n");54 return 0;55 } 56 57 58 /*********************************************************************** 59 * SetupGetLineTextA50 PSP_FILE_CALLBACK_W MsgHandler, PVOID Context) 51 { 52 FIXME("not implemented (setupapi.dll) \n"); 53 return 0; 54 } 55 56 57 /*********************************************************************** 58 * SetupGetLineTextA 60 59 */ 61 60 BOOL WINAPI SetupGetLineTextA (PINFCONTEXT Context, HINF InfHandle, … … 63 62 DWORD ReturnBufferSize, PDWORD RequiredSize) 64 63 { 65 FIXME("not implemented (setupapi.dll) \n");66 return 0;67 } 68 69 /*********************************************************************** 70 * SetupGetStringFieldA71 */ 72 BOOL WINAPI SetupGetStringFieldA(PINFCONTEXT Context, DWORD FieldIndex, 64 FIXME("not implemented (setupapi.dll) \n"); 65 return 0; 66 } 67 68 /*********************************************************************** 69 * SetupGetStringFieldA 70 */ 71 BOOL WINAPI SetupGetStringFieldA(PINFCONTEXT Context, DWORD FieldIndex, 73 72 LPSTR ReturnBuffer, DWORD ReturnBufferSize, 74 73 PDWORD RequiredSize) 75 74 { 76 FIXME("not implemented (setupapi.dll) \n");77 return 0;78 } 79 80 81 /*********************************************************************** 82 * SetupFindNextLine75 FIXME("not implemented (setupapi.dll) \n"); 76 return 0; 77 } 78 79 80 /*********************************************************************** 81 * SetupFindNextLine 83 82 */ 84 83 BOOL WINAPI SetupFindNextLine (PINFCONTEXT ContextIn, PINFCONTEXT ContextOut) 85 84 { 86 FIXME("not implemented (setupapi.dll) \n");87 return 0;88 } 89 90 91 /*********************************************************************** 92 * SetupInitDefaultQueueCallback85 FIXME("not implemented (setupapi.dll) \n"); 86 return 0; 87 } 88 89 90 /*********************************************************************** 91 * SetupInitDefaultQueueCallback 93 92 */ 94 93 PVOID WINAPI SetupInitDefaultQueueCallback(HWND OwnerWindow) 95 94 { 96 FIXME("not implemented (setupapi.dll) \n");97 return 0;98 } 99 100 /*********************************************************************** 101 * SetupInitDefaultQueueCallbackEx95 FIXME("not implemented (setupapi.dll) \n"); 96 return 0; 97 } 98 99 /*********************************************************************** 100 * SetupInitDefaultQueueCallbackEx 102 101 */ 103 102 PVOID WINAPI SetupInitDefaultQueueCallbackEx(HWND OwnerWindow, 104 HWND AlternativeProgressWindow,105 UINT ProgressMessage,106 DWORD res1,107 PVOID res2)108 { 109 FIXME("not implemented (setupapi.dll) \n");110 return 0;111 } 112 113 /*********************************************************************** 114 * SetupCloseInfFile103 HWND AlternativeProgressWindow, 104 UINT ProgressMessage, 105 DWORD res1, 106 PVOID res2) 107 { 108 FIXME("not implemented (setupapi.dll) \n"); 109 return 0; 110 } 111 112 /*********************************************************************** 113 * SetupCloseInfFile 115 114 */ 116 115 VOID WINAPI SetupCloseInfFile (HINF InfHandle) 117 116 { 118 FIXME("not implemented (setupapi.dll) \n");119 } 120 121 122 /*********************************************************************** 123 * SetupDefaultQueueCallbackA117 FIXME("not implemented (setupapi.dll) \n"); 118 } 119 120 121 /*********************************************************************** 122 * SetupDefaultQueueCallbackA 124 123 */ 125 124 UINT WINAPI SetupDefaultQueueCallbackA (PVOID Context, UINT Notification, 126 125 UINT Param1, UINT Param2) 127 126 { 128 FIXME("not implemented (setupapi.dll) \n");129 return 0;130 } 131 132 133 /*********************************************************************** 134 * SetupFindFirstLineA127 FIXME("not implemented (setupapi.dll) \n"); 128 return 0; 129 } 130 131 132 /*********************************************************************** 133 * SetupFindFirstLineA 135 134 */ 136 135 BOOL WINAPI SetupFindFirstLineA (HINF InfHandle, PCSTR Section, PCSTR Key, 137 136 PINFCONTEXT Context) 138 137 { 139 FIXME("not implemented (setupapi.dll) \n");140 return 0;141 } 142 143 /*********************************************************************** 144 * SetupGetLineByIndexA138 FIXME("not implemented (setupapi.dll) \n"); 139 return 0; 140 } 141 142 /*********************************************************************** 143 * SetupGetLineByIndexA 145 144 */ 146 145 BOOL WINAPI SetupGetLineByIndexA (HINF InfHandle, PCSTR Section, DWORD Index, 147 146 PINFCONTEXT Context) 148 147 { 149 FIXME("not implemented (setupapi.dll) \n");150 return FALSE;151 } 152 153 154 /*********************************************************************** 155 * SetupInstallFromInfSectionA148 FIXME("not implemented (setupapi.dll) \n"); 149 return FALSE; 150 } 151 152 153 /*********************************************************************** 154 * SetupInstallFromInfSectionA 156 155 */ 157 156 BOOL WINAPI SetupInstallFromInfSectionA (HWND Owner, HINF InfHandle, PCSTR SectionName, … … 161 160 PSP_DEVINFO_DATA DeviceInfoData) 162 161 { 163 FIXME("not implemented (setupapi.dll) \n");164 return 0;165 } 166 167 /*********************************************************************** 168 * SetupOpenAppendInfFileA162 FIXME("not implemented (setupapi.dll) \n"); 163 return 0; 164 } 165 166 /*********************************************************************** 167 * SetupOpenAppendInfFileA 169 168 */ 170 169 BOOL WINAPI SetupOpenAppendInfFileA (PCSTR FileName, HINF InfHandle, 171 PUINT ErrorLine)172 { 173 FIXME("not implemented (setupapi.dll) \n");174 return FALSE;175 } 176 177 /*********************************************************************** 178 * SetupOpenFileQueue170 PUINT ErrorLine) 171 { 172 FIXME("not implemented (setupapi.dll) \n"); 173 return FALSE; 174 } 175 176 /*********************************************************************** 177 * SetupOpenFileQueue 179 178 */ 180 179 HSPFILEQ WINAPI SetupOpenFileQueue (VOID) 181 180 { 182 FIXME("not implemented (setupapi.dll) \n");183 return (HSPFILEQ) INVALID_HANDLE_VALUE;184 } 185 186 /*********************************************************************** 187 * SetupOpenInfFileA181 FIXME("not implemented (setupapi.dll) \n"); 182 return (HSPFILEQ) INVALID_HANDLE_VALUE; 183 } 184 185 /*********************************************************************** 186 * SetupOpenInfFileA 188 187 */ 189 188 HINF WINAPI SetupOpenInfFileA (PCSTR FileName, PCSTR InfClass, DWORD InfStyle, 190 189 PUINT ErrorLine) 191 190 { 192 FIXME("not implemented (setupapi.dll) \n");193 return 0;194 } 195 196 /*********************************************************************** 197 * SetupQueueCopyA191 FIXME("not implemented (setupapi.dll) \n"); 192 return 0; 193 } 194 195 /*********************************************************************** 196 * SetupQueueCopyA 198 197 */ 199 198 BOOL WINAPI SetupQueueCopyA (HSPFILEQ QueueHandle, PCSTR SourceRootPath, PCSTR SourcePath, 200 PCSTR SourceFileName, PCSTR SourceDescription, PCSTR SourceTagFile,201 PCSTR TargetDirectory, PCSTR TargetFileName, DWORD CopyStyle)202 { 203 FIXME("not implemented (setupapi.dll) \n");204 return FALSE;205 } 206 207 /*********************************************************************** 208 * SetupSetDirectoryIdA199 PCSTR SourceFileName, PCSTR SourceDescription, PCSTR SourceTagFile, 200 PCSTR TargetDirectory, PCSTR TargetFileName, DWORD CopyStyle) 201 { 202 FIXME("not implemented (setupapi.dll) \n"); 203 return FALSE; 204 } 205 206 /*********************************************************************** 207 * SetupSetDirectoryIdA 209 208 */ 210 209 BOOL WINAPI SetupSetDirectoryIdA (HINF InfHandle, 211 DWORD Id,212 PCSTR Directory)213 { 214 FIXME("not implemented (setupapi.dll) \n");215 return FALSE;216 } 217 218 219 /*********************************************************************** 220 * SetupTermDefaultQueueCallback210 DWORD Id, 211 PCSTR Directory) 212 { 213 FIXME("not implemented (setupapi.dll) \n"); 214 return FALSE; 215 } 216 217 218 /*********************************************************************** 219 * SetupTermDefaultQueueCallback 221 220 */ 222 221 VOID WINAPI SetupTermDefaultQueueCallback (PVOID Callback) 223 222 { 224 FIXME("not implemented (setupapi.dll) \n");225 } 226 223 FIXME("not implemented (setupapi.dll) \n"); 224 } 225
Note:
See TracChangeset
for help on using the changeset viewer.
