mstask: Retry opening a .job file only in case of sharing violation.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Dmitry Timoshkov 2018-06-12 21:41:18 +08:00 committed by Alexandre Julliard
parent 88f273b77c
commit 70ca4ecd14
1 changed files with 1 additions and 1 deletions

View File

@ -1444,7 +1444,7 @@ static HRESULT WINAPI MSTASK_IPersistFile_Load(IPersistFile *iface, LPCOLESTR fi
file = CreateFileW(file_name, access, sharing, NULL, OPEN_EXISTING, 0, 0);
if (file != INVALID_HANDLE_VALUE) break;
if (try++ >= 3)
if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3)
{
TRACE("Failed to open %s, error %u\n", debugstr_w(file_name), GetLastError());
return HRESULT_FROM_WIN32(GetLastError());