Home | Info | Community | Development | myReactOS

  1. Home
  2. Info
  3. Community
  4. Development
  5. myReactOS

ReactOS Community > ReactOS Wiki

Win64 Issues

From ReactOS

Jump to: navigation, search

Issues about moving to 64-bit: Windows and thus ReactOS are originally 32-bit OSes.

The same applies to linux. However it lives succesfully on both, 32-bit and 64-bit platforms. Windows(2000) also went to be a 64-bit OS but still maintains its capability to be compiled for a 32-bit platform and even maintains compatibility with 32-bit applications on 64-bit platforms. Win64 does this with its WOW64 (Windows on Windows64) emulation layer. Windows XP's source is compilable for both 64-bit and 32-bit using a single source. A clean written Win32 application can also be compiled to run on 64-bit with a single source.

How to program

The data model of Win32 is the so called LPI32 which means:

  • int are 32-bit
  • Pointer are 32-bit
  • long are 32-bit
  • long long are 64-bit

For Win64 they did not decide to use LPI64 but LLP64 which means:

  • int still are 32-bit
  • Pointer are 64-bit
  • long still are 32-bit
  • long long are 64-bit

For comparisation Linux' ELF-64 uses the LP64 data model, which means:

  • int still are 32-bit
  • Pointer are 64-bit
  • long are 64-bit
  • long long are 64-bit

This leads to some pitfalls concerning 32<->64 portability. But the problems are far less than Win16->32. The main pitfall is the assumption sizeof(void*)==sizeof(DWORD). This mustn't be assumed in a clean program source. If a program needs the int<->void* polymorphism it should instead use the new types UINT_PTR. Depending on the platform it has automatically the right size.

See http://www.treblig.org/articles/64bits.html for details.