This commit is contained in:
Chris Marsh
2017-07-25 09:27:48 -07:00
parent 866e6d1104
commit 7a6172a300
10 changed files with 176 additions and 78 deletions

View File

@ -16,7 +16,7 @@ struct BaseConnectionWin : public BaseConnection {
};
static BaseConnectionWin Connection;
//static const wchar_t* PipeName = L"\\\\?\\pipe\\discord-ipc";
// static const wchar_t* PipeName = L"\\\\?\\pipe\\discord-ipc";
static const wchar_t* PipeName = L"\\\\?\\pipe\\discord-ipc-0";
/*static*/ BaseConnection* BaseConnection::Create()
@ -35,7 +35,8 @@ bool BaseConnection::Open()
{
auto self = reinterpret_cast<BaseConnectionWin*>(this);
for (;;) {
self->pipe = ::CreateFileW(PipeName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
self->pipe = ::CreateFileW(
PipeName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (self->pipe != INVALID_HANDLE_VALUE) {
return true;
}
@ -77,4 +78,3 @@ bool BaseConnection::Read(void* data, size_t length)
}
return false;
}