IGLib
1.5
The IGLib base library EXTENDED - with other lilbraries and applications.
|
The class exposes kernel32.dll methods for Mailslot communication. More...
Public Member Functions | |
static bool | ReadFile (IntPtr hFile, byte[] lpBuffer, int nNumberOfBytesToRead, out int lpNumberOfBytesRead, IntPtr lpOverlapped) |
Reads data from a file, and starts at the position that the file pointer indicates More... | |
static bool | WriteFile (IntPtr handle, byte[] lpBuffer, int nNumberOfBytesToWrite, out int lpNumberOfBytesWritten, IntPtr lpOverlapped) |
Writes data to the specified file at the position specified by the file pointer. More... | |
static bool | CloseHandle (IntPtr hObject) |
Closes an open object handle More... | |
static bool | GetMailslotInfo (IntPtr hMailslot, IntPtr lpMaxMessageSize, out int lpNextSize, out int lpMessageCount, IntPtr lpReadTimeout) |
Retrieves information about the specified mailslot More... | |
static IntPtr | CreateMailslot (string lpName, uint nMaxMessageSize, int lReadTimeout, IntPtr lpSecurityAttributes) |
Creates an instance of a mailslot and returns a handle for subsequent operations. More... | |
static IntPtr | CreateFile (string lpFileName, FileDesiredAccess dwDesiredAccess, FileShareMode dwShareMode, IntPtr SecurityAttributes, FileCreationDisposition dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile) |
open an instance of a mailslot and returns a handle for subsequent operations. More... | |
static bool | ReadFile (IntPtr hFile, byte[] lpBuffer, int nNumberOfBytesToRead, out int lpNumberOfBytesRead, IntPtr lpOverlapped) |
Reads data from a file, and starts at the position that the file pointer indicates More... | |
static bool | WriteFile (IntPtr handle, byte[] lpBuffer, int nNumberOfBytesToWrite, out int lpNumberOfBytesWritten, IntPtr lpOverlapped) |
Writes data to the specified file at the position specified by the file pointer. More... | |
static bool | CloseHandle (IntPtr hObject) |
Closes an open object handle More... | |
static bool | GetMailslotInfo (IntPtr hMailslot, IntPtr lpMaxMessageSize, out int lpNextSize, out int lpMessageCount, IntPtr lpReadTimeout) |
Retrieves information about the specified mailslot More... | |
static IntPtr | CreateMailslot (string lpName, uint nMaxMessageSize, int lReadTimeout, IntPtr lpSecurityAttributes) |
Creates an instance of a mailslot and returns a handle for subsequent operations. More... | |
static IntPtr | CreateFile (string lpFileName, FileDesiredAccess dwDesiredAccess, FileShareMode dwShareMode, IntPtr SecurityAttributes, FileCreationDisposition dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile) |
open an instance of a mailslot and returns a handle for subsequent operations. More... | |
Public Attributes | |
const int | MAILSLOT_WAIT_FOREVER = -1 |
mailslot waits forever for a message More... | |
const int | INVALID_HANDLE_VALUE = -1 |
Invalid operating system handle. More... | |
const int | MAILSLOT_NO_MESSAGE = -1 |
There is no next message More... | |
Private Member Functions | |
static bool | SetMailslotInfo (IntPtr hMailslot, uint lReadTimeout) |
Sets the time-out value used by the specified mailslot for a read operation More... | |
static bool | SetMailslotInfo (IntPtr hMailslot, uint lReadTimeout) |
Sets the time-out value used by the specified mailslot for a read operation More... | |
The class exposes kernel32.dll methods for Mailslot communication.
The class exposes kernel32.dll methods for MailSlot communication.
static bool MailslotNative.ReadFile | ( | IntPtr | hFile, |
byte[] | lpBuffer, | ||
int | nNumberOfBytesToRead, | ||
out int | lpNumberOfBytesRead, | ||
IntPtr | lpOverlapped | ||
) |
Reads data from a file, and starts at the position that the file pointer indicates
hFile | A handle to the file to be read |
lpBuffer | A buffer that receives the data read from a file |
nNumberOfBytesToRead | The maximum number of bytes to be read |
lpNumberOfBytesRead | the number of bytes read |
lpOverlapped | A pointer to an OVERLAPPED structure. |
Referenced by Program.ReadMailslot().
static bool MailslotNative.WriteFile | ( | IntPtr | handle, |
byte[] | lpBuffer, | ||
int | nNumberOfBytesToWrite, | ||
out int | lpNumberOfBytesWritten, | ||
IntPtr | lpOverlapped | ||
) |
Writes data to the specified file at the position specified by the file pointer.
handle | A handle to the file |
lpBuffer | A buffer containing the data to be written to the file. |
nNumberOfBytesToWrite | The number of bytes to be written to the file. |
lpNumberOfBytesWritten | the number of bytes written. |
lpOverlapped | A pointer to an OVERLAPPED structure. |
Referenced by Program.WriteMailslot().
static bool MailslotNative.CloseHandle | ( | IntPtr | hObject | ) |
Closes an open object handle
hObject | A valid handle to an open object |
Referenced by Program.Main().
static bool MailslotNative.GetMailslotInfo | ( | IntPtr | hMailslot, |
IntPtr | lpMaxMessageSize, | ||
out int | lpNextSize, | ||
out int | lpMessageCount, | ||
IntPtr | lpReadTimeout | ||
) |
Retrieves information about the specified mailslot
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. |
Referenced by Program.ReadMailslot().
static IntPtr MailslotNative.CreateMailslot | ( | string | lpName, |
uint | nMaxMessageSize, | ||
int | lReadTimeout, | ||
IntPtr | lpSecurityAttributes | ||
) |
Creates an instance of a mailslot and returns a handle for subsequent operations.
lpName | mailslot name |
nMaxMessageSize | The maximum size of a single message |
lReadTimeout | The time a read operation can wait for a message |
lpSecurityAttributes | Security attributes |
Referenced by Program.Main().
static IntPtr MailslotNative.CreateFile | ( | string | lpFileName, |
FileDesiredAccess | dwDesiredAccess, | ||
FileShareMode | dwShareMode, | ||
IntPtr | SecurityAttributes, | ||
FileCreationDisposition | dwCreationDisposition, | ||
uint | dwFlagsAndAttributes, | ||
IntPtr | hTemplateFile | ||
) |
open an instance of a mailslot and returns a handle for subsequent operations.
lpFileName | mailslot name |
dwDesiredAccess | The access to the object |
dwShareMode | The sharing mode of an object |
SecurityAttributes | Security attributes |
dwCreationDisposition | An action to take on files that exist and do not exist |
dwFlagsAndAttributes | The file attributes and flags |
hTemplateFile | A handle to a template file with the GENERIC_READ access right |
Referenced by Program.Main().
|
private |
Sets the time-out value used by the specified mailslot for a read operation
hMailslot | A handle to a mailslot |
lReadTimeout | The time a read operation can wait for a message to be written to the mailslot before a time-out occurs, in milliseconds |
static bool MailslotNative.ReadFile | ( | IntPtr | hFile, |
byte[] | lpBuffer, | ||
int | nNumberOfBytesToRead, | ||
out int | lpNumberOfBytesRead, | ||
IntPtr | lpOverlapped | ||
) |
Reads data from a file, and starts at the position that the file pointer indicates
hFile | A handle to the file to be read |
lpBuffer | A buffer that receives the data read from a file |
nNumberOfBytesToRead | The maximum number of bytes to be read |
lpNumberOfBytesRead | the number of bytes read |
lpOverlapped | A pointer to an OVERLAPPED structure. |
static bool MailslotNative.WriteFile | ( | IntPtr | handle, |
byte[] | lpBuffer, | ||
int | nNumberOfBytesToWrite, | ||
out int | lpNumberOfBytesWritten, | ||
IntPtr | lpOverlapped | ||
) |
Writes data to the specified file at the position specified by the file pointer.
handle | A handle to the file |
lpBuffer | A buffer containing the data to be written to the file. |
nNumberOfBytesToWrite | The number of bytes to be written to the file. |
lpNumberOfBytesWritten | the number of bytes written. |
lpOverlapped | A pointer to an OVERLAPPED structure. |
static bool MailslotNative.CloseHandle | ( | IntPtr | hObject | ) |
Closes an open object handle
hObject | A valid handle to an open object |
hObject | / handle to kernel object |
static bool MailslotNative.GetMailslotInfo | ( | IntPtr | hMailslot, |
IntPtr | lpMaxMessageSize, | ||
out int | lpNextSize, | ||
out int | lpMessageCount, | ||
IntPtr | lpReadTimeout | ||
) |
Retrieves information about the specified mailslot
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. |
static IntPtr MailslotNative.CreateMailslot | ( | string | lpName, |
uint | nMaxMessageSize, | ||
int | lReadTimeout, | ||
IntPtr | lpSecurityAttributes | ||
) |
Creates an instance of a mailslot and returns a handle for subsequent operations.
lpName | mailslot name |
nMaxMessageSize | The maximum size of a single message |
lReadTimeout | The time a read operation can wait for a message |
lpSecurityAttributes | Security attributes |
static IntPtr MailslotNative.CreateFile | ( | string | lpFileName, |
FileDesiredAccess | dwDesiredAccess, | ||
FileShareMode | dwShareMode, | ||
IntPtr | SecurityAttributes, | ||
FileCreationDisposition | dwCreationDisposition, | ||
uint | dwFlagsAndAttributes, | ||
IntPtr | hTemplateFile | ||
) |
open an instance of a mailslot and returns a handle for subsequent operations.
lpFileName | mailslot name |
dwDesiredAccess | The access to the object |
dwShareMode | The sharing mode of an object |
SecurityAttributes | Security attributes |
dwCreationDisposition | An action to take on files that exist and do not exist |
dwFlagsAndAttributes | The file attributes and flags |
hTemplateFile | A handle to a template file with the GENERIC_READ access right |
|
private |
Sets the time-out value used by the specified mailslot for a read operation
hMailslot | A handle to a mailslot |
lReadTimeout | The time a read operation can wait for a message to be written to the mailslot before a time-out occurs, in milliseconds |
const int MailslotNative.MAILSLOT_WAIT_FOREVER = -1 |
mailslot waits forever for a message
Referenced by Program.Main().
const int MailslotNative.INVALID_HANDLE_VALUE = -1 |
Invalid operating system handle.
Referenced by Program.Main().
const int MailslotNative.MAILSLOT_NO_MESSAGE = -1 |
There is no next message
Referenced by Program.ReadMailslot().