maybe this fixes it

This commit is contained in:
msciotti 2018-11-16 16:18:11 -08:00
parent 1d30b94987
commit 7fe88765fd
No known key found for this signature in database
GPG Key ID: 40FADA25CF0EAD84

View File

@ -33,11 +33,9 @@ static BaseConnectionWin Connection;
bool BaseConnection::Open(int pipe) bool BaseConnection::Open(int pipe)
{ {
std::wostringstream stream{}; wchar_t pipeName[]{L"\\\\?\\pipe\\discord-ipc-0"};
stream << L"\\\\?\\pipe\\discord-ipc-" << pipe;
std::wstring asString = stream.str();
const WCHAR* pipeName = asString.c_str();
const size_t pipeDigit = sizeof(pipeName) / sizeof(wchar_t) - 2; const size_t pipeDigit = sizeof(pipeName) / sizeof(wchar_t) - 2;
pipeName[pipeDigit] = (L'%d', pipe);
auto self = reinterpret_cast<BaseConnectionWin*>(this); auto self = reinterpret_cast<BaseConnectionWin*>(this);
for (;;) { for (;;) {
self->pipe = ::CreateFileW( self->pipe = ::CreateFileW(