Ignore:
Timestamp:
Jul 6, 2000, 11:18:45 PM (25 years ago)
Author:
sandervl
Message:

strncpy call changes + language api updates/fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/lang.cpp

    r3746 r3804  
    1 /* $Id: lang.cpp,v 1.23 2000-06-23 19:02:37 sandervl Exp $ */
     1/* $Id: lang.cpp,v 1.24 2000-07-06 21:18:43 sandervl Exp $ */
    22/*
    33 * Win32 language API functions for OS/2
     
    66 * Copyright 1998 Patrick Haller
    77 * Copyright 1999 Przemyslaw Dobrowolski
     8 *
    89 *
    910 * Project Odin Software License can be found in LICENSE.TXT
     
    2122#include "unicode.h"
    2223#include "oslibmisc.h"
     24#include <wprocess.h>
    2325
    2426#define DBG_LOCALLOG    DBG_lang
     
    880882BOOL WIN32API IsValidLocale(LCID Locale, DWORD dwFlags)
    881883{
    882   dprintf(("KERNEL32:  OS2IsValidLocale, always returns TRUE\n"));
     884  dprintf(("KERNEL32: IsValidLocale, always returns TRUE\n"));
    883885  return(TRUE);
    884886}
     
    887889LCID WIN32API GetThreadLocale()
    888890{
    889   dprintf(("KERNEL32:  OS2GetThreadLocale always return US English!\n"));
    890   return(0x409);        //US English
    891 }
    892 //******************************************************************************
    893 //******************************************************************************
    894 //******************************************************************************
    895 BOOL WIN32API SetThreadLocale( LCID locale )
    896 {
    897   dprintf(("KERNEL32:  OS2SetThreadLocale not implemented!\n"));
     891 THDB *thdb = GetThreadTHDB();
     892
     893  if(thdb == NULL) {
     894        dprintf(("KERNEL32: ERROR: GetThreadLocale thdb == NULL!"));
     895        return FALSE;
     896  }
     897  dprintf(("KERNEL32: GetThreadLocale returned %x", thdb->lcid));
     898  return(thdb->lcid);
     899}
     900//******************************************************************************
     901//******************************************************************************
     902BOOL WIN32API SetThreadLocale(LCID locale)
     903{
     904 THDB *thdb = GetThreadTHDB();
     905 
     906  if(thdb == NULL) {
     907        dprintf(("KERNEL32: ERROR SetThreadLocale thdb == NULL!"));
     908        return FALSE;
     909  }
     910  dprintf(("KERNEL32: SetThreadLocale %x", locale));
     911  thdb->lcid = locale;
    898912  return(TRUE);
    899913}
     
    901915//******************************************************************************
    902916BOOL WIN32API EnumSystemLocalesA(LOCALE_ENUMPROCA lpLocaleEnumProc,
    903                                     DWORD dwFlags)
    904 {
     917                                 DWORD dwFlags)
     918{
     919 char buffer[32];
     920
    905921  dprintf(("EnumSystemLocalesA %X %X\n", lpLocaleEnumProc, dwFlags));
    906922  if(lpLocaleEnumProc == NULL || ((dwFlags & LCID_INSTALLED) && (dwFlags & LCID_SUPPORTED))) {
     
    909925        return(FALSE);
    910926  }
    911   lpLocaleEnumProc("OS/2 US English");
     927
     928  sprintf(buffer, "%08lx", GetUserDefaultLCID());
     929  lpLocaleEnumProc(buffer);
    912930  return(TRUE);
    913931}
     
    915933//******************************************************************************
    916934BOOL WIN32API EnumSystemLocalesW(LOCALE_ENUMPROCW lpLocaleEnumProc,
    917                                     DWORD            dwFlags)
    918 {
    919  WCHAR locStr[32];
     935                                 DWORD            dwFlags)
     936{
     937 WCHAR bufferW[32];
     938 char  bufferA[32];
    920939
    921940  dprintf(("EnumSystemLocalesW %X %X\n", lpLocaleEnumProc, dwFlags));
     
    925944        return(FALSE);
    926945  }
    927   AsciiToUnicode("OS/2 US English", locStr);
    928   lpLocaleEnumProc(locStr);
     946  sprintf(bufferA, "%08lx", GetUserDefaultLCID());
     947  lstrcpyAtoW(bufferW, bufferA);
     948
     949  lpLocaleEnumProc(bufferW);
    929950  return(TRUE);
    930951}
Note: See TracChangeset for help on using the changeset viewer.