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
a235e863
Commit
a235e863
authored
Sep 29, 2014
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Implement IDirectPlay8Address GetComponentByName.
parent
3cd145f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
7 deletions
+69
-7
address.c
dlls/dpnet/address.c
+49
-4
address.c
dlls/dpnet/tests/address.c
+20
-3
No files found.
dlls/dpnet/address.c
View file @
a235e863
...
@@ -316,9 +316,53 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetNumComponents(IDirectPlay8Addre
...
@@ -316,9 +316,53 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetNumComponents(IDirectPlay8Addre
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_GetComponentByName
(
IDirectPlay8Address
*
iface
,
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_GetComponentByName
(
IDirectPlay8Address
*
iface
,
const
WCHAR
*
const
pwszName
,
void
*
pvBuffer
,
DWORD
*
pdwBufferSize
,
DWORD
*
pdwDataType
)
const
WCHAR
*
const
pwszName
,
void
*
pvBuffer
,
DWORD
*
pdwBufferSize
,
DWORD
*
pdwDataType
)
{
{
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
TRACE
(
"(%p): stub
\n
"
,
This
);
struct
component
*
entry
;
return
DPN_OK
;
TRACE
(
"(%p)->(%p %p %p %p)
\n
"
,
This
,
pwszName
,
pvBuffer
,
pdwBufferSize
,
pdwDataType
);
if
(
!
pwszName
||
!
pdwBufferSize
||
!
pdwDataType
||
(
!
pvBuffer
&&
pdwBufferSize
))
return
E_POINTER
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
components
,
struct
component
,
entry
)
{
if
(
lstrcmpW
(
pwszName
,
entry
->
name
)
==
0
)
{
TRACE
(
"Found %s
\n
"
,
debugstr_w
(
pwszName
));
if
(
*
pdwBufferSize
<
entry
->
size
)
{
*
pdwBufferSize
=
entry
->
size
;
return
DPNERR_BUFFERTOOSMALL
;
}
*
pdwBufferSize
=
entry
->
size
;
*
pdwDataType
=
entry
->
type
;
switch
(
entry
->
type
)
{
case
DPNA_DATATYPE_DWORD
:
memcpy
(
pvBuffer
,
&
entry
->
data
.
value
,
sizeof
(
DWORD
));
break
;
case
DPNA_DATATYPE_GUID
:
memcpy
(
pvBuffer
,
&
entry
->
data
.
guid
,
sizeof
(
GUID
));
break
;
case
DPNA_DATATYPE_STRING
:
memcpy
(
pvBuffer
,
&
entry
->
data
.
string
,
entry
->
size
);
break
;
case
DPNA_DATATYPE_STRING_ANSI
:
memcpy
(
pvBuffer
,
&
entry
->
data
.
ansi
,
entry
->
size
);
break
;
case
DPNA_DATATYPE_BINARY
:
memcpy
(
pvBuffer
,
&
entry
->
data
.
binary
,
entry
->
size
);
break
;
}
return
S_OK
;
}
}
return
DPNERR_DOESNOTEXIST
;
}
}
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_GetComponentByIndex
(
IDirectPlay8Address
*
iface
,
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_GetComponentByIndex
(
IDirectPlay8Address
*
iface
,
...
@@ -364,7 +408,6 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_AddComponent(IDirectPlay8Address *
...
@@ -364,7 +408,6 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_AddComponent(IDirectPlay8Address *
list_add_tail
(
&
This
->
components
,
&
entry
->
entry
);
list_add_tail
(
&
This
->
components
,
&
entry
->
entry
);
}
}
entry
->
size
=
dwDataSize
;
switch
(
dwDataType
)
switch
(
dwDataType
)
{
{
case
DPNA_DATATYPE_DWORD
:
case
DPNA_DATATYPE_DWORD
:
...
@@ -402,6 +445,8 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_AddComponent(IDirectPlay8Address *
...
@@ -402,6 +445,8 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_AddComponent(IDirectPlay8Address *
break
;
break
;
}
}
entry
->
size
=
dwDataSize
;
return
DPN_OK
;
return
DPN_OK
;
}
}
...
...
dlls/dpnet/tests/address.c
View file @
a235e863
...
@@ -102,11 +102,28 @@ static void address_addcomponents(void)
...
@@ -102,11 +102,28 @@ static void address_addcomponents(void)
hr
=
IDirectPlay8Address_AddComponent
(
localaddr
,
DPNA_KEY_PORT
,
&
port
,
sizeof
(
DWORD
),
DPNA_DATATYPE_DWORD
);
hr
=
IDirectPlay8Address_AddComponent
(
localaddr
,
DPNA_KEY_PORT
,
&
port
,
sizeof
(
DWORD
),
DPNA_DATATYPE_DWORD
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
NULL
,
&
compguid
,
&
size
,
&
type
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
UNKNOWN
,
NULL
,
&
size
,
&
type
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
UNKNOWN
,
&
compguid
,
NULL
,
&
type
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
UNKNOWN
,
&
compguid
,
&
size
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
size
=
sizeof
(
GUID
)
-
1
;
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
UNKNOWN
,
&
compguid
,
&
size
,
&
type
);
ok
(
hr
==
DPNERR_BUFFERTOOSMALL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
size
==
sizeof
(
GUID
),
"got %d
\n
"
,
size
);
size
=
sizeof
(
GUID
);
size
=
sizeof
(
GUID
);
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
UNKNOWN
,
&
compguid
,
&
size
,
&
type
);
hr
=
IDirectPlay8Address_GetComponentByName
(
localaddr
,
UNKNOWN
,
&
compguid
,
&
size
,
&
type
);
todo_wine
ok
(
IsEqualGUID
(
&
compguid
,
&
IID_Random
),
"incorrect guid
\n
"
);
ok
(
IsEqualGUID
(
&
compguid
,
&
IID_Random
),
"incorrect guid
\n
"
);
ok
(
size
==
sizeof
(
GUID
),
"incorrect size
\n
"
);
ok
(
size
==
sizeof
(
GUID
),
"incorrect size
got %d
\n
"
,
size
);
todo_wine
ok
(
type
==
DPNA_DATATYPE_GUID
,
"incorrect type
\n
"
);
ok
(
type
==
DPNA_DATATYPE_GUID
,
"incorrect type
\n
"
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetNumComponents
(
localaddr
,
NULL
);
hr
=
IDirectPlay8Address_GetNumComponents
(
localaddr
,
NULL
);
...
...
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