WinPE C++ Program Hardware Access Guides?

Clam10 1 Reputation point
2021-06-09T20:15:54.103+00:00

Is it possible to write a C or C++ program for Windows Preinstallation Environment (WinPE) that can access the hardware (PCI config space registers and memory i/o space)? If so, are there any guides to it since I couldn't find anything about it?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,904 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,683 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Doron Holan 1,801 Reputation points
    2021-06-10T05:07:33.927+00:00

    What bigger problem are you trying to solve? From a pure access to hardware/device driver point of view WinPE is no different than normal Windows. By default, WinPE does not grant user mode access to PCI config space registers or memory io space. You would need to install a device driver for the PCI device in question and that driver would have to enable access to these resources (usually through an IOCTL interface, mapping resources directly into user mode is quite dangerous and a big security hole).

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.