I do not know if this is trivial and i am very careless. I use this code
in AddDevice routine
KeQuerySystemTime(&liTime);
swprintf(timestr,L"%s%d%s",L"\SystemRoot\dbg",liTime.LowPart,L".log");
RtlInitUnicodeString(&_filename,_timestr);
InitializeObjectAttributes(&_objAtrr,&_filename,OBJ_CASE_INSENSITIVE,NULL,NULL);
ulstatus = ZwCreateFile(&_hFileHandle,
GENERIC_READ | GENERIC_WRITE,
&_objAtrr,
&_ioStatusBlock,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_DELETE,
FILE_OVERWRITE_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0);
I get 0xC000003A (STATUS_OBJECT_PATH_NOT_FOUND). My guess is that
SystemRoot is not assigned yet when my driver boots.
But is this possible? How the system knows how to boot itself if it does
not know the system path?
The same code i use with dispatch i/o routines and works just fine.
Help.