summaryrefslogtreecommitdiff
path: root/test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp')
-rw-r--r--test-client-catchcopy/catchcopy-api-0002/ExtraSocketCatchcopy.cpp31
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
+}