1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42:
| Function TMPipe.CreateServer : boolean; var FSA : SECURITY_ATTRIBUTES; FSD : SECURITY_DESCRIPTOR; begin Result := False; InitializeSecurityDescriptor(@FSD, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(@FSD, True, nil, False); FSA.lpSecurityDescriptor := @FSD; FSA.nLength := sizeof(SECURITY_ATTRIBUTES); FSA.bInheritHandle := True;
FPipeServerHandle := CreateFile(fpipeName, GENERIC_WRITE, 0, @FSA, OPEN_EXISTING, 0, 0);
----> hier ist FPipeServerHandle = INVALID
if FPipeServerHandle = INVALID_HANDLE_VALUE then raise EOSError.Create(Format(cERROPENPIPE, [fpipeName])); Result := True; end;
Function TMPipe.CreateClient : boolean; var FSA: SECURITY_ATTRIBUTES; FSD: SECURITY_DESCRIPTOR; begin InitializeSecurityDescriptor(@FSD, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(@FSD, True, nil, False); FSA.lpSecurityDescriptor := @FSD; FSA.nLength := sizeof(SECURITY_ATTRIBUTES); FSA.bInheritHandle := True;
FPipeClientHandle := CreateNamedPipe(fpipeName, PIPE_ACCESS_INBOUND, PIPE_TYPE_BYTE, PIPE_UNLIMITED_INSTANCES , 1024, 1024, 50, @FSA);
if FPipeClientHandle = INVALID_HANDLE_VALUE then raise EOSError.Create(Format(cERROPENPIPE, [fpipeName]));
Result := True; end; |