Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Failed to find .sys file when converting qt version from 5.1.1 to 5.3

    General and Desktop
    2
    6
    1452
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      samsam last edited by

      I have a project in QT version 5.1.1. I tried to check in this project if the OS version is windows 8.1 as I saw in this page http://qt-project.org/doc/qt-5/QSysInfo.html

      But this check (of OS win 8.1) available only from QT 5.2. So I converted my QT version to the latest (5.3.1), but now I have a new problem, very strange problem:

      In my project I check if specific file (.sys) in the “C:\Windows\System32\Drivers" is exist. I see that the file is exist but the
      @QFile.exists()@
      returns me false.

      I try to look into the folder with:

      @QDir folder("C:\Windows\System32\Drivers");
      QStringList list = folder.entryList(); @
      And the function returned me only 7 files (.txt, .sys and etc.) when in the folder there is more than 50 files.

      Can someone help me with that problem?

      1 Reply Last reply Reply Quote 0
      • T3STY
        T3STY last edited by

        easy question: are you running your application as administrator?
        Windows 8 has enforced the Windows 7 file protection so now you can only view protected content if you are administrator.
        not-so-hard question: are you running 32-bit application on 64-bit windows? If so, please note that you might be redirected to the 32-bit version of System32, this being, C:/Windows/SysWOW64, where the file you're looking for might not exists.

        1 Reply Last reply Reply Quote 0
        • S
          samsam last edited by

          thanks- actually i saw that i can see in my QT app only the files in the WOW64 folder. Do you know how can I canceling the default redirection to the WOW64 folder and stay in the system32 folder?

          1 Reply Last reply Reply Quote 0
          • T3STY
            T3STY last edited by

            Kernel32.dll provides a function, Wow64DisableWow64FsRedirection, that disables the file system redirection, it is documented here:
            http://msdn.microsoft.com/en-us/library/windows/desktop/aa365743(v=vs.85).aspx
            It allows 32-bit applications to access directories meant for 64-bit only software. But obviously, this doesn't overcome the 32-bit limitations over 64-bit software (you may not load the 64-bit user32.dll from your 32-bit application). For your simple file check, it is going to work fine.
            I'm not sure there exists any function for this ready-made in Qt, I think you may have to use the Windows SDK for this task.

            1 Reply Last reply Reply Quote 0
            • S
              samsam last edited by

              Thank you! it works now...

              1 Reply Last reply Reply Quote 0
              • T3STY
                T3STY last edited by

                I'm glad it works now. Remember to read-enable the FSredirection as soon as possible, or you're going to have more problems after.
                Also, please note that this issue is not due to the port from qt 5.1.1 to 5.3.1, it is a behavior of all 32-bit apps on 64-bit windows.
                Good luck :-)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post