- Timestamp:
- Apr 3, 2001, 10:55:46 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/char.cpp
r4444 r5465 1 /* $Id: char.cpp,v 1.1 4 2000-10-06 15:15:00sandervl Exp $ */1 /* $Id: char.cpp,v 1.15 2001-04-03 20:55:46 sandervl Exp $ */ 2 2 3 3 /* 4 * Win32 character API functions for OS/24 * USER string functions 5 5 * 6 * Copyright 1998 Sander van Leeuwen 7 * Copyright 1998 Patrick Haller 8 * Copyright 1998 Peter Fitzsimmons 6 * Based on WINE code (dlls\user\lstr.c) 7 * 8 * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is) 9 * Copyright 1996 Alexandre Julliard 10 * Copyright 1996 Marcus Meissner 9 11 * 10 12 * … … 14 16 15 17 16 #include <odin.h> 17 #include <odinwrap.h> 18 #include <os2sel.h> 19 20 #include "user32.h" 21 22 #include <wctype.h> /* towupper, towlower support */ 18 #include <ctype.h> 19 #include <stdarg.h> 20 #include <stdlib.h> 21 #include <stdio.h> 22 #include <string.h> 23 #include <os2win.h> 24 25 #include "winnls.h" 26 27 #include <misc.h> 28 #include <wine\unicode.h> 29 23 30 24 31 #define DBG_LOCALLOG DBG_char … … 26 33 27 34 28 ODINDEBUGCHANNEL(USER32-CHAR) 29 30 //****************************************************************************** 31 //****************************************************************************** 32 LPSTR WIN32API CharLowerA( LPSTR arg1) 33 { 34 dprintf2(("USER32: OS2CharLowerA\n")); 35 return O32_CharLower(arg1); 36 } 37 //****************************************************************************** 38 //****************************************************************************** 39 DWORD WIN32API CharLowerBuffA( LPSTR arg1, DWORD arg2) 40 { 41 dprintf2(("USER32: OS2CharLowerBuffA\n")); 42 return O32_CharLowerBuff(arg1, arg2); 43 } 44 //****************************************************************************** 45 //****************************************************************************** 46 DWORD WIN32API CharLowerBuffW(LPWSTR x,DWORD buflen) 47 { 48 DWORD done=0; 49 50 dprintf2(("USER32: CharLowerBuffW(%08xh,%08xh)\n", 51 x, 52 buflen)); 53 54 if (!x) 55 return 0; /* YES */ 56 57 while (*x && (buflen--)) 58 { 59 *x=towlower(*x); 60 x++; 61 done++; 62 } 63 64 return done; 65 } 66 //****************************************************************************** 67 //****************************************************************************** 68 LPWSTR WIN32API CharLowerW( LPWSTR x) 69 { 70 dprintf2(("USER32: CharLowerW(%08xh)\n", 71 x)); 72 73 if (HIWORD(x)) 74 { 75 LPWSTR s = x; 76 while (*s) 77 { 78 *s=towlower(*s); 79 s++; 80 } 81 return x; 82 } 83 else 84 return (LPWSTR)((UINT)towlower(LOWORD(x))); 85 } 86 //****************************************************************************** 87 //****************************************************************************** 88 LPSTR WIN32API CharNextA( LPCSTR arg1) 89 { 90 dprintf2(("USER32: OS2CharNextA(%08xh)\n", 91 arg1)); 92 93 return O32_CharNext(arg1); 94 } 95 //****************************************************************************** 96 //****************************************************************************** 97 LPWSTR WIN32API CharNextW(LPCWSTR x) 98 { 99 dprintf2(("USER32: OS2CharNextW(%08xh)\n", 100 x)); 101 102 if (*x) 103 return (LPWSTR)(x+1); 104 else 35 36 /*********************************************************************** 37 * CharNextA (USER32.@) 38 */ 39 LPSTR WINAPI CharNextA( LPCSTR ptr ) 40 { 41 dprintf2(("CharNextA %x", ptr)); 42 if (!*ptr) return (LPSTR)ptr; 43 if (IsDBCSLeadByte( ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2); 44 return (LPSTR)(ptr + 1); 45 } 46 47 48 /*********************************************************************** 49 * CharNextExA (USER32.@) 50 */ 51 LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags ) 52 { 53 dprintf2(("CharNextExA %d %x %x", codepage, ptr, flags)); 54 55 if (!*ptr) return (LPSTR)ptr; 56 if (IsDBCSLeadByteEx( codepage, ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2); 57 return (LPSTR)(ptr + 1); 58 } 59 60 61 /*********************************************************************** 62 * CharNextExW (USER32.@) 63 */ 64 LPWSTR WINAPI CharNextExW( WORD codepage, LPCWSTR ptr, DWORD flags ) 65 { 66 dprintf2(("CharNextExW %d %x %x", codepage, ptr, flags)); 67 /* doesn't make sense, there are no codepages for Unicode */ 68 return NULL; 69 } 70 71 72 /*********************************************************************** 73 * CharNextW (USER32.@) 74 */ 75 LPWSTR WINAPI CharNextW(LPCWSTR x) 76 { 77 dprintf2(("CharNextW %x", x)); 78 79 if (*x) x++; 80 105 81 return (LPWSTR)x; 106 82 } 107 //****************************************************************************** 108 //****************************************************************************** 109 LPSTR WIN32API CharPrevA( LPCSTR arg1, LPCSTR arg2) 110 { 111 dprintf2(("USER32: OS2CharPrevA\n")); 112 return O32_CharPrev(arg1, arg2); 113 } 114 //****************************************************************************** 115 //****************************************************************************** 116 LPWSTR WIN32API CharPrevW(LPCWSTR start, 117 LPCWSTR x) 118 { 119 dprintf2(("USER32: OS2CharPrevW(%08xh,%08xh)\n", 120 start, 121 x)); 122 123 /* FIXME: add DBCS / codepage stuff */ 124 if (x>start) 125 return (LPWSTR)(x-1); 126 else 127 return (LPWSTR)x; 128 } 129 //****************************************************************************** 130 //****************************************************************************** 131 BOOL WIN32API CharToOemA( LPCSTR arg1, LPSTR arg2) 132 { 133 dprintf2(("USER32: OS2CharToOemA\n")); 134 return O32_CharToOem(arg1, arg2); 135 } 136 //****************************************************************************** 137 //****************************************************************************** 138 BOOL WIN32API CharToOemBuffA( LPCSTR arg1, LPSTR arg2, DWORD arg3) 139 { 140 dprintf2(("USER32: OS2CharToOemBuffA\n")); 141 return O32_CharToOemBuff(arg1, arg2, arg3); 142 } 143 //****************************************************************************** 144 //****************************************************************************** 145 BOOL WIN32API CharToOemBuffW( LPCWSTR arg1, LPSTR arg2, DWORD arg3) 146 { 147 dprintf2(("USER32: OS2CharToOemBuffW DOESN'T WORK\n")); 148 // NOTE: This will not work as is (needs UNICODE support) 149 return 0; 150 // return O32_CharToOemBuff(arg1, arg2, arg3); 151 } 152 //****************************************************************************** 153 //****************************************************************************** 154 BOOL WIN32API CharToOemW( LPCWSTR arg1, LPSTR arg2) 155 { 156 dprintf2(("USER32: OS2CharToOemW DOESN'T WORK\n")); 157 // NOTE: This will not work as is (needs UNICODE support) 158 return 0; 159 // return O32_CharToOem(arg1, arg2); 160 } 161 //****************************************************************************** 162 //****************************************************************************** 163 LPSTR WIN32API CharUpperA( LPSTR arg1) 164 { 165 LPSTR rc; 166 167 if((int)arg1 >> 16 != 0) { 168 dprintf2(("USER32: OS2CharUpperA %s\n", arg1)); 169 } 170 else { 171 dprintf2(("USER32: OS2CharUpperA %X\n", arg1)); 172 } 173 174 rc = O32_CharUpper(arg1); 175 176 if((int)rc >> 16 != 0) { 177 dprintf2(("USER32: OS2CharUpperA %s\n", rc)); 178 } 179 else { 180 dprintf2(("USER32: OS2CharUpperA %X\n", rc)); 181 } 182 183 return(rc); 184 } 185 //****************************************************************************** 186 //****************************************************************************** 187 DWORD WIN32API CharUpperBuffA( LPSTR arg1, DWORD arg2) 188 { 189 dprintf2(("USER32: OS2CharUpperBuffA\n")); 190 return O32_CharUpperBuff(arg1, arg2); 191 } 192 //****************************************************************************** 193 //****************************************************************************** 194 DWORD WIN32API CharUpperBuffW(LPWSTR x, DWORD buflen) 195 { 196 DWORD done=0; 197 198 dprintf2(("USER32: OS2CharUpperBuffW(%08xh,%08xh)\n", 199 x, 200 buflen)); 201 202 if (!x) 203 return 0; /* YES */ 204 205 while (*x && (buflen--)) 206 { 207 *x=towupper(*x); 208 x++; 209 done++; 210 } 211 212 return done; 213 } 214 //****************************************************************************** 215 //****************************************************************************** 216 ODINFUNCTION1(LPWSTR,CharUpperW,LPWSTR,x) 217 { 218 if (HIWORD(x)) 219 { 220 LPWSTR s = x; 221 222 while (*s) 223 { 224 *s=towupper(*s); 225 s++; 226 } 227 return x; 228 } 229 else 230 return (LPWSTR)((UINT)towupper(LOWORD(x))); 231 } 232 //****************************************************************************** 233 //****************************************************************************** 234 LPSTR WIN32API CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags ) 235 { 236 if (!*ptr) return (LPSTR)ptr; 237 // if (O32_IsDBCSLeadByteEx( codepage, *ptr )) return (LPSTR)(ptr + 2); 238 return (LPSTR)(ptr + 1); 239 } 240 //****************************************************************************** 241 //****************************************************************************** 242 LPSTR WIN32API CharPrevExA(WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags) 243 { 83 84 85 /*********************************************************************** 86 * CharPrevA (USER32.@) 87 */ 88 LPSTR WINAPI CharPrevA( LPCSTR start, LPCSTR ptr ) 89 { 90 dprintf2(("CharPrevA %x %x", start, ptr)); 91 244 92 while (*start && (start < ptr)) 245 93 { 246 LPCSTR next = CharNextExA(codepage, start, flags); 94 LPCSTR next = CharNextA( start ); 95 if (next >= ptr) break; 96 start = next; 97 } 98 return (LPSTR)start; 99 } 100 101 102 /*********************************************************************** 103 * CharPrevExA (USER32.@) 104 */ 105 LPSTR WINAPI CharPrevExA( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags ) 106 { 107 dprintf2(("CharPrevExA %d %x %x %x", codepage, start, ptr, flags)); 108 109 while (*start && (start < ptr)) 110 { 111 LPCSTR next = CharNextExA( codepage, start, flags ); 247 112 if (next > ptr) break; 248 113 start = next; … … 250 115 return (LPSTR)start; 251 116 } 252 /***************************************************************************** 253 * Name : LPSTR WIN32API CharNextExW 254 * Purpose : The CharNextExA function retrieves the address of the next 255 * character in a string. This function can handle strings 256 * consisting of either single- or multi-byte characters. 257 * Parameters: 258 * Variables : 259 * Result : If the function succeeds, the return value is a pointer to the 260 * next character in the string, or to the terminating null character 261 * if at the end of the string. 262 * If lpCurrentChar points to the terminating null character, the 263 * return value is equal to lpCurrentChar. 264 * Remark : 265 * Status : UNTESTED STUB 266 * 267 * Author : Patrick Haller [Thu, 1998/02/26 11:55] 268 *****************************************************************************/ 269 270 LPWSTR WIN32API CharNextExW(WORD CodePage, 271 LPCWSTR lpCurrentChar, 272 DWORD dwFlags) 273 { 274 dprintf2(("USER32:CharNextExW(%u,%08xh,%08x) not implemented.\n", 275 CodePage, 276 lpCurrentChar, 277 dwFlags)); 278 279 return (NULL); 280 } 281 282 283 /***************************************************************************** 284 * Name : LPSTR WIN32API CharPrevExW 285 * Purpose : The CharPrevExA function retrieves the address of the preceding 286 * character in a string. This function can handle strings 287 * consisting of either single- or multi-byte characters. 288 * Parameters: 289 * Variables : 290 * Result : If the function succeeds, the return value is a pointer to the 291 * preceding character in the string, or to the first character in 292 * the string if the lpCurrentChar parameter equals the lpStart parameter. 293 * Remark : 294 * Status : UNTESTED STUB 295 * 296 * Author : Patrick Haller [Thu, 1998/02/26 11:55] 297 *****************************************************************************/ 298 299 LPWSTR WIN32API CharPrevExW(WORD CodePage, 300 LPCWSTR lpStart, 301 LPCWSTR lpCurrentChar, 302 DWORD dwFlags) 303 { 304 dprintf2(("USER32:CharPrevExW(%u,%08xh,%08xh,%08x) not implemented.\n", 305 CodePage, 306 lpStart, 307 lpCurrentChar, 308 dwFlags)); 309 310 return (NULL); 311 } 117 118 119 /*********************************************************************** 120 * CharPrevExW (USER32.@) 121 */ 122 LPWSTR WINAPI CharPrevExW( WORD codepage, LPCWSTR start, LPCWSTR ptr, DWORD flags ) 123 { 124 /* doesn't make sense, there are no codepages for Unicode */ 125 dprintf2(("CharPrevExW %d %x %x %x", codepage, start, ptr, flags)); 126 return NULL; 127 } 128 129 130 /*********************************************************************** 131 * CharPrevW (USER32.@) 132 */ 133 LPWSTR WINAPI CharPrevW(LPCWSTR start,LPCWSTR x) 134 { 135 dprintf2(("CharPrevW %x %x", start, x)); 136 137 if (x>start) return (LPWSTR)(x-1); 138 else return (LPWSTR)x; 139 } 140 141 142 /*********************************************************************** 143 * CharToOemA (USER32.@) 144 */ 145 BOOL WINAPI CharToOemA( LPCSTR s, LPSTR d ) 146 { 147 dprintf2(("CharToOemA %x %x", s, d)); 148 if ( !s || !d ) return TRUE; 149 return CharToOemBuffA( s, d, strlen( s ) + 1 ); 150 } 151 152 153 /*********************************************************************** 154 * CharToOemBuffA (USER32.@) 155 */ 156 BOOL WINAPI CharToOemBuffA( LPCSTR s, LPSTR d, DWORD len ) 157 { 158 WCHAR *bufW; 159 160 dprintf2(("CharToOemBuffA %x %x %d", s, d, len)); 161 bufW = (WCHAR *)HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); 162 if( bufW ) 163 { 164 MultiByteToWideChar( CP_ACP, 0, s, len, bufW, len ); 165 WideCharToMultiByte( CP_OEMCP, 0, bufW, len, d, len, NULL, NULL ); 166 HeapFree( GetProcessHeap(), 0, bufW ); 167 } 168 return TRUE; 169 } 170 171 172 /*********************************************************************** 173 * CharToOemBuffW (USER32.@) 174 */ 175 BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len ) 176 { 177 dprintf2(("CharToOemBuffW %x %x %d", s, d, len)); 178 179 if ( !s || !d ) return TRUE; 180 WideCharToMultiByte( CP_OEMCP, 0, s, len, d, len, NULL, NULL ); 181 return TRUE; 182 } 183 184 185 /*********************************************************************** 186 * CharToOemW (USER32.@) 187 */ 188 BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d ) 189 { 190 return CharToOemBuffW( s, d, strlenW( s ) + 1 ); 191 } 192 193 194 /*********************************************************************** 195 * OemToCharA (USER32.@) 196 */ 197 BOOL WINAPI OemToCharA( LPCSTR s, LPSTR d ) 198 { 199 return OemToCharBuffA( s, d, strlen( s ) + 1 ); 200 } 201 202 203 /*********************************************************************** 204 * OemToCharBuffA (USER32.@) 205 */ 206 BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len ) 207 { 208 WCHAR *bufW; 209 210 dprintf2(("OemToCharBuffA %x %x %d", s, d, len)); 211 212 bufW = (WCHAR *)HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); 213 if( bufW ) 214 { 215 MultiByteToWideChar( CP_OEMCP, 0, s, len, bufW, len ); 216 WideCharToMultiByte( CP_ACP, 0, bufW, len, d, len, NULL, NULL ); 217 HeapFree( GetProcessHeap(), 0, bufW ); 218 } 219 return TRUE; 220 } 221 222 223 /*********************************************************************** 224 * OemToCharBuffW (USER32.@) 225 */ 226 BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len ) 227 { 228 dprintf2(("OemToCharBuffW %x %x %d", s, d, len)); 229 230 MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len ); 231 return TRUE; 232 } 233 234 235 /*********************************************************************** 236 * OemToCharW (USER32.@) 237 */ 238 BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d ) 239 { 240 return OemToCharBuffW( s, d, strlen( s ) + 1 ); 241 } 242 243 244 /*********************************************************************** 245 * CharLowerA (USER32.@) 246 * FIXME: handle current locale 247 */ 248 LPSTR WINAPI CharLowerA(LPSTR x) 249 { 250 LPSTR s; 251 252 dprintf2(("CharLowerA %x", x)); 253 254 if (HIWORD(x)) 255 { 256 s=x; 257 while (*s) 258 { 259 *s=tolower(*s); 260 s++; 261 } 262 return x; 263 } 264 else return (LPSTR)tolower((char)(int)x); 265 } 266 267 268 /*********************************************************************** 269 * CharUpperA (USER32.@) 270 * FIXME: handle current locale 271 */ 272 LPSTR WINAPI CharUpperA(LPSTR x) 273 { 274 dprintf2(("CharUpperA %x", x)); 275 276 if (HIWORD(x)) 277 { 278 LPSTR s = x; 279 while (*s) 280 { 281 *s=toupper(*s); 282 s++; 283 } 284 return x; 285 } 286 return (LPSTR)toupper((char)(int)x); 287 } 288 289 290 /*********************************************************************** 291 * CharLowerW (USER32.@) 292 */ 293 LPWSTR WINAPI CharLowerW(LPWSTR x) 294 { 295 dprintf2(("CharLowerW %x", x)); 296 if (HIWORD(x)) return strlwrW(x); 297 else return (LPWSTR)((UINT)tolowerW(LOWORD(x))); 298 } 299 300 301 /*********************************************************************** 302 * CharUpperW (USER32.@) 303 * FIXME: handle current locale 304 */ 305 LPWSTR WINAPI CharUpperW(LPWSTR x) 306 { 307 dprintf2(("CharUpperW %x", x)); 308 if (HIWORD(x)) return struprW(x); 309 else return (LPWSTR)((UINT)toupperW(LOWORD(x))); 310 } 311 312 313 /*********************************************************************** 314 * CharLowerBuffA (USER32.@) 315 * FIXME: handle current locale 316 */ 317 DWORD WINAPI CharLowerBuffA( LPSTR str, DWORD len ) 318 { 319 DWORD ret = len; 320 321 dprintf2(("CharLowerBuffA %x %d", str, len)); 322 323 if (!str) return 0; /* YES */ 324 for (; len; len--, str++) *str = tolower(*str); 325 return ret; 326 } 327 328 329 /*********************************************************************** 330 * CharLowerBuffW (USER32.@) 331 */ 332 DWORD WINAPI CharLowerBuffW( LPWSTR str, DWORD len ) 333 { 334 DWORD ret = len; 335 336 dprintf2(("CharLowerBuffW %x %d", str, len)); 337 338 if (!str) return 0; /* YES */ 339 for (; len; len--, str++) *str = tolowerW(*str); 340 return ret; 341 } 342 343 344 /*********************************************************************** 345 * CharUpperBuffA (USER32.@) 346 * FIXME: handle current locale 347 */ 348 DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len ) 349 { 350 DWORD ret = len; 351 352 dprintf2(("CharUpperBuffA %x %d", str, len)); 353 354 if (!str) return 0; /* YES */ 355 for (; len; len--, str++) *str = toupper(*str); 356 return ret; 357 } 358 359 360 /*********************************************************************** 361 * CharUpperBuffW (USER32.@) 362 */ 363 DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len ) 364 { 365 DWORD ret = len; 366 367 dprintf2(("CharUpperBuffW %x %d", str, len)); 368 369 if (!str) return 0; /* YES */ 370 for (; len; len--, str++) *str = toupperW(*str); 371 return ret; 372 } 373 374 375 /*********************************************************************** 376 * IsCharLowerA (USER.436) (USER32.@) 377 * FIXME: handle current locale 378 */ 379 BOOL WINAPI IsCharLowerA(CHAR x) 380 { 381 dprintf2(("IsCharLowerA %x", x)); 382 return islower(x); 383 } 384 385 386 /*********************************************************************** 387 * IsCharLowerW (USER32.@) 388 */ 389 BOOL WINAPI IsCharLowerW(WCHAR x) 390 { 391 dprintf2(("IsCharLowerW %x", x)); 392 return get_char_typeW(x) & C1_LOWER; 393 } 394 395 396 /*********************************************************************** 397 * IsCharUpperA (USER.435) (USER32.@) 398 * FIXME: handle current locale 399 */ 400 BOOL WINAPI IsCharUpperA(CHAR x) 401 { 402 dprintf2(("IsCharUpperA %x", x)); 403 return isupper(x); 404 } 405 406 407 /*********************************************************************** 408 * IsCharUpperW (USER32.@) 409 */ 410 BOOL WINAPI IsCharUpperW(WCHAR x) 411 { 412 dprintf2(("IsCharUpperW %x", x)); 413 return get_char_typeW(x) & C1_UPPER; 414 } 415 416 417 /*********************************************************************** 418 * IsCharAlphaNumericW (USER32.@) 419 */ 420 BOOL WINAPI IsCharAlphaNumericW(WCHAR x) 421 { 422 dprintf2(("IsCharAlphaNumericW %x", x)); 423 return get_char_typeW(x) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER); 424 } 425 426 427 /*********************************************************************** 428 * IsCharAlphaW (USER32.@) 429 */ 430 BOOL WINAPI IsCharAlphaW(WCHAR x) 431 { 432 dprintf2(("IsCharAlphaW %x", x)); 433 return get_char_typeW(x) & (C1_ALPHA|C1_LOWER|C1_UPPER); 434 } 435 312 436 //****************************************************************************** 437 //TODO: 313 438 //****************************************************************************** 314 439 BOOL WIN32API IsCharAlphaA( CHAR arg1) 315 440 { 316 dprintf(("USER32: OS2IsCharAlphaA\n"));441 dprintf(("USER32: IsCharAlphaA %x", arg1)); 317 442 return O32_IsCharAlpha(arg1); 318 443 } … … 321 446 BOOL WIN32API IsCharAlphaNumericA( CHAR arg1) 322 447 { 323 dprintf(("USER32: OS2IsCharAlphaNumericA\n"));448 dprintf(("USER32: IsCharAlphaNumericA %x", arg1)); 324 449 return O32_IsCharAlphaNumeric(arg1); 325 450 } 326 //******************************************************************************327 //******************************************************************************328 BOOL WIN32API IsCharAlphaNumericW( WCHAR arg1)329 {330 dprintf(("USER32: OS2IsCharAlphaNumericW\n"));331 // NOTE: This will not work as is (needs UNICODE support)332 return O32_IsCharAlphaNumeric((CHAR)arg1);333 }334 //******************************************************************************335 //******************************************************************************336 BOOL WIN32API IsCharAlphaW( WCHAR arg1)337 {338 dprintf(("USER32: OS2IsCharAlphaW\n"));339 // NOTE: This will not work as is (needs UNICODE support)340 return O32_IsCharAlpha((CHAR)arg1);341 }342 //******************************************************************************343 //******************************************************************************344 BOOL WIN32API IsCharLowerA( CHAR arg1)345 {346 dprintf(("USER32: OS2IsCharLowerA\n"));347 return O32_IsCharLower(arg1);348 }349 //******************************************************************************350 //******************************************************************************351 BOOL WIN32API IsCharLowerW( WCHAR arg1)352 {353 dprintf(("USER32: OS2IsCharLowerW\n"));354 // NOTE: This will not work as is (needs UNICODE support)355 return O32_IsCharLower((CHAR)arg1);356 }357 //******************************************************************************358 //******************************************************************************359 BOOL WIN32API IsCharUpperA( CHAR arg1)360 {361 dprintf(("USER32: OS2IsCharUpperA\n"));362 return O32_IsCharUpper(arg1);363 }364 //******************************************************************************365 //******************************************************************************366 BOOL WIN32API IsCharUpperW( WCHAR arg1)367 {368 dprintf(("USER32: OS2IsCharUpperW\n"));369 // NOTE: This will not work as is (needs UNICODE support)370 return O32_IsCharUpper((CHAR)arg1);371 }372 //******************************************************************************373 //******************************************************************************374 BOOL WIN32API OemToCharA( LPCSTR arg1, LPSTR arg2)375 {376 dprintf(("USER32: OS2OemToCharA\n"));377 return O32_OemToChar(arg1, arg2);378 }379 //******************************************************************************380 //******************************************************************************381 BOOL WIN32API OemToCharBuffA( LPCSTR src, LPSTR dest, DWORD count)382 {383 BOOL rc;384 385 dprintf(("USER32: OS2OemToCharBuffA\n"));386 rc = O32_OemToCharBuff(src, dest, count);387 if(rc) {388 //SvL: Open32 replaces special character (i.e. /r & /n) with 0xff389 // -> break edit control (OEMCONVERT) (i.e. Netscape 6 install license control)390 for(int i=0;i<count;i++) {391 if(dest[i] == 0xFF) {392 dest[i] = src[i];393 }394 }395 }396 return rc;397 }398 //******************************************************************************399 //******************************************************************************400 BOOL WIN32API OemToCharBuffW(LPCSTR arg1, LPWSTR arg2, DWORD arg3)401 {402 dprintf(("USER32: OemToCharBuffW DOESN'T WORK \n"));403 // NOTE: This will not work as is (needs UNICODE support)404 return 0;405 // return O32_OemToCharBuff(arg1, arg2, arg3);406 }407 //******************************************************************************408 //******************************************************************************409 BOOL WIN32API OemToCharW( LPCSTR arg1, LPWSTR arg2)410 {411 dprintf(("USER32: OS2OemToCharW DOESN'T WORK\n"));412 // NOTE: This will not work as is (needs UNICODE support)413 return 0;414 // return O32_OemToChar(arg1, arg2);415 }
Note:
See TracChangeset
for help on using the changeset viewer.