12#ifndef CONFIGURATION_MANAGER_HELPER_H_
13#define CONFIGURATION_MANAGER_HELPER_H_
50#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type) \
55 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, \
56 IN CONST CM_OBJECT_TOKEN Token OPTIONAL, \
58 OUT UINT32 * CONST Count OPTIONAL \
62 CM_OBJ_DESCRIPTOR CmObjectDesc; \
63 UINT32 ObjCount = 0; \
65 Status = EFI_INVALID_PARAMETER; \
68 "ERROR: Get" #CmObjectId ": Invalid out parameter for" \
69 " object list. Status = %r\n", \
74 Status = CfgMgrProtocol->GetObject ( \
76 CREATE_CM_OBJECT_ID ( \
83 if (EFI_ERROR (Status)) { \
86 "INFO: Get" #CmObjectId ": Platform does not implement " \
87 #CmObjectId ". Status = %r\n", \
93 if (CmObjectDesc.ObjectId != \
94 CREATE_CM_OBJECT_ID (CmObjectNameSpace, CmObjectId)) { \
97 "ERROR: Get" #CmObjectId ": " #CmObjectId \
98 ": Invalid ObjectId = 0x%x\n, expected Id = 0x%x\n", \
99 CmObjectDesc.ObjectId, \
100 CREATE_CM_OBJECT_ID (CmObjectNameSpace, CmObjectId) \
103 Status = EFI_INVALID_PARAMETER; \
104 goto error_handler; \
106 if (CmObjectDesc.Size < (sizeof (Type) * CmObjectDesc.Count)) { \
109 "ERROR: Get" #CmObjectId ": " #CmObjectId \
110 ": Buffer too small, size = 0x%x\n", \
114 Status = EFI_BAD_BUFFER_SIZE; \
115 goto error_handler; \
117 ObjCount = CmObjectDesc.Count; \
118 *List = (Type*)CmObjectDesc.Data; \
120 if (Count != NULL) { \