NT device driver may not work on windows 2000, why?

Hi, I have written a dummy driver on NT 4.0. It works perfect on NT 4.0, but
when I move it to windows 2000. I can start and stop the driver, but when I
issue DeviceIoControl() to the driver, I get a blue screen. Here is code for
DeviceIoControl handling code. It really does nothing else, but just copy a
structure to SystemBuffer. Could somebody give me some hints? I have never
programmed for windows 2000 yet.

case IOCTL_UNAS_GET_REGS:
if ((Irp->AssociatedIrp.SystemBuffer != NULL) &&
(OutputLength >= sizeof(DeviceRegs)))
{
memcpy(Irp->AssociatedIrp.SystemBuffer, &pDevExt->deviceRegs,
sizeof(DeviceRegs));
status = STATUS_PENDING;
}

Irp->IoStatus.Status = status;
Irp->IoStatus.Information = sizeof(DeviceRegs);
break;

Thanks,

zhongsheng

Zhongsheng Wang
14150 SW Karl Braun Dr.
P.O.Box 500, M/S 50-480
Beaverton, OR 97077
Office: 503-627-5260
Fax: 503-627-4177
Email: xxxxx@tek.com


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

Hi,

I’d check the following topics if I were you:

  1. Using RtlCopyMemory instead of memcpy
  2. Looking at bugcheck address and comparing it with your deriver linker’s
    map to see where your driver crashes the system.
  3. How have you defined your custom IOCTRLs ?
  4. What kind of memory transfer do you use (e.g Direct, Buffered, Neither) ?
  5. I’m not sure about this but may be one of the unhandled PNP messages
    causes the bugcheck in your case. Once again check the address of the fail
    on the blue screen against your map.

Hope this helps,
Stas.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@exgate.tek.com
Sent: Friday, March 23, 2001 7:04 PM
To: NT Developers Interest List
Subject: [ntdev] NT device driver may not work on windows 2000, why?

Hi, I have written a dummy driver on NT 4.0. It works perfect on NT 4.0, but
when I move it to windows 2000. I can start and stop the driver, but when I
issue DeviceIoControl() to the driver, I get a blue screen. Here is code for
DeviceIoControl handling code. It really does nothing else, but just copy a
structure to SystemBuffer. Could somebody give me some hints? I have never
programmed for windows 2000 yet.

case IOCTL_UNAS_GET_REGS:
if ((Irp->AssociatedIrp.SystemBuffer != NULL) &&
(OutputLength >= sizeof(DeviceRegs)))
{
memcpy(Irp->AssociatedIrp.SystemBuffer, &pDevExt->deviceRegs,
sizeof(DeviceRegs));
status = STATUS_PENDING;
}

Irp->IoStatus.Status = status;
Irp->IoStatus.Information = sizeof(DeviceRegs);
break;

Thanks,

zhongsheng

Zhongsheng Wang
14150 SW Karl Braun Dr.
P.O.Box 500, M/S 50-480
Beaverton, OR 97077
Office: 503-627-5260
Fax: 503-627-4177
Email: xxxxx@tek.com


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


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

I don’t think that there is problem in your IOCTL Codes or even your memcpy
since you are sure it works fine under NT

----- Original Message -----
From: “Stas Desy”
To: “NT Developers Interest List”
Sent: Sunday, March 25, 2001 7:06 PM
Subject: [ntdev] RE: NT device driver may not work on windows 2000, why?

> Hi,
>
> I’d check the following topics if I were you:
> 1) Using RtlCopyMemory instead of memcpy
> 2) Looking at bugcheck address and comparing it with your deriver linker’s
> map to see where your driver crashes the system.
> 3) How have you defined your custom IOCTRLs ?
> 4) What kind of memory transfer do you use (e.g Direct, Buffered, Neither)
?
> 5) I’m not sure about this but may be one of the unhandled PNP messages
> causes the bugcheck in your case. Once again check the address of the fail
> on the blue screen against your map.
>
> Hope this helps,
> Stas.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of
> xxxxx@exgate.tek.com
> Sent: Friday, March 23, 2001 7:04 PM
> To: NT Developers Interest List
> Subject: [ntdev] NT device driver may not work on windows 2000, why?
>
>
> Hi, I have written a dummy driver on NT 4.0. It works perfect on NT 4.0,
but
> when I move it to windows 2000. I can start and stop the driver, but when
I
> issue DeviceIoControl() to the driver, I get a blue screen. Here is code
for
> DeviceIoControl handling code. It really does nothing else, but just copy
a
> structure to SystemBuffer. Could somebody give me some hints? I have never
> programmed for windows 2000 yet.
> …
> case IOCTL_UNAS_GET_REGS:
> if ((Irp->AssociatedIrp.SystemBuffer != NULL) &&
> (OutputLength >= sizeof(DeviceRegs)))
> {
> memcpy(Irp->AssociatedIrp.SystemBuffer, &pDevExt->deviceRegs,
> sizeof(DeviceRegs));
> status = STATUS_PENDING;
> }
> …
> Irp->IoStatus.Status = status;
> Irp->IoStatus.Information = sizeof(DeviceRegs);
> break;
> …
>
> Thanks,
>
> zhongsheng
> ===============================
> Zhongsheng Wang
> 14150 SW Karl Braun Dr.
> P.O.Box 500, M/S 50-480
> Beaverton, OR 97077
> Office: 503-627-5260
> Fax: 503-627-4177
> Email: xxxxx@tek.com
> ===============================
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@powernetsys.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


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

Hello,

why you returns with STATUS_PENDING ?
where is the completion from IO Control request ?

elli


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