[VIDEOPRT] registry.c: Uniformize some error debug traces

This commit is contained in:
Hermès Bélusca-Maïto
2025-11-19 15:48:35 +01:00
parent 1b89086bae
commit 9a478189e5
+20 -22
View File
@@ -107,7 +107,7 @@ IntCopyRegistryKey(
Status = ZwOpenKey(&SourceSubKeyHandle, KEY_READ, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "failed to open the source key.\n");
ERR_(VIDEOPRT, "Failed to open the source key\n");
goto Cleanup;
}
@@ -126,7 +126,7 @@ IntCopyRegistryKey(
NULL);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "failed to create the destination key.\n");
ERR_(VIDEOPRT, "Failed to create the destination key\n");
ObCloseHandle(SourceSubKeyHandle, KernelMode);
goto Cleanup;
}
@@ -136,7 +136,7 @@ IntCopyRegistryKey(
if (!NT_SUCCESS(Status))
{
/* Just warn, but continue with the remaining sub-keys */
WARN_(VIDEOPRT, "failed to copy subkey '%wZ'.\n", &NameString);
WARN_(VIDEOPRT, "Failed to copy subkey '%wZ'\n", &NameString);
}
/* Close the sub-key handles */
@@ -211,7 +211,7 @@ IntCopyRegistryKey(
if (!NT_SUCCESS(Status))
{
/* Just warn, but continue with the remaining sub-keys */
WARN_(VIDEOPRT, "failed to set value '%wZ'.\n", &NameString);
WARN_(VIDEOPRT, "Failed to set value '%wZ'\n", &NameString);
}
/* Next subkey */
@@ -221,7 +221,7 @@ IntCopyRegistryKey(
Cleanup:
/* Free the buffer and return the failure code */
if (InfoBuffer != NULL)
ExFreePoolWithTag(InfoBuffer, TAG_VIDEO_PORT_BUFFER);
ExFreePoolWithTag(InfoBuffer, TAG_VIDEO_PORT_BUFFER);
return Status;
}
@@ -285,9 +285,7 @@ IntCopyRegistryValue(
ExFreePoolWithTag(ValueInformation, TAG_VIDEO_PORT_BUFFER);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "ZwSetValueKey failed: status 0x%lx\n", Status);
}
ERR_(VIDEOPRT, "ZwSetValueKey failed, status 0x%lx\n", Status);
return Status;
}
@@ -312,7 +310,7 @@ IntSetupDeviceSettingsKey(
&DevInstRegKey);
if (Status != STATUS_SUCCESS)
{
ERR_(VIDEOPRT, "Failed to open device software key. Status 0x%lx\n", Status);
ERR_(VIDEOPRT, "Failed to open device software key, status 0x%lx\n", Status);
return Status;
}
@@ -329,7 +327,7 @@ IntSetupDeviceSettingsKey(
if (Status != STATUS_SUCCESS)
{
ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status);
ERR_(VIDEOPRT, "Failed to open settings key, status 0x%lx\n", Status);
return Status;
}
@@ -342,7 +340,7 @@ IntSetupDeviceSettingsKey(
Status = ZwOpenKey(&SourceKeyHandle, KEY_READ, &ObjectAttributes);
if (Status != STATUS_SUCCESS)
{
ERR_(VIDEOPRT, "ZwOpenKey failed for settings key: status 0x%lx\n", Status);
ERR_(VIDEOPRT, "ZwOpenKey failed for settings key, status 0x%lx\n", Status);
ObCloseHandle(DestKeyHandle, KernelMode);
return Status;
}
@@ -427,7 +425,7 @@ IntCreateNewRegistryPath(
&DeviceExtension->RegistryPath,
&DeviceExtension->NewRegistryPath);
if (!NT_SUCCESS(Status))
ERR_(VIDEOPRT, "IntDuplicateUnicodeString() failed with status 0x%lx\n", Status);
ERR_(VIDEOPRT, "IntDuplicateUnicodeString() failed, status 0x%lx\n", Status);
return Status;
}
@@ -438,7 +436,7 @@ IntCreateNewRegistryPath(
&DevInstRegKey);
if (Status != STATUS_SUCCESS)
{
ERR_(VIDEOPRT, "IoOpenDeviceRegistryKey failed: status 0x%lx\n", Status);
ERR_(VIDEOPRT, "IoOpenDeviceRegistryKey failed, status 0x%lx\n", Status);
return Status;
}
@@ -456,7 +454,7 @@ IntCreateNewRegistryPath(
Status = ExUuidCreate(&VideoId);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "ExUuidCreate failed: status 0x%lx\n", Status);
ERR_(VIDEOPRT, "ExUuidCreate failed, status 0x%lx\n", Status);
ObCloseHandle(DevInstRegKey, KernelMode);
return Status;
}
@@ -465,7 +463,7 @@ IntCreateNewRegistryPath(
Status = RtlStringFromGUID(&VideoId, &VideoIdString);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "RtlStringFromGUID failed: status 0x%lx\n", Status);
ERR_(VIDEOPRT, "RtlStringFromGUID failed, status 0x%lx\n", Status);
ObCloseHandle(DevInstRegKey, KernelMode);
return Status;
}
@@ -488,7 +486,7 @@ IntCreateNewRegistryPath(
ValueInformation->DataLength);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "ZwSetValueKey failed: status 0x%lx\n", Status);
ERR_(VIDEOPRT, "ZwSetValueKey failed, status 0x%lx\n", Status);
ObCloseHandle(DevInstRegKey, KernelMode);
return Status;
}
@@ -515,7 +513,7 @@ IntCreateNewRegistryPath(
TAG_VIDEO_PORT);
if (DeviceExtension->NewRegistryPath.Buffer == NULL)
{
ERR_(VIDEOPRT, "Failed to allocate key name buffer.\n");
ERR_(VIDEOPRT, "Failed to allocate key name buffer\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -535,7 +533,7 @@ IntCreateNewRegistryPath(
DeviceExtension->NewRegistryPath.Buffer);
}
/* Append a the instance path */ /// \todo HACK
/* Append the instance path */ /// \todo HACK
RtlAppendUnicodeToString(&DeviceExtension->NewRegistryPath, L"\\");
InstanceIdBuffer = DeviceExtension->NewRegistryPath.Buffer +
DeviceExtension->NewRegistryPath.Length / sizeof(WCHAR);
@@ -554,7 +552,8 @@ IntCreateNewRegistryPath(
DeviceExtension->NewRegistryPath.Buffer);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "Failed create key '%wZ'\n", &DeviceExtension->NewRegistryPath);
ERR_(VIDEOPRT, "Failed to create key '%wZ', status 0x%lx\n",
&DeviceExtension->NewRegistryPath, Status);
return Status;
}
@@ -567,7 +566,7 @@ IntCreateNewRegistryPath(
Status = ZwOpenKey(&NewKey, KEY_WRITE, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status);
ERR_(VIDEOPRT, "Failed to open settings key, status 0x%lx\n", Status);
return Status;
}
@@ -580,7 +579,7 @@ IntCreateNewRegistryPath(
Status = ZwOpenKey(&SettingsKey, KEY_READ, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status);
ERR_(VIDEOPRT, "Failed to open settings key, status 0x%lx\n", Status);
ObCloseHandle(NewKey, KernelMode);
return Status;
}
@@ -694,7 +693,6 @@ IntCreateRegistryPath(
/* Check if registry key exists */
Valid = NT_SUCCESS(RtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, DeviceRegistryPath->Buffer));
if (!Valid)
ExFreePoolWithTag(DeviceRegistryPath->Buffer, TAG_VIDEO_PORT);
}