Thank you Tim for your answer. Here is a simple application which I
have run in EDK2 NT32Pkg.
EFI_STATUS
EFIAPI
SimpleAppEntry(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_HANDLE Handle;
EFI_GUID **ProtocolBuffer;
UINTN Size;
Size = sizeof(EFI_HANDLE);
Status = gBS->LocateHandle (
AllHandles,
NULL,
NULL,
&Size,
&Handle
);
Print (L"\nLocate Handle Status = %r\n", Status);
Status = gBS->ProtocolsPerHandle (
Handle,
&ProtocolBuffer,
&Size
);
Print (L"\nProtocols per Handle Status = %r\n", Status);
Print (L"\nProtocols Buffer Count = %d\n", Size);
return EFI_SUCCESS;
}
It's output is:
Locate Handle Status = Buffer Too Small
Protocols Per Handle Status = Success
Protocols Buffer Count = 2
Hence it is clear that in EDK2 source the returned data is truncated
to the size of the buffer.
Although I agree with you that only BufferSize is guranteed to be
updated but clearly EDK2
does return truncated data.
Thanks,
Jagannath
On 2/4/13, Tim Lewis <[email protected]> wrote:
> The contents of Buffer are undefined with EFI_BUFFER_TOO_SMALL. Some
> implementations may return data in this case, although this is a bit sloppy.
> Only BufferSize is guaranteed to be updated. The guaranteed behavior is as
> described in the UEFI specification.
>
> Tim
>
> -----Original Message-----
> From: jagannath rath [mailto:[email protected]]
> Sent: Sunday, February 03, 2013 12:16 PM
> To: edk2-devel
> Subject: [edk2] Should LocateHandle return EFI_BUFFER_TOO_SMALL or
> EFI_WARN_BUFFER_TOO_SMALL
>
> Hello,
>
> The gBS->LocateHandle returns EFI_BUFFER_TOO_SMALL if the size of the buffer
> is small for the result.
> It actually does return the truncated data in the buffer.
> Hence should the return type not be EFI_WARN_BUFFER_TOO_SMALL as the buffer
> data is being truncated.
>
> Please point out if I am missing out on something.
>
> Thanks and Regards,
> Jagannath Prasad Rath
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics Download AppDynamics Lite for
> free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel