[VIDEOPRT] Add global variable for debugging video drivers (#3080)
authorDmitry Borisov <di.sean@protonmail.com>
Tue, 15 Sep 2020 12:24:42 +0000 (18:24 +0600)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 12:24:42 +0000 (15:24 +0300)
Reference: https://docs.microsoft.com/en-us/previous-versions/ff570170(v=vs.85)

win32ss/drivers/videoprt/videoprt.c

index a59d044..edce0fe 100644 (file)
@@ -31,6 +31,8 @@
 
 /* GLOBAL VARIABLES ***********************************************************/
 
 
 /* GLOBAL VARIABLES ***********************************************************/
 
+ULONG VideoDebugLevel = 0;
+
 BOOLEAN VpBaseVideo = FALSE;
 BOOLEAN VpNoVesa = FALSE;
 
 BOOLEAN VpBaseVideo = FALSE;
 BOOLEAN VpNoVesa = FALSE;
 
@@ -294,6 +296,8 @@ IntVideoPortFindAdapter(
                                       SystemBasicInfo.PageSize;
     }
 
                                       SystemBasicInfo.PageSize;
     }
 
+    // FIXME: Check the adapter key and update VideoDebugLevel variable.
+
     /*
      * Call miniport HwVidFindAdapter entry point to detect if
      * particular device is present. There are two possible code
     /*
      * Call miniport HwVidFindAdapter entry point to detect if
      * particular device is present. There are two possible code
@@ -794,6 +798,9 @@ VideoPortDebugPrint(
 {
     va_list ap;
 
 {
     va_list ap;
 
+    if (VideoDebugLevel >= DebugPrintLevel)
+        DebugPrintLevel = Error;
+
     va_start(ap, DebugMessage);
     vDbgPrintEx(DPFLTR_IHVVIDEO_ID, DebugPrintLevel, DebugMessage, ap);
     va_end(ap);
     va_start(ap, DebugMessage);
     vDbgPrintEx(DPFLTR_IHVVIDEO_ID, DebugPrintLevel, DebugMessage, ap);
     va_end(ap);