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
778757ba
Commit
778757ba
authored
Feb 22, 2011
by
Alexandre Goujon
Committed by
Alexandre Julliard
Feb 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Make gethostbyname fail if WSAStartup was not called before.
parent
f5eb15a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
socket.c
dlls/ws2_32/socket.c
+4
-0
sock.c
dlls/ws2_32/tests/sock.c
+2
-4
No files found.
dlls/ws2_32/socket.c
View file @
778757ba
...
...
@@ -4606,6 +4606,10 @@ struct WS_hostent* WINAPI WS_gethostbyname(const char* name)
int
locerr
=
ENOBUFS
;
#endif
char
hostname
[
100
];
if
(
!
num_startup
)
{
SetLastError
(
WSANOTINITIALISED
);
return
NULL
;
}
if
(
gethostname
(
hostname
,
100
)
==
-
1
)
{
SetLastError
(
WSAENOBUFS
);
/* appropriate ? */
return
retval
;
...
...
dlls/ws2_32/tests/sock.c
View file @
778757ba
...
...
@@ -834,8 +834,6 @@ out:
}
/* Tests for WSAStartup */
/* This should fail. WSAStartup should be called before any network function is used. */
static
void
test_WithoutWSAStartup
(
void
)
{
LPVOID
ptr
;
...
...
@@ -843,8 +841,8 @@ static void test_WithoutWSAStartup(void)
WSASetLastError
(
0xdeadbeef
);
ptr
=
gethostbyname
(
"localhost"
);
todo_wine
ok
(
ptr
==
NULL
,
"gethostbyname() succeeded unexpectedly: %d
\n
"
,
WSAGetLastError
());
todo_wine
ok
(
WSAGetLastError
()
==
WSANOTINITIALISED
,
"gethostbyname() failed with unexpected error: %d
\n
"
,
ok
(
ptr
==
NULL
,
"gethostbyname() succeeded unexpectedly: %d
\n
"
,
WSAGetLastError
());
ok
(
WSAGetLastError
()
==
WSANOTINITIALISED
,
"gethostbyname() failed with unexpected error: %d
\n
"
,
WSAGetLastError
());
}
...
...
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