BOOL GetMailslotInfo(hMailslot, lpcbMaxMsg, lpcbNextMsg, lpcMsg, lpdwReadTimeout) | |||||
HANDLE hMailslot; | /* mailslot handle | */ | |||
LPDWORD lpcbMaxMsg; | /* maximum message size | */ | |||
LPDWORD lpcbNextMsg; | /* size of next message in mailslot | */ | |||
LPDWORD lpcMsg; | /* number of messages in mailslot | */ | |||
LPDWORD lpdwReadTimeout; | /* read timeout, in milliseconds | */ |
The GetMailslotInfo function retrieves information about a given mailslot.
hMailslot
Identifies a mailslot. This handle must have been created by using the CreateMailslot function.
lpcbMaxMsg
Specifies the maximum message size (in bytes) allowed for this mailslot, when the function returns. This value may be greater than or equal to the value specified in the cbMaxMsg parameter of the CreateMailslot function that created the mailslot. An application can set this parameter to NULL.
lpcbNextMsg
Specifies the size of the next message (in bytes), when the function returns. It can be the following special value:
Value | Meaning |
MAILSLOT_NO_MESSAGE | There is no next message. |
An application can set this parameter to NULL.
lpcMsg
Specifies the total number of messages waiting to be read, when the function returns. An application can set this parameter to NULL.
lpdwReadTimeout
Specifies the amount of time, in milliseconds, a read operation can wait for a message to be written to the mailslot before timing out. This parameter is filled in when the function returns. An application can set this parameter to NULL.
The return value is TRUE if the function is successful. Otherwise, it is FALSE. Use the GetLastError function to obtain extended error information.
CreateMailslot, SetMailslotInfo