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
30c55f35
Commit
30c55f35
authored
Sep 03, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Simplify the creation of a IDPLobbySPImpl COM object.
parent
56e1e6aa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
37 deletions
+24
-37
dplay.c
dlls/dplayx/dplay.c
+1
-2
dplay_global.h
dlls/dplayx/dplay_global.h
+1
-1
lobbysp.c
dlls/dplayx/lobbysp.c
+22
-34
No files found.
dlls/dplayx/dplay.c
View file @
30c55f35
...
...
@@ -187,8 +187,7 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP )
sizeof
(
*
This
->
dp2
->
dplspData
.
lpCB
)
);
This
->
dp2
->
dplspData
.
lpCB
->
dwSize
=
sizeof
(
*
This
->
dp2
->
dplspData
.
lpCB
);
if
(
FAILED
(
DPLSP_CreateInterface
(
&
IID_IDPLobbySP
,
(
LPVOID
*
)
&
This
->
dp2
->
dplspData
.
lpISP
,
This
)
)
if
(
FAILED
(
dplobbysp_create
(
&
IID_IDPLobbySP
,
(
void
**
)
&
This
->
dp2
->
dplspData
.
lpISP
,
This
)
)
)
{
/* FIXME: Memory leak */
...
...
dlls/dplayx/dplay_global.h
View file @
30c55f35
...
...
@@ -209,6 +209,6 @@ 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
DPLSP_CreateInterface
(
REFIID
riid
,
void
**
ppvObj
,
IDirectPlayImpl
*
dp
)
DECLSPEC_HIDDEN
;
extern
HRESULT
dplobbysp_create
(
REFIID
riid
,
void
**
ppv
,
IDirectPlayImpl
*
dp
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_DPLAY_GLOBAL_INCLUDED */
dlls/dplayx/lobbysp.c
View file @
30c55f35
...
...
@@ -38,40 +38,6 @@ static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface)
return
CONTAINING_RECORD
(
iface
,
IDPLobbySPImpl
,
IDPLobbySP_iface
);
}
/* Forward declaration of virtual tables */
static
const
IDPLobbySPVtbl
dpLobbySPVT
;
HRESULT
DPLSP_CreateInterface
(
REFIID
riid
,
void
**
ppvObj
,
IDirectPlayImpl
*
dp
)
{
TRACE
(
" for %s
\n
"
,
debugstr_guid
(
riid
)
);
*
ppvObj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDPLobbySPImpl
)
);
if
(
*
ppvObj
==
NULL
)
{
return
DPERR_OUTOFMEMORY
;
}
if
(
IsEqualGUID
(
&
IID_IDPLobbySP
,
riid
)
)
{
IDPLobbySPImpl
*
This
=
*
ppvObj
;
This
->
IDPLobbySP_iface
.
lpVtbl
=
&
dpLobbySPVT
;
This
->
dplay
=
dp
;
}
else
{
/* Unsupported interface */
HeapFree
(
GetProcessHeap
(),
0
,
*
ppvObj
);
*
ppvObj
=
NULL
;
return
E_NOINTERFACE
;
}
IDPLobbySP_AddRef
(
(
LPDPLOBBYSP
)
*
ppvObj
);
return
S_OK
;
}
static
HRESULT
WINAPI
IDPLobbySPImpl_QueryInterface
(
IDPLobbySP
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
@@ -260,3 +226,25 @@ static const IDPLobbySPVtbl dpLobbySPVT =
IDPLobbySPImpl_SetSPDataPointer
,
IDPLobbySPImpl_StartSession
};
HRESULT
dplobbysp_create
(
REFIID
riid
,
void
**
ppv
,
IDirectPlayImpl
*
dp
)
{
IDPLobbySPImpl
*
obj
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
obj
)
);
if
(
!
obj
)
return
DPERR_OUTOFMEMORY
;
obj
->
IDPLobbySP_iface
.
lpVtbl
=
&
dpLobbySPVT
;
obj
->
ref
=
0
;
obj
->
dplay
=
dp
;
hr
=
IDPLobbySP_QueryInterface
(
&
obj
->
IDPLobbySP_iface
,
riid
,
ppv
);
IDPLobbySP_Release
(
&
obj
->
IDPLobbySP_iface
);
return
hr
;
}
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