Check for -1 as the undefined value for handles before CloseHandle.

This commit is contained in:
Marcus Meissner 2001-08-03 18:11:00 +00:00 committed by Alexandre Julliard
parent 9a1a35e489
commit bb72c3d5d5
1 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ static void DEBUG_UnmapDebugInfoFile(HANDLE hFile, HANDLE hMap, void* addr)
{
if (addr) UnmapViewOfFile(addr);
if (hMap) CloseHandle(hMap);
if (hFile) CloseHandle(hFile);
if (hFile!=INVALID_HANDLE_VALUE) CloseHandle(hFile);
}
@ -2898,7 +2898,7 @@ static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module,
const char *filename, DWORD timestamp )
{
enum DbgInfoLoad dil = DIL_ERROR;
HANDLE hFile = 0, hMap = 0;
HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0;
LPBYTE file_map = NULL;
PIMAGE_SEPARATE_DEBUG_HEADER hdr;
PIMAGE_DEBUG_DIRECTORY dbg;