Changeset 794


Ignore:
Timestamp:
Sep 2, 1999, 7:12:46 PM (26 years ago)
Author:
phaller
Message:

Add: WideCharToLocal and LocalToWideChar added (utility functions)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/include/heapstring.h

    r639 r794  
    1 /* $Id: heapstring.h,v 1.3 1999-08-22 22:46:22 sandervl Exp $ */
     1/* $Id: heapstring.h,v 1.4 1999-09-02 17:12:46 phaller Exp $ */
    22
    33/*
     
    4444LPSTR  WIN32API HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str );
    4545
     46INT WIN32API WideCharToLocal(LPSTR pLocal, LPWSTR pWide, INT dwChars);
     47INT WIN32API LocalToWideChar(LPWSTR pWide, LPSTR pLocal, INT dwChars);
     48
  • TabularUnified trunk/src/kernel32/KERNEL32.DEF

    r761 r794  
    1 ; $Id: KERNEL32.DEF,v 1.34 1999-08-31 17:15:29 sandervl Exp $
     1; $Id: KERNEL32.DEF,v 1.35 1999-09-02 17:12:32 phaller Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    10051005    HEAP_strdupA               = _HEAP_strdupA@12                 @1247
    10061006    HEAP_strdupW               = _HEAP_strdupW@12                 @1248
    1007 
    1008     VIRTUAL_MapFileA           = _VIRTUAL_MapFileA@8              @1249
    1009     VIRTUAL_MapFileW           = _VIRTUAL_MapFileW@8              @1250
    1010 
    1011     OS2SetExceptionHandler   @1251
    1012     OS2UnsetExceptionHandler @1252
     1007    WideCharToLocal            = _WideCharToLocal@12              @1249
     1008    LocalToWideChar            = _LocalToWideChar@12              @1250
     1009
     1010    VIRTUAL_MapFileA           = _VIRTUAL_MapFileA@8              @1251
     1011    VIRTUAL_MapFileW           = _VIRTUAL_MapFileW@8              @1252
     1012
     1013    OS2SetExceptionHandler                                        @1253
     1014    OS2UnsetExceptionHandler                                      @1254
    10131015
    10141016    __ct__12Win32MenuResFP10Win32ImageUlN22                       @1260
    1015     __ct__12Win32MenuResFP10Win32ImageUlN22Pc                     @1261
    1016     __ct__12Win32MenuResFUl                                       @1262
     1017    __ct__12Win32MenuResFP10Win32ImageUlN22Pc                     @1261
     1018    __ct__12Win32MenuResFUl                                       @1262
    10171019    __ct__12Win32MenuResFPv                                       @1263
     1020
  • TabularUnified trunk/src/kernel32/heapstring.cpp

    r634 r794  
    1 /* $Id: heapstring.cpp,v 1.8 1999-08-22 22:11:21 sandervl Exp $ */
     1/* $Id: heapstring.cpp,v 1.9 1999-09-02 17:12:32 phaller Exp $ */
    22
    33/*
     
    845845
    846846
     847/*****************************************************************************
     848 * Name      : WideCharToLocal
     849 * Purpose   : similar lstrcpyWtoA, should handle codepages properly
     850 * Parameters:
     851 * Variables :
     852 * Result    : strlen of the destination string
     853 * Remark    :
     854 * Status    :
     855 *
     856 * Author    : Patrick Haller [Thu, 1999/08/05 20:46]
     857 *****************************************************************************/
     858
     859INT WIN32API WideCharToLocal(LPSTR pLocal, LPWSTR pWide, INT dwChars)
     860{
     861  dprintf(("KERNEL32: WideCharToLocal(%08xh,%08xh,%08xh)\n",
     862           pLocal,
     863           pWide,
     864           dwChars));
     865
     866  *pLocal = 0;
     867  WideCharToMultiByte(CP_ACP,
     868                      0,
     869                      pWide,
     870                      -1,
     871                      pLocal,
     872                      dwChars,
     873                      NULL,
     874                      NULL);
     875
     876  return strlen(pLocal);
     877}
     878
     879
     880/*****************************************************************************
     881 * Name      : LocalToWideChar
     882 * Purpose   : similar lstrcpyAtoW, should handle codepages properly
     883 * Parameters:
     884 * Variables :
     885 * Result    : strlen of the destination string
     886 * Remark    :
     887 * Status    :
     888 *
     889 * Author    : Patrick Haller [Thu, 1999/08/05 20:46]
     890 *****************************************************************************/
     891
     892INT WIN32API LocalToWideChar(LPWSTR pWide, LPSTR pLocal, INT dwChars)
     893{
     894  *pWide = 0;
     895
     896  dprintf(("KERNEL32: LocalToWideChar(%08xh,%08xh,%08xh)\n",
     897           pLocal,
     898           pWide,
     899           dwChars));
     900
     901  MultiByteToWideChar(CP_ACP,
     902                      0,
     903                      pLocal,
     904                      -1,
     905                      pWide,
     906                      dwChars);
     907
     908  return lstrlenW(pWide);
     909}
     910
     911
     912
     913
     914
    847915
    848916#if 0
     
    903971#endif
    904972
     973
     974
Note: See TracChangeset for help on using the changeset viewer.