From 3ac113857071fc1f225b2e1b42547269e568c6b7 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Tue, 11 Aug 2020 22:35:12 +0100 Subject: New upstream version 2.2.4.4 --- .../catchcopy-api-0002/ExtraSocketCatchcopy.cpp | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp (limited to 'test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp') diff --git a/test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp b/test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp new file mode 100644 index 0000000..7ee05ed --- /dev/null +++ b/test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp @@ -0,0 +1,31 @@ +/** \file ExtraSocketCatchcopy.cpp +\brief Define the socket of catchcopy +\author alpha_one_x86 +\version 0002 +\date 2010 */ + +#include "ExtraSocketCatchcopy.h" + +const QString ExtraSocketCatchcopy::pathSocket() +{ +#ifdef Q_OS_UNIX + return "advanced-copier-"+QString::number(getuid()); +#else + QString userName; + DWORD size=0; + if(GetUserNameW(NULL,&size) || (GetLastError()!=ERROR_INSUFFICIENT_BUFFER)) + { + } + else + { + WCHAR * userNameW=new WCHAR[size]; + if(GetUserNameW(userNameW,&size)) + { + userName.fromWCharArray(userNameW,size*2); + userName=QString(QByteArray((char*)userNameW,size*2-2).toHex()); + } + delete userNameW; + } + return "advanced-copier-"+userName; +#endif +} -- cgit v1.2.3