mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[PCIIDEX] Implement missing PciIdeXDebugPrint function (#3146)
It's useful for debugging IDE controller minidrivers, and it makes pciidex.sys work on Windows XP/2003. - https://user-images.githubusercontent.com/37072976/92856412-39d56b80-f415-11ea-880f-48998c11112d.png CORE-17256
This commit is contained in:
parent
345ad55319
commit
0f8de896aa
3 changed files with 32 additions and 2 deletions
|
@ -11,6 +11,9 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/** @brief Global debugging level. Valid values are between 0 (Error) and 3 (Trace). */
|
||||
ULONG PciIdeDebug = 0;
|
||||
|
||||
static DRIVER_DISPATCH PciIdeXForwardOrIgnore;
|
||||
static NTSTATUS NTAPI
|
||||
PciIdeXForwardOrIgnore(
|
||||
|
@ -90,6 +93,32 @@ PciIdeXPnpDispatch(
|
|||
return PciIdeXPdoPnpDispatch(DeviceObject, Irp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prints the given string with printf-like formatting to the kernel debugger.
|
||||
* @param[in] DebugPrintLevel Level of the debug message.
|
||||
* Valid values are between 0 (Error) and 3 (Trace).
|
||||
* @param[in] DebugMessage Format of the string/arguments.
|
||||
* @param[in] ... Variable number of arguments matching the format
|
||||
* specified in \a DebugMessage.
|
||||
* @sa PciIdeDebug
|
||||
*/
|
||||
VOID
|
||||
PciIdeXDebugPrint(
|
||||
_In_ ULONG DebugPrintLevel,
|
||||
_In_z_ _Printf_format_string_ PCCHAR DebugMessage,
|
||||
...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
/* Check if we can print anything */
|
||||
if (DebugPrintLevel <= PciIdeDebug)
|
||||
DebugPrintLevel = 0;
|
||||
|
||||
va_start(ap, DebugMessage);
|
||||
vDbgPrintEx(DPFLTR_PCIIDE_ID, DebugPrintLevel, DebugMessage, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
PciIdeXInitialize(
|
||||
IN PDRIVER_OBJECT DriverObject,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@ varargs PciIdeXDebugPrint(long str)
|
||||
@ stdcall PciIdeXGetBusData(ptr ptr long long)
|
||||
@ stdcall PciIdeXInitialize(ptr ptr ptr long)
|
||||
@ stdcall PciIdeXSetBusData(ptr ptr ptr long long)
|
||||
|
|
|
@ -478,8 +478,8 @@ typedef struct _PCIIDE_CONFIG_HEADER {
|
|||
|
||||
VOID
|
||||
PciIdeXDebugPrint(
|
||||
ULONG DebugPrintLevel,
|
||||
PCCHAR DebugMessage,
|
||||
_In_ ULONG DebugPrintLevel,
|
||||
_In_z_ _Printf_format_string_ PCCHAR DebugMessage,
|
||||
...
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue