Driver Communication Problem in XP

Hi People,

I have gradually been converting my filter driver to XP compatibility. The
problem I have now is that when I open my driver for communication it
straight away BSODS and reboots - this doesn’t occur under NT or 2000 where
everything works fine.

It seems so straight forward to me.

Delphi code for opening my driver:

VxDHandle := INVALID_HANDLE_VALUE;
StrCopy(VxDName, ‘\.\MYDRIVER’);

VxDHandle:=CreateFile(
VxDName,
0,
FILE_SHARE_READ + FILE_SHARE_WRITE,
nil,
OPEN_EXISTING,
0,
0);
if VxDHandle <> INVALID_HANDLE_VALUE then
begin
CloseHandle(VxDHandle);
showmessage(‘opened and closed ok’);

end;

BTW - I use the same code for opening my 95/98/Me driver, thus the vxd
references.

My filter driver code is based on the sfilter example.

My ‘sfcreate’ routine begins with:

if ( GUIDevice == DeviceObject ) { // It’s a call
from our driver
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = FILE_OPENED;

IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_SUCCESS;
}

Which should just send it straight out without a worry.

Guidevice gets created in my DriverEntry routine.

status = IoCreateDevice(
DriverObject,
0,
&nameString,
FILE_DEVICE_DISK_FILE_SYSTEM,
0,
FALSE,
&GUIDevice
);

Since my Delphi code doesn’t call deviceiocontrol I can’t see that being
the problem.

Does anyone have any idea ?

Thanks for any help in advance.

Regards,
Graham Allen


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

What do your cleanup & close dispatches do?
Ravi

-----Original Message-----
From: Graham Allen [mailto:xxxxx@bigpond.net.au]
Sent: Monday, January 07, 2002 7:13 PM
To: File Systems Developers
Subject: [ntfsd] Driver Communication Problem in XP

Hi People,

I have gradually been converting my filter driver to XP compatibility.
The
problem I have now is that when I open my driver for communication it
straight away BSODS and reboots - this doesn’t occur under NT or 2000
where
everything works fine.

It seems so straight forward to me.

Delphi code for opening my driver:

VxDHandle := INVALID_HANDLE_VALUE;
StrCopy(VxDName, ‘\.\MYDRIVER’);

VxDHandle:=CreateFile(
VxDName,
0,
FILE_SHARE_READ + FILE_SHARE_WRITE,
nil,
OPEN_EXISTING,
0,
0);
if VxDHandle <> INVALID_HANDLE_VALUE then
begin
CloseHandle(VxDHandle);
showmessage(‘opened and closed ok’);

end;

BTW - I use the same code for opening my 95/98/Me driver, thus the vxd
references.

My filter driver code is based on the sfilter example.

My ‘sfcreate’ routine begins with:

if ( GUIDevice == DeviceObject ) { // It’s a call
from our driver
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = FILE_OPENED;

IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_SUCCESS;
}

Which should just send it straight out without a worry.

Guidevice gets created in my DriverEntry routine.

status = IoCreateDevice(
DriverObject,
0,
&nameString,
FILE_DEVICE_DISK_FILE_SYSTEM,
0,
FALSE,
&GUIDevice
);

Since my Delphi code doesn’t call deviceiocontrol I can’t see that being

the problem.

Does anyone have any idea ?

Thanks for any help in advance.

Regards,
Graham Allen


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


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

This isn’t an answer to your question, but:

VxDHandle:=CreateFile(
VxDName,
0,
FILE_SHARE_READ + FILE_SHARE_WRITE,
nil,
OPEN_EXISTING,
0,
0);

Don’t use + for manipulation of flags. Although it works for this
particular case (because the two flags are exclusive), it doesn’t in
general!
Use Or when you want to combine two flags, and And when you want to
include
only the same bits.


Kind regards, Dejan M. www.alfasp.com
E-mail: xxxxx@alfasp.com ICQ#: 56570367
Alfa File Monitor - File monitoring library for Win32 developers.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa Registry Monitor - Registry monitoring library for Win32
developers.
Alfa Registry Protector - Registry protection library for Win32
developers.


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