S
Shalini
Hi
I am using ZwCreateFile to open my PhysicalDrive0 from the Filter driver
that i have written.
For example i write that in the DriverEntry function as this
RtlInitUnicodeString( &fileNameUnicodeString, L"\\Device\\Harddisk0");
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_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FI
LE,
NULL,
0);
KdPrint((DRIVERNAME "Created the File %X\n",hFileHandle));
But always the hFileHandle is NULL.
and also the NTSTATUS returns -1073741788.
The Win32 error code for the NTSTATUS would be 6 saying invalid handle.
I also tried other ways namely "\\\\.\\PhysicalDrive0 or
\\Device\\PhysicalDrive0 but any time it was not successful
Apart from ZwCreateFile is it possible to access raw sectors from the Hard
disk,
If there is any other way also i can use that actually..
I thought i could use ZwCreateFile and then ZwReadFile to read some sectors
from the disk.
If there is any other way to read raw sectors i cud also use that
Any hints/Suggestions?
Thanks and Expecting ur replies
Regards
Shal
I am using ZwCreateFile to open my PhysicalDrive0 from the Filter driver
that i have written.
For example i write that in the DriverEntry function as this
RtlInitUnicodeString( &fileNameUnicodeString, L"\\Device\\Harddisk0");
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_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FI
LE,
NULL,
0);
KdPrint((DRIVERNAME "Created the File %X\n",hFileHandle));
But always the hFileHandle is NULL.
and also the NTSTATUS returns -1073741788.
The Win32 error code for the NTSTATUS would be 6 saying invalid handle.
I also tried other ways namely "\\\\.\\PhysicalDrive0 or
\\Device\\PhysicalDrive0 but any time it was not successful
Apart from ZwCreateFile is it possible to access raw sectors from the Hard
disk,
If there is any other way also i can use that actually..
I thought i could use ZwCreateFile and then ZwReadFile to read some sectors
from the disk.
If there is any other way to read raw sectors i cud also use that
Any hints/Suggestions?
Thanks and Expecting ur replies
Regards
Shal