mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 04:41:24 +00:00
[UMPNPMGR] PNP_AddEmptyLogConf: Add resource list to an existing requirements list
This commit is contained in:
parent
bc64f3aee1
commit
71b6fab74b
1 changed files with 53 additions and 1 deletions
|
@ -613,6 +613,26 @@ NextResourceDescriptor(
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
PIO_RESOURCE_LIST
|
||||
NextResourceRequirement(
|
||||
_In_ PIO_RESOURCE_LIST pResourceList)
|
||||
{
|
||||
LPBYTE pNext = NULL;
|
||||
|
||||
if (pResourceList == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Skip the resource list */
|
||||
pNext = (LPBYTE)pResourceList + sizeof(IO_RESOURCE_LIST);
|
||||
|
||||
/* Skip the resource descriptors */
|
||||
pNext += (pResourceList->Count - 1) * sizeof(IO_RESOURCE_DESCRIPTOR);
|
||||
|
||||
return (PIO_RESOURCE_LIST)pNext;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
BOOL
|
||||
IsCallerInteractive(
|
||||
|
@ -4458,7 +4478,39 @@ PNP_AddEmptyLogConf(
|
|||
}
|
||||
else if (RegDataType == REG_RESOURCE_REQUIREMENTS_LIST)
|
||||
{
|
||||
/* FIXME */
|
||||
PIO_RESOURCE_REQUIREMENTS_LIST pRequirementsList = NULL;
|
||||
PIO_RESOURCE_LIST pResourceList = NULL;
|
||||
ULONG ulIndex;
|
||||
|
||||
/* Reallocate a larger buffer in order to add the new configuration */
|
||||
ulNewSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST);
|
||||
pDataBuffer = HeapReAlloc(GetProcessHeap(),
|
||||
0,
|
||||
pDataBuffer,
|
||||
ulDataSize + ulNewSize);
|
||||
if (pDataBuffer == NULL)
|
||||
{
|
||||
ret = CR_OUT_OF_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
pRequirementsList = (PIO_RESOURCE_REQUIREMENTS_LIST)pDataBuffer;
|
||||
pResourceList = (PIO_RESOURCE_LIST)&pRequirementsList->List[0];
|
||||
for (ulIndex = 0; ulIndex < pRequirementsList->AlternativeLists - 1; ulIndex++)
|
||||
pResourceList = NextResourceRequirement(pResourceList);
|
||||
|
||||
pRequirementsList->ListSize = ulDataSize + ulNewSize;
|
||||
pRequirementsList->AlternativeLists++;
|
||||
|
||||
pResourceList->Version = 1;
|
||||
pResourceList->Revision = 1;
|
||||
pResourceList->Count = 1;
|
||||
|
||||
pResourceList->Descriptors[0].Option = IO_RESOURCE_PREFERRED;
|
||||
pResourceList->Descriptors[0].Type = CmResourceTypeConfigData;
|
||||
pResourceList->Descriptors[0].u.ConfigData.Priority = ulPriority;
|
||||
|
||||
*pulLogConfTag = ulIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue