From 0b21fddef67a5aceacbabbc1cc9edb9037d0e2e8 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 23 Aug 2024 10:27:23 +0200 Subject: [PATCH] [channels,serial] improve IRP processing logging --- channels/serial/client/serial_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index f54c705ef..8577de890 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -497,10 +497,15 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) break; } - WLog_Print(serial->log, WLOG_DEBUG, - "IRP MajorFunction: %s, MinorFunction: 0x%08" PRIX32 " returned 0x%08" PRIx32 - ", I0Status=0x%08" PRIx32 "\n", - rdpdr_irp_string(irp->MajorFunction), irp->MinorFunction, error, irp->IoStatus); + DWORD level = WLOG_TRACE; + if (error) + level = WLOG_WARN; + + WLog_Print(serial->log, level, + "[%s|0x%08" PRIx32 "] completed with %s [0x%08" PRIx32 "] (IoStatus %s [0x%08" PRIx32 + "])", + rdpdr_irp_string(irp->MajorFunction), irp->MajorFunction, WTSErrorToString(error), + error, NtStatus2Tag(irp->IoStatus), irp->IoStatus); return error; }