mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 17:06:29 +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
|
@ -220,7 +220,7 @@ gethostbyname(IN const char FAR * name)
|
|||
INT ErrorCode;
|
||||
CHAR ResultsBuffer[RNR_BUFFER_SIZE];
|
||||
PCHAR Results = ResultsBuffer;
|
||||
CHAR szLocalName[200];
|
||||
CHAR szLocalName[MAX_HOSTNAME_LEN];
|
||||
PCHAR pszName;
|
||||
PWSPROCESS Process;
|
||||
PWSTHREAD Thread;
|
||||
|
@ -238,7 +238,7 @@ gethostbyname(IN const char FAR * name)
|
|||
if(!name || !*name)
|
||||
{
|
||||
/* 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;
|
||||
}
|
||||
else
|
||||
|
@ -277,7 +277,7 @@ gethostbyname(IN const char FAR * name)
|
|||
else
|
||||
{
|
||||
/* We failed, so zero it out */
|
||||
Hostent = 0;
|
||||
Hostent = NULL;
|
||||
|
||||
/* Normalize the error message */
|
||||
if(GetLastError() == WSASERVICE_NOT_FOUND)
|
||||
|
|
Loading…
Reference in a new issue