FIX: gethostbyaddr() May Cause an Invalid Page Fault on Win95

ID: Q176354

The information in this article applies to:

SYMPTOMS

You might receive the following error message when you call gethostbyaddr() on Windows 95:

   This program has performed an illegal operation and will be shutdown.

When you click Details, the following details are displayed:

   <your app> caused an invalid page fault in module Kernel32.dll.

-or-

   <your app> caused an access violation fault in Kernel32.dll.

CAUSE

The gethostbyaddr API issues a NETBIOS Node Status Query if the address is not found in the local hosts file or a domain name server(DNS). However, due to this bug, if the target machine of this Node Status Query registers more than 10 netbios names, an Invalid Page Fault occurs in Kernel32.dll. If the target machine is many hops away, or network is slow, an Access Violation may occur in Kernel32.dll. This only happens under Windows 95.

RESOLUTION

This bug has been fixed in Winsock 2 for Windows 95. To work around this problem without applying the fix, manually add a PTR record to the DNS server for the target machine, or reduce the number of netbios names by stopping services whose names are registered.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Winsock 2 for Windows 95 SDK. It can be downloaded from ftp://ftp.microsoft.com/bussys/WinSock/winsock2.

Additional query words: winsock winsock2 dns netbios wins domain group

Keywords          : kbnetwork kbAPI kbSDKPlatform kbWinOS95 kbWinsock kbGrpNet 
Issue type        : kbbug
Solution Type     : kbfix

Last Reviewed: July 31, 1998