The MASM Forum

General => The Workshop => Topic started by: dedndave on June 17, 2014, 12:31:30 PM

Title: IsWow64Process
Post by: dedndave on June 17, 2014, 12:31:30 PM
i wonder if i could get you guys to test this for me
if you are running a 32-bit program (which it is) under a 64-bit OS, the result should be TRUE
if you run it under a 32-bit OS, it should display 00000000

let me know if it works correctly or not, and your OS and bits - thanks   :t

        INVOKE  GetModuleHandle,offset szKernel32
        INVOKE  GetProcAddress,eax,offset szIsWow64
        .if eax
            xchg    eax,ebx
            INVOKE  GetCurrentProcess
            push    -1
            push    esp
            push    eax
            call    ebx
            pop     eax
            print   uhex$(eax),13,10
        .else
            print   chr$('IsWow64Process function not present'),13,10
        .endif

        print   chr$(13,10)
        inkey
        INVOKE  ExitProcess,0


i am runing XP-32 SP3 and it displays 00000000
Title: Re: IsWow64Process
Post by: vogelsang on June 17, 2014, 02:14:59 PM
It returns 00000001 on Windows 7 64 bit.
Title: Re: IsWow64Process
Post by: sinsi on June 17, 2014, 02:23:12 PM
64-bits all return 1 - XPPro, Win7, Win8
32-bits all return 0 - XPPro, Vista, Win7
Function not present - Win2000  :biggrin:
Title: Re: IsWow64Process
Post by: vogelsang on June 17, 2014, 02:45:54 PM
I'm guessing - if your doing CPUID stuff, that link should be helpful:

http://developer.amd.com/resources/documentation-articles/processor-and-core-enumeration-using-cpuid/
(http://developer.amd.com/resources/documentation-articles/processor-and-core-enumeration-using-cpuid/)
It contains sample code which calls IsWow64Process.
Title: Re: IsWow64Process
Post by: Siekmanski on June 17, 2014, 05:54:48 PM
64 bit windows 8.1 returns 1
Title: Re: IsWow64Process
Post by: Gunther on June 17, 2014, 07:14:49 PM
Windows 7-32:

00000000

Press any key to continue ...


The test under Windows 7-64 follows this evening.

Gunther
Title: Re: IsWow64Process
Post by: dedndave on June 17, 2014, 07:39:00 PM
wow guys - that's great - thanks, again   :t

Sinsi has a regular test facility over there   :biggrin:
Title: Re: IsWow64Process
Post by: Gunther on June 17, 2014, 09:38:00 PM
Dave,

Quote from: dedndave on June 17, 2014, 07:39:00 PM
wow guys - that's great - thanks, again   :t

Sinsi has a regular test facility over there   :biggrin:

We like you. That's the reason.

Gunther
Title: Re: IsWow64Process
Post by: Gunther on June 18, 2014, 01:00:24 AM
Dave,

the output from Windows 7 - 64:

00000001

Press any key to continue ...


Gunther
Title: Re: IsWow64Process
Post by: RuiLoureiro on June 18, 2014, 01:48:03 AM
00000000       <----- 32 bit XP

Press any key to continue ...