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
0e4f742f
Commit
0e4f742f
authored
May 06, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't bother freeing graphics drivers.
parent
1af17844
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
62 deletions
+2
-62
dc.c
dlls/gdi32/dc.c
+0
-6
driver.c
dlls/gdi32/driver.c
+2
-54
gdi_private.h
dlls/gdi32/gdi_private.h
+0
-2
No files found.
dlls/gdi32/dc.c
View file @
0e4f742f
...
...
@@ -674,7 +674,6 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
error:
if
(
dc
)
free_dc_ptr
(
dc
);
DRIVER_release_driver
(
funcs
);
return
0
;
}
...
...
@@ -759,7 +758,6 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
physDev
=
origDC
->
physDev
;
}
release_dc_ptr
(
origDC
);
if
(
funcs
)
funcs
=
DRIVER_get_driver
(
funcs
);
}
if
(
!
funcs
&&
!
(
funcs
=
DRIVER_load_driver
(
displayW
)))
return
0
;
...
...
@@ -790,7 +788,6 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
error:
if
(
dc
)
free_dc_ptr
(
dc
);
DRIVER_release_driver
(
funcs
);
return
0
;
}
...
...
@@ -800,7 +797,6 @@ error:
*/
BOOL
WINAPI
DeleteDC
(
HDC
hdc
)
{
const
DC_FUNCTIONS
*
funcs
=
NULL
;
DC
*
dc
;
TRACE
(
"%p
\n
"
,
hdc
);
...
...
@@ -838,13 +834,11 @@ BOOL WINAPI DeleteDC( HDC hdc )
SelectObject
(
hdc
,
GetStockObject
(
WHITE_BRUSH
)
);
SelectObject
(
hdc
,
GetStockObject
(
SYSTEM_FONT
)
);
SelectObject
(
hdc
,
GetStockObject
(
DEFAULT_BITMAP
)
);
funcs
=
dc
->
funcs
;
if
(
dc
->
funcs
->
pDeleteDC
)
dc
->
funcs
->
pDeleteDC
(
dc
->
physDev
);
dc
->
physDev
=
NULL
;
}
free_dc_ptr
(
dc
);
if
(
funcs
)
DRIVER_release_driver
(
funcs
);
/* do that after releasing the GDI lock */
return
TRUE
;
}
...
...
dlls/gdi32/driver.c
View file @
0e4f742f
...
...
@@ -42,7 +42,6 @@ struct graphics_driver
{
struct
list
entry
;
HMODULE
module
;
/* module handle */
unsigned
int
count
;
/* reference count */
DC_FUNCTIONS
funcs
;
};
...
...
@@ -69,7 +68,6 @@ static struct graphics_driver *create_driver( HMODULE module )
if
(
!
(
driver
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
driver
))))
return
NULL
;
driver
->
module
=
module
;
driver
->
count
=
1
;
/* fill the function table */
if
(
module
)
...
...
@@ -227,11 +225,7 @@ static struct graphics_driver *load_display_driver(void)
HMODULE
module
=
0
;
HKEY
hkey
;
if
(
display_driver
)
/* already loaded */
{
display_driver
->
count
++
;
return
display_driver
;
}
if
(
display_driver
)
return
display_driver
;
/* already loaded */
strcpy
(
buffer
,
"x11"
);
/* default value */
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */
...
...
@@ -260,7 +254,6 @@ static struct graphics_driver *load_display_driver(void)
ExitProcess
(
1
);
}
display_driver
->
count
++
;
/* we don't want to free it */
return
display_driver
;
}
...
...
@@ -278,7 +271,7 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
EnterCriticalSection
(
&
driver_section
);
/* display driver is a special case */
if
(
!
strcmpiW
(
name
,
displayW
)
||
if
(
!
strcmpiW
(
name
,
displayW
)
||
!
strcmpiW
(
name
,
display1W
))
{
driver
=
load_display_driver
();
...
...
@@ -292,7 +285,6 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
{
if
(
driver
->
module
==
module
)
{
driver
->
count
++
;
LeaveCriticalSection
(
&
driver_section
);
return
&
driver
->
funcs
;
}
...
...
@@ -318,50 +310,6 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
}
/**********************************************************************
* DRIVER_get_driver
*
* Get a new copy of an existing driver.
*/
const
DC_FUNCTIONS
*
DRIVER_get_driver
(
const
DC_FUNCTIONS
*
funcs
)
{
struct
graphics_driver
*
driver
;
EnterCriticalSection
(
&
driver_section
);
LIST_FOR_EACH_ENTRY
(
driver
,
&
drivers
,
struct
graphics_driver
,
entry
)
if
(
&
driver
->
funcs
==
funcs
)
break
;
if
(
&
driver
->
entry
==
&
drivers
)
ERR
(
"driver not found, trouble ahead
\n
"
);
driver
->
count
++
;
LeaveCriticalSection
(
&
driver_section
);
return
funcs
;
}
/**********************************************************************
* DRIVER_release_driver
*
* Release a driver by decrementing ref count and freeing it if needed.
*/
void
DRIVER_release_driver
(
const
DC_FUNCTIONS
*
funcs
)
{
struct
graphics_driver
*
driver
;
EnterCriticalSection
(
&
driver_section
);
LIST_FOR_EACH_ENTRY
(
driver
,
&
drivers
,
struct
graphics_driver
,
entry
)
{
if
(
&
driver
->
funcs
!=
funcs
)
continue
;
if
(
--
driver
->
count
)
break
;
list_remove
(
&
driver
->
entry
);
if
(
driver
==
display_driver
)
display_driver
=
NULL
;
FreeLibrary
(
driver
->
module
);
HeapFree
(
GetProcessHeap
(),
0
,
driver
);
break
;
}
LeaveCriticalSection
(
&
driver_section
);
}
/*****************************************************************************
* DRIVER_GetDriverName
*
...
...
dlls/gdi32/gdi_private.h
View file @
0e4f742f
...
...
@@ -386,8 +386,6 @@ extern int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
/* driver.c */
extern
const
DC_FUNCTIONS
*
DRIVER_load_driver
(
LPCWSTR
name
)
DECLSPEC_HIDDEN
;
extern
const
DC_FUNCTIONS
*
DRIVER_get_driver
(
const
DC_FUNCTIONS
*
funcs
)
DECLSPEC_HIDDEN
;
extern
void
DRIVER_release_driver
(
const
DC_FUNCTIONS
*
funcs
)
DECLSPEC_HIDDEN
;
extern
BOOL
DRIVER_GetDriverName
(
LPCWSTR
device
,
LPWSTR
driver
,
DWORD
size
)
DECLSPEC_HIDDEN
;
/* enhmetafile.c */
...
...
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