Ignore:
Timestamp:
Oct 27, 1999, 8:36:36 PM (26 years ago)
Author:
phaller
Message:

Fix: console (unicode) updates

File:
1 edited

Legend:

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

    r297 r1484  
    1 /* $Id: conbuffer.cpp,v 1.4 1999-07-12 17:45:50 phaller Exp $ */
     1/* $Id: conbuffer.cpp,v 1.5 1999-10-27 18:36:33 phaller Exp $ */
    22
    33/*
     
    1818#endif
    1919
    20 #undef DEBUG_LOCAL
    21 #undef DEBUG_LOCAL2
     20//#undef DEBUG_LOCAL
     21//#undef DEBUG_LOCAL2
    2222
    2323
     
    7373#include "ConBuffer.H"
    7474#include "Console2.h"
     75#include <heapstring.h>
    7576
    7677
     
    289290
    290291        case 8: /* Backspace */
     292          // not correct if deleting expanded tab character
    291293          if (pConsoleBuffer->coordCursorPosition.X > 0)
    292294            pConsoleBuffer->coordCursorPosition.X--;
     295
     296          //@@@PH overwrite old character
     297          *(pConsoleBuffer->ppszLine[pConsoleBuffer->coordCursorPosition.Y] +
     298            pConsoleBuffer->coordCursorPosition.X * 2) = 0x20;
    293299          break;
    294300
     
    319325          break;
    320326
     327        case 13: /* CARRIAGE RETURN */
     328          pConsoleBuffer->coordCursorPosition.X = 0;
     329          //@@@PH test break;
     330
    321331        case 10: /* LINEFEED */
    322332          pConsoleBuffer->coordCursorPosition.Y++;
     
    329339            pConsoleBuffer->coordCursorPosition.Y--;
    330340          }
    331           break;
    332 
    333         case 13: /* CARRIAGE RETURN */
    334           pConsoleBuffer->coordCursorPosition.X = 0;
    335341          break;
    336342
     
    25212527{
    25222528  PCONSOLEBUFFER pConsoleBuffer = (PCONSOLEBUFFER)pHMHandleData->lpHandlerData;
     2529  DWORD          rc;
     2530  LPSTR          pszAscii;
    25232531
    25242532#ifdef DEBUG_LOCAL2
     
    25312539#endif
    25322540
    2533   /* @@@PH AScii -> unicode translation */
     2541  /* Ascii -> unicode translation */
     2542  pszAscii = (LPSTR)HEAP_malloc(cchToWrite);
     2543  if (pszAscii == NULL)
     2544     return ERROR_NOT_ENOUGH_MEMORY;
     2545
     2546  lstrcpynWtoA(pszAscii, (LPWSTR)lpvBuffer, cchToWrite);
    25342547
    25352548  /* simply forward the request to that routine */
    2536   return (HMDeviceConsoleBufferClass::WriteFile(pHMHandleData,
    2537                                                 lpvBuffer,
    2538                                                 cchToWrite,
    2539                                                 lpcchWritten,
    2540                                                 NULL));
     2549  rc = HMDeviceConsoleBufferClass::WriteFile(pHMHandleData,
     2550                                             pszAscii,
     2551                                             cchToWrite,
     2552                                             lpcchWritten,
     2553                                             NULL);
     2554  // free memory again
     2555  HEAP_free(pszAscii);
     2556  return (rc);
    25412557}
    25422558
Note: See TracChangeset for help on using the changeset viewer.