The DosMakeMailslot API creates a mailslot and returns its handle.
Restrictions
Mailslot names must be unique; no two mailslots on any one computer can have the same name.
Mailslot handles cannot be passed to other processes by way of the OS/2 DosExecPgm function. Mailslot handles can be shared, however, among threads in a single process. Thus, multiple threads can use the same handle to read or write data to the mailslot.
#include <netcons.h> #include <mailslot.h> DosMakeMailslot(pMailslotName, messagesize, mailslotsize, pMailslotHandle); /* 16 bit */ Dos32MakeMailslot(pMailslotName, messagesize, mailslotsize, pMailslotHandle); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
pMailslotName
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌────────────────────────┬───────┬─────────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├────────────────────────┼───────┼─────────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├────────────────────────┼───────┼─────────────────────────────────────────────┤
│ ERROR_PATH_NOT_FOUND │ 3 │ The path was not found. │
├────────────────────────┼───────┼─────────────────────────────────────────────┤
│ ERROR_NOT_ENOUGH_MEMORY│ 8 │ Sufficient memory is not available.
│
├────────────────────────┼───────┼─────────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER│ 87 │ At least one parameter value is not valid.
│
└────────────────────────┴───────┴─────────────────────────────────────────────┘
Other codes could be returned from the following functions: