Commit e358731f authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

kernelbase: Remove unnecessary handler from LocalLock.

parent 2fcb072f
...@@ -774,6 +774,7 @@ HLOCAL WINAPI DECLSPEC_HOTPATCH LocalFree( HLOCAL handle ) ...@@ -774,6 +774,7 @@ HLOCAL WINAPI DECLSPEC_HOTPATCH LocalFree( HLOCAL handle )
*/ */
LPVOID WINAPI DECLSPEC_HOTPATCH LocalLock( HLOCAL handle ) LPVOID WINAPI DECLSPEC_HOTPATCH LocalLock( HLOCAL handle )
{ {
HANDLE heap = GetProcessHeap();
struct mem_entry *mem; struct mem_entry *mem;
void *ret = NULL; void *ret = NULL;
...@@ -794,28 +795,20 @@ LPVOID WINAPI DECLSPEC_HOTPATCH LocalLock( HLOCAL handle ) ...@@ -794,28 +795,20 @@ LPVOID WINAPI DECLSPEC_HOTPATCH LocalLock( HLOCAL handle )
return ret; return ret;
} }
RtlLockHeap( GetProcessHeap() ); RtlLockHeap( heap );
__TRY if ((mem = unsafe_mem_from_HLOCAL( handle )))
{ {
if ((mem = unsafe_mem_from_HLOCAL( handle ))) ret = mem->ptr;
{ if (!mem->ptr) SetLastError( ERROR_DISCARDED );
ret = mem->ptr; else if (mem->lock < LMEM_LOCKCOUNT) mem->lock++;
if (!mem->ptr) SetLastError( ERROR_DISCARDED );
else if (mem->lock < LMEM_LOCKCOUNT) mem->lock++;
}
else
{
WARN_(globalmem)( "invalid handle %p\n", handle );
SetLastError( ERROR_INVALID_HANDLE );
}
} }
__EXCEPT_PAGE_FAULT else
{ {
WARN_(globalmem)( "(%p): Page fault occurred ! Caused by bug ?\n", handle ); WARN_(globalmem)( "invalid handle %p\n", handle );
SetLastError( ERROR_INVALID_HANDLE ); SetLastError( ERROR_INVALID_HANDLE );
} }
__ENDTRY RtlUnlockHeap( heap );
RtlUnlockHeap( GetProcessHeap() );
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment