4 * Copyright 1993 Yngvi Sigurjonsson
5 * Copyright 1996 Alexandre Julliard
10 #include "wine/winbase16.h"
11 #include "wine/winuser16.h"
12 #include "wine/keyboard16.h"
18 static const BYTE STRING_Oem2Ansi
[256] =
19 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\244"
20 "\020\021\022\023\266\247\026\027\030\031\032\033\034\035\036\037"
21 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057"
22 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077"
23 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117"
24 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137"
25 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157"
26 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177"
27 "\307\374\351\342\344\340\345\347\352\353\350\357\356\354\304\305"
28 "\311\346\306\364\366\362\373\371\377\326\334\242\243\245\120\203"
29 "\341\355\363\372\361\321\252\272\277\137\254\275\274\241\253\273"
30 "\137\137\137\246\246\246\246\053\053\246\246\053\053\053\053\053"
31 "\053\055\055\053\055\053\246\246\053\053\055\055\246\055\053\055"
32 "\055\055\055\053\053\053\053\053\053\053\053\137\137\246\137\137"
33 "\137\337\137\266\137\137\265\137\137\137\137\137\137\137\137\137"
34 "\137\261\137\137\137\137\367\137\260\225\267\137\156\262\137\137";
36 static const BYTE STRING_Ansi2Oem
[256] =
37 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017"
38 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
39 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057"
40 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077"
41 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117"
42 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137"
43 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157"
44 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177"
45 "\200\201\054\237\054\137\375\374\210\045\123\074\117\215\216\217"
46 "\220\140\047\042\042\371\055\137\230\231\163\076\157\235\236\131"
47 "\040\255\233\234\017\235\335\025\042\143\246\256\252\055\162\137"
48 "\370\361\375\063\047\346\024\372\054\061\247\257\254\253\137\250"
49 "\101\101\101\101\216\217\222\200\105\220\105\105\111\111\111\111"
50 "\104\245\117\117\117\117\231\170\117\125\125\125\232\131\137\341"
51 "\205\240\203\141\204\206\221\207\212\202\210\211\215\241\214\213"
52 "\144\244\225\242\223\157\224\366\157\227\243\226\201\171\137\230";
54 #define OEM_TO_ANSI(ch) (STRING_Oem2Ansi[(unsigned char)(ch)])
55 #define ANSI_TO_OEM(ch) (STRING_Ansi2Oem[(unsigned char)(ch)])
57 /* Internaly used by strchr family functions */
58 static BOOL
ChrCmpA( WORD word1
, WORD word2
);
59 static BOOL
ChrCmpW( WORD word1
, WORD word2
);
61 extern LPWSTR __cdecl
CRTDLL_wcschr(LPCWSTR str
,WCHAR xchar
);
64 /***********************************************************************
65 * hmemcpy (KERNEL.348)
67 void WINAPI
hmemcpy16( LPVOID dst
, LPCVOID src
, LONG count
)
69 memcpy( dst
, src
, count
);
73 /***********************************************************************
74 * lstrcat16 (KERNEL.89)
76 SEGPTR WINAPI
lstrcat16( SEGPTR dst
, LPCSTR src
)
78 lstrcatA( (LPSTR
)PTR_SEG_TO_LIN(dst
), src
);
83 /***********************************************************************
84 * lstrcat32A (KERNEL32.599)
86 LPSTR WINAPI
lstrcatA( LPSTR dst
, LPCSTR src
)
88 TRACE(string
,"Append %s to %s\n",
89 debugstr_a (src
), debugstr_a (dst
));
90 /* Windows does not check for NULL pointers here, so we don't either */
96 /***********************************************************************
97 * lstrcat32W (KERNEL32.600)
99 LPWSTR WINAPI
lstrcatW( LPWSTR dst
, LPCWSTR src
)
101 register LPWSTR p
= dst
;
102 TRACE(string
,"Append L%s to L%s\n",
103 debugstr_w (src
), debugstr_w (dst
));
104 /* Windows does not check for NULL pointers here, so we don't either */
106 while ((*p
++ = *src
++));
111 /***********************************************************************
112 * lstrcatn16 (KERNEL.352)
114 SEGPTR WINAPI
lstrcatn16( SEGPTR dst
, LPCSTR src
, INT16 n
)
116 lstrcatnA( (LPSTR
)PTR_SEG_TO_LIN(dst
), src
, n
);
121 /***********************************************************************
122 * lstrcatn32A (Not a Windows API)
124 LPSTR WINAPI
lstrcatnA( LPSTR dst
, LPCSTR src
, INT n
)
126 register LPSTR p
= dst
;
127 TRACE(string
,"strcatn add %d chars from %s to %s\n",
128 n
, debugstr_an (src
, n
), debugstr_a (dst
));
130 if ((n
-= (INT
)(p
- dst
)) <= 0) return dst
;
131 lstrcpynA( p
, src
, n
);
136 /***********************************************************************
137 * lstrcatn32W (Not a Windows API)
139 LPWSTR WINAPI
lstrcatnW( LPWSTR dst
, LPCWSTR src
, INT n
)
141 register LPWSTR p
= dst
;
142 TRACE(string
,"strcatn add %d chars from L%s to L%s\n",
143 n
, debugstr_wn (src
, n
), debugstr_w (dst
));
145 if ((n
-= (INT
)(p
- dst
)) <= 0) return dst
;
146 lstrcpynW( p
, src
, n
);
151 /***********************************************************************
152 * lstrcmp16 (USER.430)
154 INT16 WINAPI
lstrcmp16( LPCSTR str1
, LPCSTR str2
)
156 return (INT16
)strcmp( str1
, str2
);
160 /***********************************************************************
161 * lstrcmp32A (KERNEL.602)
163 INT WINAPI
lstrcmpA( LPCSTR str1
, LPCSTR str2
)
165 return CompareStringA(LOCALE_SYSTEM_DEFAULT
,0,str1
,-1,str2
,-1) - 2 ;
169 /***********************************************************************
170 * lstrcmp32W (KERNEL.603)
171 * FIXME : should call CompareString32W, when it is implemented.
172 * This implementation is not "word sort", as it should.
174 INT WINAPI
lstrcmpW( LPCWSTR str1
, LPCWSTR str2
)
176 TRACE(string
,"L%s and L%s\n",
177 debugstr_w (str1
), debugstr_w (str2
));
178 if (!str1
|| !str2
) {
179 SetLastError(ERROR_INVALID_PARAMETER
);
182 while (*str1
&& (*str1
== *str2
)) { str1
++; str2
++; }
183 return (INT
)(*str1
- *str2
);
187 /***********************************************************************
188 * lstrcmpi16 (USER.471)
190 INT16 WINAPI
lstrcmpi16( LPCSTR str1
, LPCSTR str2
)
192 return (INT16
)lstrcmpiA( str1
, str2
);
196 /***********************************************************************
197 * lstrcmpi32A (KERNEL32.605)
199 INT WINAPI
lstrcmpiA( LPCSTR str1
, LPCSTR str2
)
200 { TRACE(string
,"strcmpi %s and %s\n",
201 debugstr_a (str1
), debugstr_a (str2
));
202 return CompareStringA(LOCALE_SYSTEM_DEFAULT
,NORM_IGNORECASE
,str1
,-1,str2
,-1)-2;
206 /***********************************************************************
207 * lstrcmpi32W (KERNEL32.606)
209 INT WINAPI
lstrcmpiW( LPCWSTR str1
, LPCWSTR str2
)
214 /* Too much! (From registry loading.) */
215 TRACE(string
,"strcmpi L%s and L%s\n",
216 debugstr_w (str1
), debugstr_w (str2
));
218 if (!str1
|| !str2
) {
219 SetLastError(ERROR_INVALID_PARAMETER
);
224 if ((*str1
<0x100 ) && (*str2
<0x100)) {
225 if ((res
= toupper(*str1
) - toupper(*str2
)) != 0) return res
;
227 if ((res
= towupper(*str1
) - towupper(*str2
)) != 0) return res
;
232 return towupper(*str1
) - towupper(*str2
);
236 /***********************************************************************
237 * lstrcpy16 (KERNEL.88)
239 SEGPTR WINAPI
lstrcpy16( SEGPTR dst
, LPCSTR src
)
241 lstrcpyA( (LPSTR
)PTR_SEG_TO_LIN(dst
), src
);
246 /***********************************************************************
247 * lstrcpyA (KERNEL32.608)
249 LPSTR WINAPI
lstrcpyA( LPSTR dst
, LPCSTR src
)
251 TRACE(string
,"strcpy %s\n", debugstr_a (src
));
252 /* In real windows the whole function is protected by an exception handler
253 * that returns ERROR_INVALID_PARAMETER on faulty parameters
254 * We currently just check for NULL.
257 SetLastError(ERROR_INVALID_PARAMETER
);
260 /* this is how Windows does it */
261 memmove( dst
, src
, strlen(src
)+1 );
266 /***********************************************************************
267 * lstrcpy32W (KERNEL32.609)
269 LPWSTR WINAPI
lstrcpyW( LPWSTR dst
, LPCWSTR src
)
271 register LPWSTR p
= dst
;
272 TRACE(string
,"strcpy L%s\n", debugstr_w (src
));
273 /* In real windows the whole function is protected by an exception handler
274 * that returns ERROR_INVALID_PARAMETER on faulty parameters
275 * We currently just check for NULL.
278 SetLastError(ERROR_INVALID_PARAMETER
);
281 while ((*p
++ = *src
++));
286 /***********************************************************************
287 * lstrcpyn16 (KERNEL.353)
289 SEGPTR WINAPI
lstrcpyn16( SEGPTR dst
, LPCSTR src
, INT16 n
)
291 lstrcpynA( (LPSTR
)PTR_SEG_TO_LIN(dst
), src
, n
);
296 /***********************************************************************
297 * lstrcpyn32A (KERNEL32.611)
298 * Note: this function differs from the UNIX strncpy, it _always_ writes
301 LPSTR WINAPI
lstrcpynA( LPSTR dst
, LPCSTR src
, INT n
)
304 TRACE(string
,"strcpyn %s for %d chars\n",
305 debugstr_an (src
,n
), n
);
306 /* In real windows the whole function is protected by an exception handler
307 * that returns ERROR_INVALID_PARAMETER on faulty parameters
308 * We currently just check for NULL.
311 SetLastError(ERROR_INVALID_PARAMETER
);
314 while ((n
-- > 1) && *src
) *p
++ = *src
++;
320 /***********************************************************************
321 * lstrcpyn32W (KERNEL32.612)
322 * Note: this function differs from the UNIX strncpy, it _always_ writes
325 LPWSTR WINAPI
lstrcpynW( LPWSTR dst
, LPCWSTR src
, INT n
)
328 TRACE(string
,"strcpyn L%s for %d chars\n",
329 debugstr_wn (src
,n
), n
);
330 /* In real windows the whole function is protected by an exception handler
331 * that returns ERROR_INVALID_PARAMETER on faulty parameters
332 * We currently just check for NULL.
335 SetLastError(ERROR_INVALID_PARAMETER
);
338 while ((n
-- > 1) && *src
) *p
++ = *src
++;
344 /***********************************************************************
345 * lstrlen16 (KERNEL.90)
347 INT16 WINAPI
lstrlen16( LPCSTR str
)
349 return (INT16
)lstrlenA( str
);
353 /***********************************************************************
354 * lstrlen32A (KERNEL32.614)
356 INT WINAPI
lstrlenA( LPCSTR str
)
358 /* looks weird, but win3.1 KERNEL got a GeneralProtection handler
359 * in lstrlen() ... we check only for NULL pointer reference.
362 TRACE(string
,"strlen %s\n", debugstr_a (str
));
364 return (INT
)strlen(str
);
368 /***********************************************************************
369 * lstrlen32W (KERNEL32.615)
371 INT WINAPI
lstrlenW( LPCWSTR str
)
374 TRACE(string
,"strlen L%s\n", debugstr_w (str
));
376 while (*str
++) len
++;
381 /***********************************************************************
382 * lstrncmp32A (Not a Windows API)
384 INT WINAPI
lstrncmpA( LPCSTR str1
, LPCSTR str2
, INT n
)
386 TRACE(string
,"strncmp %s and %s for %d chars\n",
387 debugstr_an (str1
, n
), debugstr_an (str2
, n
), n
);
388 return (INT
)strncmp( str1
, str2
, n
);
392 /***********************************************************************
393 * lstrncmp32W (Not a Windows API)
395 INT WINAPI
lstrncmpW( LPCWSTR str1
, LPCWSTR str2
, INT n
)
397 TRACE(string
,"strncmp L%s and L%s for %d chars\n",
398 debugstr_wn (str1
, n
), debugstr_wn (str2
, n
), n
);
400 while ((--n
> 0) && *str1
&& (*str1
== *str2
)) { str1
++; str2
++; }
401 return (INT
)(*str1
- *str2
);
405 /***********************************************************************
406 * lstrncmpi32A (Not a Windows API)
408 INT WINAPI
lstrncmpiA( LPCSTR str1
, LPCSTR str2
, INT n
)
412 TRACE(string
,"strncmpi %s and %s for %d chars\n",
413 debugstr_an (str1
, n
), debugstr_an (str2
, n
), n
);
415 while ((--n
> 0) && *str1
)
416 if ( (res
= toupper(*str1
++) - toupper(*str2
++)) ) return res
;
418 return toupper(*str1
) - toupper(*str2
);
422 /***********************************************************************
423 * lstrncmpi32W (Not a Windows API)
425 INT WINAPI
lstrncmpiW( LPCWSTR str1
, LPCWSTR str2
, INT n
)
429 TRACE(string
,"strncmpi L%s and L%s for %d chars\n",
430 debugstr_wn (str1
, n
), debugstr_wn (str2
, n
), n
);
432 while ((--n
> 0) && *str1
)
434 if ((res
= towupper(*str1
) - towupper(*str2
)) != 0) return res
;
438 return towupper(*str1
) - towupper(*str2
);
442 /***********************************************************************
443 * lstrcpyAtoW (Not a Windows API)
445 LPWSTR WINAPI
lstrcpyAtoW( LPWSTR dst
, LPCSTR src
)
447 register LPWSTR p
= dst
;
449 TRACE(string
,"%s\n",src
);
451 while ((*p
++ = (WCHAR
)(unsigned char)*src
++));
456 /***********************************************************************
457 * lstrcpyWtoA (Not a Windows API)
459 LPSTR WINAPI
lstrcpyWtoA( LPSTR dst
, LPCWSTR src
)
461 register LPSTR p
= dst
;
463 TRACE(string
,"L%s\n",debugstr_w(src
));
465 while ((*p
++ = (CHAR
)*src
++));
470 /***********************************************************************
471 * lstrcpynAtoW (Not a Windows API)
472 * Note: this function differs from the UNIX strncpy, it _always_ writes
475 LPWSTR WINAPI
lstrcpynAtoW( LPWSTR dst
, LPCSTR src
, INT n
)
479 TRACE(string
,"%s %i\n",src
, n
);
481 while ((n
-- > 1) && *src
) *p
++ = (WCHAR
)(unsigned char)*src
++;
487 /***********************************************************************
488 * lstrcpynWtoA (Not a Windows API)
489 * Note: this function differs from the UNIX strncpy, it _always_ writes
492 LPSTR WINAPI
lstrcpynWtoA( LPSTR dst
, LPCWSTR src
, INT n
)
496 TRACE(string
,"L%s %i\n",debugstr_w(src
), n
);
498 while ((n
-- > 1) && *src
) *p
++ = (CHAR
)*src
++;
503 /***********************************************************************
504 * UnicodeToAnsi (KERNEL.434)
506 INT16 WINAPI
UnicodeToAnsi16( LPCWSTR src
, LPSTR dst
, INT16 codepage
)
508 if ( codepage
!= -1 )
509 FIXME( string
, "codepage %d not supported\n", codepage
);
511 lstrcpyWtoA( dst
, src
);
513 return (INT16
)lstrlenA( dst
);
517 /***********************************************************************
520 void WINAPI
Copy16( LPVOID src
, LPVOID dst
, WORD size
)
522 memcpy( dst
, src
, size
);
526 /***********************************************************************
527 * RtlFillMemory (KERNEL32.441)
529 VOID WINAPI
RtlFillMemory( LPVOID ptr
, UINT len
, UINT fill
)
531 memset( ptr
, fill
, len
);
535 /***********************************************************************
536 * RtlMoveMemory (KERNEL32.442)
538 VOID WINAPI
RtlMoveMemory( LPVOID dst
, LPCVOID src
, UINT len
)
540 memmove( dst
, src
, len
);
544 /***********************************************************************
545 * RtlZeroMemory (KERNEL32.444)
547 VOID WINAPI
RtlZeroMemory( LPVOID ptr
, UINT len
)
549 memset( ptr
, 0, len
);
553 /***********************************************************************
554 * AnsiToOem16 (KEYBOARD.5)
556 INT16 WINAPI
AnsiToOem16( LPCSTR s
, LPSTR d
)
563 /***********************************************************************
564 * OemToAnsi16 (KEYBOARD.6)
566 INT16 WINAPI
OemToAnsi16( LPCSTR s
, LPSTR d
)
573 /***********************************************************************
574 * AnsiToOemBuff16 (KEYBOARD.134)
576 void WINAPI
AnsiToOemBuff16( LPCSTR s
, LPSTR d
, UINT16 len
)
578 if (len
!= 0) CharToOemBuffA( s
, d
, len
);
582 /***********************************************************************
583 * OemToAnsiBuff16 (KEYBOARD.135)
585 void WINAPI
OemToAnsiBuff16( LPCSTR s
, LPSTR d
, UINT16 len
)
587 if (len
!= 0) OemToCharBuffA( s
, d
, len
);
591 /***********************************************************************
592 * CharToOem32A (USER32.37)
594 BOOL WINAPI
CharToOemA( LPCSTR s
, LPSTR d
)
597 if (!s
|| !d
) return TRUE
;
598 TRACE(string
,"CharToOem %s\n", debugstr_a (s
));
599 while ((*d
++ = ANSI_TO_OEM(*s
++)));
600 TRACE(string
," to %s\n", debugstr_a (oldd
));
605 /***********************************************************************
606 * CharToOemBuff32A (USER32.38)
608 BOOL WINAPI
CharToOemBuffA( LPCSTR s
, LPSTR d
, DWORD len
)
610 while (len
--) *d
++ = ANSI_TO_OEM(*s
++);
615 /***********************************************************************
616 * CharToOemBuff32W (USER32.39)
618 BOOL WINAPI
CharToOemBuffW( LPCWSTR s
, LPSTR d
, DWORD len
)
620 while (len
--) *d
++ = ANSI_TO_OEM(*s
++);
625 /***********************************************************************
626 * CharToOem32W (USER32.40)
628 BOOL WINAPI
CharToOemW( LPCWSTR s
, LPSTR d
)
631 if (!s
|| !d
) return TRUE
;
632 TRACE(string
,"CharToOem L%s\n", debugstr_w (s
));
633 while ((*d
++ = ANSI_TO_OEM(*s
++)));
634 TRACE(string
," to %s\n", debugstr_a (oldd
));
639 /***********************************************************************
640 * OemToChar32A (USER32.402)
642 BOOL WINAPI
OemToCharA( LPCSTR s
, LPSTR d
)
645 TRACE(string
,"OemToChar %s\n", debugstr_a (s
));
646 while ((*d
++ = OEM_TO_ANSI(*s
++)));
647 TRACE(string
," to %s\n", debugstr_a (oldd
));
652 /***********************************************************************
653 * OemToCharBuff32A (USER32.403)
655 BOOL WINAPI
OemToCharBuffA( LPCSTR s
, LPSTR d
, DWORD len
)
657 TRACE(string
,"OemToCharBuff %s\n", debugstr_an (s
, len
));
658 while (len
--) *d
++ = OEM_TO_ANSI(*s
++);
663 /***********************************************************************
664 * OemToCharBuff32W (USER32.404)
666 BOOL WINAPI
OemToCharBuffW( LPCSTR s
, LPWSTR d
, DWORD len
)
668 TRACE(string
,"OemToCharBuff %s\n", debugstr_an (s
, len
));
669 while (len
--) *d
++ = (WCHAR
)OEM_TO_ANSI(*s
++);
674 /***********************************************************************
675 * OemToChar32W (USER32.405)
677 BOOL WINAPI
OemToCharW( LPCSTR s
, LPWSTR d
)
679 while ((*d
++ = (WCHAR
)OEM_TO_ANSI(*s
++)));
683 /***********************************************************************
684 * WideCharToLocal (Not a Windows API)
685 * similar lstrcpyWtoA, should handle codepages properly
688 * strlen of the destination string
691 INT WINAPI
WideCharToLocal(
696 TRACE(string
,"(%p, %s, %i)\n", pLocal
, debugstr_w(pWide
),dwChars
);
697 WideCharToMultiByte(CP_ACP
,0,pWide
,-1,pLocal
,dwChars
,NULL
,NULL
);
698 return strlen(pLocal
);
700 /***********************************************************************
701 * LocalToWideChar (Not a Windows API)
702 * similar lstrcpyAtoW, should handle codepages properly
705 * strlen of the destination string
707 INT WINAPI
LocalToWideChar(
712 TRACE(string
,"(%p, %s, %i)\n",pWide
, pLocal
, dwChars
);
713 MultiByteToWideChar(CP_ACP
,0,pLocal
,-1,pWide
,dwChars
);
714 return lstrlenW(pWide
);
718 /***********************************************************************
719 * lstrrchr (Not a Windows API)
721 * This is the implementation meant to be invoked form within
722 * COMCTL32_StrRChrA and shell32(TODO)...
724 * Return a pointer to the last occurence of wMatch in lpStart
725 * not looking further than lpEnd...
727 LPSTR WINAPI
lstrrchr( LPCSTR lpStart
, LPCSTR lpEnd
, WORD wMatch
)
729 LPCSTR lpGotIt
= NULL
;
731 TRACE(string
,"(%s, %s)\n", lpStart
, lpEnd
);
733 if (!lpEnd
) lpEnd
= lpStart
+ strlen(lpStart
);
735 for(; lpStart
< lpEnd
; lpStart
= CharNextA(lpStart
))
736 if (!ChrCmpA( GET_WORD(lpStart
), wMatch
))
739 return ((LPSTR
)lpGotIt
);
742 /***********************************************************************
743 * lstrrchrw (Not a Windows API)
745 * This is the implementation meant to be invoked form within
746 * COMCTL32_StrRChrW and shell32(TODO)...
748 * Return a pointer to the last occurence of wMatch in lpStart
749 * not looking further than lpEnd...
751 LPWSTR WINAPI
lstrrchrw( LPCWSTR lpStart
, LPCWSTR lpEnd
, WORD wMatch
)
753 LPCWSTR lpGotIt
= NULL
;
755 TRACE(string
,"(%p, %p, %c)\n", lpStart
, lpEnd
, wMatch
);
756 if (!lpEnd
) lpEnd
= lpStart
+ lstrlenW(lpStart
);
758 for(; lpStart
< lpEnd
; lpStart
= CharNextW(lpStart
))
759 if (!ChrCmpW( GET_WORD(lpStart
), wMatch
))
762 return (LPWSTR
)lpGotIt
;
765 /***********************************************************************
766 * strstrw (Not a Windows API)
768 * This is the implementation meant to be invoked form within
769 * COMCTL32_StrStrW and shell32(TODO)...
772 LPWSTR WINAPI
strstrw( LPCWSTR lpFirst
, LPCWSTR lpSrch
) {
773 UINT uSrchLen
= (UINT
)lstrlenW(lpSrch
);
774 WORD wMatchBeg
= *(WORD
*)lpSrch
;
776 TRACE(string
,"(%p, %p)\n", lpFirst
, lpSrch
);
779 ((lpFirst
=CRTDLL_wcschr(lpFirst
, wMatchBeg
))!=0) &&
780 lstrncmpW(lpFirst
, lpSrch
, uSrchLen
);
784 return (LPWSTR
)lpFirst
;
788 /***********************************************************************
790 * This fuction returns FALSE if both words match, TRUE otherwise...
792 static BOOL
ChrCmpA( WORD word1
, WORD word2
) {
793 if (LOBYTE(word1
) == LOBYTE(word2
)) {
794 if (IsDBCSLeadByte(LOBYTE(word1
))) {
795 return (word1
!= word2
);
802 /***********************************************************************
804 * This fuction returns FALSE if both words match, TRUE otherwise...
806 static BOOL
ChrCmpW( WORD word1
, WORD word2
) {
807 return (word1
!= word2
);