Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
b9e1bcb7
Commit
b9e1bcb7
authored
11 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ddrawex: Get rid of the IDirectDrawFactoryImpl typedef.
parent
ec37ac6f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/ddrawex/ddraw.c
+2
-11
2 additions, 11 deletions
dlls/ddrawex/ddraw.c
dlls/ddrawex/ddrawex_private.h
+3
-3
3 additions, 3 deletions
dlls/ddrawex/ddrawex_private.h
dlls/ddrawex/main.c
+40
-73
40 additions, 73 deletions
dlls/ddrawex/main.c
with
45 additions
and
87 deletions
dlls/ddrawex/ddraw.c
+
2
−
11
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/ddrawex/ddrawex_private.h
+
3
−
3
View file @
b9e1bcb7
...
...
@@ -44,9 +44,9 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown)
#endif
HRESULT
WINAPI
IDirectDrawF
actory
Impl
_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
pGUID
,
HWND
hWnd
,
DWORD
dwC
oop
L
evel
Flags
,
DWORD
dwR
eserved
,
IUnknown
*
pUnkOuter
,
IDirectDraw
**
ppDirectD
raw
)
DECLSPEC_HIDDEN
;
HRESULT
WINAPI
ddrawex_f
actory_CreateDirectDraw
(
IDirectDrawFactory
*
iface
,
GUID
*
guid
,
HWND
window
,
DWORD
c
oop
_l
evel
,
DWORD
r
eserved
,
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/ddrawex/main.c
+
40
−
73
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
IDirectDrawF
actory
Impl
*
impl_from_IDirectDrawFactory
(
IDirectDrawFactory
*
iface
)
static
inline
struct
ddrawex_f
actory
*
impl_from_IDirectDrawFactory
(
IDirectDrawFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectDrawF
actory
Impl
,
IDirectDrawFactory_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
ddrawex_f
actory
,
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
),
o
bj
);
TRACE
(
"
iface %p, riid %s, out
%p
.
\n
"
,
iface
,
debugstr_guid
(
riid
),
o
ut
);
if
(
IsEqualGUID
(
riid
,
&
IID_I
Unknown
)
||
IsEqualGUID
(
riid
,
&
IID_I
DirectDrawFactory
))
if
(
IsEqualGUID
(
riid
,
&
IID_I
DirectDrawFactory
)
||
IsEqualGUID
(
riid
,
&
IID_I
Unknown
))
{
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
)->()
incre
menting from
%
d
.
\n
"
,
This
,
ref
-
1
);
TRACE
(
"%p incre
asing 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
)->()
decre
menting from
%
d
.
\n
"
,
This
,
ref
+
1
);
TRACE
(
"%p decre
asing refcount to
%
u
.
\n
"
,
iface
,
refcount
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
count
)
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
return
ref
;
return
ref
count
;
}
static
HRESULT
WINAPI
IDirectDrawF
actory
Impl
_DirectDrawEnumerate
(
IDirectDrawFactory
*
iface
,
static
HRESULT
WINAPI
ddrawex_f
actory_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
=
{
IDirectDrawF
actory
Impl
_QueryInterface
,
IDirectDrawF
actory
Impl
_AddRef
,
IDirectDrawF
actory
Impl
_Release
,
IDirectDrawF
actory
Impl
_CreateDirectDraw
,
IDirectDrawF
actory
Impl
_DirectDrawEnumerate
,
ddrawex_f
actory_QueryInterface
,
ddrawex_f
actory_AddRef
,
ddrawex_f
actory_Release
,
ddrawex_f
actory_CreateDirectDraw
,
ddrawex_f
actory_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
),
o
bj
);
TRACE
(
"
outer_unknown %p, riid %s, out
%p
.
\n
"
,
outer_unknown
,
debugstr_guid
(
r
iid
),
o
ut
);
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
=
&
IDirectDrawF
actory_
V
tbl
;
factory
->
IDirectDrawFactory_iface
.
lpVtbl
=
&
ddrawex_f
actory_
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment