ReactOS  0.4.13-dev-455-g28ed234
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;
67  HANDLE Data;
68 
70  Prop = IntGetProp(Window, Atom, SystemProp);
71  if (Prop == NULL)
72  {
73  return NULL;
74  }
75 
76  Data = Prop->Data;
78  UserHeapFree(Prop);
79  Window->PropListItems--;
80  return Data;
81 }
_In_ ATOM _In_ HANDLE _In_ BOOLEAN SystemProp
Definition: prop.h:22
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:42
_Out_ RTL_ATOM * Atom
Definition: class.h:54
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
Definition: window.c:29
HANDLE Data
Definition: ntuser.h:1054
LIST_ENTRY PropListEntry
Definition: ntuser.h:1053
smooth NULL
Definition: ftsmooth.c:416
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
PPROPERTY FASTCALL IntGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:16
BOOL FASTCALL UserIsEnteredExclusive(VOID)
Definition: ntuser.c:231
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ 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 }
BOOL FASTCALL UserIsEntered(VOID)
Definition: ntuser.c:225
_In_ ATOM _In_ HANDLE _In_ BOOLEAN SystemProp
Definition: prop.h:22
_Out_ RTL_ATOM * Atom
Definition: class.h:54
#define PROPERTY_FLAG_SYSTEM
Definition: ntuser.h:1049
Definition: window.c:29
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
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
unsigned short WORD
Definition: ntddk_ex.h:93
Definition: typedefs.h:117
_In_ DWORD Property
Definition: setupapi.h:1545
unsigned int UINT
Definition: ndis.h:50
#define NT_ASSERT
Definition: rtlfuncs.h:3312

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, *li;
148  DWORD Cnt = 0;
149 
150  TRACE("Enter NtUserBuildPropList\n");
151  UserEnterShared();
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 */
169  li = (PROPLISTITEM *)Buffer;
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 
211 Exit:
212  TRACE("Leave NtUserBuildPropList, ret=%lx\n", Status);
213  UserLeave();
214 
215  return Status;
216 }
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:241
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
HWND hWnd
Definition: settings.c:17
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
#define PROPERTY_FLAG_SYSTEM
Definition: ntuser.h:1049
Definition: window.c:29
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static void Exit(void)
Definition: sock.c:1331
#define BufferSize
Definition: classpnp.h:419
unsigned long DWORD
Definition: ntddk_ex.h:95
int Window
Definition: x11stubs.h:26
Definition: typedefs.h:117
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
Definition: ntuser.h:657
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
HANDLE Data
Definition: ntuser.h:1046
return STATUS_SUCCESS
Definition: btrfs.c:2777
struct _PROPLISTITEM PROPLISTITEM

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 
238 Exit:
239  TRACE("Leave NtUserRemoveProp, ret=%p\n", Data);
240  UserLeave();
241 
242  return Data;
243 }
HWND hWnd
Definition: settings.c:17
_Out_ RTL_ATOM * Atom
Definition: class.h:54
Definition: window.c:29
smooth NULL
Definition: ftsmooth.c:416
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
static void Exit(void)
Definition: sock.c:1331
int Window
Definition: x11stubs.h:26
Definition: ntuser.h:657
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
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 
267 Exit:
268  TRACE("Leave NtUserSetProp, ret=%i\n", Ret);
269  UserLeave();
270 
271  return Ret;
272 }
HWND hWnd
Definition: settings.c:17
_Out_ RTL_ATOM * Atom
Definition: class.h:54
Definition: window.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
static void Exit(void)
Definition: sock.c:1331
int Window
Definition: x11stubs.h:26
Definition: ntuser.h:657
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255

Referenced by SetPropW().

◆ UserGetProp()

HANDLE FASTCALL UserGetProp ( _In_ PWND  Window,
_In_ ATOM  Atom,
_In_ BOOLEAN  SystemProp 
)

Definition at line 46 of file prop.c.

50 {
51  PPROPERTY Prop;
52 
54  Prop = IntGetProp(Window, Atom, SystemProp);
55  return Prop ? Prop->Data : NULL;
56 }
BOOL FASTCALL UserIsEntered(VOID)
Definition: ntuser.c:225
_In_ ATOM _In_ HANDLE _In_ BOOLEAN SystemProp
Definition: prop.h:22
_Out_ RTL_ATOM * Atom
Definition: class.h:54
Definition: window.c:29
HANDLE Data
Definition: ntuser.h:1054
smooth NULL
Definition: ftsmooth.c:416
PPROPERTY FASTCALL IntGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:16
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by DefWndGetIcon(), DefWndSetIcon(), GetLayeredStatus(), IntDdeGetMessageHook(), IntEngWindowChanged(), IntFlashWindowEx(), IntGetWindowContextHelpId(), IntGhostWindowFromHungWindow(), IntSetLayeredWindowAttributes(), NC_IconForWindow(), NtUserCallHwnd(), NtUserGetLayeredWindowAttributes(), SetLayeredStatus(), and UserGethWnd().

◆ 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 }
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:42
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
Definition: window.c:29
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: typedefs.h:117
_In_ DWORD Property
Definition: setupapi.h:1545
BOOL FASTCALL UserIsEnteredExclusive(VOID)
Definition: ntuser.c:231
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by co_UserFreeWindow().