Now i have this code, but it always set null
UNICODE_STRING str;
char *cmp = "Hello";
RtlInitUnicodeString (&str, L"Hello world!");
if( ( strstr((char * )str.Buffer, cmp) ) != NULL)
{
// cmp founded in str.
}
else
{
// cmp not founded in str. Always here, but why??
}
Can you explain me why strstr in my case always null?
You’re searching for a multi-byte string in a Unicode one. Use
wcsstr:You were hiding this by casting to
char *.You should really ask another question for your second request, but you might write a function like this:
Alternatively use
_wcslwr.