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
e5df70ce
Commit
e5df70ce
authored
Sep 05, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Use CRT allocation functions.
parent
e08435a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
protocol.c
dlls/ws2_32/tests/protocol.c
+16
-16
sock.c
dlls/ws2_32/tests/sock.c
+7
-7
No files found.
dlls/ws2_32/tests/protocol.c
View file @
e5df70ce
...
...
@@ -96,7 +96,7 @@ static void test_WSAEnumProtocolsA(void)
error
=
WSAGetLastError
();
ok
(
error
==
WSAENOBUFS
,
"Expected 10055, received %ld
\n
"
,
error
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
buffer
=
malloc
(
len
);
if
(
buffer
)
{
...
...
@@ -113,7 +113,7 @@ static void test_WSAEnumProtocolsA(void)
buffer
[
i
].
dwServiceFlags1
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
}
/* Test invalid protocols in the list */
...
...
@@ -123,7 +123,7 @@ static void test_WSAEnumProtocolsA(void)
ok
(
error
==
WSAENOBUFS
||
broken
(
error
==
WSAEFAULT
)
/* NT4 */
,
"Expected 10055, received %ld
\n
"
,
error
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
buffer
=
malloc
(
len
);
if
(
buffer
)
{
...
...
@@ -141,7 +141,7 @@ static void test_WSAEnumProtocolsA(void)
}
ok
(
found
==
0x0A
,
"Expected 2 bits represented as 0xA, received 0x%x
\n
"
,
found
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
}
}
...
...
@@ -164,7 +164,7 @@ static void test_WSAEnumProtocolsW(void)
error
=
WSAGetLastError
();
ok
(
error
==
WSAENOBUFS
,
"Expected 10055, received %ld
\n
"
,
error
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
buffer
=
malloc
(
len
);
if
(
buffer
)
{
...
...
@@ -181,7 +181,7 @@ static void test_WSAEnumProtocolsW(void)
buffer
[
i
].
dwServiceFlags1
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
}
/* Test invalid protocols in the list */
...
...
@@ -191,7 +191,7 @@ static void test_WSAEnumProtocolsW(void)
ok
(
error
==
WSAENOBUFS
||
broken
(
error
==
WSAEFAULT
)
/* NT4 */
,
"Expected 10055, received %ld
\n
"
,
error
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
buffer
=
malloc
(
len
);
if
(
buffer
)
{
...
...
@@ -209,7 +209,7 @@ static void test_WSAEnumProtocolsW(void)
}
ok
(
found
==
0x0A
,
"Expected 2 bits represented as 0xA, received 0x%x
\n
"
,
found
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
}
}
...
...
@@ -2595,8 +2595,8 @@ static void test_gethostbyname(void)
ret
=
GetIpForwardTable
(
NULL
,
&
route_size
,
FALSE
);
ok
(
ret
==
ERROR_INSUFFICIENT_BUFFER
,
"GetIpForwardTable failed with a different error: %d
\n
"
,
ret
);
adapters
=
HeapAlloc
(
GetProcessHeap
(),
0
,
adap_size
);
routes
=
HeapAlloc
(
GetProcessHeap
(),
0
,
route_size
);
adapters
=
malloc
(
adap_size
);
routes
=
malloc
(
route_size
);
ret
=
GetAdaptersInfo
(
adapters
,
&
adap_size
);
ok
(
ret
==
NO_ERROR
,
"GetAdaptersInfo failed, error: %d
\n
"
,
ret
);
...
...
@@ -2633,8 +2633,8 @@ static void test_gethostbyname(void)
ok
(
found_default
,
"failed to find the first IP from gethostbyname!
\n
"
);
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
adapters
);
HeapFree
(
GetProcessHeap
(),
0
,
routes
);
free
(
adapters
);
free
(
routes
);
}
static
void
test_gethostbyname_hack
(
void
)
...
...
@@ -2792,13 +2792,13 @@ static void test_WSAEnumNameSpaceProvidersA(void)
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %lu
\n
"
,
error
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
name
=
malloc
(
len
);
ret
=
WSAEnumNameSpaceProvidersA
(
&
len
,
name
);
todo_wine
ok
(
ret
>
0
,
"Expected more than zero name space providers
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
free
(
name
);
}
static
void
test_WSAEnumNameSpaceProvidersW
(
void
)
...
...
@@ -2839,7 +2839,7 @@ static void test_WSAEnumNameSpaceProvidersW(void)
todo_wine
ok
(
error
==
WSAEFAULT
,
"Expected 10014, got %lu
\n
"
,
error
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
name
=
malloc
(
len
);
ret
=
WSAEnumNameSpaceProvidersW
(
&
len
,
name
);
todo_wine
...
...
@@ -2868,7 +2868,7 @@ static void test_WSAEnumNameSpaceProvidersW(void)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
name
);
free
(
name
);
}
static
void
test_WSCGetProviderInfo
(
void
)
...
...
dlls/ws2_32/tests/sock.c
View file @
e5df70ce
...
...
@@ -3114,7 +3114,7 @@ static void test_WSASocket(void)
ok
(
err
==
WSAENOBUFS
,
"WSAEnumProtocolsA error is %d, not WSAENOBUFS(%d)
\n
"
,
err
,
WSAENOBUFS
);
pi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pi_size
);
pi
=
malloc
(
pi_size
);
ok
(
pi
!=
NULL
,
"Failed to allocate memory
\n
"
);
items
=
WSAEnumProtocolsA
(
wsaproviders
,
pi
,
&
pi_size
);
...
...
@@ -3123,7 +3123,7 @@ static void test_WSASocket(void)
if
(
items
==
0
)
{
skip
(
"No protocols enumerated.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
pi
);
free
(
pi
);
return
;
}
...
...
@@ -3210,7 +3210,7 @@ static void test_WSASocket(void)
closesocket
(
sock
);
HeapFree
(
GetProcessHeap
(),
0
,
pi
);
free
(
pi
);
pi_size
=
0
;
items
=
WSAEnumProtocolsA
(
NULL
,
NULL
,
&
pi_size
);
...
...
@@ -3220,7 +3220,7 @@ static void test_WSASocket(void)
ok
(
err
==
WSAENOBUFS
,
"WSAEnumProtocolsA error is %d, not WSAENOBUFS(%d)
\n
"
,
err
,
WSAENOBUFS
);
pi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pi_size
);
pi
=
malloc
(
pi_size
);
ok
(
pi
!=
NULL
,
"Failed to allocate memory
\n
"
);
items
=
WSAEnumProtocolsA
(
NULL
,
pi
,
&
pi_size
);
...
...
@@ -3277,7 +3277,7 @@ static void test_WSASocket(void)
closesocket
(
sock
);
}
HeapFree
(
GetProcessHeap
(),
0
,
pi
);
free
(
pi
);
SetLastError
(
0xdeadbeef
);
/* starting on vista the socket function returns error during the socket
...
...
@@ -5944,7 +5944,7 @@ static void test_send(void)
hThread
=
CreateThread
(
NULL
,
0
,
drain_socket_thread
,
&
dst
,
0
,
&
id
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
buflen
);
buffer
=
malloc
(
buflen
);
/* fill the buffer with some nonsense */
for
(
i
=
0
;
i
<
buflen
;
++
i
)
...
...
@@ -6022,7 +6022,7 @@ end:
}
if
(
ov
.
hEvent
)
CloseHandle
(
ov
.
hEvent
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
}
#define WM_SOCKET (WM_USER+100)
...
...
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