MCPcopy Create free account
hub / github.com/CCob/lsarelayx / Pipe

Method Pipe

plugin/pipe.cpp:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30};
31
32Pipe::Pipe(const std::string& pipePath)
33{
34 _pipeHandle = win32_handle(INVALID_HANDLE_VALUE);
35
36 while(_pipeHandle.get() == INVALID_HANDLE_VALUE){
37
38 _pipeHandle = win32_handle(CreateFileA(pipePath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr));
39
40 if(_pipeHandle.get() == INVALID_HANDLE_VALUE){
41 if(GetLastError() == ERROR_PIPE_BUSY){
42 WaitNamedPipeA(pipePath.c_str(),100);
43 continue;
44 }else{
45 throw std::system_error(std::error_code(GetLastError(), std::system_category()), "Failed to open pipe");
46 }
47 }
48 }
49}
50
51MessageBuffer Pipe::ReadAll(){
52

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected