Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4c088cbe
Commit
4c088cbe
authored
Feb 24, 2010
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Dump GDI objects in the case of running out of GDI handles.
parent
10b1e2ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
gdiobj.c
dlls/gdi32/gdiobj.c
+47
-0
No files found.
dlls/gdi32/gdiobj.c
View file @
4c088cbe
...
@@ -635,6 +635,50 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
...
@@ -635,6 +635,50 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
static
GDIOBJHDR
*
large_handles
[
MAX_LARGE_HANDLES
];
static
GDIOBJHDR
*
large_handles
[
MAX_LARGE_HANDLES
];
static
int
next_large_handle
;
static
int
next_large_handle
;
static
const
char
*
gdi_obj_type
(
unsigned
type
)
{
switch
(
type
)
{
case
OBJ_PEN
:
return
"OBJ_PEN"
;
case
OBJ_BRUSH
:
return
"OBJ_BRUSH"
;
case
OBJ_DC
:
return
"OBJ_DC"
;
case
OBJ_METADC
:
return
"OBJ_METADC"
;
case
OBJ_PAL
:
return
"OBJ_PAL"
;
case
OBJ_FONT
:
return
"OBJ_FONT"
;
case
OBJ_BITMAP
:
return
"OBJ_BITMAP"
;
case
OBJ_REGION
:
return
"OBJ_REGION"
;
case
OBJ_METAFILE
:
return
"OBJ_METAFILE"
;
case
OBJ_MEMDC
:
return
"OBJ_MEMDC"
;
case
OBJ_EXTPEN
:
return
"OBJ_EXTPEN"
;
case
OBJ_ENHMETADC
:
return
"OBJ_ENHMETADC"
;
case
OBJ_ENHMETAFILE
:
return
"OBJ_ENHMETAFILE"
;
case
OBJ_COLORSPACE
:
return
"OBJ_COLORSPACE"
;
default:
return
"UNKNOWN"
;
}
}
static
void
dump_gdi_objects
(
void
)
{
int
i
;
TRACE
(
"%u objects:
\n
"
,
MAX_LARGE_HANDLES
);
EnterCriticalSection
(
&
gdi_section
);
for
(
i
=
0
;
i
<
MAX_LARGE_HANDLES
;
i
++
)
{
if
(
!
large_handles
[
i
])
{
TRACE
(
"index %d handle %p FREE
\n
"
,
i
,
(
HGDIOBJ
)(
ULONG_PTR
)((
i
+
FIRST_LARGE_HANDLE
)
<<
2
)
);
continue
;
}
TRACE
(
"handle %p obj %p type %s selcount %u deleted %u
\n
"
,
(
HGDIOBJ
)(
ULONG_PTR
)((
i
+
FIRST_LARGE_HANDLE
)
<<
2
),
large_handles
[
i
],
gdi_obj_type
(
large_handles
[
i
]
->
type
),
large_handles
[
i
]
->
selcount
,
large_handles
[
i
]
->
deleted
);
}
LeaveCriticalSection
(
&
gdi_section
);
}
/***********************************************************************
/***********************************************************************
* alloc_gdi_handle
* alloc_gdi_handle
*
*
...
@@ -658,6 +702,9 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
...
@@ -658,6 +702,9 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
for
(
i
=
0
;
i
<=
next_large_handle
;
i
++
)
for
(
i
=
0
;
i
<=
next_large_handle
;
i
++
)
if
(
!
large_handles
[
i
])
goto
found
;
if
(
!
large_handles
[
i
])
goto
found
;
LeaveCriticalSection
(
&
gdi_section
);
LeaveCriticalSection
(
&
gdi_section
);
ERR
(
"out of GDI object handles, expect a crash
\n
"
);
if
(
TRACE_ON
(
gdi
))
dump_gdi_objects
();
return
0
;
return
0
;
found:
found:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment