ReactOS 0.4.15-dev-8093-g3285f69
handlelist.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

VOID HandleList_Create (HWND hListCtrl)
 
VOID HandleList_Update (HWND hHandleListCtrl, HANDLE ProcessID)
 
TCHARGetTypeName (HANDLE handle)
 

Function Documentation

◆ GetTypeName()

TCHAR * GetTypeName ( HANDLE  handle)

Definition at line 127 of file handlelist.c.

128{
129 TCHAR* strText;
131
132 switch (Type)
133 {
135 strText = L"DC";
136 break;
138 strText = L"Region";
139 break;
141 strText = L"Bitmap";
142 break;
144 strText = L"Palette";
145 break;
147 strText = L"Font";
148 break;
150 strText = L"Brush";
151 break;
153 strText = L"EMF";
154 break;
156 strText = L"Pen";
157 break;
159 strText = L"ExtPen";
160 break;
162 strText = L"ColSpace";
163 break;
165 strText = L"MetaDC";
166 break;
168 strText = L"Metafile";
169 break;
171 strText = L"EMF";
172 break;
174 strText = L"EMDC";
175 break;
177 strText = L"MemDC";
178 break;
180 strText = L"DCE";
181 break;
183 strText = L"PFE";
184 break;
186 strText = L"anything";
187 break;
189 default:
190 strText = L"unknown";
191 break;
192 }
193 return strText;
194}
Type
Definition: Type.h:7
#define GDI_OBJECT_TYPE_REGION
Definition: gdi.h:47
#define GDI_OBJECT_TYPE_DCE
Definition: gdi.h:63
#define GDI_OBJECT_TYPE_DONTCARE
Definition: gdi.h:64
#define GDI_OBJECT_TYPE_ENHMETADC
Definition: gdi.h:61
#define GDI_OBJECT_TYPE_DC
Definition: gdi.h:46
#define GDI_OBJECT_TYPE_BRUSH
Definition: gdi.h:52
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define GDI_OBJECT_TYPE_ENHMETAFILE
Definition: gdi.h:59
#define GDI_OBJECT_TYPE_COLORSPACE
Definition: gdi.h:56
#define GDI_OBJECT_TYPE_SILENT
Definition: gdi.h:66
#define GDI_OBJECT_TYPE_BITMAP
Definition: gdi.h:48
#define GDI_OBJECT_TYPE_PALETTE
Definition: gdi.h:49
#define GDI_OBJECT_TYPE_EXTPEN
Definition: gdi.h:55
#define GDI_OBJECT_TYPE_FONT
Definition: gdi.h:50
#define GDI_OBJECT_TYPE_EMF
Definition: gdi.h:53
#define GDI_OBJECT_TYPE_METADC
Definition: gdi.h:57
#define GDI_OBJECT_TYPE_MEMDC
Definition: gdi.h:62
#define GDI_OBJECT_TYPE_PEN
Definition: gdi.h:54
#define GDI_OBJECT_TYPE_PFE
Definition: gdi.h:51
#define GDI_OBJECT_TYPE_METAFILE
Definition: gdi.h:58
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
char TCHAR
Definition: xmlstorage.h:189

Referenced by DECLARE_INTERFACE_(), and HandleList_Update().

◆ HandleList_Create()

VOID HandleList_Create ( HWND  hListCtrl)

Definition at line 26 of file handlelist.c.

27{
29
31 column.fmt = LVCFMT_LEFT;
32
33 column.pszText = L"Number";
34 column.cx = 50;
35 (void)ListView_InsertColumn(hListCtrl, 0, &column);
36
37 column.pszText = L"Index";
38 column.cx = 45;
39 (void)ListView_InsertColumn(hListCtrl, 1, &column);
40
41 column.pszText = L"Handle";
42 column.cx = 90;
43 (void)ListView_InsertColumn(hListCtrl, 2, &column);
44
45 column.pszText = L"Type";
46 column.cx = 80;
47 (void)ListView_InsertColumn(hListCtrl, 3, &column);
48
49 column.pszText = L"Process";
50 column.cx = 80;
51 (void)ListView_InsertColumn(hListCtrl, 4, &column);
52
53 column.pszText = L"KernelData";
54 column.cx = 80;
55 (void)ListView_InsertColumn(hListCtrl, 5, &column);
56
57 column.pszText = L"UserData";
58 column.cx = 80;
59 (void)ListView_InsertColumn(hListCtrl, 6, &column);
60
61 column.pszText = L"Type";
62 column.cx = 80;
63 (void)ListView_InsertColumn(hListCtrl, 7, &column);
64
65 HandleList_Update(hListCtrl, 0);
66}
VOID HandleList_Update(HWND hHandleListCtrl, HANDLE ProcessId)
Definition: handlelist.c:69
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVCOLUMN
Definition: commctrl.h:2581

