Changeset 1458 for trunk/src/kernel32/lang.cpp
- Timestamp:
- Oct 26, 1999, 7:54:16 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/lang.cpp
r488 r1458 59 59 } 60 60 61 /*****************************************************************************62 * Name : DWORD GetLocaleInfoA63 * Purpose : The GetLocaleInfoA function returns specific locale information64 * Parameters: LCID lcid locale identifier65 * LCTYPE LCType type of information66 * LPSTR buf address of buffer for information67 * int len size of buffer68 * Variables :69 * Result : size of target buffer70 * Remark : In this version LOCALE_SYSTEM_DEFAULT == LOCALE_USER_DEFAULT71 * look into GetLocaleInfoW72 *73 * Status : TESTED74 *75 * Author : Przemyslaw Dobrowolski [Tue, 1999/07/21 12:18]76 *****************************************************************************/77 int WIN32API GetLocaleInfoA(LCID lcid, LCTYPE LCType, LPSTR buf, int len)78 {79 LPWSTR lpWStr;80 int ret_len;81 82 if (len && (! buf) )83 {84 SetLastError(ERROR_INSUFFICIENT_BUFFER);85 return 0;86 }87 88 dprintf(("KERNEL32: OS2GetLocaleInfoA lcID=%d,lcType=%x,buf=%X,len=%d\n",lcid,LCType,buf,len));89 90 if (buf)91 lpWStr=(LPWSTR)malloc(len*(sizeof(WCHAR)));92 else93 lpWStr=NULL; // Query for buffer size94 95 ret_len=GetLocaleInfoW(lcid, LCType, lpWStr, len);96 97 if (ret_len && buf)98 {99 UnicodeToAscii(lpWStr,buf);100 free(lpWStr);101 }102 103 dprintf(("KERNEL32: OS2GetLocaleInfoA returned %d\n",ret_len));104 105 return (ret_len);106 }107 61 //****************************************************************************** 108 62 //****************************************************************************** … … 176 130 * Author : Przemyslaw Dobrowolski [Tue, 1999/07/22 17:07] 177 131 *****************************************************************************/ 178 int WIN32API GetLocaleInfoW(LCID lcid, LCTYPE LCType, LPWSTR wbuf, int len) 132 ODINFUNCTION4(int, GetLocaleInfoW, LCID, lcid, LCTYPE, LCType, LPWSTR, wbuf, 133 int, len) 179 134 { 180 135 LocaleObject locale_object = NULL; … … 760 715 return (ulInfoLen); 761 716 } 762 717 /***************************************************************************** 718 * Name : DWORD GetLocaleInfoA 719 * Purpose : The GetLocaleInfoA function returns specific locale information 720 * Parameters: LCID lcid locale identifier 721 * LCTYPE LCType type of information 722 * LPSTR buf address of buffer for information 723 * int len size of buffer 724 * Variables : 725 * Result : size of target buffer 726 * Remark : In this version LOCALE_SYSTEM_DEFAULT == LOCALE_USER_DEFAULT 727 * look into GetLocaleInfoW 728 * 729 * Status : TESTED 730 * 731 * Author : Przemyslaw Dobrowolski [Tue, 1999/07/21 12:18] 732 *****************************************************************************/ 733 ODINFUNCTION4(int, GetLocaleInfoA, LCID, lcid, LCTYPE, LCType, LPSTR, buf, 734 int, len) 735 { 736 LPWSTR lpWStr; 737 int ret_len; 738 739 if (len && (! buf) ) 740 { 741 SetLastError(ERROR_INSUFFICIENT_BUFFER); 742 return 0; 743 } 744 745 dprintf(("KERNEL32: OS2GetLocaleInfoA lcID=%d,lcType=%x,buf=%X,len=%d\n",lcid,LCType,buf,len)); 746 747 if (buf) 748 lpWStr=(LPWSTR)malloc(len*(sizeof(WCHAR))); 749 else 750 lpWStr=NULL; // Query for buffer size 751 752 ret_len = ODIN_GetLocaleInfoW(lcid, LCType, lpWStr, len); 753 754 if (ret_len && buf) 755 { 756 UnicodeToAscii(lpWStr,buf); 757 free(lpWStr); 758 } 759 760 dprintf(("KERNEL32: OS2GetLocaleInfoA returned %d\n",ret_len)); 761 762 return (ret_len); 763 } 763 764 //****************************************************************************** 764 765 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.