pss E63848

Member since: Wednesday, 27 June 2018
Last login: 2 months ago
Profile viewed: 53 views

No Rank
Points: 0

pss E63848 replied to the topic 'Trouble creating Mailslots' in the forum. 2 months ago

Error code 183 is correct, description posted is due to the same mistake as before, that is, there is another Windows call before getting the description for error 183.

The executable can not run multiple instances in the same computer, but this is a special case where I need to run two instances of the same executable at the same time.

So, thanks to your explanations I know that this is why the mentioned problem occurs.

I will change my code to use two different mailslot names, trying to share the same mailslot seems too complicated as per your explanations.
.

Read More...

pss E63848 replied to the topic 'Trouble creating Mailslots' in the forum. 2 months ago

Remy,
You were true, after correcting the code, now the error is "183: Operation completed correctly"
I suspect that this is due to two of my programs in the same computer trying to create the same mailslot, (using both the same function and the same mailslot name in each program).
So, now, the new question is: How can I get the handle to the mailslot that is created in another program in the same computer.. Can I share this same mailslot.

Read More...

pss E63848 replied to the topic 'Trouble creating Mailslots' in the forum. 3 months ago

Sorry for the inconcretion, I intended to be as concise as possible.
The slotnane is '\\.\mailslot\amagenda'
The code checking the error is

  lHSlot := CreateMailslot(PChar(msSlotName), 0, lReadTimeout, @sa1);
  If lHSlot = INVALID_HANDLE_VALUE Then
  begin
    sTx := '    ' + GNComputerName + '  (' + DateTimeToStr(Now) + ')  MSlotCrear: Error creando mailslot: ';
    sTx := sTx + IntToStr(GetLastError) + ': ';
    sTx := sTx + SysErrorMessage(GetLastError);
    WriteDbgLine(sTx);
  end

Variable sTx is (in spanish):
PC-SECRE (28/06/2018 8:00:16) MSlotCrear: Error creando mailslot: 203: El sistema no encontró la opción de entorno especificada

Read More...

pss E63848 created a new topic ' Trouble creating Mailslots' in the forum. 3 months ago

With the code below I am able to work with MailSlots in different customers with several computers on their private lan.
But on one of them I am not able to discover what is happening, although for sure it will be a permissions problem.
The call to CreateMailslot returns INVALID_HANDLE_VALUE and GetLastError retuns 203 "The system could not find the environment option that was entered."
Do I need to specify more options in sa1 / SECURITY_ATTRIBUTES.

var
  sd: SECURITY_DESCRIPTOR;
  sa1: SECURITY_ATTRIBUTES;
  lHSlot: THandle;

begin
  InitializeSecurityDescriptor(@sd, SECURITY_DESCRIPTOR_REVISION);
  SetSecurityDescriptorDacl(@sd, True, nil, False);
  sa1.lpSecurityDescriptor := @sd;
  sa1.bInheritHandle := False;
  lHSlot := CreateMailslot(PChar(msSlotName), 0, lReadTimeout, @sa1);
end;


Read More...