]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/FwVol/FwVol.c
move header files in MdeModulePkg\Core\Dxe except DxeMain.h into their corresponding...
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / FwVol.c
index f62be8ff43f394508392ebd02a9582774975aef5..9e26e4f020defbc129127d9d8935057db5f9320d 100644 (file)
@@ -15,8 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "DxeMain.h"\r
+#include "FwVolDriver.h"\r
 \r
-#define KEYSIZE       sizeof (UINTN)\r
 \r
 //\r
 // Protocol notify related globals\r
@@ -34,8 +34,8 @@ FV_DEVICE mFvDevice = {
     FvReadFile,\r
     FvReadFileSection,\r
     FvWriteFile,\r
-    FvGetNextFile,\r
-    KEYSIZE,\r
+    FvGetNextFile,   \r
+       sizeof (UINTN),\r
     NULL,\r
     FvGetVolumeInfo,\r
     FvSetVolumeInfo\r
@@ -83,6 +83,9 @@ GetFwVolHeader (
   //\r
   FvhLength = sizeof (EFI_FIRMWARE_VOLUME_HEADER);\r
   Status = Fvb->Read (Fvb, 0, 0, &FvhLength, (UINT8 *)&TempFvh);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Allocate a buffer for the caller\r
@@ -494,9 +497,9 @@ NotifyFwVolBlock (
 \r
 \r
 /**\r
-  This routine is the driver initialization entry point.  It initializes the\r
-  libraries, and registers two notification functions.  These notification\r
-  functions are responsible for building the FV stack dynamically.\r
+  This routine is the driver initialization entry point.  It registers\r
+  a notification function.  This notification function are responsible\r
+  for building the FV stack dynamically.\r
 \r
   @param  ImageHandle           The image handle.\r
   @param  SystemTable           The system table.\r
@@ -511,13 +514,12 @@ FwVolDriverInit (
   IN EFI_SYSTEM_TABLE             *SystemTable\r
   )\r
 {\r
-  gEfiFwVolBlockEvent = CoreCreateProtocolNotifyEvent (\r
+  gEfiFwVolBlockEvent = EfiCreateProtocolNotifyEvent (\r
                           &gEfiFirmwareVolumeBlockProtocolGuid,\r
                           TPL_CALLBACK,\r
                           NotifyFwVolBlock,\r
                           NULL,\r
-                          &gEfiFwVolBlockNotifyReg,\r
-                          TRUE\r
+                          &gEfiFwVolBlockNotifyReg\r
                           );\r
   return EFI_SUCCESS;\r
 }\r