Allow illegal handles in FindClose.

This commit is contained in:
Dominik Strasser 2001-04-20 18:38:41 +00:00 committed by Alexandre Julliard
parent f32f918123
commit 4f46b5de45
1 changed files with 19 additions and 2 deletions

View File

@ -105,6 +105,13 @@ typedef struct
} FIND_FIRST_INFO;
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* DOSFS_ValidDOSName
@ -1768,8 +1775,18 @@ BOOL WINAPI FindClose( HANDLE handle )
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
if (info->dir) DOSFS_CloseDir( info->dir );
if (info->path) HeapFree( GetProcessHeap(), 0, info->path );
__TRY
{
if (info->dir) DOSFS_CloseDir( info->dir );
if (info->path) HeapFree( GetProcessHeap(), 0, info->path );
}
__EXCEPT(page_fault)
{
WARN("Illegal handle %x\n", handle);
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
__ENDTRY
GlobalUnlock( handle );
GlobalFree( handle );
return TRUE;