ReactOS 0.4.15-dev-7931-gfd331f1
cmreslist.h File Reference
#include <wdm.h>
Include dependency graph for cmreslist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

FORCEINLINE PCM_PARTIAL_RESOURCE_DESCRIPTOR CmiGetNextPartialDescriptor (_In_ const CM_PARTIAL_RESOURCE_DESCRIPTOR *PartialDescriptor)
 
FORCEINLINE PCM_FULL_RESOURCE_DESCRIPTOR CmiGetNextResourceDescriptor (_In_ const CM_FULL_RESOURCE_DESCRIPTOR *ResourceDescriptor)
 

Function Documentation

◆ CmiGetNextPartialDescriptor()

FORCEINLINE PCM_PARTIAL_RESOURCE_DESCRIPTOR CmiGetNextPartialDescriptor ( _In_ const CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor)

Definition at line 31 of file cmreslist.h.

33{
34 const CM_PARTIAL_RESOURCE_DESCRIPTOR *NextDescriptor;
35
36 /* Assume the descriptors are the fixed size ones */
37 NextDescriptor = PartialDescriptor + 1;
38
39 /* But check if this is actually a variable-sized descriptor */
40 if (PartialDescriptor->Type == CmResourceTypeDeviceSpecific)
41 {
42 /* Add the size of the variable section as well */
43 NextDescriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)((ULONG_PTR)NextDescriptor +
44 PartialDescriptor->u.DeviceSpecificData.DataSize);
45 ASSERT(NextDescriptor >= PartialDescriptor + 1);
46 }
47
48 /* Now the correct pointer has been computed, return it */
49 return (PCM_PARTIAL_RESOURCE_DESCRIPTOR)NextDescriptor;
50}
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR * PCM_PARTIAL_RESOURCE_DESCRIPTOR
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
#define ASSERT(a)
Definition: mode.c:44
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@393 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@393::@402 DeviceSpecificData
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by CmiGetNextResourceDescriptor(), PciComputeNewCurrentSettings(), and PciDebugPrintCmResList().

◆ CmiGetNextResourceDescriptor()

FORCEINLINE PCM_FULL_RESOURCE_DESCRIPTOR CmiGetNextResourceDescriptor ( _In_ const CM_FULL_RESOURCE_DESCRIPTOR ResourceDescriptor)

Definition at line 54 of file cmreslist.h.

56{
57 const CM_PARTIAL_RESOURCE_DESCRIPTOR *LastPartialDescriptor;
58
59 /* Calculate the location of the last partial descriptor, which can have a
60 variable size! */
61 LastPartialDescriptor = &ResourceDescriptor->PartialResourceList.PartialDescriptors[
62 ResourceDescriptor->PartialResourceList.Count - 1];
63
64 /* Next full resource descriptor follows the last partial descriptor */
65 return (PCM_FULL_RESOURCE_DESCRIPTOR)CmiGetNextPartialDescriptor(LastPartialDescriptor);
66}
FORCEINLINE PCM_PARTIAL_RESOURCE_DESCRIPTOR CmiGetNextPartialDescriptor(_In_ const CM_PARTIAL_RESOURCE_DESCRIPTOR *PartialDescriptor)
Definition: cmreslist.h:31

Referenced by IopCheckForResourceConflict(), IopCheckResourceDescriptor(), IopTranslateDeviceResources(), and PdoStartDevice().