Referenced by MainWindow_WndProc().

◆ HandleList_Update()

VOID HandleList_Update ( HWND  hHandleListCtrl,
HANDLE  ProcessID 
)

Definition at line 69 of file handlelist.c.

70{
71 INT i, index;
75 TCHAR strText[80];
76 TCHAR* str2;
77
78 (void)ListView_DeleteAllItems(hHandleListCtrl);
80 item.pszText = strText;
81 item.cchTextMax = 80;
82 for (i = 0; i<= GDI_HANDLE_COUNT; i++)
83 {
85 if ( ((ProcessId != (HANDLE)1) && ((pEntry->Type & GDI_HANDLE_BASETYPE_MASK) != 0)) ||
86 ((ProcessId == (HANDLE)1) && ((pEntry->Type & GDI_HANDLE_BASETYPE_MASK) == 0)) ||
87 (ProcessId == (HANDLE)2) )
88 {
89 if (ProcessId == (HANDLE)1 || ProcessId == (HANDLE)2 ||
90 ((LONG_PTR)ProcessId & 0xfffc) == ((LONG_PTR)pEntry->ProcessId & 0xfffc))
91 {
93 index = ListView_GetItemCount(hHandleListCtrl);
94 item.iItem = index;
95 item.iSubItem = 0;
96 item.lParam = (LPARAM)handle;
97
98 wsprintf(strText, L"%d", index);
99 (void)ListView_InsertItem(hHandleListCtrl, &item);
100
101 wsprintf(strText, L"%d", i);
102 ListView_SetItemText(hHandleListCtrl, index, 1, strText);
103
104 wsprintf(strText, L"%#08Ix", handle);
105 ListView_SetItemText(hHandleListCtrl, index, 2, strText);
106
107 str2 = GetTypeName(handle);
108 ListView_SetItemText(hHandleListCtrl, index, 3, str2);
109
110 wsprintf(strText, L"%#08Ix", (UINT_PTR)pEntry->ProcessId);
111 ListView_SetItemText(hHandleListCtrl, index, 4, strText);
112
113 wsprintf(strText, L"%#08Ix", (UINT_PTR)pEntry->KernelData);
114 ListView_SetItemText(hHandleListCtrl, index, 5, strText);
115
116 wsprintf(strText, L"%#08Ix", (UINT_PTR)pEntry->UserData);
117 ListView_SetItemText(hHandleListCtrl, index, 6, strText);
118
119 wsprintf(strText, L"%#08x", (UINT)pEntry->Type);
120 ListView_SetItemText(hHandleListCtrl, index, 7, strText);
121 }
122 }
123 }
124}
#define index(s, c)
Definition: various.h:29
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
#define GDI_HANDLE_CREATE(i, t)
Definition: gdi.h:25
#define GDI_HANDLE_BASETYPE_MASK
Definition: gdi.h:18
#define GDI_HANDLE_COUNT
Definition: gdi.h:12
GLuint index
Definition: glext.h:6031
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
TCHAR * GetTypeName(HANDLE handle)
Definition: handlelist.c:127
static ATOM item
Definition: dde.c:856
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define LVITEM
Definition: commctrl.h:2375
#define LVIF_PARAM
Definition: commctrl.h:2311
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2414
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2691
#define LVIF_TEXT
Definition: commctrl.h:2309
Definition: gdi.h:2
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
#define GdiHandleTable
Definition: win32nt.h:37
LONG_PTR LPARAM
Definition: windef.h:208
#define wsprintf
Definition: winuser.h:5865

Referenced by HandleList_Create(), MainWindow_WndProc(), and MainWnd_OnNotify().