]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Processing Unicode string returned by Win32 API correctly
authorsan <san@opencascade.com>
Mon, 16 Feb 2009 06:51:53 +0000 (06:51 +0000)
committersan <san@opencascade.com>
Mon, 16 Feb 2009 06:51:53 +0000 (06:51 +0000)
src/SUIT/SUIT_LicenseDlg.cxx

index 4faafba13480143d5771103eb3e92458d848e44c..359436d9ae3e8af74ede6b2fc0ed31798a72b587 100755 (executable)
@@ -118,15 +118,16 @@ void SUIT_LicenseDlg::onAgree()
 {
   QString env;
 #ifdef WIN32
-    DWORD aLen=1024;
-  char aStr[1024];
+  DWORD aLen=1024;
+  wchar_t aStr[1024];
   HANDLE aToken=0;
   HANDLE hProcess = GetCurrentProcess();
   OpenProcessToken(hProcess,TOKEN_QUERY,&aToken);
   if( ! GetUserProfileDirectory( aToken, aStr, &aLen ) )
     reject();
 
-  env = aStr;
+  if ( aLen > 0 )
+    env = QString::fromWCharArray(aStr, aLen);
 #else
   if( ! ::getenv( "HOME" ) )
     reject();