Doubt in using IoIntializeIrp ?

Hi all

In the example provided in DDK documentation the following allocates the IRP
and Initializes with IoInitializeIrp but ddk documentation says it should
not be done that way . When I am trying to use IoReuseIrp I am getting
linker error . Anybody can suggest something about this ?

C:\NTDDK\SRC\wdm\videocap\usbcamd\iso.c(588)

irp = IoAllocateIrp(stackSize,
FALSE);
if (irp == NULL) {
USBCAMD_KdPrint(MIN_TRACE, (“Failed to create an IRP.\n”));
return irp;
}

IoInitializeIrp(irp,
IoSizeOfIrp(stackSize),
stackSize);

nextStack = IoGetNextIrpStackLocation(irp);
ASSERT(nextStack != NULL);

nextStack->Parameters.Others.Argument1 = Urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;

IoSetCompletionRoutine(irp,
CompletionRoutine,
TransferExtension,
TRUE,
TRUE,
TRUE);

DDK Documentation says :
Comments
Drivers use IoInitializeIrp to initialize IRPs the driver allocated as raw
memory. Drivers must not call IoInitializeIrp on an IRP that was allocated
by IoAllocateIrp. Drivers must not use IoInitializeIrp to reinitialize an
already initialized IRP. Instead, use IoReuseIrp.

Thanks in advance
srinivas


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

