1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

setupapi: Don't clobber the original filename if .inf is found.

This commit is contained in:
Rémi Bernon 2024-01-22 18:46:40 +01:00 committed by Alexandre Julliard
parent dd44e2e6d6
commit 35ac0e7ac0

View file

@ -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)
{