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
11756086
Commit
11756086
authored
Sep 04, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Merge the extra struct into IDirectPlaySPImpl.
parent
95fcb495
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
92 deletions
+30
-92
dplaysp.c
dlls/dplayx/dplaysp.c
+30
-92
No files found.
dlls/dplayx/dplaysp.c
View file @
11756086
...
@@ -33,34 +33,16 @@
...
@@ -33,34 +33,16 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dplay
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dplay
);
/* Prototypes */
typedef
struct
IDirectPlaySPImpl
static
BOOL
DPSP_CreateDirectPlaySP
(
void
*
lpSP
,
IDirectPlayImpl
*
dp
);
static
BOOL
DPSP_DestroyDirectPlaySP
(
LPVOID
lpSP
);
/* Predefine the interface */
typedef
struct
IDirectPlaySPImpl
IDirectPlaySPImpl
;
typedef
struct
tagDirectPlaySPData
{
LPVOID
lpSpRemoteData
;
DWORD
dwSpRemoteDataSize
;
/* Size of data pointed to by lpSpRemoteData */
LPVOID
lpSpLocalData
;
DWORD
dwSpLocalDataSize
;
/* Size of data pointed to by lpSpLocalData */
IDirectPlayImpl
*
dplay
;
/* FIXME: This should perhaps be iface not impl */
}
DirectPlaySPData
;
#define DPSP_IMPL_FIELDS \
DirectPlaySPData* sp;
struct
IDirectPlaySPImpl
{
{
const
IDirectPlaySPVtbl
*
lpVtbl
;
const
IDirectPlaySPVtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
DPSP_IMPL_FIELDS
void
*
remote_data
;
};
DWORD
remote_data_size
;
void
*
local_data
;
DWORD
local_data_size
;
IDirectPlayImpl
*
dplay
;
/* FIXME: This should perhaps be iface not impl */
}
IDirectPlaySPImpl
;
/* Forward declaration of virtual tables */
/* Forward declaration of virtual tables */
static
const
IDirectPlaySPVtbl
directPlaySPVT
;
static
const
IDirectPlaySPVtbl
directPlaySPVT
;
...
@@ -92,6 +74,7 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
...
@@ -92,6 +74,7 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
{
{
IDirectPlaySPImpl
*
This
=
*
ppvObj
;
IDirectPlaySPImpl
*
This
=
*
ppvObj
;
This
->
lpVtbl
=
&
directPlaySPVT
;
This
->
lpVtbl
=
&
directPlaySPVT
;
This
->
dplay
=
dp
;
}
}
else
else
{
{
...
@@ -102,49 +85,8 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
...
@@ -102,49 +85,8 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
/* Initialize it */
IDirectPlaySP_AddRef
(
(
LPDIRECTPLAYSP
)
*
ppvObj
);
if
(
DPSP_CreateDirectPlaySP
(
*
ppvObj
,
dp
)
)
return
S_OK
;
{
IDirectPlaySP_AddRef
(
(
LPDIRECTPLAYSP
)
*
ppvObj
);
return
S_OK
;
}
/* Initialize failed, destroy it */
DPSP_DestroyDirectPlaySP
(
*
ppvObj
);
HeapFree
(
GetProcessHeap
(),
0
,
*
ppvObj
);
*
ppvObj
=
NULL
;
return
DPERR_NOMEMORY
;
}
static
BOOL
DPSP_CreateDirectPlaySP
(
void
*
lpSP
,
IDirectPlayImpl
*
dp
)
{
IDirectPlaySPImpl
*
This
=
lpSP
;
This
->
sp
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
(
This
->
sp
)
)
);
if
(
This
->
sp
==
NULL
)
{
return
FALSE
;
}
This
->
sp
->
dplay
=
dp
;
return
TRUE
;
}
static
BOOL
DPSP_DestroyDirectPlaySP
(
LPVOID
lpSP
)
{
IDirectPlaySPImpl
*
This
=
lpSP
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sp
->
lpSpRemoteData
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sp
->
lpSpLocalData
);
/* FIXME: Need to delete player queue */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sp
);
return
TRUE
;
}
}
static
inline
IDirectPlaySPImpl
*
impl_from_IDirectPlaySP
(
IDirectPlaySP
*
iface
)
static
inline
IDirectPlaySPImpl
*
impl_from_IDirectPlaySP
(
IDirectPlaySP
*
iface
)
...
@@ -188,7 +130,8 @@ static ULONG WINAPI IDirectPlaySPImpl_Release( IDirectPlaySP *iface )
...
@@ -188,7 +130,8 @@ static ULONG WINAPI IDirectPlaySPImpl_Release( IDirectPlaySP *iface )
if
(
!
ref
)
if
(
!
ref
)
{
{
DPSP_DestroyDirectPlaySP
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
remote_data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
local_data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
@@ -269,7 +212,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData( IDirectPlaySP *iface, D
...
@@ -269,7 +212,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData( IDirectPlaySP *iface, D
TRACE
(
"(%p)->(0x%08x,%p,%p,0x%08x)
\n
"
,
TRACE
(
"(%p)->(0x%08x,%p,%p,0x%08x)
\n
"
,
This
,
idPlayer
,
lplpData
,
lpdwDataSize
,
dwFlags
);
This
,
idPlayer
,
lplpData
,
lpdwDataSize
,
dwFlags
);
hr
=
DP_GetSPPlayerData
(
This
->
sp
->
dplay
,
idPlayer
,
(
LPVOID
*
)
&
lpPlayerData
);
hr
=
DP_GetSPPlayerData
(
This
->
dplay
,
idPlayer
,
(
void
*
*
)
&
lpPlayerData
);
if
(
FAILED
(
hr
)
)
if
(
FAILED
(
hr
)
)
{
{
...
@@ -336,9 +279,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, voi
...
@@ -336,9 +279,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, voi
data
.
dwMessageSize
=
0
;
data
.
dwMessageSize
=
0
;
/* Pass this message to the dplay interface to handle */
/* Pass this message to the dplay interface to handle */
hr
=
DP_HandleMessage
(
This
->
sp
->
dplay
,
lpMessageBody
,
dwMessageBodySize
,
hr
=
DP_HandleMessage
(
This
->
dplay
,
lpMessageBody
,
dwMessageBodySize
,
lpMessageHeader
,
lpMessageHeader
,
wCommandId
,
wVersion
,
wCommandId
,
wVersion
,
&
data
.
lpMessage
,
&
data
.
dwMessageSize
);
&
data
.
lpMessage
,
&
data
.
dwMessageSize
);
if
(
FAILED
(
hr
)
)
if
(
FAILED
(
hr
)
)
{
{
...
@@ -352,7 +294,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, voi
...
@@ -352,7 +294,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, voi
data
.
idNameServer
=
0
;
data
.
idNameServer
=
0
;
data
.
lpISP
=
iface
;
data
.
lpISP
=
iface
;
hr
=
(
This
->
sp
->
dplay
->
dp2
->
spData
.
lpCB
->
Reply
)
(
&
data
);
hr
=
This
->
dplay
->
dp2
->
spData
.
lpCB
->
Reply
(
&
data
);
if
(
FAILED
(
hr
)
)
if
(
FAILED
(
hr
)
)
{
{
...
@@ -616,7 +558,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, D
...
@@ -616,7 +558,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, D
TRACE
(
"(%p)->(0x%08x,%p,0x%08x,0x%08x)
\n
"
,
This
,
idPlayer
,
lpData
,
dwDataSize
,
dwFlags
);
TRACE
(
"(%p)->(0x%08x,%p,0x%08x,0x%08x)
\n
"
,
This
,
idPlayer
,
lpData
,
dwDataSize
,
dwFlags
);
hr
=
DP_GetSPPlayerData
(
This
->
sp
->
dplay
,
idPlayer
,
(
LPVOID
*
)
&
lpPlayerEntry
);
hr
=
DP_GetSPPlayerData
(
This
->
dplay
,
idPlayer
,
(
void
*
*
)
&
lpPlayerEntry
);
if
(
FAILED
(
hr
)
)
if
(
FAILED
(
hr
)
)
{
{
/* Player must not exist */
/* Player must not exist */
...
@@ -637,7 +579,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, D
...
@@ -637,7 +579,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, D
lpPlayerEntry
->
dwPlayerRemoteDataSize
=
dwDataSize
;
lpPlayerEntry
->
dwPlayerRemoteDataSize
=
dwDataSize
;
}
}
hr
=
DP_SetSPPlayerData
(
This
->
sp
->
dplay
,
idPlayer
,
lpPlayerEntry
);
hr
=
DP_SetSPPlayerData
(
This
->
dplay
,
idPlayer
,
lpPlayerEntry
);
return
hr
;
return
hr
;
}
}
...
@@ -684,23 +626,19 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData( IDirectPlaySP *iface, void **
...
@@ -684,23 +626,19 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData( IDirectPlaySP *iface, void **
/* Yes, we're supposed to return a pointer to the memory we have stored! */
/* Yes, we're supposed to return a pointer to the memory we have stored! */
if
(
dwFlags
==
DPSET_REMOTE
)
if
(
dwFlags
==
DPSET_REMOTE
)
{
{
*
lpdwDataSize
=
This
->
sp
->
dwSpRemoteDataS
ize
;
*
lpdwDataSize
=
This
->
remote_data_s
ize
;
*
lplpData
=
This
->
sp
->
lpSpRemoteD
ata
;
*
lplpData
=
This
->
remote_d
ata
;
if
(
This
->
sp
->
lpSpRemoteData
==
NULL
)
if
(
!
This
->
remote_data
)
{
hr
=
DPERR_GENERIC
;
hr
=
DPERR_GENERIC
;
}
}
}
else
if
(
dwFlags
==
DPSET_LOCAL
)
else
if
(
dwFlags
==
DPSET_LOCAL
)
{
{
*
lpdwDataSize
=
This
->
sp
->
dwSpLocalDataS
ize
;
*
lpdwDataSize
=
This
->
local_data_s
ize
;
*
lplpData
=
This
->
sp
->
lpSpLocalD
ata
;
*
lplpData
=
This
->
local_d
ata
;
if
(
This
->
sp
->
lpSpLocalData
==
NULL
)
if
(
!
This
->
local_data
)
{
hr
=
DPERR_GENERIC
;
hr
=
DPERR_GENERIC
;
}
}
}
return
hr
;
return
hr
;
...
@@ -737,15 +675,15 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData( IDirectPlaySP *iface, void *l
...
@@ -737,15 +675,15 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData( IDirectPlaySP *iface, void *l
/* If we have data already allocated, free it and replace it */
/* If we have data already allocated, free it and replace it */
if
(
dwFlags
==
DPSET_REMOTE
)
if
(
dwFlags
==
DPSET_REMOTE
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sp
->
lpSpRemoteD
ata
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
remote_d
ata
);
This
->
sp
->
dwSpRemoteDataS
ize
=
dwDataSize
;
This
->
remote_data_s
ize
=
dwDataSize
;
This
->
sp
->
lpSpRemoteD
ata
=
lpSpData
;
This
->
remote_d
ata
=
lpSpData
;
}
}
else
if
(
dwFlags
==
DPSET_LOCAL
)
else
if
(
dwFlags
==
DPSET_LOCAL
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sp
->
lpSpLocalD
ata
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
local_d
ata
);
This
->
sp
->
lpSpLocalData
=
lpSpData
;
This
->
local_data
=
lpSpData
;
This
->
sp
->
dwSpLocalDataS
ize
=
dwDataSize
;
This
->
local_data_s
ize
=
dwDataSize
;
}
}
return
DP_OK
;
return
DP_OK
;
...
...
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