Author: tkreuzer
Date: Thu Apr 26 02:09:23 2007
New Revision: 26507
URL:
http://svn.reactos.org/svn/reactos?rev=26507&view=rev
Log:
- Fix calculation of handle
- Add Type column
Modified:
trunk/rosapps/devutils/gdihv/gdi.h
trunk/rosapps/devutils/gdihv/gdihv.c
trunk/rosapps/devutils/gdihv/handlelist.c
trunk/rosapps/devutils/gdihv/handlelist.h
trunk/rosapps/devutils/gdihv/mainwnd.c
trunk/rosapps/devutils/gdihv/proclist.c
Modified: trunk/rosapps/devutils/gdihv/gdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/gdihv/gdi.h?rev=2…
==============================================================================
--- trunk/rosapps/devutils/gdihv/gdi.h (original)
+++ trunk/rosapps/devutils/gdihv/gdi.h Thu Apr 26 02:09:23 2007
@@ -18,11 +18,11 @@
#define GDI_HANDLE_STOCK_MASK 0x00800000
#define GDI_HANDLE_REUSE_MASK 0xff000000
#define GDI_HANDLE_REUSECNT_SHIFT 24
-#define GDI_HANDLE_UPPER_MASK 0xffff0000
+#define GDI_HANDLE_UPPER_MASK 0x0000ffff
/* Handle macros */
#define GDI_HANDLE_CREATE(i, t) \
- ((HANDLE)(((i) & GDI_HANDLE_INDEX_MASK) | ((t) & GDI_HANDLE_UPPER_MASK)))
+ ((HANDLE)(((i) & GDI_HANDLE_INDEX_MASK) | ((t) << 16)))
#define GDI_HANDLE_GET_INDEX(h) \
(((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK)
Modified: trunk/rosapps/devutils/gdihv/gdihv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/gdihv/gdihv.c?rev…
==============================================================================
--- trunk/rosapps/devutils/gdihv/gdihv.c (original)
+++ trunk/rosapps/devutils/gdihv/gdihv.c Thu Apr 26 02:09:23 2007
@@ -3,7 +3,7 @@
*
* gdihv.c
*
- * Copyright (C) 2007 Timo kreuzer <timo <dot> kreuzer <at> web.de>
+ * Copyright (C) 2007 Timo Kreuzer <timo <dot> kreuzer <at> web.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Modified: trunk/rosapps/devutils/gdihv/handlelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/gdihv/handlelist.…
==============================================================================
--- trunk/rosapps/devutils/gdihv/handlelist.c (original)
+++ trunk/rosapps/devutils/gdihv/handlelist.c Thu Apr 26 02:09:23 2007
@@ -3,7 +3,7 @@
*
* handlelist.c
*
- * Copyright (C) 2007 Timo kreuzer <timo <dot> kreuzer <at> web.de>
+ * Copyright (C) 2007 Timo Kreuzer <timo <dot> kreuzer <at> web.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -58,6 +58,10 @@
column.cx = 80;
(void)ListView_InsertColumn(hListCtrl, 6, &column);
+ column.pszText = L"Type";
+ column.cx = 80;
+ (void)ListView_InsertColumn(hListCtrl, 7, &column);
+
HandleList_Update(hListCtrl, 0);
}
@@ -65,6 +69,7 @@
HandleList_Update(HWND hHandleListCtrl, HANDLE ProcessId)
{
INT i, index;
+ HANDLE handle;
PGDI_TABLE_ENTRY pEntry;
LV_ITEM item;
TCHAR strText[80];
@@ -91,10 +96,11 @@
wsprintf(strText, L"%d", i);
ListView_SetItemText(hHandleListCtrl, index, 1, strText);
- wsprintf(strText, L"%#08x", GDI_HANDLE_CREATE(i, pEntry->Type));
+ handle = GDI_HANDLE_CREATE(i, pEntry->Type);
+ wsprintf(strText, L"%#08x", handle);
ListView_SetItemText(hHandleListCtrl, index, 2, strText);
- str2 = GetTypeName(pEntry->Type & GDI_HANDLE_TYPE_MASK);
+ str2 = GetTypeName(handle);
ListView_SetItemText(hHandleListCtrl, index, 3, str2);
wsprintf(strText, L"%#08x", (UINT)pEntry->ProcessId);
@@ -105,15 +111,19 @@
wsprintf(strText, L"%#08x", (UINT)pEntry->UserData);
ListView_SetItemText(hHandleListCtrl, index, 6, strText);
+
+ wsprintf(strText, L"%#08x", (UINT)pEntry->Type);
+ ListView_SetItemText(hHandleListCtrl, index, 7, strText);
}
}
}
}
TCHAR*
-GetTypeName(UINT Type)
+GetTypeName(HANDLE handle)
{
TCHAR* strText;
+ UINT Type = GDI_HANDLE_GET_TYPE(handle);
switch (Type)
{
Modified: trunk/rosapps/devutils/gdihv/handlelist.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/gdihv/handlelist.…
==============================================================================
--- trunk/rosapps/devutils/gdihv/handlelist.h (original)
+++ trunk/rosapps/devutils/gdihv/handlelist.h Thu Apr 26 02:09:23 2007
@@ -1,4 +1,4 @@
VOID HandleList_Create(HWND hListCtrl);
VOID HandleList_Update(HWND hHandleListCtrl, HANDLE ProcessID);
-TCHAR* GetTypeName(UINT Type);
+TCHAR* GetTypeName(HANDLE handle);
Modified: trunk/rosapps/devutils/gdihv/mainwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/gdihv/mainwnd.c?r…
==============================================================================
--- trunk/rosapps/devutils/gdihv/mainwnd.c (original)
+++ trunk/rosapps/devutils/gdihv/mainwnd.c Thu Apr 26 02:09:23 2007
@@ -3,7 +3,7 @@
*
* mainwnd.c
*
- * Copyright (C) 2007 Timo kreuzer <timo <dot> kreuzer <at> web.de>
+ * Copyright (C) 2007 Timo Kreuzer <timo <dot> kreuzer <at> web.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Modified: trunk/rosapps/devutils/gdihv/proclist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/gdihv/proclist.c?…
==============================================================================
--- trunk/rosapps/devutils/gdihv/proclist.c (original)
+++ trunk/rosapps/devutils/gdihv/proclist.c Thu Apr 26 02:09:23 2007
@@ -3,7 +3,7 @@
*
* proclist.c
*
- * Copyright (C) 2007 Timo kreuzer <timo <dot> kreuzer <at> web.de>
+ * Copyright (C) 2007 Timo Kreuzer <timo <dot> kreuzer <at> web.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by