Programmatic Parsing of ACPI _CRS Resource Templates in WDM Kernel Drivers

BILL Bella 20 Reputation points
2026-05-13T14:47:10.4766667+00:00

We're trying to develop a low-level hardware abstraction layer for a proprietary chipset, necessitating the manual interrogation of platform resources through the Windows Driver Model. While we have successfully invoked the _CRS method to extract the raw ResourceTemplate buffer, we are seeking a documented kernel-mode interface to deconstruct this binary blob into intelligible structures like memory ranges or IRQ assignments. Does the Windows kernel provide a standardized set of helper functions or a specific system-provided parser to iterate through these ACPI resource descriptors? We look for any advice and suggestion. Thanks!

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up upgrades and drivers
0 comments No comments

1 answer

Sort by: Most helpful
  1. Harry Phan 28,050 Reputation points Independent Advisor
    2026-05-13T15:24:45.47+00:00

    Hi BILL,

    Windows does not expose a public kernel‑mode parser for ACPI _CRS buffers; the supported approach is to use the Plug and Play manager’s resource APIs, which return already‑parsed resource lists rather than manually decoding the raw AML template.

    When you evaluate _CRS and obtain the ResourceTemplate, the binary blob is in ACPI AML format. The kernel does not provide a documented helper to iterate through those descriptors directly. Instead, the recommended path is to let the ACPI driver and PnP manager handle parsing and then query the results via standard interfaces. In WDM, you can issue IRP_MN_QUERY_RESOURCE_REQUIREMENTS or IRP_MN_QUERY_RESOURCES to the PDO, which returns a CM_RESOURCE_LIST or IO_RESOURCE_REQUIREMENTS_LIST. These structures are already expanded into intelligible ranges, IRQs, and DMA channels, and they are the only supported way to consume ACPI resource data in kernel mode.

    If you attempt to parse the AML yourself, you are outside the documented contract and risk breaking with future ACPI revisions. Microsoft’s driver documentation explicitly advises against manual parsing of _CRS buffers; the ACPI.sys driver owns that responsibility. For low‑level abstraction layers, the correct design is to bind to the device stack and consume the resource lists provided by the OS. If your chipset requires special handling, you can implement a bus filter driver that intercepts the resource IRPs and adjusts them before they reach the function driver.

    In short, there is no system‑provided parser you can call; the standardized interface is the resource IRP mechanism. If you need further detail, I suggest reviewing the ACPI resource descriptors in the ACPI specification and the Windows IRP_MN_QUERY_RESOURCES documentation, which outline the supported structures and workflow.


    If the above response helps answer your question, please hit "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    Harry.

    Was this answer helpful?

    0 comments No comments

Your answer

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