GetMailslotInfo function

Retrieves information about the specified mailslot.


BOOL GetMailslotInfo(
  HANDLE  hMailslot,
  LPDWORD lpMaxMessageSize,
  LPDWORD lpNextSize,
  LPDWORD lpMessageCount,
  LPDWORD lpReadTimeout



A handle to a mailslot. The CreateMailslot function must create this handle.


The maximum message size, in bytes, allowed for this mailslot. This value can be greater than or equal to the value specified in the cbMaxMsg parameter of the CreateMailslot function that created the mailslot. This parameter can be NULL.


The size of the next message, in bytes. The following value has special meaning.

Value Meaning
There is no next message.

This parameter can be NULL.


The total number of messages waiting to be read, when the function returns. This parameter can be NULL.


The amount of time, in milliseconds, a read operation can wait for a message to be written to the mailslot before a time-out occurs. This parameter is filled in when the function returns. This parameter can be NULL.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also


Mailslot Functions

Mailslots Overview