The sample code is wrong. This sample has been removed from the XP DDK.
This article
(http://support.microsoft.com/support/kb/articles/q195/3/94.asp)
explains why you shouldn’t call IoInitilizaIrp on an IRP allocated by
IoAllocateIrp.

IoReuseIrp should work. Make sure you aren’t making spelling or caps
mistake in the function name.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi
Sent: Tue 6/19/2001 8:57 PM
To: NT Developers Interest List
Cc:
Subject: [ntdev] Doubt in using IoIntializeIrp ?

Hi all

In the example provided in DDK documentation the following allocates the
IRP
and Initializes with IoInitializeIrp but ddk documentation says it
should
not be done that way . When I am trying to use IoReuseIrp I am getting
linker error . Anybody can suggest something about this ?

C:\NTDDK\SRC\wdm\videocap\usbcamd\iso.c(588)

irp = IoAllocateIrp(stackSize,
FALSE);
if (irp == NULL) {
USBCAMD_KdPrint(MIN_TRACE, (“Failed to create an IRP.\n”));
return irp;
}

IoInitializeIrp(irp,
IoSizeOfIrp(stackSize),
stackSize);

nextStack = IoGetNextIrpStackLocation(irp);
ASSERT(nextStack != NULL);

nextStack->Parameters.Others.Argument1 = Urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;

IoSetCompletionRoutine(irp,
CompletionRoutine,
TransferExtension,
TRUE,
TRUE,
TRUE);

DDK Documentation says :
Comments
Drivers use IoInitializeIrp to initialize IRPs the driver allocated as
raw
memory. Drivers must not call IoInitializeIrp on an IRP that was
allocated
by IoAllocateIrp. Drivers must not use IoInitializeIrp to reinitialize
an
already initialized IRP. Instead, use IoReuseIrp.

Thanks in advance
srinivas


You are currently subscribed to ntdev as: xxxxx@microsoft.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

Thanks Eliyas !

if I remove the header file “wdm.h” and include only “ntddk.h” it works . If
I include both then it gives the error . Is there any I reason why I should
not add both ?

Thanks and regards
srinivas

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Wednesday, June 20, 2001 3:36 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

The sample code is wrong. This sample has been removed from the XP DDK. This
article ( http://support.microsoft.com/support/kb/articles/q195/3/94.asp
http: ) explains
why you shouldn’t call IoInitilizaIrp on an IRP allocated by IoAllocateIrp.

IoReuseIrp should work. Make sure you aren’t making spelling or caps mistake
in the function name.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi
Sent: Tue 6/19/2001 8:57 PM
To: NT Developers Interest List
Cc:
Subject: [ntdev] Doubt in using IoIntializeIrp ?

Hi all

In the example provided in DDK documentation the following allocates the IRP
and Initializes with IoInitializeIrp but ddk documentation says it should
not be done that way . When I am trying to use IoReuseIrp I am getting
linker error . Anybody can suggest something about this ?

C:\NTDDK\SRC\wdm\videocap\usbcamd\iso.c(588)

irp = IoAllocateIrp(stackSize,
FALSE);
if (irp == NULL) {
USBCAMD_KdPrint(MIN_TRACE, (“Failed to create an IRP.\n”));
return irp;
}

IoInitializeIrp(irp,
IoSizeOfIrp(stackSize),
stackSize);

nextStack = IoGetNextIrpStackLocation(irp);
ASSERT(nextStack != NULL);

nextStack->Parameters.Others.Argument1 = Urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;

IoSetCompletionRoutine(irp,
CompletionRoutine,
TransferExtension,
TRUE,
TRUE,
TRUE);

DDK Documentation says :
Comments
Drivers use IoInitializeIrp to initialize IRPs the driver allocated as raw
memory. Drivers must not call IoInitializeIrp on an IRP that was allocated
by IoAllocateIrp. Drivers must not use IoInitializeIrp to reinitialize an
already initialized IRP. Instead, use IoReuseIrp.

Thanks in advance
srinivas


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


You are currently subscribed to ntdev as: xxxxx@transilica.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</http:>

You shouldn’t include both. You either include wdm.h or ntddk.h. You
include wdm.h if you want the driver to work on Win2K and 9x systems. If
you include ntddk.h, the driver will only work on Win2k and above.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi [mailto:xxxxx@Transilica.com]
Sent: Wednesday, June 20, 2001 5:26 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

Thanks Eliyas !

if I remove the header file “wdm.h” and include only “ntddk.h” it works
. If I include both then it gives the error . Is there any I reason why
I should not add both ?

Thanks and regards

srinivas

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Wednesday, June 20, 2001 3:36 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

The sample code is wrong. This sample has been removed from the XP DDK.
This article
(http://support.microsoft.com/support/kb/articles/q195/3/94.asp)
explains why you shouldn’t call IoInitilizaIrp on an IRP allocated by
IoAllocateIrp.

IoReuseIrp should work. Make sure you aren’t making spelling or caps
mistake in the function name.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi
Sent: Tue 6/19/2001 8:57 PM
To: NT Developers Interest List
Cc:
Subject: [ntdev] Doubt in using IoIntializeIrp ?

Hi all

In the example provided in DDK documentation the following allocates the
IRP
and Initializes with IoInitializeIrp but ddk documentation says it
should
not be done that way . When I am trying to use IoReuseIrp I am getting
linker error . Anybody can suggest something about this ?

C:\NTDDK\SRC\wdm\videocap\usbcamd\iso.c(588)

irp = IoAllocateIrp(stackSize,
FALSE);
if (irp == NULL) {
USBCAMD_KdPrint(MIN_TRACE, (“Failed to create an IRP.\n”));
return irp;
}

IoInitializeIrp(irp,
IoSizeOfIrp(stackSize),
stackSize);

nextStack = IoGetNextIrpStackLocation(irp);
ASSERT(nextStack != NULL);

nextStack->Parameters.Others.Argument1 = Urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;

IoSetCompletionRoutine(irp,
CompletionRoutine,
TransferExtension,
TRUE,
TRUE,
TRUE);

DDK Documentation says :
Comments
Drivers use IoInitializeIrp to initialize IRPs the driver allocated as
raw
memory. Drivers must not call IoInitializeIrp on an IRP that was
allocated
by IoAllocateIrp. Drivers must not use IoInitializeIrp to reinitialize
an
already initialized IRP. Instead, use IoReuseIrp.

Thanks in advance
srinivas


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


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


You are currently subscribed to ntdev as: xxxxx@microsoft.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

Thanks Eliyas.

I want the driver to work on Win2K and 9x systems . Is there any alternate
way other than using IoReuseIrp and include wdm.h ?

Thanks and regards
srinivas

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Wednesday, June 20, 2001 6:09 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

You shouldn’t include both. You either include wdm.h or ntddk.h. You include
wdm.h if you want the driver to work on Win2K and 9x systems. If you include
ntddk.h, the driver will only work on Win2k and above.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi [mailto:xxxxx@Transilica.com]
Sent: Wednesday, June 20, 2001 5:26 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

Thanks Eliyas !

if I remove the header file “wdm.h” and include only “ntddk.h” it works . If
I include both then it gives the error . Is there any I reason why I should
not add both ?

Thanks and regards

srinivas

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Wednesday, June 20, 2001 3:36 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

The sample code is wrong. This sample has been removed from the XP DDK. This
article ( http://support.microsoft.com/support/kb/articles/q195/3/94.asp
http: ) explains
why you shouldn’t call IoInitilizaIrp on an IRP allocated by IoAllocateIrp.

IoReuseIrp should work. Make sure you aren’t making spelling or caps mistake
in the function name.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi
Sent: Tue 6/19/2001 8:57 PM
To: NT Developers Interest List
Cc:
Subject: [ntdev] Doubt in using IoIntializeIrp ?

Hi all

In the example provided in DDK documentation the following allocates the IRP
and Initializes with IoInitializeIrp but ddk documentation says it should
not be done that way . When I am trying to use IoReuseIrp I am getting
linker error . Anybody can suggest something about this ?

C:\NTDDK\SRC\wdm\videocap\usbcamd\iso.c(588)

irp = IoAllocateIrp(stackSize,
FALSE);
if (irp == NULL) {
USBCAMD_KdPrint(MIN_TRACE, (“Failed to create an IRP.\n”));
return irp;
}

IoInitializeIrp(irp,
IoSizeOfIrp(stackSize),
stackSize);

nextStack = IoGetNextIrpStackLocation(irp);
ASSERT(nextStack != NULL);

nextStack->Parameters.Others.Argument1 = Urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;

IoSetCompletionRoutine(irp,
CompletionRoutine,
TransferExtension,
TRUE,
TRUE,
TRUE);

DDK Documentation says :
Comments
Drivers use IoInitializeIrp to initialize IRPs the driver allocated as raw
memory. Drivers must not call IoInitializeIrp on an IRP that was allocated
by IoAllocateIrp. Drivers must not use IoInitializeIrp to reinitialize an
already initialized IRP. Instead, use IoReuseIrp.

Thanks in advance
srinivas


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


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


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


You are currently subscribed to ntdev as: xxxxx@transilica.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</http:>

I don’t know of any alternative. I don’t know much about what works and
what doesn’t work on 9x. I remember Walter Oney provided some kind of
WDMStub to enable people to use such functions. Check out the samples in
his book.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi [mailto:xxxxx@Transilica.com]
Sent: Wednesday, June 20, 2001 8:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

Thanks Eliyas.

I want the driver to work on Win2K and 9x systems . Is there any
alternate way other than using IoReuseIrp and include wdm.h ?

Thanks and regards

srinivas

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Wednesday, June 20, 2001 6:09 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

You shouldn’t include both. You either include wdm.h or ntddk.h. You
include wdm.h if you want the driver to work on Win2K and 9x systems. If
you include ntddk.h, the driver will only work on Win2k and above.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi [mailto:xxxxx@Transilica.com]
Sent: Wednesday, June 20, 2001 5:26 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

Thanks Eliyas !

if I remove the header file “wdm.h” and include only “ntddk.h” it works
. If I include both then it gives the error . Is there any I reason why
I should not add both ?

Thanks and regards

srinivas

-----Original Message-----
From: Eliyas Yakub [mailto:xxxxx@microsoft.com]
Sent: Wednesday, June 20, 2001 3:36 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Doubt in using IoIntializeIrp ?

The sample code is wrong. This sample has been removed from the XP DDK.
This article
(http://support.microsoft.com/support/kb/articles/q195/3/94.asp)
explains why you shouldn’t call IoInitilizaIrp on an IRP allocated by
IoAllocateIrp.

IoReuseIrp should work. Make sure you aren’t making spelling or caps
mistake in the function name.

-Eliyas

-----Original Message-----
From: Srinivasa Rao Deevi
Sent: Tue 6/19/2001 8:57 PM
To: NT Developers Interest List
Cc:
Subject: [ntdev] Doubt in using IoIntializeIrp ?

Hi all

In the example provided in DDK documentation the following allocates the
IRP
and Initializes with IoInitializeIrp but ddk documentation says it
should
not be done that way . When I am trying to use IoReuseIrp I am getting
linker error . Anybody can suggest something about this ?

C:\NTDDK\SRC\wdm\videocap\usbcamd\iso.c(588)

irp = IoAllocateIrp(stackSize,
FALSE);
if (irp == NULL) {
USBCAMD_KdPrint(MIN_TRACE, (“Failed to create an IRP.\n”));
return irp;
}

IoInitializeIrp(irp,
IoSizeOfIrp(stackSize),
stackSize);

nextStack = IoGetNextIrpStackLocation(irp);
ASSERT(nextStack != NULL);

nextStack->Parameters.Others.Argument1 = Urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;

IoSetCompletionRoutine(irp,
CompletionRoutine,
TransferExtension,
TRUE,
TRUE,
TRUE);

DDK Documentation says :
Comments
Drivers use IoInitializeIrp to initialize IRPs the driver allocated as
raw
memory. Drivers must not call IoInitializeIrp on an IRP that was
allocated
by IoAllocateIrp. Drivers must not use IoInitializeIrp to reinitialize
an
already initialized IRP. Instead, use IoReuseIrp.

Thanks in advance
srinivas


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


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


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


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


You are currently subscribed to ntdev as: xxxxx@microsoft.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