MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / StrnSizeS

Function StrnSizeS

MdePkg/Library/BaseLib/SafeString.c:175–197  ·  view source on GitHub ↗

Returns the size of a Null-terminated Unicode string in bytes, including the Null terminator. This function returns the size of the Null-terminated Unicode string specified by String in bytes, including the Null terminator. If String is not aligned on a 16-bit boundary, then ASSERT(). @param String A pointer to a Null-terminated Unicode string. @param MaxSize The maxim

Source from the content-addressed store, hash-verified

173
174**/
175UINTN
176EFIAPI
177StrnSizeS (
178 IN CONST CHAR16 *String,
179 IN UINTN MaxSize
180 )
181{
182 //
183 // If String is a null pointer, then the StrnSizeS function returns zero.
184 //
185 if (String == NULL) {
186 return 0;
187 }
188
189 //
190 // Otherwise, the StrnSizeS function returns the size of the Null-terminated
191 // Unicode string in bytes, including the Null terminator. If there is no
192 // Null terminator in the first MaxSize characters of String, then StrnSizeS
193 // returns (sizeof (CHAR16) * (MaxSize + 1)) to keep a consistent map with
194 // the StrnLenS function.
195 //
196 return (StrnLenS (String, MaxSize) + 1) * sizeof (*String);
197}
198
199/**
200 Copies the string pointed to by Source (including the terminating null char)

Callers 4

ResetUtility.cFile · 0.85
BuildResetDataFunction · 0.85

Calls 1

StrnLenSFunction · 0.70

Tested by

no test coverage detected