--- trunk/reactos/lib/kernel32/misc/profile.c 2005-03-17 23:16:12 UTC (rev 14168)
+++ trunk/reactos/lib/kernel32/misc/profile.c 2005-03-17 23:52:28 UTC (rev 14169)
@@ -819,7 +819,10 @@
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 @@
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 */