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
87ef65ab
Commit
87ef65ab
authored
Sep 11, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Avoid LPVOID.
parent
9ccced6f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
54 additions
and
73 deletions
+54
-73
main.c
dlls/ddraw/main.c
+18
-39
d3d.c
dlls/ddraw/tests/d3d.c
+2
-1
ddrawmodes.c
dlls/ddraw/tests/ddrawmodes.c
+20
-23
dsurface.c
dlls/ddraw/tests/dsurface.c
+1
-1
overlay.c
dlls/ddraw/tests/overlay.c
+2
-1
refcount.c
dlls/ddraw/tests/refcount.c
+2
-1
visual.c
dlls/ddraw/tests/visual.c
+2
-1
d3d.h
include/d3d.h
+0
-0
d3dcaps.h
include/d3dcaps.h
+1
-1
d3dtypes.h
include/d3dtypes.h
+6
-5
ddraw.h
include/ddraw.h
+0
-0
No files found.
dlls/ddraw/main.c
View file @
87ef65ab
...
...
@@ -296,28 +296,25 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectDrawCreate(GUID *driver_guid, IDirectDraw
* Arguments, return values: See DDRAW_Create
*
***********************************************************************/
HRESULT
WINAPI
DECLSPEC_HOTPATCH
DirectDrawCreateEx
(
GUID
*
guid
,
LPVOID
*
dd
,
REFIID
iid
,
IUnknown
*
UnkOuter
)
HRESULT
WINAPI
DECLSPEC_HOTPATCH
DirectDrawCreateEx
(
GUID
*
driver_guid
,
void
**
ddraw
,
REFIID
interface_iid
,
IUnknown
*
outer
)
{
HRESULT
hr
;
TRACE
(
"driver_guid %s, ddraw %p, interface_iid %s, outer
_unknown
%p.
\n
"
,
debugstr_guid
(
guid
),
dd
,
debugstr_guid
(
iid
),
UnkO
uter
);
TRACE
(
"driver_guid %s, ddraw %p, interface_iid %s, outer %p.
\n
"
,
debugstr_guid
(
driver_guid
),
ddraw
,
debugstr_guid
(
interface_iid
),
o
uter
);
if
(
!
IsEqualGUID
(
iid
,
&
IID_IDirectDraw7
))
if
(
!
IsEqualGUID
(
i
nterface_i
id
,
&
IID_IDirectDraw7
))
return
DDERR_INVALIDPARAMS
;
wined3d_mutex_lock
();
hr
=
DDRAW_Create
(
guid
,
dd
,
UnkOuter
,
iid
);
hr
=
DDRAW_Create
(
driver_guid
,
ddraw
,
outer
,
interface_
iid
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
{
IDirectDraw7
*
ddraw7
=
*
(
IDirectDraw7
**
)
dd
;
hr
=
IDirectDraw7_Initialize
(
ddraw7
,
guid
);
IDirectDraw7
*
ddraw7
=
*
(
IDirectDraw7
**
)
dd
raw
;
hr
=
IDirectDraw7_Initialize
(
ddraw7
,
driver_
guid
);
if
(
FAILED
(
hr
))
IDirectDraw7_Release
(
ddraw7
);
}
...
...
@@ -551,7 +548,7 @@ struct ddraw_class_factory
IClassFactory
IClassFactory_iface
;
LONG
ref
;
HRESULT
(
*
pfnCreateInstance
)(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
LPVOID
*
ppObj
);
HRESULT
(
*
pfnCreateInstance
)(
IUnknown
*
outer
,
REFIID
iid
,
void
**
out
);
};
static
inline
struct
ddraw_class_factory
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
...
...
@@ -687,30 +684,13 @@ static const IClassFactoryVtbl IClassFactory_Vtbl =
ddraw_class_factory_LockServer
};
/*******************************************************************************
* DllGetClassObject [DDRAW.@]
* Retrieves class object from a DLL object
*
* NOTES
* Docs say returns STDAPI
*
* PARAMS
* rclsid [I] CLSID for the class object
* riid [I] Reference to identifier of interface for class object
* ppv [O] Address of variable to receive interface pointer for riid
*
* RETURNS
* Success: S_OK
* Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
* E_UNEXPECTED
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
out
)
{
struct
ddraw_class_factory
*
factory
;
unsigned
int
i
;
TRACE
(
"rclsid %s, riid %s, o
bjec
t %p.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
TRACE
(
"rclsid %s, riid %s, o
u
t %p.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
out
);
if
(
!
IsEqualGUID
(
&
IID_IClassFactory
,
riid
)
&&
!
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
...
...
@@ -736,7 +716,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
factory
->
pfnCreateInstance
=
object_creation
[
i
].
pfnCreateInstance
;
*
ppv
=
factory
;
*
out
=
factory
;
return
S_OK
;
}
...
...
@@ -826,9 +806,8 @@ DestroyCallback(IDirectDrawSurface7 *surf,
* app didn't release them properly(Gothic 2, Diablo 2, Moto racer, ...)
*
***********************************************************************/
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstDLL
,
DWORD
reason
,
LPVOID
reserved
)
BOOL
WINAPI
DllMain
(
HINSTANCE
inst
,
DWORD
reason
,
void
*
reserved
)
{
TRACE
(
"(%p,%x,%p)
\n
"
,
hInstDLL
,
reason
,
reserved
);
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
...
...
@@ -844,7 +823,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID reserved)
wc
.
lpfnWndProc
=
DefWindowProcA
;
wc
.
cbClsExtra
=
0
;
wc
.
cbWndExtra
=
0
;
wc
.
hInstance
=
hInstDLL
;
wc
.
hInstance
=
inst
;
wc
.
hIcon
=
0
;
wc
.
hCursor
=
0
;
wc
.
hbrBackground
=
GetStockObject
(
BLACK_BRUSH
);
...
...
@@ -899,8 +878,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID reserved)
if
(
!
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
const
WCHAR
*
)
&
ddraw_self
,
&
ddraw_self
))
ERR
(
"Failed to get own module handle.
\n
"
);
instance
=
hInstDLL
;
DisableThreadLibraryCalls
(
hInstDLL
);
instance
=
inst
;
DisableThreadLibraryCalls
(
inst
);
break
;
}
...
...
@@ -969,7 +948,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID reserved)
}
if
(
reserved
)
break
;
UnregisterClassA
(
DDRAW_WINDOW_CLASS_NAME
,
hInstDLL
);
UnregisterClassA
(
DDRAW_WINDOW_CLASS_NAME
,
inst
);
}
return
TRUE
;
...
...
dlls/ddraw/tests/d3d.c
View file @
87ef65ab
...
...
@@ -67,7 +67,8 @@ typedef struct
char
callback_name_strings
[
MAX_ENUMERATION_COUNT
][
100
];
}
D3D7ELifetimeTest
;
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
LPGUID
,
LPVOID
*
,
REFIID
,
LPUNKNOWN
);
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
GUID
*
driver_guid
,
void
**
ddraw
,
REFIID
interface_iid
,
IUnknown
*
outer
);
static
void
init_function_pointers
(
void
)
{
...
...
dlls/ddraw/tests/ddrawmodes.c
View file @
87ef65ab
...
...
@@ -43,10 +43,10 @@ static int modes16bpp_cnt;
static
int
refresh_rate
;
static
int
refresh_rate_cnt
;
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateA
)(
LPDDENUMCALLBACKA
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateW
)(
LPDDENUMCALLBACKW
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateExA
)(
LPDDENUMCALLBACKEXA
,
LPVOID
,
DWORD
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateExW
)(
LPDDENUMCALLBACKEXW
,
LPVOID
,
DWORD
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateA
)(
LPDDENUMCALLBACKA
cb
,
void
*
ctx
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateW
)(
LPDDENUMCALLBACKW
cb
,
void
*
ctx
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateExA
)(
LPDDENUMCALLBACKEXA
cb
,
void
*
ctx
,
DWORD
flags
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateExW
)(
LPDDENUMCALLBACKEXW
cb
,
void
*
ctx
,
DWORD
flags
);
static
void
init_function_pointers
(
void
)
{
...
...
@@ -104,8 +104,8 @@ static void releasedirectdraw(void)
}
}
static
BOOL
WINAPI
test_nullcontext_callbackA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
)
static
BOOL
WINAPI
test_nullcontext_callbackA
(
GUID
*
lpGUID
,
char
*
lpDriverDescription
,
char
*
lpDriverName
,
void
*
lpContext
)
{
trace
(
"test_nullcontext_callbackA: %p %s %s %p
\n
"
,
lpGUID
,
lpDriverDescription
,
lpDriverName
,
lpContext
);
...
...
@@ -115,13 +115,13 @@ static BOOL WINAPI test_nullcontext_callbackA(GUID *lpGUID, LPSTR lpDriverDescri
return
TRUE
;
}
static
BOOL
WINAPI
test_context_callbackA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
)
static
BOOL
WINAPI
test_context_callbackA
(
GUID
*
lpGUID
,
char
*
lpDriverDescription
,
char
*
lpDriverName
,
void
*
lpContext
)
{
trace
(
"test_context_callbackA: %p %s %s %p
\n
"
,
lpGUID
,
lpDriverDescription
,
lpDriverName
,
lpContext
);
ok
(
lpContext
==
(
LPVOID
)
0xdeadbeef
,
"Expected non-NULL lpContext
\n
"
);
ok
(
lpContext
==
(
void
*
)
0xdeadbeef
,
"Expected non-NULL lpContext
\n
"
);
return
TRUE
;
}
...
...
@@ -147,12 +147,12 @@ static void test_DirectDrawEnumerateA(void)
/* Test with valid callback parameter and valid context parameter. */
trace
(
"Calling DirectDrawEnumerateA with test_context_callbackA callback and non-NULL context.
\n
"
);
ret
=
pDirectDrawEnumerateA
(
test_context_callbackA
,
(
LPVOID
)
0xdeadbeef
);
ret
=
pDirectDrawEnumerateA
(
test_context_callbackA
,
(
void
*
)
0xdeadbeef
);
ok
(
ret
==
DD_OK
,
"Expected DD_OK, got %d
\n
"
,
ret
);
}
static
BOOL
WINAPI
test_callbackW
(
GUID
*
lpGUID
,
LPWSTR
lpDriverDescription
,
LPWSTR
lpDriverName
,
LPVOID
lpContext
)
static
BOOL
WINAPI
test_callbackW
(
GUID
*
lpGUID
,
WCHAR
*
lpDriverDescription
,
WCHAR
*
lpDriverName
,
void
*
lpContext
)
{
ok
(
0
,
"The callback should not be invoked by DirectDrawEnumerateW
\n
"
);
return
TRUE
;
...
...
@@ -187,9 +187,8 @@ static void test_DirectDrawEnumerateW(void)
ok
(
ret
==
DDERR_UNSUPPORTED
,
"Expected DDERR_UNSUPPORTED, got %d
\n
"
,
ret
);
}
static
BOOL
WINAPI
test_nullcontext_callbackExA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
,
HMONITOR
hm
)
static
BOOL
WINAPI
test_nullcontext_callbackExA
(
GUID
*
lpGUID
,
char
*
lpDriverDescription
,
char
*
lpDriverName
,
void
*
lpContext
,
HMONITOR
hm
)
{
trace
(
"test_nullcontext_callbackExA: %p %s %s %p %p
\n
"
,
lpGUID
,
lpDriverDescription
,
lpDriverName
,
lpContext
,
hm
);
...
...
@@ -199,14 +198,13 @@ static BOOL WINAPI test_nullcontext_callbackExA(GUID *lpGUID, LPSTR lpDriverDesc
return
TRUE
;
}
static
BOOL
WINAPI
test_context_callbackExA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
LPSTR
lpDriverName
,
LPVOID
lpContext
,
HMONITOR
hm
)
static
BOOL
WINAPI
test_context_callbackExA
(
GUID
*
lpGUID
,
char
*
lpDriverDescription
,
char
*
lpDriverName
,
void
*
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
"
);
ok
(
lpContext
==
(
void
*
)
0xdeadbeef
,
"Expected non-NULL lpContext
\n
"
);
return
TRUE
;
}
...
...
@@ -236,7 +234,7 @@ static void test_DirectDrawEnumerateExA(void)
/* 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
);
ret
=
pDirectDrawEnumerateExA
(
test_context_callbackExA
,
(
void
*
)
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. */
...
...
@@ -248,9 +246,8 @@ static void test_DirectDrawEnumerateExA(void)
ok
(
ret
==
DD_OK
,
"Expected DD_OK, got %d
\n
"
,
ret
);
}
static
BOOL
WINAPI
test_callbackExW
(
GUID
*
lpGUID
,
LPWSTR
lpDriverDescription
,
LPWSTR
lpDriverName
,
LPVOID
lpContext
,
HMONITOR
hm
)
static
BOOL
WINAPI
test_callbackExW
(
GUID
*
lpGUID
,
WCHAR
*
lpDriverDescription
,
WCHAR
*
lpDriverName
,
void
*
lpContext
,
HMONITOR
hm
)
{
ok
(
0
,
"The callback should not be invoked by DirectDrawEnumerateExW.
\n
"
);
return
TRUE
;
...
...
dlls/ddraw/tests/dsurface.c
View file @
87ef65ab
...
...
@@ -740,7 +740,7 @@ static void QueryInterface(void)
{
IDirectDrawSurface
*
dsurface
;
DDSURFACEDESC
surface
;
LPVOID
object
;
void
*
object
;
HRESULT
ret
;
/* Create a surface */
...
...
dlls/ddraw/tests/overlay.c
View file @
87ef65ab
...
...
@@ -23,7 +23,8 @@
#include "ddraw.h"
#include "unknwn.h"
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
LPGUID
,
LPVOID
*
,
REFIID
,
LPUNKNOWN
);
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
GUID
*
driver_guid
,
void
**
ddraw
,
REFIID
interface_iid
,
IUnknown
*
outer
);
static
IDirectDraw7
*
ddraw
=
NULL
;
static
IDirectDrawSurface7
*
primary
=
NULL
;
...
...
dlls/ddraw/tests/refcount.c
View file @
87ef65ab
...
...
@@ -24,7 +24,8 @@
#include "d3d.h"
#include "unknwn.h"
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
LPGUID
,
LPVOID
*
,
REFIID
,
LPUNKNOWN
);
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
GUID
*
driver_guid
,
void
**
ddraw
,
REFIID
interface_iid
,
IUnknown
*
outer
);
static
void
init_function_pointers
(
void
)
{
...
...
dlls/ddraw/tests/visual.c
View file @
87ef65ab
...
...
@@ -39,7 +39,8 @@ static IDirect3DViewport *Viewport;
static
BOOL
refdevice
=
FALSE
;
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
LPGUID
,
LPVOID
*
,
REFIID
,
LPUNKNOWN
);
static
HRESULT
(
WINAPI
*
pDirectDrawCreateEx
)(
GUID
*
driver_guid
,
void
**
ddraw
,
REFIID
interface_iid
,
IUnknown
*
outer
);
static
BOOL
color_match
(
D3DCOLOR
c1
,
D3DCOLOR
c2
,
BYTE
max_diff
)
{
...
...
include/d3d.h
View file @
87ef65ab
This diff is collapsed.
Click to expand it.
include/d3dcaps.h
View file @
87ef65ab
...
...
@@ -390,7 +390,7 @@ typedef struct _D3DExecuteBufferDesc {
DWORD
dwFlags
;
DWORD
dwCaps
;
DWORD
dwBufferSize
;
LPVOID
lpData
;
void
*
lpData
;
}
D3DEXECUTEBUFFERDESC
,
*
LPD3DEXECUTEBUFFERDESC
;
#define D3DDEB_BUFSIZE 0x00000001
...
...
include/d3dtypes.h
View file @
87ef65ab
...
...
@@ -71,7 +71,7 @@ typedef LONG D3DFIXED;
#define D3DENUMRET_CANCEL DDENUMRET_CANCEL
#define D3DENUMRET_OK DDENUMRET_OK
typedef
HRESULT
(
CALLBACK
*
LPD3DVALIDATECALLBACK
)(
LPVOID
lpUserArg
,
DWORD
dwO
ffset
);
typedef
HRESULT
(
CALLBACK
*
LPD3DVALIDATECALLBACK
)(
void
*
ctx
,
DWORD
o
ffset
);
typedef
HRESULT
(
CALLBACK
*
LPD3DENUMTEXTUREFORMATSCALLBACK
)(
DDSURFACEDESC
*
surface_desc
,
void
*
ctx
);
typedef
HRESULT
(
CALLBACK
*
LPD3DENUMPIXELFORMATSCALLBACK
)(
DDPIXELFORMAT
*
format
,
void
*
ctx
);
...
...
@@ -468,9 +468,9 @@ typedef struct _D3DVIEWPORT7 {
typedef
struct
_D3DTRANSFORMDATA
{
DWORD
dwSize
;
LPVOID
lpIn
;
void
*
lpIn
;
DWORD
dwInSize
;
LPVOID
lpOut
;
void
*
lpOut
;
DWORD
dwOutSize
;
D3DHVERTEX
*
lpHOut
;
DWORD
dwClip
;
...
...
@@ -1270,8 +1270,9 @@ typedef struct _D3DVERTEXBUFFERDESC {
#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
D3DFVF_TEX1 )
typedef
struct
_D3DDP_PTRSTRIDE
{
LPVOID
lpvData
;
typedef
struct
_D3DDP_PTRSTRIDE
{
void
*
lpvData
;
DWORD
dwStride
;
}
D3DDP_PTRSTRIDE
;
...
...
include/ddraw.h
View file @
87ef65ab
This diff is collapsed.
Click to expand it.
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