Ignore:
Timestamp:
Feb 19, 2004, 2:03:07 PM (22 years ago)
Author:
sandervl
Message:

DBCS fixes for console & resource functions

File:
1 edited

Legend:

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

    r9544 r10471  
    1 /* $Id: console.cpp,v 1.32 2002-12-27 13:42:08 sandervl Exp $ */
     1/* $Id: console.cpp,v 1.33 2004-02-19 13:03:06 sandervl Exp $ */
    22
    33/*
     
    6161#define  INCL_DOSSEMAPHORES
    6262#define  INCL_DOSERRORS
     63#define  INCL_DOSEXCEPTIONS
    6364#define  INCL_DOSPROCESS
    6465#define  INCL_DOSMODULEMGR
     66#define  INCL_DOSDEVICES
    6567#define  INCL_VIO
    6668#define  INCL_KBD
     
    177179  if (ConsoleGlobals.hevConsole != NULLHANDLE) /* we're already initialized ?*/
    178180    return (NO_ERROR);                             /* then abort immediately */
     181
     182  rc = DosSetSignalExceptionFocus(SIG_SETFOCUS, &ulPostCount);
     183  if(rc) {
     184      dprintf(("DosSetSignalExceptionFocus failed with %d", rc));
     185  }
    179186
    180187  if(flVioConsole == TRUE)
     
    26952702 *****************************************************************************/
    26962703
     2704
    26972705DWORD WIN32API GetConsoleTitleW(LPWSTR lpConsoleTitle,
    26982706                                DWORD  nSize)
    26992707{
    2700   ULONG ulLength;                                          /* length of text */
    2701 
    27022708  if (ConsoleGlobals.pszWindowTitle == NULL)    /* is there a window title ? */
    27032709    return 0;                                           /* abort immediately */
    27042710
    2705   ulLength = strlen(ConsoleGlobals.pszWindowTitle);        /* length of text */
    2706 
    2707   lstrcpynAtoW(lpConsoleTitle,
    2708                ConsoleGlobals.pszWindowTitle,
    2709                nSize);
    2710 
    2711   return (nSize < ulLength) ? nSize : ulLength;
     2711  MultiByteToWideChar( GetConsoleCP(), 0, ConsoleGlobals.pszWindowTitle, -1,
     2712        lpConsoleTitle, nSize );
     2713  lpConsoleTitle[ nSize - 1 ] = 0;
     2714
     2715  return lstrlenW( lpConsoleTitle );
    27122716}
    27132717
     
    34433447BOOL WIN32API SetConsoleTitleW(LPWSTR lpszTitle)
    34443448{
     3449  int alen;
     3450
    34453451  if (lpszTitle == NULL)                                 /* check parameters */
    34463452    return FALSE;
     
    34493455    free (ConsoleGlobals.pszWindowTitle);                     /* then free it */
    34503456
     3457  alen = WideCharToMultiByte( GetConsoleCP(), 0, lpszTitle, -1, 0, 0, 0, 0 );
    34513458  /* create an ascii copy of the lpszTitle */
    3452   int iLength = lstrlenW(lpszTitle);
    3453 
    3454   ConsoleGlobals.pszWindowTitle = (PSZ)malloc(iLength+1);
    3455   ConsoleGlobals.pszWindowTitle[iLength] = 0;
    3456   lstrcpynWtoA(ConsoleGlobals.pszWindowTitle,
    3457                lpszTitle,
    3458                iLength+1); //must add one (lstrcpynWtoA terminates string)
     3459  ConsoleGlobals.pszWindowTitle = (PSZ)malloc( alen );
     3460  WideCharToMultiByte( GetConsoleCP(), 0, lpszTitle, -1,
     3461        ConsoleGlobals.pszWindowTitle, alen, 0, 0 );
    34593462
    34603463  WinSetWindowText(ConsoleGlobals.hwndFrame,           /* set new title text */
Note: See TracChangeset for help on using the changeset viewer.