Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Failed to find .sys file when converting qt version from 5.1.1 to 5.3

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

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.7k Views
  • 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 Offline
    S Offline
    samsam
    wrote on last edited by
    #1

    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
    0
    • T3STYT Offline
      T3STYT Offline
      T3STY
      wrote on last edited by
      #2

      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
      0
      • S Offline
        S Offline
        samsam
        wrote on last edited by
        #3

        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
        0
        • T3STYT Offline
          T3STYT Offline
          T3STY
          wrote on last edited by
          #4

          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
          0
          • S Offline
            S Offline
            samsam
            wrote on last edited by
            #5

            Thank you! it works now...

            1 Reply Last reply
            0
            • T3STYT Offline
              T3STYT Offline
              T3STY
              wrote on last edited by
              #6

              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
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved