+/**\r
+ Returns the size of a Null-terminated Unicode string in bytes, including the\r
+ Null terminator.\r
+\r
+ This function returns the size of the Null-terminated Unicode string\r
+ specified by String in bytes, including the Null terminator.\r
+\r
+ If String is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+ @param String A pointer to a Null-terminated Unicode string.\r
+ @param MaxSize The maximum number of Destination Unicode\r
+ char, including the Null terminator.\r
+\r
+ @retval 0 If String is NULL.\r
+ @retval (sizeof (CHAR16) * (MaxSize + 1))\r
+ If there is no Null terminator in the first MaxSize characters of\r
+ String.\r
+ @return The size of the Null-terminated Unicode string in bytes, including\r
+ the Null terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+StrnSizeS (\r
+ IN CONST CHAR16 *String,\r
+ IN UINTN MaxSize\r
+ )\r
+{\r
+ //\r
+ // If String is a null pointer, then the StrnSizeS function returns zero.\r
+ //\r
+ if (String == NULL) {\r
+ return 0;\r
+ }\r
+\r
+ //\r
+ // Otherwise, the StrnSizeS function returns the size of the Null-terminated\r
+ // Unicode string in bytes, including the Null terminator. If there is no\r
+ // Null terminator in the first MaxSize characters of String, then StrnSizeS\r
+ // returns (sizeof (CHAR16) * (MaxSize + 1)) to keep a consistent map with\r
+ // the StrnLenS function.\r
+ //\r
+ return (StrnLenS (String, MaxSize) + 1) * sizeof (*String);\r
+}\r
+\r