mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
It's not exactly wise to call GetFileTime and CloseHandle with invalid handle, so don't do it.
svn path=/trunk/; revision=14169
This commit is contained in:
parent
b8419654bd
commit
e995509c26
1 changed files with 7 additions and 3 deletions
|
@ -819,7 +819,10 @@ static BOOL PROFILE_Open( LPCWSTR filename )
|
|||
MRUProfile[j] = MRUProfile[j-1];
|
||||
CurProfile=tempProfile;
|
||||
}
|
||||
GetFileTime(hFile, NULL, NULL, &LastWriteTime);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
GetFileTime(hFile, NULL, NULL, &LastWriteTime);
|
||||
else
|
||||
LastWriteTime.dwHighDateTime = LastWriteTime.dwLowDateTime = 0;
|
||||
if (memcmp(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME)))
|
||||
{
|
||||
DPRINT("(%S): already opened (mru = %d)\n",
|
||||
|
@ -830,9 +833,10 @@ static BOOL PROFILE_Open( LPCWSTR filename )
|
|||
DPRINT("(%S): already opened, needs refreshing (mru = %d)\n",
|
||||
buffer, i );
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
CloseHandle(hFile);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Flush the old current profile */
|
||||
|
|
Loading…
Reference in a new issue