r=dougt, a=brendan
Make OS/2 Desktop directory NLS aware


git-svn-id: svn://10.0.0.236/trunk@76440 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com 2000-08-16 14:27:18 +00:00
parent 47f1260e9d
commit 049de0d702

View File

@ -38,6 +38,7 @@
#include <stdio.h>
#elif defined(XP_OS2)
#define MAX_PATH _MAX_PATH
#define INCL_WINWORKPLACE
#include <os2.h>
#include <stdlib.h>
#include <stdio.h>
@ -823,14 +824,20 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
case OS2_DesktopDirectory:
{
ULONG ulBootDrive = 0;
char buffer[] = " :\\desktop\\";
DosQuerySysInfo( QSV_BOOT_DRIVE, QSV_BOOT_DRIVE,
&ulBootDrive, sizeof ulBootDrive);
buffer[0] = 'A' - 1 + ulBootDrive; // duh, 1-based index...
*this = buffer;
char szPath[CCHMAXPATH + 1];
BOOL fSuccess;
fSuccess = WinQueryActiveDesktopPathname (szPath, sizeof(szPath));
int len = strlen (szPath);
if (len > CCHMAXPATH -1)
break;
szPath[len] = '\\';
szPath[len + 1] = '\0';
#ifdef DEBUG
printf( "Got OS2_DesktopDirectory: %s\n", buffer);
if (fSuccess) {
printf ("Got OS2_DesktopDirectory: %s\n", szPath);
} else {
printf ("Failed getting OS2_DesktopDirectory: %s\n", szPath);
}
#endif
break;
}