Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert a wchar_t array to PUNICODE_STRING

I have a const string - "testfilename.sys", and I want to create a PUNICODE_STRING that will hold it.
How can I do that?

like image 943
sternr Avatar asked Apr 09 '26 21:04

sternr


1 Answers

As @David Heffernan pointed out, RtlInitUnicodeString is the way to create UNICODE_STRING structures.

In your case:

#include <Winternl.h>

[...]

UNICODE_STRING myUnicodeStr;
RtlInitUnicodeString(&myUnicodeStr, L"testfilename.sys");

A PUNICODE_STRING is just UNICODE_STRING*.

like image 188
Elliot Cameron Avatar answered Apr 11 '26 09:04

Elliot Cameron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!