Note that there are some explanatory texts on larger screens.

plurals
  1. PONamed Pipes from Windows Service to Client Application
    primarykey
    data
    text
    <p>My story is that I am designing a new app which must communicate with a Windows service. After much research I have come to the conclusion that Named Pipes are the recommended method ( <a href="https://stackoverflow.com/questions/512366/how-do-i-send-a-string-from-one-instance-of-my-delphi-program-to-another">How do I send a string from one instance of my Delphi program to another?</a> ) however, it appears that I can't use SendMessage or Named Pipes in Win7 due to security problems... the messages never reach outside the service to the application.</p> <p>I am using the Russell Libby's named Pipe components, which work without a hitch between normal desktop apps, but the Windows service seems to be throwing a wrench in the solution. Further research tells me that it may be possible to open up security on both sides to let them communicate, however, my knowledge level on this is minimal at best, and I haven't been able to make heads or tails of the possible API calls.</p> <p>Based on the Delphi component pipes.pas, what needs to be done to open up this baby so both sides can start talking? I'm sure the following two functions from the pipes.pas file identify the security attributes, is anyone able to help me out here?</p> <p>Thanks!</p> <pre><code>procedure InitializeSecurity(var SA: TSecurityAttributes); var sd: PSecurityDescriptor; begin // Allocate memory for the security descriptor sd := AllocMem(SECURITY_DESCRIPTOR_MIN_LENGTH); // Initialize the new security descriptor if InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION) then begin // Add a NULL descriptor ACL to the security descriptor if SetSecurityDescriptorDacl(sd, True, nil, False) then begin // Set up the security attributes structure SA.nLength := SizeOf(TSecurityAttributes); SA.lpSecurityDescriptor := sd; SA.bInheritHandle := True; end else // Failed to init the sec descriptor RaiseWindowsError; end else // Failed to init the sec descriptor RaiseWindowsError; end; procedure FinalizeSecurity(var SA: TSecurityAttributes); begin // Release memory that was assigned to security descriptor if Assigned(SA.lpSecurityDescriptor) then begin // Reource protection try // Free memory FreeMem(SA.lpSecurityDescriptor); finally // Clear pointer SA.lpSecurityDescriptor := nil; end; end; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload