Opened 18 years ago

Closed 18 years ago

#32 closed defect (fixed)

QDir::rootDirPath() causes an access violation

Reported by: froloff Owned by: dmik
Priority: normal Milestone: qt-os2-3.3.1-rc07
Component: tools Version: 3.3.1-rc06
Severity: normal Keywords: trap access violation
Cc:

Description (last modified by dmik)

Finally I found the bug, which cause QT application trap on my notebook, when using file dialog. It is strange that this mistake doesn't cause trap on desktop PC ;)

Here is the fixed version of QDir::rootDirPath() function:

QString QDir::rootDirPath()

{
    ULONG bootDrive[1] = {0};

    DosQuerySysInfo( QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, (PVOID)bootDrive, sizeof(bootDrive) );

    QString d = QChar( (char)(bootDrive[0] + 'A' - 1) );

    d += ":/";

    return d;

}

Change History (1)

comment:1 by dmik, 18 years ago

Component: kerneltools
Description: modified (diff)
Keywords: trap access violation added
Milestone: qt-os2-3.3.1-rc07
Resolution: fixed
Status: newclosed
Summary: qdir_pm.cpp bugQDir::rootDirPath() causes an access violation
Version: 3.3.1-rc06

This bug has already been fixed in r123. You should update from SVN more often :) But thank you anyway, it was a nasty typo. It may not cause traps on your desktop PC because you have the HOME environment variable set there, as opposed to your notebook.

Note: See TracTickets for help on using tickets.