- Don't use an invalid file handle. In this case invalid file handle

means that the file hasn't yet been created.
- Only call GetFileTime when we are being logged for a tiny
  performance improvement.
- Reindent to 4 spaces.
This commit is contained in:
Robert Shearman 2005-01-11 10:43:24 +00:00 committed by Alexandre Julliard
parent fbcc21be62
commit 8a46494ea9
1 changed files with 29 additions and 20 deletions

View File

@ -785,6 +785,11 @@ static BOOL PROFILE_Open( LPCWSTR filename )
MRUProfile[j]=MRUProfile[j-1];
CurProfile=tempProfile;
}
if (hFile != INVALID_HANDLE_VALUE)
{
if (TRACE_ON(profile))
{
GetFileTime(hFile, NULL, NULL, &LastWriteTime);
if (memcmp(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME)))
TRACE("(%s): already opened (mru=%d)\n",
@ -792,7 +797,11 @@ static BOOL PROFILE_Open( LPCWSTR filename )
else
TRACE("(%s): already opened, needs refreshing (mru=%d)\n",
debugstr_w(buffer), i);
}
CloseHandle(hFile);
}
else TRACE("(%s): already opened, not yet created (mru=%d)\n",
debugstr_w(buffer), i);
return TRUE;
}
}