Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@HBelusca
Copy link
Contributor

@HBelusca HBelusca commented Nov 6, 2025

Purpose & Proposed changes

The choice is done by looking for the presence or absence of the HKLM\System\CurrentControlSet\Control\GraphicsDrivers\DisableEmulator registry key. For more details, see:
https://www.geoffchappell.com/studies/windows/km/hal/api/x86bios/call.htm

By default, use V86 in 32-bit Win2k3-compatible builds, otherwise (Vista+) check the presence of the registry key.

The X86 emulator routines are exported by the HAL.DLL. They are always exported by the non-x86 HAL. However, they may or may not be exported by the x86 (32-bit) HAL: on NT 5.2 and below they are not exported, while on NT 6.x (Vista+) they are.

Therefore:

  • in our NT <= 5.2 x86 builds, we load the routines at runtime. If they aren't found, we fail emulator support initialization and fall back to VDM V86 support.

  • in our NT 6.x (x86 or not) builds, we always directly link with the HAL routines, since they are guaranteed to be present there.

…lator on x86 32-bit builds.

The choice is done by looking for the presence or absence of the
`HKLM\System\CurrentControlSet\Control\GraphicsDrivers\DisableEmulator`
registry key. For more details, see:
https://www.geoffchappell.com/studies/windows/km/hal/api/x86bios/call.htm

By default, use V86 in 32-bit Win2k3-compatible builds, otherwise
(Vista+) check the presence of the registry key.

The X86 emulator routines are exported by the HAL.DLL. They are always
exported by the non-x86 HAL. However, they may or may not be exported by
the x86 (32-bit) HAL: on NT 5.2 and below they are not exported, while
on NT 6.x (Vista+) they are.

Therefore:

- in our NT <= 5.2 x86 builds, we load the routines at runtime. If they
  aren't found, we fail emulator support initialization and fall back to
  VDM V86 support.

- in our NT 6.x (x86 or not) builds, we always directly link with the HAL
  routines, since they are guaranteed to be present there.
@HBelusca HBelusca self-assigned this Nov 6, 2025
@HBelusca HBelusca added enhancement For PRs with an enhancement/new feature. Win32SS For Win32 subsystem (Win32k, GDI/USER DLLs, etc.) related components PRs. labels Nov 6, 2025
@HBelusca
Copy link
Contributor Author

HBelusca commented Nov 6, 2025

Cc @archeYR for testing on real hardware :D

@github-actions github-actions bot added the drivers Kernel mode drivers and frameworks label Nov 6, 2025
}

#if defined(_M_IX86) || defined(_M_AMD64)
static FORCEINLINE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GCC error: multiple storage classes in declaration specifiers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drivers Kernel mode drivers and frameworks enhancement For PRs with an enhancement/new feature. Win32SS For Win32 subsystem (Win32k, GDI/USER DLLs, etc.) related components PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants