diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index d3fb0239a04..64b3e139cbe 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2875,6 +2875,7 @@ static HRESULT StorageImpl_LockRegionSync(StorageImpl *This, ULARGE_INTEGER offs { HRESULT hr; int delay = 0; + DWORD start_time = GetTickCount(); do { @@ -2882,6 +2883,11 @@ static HRESULT StorageImpl_LockRegionSync(StorageImpl *This, ULARGE_INTEGER offs if (hr == STG_E_ACCESSDENIED || hr == STG_E_LOCKVIOLATION) { + if (GetTickCount() - start_time >= 20000) + { + /* timeout */ + break; + } Sleep(delay); if (delay < 150) delay++; }