Changeset 6648 for trunk/src/NTDLL
- Timestamp:
 - Sep 5, 2001, 3:19:02 PM (24 years ago)
 - Location:
 - trunk/src/NTDLL
 - Files:
 - 
      
- 3 edited
 
- 
          
  initterm.cpp (modified) (3 diffs)
 - 
          
  rtlstr.c (modified) (34 diffs)
 - 
          
  wcstring.c (modified) (3 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/src/NTDLL/initterm.cpp
r5135 r6648 1 /* 1 /* $Id: initterm.cpp,v 1.13 2001-09-05 13:14:08 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * … … 53 54 case DLL_THREAD_ATTACH: 54 55 case DLL_THREAD_DETACH: 55 return NTDLL_LibMain(hinstDLL, fdwReason, fImpLoad);56 return NTDLL_LibMain(hinstDLL, fdwReason, fImpLoad); 56 57 57 58 case DLL_PROCESS_DETACH: 58 NTDLL_LibMain(hinstDLL, fdwReason, fImpLoad);59 ctordtorTerm();60 return TRUE;59 NTDLL_LibMain(hinstDLL, fdwReason, fImpLoad); 60 ctordtorTerm(); 61 return TRUE; 61 62 } 62 63 return FALSE; … … 88 89 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 89 90 90 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);91 if(dllHandle == 0) 92 return 0UL;91 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 92 if(dllHandle == 0) 93 return 0UL; 93 94 94 95 break; 95 96 case 1 : 96 97 if(dllHandle) { 97 UnregisterLxDll(dllHandle);98 UnregisterLxDll(dllHandle); 98 99 } 99 100 break;  - 
      
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 * RtlInitAnsiString (NTDLL.@)26 * RtlInitAnsiString (NTDLL.@) 26 27 */ 27 28 void WINAPI RtlInitAnsiString( PSTRING target, LPCSTR source) … … 37 38 38 39 /************************************************************************** 39 * RtlInitString (NTDLL.@)40 * RtlInitString (NTDLL.@) 40 41 */ 41 42 void WINAPI RtlInitString( PSTRING target, LPCSTR source ) … … 46 47 47 48 /************************************************************************** 48 * RtlFreeAnsiString (NTDLL.@)49 * RtlFreeAnsiString (NTDLL.@) 49 50 */ 50 51 void WINAPI RtlFreeAnsiString( PSTRING str ) … … 55 56 56 57 /************************************************************************** 57 * RtlFreeOemString (NTDLL.@)58 * RtlFreeOemString (NTDLL.@) 58 59 */ 59 60 void WINAPI RtlFreeOemString( PSTRING str ) … … 64 65 65 66 /************************************************************************** 66 * RtlCopyString (NTDLL.@)67 * RtlCopyString (NTDLL.@) 67 68 */ 68 69 void WINAPI RtlCopyString( STRING *dst, const STRING *src ) … … 79 80 80 81 /************************************************************************** 81 * RtlInitUnicodeString (NTDLL.@)82 * RtlInitUnicodeString (NTDLL.@) 82 83 */ 83 84 void WINAPI RtlInitUnicodeString( PUNICODE_STRING target, LPCWSTR source ) … … 93 94 94 95 /************************************************************************** 95 * RtlCreateUnicodeString (NTDLL.@)96 * RtlCreateUnicodeString (NTDLL.@) 96 97 */ 97 98 BOOLEAN WINAPI RtlCreateUnicodeString( PUNICODE_STRING target, LPCWSTR src ) … … 107 108 108 109 /************************************************************************** 109 * RtlCreateUnicodeStringFromAsciiz (NTDLL.@)110 * RtlCreateUnicodeStringFromAsciiz (NTDLL.@) 110 111 */ 111 112 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz( PUNICODE_STRING target, LPCSTR src ) … … 118 119 119 120 /************************************************************************** 120 * RtlFreeUnicodeString (NTDLL.@)121 * RtlFreeUnicodeString (NTDLL.@) 121 122 */ 122 123 void WINAPI RtlFreeUnicodeString( PUNICODE_STRING str ) … … 127 128 128 129 /************************************************************************** 129 * RtlCopyUnicodeString (NTDLL.@)130 * RtlCopyUnicodeString (NTDLL.@) 130 131 */ 131 132 void WINAPI RtlCopyUnicodeString( UNICODE_STRING *dst, const UNICODE_STRING *src ) … … 144 145 145 146 /************************************************************************** 146 * RtlEraseUnicodeString (NTDLL.@)147 * RtlEraseUnicodeString (NTDLL.@) 147 148 */ 148 149 void WINAPI RtlEraseUnicodeString( UNICODE_STRING *str ) … … 160 161 161 162 /****************************************************************************** 162 * RtlCompareString (NTDLL.@)163 * RtlCompareString (NTDLL.@) 163 164 */ 164 165 LONG WINAPI RtlCompareString( const STRING *s1, const STRING *s2, BOOLEAN CaseInsensitive ) … … 186 187 187 188 /****************************************************************************** 188 * RtlCompareUnicodeString (NTDLL.@)189 * RtlCompareUnicodeString (NTDLL.@) 189 190 */ 190 191 LONG WINAPI RtlCompareUnicodeString( const UNICODE_STRING *s1, const UNICODE_STRING *s2, … … 213 214 214 215 /************************************************************************** 215 * RtlEqualString (NTDLL.@)216 * RtlEqualString (NTDLL.@) 216 217 */ 217 218 BOOLEAN WINAPI RtlEqualString( const STRING *s1, const STRING *s2, BOOLEAN CaseInsensitive ) … … 223 224 224 225 /************************************************************************** 225 * RtlEqualUnicodeString (NTDLL.@)226 * RtlEqualUnicodeString (NTDLL.@) 226 227 */ 227 228 BOOLEAN WINAPI RtlEqualUnicodeString( const UNICODE_STRING *s1, const UNICODE_STRING *s2, … … 234 235 235 236 /************************************************************************** 236 * RtlPrefixString (NTDLL.@)237 * RtlPrefixString (NTDLL.@) 237 238 * 238 239 * Test if s1 is a prefix in s2 … … 258 259 259 260 /************************************************************************** 260 * RtlPrefixUnicodeString (NTDLL.@)261 * RtlPrefixUnicodeString (NTDLL.@) 261 262 * 262 263 * Test if s1 is a prefix in s2 … … 284 285 285 286 /* 286 COPY BETWEEN ANSI_STRING or UNICODE_STRING287 there is no parameter checking, it just crashes287 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 * RtlAnsiStringToUnicodeString (NTDLL.@)293 * RtlAnsiStringToUnicodeString (NTDLL.@) 293 294 * 294 295 * NOTES: … … 318 319 319 320 /************************************************************************** 320 * RtlOemStringToUnicodeString (NTDLL.@)321 * RtlOemStringToUnicodeString (NTDLL.@) 321 322 * 322 323 * NOTES … … 347 348 348 349 /************************************************************************** 349 * RtlUnicodeStringToAnsiString (NTDLL.@)350 * RtlUnicodeStringToAnsiString (NTDLL.@) 350 351 * 351 352 * NOTES … … 381 382 382 383 /************************************************************************** 383 * RtlUnicodeStringToOemString (NTDLL.@)384 * RtlUnicodeStringToOemString (NTDLL.@) 384 385 * 385 386 * NOTES … … 415 416 416 417 /************************************************************************** 417 * RtlMultiByteToUnicodeN (NTDLL.@)418 * RtlMultiByteToUnicodeN (NTDLL.@) 418 419 * 419 420 * NOTES … … 431 432 432 433 /************************************************************************** 433 * RtlOemToUnicodeN (NTDLL.@)434 * RtlOemToUnicodeN (NTDLL.@) 434 435 */ 435 436 NTSTATUS WINAPI RtlOemToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen, … … 444 445 445 446 /************************************************************************** 446 * RtlUnicodeToMultiByteN (NTDLL.@)447 * RtlUnicodeToMultiByteN (NTDLL.@) 447 448 */ 448 449 NTSTATUS WINAPI RtlUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 458 459 459 460 /************************************************************************** 460 * RtlUnicodeToOemN (NTDLL.@)461 * RtlUnicodeToOemN (NTDLL.@) 461 462 */ 462 463 NTSTATUS WINAPI RtlUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 476 477 477 478 /************************************************************************** 478 * RtlUpperString (NTDLL.@)479 * RtlUpperString (NTDLL.@) 479 480 */ 480 481 void WINAPI RtlUpperString( STRING *dst, const STRING *src ) … … 488 489 489 490 /************************************************************************** 490 * RtlUpcaseUnicodeString (NTDLL.@)491 * RtlUpcaseUnicodeString (NTDLL.@) 491 492 * 492 493 * NOTES: … … 515 516 516 517 /************************************************************************** 517 * RtlUpcaseUnicodeStringToAnsiString (NTDLL.@)518 * RtlUpcaseUnicodeStringToAnsiString (NTDLL.@) 518 519 * 519 520 * NOTES … … 537 538 538 539 /************************************************************************** 539 * RtlUpcaseUnicodeStringToOemString (NTDLL.@)540 * RtlUpcaseUnicodeStringToOemString (NTDLL.@) 540 541 * 541 542 * NOTES … … 559 560 560 561 /************************************************************************** 561 * RtlUpcaseUnicodeToMultiByteN (NTDLL.@)562 * RtlUpcaseUnicodeToMultiByteN (NTDLL.@) 562 563 */ 563 564 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 577 578 578 579 /************************************************************************** 579 * RtlUpcaseUnicodeToOemN (NTDLL.@)580 * RtlUpcaseUnicodeToOemN (NTDLL.@) 580 581 */ 581 582 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen, … … 595 596 596 597 /* 597 STRING SIZE598 STRING SIZE 598 599 */ 599 600 … … 741 742 742 743 /* 743 MISC744 MISC 744 745 */ 745 746 746 747 /************************************************************************** 747 * RtlIsTextUnicode748 * 749 * Apply various feeble heuristics to guess whether750 * the text buffer contains Unicode.751 * FIXME: should implement more tests.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 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 the767 * docs, each test "passed" sets the corresponding flag in768 * the output flags. But some of the tests are mutually769 * 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;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 if (pf)788 *pf = out_flags;789 return len;790 } 788 if (pf) 789 *pf = out_flags; 790 return len; 791 }  - 
      
trunk/src/NTDLL/wcstring.c
r6378 r6648 1 /* $Id: wcstring.c,v 1.2 2001-09-05 13:14:08 bird Exp $ */ 1 2 /* 2 3 * NTDLL wide-char functions … … 286 287 { 287 288 LPSTR sA = HEAP_strdupWtoA(GetProcessHeap(),0,s),endA; 288 INT ret = strtol(sA,&endA,base);289 INT ret = strtol(sA,&endA,base); 289 290 290 291 HeapFree(GetProcessHeap(),0,sA); … … 325 326 326 327 if (radix > 36 || radix <= 1) 327 return 0;328 return 0; 328 329 329 330 while (v || tp == tmp) 330 331 { 331 i = v % radix;332 v = v / radix;333 if (i < 10)334 *tp++ = i + '0';335 else336 *tp++ = i + 'a' - 10;332 i = v % radix; 333 v = v / radix; 334 if (i < 10) 335 *tp++ = i + '0'; 336 else 337 *tp++ = i + 'a' - 10; 337 338 } 338 339 339 340 sp = string; 340 341 while (tp > tmp) 341 *sp++ = *--tp;342 *sp++ = *--tp; 342 343 *sp = 0; 343 344 return string;  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  