NtOpenFile returning 0xC000003B

Hi All

I am trying to write a native windows app.
When I try to open the file, I get the error 0xC000003B which says
STATUS_OBJECT_PATH_SYNTAX_BAD.

I have specified the path as shown below. Could anyone help me in specifying
the path in the proper form.

OBJECT_ATTRIBUTES objAttrs;
IO_STATUS_BLOCK ioStatus;
NTSTATUS ntStat;

UNICODE_STRING strFileName;
RtlInitUnicodeString(&strFileName, L"c:\test.txt");
InitializeObjectAttributes(&objAttrs, &strFileName, OBJ_INHERIT, NULL,
NULL);

ntStat = NtOpenFile(&hFile, GENERIC_READ, &objAttrs, &ioStatus,
FILE_SHARE_READ, FILE_OPEN);

Thanks in advance for the help,

Cheers
Ramananda

> RtlInitUnicodeString(&strFileName, L"c:\test.txt");

Native apps cannot understand such paths. Use “\??\c:\test.txt” instead.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks Maxim, it is working fine for me now.

Cheers
Ramananda

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>> RtlInitUnicodeString(&strFileName, L"c:\test.txt");
>
> Native apps cannot understand such paths. Use “\??\c:\test.txt”
> instead.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>