ReactOS  0.4.11-dev-791-gf6f1255
misc.h
Go to the documentation of this file.
1 #pragma once
2 
3 typedef struct INTENG_ENTER_LEAVE_TAG
4  {
5  /* Contents is private to EngEnter/EngLeave */
13 
14 extern BOOL APIENTRY IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
15  SURFOBJ *DestObj,
16  RECTL *DestRect,
17  BOOL ReadOnly,
18  POINTL *Translate,
19  SURFOBJ **OutputObj);
20 
21 extern BOOL APIENTRY IntEngLeave(PINTENG_ENTER_LEAVE EnterLeave);
22 
23 extern HGDIOBJ StockObjects[];
24 extern SHORT gusLanguageID;
25 
29 
31 NTAPI
33  LPCWSTR pwszKeyName,
34  PHKEY phkey);
35 
37 NTAPI
39  IN HKEY hkey,
41  IN ULONG ulType,
43  IN OUT PULONG pcbValue);
44 
45 VOID
46 NTAPI
47 RegWriteSZ(HKEY hkey, PWSTR pwszValue, PWSTR pwszData);
48 
49 VOID
50 NTAPI
51 RegWriteDWORD(HKEY hkey, PWSTR pwszValue, DWORD dwData);
52 
53 BOOL
54 NTAPI
55 RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData);
56 
60 
61 typedef struct _GDI_POOL *PGDI_POOL;
62 
63 PGDI_POOL
64 NTAPI
67  ULONG ulTag);
68 
69 VOID
70 NTAPI
71 GdiPoolDestroy(PGDI_POOL pPool);
72 
73 PVOID
74 NTAPI
76  PGDI_POOL pPool);
77 
78 VOID
79 NTAPI
81  PGDI_POOL pPool,
82  PVOID pvAlloc);
83 
85 VOID
87 {
88  /* Try acquiring the lock */
90  {
91  /* Someone changed it, use the slow path */
93  }
94 }
95 
97 BOOLEAN
99 {
100  /* Try acquiring the lock */
102 }
103 
105 VOID
107 {
108  EX_PUSH_LOCK OldValue;
109 
110  /* Unlock the pushlock */
111  OldValue.Value = InterlockedExchangeAddSizeT((PSIZE_T)PushLock,
113  /* Check if anyone is waiting on it and it's not already waking */
114  if ((OldValue.Waiting) && !(OldValue.Waking))
115  {
116  /* Wake it up */
117  ExfTryToWakePushLock(PushLock);
118  }
119 }
120 
122 VOID
124 {
125  *(PULONG_PTR)Lock = 0;
126 }
127 #define ExInitializePushLock _ExInitializePushLock
128 
132 
136 
138 
140 
ULONG_PTR Value
Definition: extypes.h:465
DWORD *typedef PVOID
Definition: winlogon.h:61
SURFOBJ * OutputObj
Definition: misc.h:7
#define IN
Definition: typedefs.h:38
VOID NTAPI GdiPoolDestroy(PGDI_POOL pPool)
Definition: gdipool.c:343
#define HBITMAP
Definition: msvc.h:28
NTSTATUS NTAPI RegQueryValue(IN HKEY hkey, IN PCWSTR pwszValueName, IN ULONG ulType, OUT PVOID pvData, IN OUT PULONG pcbValue)
Definition: registry.c:47
Definition: arc.h:80
FORCEINLINE VOID _ExInitializePushLock(PEX_PUSH_LOCK Lock)
Definition: misc.h:123
struct INTENG_ENTER_LEAVE_TAG INTENG_ENTER_LEAVE
BOOL NTAPI W32kDosPathNameToNtPathName(PCWSTR, PUNICODE_STRING)
ULONG cjAllocSize
Definition: gdipool.c:32
PVOID *typedef PWSTR
Definition: winlogon.h:66
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static HANDLE ULONG_PTR dwData
Definition: file.c:35
LONG_PTR SSIZE_T
Definition: basetsd.h:183
#define FASTCALL
Definition: nt_native.h:50
SURFOBJ * DestObj
Definition: misc.h:6
DWORD DWORD
Definition: winlogon.h:84
struct INTENG_ENTER_LEAVE_TAG * PINTENG_ENTER_LEAVE
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
ULONG_PTR * PSIZE_T
Definition: typedefs.h:78
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS FASTCALL IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest, PUNICODE_STRING Source)
Definition: misc.c:659
short SHORT
Definition: pedump.c:59
#define APIENTRY
Definition: nt_native.h:48
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
BOOL APIENTRY IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, SURFOBJ *DestObj, RECTL *DestRect, BOOL ReadOnly, POINTL *Translate, SURFOBJ **OutputObj)
Definition: engmisc.c:15
ULONG_PTR Waiting
Definition: extypes.h:460
#define FORCEINLINE
Definition: ntbasedef.h:221
PVOID APIENTRY HackSecureVirtualMemory(IN PVOID, IN SIZE_T, IN ULONG, OUT PVOID *)
Definition: mem.c:113
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
Definition: gdipool.c:233
ULONG_PTR Waking
Definition: extypes.h:461
#define InterlockedBitTestAndSet
Definition: interlocked.h:30
unsigned char BOOLEAN
#define EX_PUSH_LOCK_LOCK
Definition: Object.c:29
NTSTATUS NTAPI RegOpenKey(LPCWSTR pwszKeyName, PHKEY phkey)
Definition: registry.c:16
VOID NTAPI RegWriteSZ(HKEY hkey, PWSTR pwszValue, PWSTR pwszData)
Definition: registry.c:128
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG NTSTATUS
Definition: precomp.h:26
BOOL APIENTRY IntEngLeave(PINTENG_ENTER_LEAVE EnterLeave)
Definition: engmisc.c:162
HANDLE HKEY
Definition: registry.h:24
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:36
PVOID NTAPI GdiPoolAllocate(PGDI_POOL pPool)
Definition: gdipool.c:122
VOID NTAPI RegWriteDWORD(HKEY hkey, PWSTR pwszValue, DWORD dwData)
Definition: registry.c:140
BOOL NTAPI RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData)
Definition: registry.c:150
struct _GDI_POOL * PGDI_POOL
Definition: misc.h:61
VOID FASTCALL ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: pushlock.c:471
HBITMAP NTAPI UserLoadImage(PCWSTR)
Definition: file.c:155
#define InterlockedExchangeAddSizeT(a, b)
Definition: interlocked.h:196
SHORT gusLanguageID
Definition: main.c:29
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
VOID APIENTRY HackUnsecureVirtualMemory(IN PVOID)
Definition: mem.c:163
Status
Definition: gdiplustypes.h:24
NTSTATUS FASTCALL IntSafeCopyUnicodeString(PUNICODE_STRING Dest, PUNICODE_STRING Source)
Definition: misc.c:613
_In_ ULONG _In_ ULONG ulTag
Definition: winddi.h:3941
ULONG_PTR SIZE_T
Definition: typedefs.h:78
HANDLE * PHKEY
Definition: registry.h:24
SHORT FASTCALL UserGetLanguageID(VOID)
Definition: misc.c:96
FORCEINLINE VOID ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: misc.h:106
unsigned int * PULONG
Definition: retypes.h:1
#define EX_PUSH_LOCK_LOCK_V
Definition: Object.c:28
CLIPOBJ * TrivialClipObj
Definition: misc.h:9
HBITMAP OutputBitmap
Definition: misc.h:8
DWORD * PDWORD
Definition: pedump.c:68
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:36
PGDI_POOL NTAPI GdiPoolCreate(ULONG cjAllocSize, ULONG ulTag)
Definition: gdipool.c:316
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
uint32_t * PULONG_PTR
Definition: typedefs.h:63
const uint16_t * PCWSTR
Definition: typedefs.h:55
signed int * PLONG
Definition: retypes.h:5
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: misc.h:86
FORCEINLINE BOOLEAN ExTryAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: misc.h:98
VOID FASTCALL ExfTryToWakePushLock(PEX_PUSH_LOCK PushLock)
Definition: pushlock.c:1165