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
70be64b2
Commit
70be64b2
authored
Mar 23, 2012
by
Bruno Jesus
Committed by
Alexandre Julliard
Mar 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Handle NULL proto in WSAAsyncGetServByName.
parent
ece5d712
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
async.c
dlls/ws2_32/async.c
+11
-3
sock.c
dlls/ws2_32/tests/sock.c
+28
-0
No files found.
dlls/ws2_32/async.c
View file @
70be64b2
...
@@ -384,7 +384,7 @@ HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name,
...
@@ -384,7 +384,7 @@ HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name,
{
{
struct
async_query_getservbyname
*
aq
;
struct
async_query_getservbyname
*
aq
;
unsigned
int
len1
=
strlen
(
name
)
+
1
;
unsigned
int
len1
=
strlen
(
name
)
+
1
;
unsigned
int
len2
=
strlen
(
proto
)
+
1
;
unsigned
int
len2
=
proto
?
strlen
(
proto
)
+
1
:
0
;
TRACE
(
"hwnd %p, msg %04x, name %s, proto %s
\n
"
,
hWnd
,
uMsg
,
debugstr_a
(
name
),
debugstr_a
(
proto
));
TRACE
(
"hwnd %p, msg %04x, name %s, proto %s
\n
"
,
hWnd
,
uMsg
,
debugstr_a
(
name
),
debugstr_a
(
proto
));
...
@@ -393,10 +393,18 @@ HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name,
...
@@ -393,10 +393,18 @@ HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name,
SetLastError
(
WSAEWOULDBLOCK
);
SetLastError
(
WSAEWOULDBLOCK
);
return
0
;
return
0
;
}
}
aq
->
serv_name
=
(
char
*
)(
aq
+
1
);
aq
->
serv_name
=
(
char
*
)(
aq
+
1
);
aq
->
serv_proto
=
aq
->
serv_name
+
len1
;
strcpy
(
aq
->
serv_name
,
name
);
strcpy
(
aq
->
serv_name
,
name
);
strcpy
(
aq
->
serv_proto
,
proto
);
if
(
proto
)
{
aq
->
serv_proto
=
aq
->
serv_name
+
len1
;
strcpy
(
aq
->
serv_proto
,
proto
);
}
else
aq
->
serv_proto
=
NULL
;
return
run_query
(
hWnd
,
uMsg
,
async_getservbyname
,
&
aq
->
query
,
sbuf
,
buflen
);
return
run_query
(
hWnd
,
uMsg
,
async_getservbyname
,
&
aq
->
query
,
sbuf
,
buflen
);
}
}
...
...
dlls/ws2_32/tests/sock.c
View file @
70be64b2
...
@@ -5203,6 +5203,33 @@ static void test_WSAAsyncGetServByPort(void)
...
@@ -5203,6 +5203,33 @@ static void test_WSAAsyncGetServByPort(void)
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
}
}
static
void
test_WSAAsyncGetServByName
(
void
)
{
HWND
hwnd
=
create_async_message_window
();
HANDLE
ret
;
char
buffer
[
MAXGETHOSTSTRUCT
];
if
(
!
hwnd
)
return
;
/* FIXME: The asynchronous window messages should be tested. */
/* Parameters are not checked when initiating the asynchronous operation. */
ret
=
WSAAsyncGetServByName
(
hwnd
,
WM_ASYNCCOMPLETE
,
""
,
NULL
,
NULL
,
0
);
ok
(
ret
!=
NULL
,
"WSAAsyncGetServByName returned NULL
\n
"
);
ret
=
WSAAsyncGetServByName
(
hwnd
,
WM_ASYNCCOMPLETE
,
""
,
""
,
buffer
,
MAXGETHOSTSTRUCT
);
ok
(
ret
!=
NULL
,
"WSAAsyncGetServByName returned NULL
\n
"
);
ret
=
WSAAsyncGetServByName
(
hwnd
,
WM_ASYNCCOMPLETE
,
"http"
,
NULL
,
NULL
,
0
);
ok
(
ret
!=
NULL
,
"WSAAsyncGetServByName returned NULL
\n
"
);
ret
=
WSAAsyncGetServByName
(
hwnd
,
WM_ASYNCCOMPLETE
,
"http"
,
"tcp"
,
buffer
,
MAXGETHOSTSTRUCT
);
ok
(
ret
!=
NULL
,
"WSAAsyncGetServByName returned NULL
\n
"
);
DestroyWindow
(
hwnd
);
}
static
void
test_completion_port
(
void
)
static
void
test_completion_port
(
void
)
{
{
HANDLE
previous_port
,
io_port
;
HANDLE
previous_port
,
io_port
;
...
@@ -5770,6 +5797,7 @@ START_TEST( sock )
...
@@ -5770,6 +5797,7 @@ START_TEST( sock )
test_sioRoutingInterfaceQuery
();
test_sioRoutingInterfaceQuery
();
test_WSAAsyncGetServByPort
();
test_WSAAsyncGetServByPort
();
test_WSAAsyncGetServByName
();
test_completion_port
();
test_completion_port
();
...
...
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