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
b9e1bcb7
Commit
b9e1bcb7
authored
Nov 04, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: Get rid of the IDirectDrawFactoryImpl typedef.
parent
ec37ac6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
87 deletions
+45
-87
ddraw.c
dlls/ddrawex/ddraw.c
+2
-11
ddrawex_private.h
dlls/ddrawex/ddrawex_private.h
+3
-3
main.c
dlls/ddrawex/main.c
+40
-73
No files found.
dlls/ddrawex/ddraw.c
View file @
b9e1bcb7
...
...
@@ -1276,17 +1276,8 @@ static const IDirectDraw4Vtbl IDirectDraw4_Vtbl =
IDirectDraw4Impl_GetDeviceIdentifier
};
/*******************************************************************************
* IDirectDrawFactoryImpl_CreateDirectDraw
*******************************************************************************/
HRESULT
WINAPI
IDirectDrawFactoryImpl_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
DWORD
dwCoopLevelFlags
,
DWORD
dwReserved
,
IUnknown
*
pUnkOuter
,
IDirectDraw
**
ppDirectDraw
)
HRESULT
WINAPI
ddrawex_factory_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
DWORD
dwCoopLevelFlags
,
DWORD
dwReserved
,
IUnknown
*
pUnkOuter
,
IDirectDraw
**
ppDirectDraw
)
{
HRESULT
hr
;
IDirectDrawImpl
*
object
=
NULL
;
...
...
dlls/ddrawex/ddrawex_private.h
View file @
b9e1bcb7
...
...
@@ -44,9 +44,9 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown)
#endif
HRESULT
WINAPI
IDirectDrawFactoryImpl_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
DWORD
dwCoopLevelFlags
,
DWORD
dwReserved
,
IUnknown
*
pUnkOuter
,
IDirectDraw
**
ppDirectD
raw
)
DECLSPEC_HIDDEN
;
HRESULT
WINAPI
ddrawex_factory_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
guid
,
HWND
window
,
DWORD
coop_level
,
DWORD
reserved
,
IUnknown
*
outer_unknown
,
IDirectDraw
**
dd
raw
)
DECLSPEC_HIDDEN
;
void
DDSD_to_DDSD2
(
const
DDSURFACEDESC
*
in
,
DDSURFACEDESC2
*
out
)
DECLSPEC_HIDDEN
;
void
DDSD2_to_DDSD
(
const
DDSURFACEDESC2
*
in
,
DDSURFACEDESC
*
out
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddrawex/main.c
View file @
b9e1bcb7
...
...
@@ -116,129 +116,96 @@ static const IClassFactoryVtbl ddrawex_class_factory_vtbl =
ddrawex_class_factory_LockServer
,
};
/******************************************************************************
* DirectDrawFactory implementation
******************************************************************************/
typedef
struct
struct
ddrawex_factory
{
IDirectDrawFactory
IDirectDrawFactory_iface
;
LONG
ref
;
}
IDirectDrawFactoryImpl
;
};
static
inline
IDirectDrawFactoryImpl
*
impl_from_IDirectDrawFactory
(
IDirectDrawFactory
*
iface
)
static
inline
struct
ddrawex_factory
*
impl_from_IDirectDrawFactory
(
IDirectDrawFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectDrawFactoryImpl
,
IDirectDrawFactory_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
ddrawex_factory
,
IDirectDrawFactory_iface
);
}
/*******************************************************************************
* IDirectDrawFactory::QueryInterface
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawFactoryImpl_QueryInterface
(
IDirectDrawFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
ddrawex_factory_QueryInterface
(
IDirectDrawFactory
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"
(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"
iface %p, riid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_I
Unknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawFactory
))
if
(
IsEqualGUID
(
riid
,
&
IID_I
DirectDrawFactory
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IDirectDrawFactory_AddRef
(
iface
);
*
o
bj
=
iface
;
*
o
ut
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
o
bj
=
NULL
;
*
o
ut
=
NULL
;
return
E_NOINTERFACE
;
}
/*******************************************************************************
* IDirectDrawFactory::AddRef
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawFactoryImpl_AddRef
(
IDirectDrawFactory
*
iface
)
static
ULONG
WINAPI
ddrawex_factory_AddRef
(
IDirectDrawFactory
*
iface
)
{
IDirectDrawFactoryImpl
*
This
=
impl_from_IDirectDrawFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
ddrawex_factory
*
factory
=
impl_from_IDirectDrawFactory
(
iface
);
ULONG
ref
count
=
InterlockedIncrement
(
&
factory
->
ref
);
TRACE
(
"
(%p)->() incrementing from %d.
\n
"
,
This
,
ref
-
1
);
TRACE
(
"
%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
return
ref
;
return
ref
count
;
}
/*******************************************************************************
* IDirectDrawFactory::Release
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawFactoryImpl_Release
(
IDirectDrawFactory
*
iface
)
static
ULONG
WINAPI
ddrawex_factory_Release
(
IDirectDrawFactory
*
iface
)
{
IDirectDrawFactoryImpl
*
This
=
impl_from_IDirectDrawFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
ddrawex_factory
*
factory
=
impl_from_IDirectDrawFactory
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
factory
->
ref
);
TRACE
(
"
(%p)->() decrementing from %d.
\n
"
,
This
,
ref
+
1
);
TRACE
(
"
%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
return
ref
;
return
ref
count
;
}
static
HRESULT
WINAPI
IDirectDrawFactoryImpl
_DirectDrawEnumerate
(
IDirectDrawFactory
*
iface
,
static
HRESULT
WINAPI
ddrawex_factory
_DirectDrawEnumerate
(
IDirectDrawFactory
*
iface
,
LPDDENUMCALLBACKW
cb
,
void
*
ctx
)
{
FIXME
(
"Stub!
\n
"
);
FIXME
(
"iface %p, cb %p, ctx %p stub!
\n
"
,
iface
,
cb
,
ctx
);
return
E_FAIL
;
}
/*******************************************************************************
* Direct Draw Factory VTable
*******************************************************************************/
static
const
IDirectDrawFactoryVtbl
IDirectDrawFactory_Vtbl
=
static
const
IDirectDrawFactoryVtbl
ddrawex_factory_vtbl
=
{
IDirectDrawFactoryImpl
_QueryInterface
,
IDirectDrawFactoryImpl
_AddRef
,
IDirectDrawFactoryImpl
_Release
,
IDirectDrawFactoryImpl
_CreateDirectDraw
,
IDirectDrawFactoryImpl
_DirectDrawEnumerate
,
ddrawex_factory
_QueryInterface
,
ddrawex_factory
_AddRef
,
ddrawex_factory
_Release
,
ddrawex_factory
_CreateDirectDraw
,
ddrawex_factory
_DirectDrawEnumerate
,
};
/***********************************************************************
* CreateDirectDrawFactory
*
***********************************************************************/
static
HRESULT
CreateDirectDrawFactory
(
IUnknown
*
UnkOuter
,
REFIID
iid
,
void
**
obj
)
static
HRESULT
ddrawex_factory_create
(
IUnknown
*
outer_unknown
,
REFIID
riid
,
void
**
out
)
{
struct
ddrawex_factory
*
factory
;
HRESULT
hr
;
IDirectDrawFactoryImpl
*
This
=
NULL
;
TRACE
(
"
(%p,%s,%p)
\n
"
,
UnkOuter
,
debugstr_guid
(
iid
),
obj
);
TRACE
(
"
outer_unknown %p, riid %s, out %p.
\n
"
,
outer_unknown
,
debugstr_guid
(
riid
),
out
);
if
(
UnkOuter
!=
NULL
)
if
(
outer_unknown
)
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectDrawFactoryImpl
));
if
(
!
This
)
{
ERR
(
"Out of memory when creating DirectDraw
\n
"
);
if
(
!
(
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
))))
return
E_OUTOFMEMORY
;
}
This
->
IDirectDrawFactory_iface
.
lpVtbl
=
&
IDirectDrawFactory_V
tbl
;
factory
->
IDirectDrawFactory_iface
.
lpVtbl
=
&
ddrawex_factory_v
tbl
;
hr
=
IDirectDrawFactory_QueryInterface
(
&
This
->
IDirectDrawFactory_iface
,
iid
,
obj
);
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
FAILED
(
hr
=
ddrawex_factory_QueryInterface
(
&
factory
->
IDirectDrawFactory_iface
,
riid
,
out
)))
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
return
hr
;
}
/*******************************************************************************
* DllCanUnloadNow [DDRAWEX.@] Determines whether the DLL is in use.
*/
...
...
@@ -273,7 +240,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
factory
->
IClassFactory_iface
.
lpVtbl
=
&
ddrawex_class_factory_vtbl
;
factory
->
ref
=
1
;
factory
->
pfnCreateInstance
=
CreateDirectDrawFactory
;
factory
->
pfnCreateInstance
=
ddrawex_factory_create
;
*
out
=
factory
;
...
...
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