setupapi: Don't clobber the original filename if .inf is found.
This commit is contained in:
parent
dd44e2e6d6
commit
35ac0e7ac0
1 changed files with 10 additions and 13 deletions
|
@ -1068,23 +1068,20 @@ BOOL WINAPI SetupCopyOEMInfW( PCWSTR source, PCWSTR location,
|
|||
if (!(ret = CopyFileW( source, target, TRUE )))
|
||||
return ret;
|
||||
|
||||
wcscpy(pnf_path, target);
|
||||
PathRemoveExtensionW(pnf_path);
|
||||
PathAddExtensionW(pnf_path, L".pnf");
|
||||
if ((pnf_file = _wfopen(pnf_path, L"w")))
|
||||
{
|
||||
fputws(PNF_HEADER, pnf_file);
|
||||
fputws(source, pnf_file);
|
||||
fclose(pnf_file);
|
||||
}
|
||||
|
||||
done:
|
||||
if (style & SP_COPY_DELETESOURCE)
|
||||
DeleteFileW( source );
|
||||
|
||||
if (ret)
|
||||
{
|
||||
wcscpy(pnf_path, target);
|
||||
PathRemoveExtensionW(pnf_path);
|
||||
PathAddExtensionW(pnf_path, L".pnf");
|
||||
if ((pnf_file = _wfopen(pnf_path, L"w")))
|
||||
{
|
||||
fputws(PNF_HEADER, pnf_file);
|
||||
fputws(source, pnf_file);
|
||||
fclose(pnf_file);
|
||||
}
|
||||
}
|
||||
|
||||
size = lstrlenW( target ) + 1;
|
||||
if (dest)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue