The class exposes Windows APIs to be used in this code sample.
More...
|
static SafeMailslotHandle | CreateMailslot (string mailslotName, uint nMaxMessageSize, int lReadTimeout, SECURITY_ATTRIBUTES securityAttributes) |
| Creates an instance of a mailslot and returns a handle for subsequent operations. More...
|
|
static SafeMailslotHandle | CreateFile (string fileName, FileDesiredAccess desiredAccess, FileShareMode shareMode, IntPtr securityAttributes, FileCreationDisposition creationDisposition, int flagsAndAttributes, IntPtr hTemplateFile) |
| Creates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe. More...
|
|
static bool | GetMailslotInfo (SafeMailslotHandle hMailslot, IntPtr lpMaxMessageSize, out int lpNextSize, out int lpMessageCount, IntPtr lpReadTimeout) |
| Retrieves information about the specified mailslot. More...
|
|
static bool | ReadFile (SafeMailslotHandle handle, byte[] bytes, int numBytesToRead, out int numBytesRead, IntPtr overlapped) |
| Reads data from the specified file or input/output (I/O) device. More...
|
|
static bool | WriteFile (SafeMailslotHandle handle, byte[] bytes, int numBytesToWrite, out int numBytesWritten, IntPtr overlapped) |
| Writes data to the specified file or input/output (I/O) device. More...
|
|
static bool | ConvertStringSecurityDescriptorToSecurityDescriptor (string sddlSecurityDescriptor, int sddlRevision, out SafeLocalMemHandle pSecurityDescriptor, IntPtr securityDescriptorSize) |
| The ConvertStringSecurityDescriptorToSecurityDescriptor function converts a string-format security descriptor into a valid, functional security descriptor. More...
|
|
static bool | CloseHandle (SafeMailslotHandle handle) |
|
The class exposes Windows APIs to be used in this code sample.
◆ ConvertStringSecurityDescriptorToSecurityDescriptor()
static bool SpringCard.LibCs.Windows.MailSlotServer.MailSlot.ConvertStringSecurityDescriptorToSecurityDescriptor |
( |
string |
sddlSecurityDescriptor, |
|
|
int |
sddlRevision, |
|
|
out SafeLocalMemHandle |
pSecurityDescriptor, |
|
|
IntPtr |
securityDescriptorSize |
|
) |
| |
The ConvertStringSecurityDescriptorToSecurityDescriptor function converts a string-format security descriptor into a valid, functional security descriptor.
- Parameters
-
sddlSecurityDescriptor | A string containing the string-format security descriptor (SDDL) to convert. |
sddlRevision | The revision level of the sddlSecurityDescriptor string. Currently this value must be 1. |
pSecurityDescriptor | A pointer to a variable that receives a pointer to the converted security descriptor. |
securityDescriptorSize | A pointer to a variable that receives the size, in bytes, of the converted security descriptor. This parameter can be IntPtr.Zero. |
- Returns
- If the function succeeds, the return value is true.
◆ CreateFile()
Creates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe.
- Parameters
-
fileName | The name of the file or device to be created or opened. |
desiredAccess | The requested access to the file or device, which can be summarized as read, write, both or neither (zero). |
shareMode | The requested sharing mode of the file or device, which can be read, write, both, delete, all of these, or none (refer to the following table). |
securityAttributes | A SECURITY_ATTRIBUTES object that contains two separate but related data members: an optional security descriptor, and a Boolean value that determines whether the returned handle can be inherited by child processes. |
creationDisposition | An action to take on a file or device that exists or does not exist. |
flagsAndAttributes | The file or device attributes and flags. |
hTemplateFile | Handle to a template file. |
- Returns
- If the function succeeds, the return value is an open handle to the specified file, device, named pipe, or mail slot. If the function fails, the return value is an invalid handle.
◆ CreateMailslot()
static SafeMailslotHandle SpringCard.LibCs.Windows.MailSlotServer.MailSlot.CreateMailslot |
( |
string |
mailslotName, |
|
|
uint |
nMaxMessageSize, |
|
|
int |
lReadTimeout, |
|
|
SECURITY_ATTRIBUTES |
securityAttributes |
|
) |
| |
Creates an instance of a mailslot and returns a handle for subsequent operations.
- Parameters
-
mailslotName | Mailslot name |
nMaxMessageSize | The maximum size of a single message |
lReadTimeout | The time a read operation can wait for a message. |
securityAttributes | Security attributes |
- Returns
- If the function succeeds, the return value is a handle to the server end of a mailslot instance.
◆ GetMailslotInfo()
static bool SpringCard.LibCs.Windows.MailSlotServer.MailSlot.GetMailslotInfo |
( |
SafeMailslotHandle |
hMailslot, |
|
|
IntPtr |
lpMaxMessageSize, |
|
|
out int |
lpNextSize, |
|
|
out int |
lpMessageCount, |
|
|
IntPtr |
lpReadTimeout |
|
) |
| |
Retrieves information about the specified mailslot.
- Parameters
-
hMailslot | A handle to a mailslot |
lpMaxMessageSize | The maximum message size, in bytes, allowed for this mailslot. |
lpNextSize | The size of the next message in bytes. |
lpMessageCount | The total number of messages waiting to be read. |
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. |
- Returns
◆ ReadFile()
static bool SpringCard.LibCs.Windows.MailSlotServer.MailSlot.ReadFile |
( |
SafeMailslotHandle |
handle, |
|
|
byte [] |
bytes, |
|
|
int |
numBytesToRead, |
|
|
out int |
numBytesRead, |
|
|
IntPtr |
overlapped |
|
) |
| |
Reads data from the specified file or input/output (I/O) device.
- Parameters
-
handle | A handle to the device (for example, a file, file stream, physical disk, volume, console buffer, tape drive, socket, communications resource, mailslot, or pipe). |
bytes | A buffer that receives the data read from a file or device. |
numBytesToRead | The maximum number of bytes to be read. |
numBytesRead | The number of bytes read when using a synchronous IO. |
overlapped | A pointer to an OVERLAPPED structure if the file was opened with FILE_FLAG_OVERLAPPED. |
- Returns
- If the function succeeds, the return value is true. If the function fails, or is completing asynchronously, the return value is false.
◆ WriteFile()
static bool SpringCard.LibCs.Windows.MailSlotServer.MailSlot.WriteFile |
( |
SafeMailslotHandle |
handle, |
|
|
byte [] |
bytes, |
|
|
int |
numBytesToWrite, |
|
|
out int |
numBytesWritten, |
|
|
IntPtr |
overlapped |
|
) |
| |
Writes data to the specified file or input/output (I/O) device.
- Parameters
-
handle | A handle to the file or I/O device (for example, a file, file stream, physical disk, volume, console buffer, tape drive, socket, communications resource, mailslot, or pipe). |
bytes | A buffer containing the data to be written to the file or device. |
numBytesToWrite | The number of bytes to be written to the file or device. |
numBytesWritten | The number of bytes written when using a synchronous IO. |
overlapped | A pointer to an OVERLAPPED structure is required if the file was opened with FILE_FLAG_OVERLAPPED. |
- Returns
- If the function succeeds, the return value is true. If the function fails, or is completing asynchronously, the return value is false.
The documentation for this class was generated from the following file:
- D:/dev/interne/springcard.software.multiprod/src/common/lib-cs/windows/mailslotserver.cs