Can't read/write file

Hello!

I got very strange problem. In my driver i use NuMega DriverWork’s KFile
class. File is created (i can see it on disk) and file handle is known good
(IsValid() return true), but all Read()/Write() operation are failed with
code STATUS_OBJECT_TYPE_MISMATCH. I try “play” with OpenCreate() params but
no luck. My “last iteration” is look like:

KUstring name( L"\DosDevices\C:\filename.dat" );

NTSTATUS ret = Index_file.OpenCreate
(
name,
// Name
0,
// pSecurity
FILE_GENERIC_READ | FILE_GENERIC_WRITE | SYNCHRONIZE, //
Access
OBJ_CASE_INSENSITIVE,
// ObjFlags
0,
// FileFlags
FILE_SHARE_READ | FILE_SHARE_WRITE, //
ShareDisposition
FILE_OPEN_IF,
// CreateDisposition
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, //
Options
0
// &initial_size
);

I check IRQL - it is OK (LEVEL_PASSIVE). What may be wrong?

Vladimir Ignatov


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com