summaryrefslogtreecommitdiffstats
path: root/private/crt32/misc/setmbval.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/misc/setmbval.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/crt32/misc/setmbval.c')
-rw-r--r--private/crt32/misc/setmbval.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/private/crt32/misc/setmbval.c b/private/crt32/misc/setmbval.c
new file mode 100644
index 000000000..bbbf48f3f
--- /dev/null
+++ b/private/crt32/misc/setmbval.c
@@ -0,0 +1,35 @@
+/***
+*setmbval.c - sets __invalid_mb_chars variable
+*
+* Copyright (c) 1993, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* sets __invalid_mb_chars flag to value apppropriate to the NLS API
+* call support. Older versions of NT do not support this flag.
+*
+**
+*Revision History:
+* 10-22-93 CFW Module created.
+*
+*******************************************************************************/
+
+#include <windows.h>
+#include <internal.h>
+
+
+void __set_invalid_mb_chars(void)
+{
+ char *astring = "a"; /* test string */
+
+ /*
+ * Determine whether API supports this flag by making a dummy call.
+ *
+ */
+
+ if (0 != MultiByteToWideChar(0, MB_ERR_INVALID_CHARS, astring, -1, NULL, 0))
+ __invalid_mb_chars = MB_ERR_INVALID_CHARS;
+ else
+ __invalid_mb_chars = 0;
+}
+
+