Mailslot programs may be slow in Windows 2000 (819107)



The information in this article applies to:

  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional
  • Microsoft Windows 2000 Server

SUMMARY

This article discusses why mailslot programs may appear to be slower in Microsoft Windows 2000 than in Microsoft Windows NT 4.0.

SYMPTOMS

After you upgrade a Windows NT 4.0 system to Windows 2000, you may notice slow performance in mailslot programs. Calls to the WriteFile function may return after a long delay on Windows 2000-based systems.

CAUSE

In Windows NT 4.0, if the mailslot name or the computer name that is specified in the CreateFile function does not exist, the WriteFile function returns confirmation immediately and then sends a datagram.

NetBIOS over TCP/IP (NetBT) behavior changed in Windows 2000. Windows 2000 first tries to resolve the computer name. Windows 2000 returns confirmation only if it successfully resolves the name. (Because the datagram is unreliable, the confirmation is no guarantee that the datagram reached its destination). The change to NetBT was made so that certain clients, such as the Net Logon service, would know whether the datagram was sent beyond NetBT.

If a Windows 2000-based client program calls the CreateFile function with the "\\\\computername\\mailslot\myslot" string, and computername cannot be found on the network, subsequent calls to the WriteFile function fail with the "System error 53 ERROR_BAD_NETPATH" error. This scenario indicates whether the recipient of the mailslot message exists.

In Windows NT 4.0, when the CreateFile function is called with a computer name, such as with the "\\\\computername\\mailslot\myslot" string, the client program uses the following procedure to resolve the computer name to an IP address:
  1. The client program sends a broadcast to the subnet.
  2. If the broadcast fails after three tries, the client program sends a name query request to all Windows Internet Name Service (WINS) servers.
  3. If the name query fails, the WriteFile function returns a confirmation to Windows NT 4.0.

Windows 2000 uses the following procedure for default name resolution:
  1. Windows 2000 sends a request to WINS.
  2. If the request fails, Windows 2000 sends a broadcast to the subnet.
  3. If three broadcasts do not generate a response, Windows 2000 sends a query to DNS.
  4. If the query fails, the WriteFile function fails with error 53.

WORKAROUND

To work around this issue, use the WriteFile function or the WriteFileEx function asynchronously.

Another possible workaround is to install the NetBEUI protocol on the local area network (LAN) adapter. This configuration makes the mailslot program behave as it does in Windows NT 4.0.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

If the client and server mailslot programs are both running in Windows 2000, the server program does not receive any data from the client program if the data is more than 426 bytes. This behavior is by design in Windows 2000. Because mailslot programs cannot be used to send more than 426 bytes from a Windows 2000-based client to a Windows 2000-based server, use named pipes or Windows Sockets (winsock) for larger amounts of data.

Note
  • If more than one protocol is installed on your computer, the mailslot program will use all protocols to send messages.
  • Mailslot programs are an older technology. We do not recommend using mailslot programs. NetBEUI is not supported in Microsoft Windows XP.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

127905 Messages sent to mailslot are duplicated

170581 Mailslot created on Win95 allows only 4093 bytes

131493 CreateFile() and Mailslots

822345 "System error 53 has occurred. The network path was not found." error message when you try to send a mailslot message to a different workgroup


Modification Type:MajorLast Reviewed:6/25/2004
Keywords:kbprb KB819107