From 9a478189e5564e978747654610c93bb0feb078fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 19 Nov 2025 15:48:35 +0100 Subject: [PATCH] [VIDEOPRT] registry.c: Uniformize some error debug traces --- win32ss/drivers/videoprt/registry.c | 42 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/win32ss/drivers/videoprt/registry.c b/win32ss/drivers/videoprt/registry.c index 64be3601827..eeba2f5e3cd 100644 --- a/win32ss/drivers/videoprt/registry.c +++ b/win32ss/drivers/videoprt/registry.c @@ -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); }