- Timestamp:
- Jan 20, 2000, 10:40:26 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/codepage.cpp
r2213 r2485 21 21 ULONG GetDisplayCodepage() 22 22 { 23 return ODIN_PROFILE_GetOdinIniInt(CODEPAGE_SECTION, "DISPLAY", 0); 23 static ULONG codepage = -1; 24 25 if(codepage == -1) { 26 codepage = ODIN_PROFILE_GetOdinIniInt(CODEPAGE_SECTION, "DISPLAY", 0); 27 } 28 return codepage; 24 29 } 25 30 26 31 ULONG GetWindowsCodepage() 27 32 { 28 return ODIN_PROFILE_GetOdinIniInt(CODEPAGE_SECTION, "WINDOWS", 0); 33 static ULONG codepage = -1; 34 35 if(codepage == -1) { 36 codepage = ODIN_PROFILE_GetOdinIniInt(CODEPAGE_SECTION, "WINDOWS", 0); 37 } 38 return codepage; 29 39 } 30 40 … … 37 47 if ( ret == ULS_SUCCESS ) 38 48 { 39 ret = UniCreateUconvObject( (UniChar*)L"", &rc );49 ret = UniCreateUconvObject( codepage_str, &rc ); 40 50 if ( ret != ULS_SUCCESS ) 41 51 rc = 0; -
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 /***************************************************************************** -
trunk/src/kernel32/misc.cpp
r2430 r2485 1 /* $Id: misc.cpp,v 1.1 7 2000-01-13 20:09:09sandervl Exp $ */1 /* $Id: misc.cpp,v 1.18 2000-01-20 21:40:26 sandervl Exp $ */ 2 2 3 3 /* … … 361 361 void OpenPrivateLogFiles() 362 362 { 363 OpenPrivateLogFilePE(); 363 #ifdef DEFAULT_LOGGING_OFF 364 if(getenv("WIN32LOG_ENABLED")) { 365 #else 366 if(!getenv("NOWIN32LOG")) { 367 #endif 368 OpenPrivateLogFilePE(); 369 } 364 370 } 365 371 //****************************************************************************** … … 368 374 void ClosePrivateLogFiles() 369 375 { 370 ClosePrivateLogFilePE(); 376 #ifdef DEFAULT_LOGGING_OFF 377 if(getenv("WIN32LOG_ENABLED")) { 378 #else 379 if(!getenv("NOWIN32LOG")) { 380 #endif 381 ClosePrivateLogFilePE(); 382 } 371 383 } 372 384 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.