Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b7c31354
Commit
b7c31354
authored
Apr 28, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Move namespace provider tests to protocol.c.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8b208093
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
221 additions
and
221 deletions
+221
-221
protocol.c
dlls/ws2_32/tests/protocol.c
+221
-0
sock.c
dlls/ws2_32/tests/sock.c
+0
-221
No files found.
dlls/ws2_32/tests/protocol.c
View file @
b7c31354
...
...
@@ -26,6 +26,7 @@
#include <winbase.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <ws2spi.h>
#include <mswsock.h>
#include <iphlpapi.h>
...
...
@@ -42,6 +43,7 @@ static const char *(WINAPI *p_inet_ntop)(int family, void *addr, char *string, U
static
const
WCHAR
*
(
WINAPI
*
pInetNtopW
)(
int
family
,
void
*
addr
,
WCHAR
*
string
,
ULONG
size
);
static
int
(
WINAPI
*
p_inet_pton
)(
int
family
,
const
char
*
string
,
void
*
addr
);
static
int
(
WINAPI
*
pInetPtonW
)(
int
family
,
WCHAR
*
string
,
void
*
addr
);
static
int
(
WINAPI
*
pWSCGetProviderInfo
)(
GUID
*
provider
,
WSC_PROVIDER_INFO_TYPE
type
,
BYTE
*
info
,
size_t
*
size
,
DWORD
flags
,
INT
*
err
);
/* TCP and UDP over IP fixed set of service flags */
#define TCPIP_SERVICE_FLAGS (XP1_GUARANTEED_DELIVERY \
...
...
@@ -2281,6 +2283,219 @@ static void test_GetHostNameW(void)
ok
(
ret
==
0
,
"GetHostNameW() call failed: %d
\n
"
,
WSAGetLastError
());
}
static
void
test_WSAEnumNameSpaceProvidersA
(
void
)
{
WSANAMESPACE_INFOA
*
name
=
NULL
;
DWORD
ret
,
error
,
len
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
len
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
/* Invalid parameter tests */
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
NULL
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
NULL
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
len
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
len
,
name
);
todo_wine
ok
(
ret
>
0
,
"Expected more than zero name space providers
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
static
void
test_WSAEnumNameSpaceProvidersW
(
void
)
{
WSANAMESPACE_INFOW
*
name
=
NULL
;
DWORD
ret
,
error
,
len
=
0
,
i
;
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
len
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
/* Invalid parameter tests */
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
NULL
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
NULL
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
len
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
len
,
name
);
todo_wine
ok
(
ret
>
0
,
"Expected more than zero name space providers
\n
"
);
if
(
winetest_debug
>
1
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
trace
(
"Name space Identifier (%p): %s
\n
"
,
name
[
i
].
lpszIdentifier
,
wine_dbgstr_w
(
name
[
i
].
lpszIdentifier
));
switch
(
name
[
i
].
dwNameSpace
)
{
case
NS_DNS
:
trace
(
"
\t
Name space ID: NS_DNS (%u)
\n
"
,
name
[
i
].
dwNameSpace
);
break
;
case
NS_NLA
:
trace
(
"
\t
Name space ID: NS_NLA (%u)
\n
"
,
name
[
i
].
dwNameSpace
);
break
;
default:
trace
(
"
\t
Name space ID: Unknown (%u)
\n
"
,
name
[
i
].
dwNameSpace
);
break
;
}
trace
(
"
\t
Active: %d
\n
"
,
name
[
i
].
fActive
);
trace
(
"
\t
Version: %d
\n
"
,
name
[
i
].
dwVersion
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
static
void
test_WSCGetProviderInfo
(
void
)
{
int
ret
;
int
errcode
;
GUID
provider
=
{
0
};
BYTE
info
[
1
];
size_t
len
=
0
;
if
(
!
pWSCGetProviderInfo
)
{
skip
(
"WSCGetProviderInfo is not available.
\n
"
);
return
;
}
ret
=
pWSCGetProviderInfo
(
NULL
,
-
1
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
NULL
,
ProviderInfoLspCategories
,
info
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSAEFAULT
,
"got %d, expected WSAEFAULT
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
-
1
,
info
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
ProviderInfoLspCategories
,
NULL
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
ProviderInfoLspCategories
,
info
,
NULL
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
ProviderInfoLspCategories
,
info
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
}
static
void
test_WSCGetProviderPath
(
void
)
{
GUID
provider
=
{
0
};
WCHAR
buffer
[
256
];
INT
ret
,
err
,
len
;
ret
=
WSCGetProviderPath
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ret
=
WSCGetProviderPath
(
NULL
,
buffer
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
len
=
-
1
;
ret
=
WSCGetProviderPath
(
NULL
,
NULL
,
&
len
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
len
==
-
1
,
"Got unexpected len %d.
\n
"
,
len
);
err
=
0
;
ret
=
WSCGetProviderPath
(
NULL
,
NULL
,
NULL
,
&
err
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
err
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
err
);
err
=
0
;
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
NULL
,
&
err
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
err
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
err
);
err
=
0
;
len
=
-
1
;
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
&
len
,
&
err
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
err
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
err
);
ok
(
len
==
-
1
,
"Got unexpected len %d.
\n
"
,
len
);
err
=
0
;
len
=
256
;
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
&
len
,
&
err
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
todo_wine
ok
(
err
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
err
);
ok
(
len
==
256
,
"Got unexpected len %d.
\n
"
,
len
);
/* Valid pointers and length but invalid GUID */
err
=
0
;
len
=
256
;
ret
=
WSCGetProviderPath
(
&
provider
,
buffer
,
&
len
,
&
err
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
todo_wine
ok
(
err
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
err
);
ok
(
len
==
256
,
"Got unexpected len %d.
\n
"
,
len
);
}
START_TEST
(
protocol
)
{
WSADATA
data
;
...
...
@@ -2294,6 +2509,7 @@ START_TEST( protocol )
pInetNtopW
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ws2_32"
),
"InetNtopW"
);
p_inet_pton
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ws2_32"
),
"inet_pton"
);
pInetPtonW
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ws2_32"
),
"InetPtonW"
);
pWSCGetProviderInfo
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ws2_32"
),
"WSCGetProviderInfo"
);
if
(
WSAStartup
(
version
,
&
data
))
return
;
...
...
@@ -2323,4 +2539,9 @@ START_TEST( protocol )
test_gethostbyname_hack
();
test_gethostname
();
test_GetHostNameW
();
test_WSAEnumNameSpaceProvidersA
();
test_WSAEnumNameSpaceProvidersW
();
test_WSCGetProviderInfo
();
test_WSCGetProviderPath
();
}
dlls/ws2_32/tests/sock.c
View file @
b7c31354
...
...
@@ -27,7 +27,6 @@
#include <windows.h>
#include <winternl.h>
#include <ws2tcpip.h>
#include <ws2spi.h>
#include <wsipx.h>
#include <wsnwlink.h>
#include <mswsock.h>
...
...
@@ -62,7 +61,6 @@
/* Function pointers */
static
int
(
WINAPI
*
pWSAPoll
)(
WSAPOLLFD
*
,
ULONG
,
INT
);
static
int
(
WINAPI
*
pWSCGetProviderInfo
)(
LPGUID
,
WSC_PROVIDER_INFO_TYPE
,
PBYTE
,
size_t
*
,
DWORD
,
LPINT
);
/* Function pointers from ntdll */
static
DWORD
(
WINAPI
*
pNtClose
)(
HANDLE
);
...
...
@@ -1091,7 +1089,6 @@ static void Init (void)
HMODULE
hws2_32
=
GetModuleHandleA
(
"ws2_32.dll"
),
ntdll
;
pWSAPoll
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSAPoll"
);
pWSCGetProviderInfo
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSCGetProviderInfo"
);
ntdll
=
LoadLibraryA
(
"ntdll.dll"
);
if
(
ntdll
)
...
...
@@ -7689,123 +7686,6 @@ static void test_address_list_query(void)
closesocket
(
s
);
}
static
void
test_WSAEnumNameSpaceProvidersA
(
void
)
{
LPWSANAMESPACE_INFOA
name
=
NULL
;
DWORD
ret
,
error
,
blen
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
blen
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
/* Invalid parameter tests */
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
NULL
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
NULL
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
blen
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
blen
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
blen
,
name
);
todo_wine
ok
(
ret
>
0
,
"Expected more than zero name space providers
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
static
void
test_WSAEnumNameSpaceProvidersW
(
void
)
{
LPWSANAMESPACE_INFOW
name
=
NULL
;
DWORD
ret
,
error
,
blen
=
0
,
i
;
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
blen
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
/* Invalid parameter tests */
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
NULL
,
name
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
NULL
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
blen
,
NULL
);
error
=
WSAGetLastError
();
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Expected failure, got %u
\n
"
,
ret
);
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %u
\n
"
,
error
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
blen
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
blen
,
name
);
todo_wine
ok
(
ret
>
0
,
"Expected more than zero name space providers
\n
"
);
if
(
winetest_debug
>
1
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
trace
(
"Name space Identifier (%p): %s
\n
"
,
name
[
i
].
lpszIdentifier
,
wine_dbgstr_w
(
name
[
i
].
lpszIdentifier
));
switch
(
name
[
i
].
dwNameSpace
)
{
case
NS_DNS
:
trace
(
"
\t
Name space ID: NS_DNS (%u)
\n
"
,
name
[
i
].
dwNameSpace
);
break
;
case
NS_NLA
:
trace
(
"
\t
Name space ID: NS_NLA (%u)
\n
"
,
name
[
i
].
dwNameSpace
);
break
;
default:
trace
(
"
\t
Name space ID: Unknown (%u)
\n
"
,
name
[
i
].
dwNameSpace
);
break
;
}
trace
(
"
\t
Active: %d
\n
"
,
name
[
i
].
fActive
);
trace
(
"
\t
Version: %d
\n
"
,
name
[
i
].
dwVersion
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
static
void
sync_read
(
SOCKET
src
,
SOCKET
dst
)
{
int
ret
;
...
...
@@ -8438,101 +8318,6 @@ static void test_iocp(void)
closesocket
(
dst
);
}
static
void
test_WSCGetProviderInfo
(
void
)
{
int
ret
;
int
errcode
;
GUID
provider
=
{};
char
info
[
1
];
size_t
len
=
0
;
if
(
!
pWSCGetProviderInfo
)
{
skip
(
"WSCGetProviderInfo is not available.
\n
"
);
return
;
}
ret
=
pWSCGetProviderInfo
(
NULL
,
-
1
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
NULL
,
ProviderInfoLspCategories
,
(
PBYTE
)
&
info
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSAEFAULT
,
"got %d, expected WSAEFAULT
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
-
1
,
(
PBYTE
)
&
info
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
ProviderInfoLspCategories
,
NULL
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
ProviderInfoLspCategories
,
(
PBYTE
)
&
info
,
NULL
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
errcode
=
0xdeadbeef
;
ret
=
pWSCGetProviderInfo
(
&
provider
,
ProviderInfoLspCategories
,
(
PBYTE
)
&
info
,
&
len
,
0
,
&
errcode
);
ok
(
ret
==
SOCKET_ERROR
,
"got %d, expected SOCKET_ERROR
\n
"
,
ret
);
ok
(
errcode
==
WSANO_RECOVERY
,
"got %d, expected WSANO_RECOVERY
\n
"
,
errcode
);
}
static
void
test_WSCGetProviderPath
(
void
)
{
GUID
provider
=
{};
WCHAR
buffer
[
256
];
INT
ret
,
err
,
len
;
ret
=
WSCGetProviderPath
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ret
=
WSCGetProviderPath
(
NULL
,
buffer
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
len
=
-
1
;
ret
=
WSCGetProviderPath
(
NULL
,
NULL
,
&
len
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
len
==
-
1
,
"Got unexpected len %d.
\n
"
,
len
);
err
=
0
;
ret
=
WSCGetProviderPath
(
NULL
,
NULL
,
NULL
,
&
err
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
err
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
err
);
err
=
0
;
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
NULL
,
&
err
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
err
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
err
);
err
=
0
;
len
=
-
1
;
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
&
len
,
&
err
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
err
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
err
);
ok
(
len
==
-
1
,
"Got unexpected len %d.
\n
"
,
len
);
err
=
0
;
len
=
256
;
ret
=
WSCGetProviderPath
(
&
provider
,
NULL
,
&
len
,
&
err
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
todo_wine
ok
(
err
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
err
);
ok
(
len
==
256
,
"Got unexpected len %d.
\n
"
,
len
);
/* Valid pointers and length but invalid GUID */
err
=
0
;
len
=
256
;
ret
=
WSCGetProviderPath
(
&
provider
,
buffer
,
&
len
,
&
err
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
todo_wine
ok
(
err
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
err
);
ok
(
len
==
256
,
"Got unexpected len %d.
\n
"
,
len
);
}
static
void
test_wsaioctl
(
void
)
{
unsigned
int
i
,
count
;
...
...
@@ -8640,15 +8425,9 @@ START_TEST( sock )
test_sioRoutingInterfaceQuery
();
test_sioAddressListChange
();
test_WSAEnumNameSpaceProvidersA
();
test_WSAEnumNameSpaceProvidersW
();
test_completion_port
();
test_address_list_query
();
test_WSCGetProviderInfo
();
test_WSCGetProviderPath
();
/* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send
();
test_synchronous_WSAIoctl
();
...
...
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