summaryrefslogtreecommitdiffstats
path: root/private/crt32/misc/setmbval.c
blob: bbbf48f3f049f772181c7893408d643958b05c2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}