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
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
/** @brief Global debugging level. Valid values are between 0 (Error) and 3 (Trace). */
|
||||||
|
ULONG PciIdeDebug = 0;
|
||||||
|
|
||||||
static DRIVER_DISPATCH PciIdeXForwardOrIgnore;
|
static DRIVER_DISPATCH PciIdeXForwardOrIgnore;
|
||||||
static NTSTATUS NTAPI
|
static NTSTATUS NTAPI
|
||||||
PciIdeXForwardOrIgnore(
|
PciIdeXForwardOrIgnore(
|
||||||
|
@ -90,6 +93,32 @@ PciIdeXPnpDispatch(
|
||||||
return PciIdeXPdoPnpDispatch(DeviceObject, Irp);
|
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
|
NTSTATUS NTAPI
|
||||||
PciIdeXInitialize(
|
PciIdeXInitialize(
|
||||||
IN PDRIVER_OBJECT DriverObject,
|
IN PDRIVER_OBJECT DriverObject,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
@ varargs PciIdeXDebugPrint(long str)
|
||||||
@ stdcall PciIdeXGetBusData(ptr ptr long long)
|
@ stdcall PciIdeXGetBusData(ptr ptr long long)
|
||||||
@ stdcall PciIdeXInitialize(ptr ptr ptr long)
|
@ stdcall PciIdeXInitialize(ptr ptr ptr long)
|
||||||
@ stdcall PciIdeXSetBusData(ptr ptr ptr long long)
|
@ stdcall PciIdeXSetBusData(ptr ptr ptr long long)
|
||||||
|
|
|
@ -478,8 +478,8 @@ typedef struct _PCIIDE_CONFIG_HEADER {
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
PciIdeXDebugPrint(
|
PciIdeXDebugPrint(
|
||||||
ULONG DebugPrintLevel,
|
_In_ ULONG DebugPrintLevel,
|
||||||
PCCHAR DebugMessage,
|
_In_z_ _Printf_format_string_ PCCHAR DebugMessage,
|
||||||
...
|
...
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue