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
c41d2750
Commit
c41d2750
authored
Apr 11, 2014
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Apr 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Improve error checking in Get/Set SP.
parent
daac5b1f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
10 deletions
+103
-10
address.c
dlls/dpnet/address.c
+18
-8
dpnet_private.h
dlls/dpnet/dpnet_private.h
+1
-1
Makefile.in
dlls/dpnet/tests/Makefile.in
+2
-1
address.c
dlls/dpnet/tests/address.c
+82
-0
No files found.
dlls/dpnet/address.c
View file @
c41d2750
...
...
@@ -166,12 +166,18 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetURLA(IDirectPlay8Address *iface
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_GetSP
(
IDirectPlay8Address
*
iface
,
GUID
*
pguidSP
)
{
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pguidSP
);
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pguidSP
);
*
pguidSP
=
This
->
SP_guid
;
return
DPN_OK
;
if
(
!
pguidSP
)
return
DPNERR_INVALIDPOINTER
;
if
(
!
This
->
init
)
return
DPNERR_DOESNOTEXIST
;
*
pguidSP
=
This
->
SP_guid
;
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_GetUserData
(
IDirectPlay8Address
*
iface
,
...
...
@@ -185,12 +191,16 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetUserData(IDirectPlay8Address *i
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_SetSP
(
IDirectPlay8Address
*
iface
,
const
GUID
*
const
pguidSP
)
{
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
IDirectPlay8AddressImpl
*
This
=
impl_from_IDirectPlay8Address
(
iface
);
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_SP
(
pguidSP
));
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_SP
(
pguidSP
));
This
->
SP_guid
=
*
pguidSP
;
return
DPN_OK
;
if
(
!
pguidSP
)
return
DPNERR_INVALIDPOINTER
;
This
->
init
=
TRUE
;
This
->
SP_guid
=
*
pguidSP
;
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8AddressImpl_SetUserData
(
IDirectPlay8Address
*
iface
,
...
...
dlls/dpnet/dpnet_private.h
View file @
c41d2750
...
...
@@ -64,7 +64,7 @@ struct IDirectPlay8AddressImpl
LONG
ref
;
/* IDirectPlay8Address fields */
GUID
SP_guid
;
const
WCHAR
*
url
;
BOOL
init
;
};
/*****************************************************************************
...
...
dlls/dpnet/tests/Makefile.in
View file @
c41d2750
TESTDLL
=
dpnet.dll
IMPORTS
=
d
pnet ole32 dxguid
IMPORTS
=
d
xguid uuid dpnet ole32
C_SRCS
=
\
address.c
\
peer.c
\
server.c
dlls/dpnet/tests/address.c
0 → 100644
View file @
c41d2750
/*
* Copyright 2014 Alistair Leslie-Hughes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define WIN32_LEAN_AND_MEAN
#include <stdio.h>
#include <dplay8.h>
#include "wine/test.h"
/* {6733C6E8-A0D6-450E-8C18-CEACF331DC27} */
static
const
GUID
IID_Random
=
{
0x6733c6e8
,
0xa0d6
,
0x450e
,
{
0x8c
,
0x18
,
0xce
,
0xac
,
0xf3
,
0x31
,
0xdc
,
0x27
}
};
static
void
create_directplay_address
(
void
)
{
HRESULT
hr
;
IDirectPlay8Address
*
localaddr
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Address
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay8Address
,
(
LPVOID
*
)
&
localaddr
);
ok
(
hr
==
S_OK
,
"Failed to create IDirectPlay8Address object"
);
if
(
SUCCEEDED
(
hr
))
{
GUID
guidsp
;
hr
=
IDirectPlay8Address_GetSP
(
localaddr
,
NULL
);
ok
(
hr
==
DPNERR_INVALIDPOINTER
,
"GetSP failed 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetSP
(
localaddr
,
&
guidsp
);
ok
(
hr
==
DPNERR_DOESNOTEXIST
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_SetSP
(
localaddr
,
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetSP
(
localaddr
,
&
guidsp
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guidsp
,
&
GUID_NULL
),
"wrong guid: %s
\n
"
,
wine_dbgstr_guid
(
&
guidsp
));
hr
=
IDirectPlay8Address_SetSP
(
localaddr
,
&
IID_Random
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetSP
(
localaddr
,
&
guidsp
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guidsp
,
&
IID_Random
),
"wrong guid: %s
\n
"
,
wine_dbgstr_guid
(
&
guidsp
));
hr
=
IDirectPlay8Address_SetSP
(
localaddr
,
&
CLSID_DP8SP_TCPIP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_GetSP
(
localaddr
,
&
guidsp
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guidsp
,
&
CLSID_DP8SP_TCPIP
),
"wrong guid: %s
\n
"
,
wine_dbgstr_guid
(
&
guidsp
));
IDirectPlay8Address_Release
(
localaddr
);
}
}
START_TEST
(
address
)
{
HRESULT
hr
;
hr
=
CoInitialize
(
0
);
ok
(
hr
==
S_OK
,
"failed to init com
\n
"
);
if
(
hr
!=
S_OK
)
return
;
create_directplay_address
();
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