diff options
author | Thomas Preud'homme <robotux@celest.fr> | 2020-08-11 22:35:12 +0100 |
---|---|---|
committer | Thomas Preud'homme <robotux@celest.fr> | 2020-08-11 22:35:12 +0100 |
commit | 3ac113857071fc1f225b2e1b42547269e568c6b7 (patch) | |
tree | 8b28dd9c44a0d3c7ab8187cd8d8f19d47591d813 /test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp | |
parent | 9b10c21f5cad0e2ec27d23c59e65af7141a226f3 (diff) |
New upstream version 2.2.4.4
Diffstat (limited to 'test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp')
-rw-r--r-- | test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
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 +} |