Fix windows connection
This commit is contained in:
parent
d90a8efd47
commit
6796d2ffa9
@ -6,6 +6,7 @@
|
||||
#define NOIME
|
||||
#include <assert.h>
|
||||
#include <windows.h>
|
||||
#include <sstream>
|
||||
|
||||
int GetProcessId()
|
||||
{
|
||||
@ -32,9 +33,10 @@ static BaseConnectionWin Connection;
|
||||
|
||||
bool BaseConnection::Open(int pipe)
|
||||
{
|
||||
wchar_t pipeName[]{L"\\\\?\\pipe\\discord-ipc-0"};
|
||||
const size_t pipeDigit = sizeof(pipeName) / sizeof(wchar_t) - 2;
|
||||
pipeName[pipeDigit] = sprintf(L"%d", pipe);
|
||||
std::wostringstream stream{};
|
||||
stream << L"\\\\?\\pipe\\discord-ipc-" << pipe;
|
||||
std::wstring asString = stream.str();
|
||||
const WCHAR* pipeName = asString.c_str();
|
||||
auto self = reinterpret_cast<BaseConnectionWin*>(this);
|
||||
for (;;) {
|
||||
self->pipe = ::CreateFileW(
|
||||
|
Loading…
x
Reference in New Issue
Block a user