64 Bit harbour App : "disable" SysWOW64 ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

64 Bit harbour App : "disable" SysWOW64 ?

Post by AUGE_OHR »

hi,

under 64 Bit App, calling OSK.EXE or WMI WEI, i need to "disable" SysWOW64 "Redirection" when call it

Code: Select all

   oWmi := WmiService()
   IF Is64Bit()
      HMG_CallDLL( "Kernel32.dll", DLL_OSAPI, "Wow64EnableWow64FsRedirection", .F. )                                                      // disable bevor API Call
   ENDIF

   BEGIN SEQUENCE
      FOR EACH oMemory IN oWmi:ExecQuery( "SELECT * FROM Win32_WinSAT" )
         IF VAL( VAR2CHAR( oMemory:CPUScore ) ) = 0
            EXECUTE FILE "winsat formal" WAIT
         ENDIF
         EXIT
      NEXT

      FOR EACH oMemory IN oWmi:ExecQuery( "SELECT * FROM Win32_WinSAT" )
         cInfo += "Processor            : " + VAR2CHAR( oMemory:CPUScore ) + CRLF
         cInfo += "Memory ( RAM )  : " + VAR2CHAR( oMemory:MemoryScore ) + CRLF
         cInfo += "Graphics              : " + VAR2CHAR( oMemory:GraphicsScore ) + CRLF
         cInfo += "Gameing graphics: " + VAR2CHAR( oMemory:D3DScore ) + CRLF
         cInfo += "Primary hard disk: " + VAR2CHAR( oMemory:DiskScore ) + CRLF
         cInfo += "            Base score: " + VAR2CHAR( oMemory:WinSPRLevel ) + CRLF
         EXIT
      NEXT
   END SEQUENCE
   ERRORBLOCK( bError )

   IF Is64Bit()
      HMG_CallDLL( "Kernel32.dll", DLL_OSAPI, "Wow64EnableWow64FsRedirection", .T. )                                                       // enable again
   ENDIF

RETURN cInfo
so my Question is : "why" and "when" do i need to "disable" SysWOW64 "Redirection" :?:
have fun
Jimmy
User avatar
srvet_claudio
Posts: 2224
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: 64 Bit harbour App : "disable" SysWOW64 ?

Post by srvet_claudio »

Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply