How pass a UNICODE_STRING to a function that expect PUNICODE_STRING?

  • Thread starter Thread starter FLASHCODER
  • Start date Start date
F

FLASHCODER

Guest
I'm trying pass a directory path as UNICODE_STRING to a function that expect a PUNICODE_STRING, but this is failing.

Some idea to fix it?.

NTSTATUS EnumFiles(PUNICODE_STRING szPath)
{

UNICODE_STRING uAllocatedBufferName = RTL_CONSTANT_STRING(szPath);

OBJECT_ATTRIBUTES ObjAttributes;

InitializeObjectAttributes(&ObjAttributes,
&uAllocatedBufferName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
NULL, NULL);

}

// usage on DriverEntry():

UNICODE_STRING usDirectory;

RtlInitUnicodeString(&usDirectory,
L"\\??\\C:\\Program Files\\Foo");

EnumFiles(&usDirectory);

Continue reading...
 
Back
Top