Re: Is it windows bug ? Callback routine get wrong argument ?!
- From: "cristalink" <cristalink@xxxxxxxxxxxxx>
- Date: Tue, 26 Jul 2005 15:16:36 +1200
Apparently you use an explicit cast to shut up the compiler that warned you
about the type mismatch.
(PIO_WORKITEM_ROUTINE) USBCAMD_ProcessStillReadWorkItem
It must be
VOID
USBCAMD_ProcessStillReadWorkItem (
IN PDEVICE_OBJECT DeviceObject,
IN PVOID Context
);
--
http://www.cristalink.com
"SL Chang" <slchang@xxxxxxxxx> wrote in message
news:OXr$cuYkFHA.3568@xxxxxxxxxxxxxxxxxxxxxxx
> Driver is base on USBCAMD code inside DDK sample.
> Before I replace ExXxxxWorkItem with IoXxxxWorkItem, the address is match
> and data is correct too.
> I don't know why.
>
> ////////////////////////////////////////////////////////////////////////////
> /////////////////////
> typedef struct _USBCAMD_WORK_ITEM {
> PIO_WORKITEM WorkItem;
> PUSBCAMD_READ_EXTENSION Request;
> PUSBCAMD_CHANNEL_EXTENSION ChannelExtension;
> ULONG StreamNumber;
> BOOLEAN CopyFrameToStillPin;
> NTSTATUS status;
> PHW_STREAM_REQUEST_BLOCK Srb;
> } USBCAMD_WORK_ITEM, *PUSBCAMD_WORK_ITEM;
> ////////////////////////////////////////////////////////////////////////////
> /////////////////////
> ROUTINE_A(...) {
> PUSBCAMD_WORK_ITEM usbWorkItem;
> usbWorkItem = (PUSBCAMD_WORK_ITEM) USBCAMD_ExAllocatePool(NonPagedPool,
> sizeof(USBCAMD_WORK_ITEM));
> if (usbWorkItem) {
> usbWorkItem->WorkItem = IoAllocateWorkItem(
> ChannelExtension->DeviceExtension->SCDeviceObject);
> usbWorkItem->Request = NULL;
> usbWorkItem->ChannelExtension = ChannelExtension;
> usbWorkItem->status = ntStatus;
> DbgPrint("Address before callback routine = %x\n", usbWorkItem);
> if (usbWorkItem->WorkItem && !IsStop) {
> IoQueueWorkItem(usbWorkItem->WorkItem,
> (PIO_WORKITEM_ROUTINE)
> USBCAMD_ProcessStillReadWorkItem,
> DelayedWorkQueue,
> usbWorkItem);
> }
> else
> ExFreePool(usbWorkItem);
> }
> }
> }
> ////////////////////////////////////////////////////////////////////////////
> /////////////////////////////////////
> VOID USBCAMD_ProcessStillReadWorkITem(PVOID Context) {
> PUSBCAMD_WORK_ITEM usbWorkItem = (PUSBCAMD_WORK_ITEM) Context;
>
> //--------------------------------------------------------------------------
> ----
> // here get wrong structure context and address isn't match also.
> //--------------------------------------------------------------------------
> ----
> DbgPrint("Address inside callback routine = %x\n", Context);
>
> // do something ...
>
> IoFreeWorkItem(usbWorkItem->WorkItem);
> }
>
>
.
- Follow-Ups:
- References:
- Is it windows bug ? Callback routine get wrong argument ?!
- From: SL Chang
- Re: Is it windows bug ? Callback routine get wrong argument ?!
- From: Alexander Grigoriev
- Re: Is it windows bug ? Callback routine get wrong argument ?!
- From: SL Chang
- Is it windows bug ? Callback routine get wrong argument ?!
- Prev by Date: The unusual question is appeared in the printer installing.
- Next by Date: Re: Known bug in serial.sys on Windows XP ???
- Previous by thread: Re: Is it windows bug ? Callback routine get wrong argument ?!
- Next by thread: Re: Is it windows bug ? Callback routine get wrong argument ?!
- Index(es):
Relevant Pages
|