- Код: Выделить всё
Public Structure SECURITY_ATTRIBUTES
Public nLength As Int32
Public lpSecurityDescriptor As Int32
Public bInheritHandle As Int32
End Structure
Public Const INVALID_HANDLE_VALUE As Int32 = -1
Public Declare Auto Function CreateMailslot Lib "Kernel32" Alias "CreateMailslotA" _
(ByVal lpName As String, _
ByVal nMaxMessageSize As Int32, _
ByVal lReadTimeout As Int32, _
ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES) As Int32
Вызываю так:
- Код: Выделить всё
Dim oSA As SECURITY_ATTRIBUTES
oSA.nLength = Len(oSA)
oSA.bInheritHandle = 0
oSA.lpSecurityDescriptor = 0
Dim hSlot As Int32 = CreateMailslot("\\.\mailslot\my_slot_name", 0, -1, oSA)
Все время возвращается -1 с ошибкой 123 "The filename, directory name, or volume label syntax is incorrect."