I found that I can open “C:\somefile.ext” with ZwCreateFile pretty early in
the game, no need for the “\?” stuff. But in my case, even that fails when
I’m loading really early. Also, I suggest looking at the NTSTATUS coming out
of ZwCreateFile, to make sure that what’s happening is indeed what we thing
is happening !
Alberto.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Wednesday, July 07, 2004 1:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ZwCreateFile Problem
He tried that. This sounds a lot like alberto’s problem of a few weeks ago:
he is trying to open the file way too early in the boot process.
=====================
Mark Roddy
-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, July 07, 2004 12:57 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ZwCreateFile Problem
You can always use \SystemRoot to get at the windows root directory as well.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Krishnama Raju
Sent: Wednesday, July 07, 2004 8:41 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ZwCreateFile Problem
– try this …I guess u might have missed the char '"'in your code …
i tried this, its creating in my system… but check if the folder
“C:\Windows\System32\” really exists in your system…and try with simple
path, something like L"\??\C:\SomeFile.xml" …so that atleast you can
confirm whether our code is working or not…
RtlInitUnicodeString(&fileNameUnicodeString,L"\??\C:\Windows\System3
2\SomeFile.xml");
-----Original Message-----
From: Shalini [mailto:xxxxx@yahoo.com]
Sent: Wednesday, July 07, 2004 8:44 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ZwCreateFile Problem
Hi Raju
I get ERROR_INVALID_NAME if i use that.
“Krishnama Raju” wrote in message
news:xxxxx@ntdev…
if i’m not wrong try like this…
RtlInitUnicodeString(&fileNameUnicodeString,L"\\?\C:\Windows\System
32\
So
meFile.xml");
–cheers
K.Raju
-----Original Message-----
From: Shalini [mailto:xxxxx@yahoo.com]
Sent: Wednesday, July 07, 2004 8:17 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] ZwCreateFile Problem
Hi All,
My ZwCreateFile does not succeed at all. I had this problem initially and i
got this suddenly again.
I am calling this function from my first ReadWrite.(IRP_MJ_READ)
RtlInitUnicodeString(&fileNameUnicodeString,L\??\C:\Windows\System32
\So
meFile.xml);
InitializeObjectAttributes(&objectAttributes,
&fileNameUnicodeString,
OBJ_CASE_INSENSITIVE,
NULL,
NULL );
rc = ZwCreateFile( &hFileHandle, SYNCHRONIZE|FILE_ANY_ACCESS,
&objectAttributes, &IoStatus, NULL, 0,
FILE_SHARE_READ|FILE_SHARE_WRITE,
FILE_CREATE,
FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE,
NULL, 0 );
if(!NT_SUCCESS(rc))
KdPrint((DRIVERNAME “Error Creating the File\n”));
I always get the error code as -1073741766(ERROR_PATH_NOT_FOUND) I get the
same error code even if i change my file name to
\SystemRoot\System32\Somefile.xml …
Any ideas guys?
Regards
Shal
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@inquesttechnologies.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@inquesttechnologies.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.