GetVersionEx(&osver);
bManageDirectory = 0;
- if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
+ if (osver.dwMajorVersion < 5) {
char szBuffer[MAX_PATH*driveCount];
if (GetLogicalDriveStringsA(sizeof(szBuffer), szBuffer)) {
char* pEnv = (char*)GetEnvironmentStringsA();
}
SetDefaultA(".");
}
- else { /* Windows NT or later */
+ else { /* Windows 2000 or later */
WCHAR szBuffer[MAX_PATH*driveCount];
if (GetLogicalDriveStringsW(sizeof(szBuffer), szBuffer)) {
WCHAR* pEnv = GetEnvironmentStringsW();
int VDir::SetDirW(WCHAR const *pPath, int index)
{
WCHAR chr, *ptr;
- char szBuffer[MAX_PATH+1];
int length = 0;
if (index < driveCount && pPath != NULL) {
length = wcslen(pPath);
pMem->Free(dirTableW[index]);
ptr = dirTableW[index] = (WCHAR*)pMem->Malloc((length+2)*2);
if (ptr != NULL) {
+ char *ansi;
wcscpy(ptr, pPath);
ptr += length-1;
chr = *ptr++;
*ptr++ = '\\';
*ptr = '\0';
}
- WideCharToMultiByte(CP_ACP, 0, dirTableW[index], -1, szBuffer, sizeof(szBuffer), NULL, NULL);
- length = strlen(szBuffer);
+ ansi = win32_ansipath(dirTableW[index]);
+ length = strlen(ansi);
pMem->Free(dirTableA[index]);
dirTableA[index] = (char*)pMem->Malloc(length+1);
if (dirTableA[index] != NULL) {
- strcpy(dirTableA[index], szBuffer);
+ strcpy(dirTableA[index], ansi);
}
+ win32_free(ansi);
}
}
/*
* On WinNT GetFullPathName does not fail, (or at least always
- * succeeds when the drive is valid) WinNT does set *Dest to Nullch
+ * succeeds when the drive is valid) WinNT does set *Dest to NULL
* On Win98 GetFullPathName will set last error if it fails, but
* does not touch *Dest
*/
/*
* On WinNT GetFullPathName does not fail, (or at least always
- * succeeds when the drive is valid) WinNT does set *Dest to Nullch
+ * succeeds when the drive is valid) WinNT does set *Dest to NULL
* On Win98 GetFullPathName will set last error if it fails, but
* does not touch *Dest
*/