New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NTOS:PNP] IopEnumerateDetectedDevices(): General refactoring #5276
Conversation
This stuff should be moved to HAL, the kernel must not be responsible for mapping devices on a particular type of system. That would be a refactoring! |
Is this because the kernel should stay as much as possible system-agnostic, while the HAL indeed can depend on the system it supports? |
Reply from @binarymaster :
I can agree with this, specifically for the controllers that may have different PnP identifiers on different types of systems (e.g. PC/AT vs. PC-98), however some known devices would always have the same identifiers (most keyboards and mices). Redesigning it the way you described is a good idea, but it's out of scope of this PR.
This is correct, however the goal of this PR/patch is to simplify the function, reducing amount of code, without breaking current logic in any way (even if it's not perfect). Changing the things in a more correct way that you described would rather be a "bugfix"/"enhancement" than refactoring. 🙂 |
Why not leave this device mapping logic in the kernel for compatibility? |
There is a general code in the kernel for managing device objects and its resources, and it is PnP device management code. This "firmware mapper" thing creates a parallel code path which does the same thing. I want to remove it to avoid code duplication and bugs.
For compatibility with what? |
Example: replacing the hal.dll with one from Windows |
Such scenario will not be supported by ReactOS. Supporting HALs from Windows (2003) is a quite an amount of work, and puts too many restrictions on internal design of things |
CORE-18962 - Deduplicate a while-loop by adding one more recursive call. - Add IopMapDetectedDeviceId() helper function with a structure in order to reduce hardcoded constants and checks.
8cec2e6
to
85ca8af
Compare
**NOTE: Made on behalf of @binarymaster **
Purpose
JIRA issue: CORE-18962