FindClose: protect the GlobalLock for pagefaults too.
This commit is contained in:
parent
714bfd7e4a
commit
77fbbcf30d
|
@ -1806,17 +1806,16 @@ BOOL WINAPI FindClose( HANDLE handle )
|
|||
{
|
||||
FIND_FIRST_INFO *info;
|
||||
|
||||
if ((handle == INVALID_HANDLE_VALUE) ||
|
||||
!(info = (FIND_FIRST_INFO *)GlobalLock( handle )))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_HANDLE );
|
||||
return FALSE;
|
||||
}
|
||||
if (handle == INVALID_HANDLE_VALUE) goto error;
|
||||
|
||||
__TRY
|
||||
{
|
||||
if ((info = (FIND_FIRST_INFO *)GlobalLock( handle )))
|
||||
{
|
||||
if (info->dir) DOSFS_CloseDir( info->dir );
|
||||
if (info->path) HeapFree( GetProcessHeap(), 0, info->path );
|
||||
}
|
||||
}
|
||||
__EXCEPT(page_fault)
|
||||
{
|
||||
WARN("Illegal handle %x\n", handle);
|
||||
|
@ -1824,9 +1823,14 @@ BOOL WINAPI FindClose( HANDLE handle )
|
|||
return FALSE;
|
||||
}
|
||||
__ENDTRY
|
||||
if (!info) goto error;
|
||||
GlobalUnlock( handle );
|
||||
GlobalFree( handle );
|
||||
return TRUE;
|
||||
|
||||
error:
|
||||
SetLastError( ERROR_INVALID_HANDLE );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in New Issue