mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
Windows: Fix Share menu #4781
This commit is contained in:
parent
74f67c97a9
commit
8820bc1c17
2 changed files with 15 additions and 2 deletions
|
@ -34,10 +34,23 @@ using namespace std;
|
||||||
#define PIPE_TIMEOUT 5*1000 //ms
|
#define PIPE_TIMEOUT 5*1000 //ms
|
||||||
#define SOCK_BUFFER 4096
|
#define SOCK_BUFFER 4096
|
||||||
|
|
||||||
|
// TODO: Unify this with RemotePathChecker.cpp
|
||||||
|
#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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo()
|
OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo()
|
||||||
{
|
{
|
||||||
auto pipename = std::wstring(L"\\\\.\\pipe\\");
|
auto pipename = std::wstring(L"\\\\.\\pipe\\");
|
||||||
pipename += L"ownCloud";
|
pipename += L"ownCloud\\";
|
||||||
|
pipename += getUserName();
|
||||||
|
|
||||||
CommunicationSocket socket;
|
CommunicationSocket socket;
|
||||||
if (!WaitNamedPipe(pipename.data(), PIPE_TIMEOUT)) {
|
if (!WaitNamedPipe(pipename.data(), PIPE_TIMEOUT)) {
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
// FIXME: Unify this with OCClientInterface.cpp
|
||||||
#define BUFSIZE 512
|
#define BUFSIZE 512
|
||||||
|
|
||||||
std::wstring getUserName() {
|
std::wstring getUserName() {
|
||||||
DWORD len = BUFSIZE;
|
DWORD len = BUFSIZE;
|
||||||
TCHAR buf[BUFSIZE];
|
TCHAR buf[BUFSIZE];
|
||||||
|
|
Loading…
Reference in a new issue