Hello,

 

I've got a harddisk with a GPT and different partitions on it.

Now I want to get the GUID of every partition (because I'm looking for a
specific GUID).

 

I tried it that way:

// Get all BlockIO-protocols

Status = gBS->LocateHandleBuffer(

                                               ByProtocol,

                                               &gEfiBlockIoProtocolGuid,

                                               NULL,

                                               &Count,

                                               &Handle);

                                               

// Loop through it

for( i=0; i<Count; i++ )

    {

                Status = gBS->HandleProtocol(Handle[i],
&gEfiBlockIoProtocolGuid, &BlockIo);

                

                if (!BlockIo->Media->LogicalPartition) 

                               continue;

                

                Size=sizeof(GPT_HEADER);

                AdjustBufferSize(BlockIo, &Size);

                

                // Allocate memory to hold the data GPT header

                Status = gBS->AllocatePool(EfiBootServicesData, Size, &Gpt);

                

                // Read primary GPT

                BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, 1,
Size, Gpt);

                

                // Right now I should get a good value for
Gpt->NumberOfPartitionEntries

                // but that is not the case.

                // In most cases Gpt->NumberOfPartitionEntries is empty and
the only other value

                // is far too big to be the actual number of partitions

                // All other entries in the Gpt structure have the same
disturbing values.

                

                }

 

I had a look here:

http://feishare.com/efimail/messages/20101023-0646-Re__edk2__Need_pointers_o
n_how_to_handle_GPT_disk_in_EDK2-Andrew_Fish.html

And I think I've done it exactly as suggested. What am I missing?

 

Thank you.

 

Regards,

Michael

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to