ReactOS 0.4.15-dev-7942-gd23573b
prop.c File Reference
#include <win32k.h>
Include dependency graph for prop.c:

Go to the source code of this file.

Functions

 DBG_DEFAULT_CHANNEL (UserProp)
 
PPROPERTY FASTCALL IntGetProp (_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
 
HANDLE FASTCALL UserGetProp (_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
 
 _Success_ (return)
 
VOID FASTCALL UserRemoveWindowProps (_In_ PWND Window)
 
NTSTATUS APIENTRY NtUserBuildPropList (_In_ HWND hWnd, _Out_writes_bytes_to_opt_(BufferSize, *Count *sizeof(PROPLISTITEM)) LPVOID Buffer, _In_ DWORD BufferSize, _Out_opt_ DWORD *Count)
 
HANDLE APIENTRY NtUserRemoveProp (_In_ HWND hWnd, _In_ ATOM Atom)
 
BOOL APIENTRY NtUserSetProp (_In_ HWND hWnd, _In_ ATOM Atom, _In_ HANDLE Data)
 

Function Documentation

◆ _Success_()

_Success_ ( return  )

Definition at line 58 of file prop.c.

65{
66 PPROPERTY Prop;
68
71 if (Prop == NULL)
72 {
73 return NULL;
74 }
75
76 Data = Prop->Data;
78 UserHeapFree(Prop);
79 Window->PropListItems--;
80 return Data;
81}
_Out_ RTL_ATOM * Atom
Definition: class.h:54
#define NULL
Definition: types.h:112
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
BOOL FASTCALL UserIsEnteredExclusive(VOID)
Definition: ntuser.c:224
_In_ ATOM _In_ HANDLE _In_ BOOLEAN SystemProp
Definition: prop.h:24
Definition: window.c:28
HANDLE Data
Definition: ntuser.h:1101
LIST_ENTRY PropListEntry
Definition: ntuser.h:1100
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:44
PPROPERTY FASTCALL IntGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:16
#define NT_ASSERT
Definition: rtlfuncs.h:3310

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UserProp  )

◆ IntGetProp()

PPROPERTY FASTCALL IntGetProp ( _In_ PWND  Window,
_In_ ATOM  Atom,
_In_ BOOLEAN  SystemProp 
)

Definition at line 16 of file prop.c.

20{
21 PLIST_ENTRY ListEntry;
23 UINT i;
24 WORD SystemFlag = SystemProp ? PROPERTY_FLAG_SYSTEM : 0;
25
27 ListEntry = Window->PropListHead.Flink;
28
29 for (i = 0; i < Window->PropListItems; i++)
30 {
31 Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
32 ListEntry = ListEntry->Flink;
33
34 if (Property->Atom == Atom &&
35 (Property->fs & PROPERTY_FLAG_SYSTEM) == SystemFlag)
36 {
37 return Property;
38 }
39 }
40 NT_ASSERT(ListEntry == &Window->PropListHead);
41 return NULL;
42}
unsigned short WORD
Definition: ntddk_ex.h:93
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PROPERTY_FLAG_SYSTEM
Definition: ntuser.h:1096
unsigned int UINT
Definition: ndis.h:50
BOOL FASTCALL UserIsEntered(VOID)
Definition: ntuser.c:218
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by _Success_(), GetPropW(), and UserGetProp().

◆ NtUserBuildPropList()

NTSTATUS APIENTRY NtUserBuildPropList ( _In_ HWND  hWnd,
_Out_writes_bytes_to_opt_(BufferSize, *Count *sizeof(PROPLISTITEM)) LPVOID  Buffer,
_In_ DWORD  BufferSize,
_Out_opt_ DWORD Count 
)

Definition at line 137 of file prop.c.

142{
143 PWND Window;
145 PLIST_ENTRY ListEntry;
146 PROPLISTITEM listitem = { 0 }, *li;
148 DWORD Cnt = 0;
149
150 TRACE("Enter NtUserBuildPropList\n");
152
154 if (Window == NULL)
155 {
157 goto Exit;
158 }
159
160 if (Buffer)
161 {
162 if (!BufferSize || (BufferSize % sizeof(PROPLISTITEM) != 0))
163 {
165 goto Exit;
166 }
167
168 /* Copy list */
170 ListEntry = Window->PropListHead.Flink;
171 while ((BufferSize >= sizeof(PROPLISTITEM)) &&
172 (ListEntry != &Window->PropListHead))
173 {
174 Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
175 ListEntry = ListEntry->Flink;
176 if (!(Property->fs & PROPERTY_FLAG_SYSTEM))
177 {
178 listitem.Atom = Property->Atom;
179 listitem.Data = Property->Data;
180
181 Status = MmCopyToCaller(li, &listitem, sizeof(PROPLISTITEM));
182 if (!NT_SUCCESS(Status))
183 {
184 goto Exit;
185 }
186
187 BufferSize -= sizeof(PROPLISTITEM);
188 Cnt++;
189 li++;
190 }
191 }
192
193 }
194 else
195 {
196 /* FIXME: This counts user and system props */
197 Cnt = Window->PropListItems * sizeof(PROPLISTITEM);
198 }
199
200 if (Count)
201 {
202 Status = MmCopyToCaller(Count, &Cnt, sizeof(DWORD));
203 if (!NT_SUCCESS(Status))
204 {
205 goto Exit;
206 }
207 }
208
210
211Exit:
212 TRACE("Leave NtUserBuildPropList, ret=%lx\n", Status);
213 UserLeave();
214
215 return Status;
216}
HWND hWnd
Definition: settings.c:17
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235
Status
Definition: gdiplustypes.h:25
struct _PROPLISTITEM PROPLISTITEM
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
int Count
Definition: noreturn.cpp:7
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:245
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:251
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:235
#define STATUS_SUCCESS
Definition: shellext.h:65
static void Exit(void)
Definition: sock.c:1330
#define TRACE(s)
Definition: solgame.cpp:4
HANDLE Data
Definition: ntuser.h:1093
Definition: ntuser.h:694
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:122
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

Referenced by EnumPropsA(), EnumPropsExA(), EnumPropsExW(), and EnumPropsW().

◆ NtUserRemoveProp()

HANDLE APIENTRY NtUserRemoveProp ( _In_ HWND  hWnd,
_In_ ATOM  Atom 
)

Definition at line 220 of file prop.c.

223{
224 PWND Window;
225 HANDLE Data = NULL;
226
227 TRACE("Enter NtUserRemoveProp\n");
229
231 if (Window == NULL)
232 {
233 goto Exit;
234 }
235
237
238Exit:
239 TRACE("Leave NtUserRemoveProp, ret=%p\n", Data);
240 UserLeave();
241
242 return Data;
243}
#define FALSE
Definition: types.h:117
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:242
HANDLE FASTCALL UserRemoveProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)

