GetMailslotInfo function

Retrieves information about the specified mailslot.

Syntax

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

Parameters

hMailslot

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

lpMaxMessageSize

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.

lpNextSize

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

Value Meaning
MAILSLOT_NO_MESSAGE
((DWORD)-1)
There is no next message.
 

This parameter can be NULL.

lpMessageCount

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

lpReadTimeout

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.

Requirements

   
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

CreateMailslot

Mailslot Functions

Mailslots Overview

SetMailslotInfo