fix QueryServerAlreadyOpen func error ret
This commit is contained in:
@@ -189,6 +189,12 @@ static bool ConnectToServer(HANDLE& pipe)
|
||||
DWORD err = GetLastError();
|
||||
if (err == ERROR_PIPE_BUSY)
|
||||
{
|
||||
LogA(
|
||||
"[dll-client] CreateFileW(%ls) failed: %lu\n",
|
||||
kPipeName,
|
||||
err);
|
||||
|
||||
|
||||
if (!WaitNamedPipeW(kPipeName, 1000))
|
||||
Sleep(250);
|
||||
continue;
|
||||
@@ -540,9 +546,21 @@ BOOL QueryServerAlreadyOpen()
|
||||
0,
|
||||
nullptr);
|
||||
|
||||
if (pipe == INVALID_HANDLE_VALUE)
|
||||
|
||||
|
||||
|
||||
if (pipe == INVALID_HANDLE_VALUE) {
|
||||
|
||||
|
||||
DWORD err = GetLastError();
|
||||
|
||||
LogA("[dll-client] CreateFileW failed, err=%lu\n", err);
|
||||
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
DWORD mode = PIPE_READMODE_MESSAGE;
|
||||
SetNamedPipeHandleState(pipe, &mode, nullptr, nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user