Changeset 10471 for trunk/src/kernel32/conbuffer.cpp
- Timestamp:
- Feb 19, 2004, 2:03:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/conbuffer.cpp
r10010 r10471 1 /* $Id: conbuffer.cpp,v 1. 19 2003-04-11 12:08:35 sandervl Exp $ */1 /* $Id: conbuffer.cpp,v 1.20 2004-02-19 13:03:05 sandervl Exp $ */ 2 2 3 3 /* … … 2498 2498 } 2499 2499 2500 2501 2500 /***************************************************************************** 2502 2501 * Name : DWORD HMDeviceConsoleBufferClass::WriteConsoleW … … 2524 2523 DWORD rc; 2525 2524 LPSTR pszAscii; 2525 int alen; 2526 2526 2527 2527 #ifdef DEBUG_LOCAL2 … … 2534 2534 #endif 2535 2535 2536 alen = WideCharToMultiByte( GetConsoleCP(), 0, (LPCWSTR)lpvBuffer, cchToWrite, 0, 0, 0, 0 ); 2536 2537 /* Ascii -> unicode translation */ 2537 pszAscii = (LPSTR)HEAP_malloc( cchToWrite+1);2538 pszAscii = (LPSTR)HEAP_malloc(( alen + 1 ) * sizeof( WCHAR )); 2538 2539 if (pszAscii == NULL) 2539 2540 return ERROR_NOT_ENOUGH_MEMORY; 2540 2541 2541 lstrcpynWtoA(pszAscii, (LPWSTR)lpvBuffer, cchToWrite+1); 2542 WideCharToMultiByte( GetConsoleCP(), 0, (LPWSTR)lpvBuffer, cchToWrite, pszAscii, alen, 0, 0 ); 2543 pszAscii[ alen ] = 0; 2542 2544 2543 2545 /* simply forward the request to that routine */ 2544 2546 rc = HMDeviceConsoleBufferClass::WriteFile(pHMHandleData, 2545 2547 pszAscii, 2546 cchToWrite,2548 alen, 2547 2549 lpcchWritten, 2548 2550 NULL, NULL); 2549 2551 2552 *lpcchWritten = MultiByteToWideChar( GetConsoleCP(), 0, pszAscii, *lpcchWritten, 0, 0 ); 2550 2553 // free memory again 2551 2554 HEAP_free(pszAscii);
Note:
See TracChangeset
for help on using the changeset viewer.