Win32 message

Hello, I am coding in 64 bit in Visual Studio 2019 C++ nevertheless looking to the output appears "(Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'" among others similar. That means that my program is 32-bit instead of 64?

Windows is a huge a rabbit hole of backwards compatibility, spanning a few decades at this point. The reason Microsoft originally put "32" at the end of everything was to differentiate it from the 16-bit software in previous versions of Windows. By the time 64-bit Windows came, it was already a mess of backwards compatibility, and they decided it was easier to just keep the name "System32".

Ironically, if you are running a 32-bit application on 64-bit Windows, the registry/system folders might actually point to "SysWOW64" instead (at least, for most libraries). It's confusing, yes.

Your exe is probably 64-bit if you set it that way in VS, but if you want to be more sure, you can open the Task Manager, look at the processes tabs, and see if your particular process has (32 bit) in parentheses next to its name. If it doesn't, then congrats, it's 64-bit.

You can also do use sizeof a pointer to see if it's 32-bit or 64-bit.
https://docs.microsoft.com/en-us/cpp/cpp/raw-pointers?view=msvc-160
the sizeof operator when applied to a pointer returns the pointer size, 4 bytes on x86 or 8 bytes on x64
(Caveat: The C++ standard itself is actually not this strict, but Visual Studio makes extra guarantees. Don't rely on the sizeof pointer to be a particular value or your code may rot sooner rather than later.)

There's also ways to check from the exe itself.
https://reverseengineering.stackexchange.com/questions/6040/check-if-exe-is-64-bit
Last edited on
> That means that my program is 32-bit instead of 64?

No. The libraries in Windows\System32 are 64-bit DLLs. (The 32-bit ones would be in Windows\SysWow64)
> There's also ways to check from the exe itself

We can use dumpbin to check it.

For example:
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.4
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>dumpbin /headers C
:\windows\system32\wintypes.dll
Microsoft (R) COFF/PE Dumper Version 14.24.28316.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\windows\system32\wintypes.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
            8664 machine (x64)
               7 number of sections
        869F9715 time date stamp
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            2022 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   DLL

OPTIONAL HEADER VALUES
             20B magic # (PE32+)
           14.15 linker version
           73800 size of code
...

Now I understood! Thank so much Ganado and JLBorges, very precious information
Topic archived. No new replies allowed.