Changeset 2485 for trunk/src/kernel32/heapstring.cpp
- Timestamp:
- Jan 20, 2000, 10:40:26 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/heapstring.cpp
r2447 r2485 1 /* $Id: heapstring.cpp,v 1.2 4 2000-01-15 15:42:49sandervl Exp $ */1 /* $Id: heapstring.cpp,v 1.25 2000-01-20 21:40:26 sandervl Exp $ */ 2 2 3 3 /* … … 27 27 #include <heapstring.h> 28 28 #include "misc.h" 29 29 #include "codepage.h" 30 30 31 31 /***************************************************************************** … … 34 34 35 35 ODINDEBUGCHANNEL(KERNEL32-HEAPSTRING) 36 37 38 /*****************************************************************************39 * Name :40 * Purpose :41 * Parameters:42 * Variables :43 * Result :44 * Remark :45 * Status :46 *47 * Author : Patrick Haller [Thu, 1999/08/05 20:46]48 *****************************************************************************/49 50 static UconvObject uconv_object = NULL;51 52 static BOOL getUconvObject( void )53 {54 int rc;55 BOOL ret;56 57 if ( uconv_object )58 ret = TRUE;59 else60 {61 rc = UniCreateUconvObject( (UniChar*)L"",62 &uconv_object );63 if ( rc == ULS_SUCCESS )64 ret = TRUE;65 else66 {67 uconv_object = NULL; // to make sure68 return FALSE;69 }70 dprintf2(("KERNEL32: HeapString: UniCreateUconvObject(%d)\n",71 rc));72 }73 return ret;74 }75 76 36 77 37 /***************************************************************************** … … 515 475 // returns string length 516 476 517 int WIN32API lstrcpyn WtoA(LPSTR astring,477 int WIN32API lstrcpynCtoA(LPSTR astring, 518 478 LPCWSTR ustring, 519 int unilen) 479 int unilen, 480 UconvObject uconv_object) 520 481 { 521 482 int i; … … 537 498 return 0; 538 499 539 if ( getUconvObject())500 if (uconv_object) 540 501 { 541 502 if (unilen == 1) … … 578 539 } 579 540 541 int WIN32API lstrcpynWtoA(LPSTR astring, 542 LPCWSTR ustring, 543 int unilen) 544 { 545 return lstrcpynCtoA(astring, ustring, unilen, GetWindowsUconvObject()); 546 } 547 580 548 581 549 /***************************************************************************** … … 593 561 // asciilen: max length of unicode buffer (including end 0) 594 562 // @@@PH 0 termination is NOT necessarily included ! 595 int WIN32API lstrcpynAtoW(LPWSTR unicode, 596 LPCSTR ascii, 597 int asciilen) 563 int lstrcpynAtoC(LPWSTR unicode, 564 LPCSTR ascii, 565 int asciilen, 566 UconvObject uconv_object) 598 567 { 599 568 int rc; … … 620 589 return 0; //nothing to do 621 590 622 if ( getUconvObject())591 if (uconv_object) 623 592 { 624 593 //@@@PH what's this? … … 637 606 in_bytes_left = strlen(in_buf)+1; 638 607 in_bytes_left = asciilen = min(in_bytes_left, asciilen); //buffer size in bytes 639 608 640 609 out_buf = (UniChar*)unicode; 641 610 … … 670 639 } 671 640 641 int WIN32API lstrcpynAtoW(LPWSTR unicode, 642 LPCSTR ascii, 643 int asciilen) 644 { 645 return lstrcpynAtoC(unicode, ascii, asciilen, GetWindowsUconvObject()); 646 } 672 647 673 648 /*****************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.