Changeset 6712 for trunk/src/NTDLL/rtlstr.c
- Timestamp:
- Sep 15, 2001, 11:47:44 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/NTDLL/rtlstr.c
r6648 r6712 1 /* $Id: rtlstr.c,v 1.4 2001-09-05 13:14:08 bird Exp $ */2 1 /* 3 2 * Rtl string functions … … 24 23 25 24 /************************************************************************** 26 * 25 * RtlInitAnsiString (NTDLL.@) 27 26 */ 28 27 void WINAPI RtlInitAnsiString( PSTRING target, LPCSTR source) … … 38 37 39 38 /************************************************************************** 40 * 39 * RtlInitString (NTDLL.@) 41 40 */ 42 41 void WINAPI RtlInitString( PSTRING target, LPCSTR source ) … … 47 46 48 47 /************************************************************************** 49 * 48 * RtlFreeAnsiString (NTDLL.@) 50 49 */ 51 50 void WINAPI RtlFreeAnsiString( PSTRING str ) … … 56 55 57 56 /************************************************************************** 58 * 57 * RtlFreeOemString (NTDLL.@) 59 58 */ 60 59 void WINAPI RtlFreeOemString( PSTRING str ) … … 65 64 66 65 /************************************************************************** 67 * 66 * RtlCopyString (NTDLL.@) 68 67 */ 69 68 void WINAPI RtlCopyString( STRING *dst, const STRING *src ) … … 80 79 81 80 /************************************************************************** 82 * 81 * RtlInitUnicodeString (NTDLL.@) 83 82 */ 84 83 void WINAPI RtlInitUnicodeString( PUNICODE_STRING target, LPCWSTR source ) … … 94 93 95 94 /************************************************************************** 96 * 95 * RtlCreateUnicodeString (NTDLL.@) 97 96 */ 98 97 BOOLEAN WINAPI RtlCreateUnicodeString( PUNICODE_STRING target, LPCWSTR src ) … … 108 107 109 108 /************************************************************************** 110 * 109 * RtlCreateUnicodeStringFromAsciiz (NTDLL.@) 111 110 */ 112 111 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz( PUNICODE_STRING target, LPCSTR src ) … … 119 118 120 119 /************************************************************************** 121 * 120 * RtlFreeUnicodeString (NTDLL.@) 122 121 */ 123 122 void WINAPI RtlFreeUnicodeString( PUNICODE_STRING str ) … … 128 127 129 128 /************************************************************************** 130 * 129 * RtlCopyUnicodeString (NTDLL.@) 131 130 */ 132 131 void WINAPI RtlCopyUnicodeString( UNICODE_STRING *dst, const UNICODE_STRING *src ) … … 145 144 146 145 /************************************************************************** 147 * 146 * RtlEraseUnicodeString (NTDLL.@) 148 147 */ 149 148 void WINAPI RtlEraseUnicodeString( UNICODE_STRING *str ) … … 161 160 162 161 /****************************************************************************** 163 * 162 * RtlCompareString (NTDLL.@) 164 163 */ 165 164 LONG WINAPI RtlCompareString( const STRING *s1, const STRING *s2, BOOLEAN CaseInsensitive ) … … 187 186 188 187 /****************************************************************************** 189 * 188 * RtlCompareUnicodeString (NTDLL.@) 190 189 */ 191 190 LONG WINAPI RtlCompareUnicodeString( const UNICODE_STRING *s1, const UNICODE_STRING *s2, … … 214 213 215 214 /************************************************************************** 216 * 215 * RtlEqualString (NTDLL.@) 217 216 */ 218 217 BOOLEAN WINAPI RtlEqualString( const STRING *s1, const STRING *s2, BOOLEAN CaseInsensitive ) … … 224 223 225 224 /************************************************************************** 226 * 225 * RtlEqualUnicodeString (NTDLL.@) 227 226 */ 228 227 BOOLEAN WINAPI RtlEqualUnicodeString( const UNICODE_STRING *s1, const UNICODE_STRING *s2, … … 235 234 236 235 /************************************************************************** 237 * 236 * RtlPrefixString (NTDLL.@) 238 237 * 239 238 * Test if s1 is a prefix in s2 … … 259 258 260 259 /************************************************************************** 261 * 260 * RtlPrefixUnicodeString (NTDLL.@) 262 261 * 263 262 * Test if s1 is a prefix in s2 … … 285 284 286 285 /* 287 288 286 COPY BETWEEN ANSI_STRING or UNICODE_STRING 287 there is no parameter checking, it just crashes 289 288 */ 290 289 291 290 292 291 /************************************************************************** 293 * 292 * RtlAnsiStringToUnicodeString (NTDLL.@) 294 293 * 295 294 * NOTES: … … 319 318 320 319 /************************************************************************** 321 * 320 * RtlOemStringToUnicodeString (NTDLL.@) 322 321 * 323 322 * NOTES … … 348 347 349 348 /************************************************************************** 350 * 349 * RtlUnicodeStringToAnsiString (NTDLL.@) 351 350 * 352 351 * NOTES … … 382 381 383 382 /************************************************************************** 384 * 383 * RtlUnicodeStringToOemString (NTDLL.@) 385 384 * 386 385 * NOTES … … 416 415 417 416 /************************************************************************** 418 * 417 * RtlMultiByteToUnicodeN (NTDLL.@) 419 418 * 420 419 * NOTES … … 432 431 433 432 /************************************************************************** 434 * 433 * RtlOemToUnicodeN (NTDLL.@) 435 434 */ 436 435 NTSTATUS WINAPI RtlOemToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen, … … 445 444 446 445 /************************************************************************** 447 * 446 * RtlUnicodeToMultiByteN (NTDLL.@) 448 447 */ 449 448 NTSTATUS WINAPI RtlUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 459 458 460 459 /************************************************************************** 461 * 460 * RtlUnicodeToOemN (NTDLL.@) 462 461 */ 463 462 NTSTATUS WINAPI RtlUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 477 476 478 477 /************************************************************************** 479 * 478 * RtlUpperString (NTDLL.@) 480 479 */ 481 480 void WINAPI RtlUpperString( STRING *dst, const STRING *src ) … … 489 488 490 489 /************************************************************************** 491 * 490 * RtlUpcaseUnicodeString (NTDLL.@) 492 491 * 493 492 * NOTES: … … 516 515 517 516 /************************************************************************** 518 * 517 * RtlUpcaseUnicodeStringToAnsiString (NTDLL.@) 519 518 * 520 519 * NOTES … … 538 537 539 538 /************************************************************************** 540 * 539 * RtlUpcaseUnicodeStringToOemString (NTDLL.@) 541 540 * 542 541 * NOTES … … 560 559 561 560 /************************************************************************** 562 * 561 * RtlUpcaseUnicodeToMultiByteN (NTDLL.@) 563 562 */ 564 563 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 578 577 579 578 /************************************************************************** 580 * 579 * RtlUpcaseUnicodeToOemN (NTDLL.@) 581 580 */ 582 581 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 596 595 597 596 /* 598 597 STRING SIZE 599 598 */ 600 599 … … 742 741 743 742 /* 744 743 MISC 745 744 */ 746 745 747 746 /************************************************************************** 748 * 749 * 750 * 751 * 752 * 747 * RtlIsTextUnicode 748 * 749 * Apply various feeble heuristics to guess whether 750 * the text buffer contains Unicode. 751 * FIXME: should implement more tests. 753 752 */ 754 753 DWORD WINAPI RtlIsTextUnicode( 755 756 757 758 { 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 754 LPVOID buf, 755 DWORD len, 756 DWORD *pf) 757 { 758 LPWSTR s = buf; 759 DWORD flags = -1, out_flags = 0; 760 761 if (!len) 762 goto out; 763 if (pf) 764 flags = *pf; 765 /* 766 * Apply various tests to the text string. According to the 767 * docs, each test "passed" sets the corresponding flag in 768 * the output flags. But some of the tests are mutually 769 * exclusive, so I don't see how you could pass all tests ... 770 */ 771 772 /* Check for an odd length ... pass if even. */ 773 if (!(len & 1)) 774 out_flags |= IS_TEXT_UNICODE_ODD_LENGTH; 775 776 /* Check for the special unicode marker byte. */ 777 if (*s == 0xFEFF) 778 out_flags |= IS_TEXT_UNICODE_SIGNATURE; 779 780 /* 781 * Check whether the string passed all of the tests. 782 */ 783 flags &= ITU_IMPLEMENTED_TESTS; 784 if ((out_flags & flags) != flags) 785 len = 0; 787 786 out: 788 789 790 791 } 787 if (pf) 788 *pf = out_flags; 789 return len; 790 }
Note:
See TracChangeset
for help on using the changeset viewer.