Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e9a4c235
Commit
e9a4c235
authored
Aug 22, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix a few more places that use the wrong get/release function for DCs.
parent
4fb26709
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
23 deletions
+15
-23
dc.c
dlls/gdi32/dc.c
+11
-13
gdiobj.c
dlls/gdi32/gdiobj.c
+4
-10
No files found.
dlls/gdi32/dc.c
View file @
e9a4c235
...
...
@@ -200,7 +200,7 @@ BOOL DC_FreeDCPtr( DC *dc )
*/
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
{
DC_ReleaseDCPtr
(
obj
);
GDI_ReleaseObj
(
handle
);
return
DeleteDC
(
handle
);
}
...
...
@@ -740,25 +740,23 @@ HDC WINAPI CreateICW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
HDC
WINAPI
CreateCompatibleDC
(
HDC
hdc
)
{
DC
*
dc
,
*
origDC
;
const
DC_FUNCTIONS
*
funcs
;
PHYSDEV
physDev
;
const
DC_FUNCTIONS
*
funcs
=
NULL
;
PHYSDEV
physDev
=
NULL
;
GDI_CheckNotLock
();
if
((
origDC
=
GDI_GetObjPtr
(
hdc
,
DC_MAGIC
)))
if
((
origDC
=
DC_GetDCPtr
(
hdc
)))
{
funcs
=
origDC
->
funcs
;
physDev
=
origDC
->
physDev
;
if
(
GetObjectType
(
hdc
)
==
OBJ_DC
)
{
funcs
=
origDC
->
funcs
;
physDev
=
origDC
->
physDev
;
}
DC_ReleaseDCPtr
(
origDC
);
/* can't hold the lock while loading the driver */
funcs
=
DRIVER_get_driver
(
funcs
);
}
else
{
funcs
=
DRIVER_load_driver
(
displayW
);
physDev
=
NULL
;
if
(
funcs
)
funcs
=
DRIVER_get_driver
(
funcs
);
}
if
(
!
funcs
)
return
0
;
if
(
!
funcs
&&
!
(
funcs
=
DRIVER_load_driver
(
displayW
))
)
return
0
;
if
(
!
(
dc
=
DC_AllocDC
(
funcs
,
MEMORY_DC_MAGIC
)))
goto
error
;
...
...
dlls/gdi32/gdiobj.c
View file @
e9a4c235
...
...
@@ -528,15 +528,9 @@ static DWORD get_dpi( void )
*
* Increment the reference count of a GDI object.
*/
static
inline
void
inc_ref_count
(
HGDIOBJ
handle
)
static
inline
void
inc_ref_count
(
GDIOBJHDR
*
header
)
{
GDIOBJHDR
*
header
;
if
((
header
=
GDI_GetObjPtr
(
handle
,
MAGIC_DONTCARE
)))
{
header
->
dwCount
++
;
GDI_ReleaseObj
(
handle
);
}
header
->
dwCount
++
;
}
...
...
@@ -829,7 +823,7 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
{
if
(
dc
->
funcs
->
pDeleteObject
)
dc
->
funcs
->
pDeleteObject
(
dc
->
physDev
,
obj
);
GDI_ReleaseObj
(
header
->
hdcs
->
h
dc
);
DC_ReleaseDCPtr
(
dc
);
}
tmp
=
header
->
hdcs
;
header
->
hdcs
=
header
->
hdcs
->
next
;
...
...
@@ -1159,7 +1153,7 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj )
ret
=
header
->
funcs
->
pSelectObject
(
hObj
,
header
,
hdc
);
if
(
ret
&&
ret
!=
hObj
&&
HandleToULong
(
ret
)
>
COMPLEXREGION
)
{
inc_ref_count
(
h
Obj
);
inc_ref_count
(
h
eader
);
dec_ref_count
(
ret
);
}
}
...
...
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