mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
- Removed NtUserGetProp, updated all related.
- Tested with FF, OOo, Seamonkey, putty, etc, and standard loaded apps. We use GetProp more than anyone thinks. svn path=/trunk/; revision=34378
This commit is contained in:
parent
be356d11cd
commit
dd4397b095
|
@ -32,14 +32,52 @@
|
|||
|
||||
#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,6 +383,8 @@ HANDLE STDCALL
|
|||
GetPropW(HWND hWnd, LPCWSTR lpString)
|
||||
{
|
||||
ATOM Atom;
|
||||
HANDLE Data = NULL;
|
||||
PPROPERTY Prop;
|
||||
if (HIWORD(lpString))
|
||||
{
|
||||
Atom = GlobalFindAtomW(lpString);
|
||||
|
@ -353,7 +393,9 @@ GetPropW(HWND hWnd, LPCWSTR lpString)
|
|||
{
|
||||
Atom = LOWORD((DWORD)lpString);
|
||||
}
|
||||
return(NtUserGetProp(hWnd, Atom));
|
||||
Prop = IntGetProp(hWnd, Atom);
|
||||
if (Prop != NULL) Data = Prop->Data;
|
||||
return Data;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -155,6 +155,9 @@ typedef struct _WINDOW
|
|||
DWORD ContextHelpId;
|
||||
|
||||
HWND hWndLastActive;
|
||||
/* Property list head.*/
|
||||
LIST_ENTRY PropListHead;
|
||||
ULONG PropListItems;
|
||||
|
||||
struct
|
||||
{
|
||||
|
@ -2702,10 +2705,6 @@ NtUserGetMonitorInfo(
|
|||
OUT LPMONITORINFO pMonitorInfo);
|
||||
|
||||
/* Should be done in usermode */
|
||||
HANDLE
|
||||
NTAPI
|
||||
NtUserGetProp(HWND hWnd, ATOM Atom); // Done in both User/Kernel
|
||||
|
||||
BOOL
|
||||
NTAPI
|
||||
NtUserGetScrollInfo(
|
||||
|
|
|
@ -53,9 +53,6 @@ typedef struct _WINDOW_OBJECT
|
|||
HWND hOwner;
|
||||
/* DC Entries (DCE) */
|
||||
PDCE Dce;
|
||||
/* Property list head.*/
|
||||
LIST_ENTRY PropListHead;
|
||||
ULONG PropListItems;
|
||||
/* Scrollbar info */
|
||||
PWINDOW_SCROLLINFO Scroll;
|
||||
PETHREAD OwnerThread;
|
||||
|
|
|
@ -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 @@ IntGetProp(PWINDOW_OBJECT Window, ATOM Atom)
|
|||
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 @@ NtUserBuildPropList(HWND hWnd,
|
|||
|
||||
/* 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 @@ NtUserBuildPropList(HWND hWnd,
|
|||
}
|
||||
else
|
||||
{
|
||||
Cnt = Window->PropListItems * sizeof(PROPLISTITEM);
|
||||
Cnt = Window->Wnd->PropListItems * sizeof(PROPLISTITEM);
|
||||
}
|
||||
|
||||
if(Count)
|
||||
|
@ -162,8 +161,8 @@ NtUserRemoveProp(HWND hWnd, ATOM Atom)
|
|||
}
|
||||
Data = Prop->Data;
|
||||
RemoveEntryList(&Prop->PropListEntry);
|
||||
ExFreePool(Prop);
|
||||
Window->PropListItems--;
|
||||
UserHeapFree(Prop);
|
||||
Window->Wnd->PropListItems--;
|
||||
|
||||
RETURN(Data);
|
||||
|
||||
|
@ -173,54 +172,25 @@ CLEANUP:
|
|||
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;
|
||||
|
|
|
@ -1710,7 +1710,7 @@ AllocErr:
|
|||
Window->NextSibling = NULL;
|
||||
Wnd->ExtraDataSize = Wnd->Class->WndExtra;
|
||||
|
||||
InitializeListHead(&Window->PropListHead);
|
||||
InitializeListHead(&Wnd->PropListHead);
|
||||
InitializeListHead(&Window->WndObjListHead);
|
||||
|
||||
if (NULL != WindowName->Buffer && WindowName->Length > 0)
|
||||
|
|
|
@ -686,7 +686,6 @@ NtUserGetMenuDefaultItem 3
|
|||
NtUserGetLastInputInfo 1
|
||||
NtUserGetMinMaxInfo 3
|
||||
NtUserGetMonitorInfo 2
|
||||
NtUserGetProp 2
|
||||
NtUserGetScrollInfo 3
|
||||
NtUserGetShellWindow 0
|
||||
NtUserGetWindow 2
|
||||
|
|
Loading…
Reference in a new issue