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
275364d9
Commit
275364d9
authored
Jun 11, 2015
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Correct adding components in Duplicate.
parent
14706845
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
address.c
dlls/dpnet/address.c
+22
-1
address.c
dlls/dpnet/tests/address.c
+14
-2
No files found.
dlls/dpnet/address.c
View file @
275364d9
...
...
@@ -232,9 +232,30 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_Duplicate(IDirectPlay8Address *ifa
{
struct
component
*
entry
=
This
->
components
[
i
];
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
&
entry
->
data
,
entry
->
size
,
entry
->
type
);
switch
(
entry
->
type
)
{
case
DPNA_DATATYPE_DWORD
:
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
&
entry
->
data
.
value
,
entry
->
size
,
entry
->
type
);
break
;
case
DPNA_DATATYPE_GUID
:
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
&
entry
->
data
.
guid
,
entry
->
size
,
entry
->
type
);
break
;
case
DPNA_DATATYPE_STRING
:
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
entry
->
data
.
string
,
entry
->
size
,
entry
->
type
);
break
;
case
DPNA_DATATYPE_STRING_ANSI
:
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
entry
->
data
.
ansi
,
entry
->
size
,
entry
->
type
);
break
;
case
DPNA_DATATYPE_BINARY
:
hr
=
IDirectPlay8Address_AddComponent
(
dup
,
entry
->
name
,
entry
->
data
.
binary
,
entry
->
size
,
entry
->
type
);
break
;
}
if
(
hr
!=
S_OK
)
{
ERR
(
"Failed to copy component: %s - 0x%08x
\n
"
,
debugstr_w
(
entry
->
name
),
hr
);
break
;
}
}
*
ppdpaNewAddress
=
dup
;
...
...
dlls/dpnet/tests/address.c
View file @
275364d9
...
...
@@ -24,6 +24,7 @@
/* {6733C6E8-A0D6-450E-8C18-CEACF331DC27} */
static
const
GUID
IID_Random
=
{
0x6733c6e8
,
0xa0d6
,
0x450e
,
{
0x8c
,
0x18
,
0xce
,
0xac
,
0xf3
,
0x31
,
0xdc
,
0x27
}
};
static
const
WCHAR
localhost
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
,
0
};
static
void
create_directplay_address
(
void
)
{
...
...
@@ -70,7 +71,6 @@ static void create_directplay_address(void)
static
void
address_addcomponents
(
void
)
{
static
const
WCHAR
UNKNOWN
[]
=
{
'u'
,
'n'
,
'k'
,
'n'
,
'o'
,
'w'
,
'n'
,
0
};
static
const
WCHAR
localhost
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
,
0
};
static
const
char
testing
[]
=
"testing"
;
HRESULT
hr
;
IDirectPlay8Address
*
localaddr
=
NULL
;
...
...
@@ -309,14 +309,20 @@ static void address_duplicate(void)
hr
=
IDirectPlay8Address_SetSP
(
localaddr
,
&
CLSID_DP8SP_TCPIP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_AddComponent
(
localaddr
,
DPNA_KEY_HOSTNAME
,
&
localhost
,
sizeof
(
localhost
),
DPNA_DATATYPE_STRING
);
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
);
ok
(
components
==
2
,
"components=%d
\n
"
,
components
);
hr
=
IDirectPlay8Address_Duplicate
(
localaddr
,
&
duplicate
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
size
,
type
;
WCHAR
buffer
[
256
];
hr
=
IDirectPlay8Address_GetSP
(
duplicate
,
&
guid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
CLSID_DP8SP_TCPIP
),
"wrong guid
\n
"
);
...
...
@@ -325,6 +331,12 @@ static void address_duplicate(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
components
==
dupcomps
,
"expected %d got %d
\n
"
,
components
,
dupcomps
);
size
=
sizeof
(
buffer
);
hr
=
IDirectPlay8Address_GetComponentByName
(
duplicate
,
DPNA_KEY_HOSTNAME
,
buffer
,
&
size
,
&
type
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
type
==
DPNA_DATATYPE_STRING
,
"incorrect type %d
\n
"
,
type
);
ok
(
!
lstrcmpW
(
buffer
,
localhost
),
"Invalid string: %s
\n
"
,
wine_dbgstr_w
(
buffer
));
IDirectPlay8Address_Release
(
duplicate
);
}
...
...
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