api: remove temporary folder in case of intermediate failure
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
369801cdfa
commit
70461121f7
@ -320,7 +320,7 @@ InstallDriver(_In_ BOOL UpdateExisting)
|
|||||||
!PathCombineW(InfPath, RandomTempSubDirectory, L"wintun.inf"))
|
!PathCombineW(InfPath, RandomTempSubDirectory, L"wintun.inf"))
|
||||||
{
|
{
|
||||||
Result = ERROR_BUFFER_OVERFLOW;
|
Result = ERROR_BUFFER_OVERFLOW;
|
||||||
goto cleanupFree;
|
goto cleanupDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL UseWHQL = HaveWHQL();
|
BOOL UseWHQL = HaveWHQL();
|
||||||
@ -354,6 +354,7 @@ cleanupDelete:
|
|||||||
DeleteFileW(CatPath);
|
DeleteFileW(CatPath);
|
||||||
DeleteFileW(SysPath);
|
DeleteFileW(SysPath);
|
||||||
DeleteFileW(InfPath);
|
DeleteFileW(InfPath);
|
||||||
|
cleanupDirectory:
|
||||||
RemoveDirectoryW(RandomTempSubDirectory);
|
RemoveDirectoryW(RandomTempSubDirectory);
|
||||||
cleanupFree:
|
cleanupFree:
|
||||||
LocalFree(SecurityAttributes.lpSecurityDescriptor);
|
LocalFree(SecurityAttributes.lpSecurityDescriptor);
|
||||||
|
Loading…
Reference in New Issue
Block a user