фреимворк 1.1, винда 2003 сервак
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
Public Declare Auto Function GetMailslotInfo Lib "Kernel32" Alias "GetMailslotInfo" _
(ByVal hMailslot As Int32, _
ByRef lpMaxMessageSize As Int32, _
ByRef lpNextSize As Int32, _
ByRef lpMessageCount As Int32, _
ByRef lpReadTimeout As Int32) As Int32
Public Sub ThreadProc()
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)
...
End Sub
hSlot всегда -1, а LastDllError всегда 123 (invalid name or path...), какое бы имя не подсунул