mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[WIN32K:NTUSER] Assert global user lock is held exclusively when using global & desktop heaps
They're explicitly not serialized because we count on this.
This commit is contained in:
parent
8c098ee8d2
commit
d958dc9bc2
3 changed files with 15 additions and 1 deletions
|
@ -230,6 +230,8 @@ static __inline PVOID
|
||||||
DesktopHeapAlloc(IN PDESKTOP Desktop,
|
DesktopHeapAlloc(IN PDESKTOP Desktop,
|
||||||
IN SIZE_T Bytes)
|
IN SIZE_T Bytes)
|
||||||
{
|
{
|
||||||
|
/* Desktop heap has no lock, using global user lock instead. */
|
||||||
|
ASSERT(UserIsEnteredExclusive());
|
||||||
return RtlAllocateHeap(Desktop->pheapDesktop,
|
return RtlAllocateHeap(Desktop->pheapDesktop,
|
||||||
HEAP_NO_SERIALIZE,
|
HEAP_NO_SERIALIZE,
|
||||||
Bytes);
|
Bytes);
|
||||||
|
@ -239,6 +241,8 @@ static __inline BOOL
|
||||||
DesktopHeapFree(IN PDESKTOP Desktop,
|
DesktopHeapFree(IN PDESKTOP Desktop,
|
||||||
IN PVOID lpMem)
|
IN PVOID lpMem)
|
||||||
{
|
{
|
||||||
|
/* Desktop heap has no lock, using global user lock instead. */
|
||||||
|
ASSERT(UserIsEnteredExclusive());
|
||||||
return RtlFreeHeap(Desktop->pheapDesktop,
|
return RtlFreeHeap(Desktop->pheapDesktop,
|
||||||
HEAP_NO_SERIALIZE,
|
HEAP_NO_SERIALIZE,
|
||||||
lpMem);
|
lpMem);
|
||||||
|
@ -259,6 +263,9 @@ DesktopHeapReAlloc(IN PDESKTOP Desktop,
|
||||||
SIZE_T PrevSize;
|
SIZE_T PrevSize;
|
||||||
PVOID pNew;
|
PVOID pNew;
|
||||||
|
|
||||||
|
/* Desktop heap has no lock, using global user lock instead. */
|
||||||
|
ASSERT(UserIsEnteredExclusive());
|
||||||
|
|
||||||
PrevSize = RtlSizeHeap(Desktop->pheapDesktop,
|
PrevSize = RtlSizeHeap(Desktop->pheapDesktop,
|
||||||
HEAP_NO_SERIALIZE,
|
HEAP_NO_SERIALIZE,
|
||||||
lpMem);
|
lpMem);
|
||||||
|
|
|
@ -33,6 +33,8 @@ MapGlobalUserHeap(IN PEPROCESS Process,
|
||||||
static __inline PVOID
|
static __inline PVOID
|
||||||
UserHeapAlloc(SIZE_T Bytes)
|
UserHeapAlloc(SIZE_T Bytes)
|
||||||
{
|
{
|
||||||
|
/* User heap has no lock, using global user lock instead. */
|
||||||
|
ASSERT(UserIsEnteredExclusive());
|
||||||
return RtlAllocateHeap(GlobalUserHeap,
|
return RtlAllocateHeap(GlobalUserHeap,
|
||||||
HEAP_NO_SERIALIZE,
|
HEAP_NO_SERIALIZE,
|
||||||
Bytes);
|
Bytes);
|
||||||
|
@ -41,6 +43,8 @@ UserHeapAlloc(SIZE_T Bytes)
|
||||||
static __inline BOOL
|
static __inline BOOL
|
||||||
UserHeapFree(PVOID lpMem)
|
UserHeapFree(PVOID lpMem)
|
||||||
{
|
{
|
||||||
|
/* User heap has no lock, using global user lock instead. */
|
||||||
|
ASSERT(UserIsEnteredExclusive());
|
||||||
return RtlFreeHeap(GlobalUserHeap,
|
return RtlFreeHeap(GlobalUserHeap,
|
||||||
HEAP_NO_SERIALIZE,
|
HEAP_NO_SERIALIZE,
|
||||||
lpMem);
|
lpMem);
|
||||||
|
@ -60,6 +64,9 @@ UserHeapReAlloc(PVOID lpMem,
|
||||||
SIZE_T PrevSize;
|
SIZE_T PrevSize;
|
||||||
PVOID pNew;
|
PVOID pNew;
|
||||||
|
|
||||||
|
/* User heap has no lock, using global user lock instead. */
|
||||||
|
ASSERT(UserIsEnteredExclusive());
|
||||||
|
|
||||||
PrevSize = RtlSizeHeap(GlobalUserHeap,
|
PrevSize = RtlSizeHeap(GlobalUserHeap,
|
||||||
HEAP_NO_SERIALIZE,
|
HEAP_NO_SERIALIZE,
|
||||||
lpMem);
|
lpMem);
|
||||||
|
|
|
@ -58,9 +58,9 @@ typedef struct _DC *PDC;
|
||||||
#include "user/ntuser/win32.h"
|
#include "user/ntuser/win32.h"
|
||||||
#include "user/ntuser/tags.h"
|
#include "user/ntuser/tags.h"
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
|
#include "user/ntuser/ntuser.h"
|
||||||
#include "user/ntuser/usrheap.h"
|
#include "user/ntuser/usrheap.h"
|
||||||
#include "user/ntuser/object.h"
|
#include "user/ntuser/object.h"
|
||||||
#include "user/ntuser/ntuser.h"
|
|
||||||
#include "user/ntuser/shutdown.h"
|
#include "user/ntuser/shutdown.h"
|
||||||
#include "user/ntuser/cursoricon.h"
|
#include "user/ntuser/cursoricon.h"
|
||||||
#include "user/ntuser/accelerator.h"
|
#include "user/ntuser/accelerator.h"
|
||||||
|
|
Loading…
Reference in a new issue