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
7a71a6a8
Commit
7a71a6a8
authored
Oct 28, 2016
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Nov 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Semi-stub IDirectPlay8Client SetClientInfo.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ac5418b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
5 deletions
+118
-5
client.c
dlls/dpnet/client.c
+49
-5
dpnet_private.h
dlls/dpnet/dpnet_private.h
+3
-0
client.c
dlls/dpnet/tests/client.c
+66
-0
No files found.
dlls/dpnet/client.c
View file @
7a71a6a8
...
@@ -86,8 +86,11 @@ static ULONG WINAPI IDirectPlay8ClientImpl_Release(IDirectPlay8Client *iface)
...
@@ -86,8 +86,11 @@ static ULONG WINAPI IDirectPlay8ClientImpl_Release(IDirectPlay8Client *iface)
TRACE
(
"(%p) ref=%u
\n
"
,
This
,
ref
);
TRACE
(
"(%p) ref=%u
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
{
heap_free
(
This
->
username
);
heap_free
(
This
->
data
);
heap_free
(
This
);
}
}
return
ref
;
return
ref
;
}
}
...
@@ -182,9 +185,50 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_SetClientInfo(IDirectPlay8Client *i
...
@@ -182,9 +185,50 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_SetClientInfo(IDirectPlay8Client *i
const
DPN_PLAYER_INFO
*
const
pdpnPlayerInfo
,
void
*
const
pvAsyncContext
,
const
DPN_PLAYER_INFO
*
const
pdpnPlayerInfo
,
void
*
const
pvAsyncContext
,
DPNHANDLE
*
const
phAsyncHandle
,
const
DWORD
dwFlags
)
DPNHANDLE
*
const
phAsyncHandle
,
const
DWORD
dwFlags
)
{
{
IDirectPlay8ClientImpl
*
This
=
impl_from_IDirectPlay8Client
(
iface
);
IDirectPlay8ClientImpl
*
This
=
impl_from_IDirectPlay8Client
(
iface
);
FIXME
(
"(%p):(%p,%p,%x): Stub
\n
"
,
This
,
pvAsyncContext
,
phAsyncHandle
,
dwFlags
);
FIXME
(
"(%p):(%p,%p,%x): Semi-stub.
\n
"
,
This
,
pvAsyncContext
,
phAsyncHandle
,
dwFlags
);
return
DPN_OK
;
if
(
!
pdpnPlayerInfo
)
return
E_POINTER
;
if
(
phAsyncHandle
)
FIXME
(
"Async handle currently not supported.
\n
"
);
if
(
pdpnPlayerInfo
->
dwInfoFlags
&
DPNINFO_NAME
)
{
heap_free
(
This
->
username
);
This
->
username
=
NULL
;
if
(
pdpnPlayerInfo
->
pwszName
)
{
This
->
username
=
heap_strdupW
(
pdpnPlayerInfo
->
pwszName
);
if
(
!
This
->
username
)
return
E_OUTOFMEMORY
;
}
}
if
(
pdpnPlayerInfo
->
dwInfoFlags
&
DPNINFO_DATA
)
{
heap_free
(
This
->
data
);
This
->
data
=
NULL
;
This
->
datasize
=
0
;
if
(
!
pdpnPlayerInfo
->
pvData
&&
pdpnPlayerInfo
->
dwDataSize
)
return
E_POINTER
;
if
(
pdpnPlayerInfo
->
dwDataSize
&&
pdpnPlayerInfo
->
pvData
)
{
This
->
data
=
heap_alloc
(
pdpnPlayerInfo
->
dwDataSize
);
if
(
!
This
->
data
)
return
E_OUTOFMEMORY
;
This
->
datasize
=
pdpnPlayerInfo
->
dwDataSize
;
memcpy
(
This
->
data
,
pdpnPlayerInfo
->
pvData
,
pdpnPlayerInfo
->
dwDataSize
);
}
}
return
DPN_OK
;
}
}
static
HRESULT
WINAPI
IDirectPlay8ClientImpl_GetServerInfo
(
IDirectPlay8Client
*
iface
,
static
HRESULT
WINAPI
IDirectPlay8ClientImpl_GetServerInfo
(
IDirectPlay8Client
*
iface
,
...
...
dlls/dpnet/dpnet_private.h
View file @
7a71a6a8
...
@@ -56,6 +56,9 @@ struct IDirectPlay8ClientImpl
...
@@ -56,6 +56,9 @@ struct IDirectPlay8ClientImpl
PFNDPNMESSAGEHANDLER
msghandler
;
PFNDPNMESSAGEHANDLER
msghandler
;
DWORD
flags
;
DWORD
flags
;
void
*
usercontext
;
void
*
usercontext
;
WCHAR
*
username
;
void
*
data
;
DWORD
datasize
;
DPN_SP_CAPS
spcaps
;
DPN_SP_CAPS
spcaps
;
};
};
...
...
dlls/dpnet/tests/client.c
View file @
7a71a6a8
...
@@ -230,6 +230,71 @@ static void test_lobbyclient(void)
...
@@ -230,6 +230,71 @@ static void test_lobbyclient(void)
}
}
}
}
static
void
test_player_info
(
void
)
{
HRESULT
hr
;
DPN_PLAYER_INFO
info
;
WCHAR
name
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
0
};
WCHAR
name2
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
'2'
,
0
};
WCHAR
data
[]
=
{
'X'
,
'X'
,
'X'
,
'X'
,
0
};
ZeroMemory
(
&
info
,
sizeof
(
DPN_PLAYER_INFO
)
);
info
.
dwSize
=
sizeof
(
DPN_PLAYER_INFO
);
info
.
dwInfoFlags
=
DPNINFO_NAME
;
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
NULL
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
E_POINTER
,
"got %x
\n
"
,
hr
);
info
.
pwszName
=
NULL
;
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
info
.
pwszName
=
name
;
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
info
.
dwInfoFlags
=
DPNINFO_NAME
;
info
.
pwszName
=
name2
;
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
info
.
dwInfoFlags
=
DPNINFO_DATA
;
info
.
pwszName
=
NULL
;
info
.
pvData
=
NULL
;
info
.
dwDataSize
=
sizeof
(
data
);
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
E_POINTER
,
"got %x
\n
"
,
hr
);
info
.
dwInfoFlags
=
DPNINFO_DATA
;
info
.
pwszName
=
NULL
;
info
.
pvData
=
data
;
info
.
dwDataSize
=
0
;
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
info
.
dwInfoFlags
=
DPNINFO_DATA
;
info
.
pwszName
=
NULL
;
info
.
pvData
=
data
;
info
.
dwDataSize
=
sizeof
(
data
);
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
info
.
dwInfoFlags
=
DPNINFO_DATA
|
DPNINFO_NAME
;
info
.
pwszName
=
name
;
info
.
pvData
=
data
;
info
.
dwDataSize
=
sizeof
(
data
);
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
/* Leave ClientInfo with only the name set. */
info
.
dwInfoFlags
=
DPNINFO_DATA
|
DPNINFO_NAME
;
info
.
pwszName
=
name
;
info
.
pvData
=
NULL
;
info
.
dwDataSize
=
0
;
hr
=
IDirectPlay8Client_SetClientInfo
(
client
,
&
info
,
NULL
,
NULL
,
DPNSETCLIENTINFO_SYNC
);
ok
(
hr
==
S_OK
,
"got %x
\n
"
,
hr
);
}
static
void
test_cleanup_dp
(
void
)
static
void
test_cleanup_dp
(
void
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -258,6 +323,7 @@ START_TEST(client)
...
@@ -258,6 +323,7 @@ START_TEST(client)
test_enum_service_providers
();
test_enum_service_providers
();
test_enum_hosts
();
test_enum_hosts
();
test_get_sp_caps
();
test_get_sp_caps
();
test_player_info
();
test_lobbyclient
();
test_lobbyclient
();
test_cleanup_dp
();
test_cleanup_dp
();
}
}
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