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
7dcfb9d3
Commit
7dcfb9d3
authored
May 13, 2014
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Sep 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Implement IDirectPlay8Address Duplicate.
parent
0dd5cb1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
3 deletions
+70
-3
address.c
dlls/dpnet/address.c
+30
-3
dpnet_private.h
dlls/dpnet/dpnet_private.h
+1
-0
address.c
dlls/dpnet/tests/address.c
+39
-0
No files found.
dlls/dpnet/address.c
View file @
7dcfb9d3
...
...
@@ -179,9 +179,35 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_BuildFromURLA(IDirectPlay8Address
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_Duplicate
(
IDirectPlay8Address
*
iface
,
IDirectPlay8Address
**
ppdpaNewAddress
)
{
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
TRACE
(
"(%p, %p): stub
\n
"
,
This
,
ppdpaNewAddress
);
return
DPN_OK
;
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
IDirectPlay8Address
*
dup
;
HRESULT
hr
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
ppdpaNewAddress
);
if
(
!
ppdpaNewAddress
)
return
E_POINTER
;
hr
=
DPNET_CreateDirectPlay8Address
(
NULL
,
NULL
,
&
IID_IDirectPlay8Address
,
(
LPVOID
*
)
&
dup
);
if
(
hr
==
S_OK
)
{
IDirectPlay8AddressImpl
*
DupThis
=
impl_from_IDirectPlay8Address
(
dup
);
struct
component
*
entry
;
DupThis
->
SP_guid
=
This
->
SP_guid
;
DupThis
->
init
=
This
->
init
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
components
,
struct
component
,
entry
)
{
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
&
entry
->
data
,
entry
->
size
,
entry
->
type
);
if
(
hr
!=
S_OK
)
ERR
(
"Failed to copy component: %s - 0x%08x
\n
"
,
debugstr_w
(
entry
->
name
),
hr
);
}
*
ppdpaNewAddress
=
dup
;
}
return
hr
;
}
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_SetEqual
(
IDirectPlay8Address
*
iface
,
...
...
@@ -338,6 +364,7 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_AddComponent(IDirectPlay8Address *
list_add_tail
(
&
This
->
components
,
&
entry
->
entry
);
}
entry
->
size
=
dwDataSize
;
switch
(
dwDataType
)
{
case
DPNA_DATATYPE_DWORD
:
...
...
dlls/dpnet/dpnet_private.h
View file @
7dcfb9d3
...
...
@@ -68,6 +68,7 @@ struct component
WCHAR
*
name
;
DWORD
type
;
DWORD
size
;
union
{
...
...
dlls/dpnet/tests/address.c
View file @
7dcfb9d3
...
...
@@ -214,6 +214,44 @@ static void address_setsp(void)
}
}
static
void
address_duplicate
(
void
)
{
HRESULT
hr
;
IDirectPlay8Address
*
localaddr
=
NULL
;
IDirectPlay8Address
*
duplicate
=
NULL
;
DWORD
components
,
dupcomps
;
GUID
guid
=
IID_Random
;
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Address
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay8Address
,
(
LPVOID
*
)
&
localaddr
);
ok
(
hr
==
S_OK
,
"Failed to create IDirectPlay8Address object
\n
"
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirectPlay8Address_SetSP
(
localaddr
,
&
CLSID_DP8SP_TCPIP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetNumComponents
(
localaddr
,
&
components
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
components
==
1
,
"components=%d
\n
"
,
components
);
hr
=
IDirectPlay8Address_Duplicate
(
localaddr
,
&
duplicate
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirectPlay8Address_GetSP
(
duplicate
,
&
guid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
CLSID_DP8SP_TCPIP
),
"wrong guid
\n
"
);
hr
=
IDirectPlay8Address_GetNumComponents
(
duplicate
,
&
dupcomps
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
components
==
dupcomps
,
"expected %d got %d
\n
"
,
components
,
dupcomps
);
IDirectPlay8Address_Release
(
duplicate
);
}
IDirectPlay8Address_Release
(
localaddr
);
}
}
START_TEST
(
address
)
{
HRESULT
hr
;
...
...
@@ -226,6 +264,7 @@ START_TEST(address)
create_directplay_address
();
address_addcomponents
();
address_setsp
();
address_duplicate
();
CoUninitialize
();
}
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