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
09e794af
Commit
09e794af
authored
Oct 09, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Make the ddraw list a wine list.
parent
9eda99c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
30 deletions
+19
-30
ddraw.c
dlls/ddraw/ddraw.c
+1
-21
ddraw_private.h
dlls/ddraw/ddraw_private.h
+4
-3
main.c
dlls/ddraw/main.c
+14
-6
No files found.
dlls/ddraw/ddraw.c
View file @
09e794af
...
...
@@ -62,9 +62,6 @@ static const DDDEVICEIDENTIFIER2 deviceidentifier =
0
};
/* This is for cleanup if a broken app doesn't Release its objects */
IDirectDrawImpl
*
ddraw_list
;
/*****************************************************************************
* IUnknown Methods
*****************************************************************************/
...
...
@@ -244,8 +241,6 @@ IDirectDrawImpl_AddRef(IDirectDraw7 *iface)
void
IDirectDrawImpl_Destroy
(
IDirectDrawImpl
*
This
)
{
IDirectDrawImpl
*
prev
;
/* Clear the cooplevel to restore window and display mode */
IDirectDraw7_SetCooperativeLevel
(
ICOM_INTERFACE
(
This
,
IDirectDraw7
),
NULL
,
...
...
@@ -262,22 +257,7 @@ IDirectDrawImpl_Destroy(IDirectDrawImpl *This)
/* Unregister the window class */
UnregisterClassA
(
This
->
classname
,
0
);
/* Unchain it from the ddraw list */
if
(
ddraw_list
==
This
)
{
ddraw_list
=
This
->
next
;
/* No need to search for a predecessor here */
}
else
{
for
(
prev
=
ddraw_list
;
prev
;
prev
=
prev
->
next
)
if
(
prev
->
next
==
This
)
break
;
if
(
prev
)
prev
->
next
=
This
->
next
;
else
ERR
(
"Didn't find the previous ddraw element in the list
\n
"
);
}
remove_ddraw_object
(
This
);
/* Release the attached WineD3D stuff */
IWineD3DDevice_Release
(
This
->
wineD3DDevice
);
...
...
dlls/ddraw/ddraw_private.h
View file @
09e794af
...
...
@@ -36,6 +36,7 @@
#include "ddcomimpl.h"
#include "wine/wined3d_interface.h"
#include "wine/list.h"
/*****************************************************************************
* IParent - a helper interface
...
...
@@ -143,7 +144,7 @@ struct IDirectDrawImpl
BOOL
depthstencil
;
/* For the dll unload cleanup code */
IDirectDrawImpl
*
next
;
struct
list
ddraw_list_entry
;
LONG
surfaces
;
};
...
...
@@ -182,8 +183,8 @@ HRESULT WINAPI
IDirectDrawImpl_RecreateSurfacesCallback
(
IDirectDrawSurface7
*
surf
,
DDSURFACEDESC2
*
desc
,
void
*
Context
);
/* The cleanup list */
extern
IDirectDrawImpl
*
ddraw_list
;
void
remove_ddraw_object
(
IDirectDrawImpl
*
ddraw
)
;
/* The default surface type */
extern
WINED3DSURFTYPE
DefaultSurfaceType
;
...
...
dlls/ddraw/main.c
View file @
09e794af
...
...
@@ -58,6 +58,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
/* The configured default surface */
WINED3DSURFTYPE
DefaultSurfaceType
=
SURFACE_UNKNOWN
;
static
struct
list
global_ddraw_list
=
LIST_INIT
(
global_ddraw_list
);
/***********************************************************************
*
* Helper function for DirectDrawCreate and friends
...
...
@@ -302,9 +304,7 @@ DDRAW_Create(GUID *guid,
#undef CKEY_CAPS
#undef FX_CAPS
/* Add the object to the ddraw cleanup list */
This
->
next
=
ddraw_list
;
ddraw_list
=
This
;
list_add_head
(
&
global_ddraw_list
,
&
This
->
ddraw_list_entry
);
/* Call QueryInterface to get the pointer to the requested interface. This also initializes
* The required refcount
...
...
@@ -860,16 +860,18 @@ DllMain(HINSTANCE hInstDLL,
if
(
counter
==
0
)
{
if
(
ddraw_list
)
if
(
!
list_empty
(
&
global_ddraw_list
)
)
{
IDirectDrawImpl
*
ddraw
;
struct
list
*
entry
,
*
entry2
;
WARN
(
"There are still existing DirectDraw interfaces. Wine bug or buggy application?
\n
"
);
for
(
ddraw
=
ddraw_list
;
ddraw
;
ddraw
=
ddraw
->
next
)
/* We remove elemets from this loop */
LIST_FOR_EACH_SAFE
(
entry
,
entry2
,
&
global_ddraw_list
)
{
HRESULT
hr
;
DDSURFACEDESC2
desc
;
int
i
;
IDirectDrawImpl
*
ddraw
=
LIST_ENTRY
(
entry
,
IDirectDrawImpl
,
ddraw_list_entry
);
WARN
(
"DDraw %p has a refcount of %ld
\n
"
,
ddraw
,
ddraw
->
ref7
+
ddraw
->
ref4
+
ddraw
->
ref2
+
ddraw
->
ref1
);
...
...
@@ -923,3 +925,9 @@ DllMain(HINSTANCE hInstDLL,
return
TRUE
;
}
void
remove_ddraw_object
(
IDirectDrawImpl
*
ddraw
)
{
list_remove
(
&
ddraw
->
ddraw_list_entry
);
}
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