Answer the question
In order to leave comments, you need to log in
How to "trim" part of an LPCWSTR array?
Hello!
When I intercept the NtCreateFile function and get the file name from there, something like this comes out: \??\C:\мой_файл.data
I compare this string, and if it matches, then copying the file is prohibited
Can you tell me how to remove the first 4 characters or please tell me some function to check the occurrence (data type const wchar_t*)
Answer the question
In order to leave comments, you need to log in
Solved a problem:
wchar_t *subwstr(const wchar_t *str, size_t startPos, size_t len)
{
wchar_t* temp = new wchar_t[wcslen(str)+100];
wmemcpy(temp, str, 100);
temp[startPos + len] = '\0';
return temp + startPos;
}
const wchar_t* subw = subwstr((LPCWSTR)ObjectAttributes->ObjectName->Buffer, 4, wcslen((LPCWSTR)ObjectAttributes->ObjectName->Buffer));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question