mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
1. implemented GetGuiResources()
2. modified test app guithreadinfo to display additional information about the current process using GetGuiResources() svn path=/trunk/; revision=6705
This commit is contained in:
parent
bc1f65ef73
commit
a55677b029
10 changed files with 127 additions and 41 deletions
|
@ -92,20 +92,27 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
if(gti.flags & GUI_SYSTEMMENUMODE) lstrcat(str, "GUI_SYSTEMMENUMODE ");
|
if(gti.flags & GUI_SYSTEMMENUMODE) lstrcat(str, "GUI_SYSTEMMENUMODE ");
|
||||||
TextOut(hDC, 10, 10, str, strlen(str));
|
TextOut(hDC, 10, 10, str, strlen(str));
|
||||||
|
|
||||||
wsprintf(str, "hwndActive == %04x", gti.hwndActive);
|
wsprintf(str, "hwndActive == %08X", gti.hwndActive);
|
||||||
TextOut(hDC, 10, 30, str, strlen(str));
|
TextOut(hDC, 10, 30, str, strlen(str));
|
||||||
wsprintf(str, "hwndFocus == %04x", gti.hwndFocus);
|
wsprintf(str, "hwndFocus == %08X", gti.hwndFocus);
|
||||||
TextOut(hDC, 10, 50, str, strlen(str));
|
TextOut(hDC, 10, 50, str, strlen(str));
|
||||||
wsprintf(str, "hwndCapture == %04x", gti.hwndCapture);
|
wsprintf(str, "hwndCapture == %08X", gti.hwndCapture);
|
||||||
TextOut(hDC, 10, 70, str, strlen(str));
|
TextOut(hDC, 10, 70, str, strlen(str));
|
||||||
wsprintf(str, "hwndMenuOwner == %04x", gti.hwndMenuOwner);
|
wsprintf(str, "hwndMenuOwner == %08X", gti.hwndMenuOwner);
|
||||||
TextOut(hDC, 10, 90, str, strlen(str));
|
TextOut(hDC, 10, 90, str, strlen(str));
|
||||||
wsprintf(str, "hwndMoveSize == %04x", gti.hwndMoveSize);
|
wsprintf(str, "hwndMoveSize == %08X", gti.hwndMoveSize);
|
||||||
TextOut(hDC, 10, 110, str, strlen(str));
|
TextOut(hDC, 10, 110, str, strlen(str));
|
||||||
wsprintf(str, "hwndCaret == %04x", gti.hwndCaret);
|
wsprintf(str, "hwndCaret == %08X", gti.hwndCaret);
|
||||||
TextOut(hDC, 10, 130, str, strlen(str));
|
TextOut(hDC, 10, 130, str, strlen(str));
|
||||||
wsprintf(str, "rcCaret == (%lu, %lu, %lu, %lu)", gti.rcCaret.left, gti.rcCaret.top, gti.rcCaret.right, gti.rcCaret.bottom);
|
wsprintf(str, "rcCaret == (%lu, %lu, %lu, %lu)", gti.rcCaret.left, gti.rcCaret.top, gti.rcCaret.right, gti.rcCaret.bottom);
|
||||||
TextOut(hDC, 10, 150, str, strlen(str));
|
TextOut(hDC, 10, 150, str, strlen(str));
|
||||||
|
|
||||||
|
wsprintf(str, "GetGuiResources for the current process: %08X", GetCurrentProcess());
|
||||||
|
TextOut(hDC, 10, 180, str, strlen(str));
|
||||||
|
wsprintf(str, "GetGuiResources: GR_GDIOBJECTS == %04X", GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS));
|
||||||
|
TextOut(hDC, 10, 200, str, strlen(str));
|
||||||
|
wsprintf(str, "GetGuiResources: GR_USEROBJECTS == %04x", GetGuiResources(GetCurrentProcess(), GR_USEROBJECTS));
|
||||||
|
TextOut(hDC, 10, 220, str, strlen(str));
|
||||||
EndPaint(hWnd, &ps);
|
EndPaint(hWnd, &ps);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1569,6 +1569,10 @@ extern "C" {
|
||||||
#define GM_COMPATIBLE (1)
|
#define GM_COMPATIBLE (1)
|
||||||
#define GM_ADVANCED (2)
|
#define GM_ADVANCED (2)
|
||||||
|
|
||||||
|
/* GetGuiResources */
|
||||||
|
#define GR_GDIOBJECTS (0)
|
||||||
|
#define GR_USEROBJECTS (1)
|
||||||
|
|
||||||
/* GetGUIThreadInfo */
|
/* GetGUIThreadInfo */
|
||||||
#define GUI_CARETBLINKING (1)
|
#define GUI_CARETBLINKING (1)
|
||||||
#define GUI_INMOVESIZE (2)
|
#define GUI_INMOVESIZE (2)
|
||||||
|
|
|
@ -9327,6 +9327,13 @@ GetWindowThreadProcessId(
|
||||||
LPDWORD lpdwProcessId);
|
LPDWORD lpdwProcessId);
|
||||||
|
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
STDCALL
|
||||||
|
GetGuiResources(
|
||||||
|
HANDLE hProcess,
|
||||||
|
DWORD uiFlags);
|
||||||
|
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
GetGUIThreadInfo(
|
GetGUIThreadInfo(
|
||||||
|
|
|
@ -18,6 +18,8 @@ typedef struct _W32PROCESS
|
||||||
LIST_ENTRY MenuListHead;
|
LIST_ENTRY MenuListHead;
|
||||||
struct _KBDTABLES* KeyboardLayout;
|
struct _KBDTABLES* KeyboardLayout;
|
||||||
struct _WINSTATION_OBJECT* WindowStation;
|
struct _WINSTATION_OBJECT* WindowStation;
|
||||||
|
WORD GDIObjects;
|
||||||
|
WORD UserObjects;
|
||||||
} W32PROCESS, *PW32PROCESS;
|
} W32PROCESS, *PW32PROCESS;
|
||||||
|
|
||||||
PW32THREAD STDCALL
|
PW32THREAD STDCALL
|
||||||
|
|
|
@ -694,8 +694,8 @@ NtUserGetForegroundWindow(VOID);
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserGetGuiResources(
|
NtUserGetGuiResources(
|
||||||
DWORD Unknown0,
|
HANDLE hProcess,
|
||||||
DWORD Unknown1);
|
DWORD uiFlags);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.29 2003/11/07 19:13:01 sedwards Exp $
|
# $Id: Makefile,v 1.30 2003/11/19 12:25:03 weiden Exp $
|
||||||
|
|
||||||
PATH_TO_TOP = ../..
|
PATH_TO_TOP = ../..
|
||||||
|
|
||||||
|
@ -50,7 +50,8 @@ MISC_OBJECTS = \
|
||||||
misc/resources.o \
|
misc/resources.o \
|
||||||
misc/object.o \
|
misc/object.o \
|
||||||
misc/timer.o \
|
misc/timer.o \
|
||||||
misc/strpool.o
|
misc/strpool.o \
|
||||||
|
misc/misc.o
|
||||||
|
|
||||||
WINDOWS_OBJECTS = \
|
WINDOWS_OBJECTS = \
|
||||||
windows/caret.o \
|
windows/caret.o \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.50 2003/11/09 18:38:09 navaraf Exp $
|
/* $Id: stubs.c,v 1.51 2003/11/19 12:25:03 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING WINBOOLthe top level directory
|
* COPYRIGHT: See COPYING WINBOOLthe top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -127,20 +127,6 @@ CopyImage(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
DWORD
|
|
||||||
STDCALL
|
|
||||||
GetGuiResources(
|
|
||||||
HANDLE hProcess,
|
|
||||||
DWORD uiFlags)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: misc.c,v 1.24 2003/11/18 23:33:31 weiden Exp $
|
/* $Id: misc.c,v 1.25 2003/11/19 12:25:03 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -513,3 +513,59 @@ NtUserGetGUIThreadInfo(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
STDCALL
|
||||||
|
NtUserGetGuiResources(
|
||||||
|
HANDLE hProcess,
|
||||||
|
DWORD uiFlags)
|
||||||
|
{
|
||||||
|
PEPROCESS Process;
|
||||||
|
PW32PROCESS W32Process;
|
||||||
|
NTSTATUS Status;
|
||||||
|
DWORD Ret = 0;
|
||||||
|
|
||||||
|
Status = ObReferenceObjectByHandle(hProcess,
|
||||||
|
PROCESS_QUERY_INFORMATION,
|
||||||
|
PsProcessType,
|
||||||
|
ExGetPreviousMode(),
|
||||||
|
(PVOID*)&Process,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
W32Process = Process->Win32Process;
|
||||||
|
if(!W32Process)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(uiFlags)
|
||||||
|
{
|
||||||
|
case GR_GDIOBJECTS:
|
||||||
|
{
|
||||||
|
Ret = (DWORD)W32Process->GDIObjects;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GR_USEROBJECTS:
|
||||||
|
{
|
||||||
|
Ret = (DWORD)W32Process->UserObjects;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ObDereferenceObject(Process);
|
||||||
|
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.36 2003/11/18 23:33:31 weiden Exp $
|
/* $Id: stubs.c,v 1.37 2003/11/19 12:25:03 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -525,17 +525,6 @@ NtUserGetCPD(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
|
||||||
STDCALL
|
|
||||||
NtUserGetGuiResources(
|
|
||||||
DWORD Unknown0,
|
|
||||||
DWORD Unknown1)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserGetImeHotKey(
|
NtUserGetImeHotKey(
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
/*
|
/*
|
||||||
* GDIOBJ.C - GDI object manipulation routines
|
* GDIOBJ.C - GDI object manipulation routines
|
||||||
*
|
*
|
||||||
* $Id: gdiobj.c,v 1.49 2003/11/08 14:58:34 gvg Exp $
|
* $Id: gdiobj.c,v 1.50 2003/11/19 12:25:03 weiden Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -237,6 +237,7 @@ GDIOBJ_iGetNextOpenHandleIndex (void)
|
||||||
HGDIOBJ FASTCALL
|
HGDIOBJ FASTCALL
|
||||||
GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
||||||
{
|
{
|
||||||
|
PW32PROCESS W32Process;
|
||||||
PGDIOBJHDR newObject;
|
PGDIOBJHDR newObject;
|
||||||
WORD Index;
|
WORD Index;
|
||||||
|
|
||||||
|
@ -266,6 +267,12 @@ GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
||||||
newObject->lockline = 0;
|
newObject->lockline = 0;
|
||||||
HandleTable->Handles[Index] = newObject;
|
HandleTable->Handles[Index] = newObject;
|
||||||
|
|
||||||
|
W32Process = PsGetCurrentProcess()->Win32Process;
|
||||||
|
if(W32Process)
|
||||||
|
{
|
||||||
|
W32Process->GDIObjects++;
|
||||||
|
}
|
||||||
|
|
||||||
return GDI_HANDLE_CREATE(Index, ObjectType);
|
return GDI_HANDLE_CREATE(Index, ObjectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +294,7 @@ GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
GDIOBJ_FreeObj(HGDIOBJ hObj, DWORD ObjectType, DWORD Flag)
|
GDIOBJ_FreeObj(HGDIOBJ hObj, DWORD ObjectType, DWORD Flag)
|
||||||
{
|
{
|
||||||
|
PW32PROCESS W32Process;
|
||||||
PGDIOBJHDR objectHeader;
|
PGDIOBJHDR objectHeader;
|
||||||
PGDIOBJ Obj;
|
PGDIOBJ Obj;
|
||||||
BOOL bRet = TRUE;
|
BOOL bRet = TRUE;
|
||||||
|
@ -328,6 +336,12 @@ GDIOBJ_FreeObj(HGDIOBJ hObj, DWORD ObjectType, DWORD Flag)
|
||||||
ExFreePool(objectHeader);
|
ExFreePool(objectHeader);
|
||||||
HandleTable->Handles[GDI_HANDLE_GET_INDEX(hObj)] = NULL;
|
HandleTable->Handles[GDI_HANDLE_GET_INDEX(hObj)] = NULL;
|
||||||
|
|
||||||
|
W32Process = PsGetCurrentProcess()->Win32Process;
|
||||||
|
if(W32Process)
|
||||||
|
{
|
||||||
|
W32Process->GDIObjects--;
|
||||||
|
}
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +434,9 @@ GDIOBJ_UnlockMultipleObj(PGDIMULTILOCK pList, INT nObj)
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
GDIOBJ_MarkObjectGlobal(HGDIOBJ ObjectHandle)
|
GDIOBJ_MarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||||
{
|
{
|
||||||
|
PEPROCESS Process;
|
||||||
|
PW32PROCESS W32Process;
|
||||||
|
NTSTATUS Status;
|
||||||
PGDIOBJHDR ObjHdr;
|
PGDIOBJHDR ObjHdr;
|
||||||
|
|
||||||
DPRINT("GDIOBJ_MarkObjectGlobal handle 0x%08x\n", ObjectHandle);
|
DPRINT("GDIOBJ_MarkObjectGlobal handle 0x%08x\n", ObjectHandle);
|
||||||
|
@ -429,6 +446,16 @@ GDIOBJ_MarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = PsLookupProcessByProcessId((PVOID)ObjHdr->hProcessId, &Process);
|
||||||
|
if(NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
W32Process = Process->Win32Process;
|
||||||
|
if(W32Process)
|
||||||
|
{
|
||||||
|
W32Process->GDIObjects--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ObjHdr->hProcessId = GDI_GLOBAL_PROCESS;
|
ObjHdr->hProcessId = GDI_GLOBAL_PROCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,6 +469,7 @@ GDIOBJ_MarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
GDIOBJ_UnmarkObjectGlobal(HGDIOBJ ObjectHandle)
|
GDIOBJ_UnmarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||||
{
|
{
|
||||||
|
PW32PROCESS W32Process;
|
||||||
PGDIOBJHDR ObjHdr;
|
PGDIOBJHDR ObjHdr;
|
||||||
|
|
||||||
DPRINT("GDIOBJ_MarkObjectGlobal handle 0x%08x\n", ObjectHandle);
|
DPRINT("GDIOBJ_MarkObjectGlobal handle 0x%08x\n", ObjectHandle);
|
||||||
|
@ -451,6 +479,12 @@ GDIOBJ_UnmarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
W32Process = PsGetCurrentProcess()->Win32Process;
|
||||||
|
if(W32Process)
|
||||||
|
{
|
||||||
|
W32Process->GDIObjects++;
|
||||||
|
}
|
||||||
|
|
||||||
ObjHdr->hProcessId = PsGetCurrentProcessId();
|
ObjHdr->hProcessId = PsGetCurrentProcessId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue