Hi when I am doing ZwCreateFile I am getting STATUS_OBJECT_NAME_NOT_FOUND error.
below is the code can some one please help me.
IO_STATUS_BLOCK sb;
NTSTATUS ntStatus;
UNICODE_STRING idxName;
OBJECT_ATTRIBUTES idx_attr;
HANDLE hFile = NULL;
//
// Assume the directory is a temp directory under %windir%
//
RtlInitUnicodeString(&idxName, L"\SystemRoot\ShutdownTracker.dat");
InitializeObjectAttributes(
&idx_attr,
&idxName,
OBJ_CASE_INSENSITIVE|OBJ_KERNEL_HANDLE ,
NULL,
NULL
);
ntStatus = ZwCreateFile(
&hFile,
GENERIC_READ | SYNCHRONIZE,
&idx_attr,
&sb,
NULL,
FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM,
FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
FILE_OPEN,
FILE_NON_DIRECTORY_FILE |
FILE_RANDOM_ACCESS |
FILE_NO_INTERMEDIATE_BUFFERING |
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0
);
> Hi when I am doing ZwCreateFile I am getting STATUS_OBJECT_NAME_NOT_FOUND error.
…
RtlInitUnicodeString(&idxName, L"\SystemRoot\ShutdownTracker.dat");
May be file “C:\WINDOWS\System32\ShutdownTracker.dat” realy not exist?
xxxxx@rambler.ru wrote:
> Hi when I am doing ZwCreateFile I am getting STATUS_OBJECT_NAME_NOT_FOUND error.
>
…
> RtlInitUnicodeString(&idxName, L"\SystemRoot\ShutdownTracker.dat");
>
May be file “C:\WINDOWS\System32\ShutdownTracker.dat” realy not exist?
\SystemRoot maps to C:\Windows, not C:\Windows\System32.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> \SystemRoot maps to C:\Windows, not C:\Windows\System32.
Ups 
May be file “C:\WINDOWS\ShutdownTracker.dat” realy not exist?
Sorry I miss interpreted the path , it is not working
From:
Sent: Thursday, August 27, 2009 1:43 PM
To: “Windows System Software Devs Interest List”
Subject: RE:[ntdev] CreateFile returns STATUS_OBJECT_NAME_NOT_FOUND
>> \SystemRoot maps to C:\Windows, not C:\Windows\System32.
> Ups 
> May be file “C:\WINDOWS\ShutdownTracker.dat” realy not exist?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>