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

kernelbase: Workaround Local(Alloc|Free) invalid access warnings.

parent f7a4ca44
......@@ -712,7 +712,7 @@ static struct kernelbase_global_data global_data = {0};
static inline struct mem_entry *unsafe_mem_from_HLOCAL( HLOCAL handle )
{
struct mem_entry *mem = CONTAINING_RECORD( handle, struct mem_entry, ptr );
struct mem_entry *mem = CONTAINING_RECORD( *(volatile HANDLE *)&handle, struct mem_entry, ptr );
struct kernelbase_global_data *data = &global_data;
if (((UINT_PTR)handle & ((sizeof(void *) << 1) - 1)) != sizeof(void *)) return NULL;
if (mem < data->mem_entries || mem >= data->mem_entries_end) return NULL;
......@@ -831,7 +831,7 @@ HLOCAL WINAPI DECLSPEC_HOTPATCH LocalAlloc( UINT flags, SIZE_T size )
return handle;
failed:
if (mem) LocalFree( handle );
if (mem) LocalFree( *(volatile HANDLE *)&handle );
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
return 0;
}
......
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