Annotation of ntddk/src/print/lib/str2wchr.c, revision 1.1.1.1

1.1       root        1: /************************** Module Header ***********************************
                      2:  * str2wchr.c
                      3:  *      Functions to mimic the strcat and strcpy functions,  but these
                      4:  *      convert the source string to WCHAR format in the process.
                      5:  *      Also includes wchlen,  which works as for strlen - it returns
                      6:  *      the number of WCHARS in the string - NOT BYTES.
                      7:  *
                      8:  * NOTE:  these functions perform simplistic mapping from input char to
                      9:  *      output WCHAR - this is probably only relevant for the ASCII set
                     10:  *      of characters.
                     11:  *
                     12:  * Copyright (C) 1991 - 1993  Microsoft Corporation
                     13:  *
                     14:  ****************************************************************************/
                     15: 
                     16: #include        <string.h>
                     17: #include        <stddef.h>
                     18: #include        <windows.h>
                     19: #include        "libproto.h"
                     20: 
                     21: 
                     22: 
                     23: /************************* Function Header ********************************
                     24:  * strcpy2WChar
                     25:  *      Convert a char * string to a WCHAR string.  Basically this means
                     26:  *      converting each input character to 16 bits by zero extending it.
                     27:  *
                     28:  * RETURNS:
                     29:  *      Value of first parameter.
                     30:  *
                     31:  * HISTORY:
                     32:  *  12:35 on Thu 18 Mar 1993    -by-    Lindsay Harris   [lindsayh]
                     33:  *      Use the correct conversion method to Unicode.
                     34:  *
                     35:  *  09:36 on Thu 07 Mar 1991    -by-    Lindsay Harris   [lindsayh]
                     36:  *      Created it.
                     37:  *
                     38:  **************************************************************************/
                     39: 
                     40: PWSTR
                     41: strcpy2WChar( pWCHOut, lpstr )
                     42: PWSTR   pWCHOut;              /* Destination */
                     43: LPSTR   lpstr;                /* Source string */
                     44: {
                     45: 
                     46:     /*
                     47:      *   Put buffering around the NLS function that does all this stuff.
                     48:      */
                     49: 
                     50:     int     cchIn;             /* Number of input chars */
                     51: 
                     52: 
                     53:     cchIn = strlen( lpstr ) + 1;
                     54: 
                     55:     MultiByteToWideChar( CP_ACP, 0, lpstr, cchIn, pWCHOut, cchIn );
                     56: 
                     57: 
                     58:     return  pWCHOut;
                     59: }
                     60: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.