Referenced by RemovePropW().

◆ NtUserSetProp()

BOOL APIENTRY NtUserSetProp ( _In_ HWND  hWnd,
_In_ ATOM  Atom,
_In_ HANDLE  Data 
)

Definition at line 247 of file prop.c.

251{
252 PWND Window;
253 BOOL Ret;
254
255 TRACE("Enter NtUserSetProp\n");
257
259 if (Window == NULL)
260 {
261 Ret = FALSE;
262 goto Exit;
263 }
264
265 Ret = UserSetProp(Window, Atom, Data, FALSE);
266
267Exit:
268 TRACE("Leave NtUserSetProp, ret=%i\n", Ret);
269 UserLeave();
270
271 return Ret;
272}
unsigned int BOOL
Definition: ntddk_ex.h:94

Referenced by SetPropW().

◆ UserGetProp()

◆ UserRemoveWindowProps()

VOID FASTCALL UserRemoveWindowProps ( _In_ PWND  Window)

Definition at line 115 of file prop.c.

117{
118 PLIST_ENTRY ListEntry;
120
122 while (!IsListEmpty(&Window->PropListHead))
123 {
124 ListEntry = Window->PropListHead.Flink;
125 Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
126 RemoveEntryList(&Property->PropListEntry);
128 Window->PropListItems--;
129 }
130 return;
131}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954

Referenced by co_UserFreeWindow().