Author: jimtabor
Date: Tue Jul 8 22:29:43 2008
New Revision: 34378
URL:
http://svn.reactos.org/svn/reactos?rev=34378&view=rev
Log:
- Removed NtUserGetProp, updated all related.
- Tested with FF, OOo, Seamonkey, putty, etc, and standard loaded apps. We use GetProp
more than anyone thinks.
Modified:
trunk/reactos/dll/win32/user32/windows/prop.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/include/window.h
trunk/reactos/subsystems/win32/win32k/ntuser/prop.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/user32/windows/prop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/p…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/prop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/prop.c [iso-8859-1] Tue Jul 8 22:29:43 2008
@@ -32,13 +32,51 @@
#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(user32);
+
typedef struct _PROPLISTITEM
{
ATOM Atom;
HANDLE Data;
} PROPLISTITEM, *PPROPLISTITEM;
+typedef struct _PROPERTY
+{
+ LIST_ENTRY PropListEntry;
+ HANDLE Data;
+ ATOM Atom;
+} PROPERTY, *PPROPERTY;
+
#define ATOM_BUFFER_SIZE 256
+
+/* INTERNAL FUNCTIONS ********************************************************/
+
+HANDLE
+FASTCALL
+IntGetProp(HWND hWnd, ATOM Atom)
+{
+ PLIST_ENTRY ListEntry, temp;
+ PPROPERTY Property;
+ PWINDOW pWnd;
+ int i;
+
+ pWnd = ValidateHwnd(hWnd);
+ if (!pWnd) return NULL;
+
+ ListEntry = SharedPtrToUser(pWnd->PropListHead.Flink);
+ for (i = 0; i < pWnd->PropListItems; i++ )
+ {
+ Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
+ if (Property->Atom == Atom)
+ {
+ return(Property);
+ }
+ temp = ListEntry->Flink;
+ ListEntry = SharedPtrToUser(temp);
+ }
+ return NULL;
+}
+
/* FUNCTIONS *****************************************************************/
@@ -345,15 +383,19 @@
GetPropW(HWND hWnd, LPCWSTR lpString)
{
ATOM Atom;
- if (HIWORD(lpString))
- {
- Atom = GlobalFindAtomW(lpString);
- }
- else
- {
- Atom = LOWORD((DWORD)lpString);
- }
- return(NtUserGetProp(hWnd, Atom));
+ HANDLE Data = NULL;
+ PPROPERTY Prop;
+ if (HIWORD(lpString))
+ {
+ Atom = GlobalFindAtomW(lpString);
+ }
+ else
+ {
+ Atom = LOWORD((DWORD)lpString);
+ }
+ Prop = IntGetProp(hWnd, Atom);
+ if (Prop != NULL) Data = Prop->Data;
+ return Data;
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Jul 8 22:29:43 2008
@@ -155,6 +155,9 @@
DWORD ContextHelpId;
HWND hWndLastActive;
+ /* Property list head.*/
+ LIST_ENTRY PropListHead;
+ ULONG PropListItems;
struct
{
@@ -2702,10 +2705,6 @@
OUT LPMONITORINFO pMonitorInfo);
/* Should be done in usermode */
-HANDLE
-NTAPI
-NtUserGetProp(HWND hWnd, ATOM Atom); // Done in both User/Kernel
-
BOOL
NTAPI
NtUserGetScrollInfo(
Modified: trunk/reactos/subsystems/win32/win32k/include/window.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] Tue Jul 8
22:29:43 2008
@@ -53,9 +53,6 @@
HWND hOwner;
/* DC Entries (DCE) */
PDCE Dce;
- /* Property list head.*/
- LIST_ENTRY PropListHead;
- ULONG PropListItems;
/* Scrollbar info */
PWINDOW_SCROLLINFO Scroll;
PETHREAD OwnerThread;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/prop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/prop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/prop.c [iso-8859-1] Tue Jul 8 22:29:43
2008
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Window properties
@@ -52,8 +51,8 @@
PLIST_ENTRY ListEntry;
PPROPERTY Property;
- ListEntry = Window->PropListHead.Flink;
- while (ListEntry != &Window->PropListHead)
+ ListEntry = Window->Wnd->PropListHead.Flink;
+ while (ListEntry != &Window->Wnd->PropListHead)
{
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
if (Property->Atom == Atom)
@@ -96,8 +95,8 @@
/* copy list */
li = (PROPLISTITEM *)Buffer;
- ListEntry = Window->PropListHead.Flink;
- while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry !=
&Window->PropListHead))
+ ListEntry = Window->Wnd->PropListHead.Flink;
+ while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry !=
&Window->Wnd->PropListHead))
{
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
listitem.Atom = Property->Atom;
@@ -118,7 +117,7 @@
}
else
{
- Cnt = Window->PropListItems * sizeof(PROPLISTITEM);
+ Cnt = Window->Wnd->PropListItems * sizeof(PROPLISTITEM);
}
if(Count)
@@ -162,8 +161,8 @@
}
Data = Prop->Data;
RemoveEntryList(&Prop->PropListEntry);
- ExFreePool(Prop);
- Window->PropListItems--;
+ UserHeapFree(Prop);
+ Window->Wnd->PropListItems--;
RETURN(Data);
@@ -173,54 +172,25 @@
END_CLEANUP;
}
-HANDLE STDCALL
-NtUserGetProp(HWND hWnd, ATOM Atom)
-{
- PWINDOW_OBJECT Window;
- PPROPERTY Prop;
- HANDLE Data = NULL;
- DECLARE_RETURN(HANDLE);
-
- DPRINT("Enter NtUserGetProp\n");
- UserEnterShared();
-
- if (!(Window = UserGetWindowObject(hWnd)))
- {
- RETURN( FALSE);
- }
-
- Prop = IntGetProp(Window, Atom);
- if (Prop != NULL)
- {
- Data = Prop->Data;
- }
-
- RETURN(Data);
-
-CLEANUP:
- DPRINT("Leave NtUserGetProp, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
static
BOOL FASTCALL
-IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data)
+IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data)
{
PPROPERTY Prop;
- Prop = IntGetProp(Wnd, Atom);
+ Prop = IntGetProp(pWnd, Atom);
if (Prop == NULL)
{
- Prop = ExAllocatePoolWithTag(PagedPool, sizeof(PROPERTY), TAG_WNDPROP);
+ Prop = UserHeapAlloc(sizeof(PROPERTY));
if (Prop == NULL)
{
return FALSE;
}
Prop->Atom = Atom;
- InsertTailList(&Wnd->PropListHead, &Prop->PropListEntry);
- Wnd->PropListItems++;
+ InsertTailList(&pWnd->Wnd->PropListHead, &Prop->PropListEntry);
+ pWnd->Wnd->PropListItems++;
}
Prop->Data = Data;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Tue Jul 8 22:29:43
2008
@@ -1710,7 +1710,7 @@
Window->NextSibling = NULL;
Wnd->ExtraDataSize = Wnd->Class->WndExtra;
- InitializeListHead(&Window->PropListHead);
+ InitializeListHead(&Wnd->PropListHead);
InitializeListHead(&Window->WndObjListHead);
if (NULL != WindowName->Buffer && WindowName->Length > 0)
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Jul 8 22:29:43
2008
@@ -686,7 +686,6 @@
NtUserGetLastInputInfo 1
NtUserGetMinMaxInfo 3
NtUserGetMonitorInfo 2
-NtUserGetProp 2
NtUserGetScrollInfo 3
NtUserGetShellWindow 0
NtUserGetWindow 2