[PATCH 0/1] MR2206: ntdll: Add ntdll_wcsstr function.
From: Tingzhong Luo <luotingzhong(a)uniontech.com> Signed-off-by: Haidong Yu <yuhaidong(a)uniontech.com> --- dlls/ntdll/unix/unix_private.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index d7d1d0d2ac0..56a911ec4ab 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -470,6 +470,18 @@ static inline WCHAR ntdll_towlower( WCHAR ch ) return ch + lctable[lctable[lctable[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0x0f)]; } +static inline WCHAR *ntdll_wcsstr( const WCHAR * str, const WCHAR * sub ) +{ + while (*str) + { + const WCHAR *p1 = str, *p2 = sub; + while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; } + if (!*p2) return (WCHAR *)str; + str++; + } + return NULL; +} + static inline WCHAR *ntdll_wcsupr( WCHAR *str ) { WCHAR *ret; @@ -480,6 +492,7 @@ static inline WCHAR *ntdll_wcsupr( WCHAR *str ) #define wcsupr(str) ntdll_wcsupr(str) #define towupper(c) ntdll_towupper(c) #define towlower(c) ntdll_towlower(c) +#define wcsstr(s1, s2) ntdll_wcsstr(s1,s2) static inline void init_unicode_string( UNICODE_STRING *str, const WCHAR *data ) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2206
This is just introducing dead (i.e. unused) code. If you need this for some other change, please add it along with that change. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2206#note_24527
This merge request was closed by Tingzhong Luo. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2206
participants (3)
-
Huw Davies (@huw) -
Tingzhong Luo -
Tingzhong Luo (@tzluo)