I am having trouble understanding the DDK
documentation in regards to UNICODE_STRINGS.
i am writing a driver that writes an output file.
instead of having the name of the file hard-coded
inside the driver source code, I would like to send it
a file name from a user application.
using buffered I/O, i would something like the
following in my test_app in user mode…
unsigned char FileInBuffer = “\??\c:\test.txt”;
and then do buffered I/O using DeviceIoControl
IoctlResult = DeviceIoControl(hTest,
(unsigned long)IOCTL_WRITE_FILE,
&FileInBuffer,
sizeof(FileInBuffer),
NULL,
0,
&ReturnedLength,
NULL);
and in my IO DeviceControl function in the driver
source code i have…
pBuffer = (UCHAR *)Irp->AssociatedIrp.SystemBuffer;
i would like to convert pBuffer to a unicode string,
so that I can do something like this before I create
my file object attributes using
InitializeObjectAttributes…
RtlInitUnicodeString(myObjectName, pBuffer_US);
where myObjectName is declared as…
UNICODE_STRING myObjectName;
and pBuffer_US is the equivalent of
L"\??\c:\test.txt"
instead of the normal…
RtlInitUnicodeStringmyObjectName,
L"\??\c:\test.txt");
…which works fine in my driver
thanks in advance for any assistance
-SA
Do you Yahoo!?
Send a seasonal email greeting and help others. Do good.
http://celebrity.mail.yahoo.com