mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 23:31:22 +00:00
[WS2_32_NEW] Properly handle szLocalName. Properly set Hostent on failure. By Peter Hater. CORE-10440
svn path=/trunk/; revision=69807
This commit is contained in:
parent
2ae0399eb9
commit
dea5974e8c
1 changed files with 3 additions and 3 deletions
|
@ -220,7 +220,7 @@ gethostbyname(IN const char FAR * name)
|
||||||
INT ErrorCode;
|
INT ErrorCode;
|
||||||
CHAR ResultsBuffer[RNR_BUFFER_SIZE];
|
CHAR ResultsBuffer[RNR_BUFFER_SIZE];
|
||||||
PCHAR Results = ResultsBuffer;
|
PCHAR Results = ResultsBuffer;
|
||||||
CHAR szLocalName[200];
|
CHAR szLocalName[MAX_HOSTNAME_LEN];
|
||||||
PCHAR pszName;
|
PCHAR pszName;
|
||||||
PWSPROCESS Process;
|
PWSPROCESS Process;
|
||||||
PWSTHREAD Thread;
|
PWSTHREAD Thread;
|
||||||
|
@ -238,7 +238,7 @@ gethostbyname(IN const char FAR * name)
|
||||||
if(!name || !*name)
|
if(!name || !*name)
|
||||||
{
|
{
|
||||||
/* This means we should do a local lookup first */
|
/* This means we should do a local lookup first */
|
||||||
if(gethostname(szLocalName, 200) != NO_ERROR) return(NULL);
|
if(gethostname(szLocalName, MAX_HOSTNAME_LEN) != NO_ERROR) return(NULL);
|
||||||
pszName = szLocalName;
|
pszName = szLocalName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -277,7 +277,7 @@ gethostbyname(IN const char FAR * name)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We failed, so zero it out */
|
/* We failed, so zero it out */
|
||||||
Hostent = 0;
|
Hostent = NULL;
|
||||||
|
|
||||||
/* Normalize the error message */
|
/* Normalize the error message */
|
||||||
if(GetLastError() == WSASERVICE_NOT_FOUND)
|
if(GetLastError() == WSASERVICE_NOT_FOUND)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue