I know this is pretty old now but i was trying to get comms accross local system, admin and limited users for months in windows 10 and was just not having any luck with anything at all.
ended up finding this solution, CreateFileW kernel32 dll call to create the handle to write the message in mailslot.au3 had to be changed because it still worked between admin and another limited user as it was, but not from local system to any other user.
had to change the file attributes to normal instead of the original flag $SECURITY_ANONYMOUS. see below
only after this would the security attributes pointer used to create the mailslot actually take affect on the system account.
Func _MailSlotWrite($sMailSlotName, $vData, $iMode = 0)
Local $aCall = DllCall("kernel32.dll", "ptr", "CreateFileW", _
"wstr", $sMailSlotName, _
"dword", 0x40000000, _ ; GENERIC_WRITE
"dword", 1, _ ; FILE_SHARE_READ
"ptr", 0, _ ; lp security attributes (ignored on open existing)
"dword", 3, _ ; OPEN_EXISTING
"dword", 128, _ ; 0, _ ; SECURITY_ANONYMOUS replaced with file attribute normal 128
"ptr", 0)
; .........
above now works when creating the mailslot with a security pointer which i have used permissions.au3 udf to create, shown below.
#include "MailSlot.au3"
#include <Permissions.au3>
Global Const $sMailSlotName = "\\.\mailslot\SampleCrossSessonMailslot"
Global $ptrSecurityDescriptor = _ConvertStringSecurityDescriptorToSecurityDescriptor("O:BAD:(A;OICI;GRGW;;;AU)(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)")
If @error Then
Global $aError = DllCall("kernel32.dll", "dword", "GetLastError")
if not @Compiled Then ConsoleWrite("err: " & $aError[0] & @CR)
EndIf
Global $tSecurityAttributes = DllStructCreate("dword Length;ptr Descriptor;bool InheritHandle")
DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes))
DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($ptrSecurityDescriptor))
DllStructSetData($tSecurityAttributes, 3, 0) ; InheritHandle = FALSE
Global $hMailSlot = _MailSlotCreate($sMailSlotName,0,0,$tSecurityAttributes)
hopefully this saves someone else from banging their head against the wall.