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
72caaad6
Commit
72caaad6
authored
Dec 05, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Dec 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Catch access violations when calling DirectDrawEnumerateProc.
parent
ae4eafbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
7 deletions
+27
-7
Makefile.in
dlls/ddraw/Makefile.in
+1
-1
main.c
dlls/ddraw/main.c
+26
-6
No files found.
dlls/ddraw/Makefile.in
View file @
72caaad6
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
ddraw.dll
IMPORTLIB
=
libddraw.
$(IMPLIBEXT)
IMPORTS
=
ole32 user32 gdi32 advapi32 kernel32
IMPORTS
=
ole32 user32 gdi32 advapi32 kernel32
ntdll
EXTRAINCL
=
@X_CFLAGS@
EXTRALIBS
=
-ldxguid
-luuid
@X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
...
...
dlls/ddraw/main.c
View file @
72caaad6
...
...
@@ -39,6 +39,8 @@
#include "winnls.h"
#include "winerror.h"
#include "wingdi.h"
#include "wine/exception.h"
#include "excpt.h"
#include "ddraw.h"
#include "d3d.h"
...
...
@@ -62,6 +64,14 @@ void (*wine_tsx11_unlock_ptr)(void) = NULL;
WINE_DEFAULT_DEBUG_CHANNEL
(
ddraw
);
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
if
(
GetExceptionCode
()
==
EXCEPTION_ACCESS_VIOLATION
)
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
/**********************************************************************/
typedef
struct
{
...
...
@@ -180,6 +190,7 @@ HRESULT WINAPI DirectDrawEnumerateExA(
LPDDENUMCALLBACKEXA
lpCallback
,
LPVOID
lpContext
,
DWORD
dwFlags
)
{
int
i
;
BOOL
stop
=
FALSE
;
TRACE
(
"(%p,%p, %08lx)
\n
"
,
lpCallback
,
lpContext
,
dwFlags
);
if
(
TRACE_ON
(
ddraw
))
{
...
...
@@ -201,12 +212,21 @@ HRESULT WINAPI DirectDrawEnumerateExA(
/* We have to pass NULL from the primary display device.
* RoadRage chapter 6's enumeration routine expects it. */
if
(
!
lpCallback
((
DDRAW_default_driver
==
i
)
?
NULL
:
(
LPGUID
)
&
DDRAW_drivers
[
i
]
->
info
->
guidDeviceIdentifier
,
(
LPSTR
)
DDRAW_drivers
[
i
]
->
info
->
szDescription
,
(
LPSTR
)
DDRAW_drivers
[
i
]
->
info
->
szDriver
,
lpContext
,
0
))
return
DD_OK
;
__TRY
{
if
(
!
lpCallback
((
DDRAW_default_driver
==
i
)
?
NULL
:
(
LPGUID
)
&
DDRAW_drivers
[
i
]
->
info
->
guidDeviceIdentifier
,
(
LPSTR
)
DDRAW_drivers
[
i
]
->
info
->
szDescription
,
(
LPSTR
)
DDRAW_drivers
[
i
]
->
info
->
szDriver
,
lpContext
,
0
))
stop
=
TRUE
;
}
__EXCEPT
(
page_fault
)
{
return
E_INVALIDARG
;
}
__ENDTRY
if
(
stop
)
return
DD_OK
;
}
/* Unsupported flags */
...
...
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