|
Navigation
- Home
- Community
- Development
- myReactOS
- Fundraiser 2012
Doxygen
- Main Page
- Alphabetical List
- Data Structures
- Directories
- File List
- Data Fields
- Globals
- Related Pages
Search
|
|
|
Definition at line 304 of file resource.cpp.
Referenced by PortClsPnp().
{
PCM_RESOURCE_LIST NewUntranslatedResources, NewTranslatedResources;
ULONG ResourceSize, ResourceCount;
CResourceList* NewList;
NTSTATUS Status;
if (!TranslatedResourceList)
{
if (UntranslatedResourceList)
{
return STATUS_INVALID_PARAMETER;
}
}
else
{
if (!UntranslatedResourceList)
{
return STATUS_INVALID_PARAMETER;
}
}
NewList = new(PoolType, TAG_PORTCLASS)CResourceList(OuterUnknown);
if (!NewList)
return STATUS_INSUFFICIENT_RESOURCES;
Status = NewList->QueryInterface(IID_IResourceList, (PVOID*)OutResourceList);
if (!NT_SUCCESS(Status))
{
delete NewList;
return STATUS_INVALID_PARAMETER;
}
if (!TranslatedResourceList)
{
return STATUS_SUCCESS;
}
ASSERT(UntranslatedResourceList->List[0].PartialResourceList.Count == TranslatedResourceList->List[0].PartialResourceList.Count);
ResourceCount = UntranslatedResourceList->List[0].PartialResourceList.Count;
#ifdef _MSC_VER
ResourceSize = FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.PartialDescriptors[ResourceCount]);
#else
ResourceSize = sizeof(CM_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + (ResourceCount) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
#endif
NewTranslatedResources = (PCM_RESOURCE_LIST)AllocateItem(PoolType, ResourceSize, TAG_PORTCLASS);
if (!NewTranslatedResources)
{
delete NewList;
return STATUS_INSUFFICIENT_RESOURCES;
}
NewUntranslatedResources = (PCM_RESOURCE_LIST)AllocateItem(PoolType, ResourceSize, TAG_PORTCLASS);
if (!NewUntranslatedResources)
{
delete NewList;
FreeItem(NewTranslatedResources, TAG_PORTCLASS);
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlCopyMemory(NewTranslatedResources, TranslatedResourceList, ResourceSize);
RtlCopyMemory(NewUntranslatedResources, UntranslatedResourceList, ResourceSize);
NewList->m_TranslatedResourceList= NewTranslatedResources;
NewList->m_UntranslatedResourceList = NewUntranslatedResources;
NewList->m_NumberOfEntries = ResourceCount;
NewList->m_MaxEntries = ResourceCount;
NewList->m_PoolType = PoolType;
return STATUS_SUCCESS;
}
|
Generated on Sat May 26 2012 05:26:00 for ReactOS by
1.7.6.1
|