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
3496fe5f
Commit
3496fe5f
authored
Oct 08, 2009
by
Andrew Nguyen
Committed by
Alexandre Julliard
Oct 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: More fully implement and test DirectDrawEnumerateExA.
parent
bab8f7e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
3 deletions
+92
-3
main.c
dlls/ddraw/main.c
+12
-3
ddrawmodes.c
dlls/ddraw/tests/ddrawmodes.c
+80
-0
No files found.
dlls/ddraw/main.c
View file @
3496fe5f
...
@@ -403,7 +403,16 @@ DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA Callback,
...
@@ -403,7 +403,16 @@ DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA Callback,
LPVOID
Context
,
LPVOID
Context
,
DWORD
Flags
)
DWORD
Flags
)
{
{
BOOL
stop
=
FALSE
;
TRACE
(
"(%p, %p, 0x%08x)
\n
"
,
Callback
,
Context
,
Flags
);
if
(
Flags
&
~
(
DDENUM_ATTACHEDSECONDARYDEVICES
|
DDENUM_DETACHEDSECONDARYDEVICES
|
DDENUM_NONDISPLAYDEVICES
))
return
DDERR_INVALIDPARAMS
;
if
(
Flags
)
FIXME
(
"flags 0x%08x not handled
\n
"
,
Flags
);
TRACE
(
"Enumerating default DirectDraw HAL interface
\n
"
);
TRACE
(
"Enumerating default DirectDraw HAL interface
\n
"
);
/* We only have one driver by now */
/* We only have one driver by now */
...
@@ -413,11 +422,11 @@ DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA Callback,
...
@@ -413,11 +422,11 @@ DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA Callback,
driver_name
[]
=
"display"
;
driver_name
[]
=
"display"
;
/* QuickTime expects the description "DirectDraw HAL" */
/* QuickTime expects the description "DirectDraw HAL" */
stop
=
!
Callback
(
NULL
,
driver_desc
,
driver_name
,
Context
,
0
);
Callback
(
NULL
,
driver_desc
,
driver_name
,
Context
,
0
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
return
E_INVALIDARG
;
return
DDERR_INVALIDPARAMS
;
}
}
__ENDTRY
;
__ENDTRY
;
...
...
dlls/ddraw/tests/ddrawmodes.c
View file @
3496fe5f
...
@@ -40,12 +40,14 @@ static LPDDSURFACEDESC modes;
...
@@ -40,12 +40,14 @@ static LPDDSURFACEDESC modes;
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateA
)(
LPDDENUMCALLBACKA
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateA
)(
LPDDENUMCALLBACKA
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateW
)(
LPDDENUMCALLBACKW
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateW
)(
LPDDENUMCALLBACKW
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateExA
)(
LPDDENUMCALLBACKEXA
,
LPVOID
,
DWORD
);
static
void
init_function_pointers
(
void
)
static
void
init_function_pointers
(
void
)
{
{
HMODULE
hmod
=
GetModuleHandleA
(
"ddraw.dll"
);
HMODULE
hmod
=
GetModuleHandleA
(
"ddraw.dll"
);
pDirectDrawEnumerateA
=
(
void
*
)
GetProcAddress
(
hmod
,
"DirectDrawEnumerateA"
);
pDirectDrawEnumerateA
=
(
void
*
)
GetProcAddress
(
hmod
,
"DirectDrawEnumerateA"
);
pDirectDrawEnumerateW
=
(
void
*
)
GetProcAddress
(
hmod
,
"DirectDrawEnumerateW"
);
pDirectDrawEnumerateW
=
(
void
*
)
GetProcAddress
(
hmod
,
"DirectDrawEnumerateW"
);
pDirectDrawEnumerateExA
=
(
void
*
)
GetProcAddress
(
hmod
,
"DirectDrawEnumerateExA"
);
}
}
static
void
createwindow
(
void
)
static
void
createwindow
(
void
)
...
@@ -194,6 +196,83 @@ static void test_DirectDrawEnumerateW(void)
...
@@ -194,6 +196,83 @@ static void test_DirectDrawEnumerateW(void)
ok
(
ret
==
DDERR_UNSUPPORTED
,
"Expected DDERR_UNSUPPORTED, got %d
\n
"
,
ret
);
ok
(
ret
==
DDERR_UNSUPPORTED
,
"Expected DDERR_UNSUPPORTED, got %d
\n
"
,
ret
);
}
}
static
BOOL
WINAPI
crash_callbackExA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
,
HMONITOR
hm
)
{
*
(
volatile
char
*
)
0
=
2
;
return
TRUE
;
}
static
BOOL
WINAPI
test_nullcontext_callbackExA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
,
HMONITOR
hm
)
{
trace
(
"test_nullcontext_callbackExA: %p %s %s %p %p
\n
"
,
lpGUID
,
lpDriverDescription
,
lpDriverName
,
lpContext
,
hm
);
ok
(
!
lpContext
,
"Expected NULL lpContext
\n
"
);
return
TRUE
;
}
static
BOOL
WINAPI
test_context_callbackExA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
,
HMONITOR
hm
)
{
trace
(
"test_context_callbackExA: %p %s %s %p %p
\n
"
,
lpGUID
,
lpDriverDescription
,
lpDriverName
,
lpContext
,
hm
);
ok
(
lpContext
==
(
LPVOID
)
0xdeadbeef
,
"Expected non-NULL lpContext
\n
"
);
return
TRUE
;
}
static
void
test_DirectDrawEnumerateExA
(
void
)
{
HRESULT
ret
;
if
(
!
pDirectDrawEnumerateExA
)
{
win_skip
(
"DirectDrawEnumerateExA is not available
\n
"
);
return
;
}
/* Test with NULL callback parameter. */
ret
=
pDirectDrawEnumerateExA
(
NULL
,
NULL
,
0
);
ok
(
ret
==
DDERR_INVALIDPARAMS
,
"Expected DDERR_INVALIDPARAMS, got %d
\n
"
,
ret
);
/* Test with invalid callback parameter. */
ret
=
pDirectDrawEnumerateExA
((
LPDDENUMCALLBACKEXA
)
0xdeadbeef
,
NULL
,
0
);
ok
(
ret
==
DDERR_INVALIDPARAMS
,
"Expected DDERR_INVALIDPARAMS, got %d
\n
"
,
ret
);
/* Test with callback that crashes. */
ret
=
pDirectDrawEnumerateExA
(
crash_callbackExA
,
NULL
,
0
);
ok
(
ret
==
DDERR_INVALIDPARAMS
,
"Expected DDERR_INVALIDPARAMS, got %d
\n
"
,
ret
);
/* Test with valid callback parameter and invalid flags */
ret
=
pDirectDrawEnumerateExA
(
test_nullcontext_callbackExA
,
NULL
,
~
0
);
ok
(
ret
==
DDERR_INVALIDPARAMS
,
"Expected DDERR_INVALIDPARAMS, got %d
\n
"
,
ret
);
/* Test with valid callback parameter and NULL context parameter. */
trace
(
"Calling DirectDrawEnumerateExA with empty flags and NULL context.
\n
"
);
ret
=
pDirectDrawEnumerateExA
(
test_nullcontext_callbackExA
,
NULL
,
0
);
ok
(
ret
==
DD_OK
,
"Expected DD_OK, got %d
\n
"
,
ret
);
/* Test with valid callback parameter and non-NULL context parameter. */
trace
(
"Calling DirectDrawEnumerateExA with empty flags and non-NULL context.
\n
"
);
ret
=
pDirectDrawEnumerateExA
(
test_context_callbackExA
,
(
LPVOID
)
0xdeadbeef
,
0
);
ok
(
ret
==
DD_OK
,
"Expected DD_OK, got %d
\n
"
,
ret
);
/* Test with valid callback parameter, NULL context parameter, and all flags set. */
trace
(
"Calling DirectDrawEnumerateExA with all flags set and NULL context.
\n
"
);
ret
=
pDirectDrawEnumerateExA
(
test_nullcontext_callbackExA
,
NULL
,
DDENUM_ATTACHEDSECONDARYDEVICES
|
DDENUM_DETACHEDSECONDARYDEVICES
|
DDENUM_NONDISPLAYDEVICES
);
ok
(
ret
==
DD_OK
,
"Expected DD_OK, got %d
\n
"
,
ret
);
}
static
void
adddisplaymode
(
LPDDSURFACEDESC
lpddsd
)
static
void
adddisplaymode
(
LPDDSURFACEDESC
lpddsd
)
{
{
if
(
!
modes
)
if
(
!
modes
)
...
@@ -523,6 +602,7 @@ START_TEST(ddrawmodes)
...
@@ -523,6 +602,7 @@ START_TEST(ddrawmodes)
test_DirectDrawEnumerateA
();
test_DirectDrawEnumerateA
();
test_DirectDrawEnumerateW
();
test_DirectDrawEnumerateW
();
test_DirectDrawEnumerateExA
();
enumdisplaymodes
();
enumdisplaymodes
();
if
(
winetest_interactive
)
if
(
winetest_interactive
)
...
...
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