]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Include/Protocol/Print2.h
MdeModulePkg: Refine the services comments in EFI_PRINT2_PROTOCOL
authorHao Wu <hao.a.wu@intel.com>
Wed, 8 Feb 2017 02:48:14 +0000 (10:48 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 21 Feb 2017 05:55:28 +0000 (13:55 +0800)
commit0b6642e60eee7456a6075fdb1a011ad4a1d3f31d
tree28987bba16e2f428f9577d61a13645965522a0a0
parent50418baa6936b8017b6b4bead4c183c2b8dcc4e1
MdeModulePkg: Refine the services comments in EFI_PRINT2_PROTOCOL

For the following 8 services in EFI_PRINT2_PROTOCOL:
UNICODE_BS_PRINT
UNICODE_S_PRINT
UNICODE_BS_PRINT_ASCII_FORMAT
UNICODE_S_PRINT_ASCII_FORMAT
ASCII_BS_PRINT
ASCII_S_PRINT
ASCII_BS_PRINT_UNICODE_FORMAT
ASCII_S_PRINT_UNICODE_FORMAT

They will ASSERT when:
1) The input parameter 'StartOfBuffer' is NULL if 'BufferSize' indicates
at least 1 Ascii/Unicode character can be held.
2) The input parameter 'FormatString' is NULL if 'BufferSize' indicates at
least 1 Ascii/Unicode character can be held.
3) The input parameter 'FormatString' contains more than
PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters.
4) The produced string contains more than
PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters.

This commits removes the ASSERT case 4) and add the following new ASSERT
case:
4) The input parameter 'BufferSize' is greater than
(PcdMaximumAsciiStringLength * sizeof (CHAR8)) for Ascii format string or
(PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for Unicode format
string.

And for those ASSERT cases, 0 will be returned by those services.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Include/Protocol/Print2.h