loader/gpt.c
GPT_DATA * AllocateGptData(VOID) {
   GPT_DATA *GptData;

   GptData = AllocateZeroPool(sizeof(GPT_DATA));
   if (GptData != NULL) {
      GptData->ProtectiveMBR = AllocateZeroPool(sizeof(MBR_RECORD));
      GptData->Header = AllocateZeroPool(sizeof(GPT_HEADER));
      if ((GptData->ProtectiveMBR == NULL) || (GptData->Header == NULL)) {
         MyFreePool(GptData->ProtectiveMBR);
         MyFreePool(GptData->Header);
         MyFreePool(GptData);
         GptData = NULL;
      } // if
   } // if
   return GptData;
}
// Allocate data for the main GPT_DATA structure, as well as the ProtectiveMBR
// and Header structures it contains. This function does *NOT*, however,
// allocate memory for the Entries data structure, since its size is variable
// and is determined by the contents of Header.
Allocate data for the main GPT_DATA structure, as well as the ProtectiveMBR
and Header structures it contains. This function does *NOT*, however,
allocate memory for the Entries data structure, since its size is variable
and is determined by the contents of Header.
Allocate data for the main GPT_DATA structure as well as the ProtectiveMBR and Header structures it contains . This function does * NOT * however allocate memory for the Entries data structure since its size is variable and is determined by the contents of Header .
GPT_DATA * AllocateGptData(VOID) {
   GPT_DATA *GptData;
   GptData = AllocateZeroPool(sizeof(GPT_DATA));
   if (GptData != NULL) {
      GptData->ProtectiveMBR = AllocateZeroPool(sizeof(MBR_RECORD));
      GptData->Header = AllocateZeroPool(sizeof(GPT_HEADER));
      if ((GptData->ProtectiveMBR == NULL) || (GptData->Header == NULL)) {
         MyFreePool(GptData->ProtectiveMBR);
         MyFreePool(GptData->Header);
         MyFreePool(GptData);
         GptData = NULL;
      } 
   } 
   return GptData;
}
GPT_DATA * AllocateGptData ( VOID ) { GPT_DATA * GptData ; GptData = AllocateZeroPool ( sizeof ( GPT_DATA ) ) ; if ( GptData != NULL ) { GptData -> ProtectiveMBR = AllocateZeroPool ( sizeof ( MBR_RECORD ) ) ; GptData -> Header = AllocateZeroPool ( sizeof ( GPT_HEADER ) ) ; if ( ( GptData -> ProtectiveMBR == NULL ) || ( GptData -> Header == NULL ) ) { MyFreePool ( GptData -> ProtectiveMBR ) ; MyFreePool ( GptData -> Header ) ; MyFreePool ( GptData ) ; GptData = NULL ; } } return GptData ; }
Allocate data for the main GPT_DATA structure, as well as the ProtectiveMBR
and Header structures it contains.
Allocate data for the main GPT_DATA structure as well as the ProtectiveMBR and Header structures it contains .
// if // if