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 =
...
@@ -1276,17 +1276,8 @@ static const IDirectDraw4Vtbl IDirectDraw4_Vtbl =
IDirectDraw4Impl_GetDeviceIdentifier
IDirectDraw4Impl_GetDeviceIdentifier
};
};
/*******************************************************************************
HRESULT
WINAPI
ddrawex_factory_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
* IDirectDrawFactoryImpl_CreateDirectDraw
DWORD
dwCoopLevelFlags
,
DWORD
dwReserved
,
IUnknown
*
pUnkOuter
,
IDirectDraw
**
ppDirectDraw
)
*******************************************************************************/
HRESULT
WINAPI
IDirectDrawFactoryImpl_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
DWORD
dwCoopLevelFlags
,
DWORD
dwReserved
,
IUnknown
*
pUnkOuter
,
IDirectDraw
**
ppDirectDraw
)
{
{
HRESULT
hr
;
HRESULT
hr
;
IDirectDrawImpl
*
object
=
NULL
;
IDirectDrawImpl
*
object
=
NULL
;
...
...
dlls/ddrawex/ddrawex_private.h
View file @
b9e1bcb7
...
@@ -44,9 +44,9 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown)
...
@@ -44,9 +44,9 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown)
#endif
#endif
HRESULT
WINAPI
IDirectDrawFactoryImpl_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
HRESULT
WINAPI
ddrawex_factory_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
DWORD
dwCoopLevelFlags
,
DWORD
dwReserved
,
IUnknown
*
pUnkOuter
,
GUID
*
guid
,
HWND
window
,
DWORD
coop_level
,
DWORD
reserved
,
IUnknown
*
outer_unknown
,
IDirectDraw
**
ppDirectD
raw
)
DECLSPEC_HIDDEN
;
IDirectDraw
**
dd
raw
)
DECLSPEC_HIDDEN
;
void
DDSD_to_DDSD2
(
const
DDSURFACEDESC
*
in
,
DDSURFACEDESC2
*
out
)
DECLSPEC_HIDDEN
;
void
DDSD_to_DDSD2
(
const
DDSURFACEDESC
*
in
,
DDSURFACEDESC2
*
out
)
DECLSPEC_HIDDEN
;
void
DDSD2_to_DDSD
(
const
DDSURFACEDESC2
*
in
,
DDSURFACEDESC
*
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 =
...
@@ -116,129 +116,96 @@ static const IClassFactoryVtbl ddrawex_class_factory_vtbl =
ddrawex_class_factory_LockServer
,
ddrawex_class_factory_LockServer
,
};
};
struct
ddrawex_factory
/******************************************************************************
* DirectDrawFactory implementation
******************************************************************************/
typedef
struct
{
{
IDirectDrawFactory
IDirectDrawFactory_iface
;
IDirectDrawFactory
IDirectDrawFactory_iface
;
LONG
ref
;
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
);
}
}
/*******************************************************************************
static
HRESULT
WINAPI
ddrawex_factory_QueryInterface
(
IDirectDrawFactory
*
iface
,
REFIID
riid
,
void
**
out
)
* IDirectDrawFactory::QueryInterface
*
*******************************************************************************/
static
HRESULT
WINAPI
IDirectDrawFactoryImpl_QueryInterface
(
IDirectDrawFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
{
{
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
)
if
(
IsEqualGUID
(
riid
,
&
IID_I
DirectDrawFactory
)
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawFactory
))
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
{
IDirectDrawFactory_AddRef
(
iface
);
IDirectDrawFactory_AddRef
(
iface
);
*
o
bj
=
iface
;
*
o
ut
=
iface
;
return
S_OK
;
return
S_OK
;
}
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
o
bj
=
NULL
;
*
o
ut
=
NULL
;
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
/*******************************************************************************
static
ULONG
WINAPI
ddrawex_factory_AddRef
(
IDirectDrawFactory
*
iface
)
* IDirectDrawFactory::AddRef
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawFactoryImpl_AddRef
(
IDirectDrawFactory
*
iface
)
{
{
IDirectDrawFactoryImpl
*
This
=
impl_from_IDirectDrawFactory
(
iface
);
struct
ddrawex_factory
*
factory
=
impl_from_IDirectDrawFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
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
;
}
}
/*******************************************************************************
static
ULONG
WINAPI
ddrawex_factory_Release
(
IDirectDrawFactory
*
iface
)
* IDirectDrawFactory::Release
*
*******************************************************************************/
static
ULONG
WINAPI
IDirectDrawFactoryImpl_Release
(
IDirectDrawFactory
*
iface
)
{
{
IDirectDrawFactoryImpl
*
This
=
impl_from_IDirectDrawFactory
(
iface
);
struct
ddrawex_factory
*
factory
=
impl_from_IDirectDrawFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
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
)
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
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
)
LPDDENUMCALLBACKW
cb
,
void
*
ctx
)
{
{
FIXME
(
"Stub!
\n
"
);
FIXME
(
"iface %p, cb %p, ctx %p stub!
\n
"
,
iface
,
cb
,
ctx
);
return
E_FAIL
;
return
E_FAIL
;
}
}
static
const
IDirectDrawFactoryVtbl
ddrawex_factory_vtbl
=
/*******************************************************************************
* Direct Draw Factory VTable
*******************************************************************************/
static
const
IDirectDrawFactoryVtbl
IDirectDrawFactory_Vtbl
=
{
{
IDirectDrawFactoryImpl
_QueryInterface
,
ddrawex_factory
_QueryInterface
,
IDirectDrawFactoryImpl
_AddRef
,
ddrawex_factory
_AddRef
,
IDirectDrawFactoryImpl
_Release
,
ddrawex_factory
_Release
,
IDirectDrawFactoryImpl
_CreateDirectDraw
,
ddrawex_factory
_CreateDirectDraw
,
IDirectDrawFactoryImpl
_DirectDrawEnumerate
,
ddrawex_factory
_DirectDrawEnumerate
,
};
};
/***********************************************************************
static
HRESULT
ddrawex_factory_create
(
IUnknown
*
outer_unknown
,
REFIID
riid
,
void
**
out
)
* CreateDirectDrawFactory
*
***********************************************************************/
static
HRESULT
CreateDirectDrawFactory
(
IUnknown
*
UnkOuter
,
REFIID
iid
,
void
**
obj
)
{
{
struct
ddrawex_factory
*
factory
;
HRESULT
hr
;
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
;
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectDrawFactoryImpl
));
if
(
!
(
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
))))
if
(
!
This
)
{
ERR
(
"Out of memory when creating DirectDraw
\n
"
);
return
E_OUTOFMEMORY
;
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
=
ddrawex_factory_QueryInterface
(
&
factory
->
IDirectDrawFactory_iface
,
riid
,
out
)))
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
return
hr
;
}
}
/*******************************************************************************
/*******************************************************************************
* DllCanUnloadNow [DDRAWEX.@] Determines whether the DLL is in use.
* DllCanUnloadNow [DDRAWEX.@] Determines whether the DLL is in use.
*/
*/
...
@@ -273,7 +240,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
...
@@ -273,7 +240,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
factory
->
IClassFactory_iface
.
lpVtbl
=
&
ddrawex_class_factory_vtbl
;
factory
->
IClassFactory_iface
.
lpVtbl
=
&
ddrawex_class_factory_vtbl
;
factory
->
ref
=
1
;
factory
->
ref
=
1
;
factory
->
pfnCreateInstance
=
CreateDirectDrawFactory
;
factory
->
pfnCreateInstance
=
ddrawex_factory_create
;
*
out
=
factory
;
*
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