15.1.2 Mailslots and LAN Manager

The implementation of mailslots in Windows is based on the mailslots in Microsoft LAN Manager version 2.0. An application that uses LAN Manager 2.x mailslots can easily interact with mailslots created by Windows. There are some significant differences between Windows and LAN Manager mailslots, however:

Windows mailslots all have the same class—there are no “first class” and “second class” mailslots.

Windows mailslot messages have equal priority and are always appended to the mailslot buffer. When a Windows mailslot message is written to a mailslot on a computer that requires a message priority, the priority is set to the lowest value [0].

Write operations to Windows mailslots on local computers return an error value if an error occurs. Write operations to remote Windows mailslots, however, do not return an error value when they fail.

Write operations to Windows mailslots fail immediately if the message cannot be appended to the mailslot buffer (because of insufficient space, for example). Unlike LAN Manager mailslots, there are no write timeouts.

A process that creates a Windows mailslot can specify that the mailslot handle can be inherited by its child processes. (Mailslot handles in LAN Manager cannot be inherited.)

A process writes messages to a Windows mailslot using standard file input-and-output functions. The following list gives the LAN Manager mailslot functions and the Windows functions that do the same job:

LAN Manager function Windows function

DosDeleteMailslot CloseHandle
DosMailslotInfo GetMailslotInfo
DosMakeMailslot CreateMailslot
DosReadMailslot ReadFile
DosWriteMailslot WriteFile