[PATCH 4/4] ntdll: Add some documentation for ntdll_umbstowcs() and ntdll_wcstoumbs().

Zebediah Figura wine at gitlab.winehq.org
Thu Jun 23 18:47:42 CDT 2022


From: Zebediah Figura <zfigura at codeweavers.com>

These functions do match e.g. mbstowcs() and MultiByteToWideChar(), but that
fact is not inherently obvious [and they don't match RtlMultiByteToUnicodeN(),
for example.]
---
 dlls/ntdll/unix/env.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index a71df03966f..f69e4e80f0d 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -364,6 +364,13 @@ static BOOL is_dynamic_env_var( const char *var )
 
 /******************************************************************
  *      ntdll_umbstowcs  (ntdll.so)
+ *
+ * Convert a multi-byte string in the Unix code page to UTF-16. Returns the
+ * number of characters converted, which may be less than the entire source
+ * string. The destination string must not be NULL.
+ *
+ * The size of the output buffer, and the return value, are both given in
+ * characters, not bytes.
  */
 DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen )
 {
@@ -381,6 +388,11 @@ DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen )
 
 /******************************************************************
  *      ntdll_wcstoumbs  (ntdll.so)
+ *
+ * Convert a UTF-16 string to a multi-byte string in the Unix code page.
+ * The destination string must not be NULL.
+ *
+ * The size of the source string is given in characters, not bytes.
  */
 int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict )
 {
-- 
GitLab

https://gitlab.winehq.org/wine/wine/-/merge_requests/307



More information about the wine-devel mailing list