using namespace std;
+#define BUFSIZE 512
+
+std::wstring getUserName() {
+ DWORD len = BUFSIZE;
+ TCHAR buf[BUFSIZE];
+ if (GetUserName(buf, &len)) {
+ return std::wstring(&buf[0], len);
+ } else {
+ return std::wstring();
+ }
+}
// This code is run in a thread
void RemotePathChecker::workerThreadLoop()
{
auto pipename = std::wstring(L"\\\\.\\pipe\\");
- pipename += L"ownCloud";
+ pipename += L"ownCloud\\";
+ pipename += getUserName();
bool connected = false;
CommunicationSocket socket;
}
return StateNone;
-}
\ No newline at end of file
+}
if (Utility::isWindows()) {
socketPath = QLatin1String("\\\\.\\pipe\\")
- + QLatin1String("ownCloud");
+ + QLatin1String("ownCloud") + '\\'
+ + QString::fromLocal8Bit(qgetenv("USERNAME"));
// TODO: once the windows extension supports multiple
// client connections, switch back to the theme name
// See issue #2388