Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b80ab335
Commit
b80ab335
authored
Sep 05, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Simplify the creation of an IDirectPlaySPImpl object.
parent
a3ba1b8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
38 deletions
+23
-38
dplay.c
dlls/dplayx/dplay.c
+1
-3
dplay_global.h
dlls/dplayx/dplay_global.h
+1
-1
dplaysp.c
dlls/dplayx/dplaysp.c
+21
-34
No files found.
dlls/dplayx/dplay.c
View file @
b80ab335
...
...
@@ -173,9 +173,7 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP )
This
->
dp2
->
spData
.
lpCB
->
dwVersion
=
DPSP_MAJORVERSION
;
/* This is the pointer to the service provider */
if
(
FAILED
(
DPSP_CreateInterface
(
&
IID_IDirectPlaySP
,
(
LPVOID
*
)
&
This
->
dp2
->
spData
.
lpISP
,
This
)
)
)
if
(
FAILED
(
dplaysp_create
(
&
IID_IDirectPlaySP
,
(
void
**
)
&
This
->
dp2
->
spData
.
lpISP
,
This
)
)
)
{
/* FIXME: Memory leak */
return
FALSE
;
...
...
dlls/dplayx/dplay_global.h
View file @
b80ab335
...
...
@@ -208,7 +208,7 @@ extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
extern
HRESULT
dplay_create
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
dplobby_create
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DPSP_CreateInterface
(
REFIID
riid
,
void
**
ppvObj
,
IDirectPlayImpl
*
dp
)
DECLSPEC_HIDDEN
;
extern
HRESULT
dplaysp_create
(
REFIID
riid
,
void
**
ppv
,
IDirectPlayImpl
*
dp
)
DECLSPEC_HIDDEN
;
extern
HRESULT
dplobbysp_create
(
REFIID
riid
,
void
**
ppv
,
IDirectPlayImpl
*
dp
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_DPLAY_GLOBAL_INCLUDED */
dlls/dplayx/dplaysp.c
View file @
b80ab335
...
...
@@ -44,9 +44,6 @@ typedef struct IDirectPlaySPImpl
IDirectPlayImpl
*
dplay
;
/* FIXME: This should perhaps be iface not impl */
}
IDirectPlaySPImpl
;
/* Forward declaration of virtual tables */
static
const
IDirectPlaySPVtbl
directPlaySPVT
;
/* This structure is passed to the DP object for safe keeping */
typedef
struct
tagDP_SPPLAYERDATA
{
...
...
@@ -57,37 +54,6 @@ typedef struct tagDP_SPPLAYERDATA
DWORD
dwPlayerRemoteDataSize
;
}
DP_SPPLAYERDATA
,
*
LPDP_SPPLAYERDATA
;
/* Create the SP interface */
HRESULT
DPSP_CreateInterface
(
REFIID
riid
,
void
**
ppvObj
,
IDirectPlayImpl
*
dp
)
{
TRACE
(
" for %s
\n
"
,
debugstr_guid
(
riid
)
);
*
ppvObj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectPlaySPImpl
)
);
if
(
*
ppvObj
==
NULL
)
{
return
DPERR_OUTOFMEMORY
;
}
if
(
IsEqualGUID
(
&
IID_IDirectPlaySP
,
riid
)
)
{
IDirectPlaySPImpl
*
This
=
*
ppvObj
;
This
->
IDirectPlaySP_iface
.
lpVtbl
=
&
directPlaySPVT
;
This
->
dplay
=
dp
;
}
else
{
/* Unsupported interface */
HeapFree
(
GetProcessHeap
(),
0
,
*
ppvObj
);
*
ppvObj
=
NULL
;
return
E_NOINTERFACE
;
}
IDirectPlaySP_AddRef
(
(
LPDIRECTPLAYSP
)
*
ppvObj
);
return
S_OK
;
}
static
inline
IDirectPlaySPImpl
*
impl_from_IDirectPlaySP
(
IDirectPlaySP
*
iface
)
{
...
...
@@ -717,6 +683,27 @@ static const IDirectPlaySPVtbl directPlaySPVT =
IDirectPlaySPImpl_SendComplete
};
HRESULT
dplaysp_create
(
REFIID
riid
,
void
**
ppv
,
IDirectPlayImpl
*
dp
)
{
IDirectPlaySPImpl
*
obj
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
)
);
if
(
!
obj
)
return
DPERR_OUTOFMEMORY
;
obj
->
IDirectPlaySP_iface
.
lpVtbl
=
&
directPlaySPVT
;
obj
->
ref
=
1
;
obj
->
dplay
=
dp
;
hr
=
IDirectPlaySP_QueryInterface
(
&
obj
->
IDirectPlaySP_iface
,
riid
,
ppv
);
IDirectPlaySP_Release
(
&
obj
->
IDirectPlaySP_iface
);
return
hr
;
}
/* DP external interfaces to call into DPSP interface */
...
...
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