ReactOS  0.4.15-dev-5461-g062a8f2
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 
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 USHORT 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 
57 DWORD
58 NTAPI
59 RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault);
60 
64 
65 typedef struct _GDI_POOL *PGDI_POOL;
66 
68 NTAPI
71  ULONG ulTag);
72 
73 VOID
74 NTAPI
76 
77 PVOID
78 NTAPI
80  PGDI_POOL pPool);
81 
82 VOID
83 NTAPI
85  PGDI_POOL pPool,
86  PVOID pvAlloc);
87 
89 VOID
91 {
92  /* Try acquiring the lock */
94  {
95  /* Someone changed it, use the slow path */
97  }
98 }
99 
101 BOOLEAN
103 {
104  /* Try acquiring the lock */
106 }
107 
109 VOID
111 {
112  EX_PUSH_LOCK OldValue;
113 
114  /* Unlock the pushlock */
115  OldValue.Value = InterlockedExchangeAddSizeT((PSIZE_T)PushLock,
117  /* Check if anyone is waiting on it and it's not already waking */
118  if ((OldValue.Waiting) && !(OldValue.Waking))
119  {
120  /* Wake it up */
121  ExfTryToWakePushLock(PushLock);
122  }
123 }
124 
126 VOID
128 {
129  *(PULONG_PTR)Lock = 0;
130 }
131 #define ExInitializePushLock _ExInitializePushLock
132 
136 
140 
142 
144 
ULONG_PTR Value
Definition: extypes.h:465
SURFOBJ * OutputObj
Definition: misc.h:7
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
VOID NTAPI GdiPoolDestroy(PGDI_POOL pPool)
Definition: gdipool.c:343
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
uint16_t * PWSTR
Definition: typedefs.h:56
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:127
struct INTENG_ENTER_LEAVE_TAG INTENG_ENTER_LEAVE
LONG NTSTATUS
Definition: precomp.h:26
BOOL NTAPI W32kDosPathNameToNtPathName(PCWSTR, PUNICODE_STRING)
ULONG cjAllocSize
Definition: gdipool.c:32
static HANDLE ULONG_PTR dwData
Definition: file.c:35
USHORT FASTCALL UserGetLanguageID(VOID)
Definition: misc.c:97
LONG_PTR SSIZE_T
Definition: basetsd.h:183
DWORD NTAPI RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault)
Definition: registry.c:173
#define FASTCALL
Definition: nt_native.h:50
SURFOBJ * DestObj
Definition: misc.h:6
struct INTENG_ENTER_LEAVE_TAG * PINTENG_ENTER_LEAVE
HGDIOBJ StockObjects[]
Definition: stockobj.c:100
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
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:679
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned char BOOLEAN
_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
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
Status
Definition: gdiplustypes.h:24
#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
BOOL APIENTRY IntEngLeave(PINTENG_ENTER_LEAVE EnterLeave)
Definition: engmisc.c:162
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:47
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
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _GDI_POOL * PGDI_POOL
Definition: misc.h:65
VOID FASTCALL ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: pushlock.c:471
HBITMAP NTAPI UserLoadImage(PCWSTR)
Definition: file.c:159
#define InterlockedExchangeAddSizeT(a, b)
Definition: interlocked.h:196
USHORT gusLanguageID
Definition: main.c:29
VOID APIENTRY HackUnsecureVirtualMemory(IN PVOID)
Definition: mem.c:163
NTSTATUS FASTCALL IntSafeCopyUnicodeString(PUNICODE_STRING Dest, PUNICODE_STRING Source)
Definition: misc.c:633
_In_ ULONG _In_ ULONG ulTag
Definition: winddi.h:3941
ULONG_PTR SIZE_T
Definition: typedefs.h:80
FORCEINLINE VOID ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: misc.h:110
unsigned short USHORT
Definition: pedump.c:61
#define FORCEINLINE
Definition: wdftypes.h:67
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:47
PGDI_POOL NTAPI GdiPoolCreate(ULONG cjAllocSize, ULONG ulTag)
Definition: gdipool.c:316
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
unsigned int ULONG
Definition: retypes.h:1
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
uint32_t * PULONG_PTR
Definition: typedefs.h:65
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
static HBITMAP
Definition: button.c:44
WCHAR * LPWSTR
Definition: xmlstorage.h:184
signed int * PLONG
Definition: retypes.h:5
#define APIENTRY
Definition: api.h:79
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: misc.h:90
FORCEINLINE BOOLEAN ExTryAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: misc.h:102
VOID FASTCALL ExfTryToWakePushLock(PEX_PUSH_LOCK PushLock)
Definition: pushlock.c:1165