Skip to content

Commit

Permalink
[UMPNPMGR] OpenConfigurationKey: Open subkeys depending on the config…
Browse files Browse the repository at this point in the history
…uration type

- Boot and Basic Configurations are located in the LogConf subkey.
- Alloc and filtered Configurations are located in the Control subkey.
  • Loading branch information
EricKohl committed Jun 28, 2023
1 parent 7f55dd3 commit 44a3124
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion base/services/umpnpmgr/rpcserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,11 @@ static
CONFIGRET
OpenConfigurationKey(
_In_ LPCWSTR pszDeviceID,
_In_ DWORD ulLogConfType,
_Out_ PHKEY phKey)
{
WCHAR szKeyName[MAX_PATH];
PCWSTR pszSubKeyName;
HKEY hInstanceKey;
DWORD dwError;

Expand All @@ -447,9 +449,26 @@ OpenConfigurationKey(
if (dwError != ERROR_SUCCESS)
return CR_INVALID_DEVINST;

switch (ulLogConfType)
{
case BOOT_LOG_CONF:
case BASIC_LOG_CONF:
pszSubKeyName = L"LogConf";
break;

case ALLOC_LOG_CONF:
case FILTERED_LOG_CONF:
pszSubKeyName = L"Control";
break;

default:
DPRINT1("Unsupported configuration type!\n");
return CR_FAILURE;
}

/* Create or open the LogConf key */
dwError = RegCreateKeyExW(hInstanceKey,
L"LogConf",
pszSubKeyName,
0,
NULL,
REG_OPTION_NON_VOLATILE,
Expand Down Expand Up @@ -4197,6 +4216,7 @@ PNP_GetFirstLogConf(
return CR_INVALID_DEVINST;

ret = OpenConfigurationKey(pDeviceID,
ulLogConfType,
&hConfigKey);
if (ret != CR_SUCCESS)
{
Expand Down Expand Up @@ -4297,6 +4317,7 @@ PNP_GetNextLogConf(
return CR_INVALID_DEVINST;

ret = OpenConfigurationKey(pDeviceID,
ulLogConfType,
&hConfigKey);
if (ret != CR_SUCCESS)
{
Expand Down Expand Up @@ -4445,6 +4466,7 @@ PNP_GetNextResDes(
return CR_INVALID_DEVINST;

ret = OpenConfigurationKey(pDeviceID,
ulLogConfType,
&hConfigKey);
if (ret != CR_SUCCESS)
{
Expand Down

0 comments on commit 44a3124

Please sign in to comment.