]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
Nt32Pkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Nt32Pkg / Library / DxeNt32OemHookStatusCodeLib / Nt32OemHookStatusCodeLib.c
index f3d9efcaada4c0dedbf622a08f933a3f8cb62304..a69dc338b37b10f121e8e3d663f00717083449c2 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   OEM hook status code library functions with no library constructor/destructor\r
 \r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   Module Name:  Nt32OemHookStatusCodeLib.c\r
 \r
@@ -17,8 +11,6 @@
 //\r
 // The package level header files this module uses\r
 //\r
-#include <FrameworkDxe.h>\r
-#include <FrameworkModuleDxe.h>\r
 #include <WinNtDxe.h>\r
 \r
 //\r
@@ -26,6 +18,7 @@
 //\r
 #include <Protocol/WinNtThunk.h>\r
 #include <Guid/StatusCodeDataTypeId.h>\r
+#include <Guid/StatusCodeDataTypeDebug.h>\r
 //\r
 // The Library classes this module consumes\r
 //\r
@@ -133,7 +126,7 @@ OemHookStatusCodeReport (
     //\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+                  sizeof (Buffer),\r
                   "\n\rASSERT!: %a (%d): %a\n\r",\r
                   Filename,\r
                   LineNumber,\r
@@ -146,7 +139,7 @@ OemHookStatusCodeReport (
     mWinNt->WriteFile (\r
               mStdOut,\r
               Buffer,\r
-              CharCount,\r
+              (DWORD)CharCount,\r
               (LPDWORD)&CharCount,\r
               NULL\r
               );\r
@@ -160,7 +153,7 @@ OemHookStatusCodeReport (
     //\r
     CharCount = AsciiBSPrint (\r
                   Buffer,\r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+                  sizeof (Buffer),\r
                   Format,\r
                   Marker\r
                   );\r
@@ -170,7 +163,7 @@ OemHookStatusCodeReport (
     //\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+                  sizeof (Buffer),\r
                   "ERROR: C%x:V%x I%x",\r
                   CodeType,\r
                   Value,\r
@@ -184,7 +177,7 @@ OemHookStatusCodeReport (
     if (CallerId != NULL) {\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
-                     (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                      " %g",\r
                      CallerId\r
                      );\r
@@ -193,7 +186,7 @@ OemHookStatusCodeReport (
     if (Data != NULL) {\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
-                     (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                      " %p",\r
                      Data\r
                      );\r
@@ -201,13 +194,13 @@ OemHookStatusCodeReport (
 \r
     CharCount += AsciiSPrint (\r
                    &Buffer[CharCount - 1],\r
-                   (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                    "\n\r"\r
                    );\r
   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+                  sizeof (Buffer),\r
                   "PROGRESS CODE: V%x I%x\n\r",\r
                   Value,\r
                   Instance\r
@@ -215,7 +208,7 @@ OemHookStatusCodeReport (
   } else {\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+                  sizeof (Buffer),\r
                   "Undefined: C%x:V%x I%x\n\r",\r
                   CodeType,\r
                   Value,\r
@@ -229,7 +222,7 @@ OemHookStatusCodeReport (
   mWinNt->WriteFile (\r
             mStdOut,\r
             Buffer,\r
-            CharCount,\r
+            (DWORD)CharCount,\r
             (LPDWORD)&CharCount,\r
             NULL\r
             );\r