VirtualBox

Ignore:
Timestamp:
Mar 12, 2019 12:40:12 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129295
Message:

EFI: First step in UDK2018 merge. Does not build yet.

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Include/Library/PrintLib.h

    r58466 r77662  
    33  Unicode and ASCII strings are supported.
    44
    5 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials are licensed and made available under
    77the terms and conditions of the BSD License that accompanies this distribution.
     
    8989    - d
    9090      - The argument is a signed decimal number.  If the flag 'L' is not specified,
     91        then the argument is assumed to be size int.
     92    - u
     93      - The argument is a unsigned decimal number.  If the flag 'L' is not specified,
    9194        then the argument is assumed to be size int.
    9295    - p
     
    205208  a Null-terminated Unicode format string and a VA_LIST argument list.
    206209
     210  This function is similar as vsnprintf_s defined in C11.
     211
    207212  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    208213  and BufferSize.
     
    210215  Arguments are pulled from the variable argument list specified by Marker based on the
    211216  contents of the format string.
    212   The number of Unicode characters in the produced output buffer is returned, not including
    213   the Null-terminator.
    214   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    215 
    216   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    217   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    218   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    219   If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
     217  The number of Unicode characters in the produced output buffer is returned not including
     218  the Null-terminator.
     219
     220  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     221  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     222
     223  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     224  unmodified and 0 is returned.
     225  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     226  unmodified and 0 is returned.
     227  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     228  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     229  buffer is unmodified and 0 is returned.
    220230  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    221   PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
    222   ASSERT().
    223   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    224   contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
    225   Null-terminator, then ASSERT().
     231  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     232  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     233
     234  If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
    226235
    227236  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    228237                          Unicode string.
    229238  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    230   @param  FormatString    Null-terminated Unicode format string.
     239  @param  FormatString    A Null-terminated Unicode format string.
    231240  @param  Marker          VA_LIST marker for the variable argument list.
    232241
    233   @return The number of Unicode characters in the produced output buffer, not including the
     242  @return The number of Unicode characters in the produced output buffer not including the
    234243          Null-terminator.
    235244
     
    253262  Arguments are pulled from the variable argument list specified by Marker based on the
    254263  contents of the format string.
    255   The number of Unicode characters in the produced output buffer is returned, not including
    256   the Null-terminator.
    257   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    258 
    259   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    260   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    261   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    262   If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
     264  The number of Unicode characters in the produced output buffer is returned not including
     265  the Null-terminator.
     266
     267  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     268  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     269
     270  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     271  unmodified and 0 is returned.
     272  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     273  unmodified and 0 is returned.
     274  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     275  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     276  buffer is unmodified and 0 is returned.
    263277  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    264   PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
    265   ASSERT().
    266   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    267   contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
    268   Null-terminator, then ASSERT().
     278  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     279  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     280
     281  If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
    269282
    270283  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    271284                          Unicode string.
    272285  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    273   @param  FormatString    Null-terminated Unicode format string.
     286  @param  FormatString    A Null-terminated Unicode format string.
    274287  @param  Marker          BASE_LIST marker for the variable argument list.
    275288
    276   @return The number of Unicode characters in the produced output buffer, not including the
     289  @return The number of Unicode characters in the produced output buffer not including the
    277290          Null-terminator.
    278291
     
    291304  Unicode format string and variable argument list.
    292305
     306  This function is similar as snprintf_s defined in C11.
     307
    293308  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    294309  and BufferSize.
    295310  The Unicode string is produced by parsing the format string specified by FormatString.
    296311  Arguments are pulled from the variable argument list based on the contents of the format string.
    297   The number of Unicode characters in the produced output buffer is returned, not including
    298   the Null-terminator.
    299   If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    300 
    301   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    302   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    303   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    304   If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
     312  The number of Unicode characters in the produced output buffer is returned not including
     313  the Null-terminator.
     314
     315  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     316  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     317
     318  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     319  unmodified and 0 is returned.
     320  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     321  unmodified and 0 is returned.
     322  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     323  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     324  buffer is unmodified and 0 is returned.
    305325  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    306326  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
    307   ASSERT().
    308   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    309   contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
    310   Null-terminator, then ASSERT().
     327  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     328
     329  If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
    311330
    312331  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    313332                          Unicode string.
    314333  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    315   @param  FormatString    A null-terminated Unicode format string.
    316   @param  ...             The variable argument list whose contents are accessed based on the
     334  @param  FormatString    A Null-terminated Unicode format string.
     335  @param  ...             Variable argument list whose contents are accessed based on the
    317336                          format string specified by FormatString.
    318337
    319   @return The number of Unicode characters in the produced output buffer, not including the
     338  @return The number of Unicode characters in the produced output buffer not including the
    320339          Null-terminator.
    321340
     
    332351/**
    333352  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
    334   ASCII format string and a VA_LIST argument list
     353  ASCII format string and a VA_LIST argument list.
     354
     355  This function is similar as vsnprintf_s defined in C11.
    335356
    336357  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
     
    339360  Arguments are pulled from the variable argument list specified by Marker based on the
    340361  contents of the format string.
    341   The number of Unicode characters in the produced output buffer is returned, not including
    342   the Null-terminator.
     362  The number of Unicode characters in the produced output buffer is returned not including
     363  the Null-terminator.
     364
     365  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     366
     367  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     368  unmodified and 0 is returned.
     369  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     370  unmodified and 0 is returned.
     371  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     372  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     373  buffer is unmodified and 0 is returned.
     374  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     375  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     376  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     377
    343378  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    344379
    345   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    346   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    347   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    348   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    349   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
    350   ASSERT().
    351   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    352   contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
    353   Null-terminator, then ASSERT().
    354 
    355380  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    356381                          Unicode string.
    357382  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    358   @param  FormatString    A null-terminated ASCII format string.
     383  @param  FormatString    A Null-terminated ASCII format string.
    359384  @param  Marker          VA_LIST marker for the variable argument list.
    360385
     
    374399/**
    375400  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
    376   ASCII format string and a BASE_LIST argument list
     401  ASCII format string and a BASE_LIST argument list.
    377402
    378403  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
     
    381406  Arguments are pulled from the variable argument list specified by Marker based on the
    382407  contents of the format string.
    383   The number of Unicode characters in the produced output buffer is returned, not including
    384   the Null-terminator.
     408  The number of Unicode characters in the produced output buffer is returned not including
     409  the Null-terminator.
     410
     411  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     412
     413  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     414  unmodified and 0 is returned.
     415  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     416  unmodified and 0 is returned.
     417  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     418  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     419  buffer is unmodified and 0 is returned.
     420  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     421  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     422  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     423
    385424  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    386425
    387   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    388   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    389   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    390   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    391   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
    392   ASSERT().
    393   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    394   contains more than PcdMaximumUnicodeStringLength Unicode characters, not including the
    395   Null-terminator, then ASSERT().
    396 
    397426  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    398427                          Unicode string.
    399428  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    400   @param  FormatString    A null-terminated ASCII format string.
    401   @param  Marker          A BASE_LIST marker for the variable argument list.
    402 
    403   @return The number of Unicode characters in the produced output buffer, not including the
     429  @param  FormatString    A Null-terminated ASCII format string.
     430  @param  Marker          BASE_LIST marker for the variable argument list.
     431
     432  @return The number of Unicode characters in the produced output buffer not including the
    404433          Null-terminator.
    405434
     
    418447  ASCII format string and  variable argument list.
    419448
     449  This function is similar as snprintf_s defined in C11.
     450
    420451  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    421452  and BufferSize.
     
    423454  Arguments are pulled from the variable argument list based on the contents of the
    424455  format string.
    425   The number of Unicode characters in the produced output buffer is returned, not including
    426   the Null-terminator.
     456  The number of Unicode characters in the produced output buffer is returned not including
     457  the Null-terminator.
     458
     459  If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
     460
     461  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     462  unmodified and 0 is returned.
     463  If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     464  unmodified and 0 is returned.
     465  If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
     466  (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
     467  buffer is unmodified and 0 is returned.
     468  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     469  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     470  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     471
    427472  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
    428473
    429   If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
    430   If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
    431   If BufferSize > 1 and FormatString is NULL, then ASSERT().
    432   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    433   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
    434   ASSERT().
    435   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
    436   contains more than PcdMaximumUnicodeStringLength Unicode characters, the
    437   Null-terminator, then ASSERT().
    438 
    439474  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    440475                          Unicode string.
    441476  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    442   @param  FormatString    A null-terminated ASCII format string.
     477  @param  FormatString    A Null-terminated ASCII format string.
    443478  @param  ...             Variable argument list whose contents are accessed based on the
    444479                          format string specified by FormatString.
    445480
    446   @return The number of Unicode characters in the produced output buffer, not including the
     481  @return The number of Unicode characters in the produced output buffer not including the
    447482          Null-terminator.
    448483
     
    457492  );
    458493
    459 /**
     494#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
     495
     496/**
     497  [ATTENTION] This function is deprecated for security reason.
     498
    460499  Converts a decimal value to a Null-terminated Unicode string.
    461500
     
    507546  );
    508547
     548#endif
     549
     550/**
     551  Converts a decimal value to a Null-terminated Unicode string.
     552
     553  Converts the decimal number specified by Value to a Null-terminated Unicode
     554  string specified by Buffer containing at most Width characters. No padding of
     555  spaces is ever performed. If Width is 0 then a width of
     556  MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
     557  Width characters, then only the first Width characters are placed in Buffer.
     558  Additional conversion parameters are specified in Flags.
     559
     560  The Flags bit LEFT_JUSTIFY is always ignored.
     561  All conversions are left justified in Buffer.
     562  If Width is 0, PREFIX_ZERO is ignored in Flags.
     563  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
     564  commas are inserted every 3rd digit starting from the right.
     565  If RADIX_HEX is set in Flags, then the output buffer will be formatted in
     566  hexadecimal format.
     567  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
     568  Buffer is a '-'.
     569  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
     570  Buffer is padded with '0' characters so the combination of the optional '-'
     571  sign character, '0' characters, digit characters for Value, and the
     572  Null-terminator add up to Width characters.
     573
     574  If Buffer is not aligned on a 16-bit boundary, then ASSERT().
     575  If an error would be returned, then the function will also ASSERT().
     576
     577  @param  Buffer      The pointer to the output buffer for the produced
     578                      Null-terminated Unicode string.
     579  @param  BufferSize  The size of Buffer in bytes, including the
     580                      Null-terminator.
     581  @param  Flags       The bitmask of flags that specify left justification,
     582                      zero pad, and commas.
     583  @param  Value       The 64-bit signed value to convert to a string.
     584  @param  Width       The maximum number of Unicode characters to place in
     585                      Buffer, not including the Null-terminator.
     586
     587  @retval RETURN_SUCCESS           The decimal value is converted.
     588  @retval RETURN_BUFFER_TOO_SMALL  If BufferSize cannot hold the converted
     589                                   value.
     590  @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
     591                                   If PcdMaximumUnicodeStringLength is not
     592                                   zero, and BufferSize is greater than
     593                                   (PcdMaximumUnicodeStringLength *
     594                                   sizeof (CHAR16) + 1).
     595                                   If unsupported bits are set in Flags.
     596                                   If both COMMA_TYPE and RADIX_HEX are set in
     597                                   Flags.
     598                                   If Width >= MAXIMUM_VALUE_CHARACTERS.
     599
     600**/
     601RETURN_STATUS
     602EFIAPI
     603UnicodeValueToStringS (
     604  IN OUT CHAR16  *Buffer,
     605  IN UINTN       BufferSize,
     606  IN UINTN       Flags,
     607  IN INT64       Value,
     608  IN UINTN       Width
     609  );
     610
    509611/**
    510612  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    511613  ASCII format string and a VA_LIST argument list.
     614
     615  This function is similar as vsnprintf_s defined in C11.
    512616
    513617  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
     
    516620  Arguments are pulled from the variable argument list specified by Marker based on
    517621  the contents of the format string.
    518   The number of ASCII characters in the produced output buffer is returned, not including
    519   the Null-terminator.
     622  The number of ASCII characters in the produced output buffer is returned not including
     623  the Null-terminator.
     624
     625  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     626  unmodified and 0 is returned.
     627  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     628  unmodified and 0 is returned.
     629  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     630  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     631  is unmodified and 0 is returned.
     632  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     633  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     634  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     635
    520636  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    521637
    522   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    523   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    524   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    525   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
    526   ASSERT().
    527   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    528   contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
    529   Null-terminator, then ASSERT().
    530 
    531638  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    532639                          ASCII string.
    533640  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    534   @param  FormatString    A null-terminated ASCII format string.
     641  @param  FormatString    A Null-terminated ASCII format string.
    535642  @param  Marker          VA_LIST marker for the variable argument list.
    536643
    537   @return The number of ASCII characters in the produced output buffer, not including the
     644  @return The number of ASCII characters in the produced output buffer not including the
    538645          Null-terminator.
    539646
     
    557664  Arguments are pulled from the variable argument list specified by Marker based on
    558665  the contents of the format string.
    559   The number of ASCII characters in the produced output buffer is returned, not including
    560   the Null-terminator.
     666  The number of ASCII characters in the produced output buffer is returned not including
     667  the Null-terminator.
     668
     669  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     670  unmodified and 0 is returned.
     671  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     672  unmodified and 0 is returned.
     673  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     674  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     675  is unmodified and 0 is returned.
     676  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     677  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     678  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     679
    561680  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    562681
    563   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    564   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    565   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    566   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
    567   ASSERT().
    568   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    569   contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
    570   Null-terminator, then ASSERT().
    571 
    572682  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    573683                          ASCII string.
    574684  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    575   @param  FormatString    A null-terminated ASCII format string.
     685  @param  FormatString    A Null-terminated ASCII format string.
    576686  @param  Marker          BASE_LIST marker for the variable argument list.
    577687
    578   @return The number of ASCII characters in the produced output buffer, not including the
     688  @return The number of ASCII characters in the produced output buffer not including the
    579689          Null-terminator.
    580690
     
    593703  ASCII format string and  variable argument list.
    594704
     705  This function is similar as snprintf_s defined in C11.
     706
    595707  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    596708  and BufferSize.
     
    598710  Arguments are pulled from the variable argument list based on the contents of the
    599711  format string.
    600   The number of ASCII characters in the produced output buffer is returned, not including
    601   the Null-terminator.
     712  The number of ASCII characters in the produced output buffer is returned not including
     713  the Null-terminator.
     714
     715  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     716  unmodified and 0 is returned.
     717  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     718  unmodified and 0 is returned.
     719  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     720  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     721  is unmodified and 0 is returned.
     722  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
     723  PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
     724  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     725
    602726  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    603727
    604   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    605   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    606   If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
    607   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, then
    608   ASSERT().
    609   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    610   contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
    611   Null-terminator, then ASSERT().
    612 
    613728  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    614729                          ASCII string.
    615730  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    616   @param  FormatString    A null-terminated ASCII format string.
    617   @param  ...             The variable argument list whose contents are accessed based on the
     731  @param  FormatString    A Null-terminated ASCII format string.
     732  @param  ...             Variable argument list whose contents are accessed based on the
    618733                          format string specified by FormatString.
    619734
    620   @return The number of ASCII characters in the produced output buffer, not including the
     735  @return The number of ASCII characters in the produced output buffer not including the
    621736          Null-terminator.
    622737
     
    635750  Unicode format string and a VA_LIST argument list.
    636751
     752  This function is similar as vsnprintf_s defined in C11.
     753
    637754  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    638755  and BufferSize.
     
    640757  Arguments are pulled from the variable argument list specified by Marker based on
    641758  the contents of the format string.
    642   The number of ASCII characters in the produced output buffer is returned, not including
    643   the Null-terminator.
     759  The number of ASCII characters in the produced output buffer is returned not including
     760  the Null-terminator.
     761
     762  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     763
     764  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     765  unmodified and 0 is returned.
     766  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     767  unmodified and 0 is returned.
     768  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     769  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     770  is unmodified and 0 is returned.
     771  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
     772  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     773  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     774
    644775  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    645776
    646   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    647   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    648   If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
    649   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    650   PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
    651   ASSERT().
    652   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    653   contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
    654   Null-terminator, then ASSERT().
    655 
    656777  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    657778                          ASCII string.
    658779  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    659   @param  FormatString    A null-terminated Unicode format string.
     780  @param  FormatString    A Null-terminated Unicode format string.
    660781  @param  Marker          VA_LIST marker for the variable argument list.
    661782
    662   @return The number of ASCII characters in the produced output buffer, not including the
     783  @return The number of ASCII characters in the produced output buffer not including the
    663784          Null-terminator.
    664785
     
    682803  Arguments are pulled from the variable argument list specified by Marker based on
    683804  the contents of the format string.
    684   The number of ASCII characters in the produced output buffer is returned, not including
    685   the Null-terminator.
     805  The number of ASCII characters in the produced output buffer is returned not including
     806  the Null-terminator.
     807
     808  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     809
     810  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     811  unmodified and 0 is returned.
     812  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     813  unmodified and 0 is returned.
     814  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     815  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     816  is unmodified and 0 is returned.
     817  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
     818  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     819  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     820
    686821  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    687822
    688   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    689   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    690   If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
    691   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    692   PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
    693   ASSERT().
    694   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    695   contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
    696   Null-terminator, then ASSERT().
    697 
    698823  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    699824                          ASCII string.
    700825  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    701   @param  FormatString    A null-terminated Unicode format string.
     826  @param  FormatString    A Null-terminated Unicode format string.
    702827  @param  Marker          BASE_LIST marker for the variable argument list.
    703828
    704   @return The number of ASCII characters in the produced output buffer, not including the
     829  @return The number of ASCII characters in the produced output buffer not including the
    705830          Null-terminator.
    706831
     
    719844  Unicode format string and  variable argument list.
    720845
     846  This function is similar as snprintf_s defined in C11.
     847
    721848  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    722849  and BufferSize.
     
    724851  Arguments are pulled from the variable argument list based on the contents of the
    725852  format string.
    726   The number of ASCII characters in the produced output buffer is returned, not including
    727   the Null-terminator.
     853  The number of ASCII characters in the produced output buffer is returned not including
     854  the Null-terminator.
     855
     856  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     857
     858  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
     859  unmodified and 0 is returned.
     860  If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
     861  unmodified and 0 is returned.
     862  If PcdMaximumAsciiStringLength is not zero, and BufferSize >
     863  (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
     864  is unmodified and 0 is returned.
     865  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
     866  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
     867  ASSERT(). Also, the output buffer is unmodified and 0 is returned.
     868
    728869  If BufferSize is 0, then no output buffer is produced and 0 is returned.
    729870
    730   If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
    731   If BufferSize > 0 and FormatString is NULL, then ASSERT().
    732   If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
    733   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
    734   PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, then
    735   ASSERT().
    736   If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
    737   contains more than PcdMaximumAsciiStringLength ASCII characters, not including the
    738   Null-terminator, then ASSERT().
    739 
    740871  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated
    741872                          ASCII string.
    742873  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    743   @param  FormatString    A null-terminated Unicode format string.
     874  @param  FormatString    A Null-terminated Unicode format string.
    744875  @param  ...             Variable argument list whose contents are accessed based on the
    745876                          format string specified by FormatString.
    746877
    747   @return The number of ASCII characters in the produced output buffer, not including the
     878  @return The number of ASCII characters in the produced output buffer not including the
    748879          Null-terminator.
    749880
     
    758889  );
    759890
    760 /**
     891#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
     892
     893/**
     894  [ATTENTION] This function is deprecated for security reason.
     895
    761896  Converts a decimal value to a Null-terminated ASCII string.
    762897
     
    807942  );
    808943
     944#endif
     945
     946/**
     947  Converts a decimal value to a Null-terminated Ascii string.
     948
     949  Converts the decimal number specified by Value to a Null-terminated Ascii
     950  string specified by Buffer containing at most Width characters. No padding of
     951  spaces is ever performed. If Width is 0 then a width of
     952  MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
     953  Width characters, then only the first Width characters are placed in Buffer.
     954  Additional conversion parameters are specified in Flags.
     955
     956  The Flags bit LEFT_JUSTIFY is always ignored.
     957  All conversions are left justified in Buffer.
     958  If Width is 0, PREFIX_ZERO is ignored in Flags.
     959  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
     960  commas are inserted every 3rd digit starting from the right.
     961  If RADIX_HEX is set in Flags, then the output buffer will be formatted in
     962  hexadecimal format.
     963  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
     964  Buffer is a '-'.
     965  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
     966  Buffer is padded with '0' characters so the combination of the optional '-'
     967  sign character, '0' characters, digit characters for Value, and the
     968  Null-terminator add up to Width characters.
     969
     970  If an error would be returned, then the function will ASSERT().
     971
     972  @param  Buffer      The pointer to the output buffer for the produced
     973                      Null-terminated Ascii string.
     974  @param  BufferSize  The size of Buffer in bytes, including the
     975                      Null-terminator.
     976  @param  Flags       The bitmask of flags that specify left justification,
     977                      zero pad, and commas.
     978  @param  Value       The 64-bit signed value to convert to a string.
     979  @param  Width       The maximum number of Ascii characters to place in
     980                      Buffer, not including the Null-terminator.
     981
     982  @retval RETURN_SUCCESS           The decimal value is converted.
     983  @retval RETURN_BUFFER_TOO_SMALL  If BufferSize cannot hold the converted
     984                                   value.
     985  @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
     986                                   If PcdMaximumAsciiStringLength is not
     987                                   zero, and BufferSize is greater than
     988                                   PcdMaximumAsciiStringLength.
     989                                   If unsupported bits are set in Flags.
     990                                   If both COMMA_TYPE and RADIX_HEX are set in
     991                                   Flags.
     992                                   If Width >= MAXIMUM_VALUE_CHARACTERS.
     993
     994**/
     995RETURN_STATUS
     996EFIAPI
     997AsciiValueToStringS (
     998  IN OUT CHAR8   *Buffer,
     999  IN UINTN       BufferSize,
     1000  IN UINTN       Flags,
     1001  IN INT64       Value,
     1002  IN UINTN       Width
     1003  );
     1004
    8091005/**
    8101006  Returns the number of characters that would be produced by if the formatted
    8111007  output were produced not including the Null-terminator.
    8121008
    813   If Format is NULL, then ASSERT().
    814   If Format is not aligned on a 16-bit boundary, then ASSERT().
     1009  If FormatString is not aligned on a 16-bit boundary, then ASSERT().
     1010
     1011  If FormatString is NULL, then ASSERT() and 0 is returned.
     1012  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more
     1013  than PcdMaximumUnicodeStringLength Unicode characters not including the
     1014  Null-terminator, then ASSERT() and 0 is returned.
    8151015
    8161016  @param[in]  FormatString    A Null-terminated Unicode format string.
     
    8311031  output were produced not including the Null-terminator.
    8321032
    833   If Format is NULL, then ASSERT().
     1033  If FormatString is NULL, then ASSERT() and 0 is returned.
     1034  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more
     1035  than PcdMaximumAsciiStringLength Ascii characters not including the
     1036  Null-terminator, then ASSERT() and 0 is returned.
    8341037
    8351038  @param[in]  FormatString    A Null-terminated ASCII format string.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette