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