diff --git a/dll/win32/ws2_32/inc/ws2_32p.h b/dll/win32/ws2_32/inc/ws2_32p.h index 5f1c748b97e..1f46cc79e2b 100644 --- a/dll/win32/ws2_32/inc/ws2_32p.h +++ b/dll/win32/ws2_32/inc/ws2_32p.h @@ -423,7 +423,7 @@ WsNcEnumerateCatalogItems(IN PNSCATALOG Catalog, INT WSAAPI WsNcGetServiceClassInfo(IN PNSCATALOG Catalog, - IN OUT LPDWORD BugSize, + IN OUT LPDWORD BufSize, IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo); PNSCATALOG_ENTRY diff --git a/dll/win32/ws2_32/src/addrconv.c b/dll/win32/ws2_32/src/addrconv.c index fa459a073f3..2b454dcd760 100644 --- a/dll/win32/ws2_32/src/addrconv.c +++ b/dll/win32/ws2_32/src/addrconv.c @@ -73,6 +73,9 @@ inet_addr(IN CONST CHAR FAR* cp) register u_long val, base, n; register unsigned char c; u_long parts[4], *pp = parts; + + DPRINT("inet_addr: %s\n", cp); + if (!cp) return INADDR_ANY; if (!isdigit(*cp)) return INADDR_NONE; diff --git a/dll/win32/ws2_32/src/getxbyxx.c b/dll/win32/ws2_32/src/getxbyxx.c index 8f559346222..f49bedba152 100644 --- a/dll/win32/ws2_32/src/getxbyxx.c +++ b/dll/win32/ws2_32/src/getxbyxx.c @@ -310,7 +310,7 @@ gethostbyaddr(IN const char FAR * addr, IN int len, IN int type) { - CHAR AddressBuffer[100]; + CHAR AddressBuffer[100] = { 0 }; PHOSTENT Hostent; LPBLOB Blob; CHAR ResultsBuffer[RNR_BUFFER_SIZE]; @@ -318,7 +318,11 @@ gethostbyaddr(IN const char FAR * addr, PWSPROCESS Process; PWSTHREAD Thread; INT ErrorCode; - DPRINT("gethostbyaddr: %s\n", addr); + BYTE Buf[4] = { 0 }; + + memcpy(Buf, addr, 4); + DPRINT("gethostbyaddr: 0x%02x%02x%02x%02x, len %d, type %d\n", + Buf[0], Buf[1], Buf[2], Buf[3], len, type); /* Enter prolog */ if ((ErrorCode = WsApiProlog(&Process, &Thread)) != ERROR_SUCCESS) @@ -372,6 +376,34 @@ gethostbyaddr(IN const char FAR * addr, } else { + /* HACK FIXME: Currently returning Blob above fails due + * to an unimplemented function. We can handle two common + * requests which are for the Loop Back adapter and the + * first network cards IP address using this for now. */ + CHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD NameSize = ARRAYSIZE(ComputerName); + struct hostent *host_entry; + BYTE LoopBackAdapter[4] = {0x7f, 0, 0, 1}; + + GetComputerNameA(ComputerName, &NameSize); + host_entry = gethostbyname(ComputerName); + + if (host_entry == NULL) + DPRINT1("Error getting host entry\n"); + + if (memcmp(addr, LoopBackAdapter, 4) == 0) + { + DPRINT("IP address is Loop Back\n"); + memcpy(host_entry->h_addr_list[0], LoopBackAdapter, 4); + return host_entry; + } + + if (memcmp(addr, host_entry->h_addr_list[0], 4) == 0) + { + DPRINT("IP address is local IP\n"); + return host_entry; + } + /* We failed, so zero it out */ Hostent = NULL; diff --git a/dll/win32/ws2_32/src/nscatalo.c b/dll/win32/ws2_32/src/nscatalo.c index 32cee959c89..5b77033fbbd 100644 --- a/dll/win32/ws2_32/src/nscatalo.c +++ b/dll/win32/ws2_32/src/nscatalo.c @@ -442,9 +442,10 @@ WsNcLoadProvider(IN PNSCATALOG Catalog, INT WSAAPI WsNcGetServiceClassInfo(IN PNSCATALOG Catalog, - IN OUT LPDWORD BugSize, + IN OUT LPDWORD BufSize, IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo) { + UNIMPLEMENTED; /* Not yet implemented in the spec? */ SetLastError(ERROR_SUCCESS); return SOCKET_ERROR; diff --git a/dll/win32/ws2_32/src/nsquery.c b/dll/win32/ws2_32/src/nsquery.c index 16c58150c66..8aca9b851ce 100644 --- a/dll/win32/ws2_32/src/nsquery.c +++ b/dll/win32/ws2_32/src/nsquery.c @@ -10,6 +10,9 @@ #include +#define NDEBUG +#include + /* DATA **********************************************************************/ #define WsNqLock() EnterCriticalSection(&NsQuery->Lock) @@ -359,6 +362,8 @@ WsNqLookupServiceBegin(IN PNSQUERY NsQuery, ENUM_CONTEXT EnumContext; BOOLEAN TryAgain; + DPRINT("WsNqLookupServiceBegin: %p\n", Restrictions); + /* Check for RAS Auto-dial attempt */ if (NsQuery->TryAgain) { diff --git a/dll/win32/ws2_32/src/rnr.c b/dll/win32/ws2_32/src/rnr.c index b6e1fd691b2..d5b4ac6967e 100644 --- a/dll/win32/ws2_32/src/rnr.c +++ b/dll/win32/ws2_32/src/rnr.c @@ -266,7 +266,7 @@ WSALookupServiceBeginA(IN LPWSAQUERYSETA lpqsRestrictions, lpqsRestrictions->lpszComment = NULL; lpqsRestrictions->dwNumberOfCsAddrs = 0; - /* Find out the side we'll need */ + /* Find out the size we'll need */ ErrorCode = MapAnsiQuerySetToUnicode(lpqsRestrictions, &UnicodeQuerySetSize, UnicodeQuerySet); @@ -322,7 +322,8 @@ WSALookupServiceBeginW(IN LPWSAQUERYSETW lpqsRestrictions, INT ErrorCode; PNSQUERY Query; - DPRINT("WSALookupServiceBeginW: %p\n", lpqsRestrictions); + DPRINT("WSALookupServiceBeginW:'%S'\n", + lpqsRestrictions->lpszServiceInstanceName); /* Enter prolog */ if ((ErrorCode = WsApiProlog(&Process, &Thread)) != ERROR_SUCCESS)