You are issuing a call that can only be used at PASSIVE_LEVEL at
DISPATCH_LEVEL. The EvtTimerFunc is a DPC routine that runs at
DISPATCH_LEVEL. Use a WDF work item from the EvtTimerFunc to get a
function running at PASSIVE.
--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website:
http://www.windrvr.com
Blog:
http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"sinosoidal" <> wrote in message
news:A709505F-3663-4800-8279-...
> Hi,
>
> I'm trying to make the following in a timer callback:
>
> VOID
> DpxMttCalibrationStateEvtTimerFunction(
> IN WDFTIMER Timer
> )
> {
> NTSTATUS status = STATUS_SUCCESS;
> PDEVICE_EXTENSION devContext =
> GetDeviceContext(WdfTimerGetParentObject(Timer));
>
> UCHAR CalibrationState;
>
> status = DpxMttGetCalibrationState(devContext,&CalibrationS tate);
>
> if (status==STATUS_SUCCESS)
> {
> if (devContext->Context.State.Calibrated==0)
> {
> if (CalibrationState==1)
> devContext->Context.State.Calibrated = 1;
> else
> devContext->Context.State.Calibrated = 0;
> }
> }
> else
> {
> devContext->Context.State.Calibrated = 0;
> }
> }
>
>
> where
>
> NTSTATUS
> DpxMttGetCalibrationState(
> IN PDEVICE_EXTENSION devContext,
> OUT PUCHAR CalibrationState
> )
> {
> NTSTATUS status = STATUS_SUCCESS;
> WDF_MEMORY_DESCRIPTOR memDesc;
> WDF_USB_CONTROL_SETUP_PACKET controlSetupPacket;
> ULONG bytesTransferred = 0;
>
> WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR(&controlS etupPacket,
> BmRequestDeviceToHost,
> BmRequestToDevice,
> 0x03,
> 0,
> 0);
>
> WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&memDesc,
> CalibrationState,
> sizeof(UCHAR));
>
> status = WdfUsbTargetDeviceSendControlTransferSynchronously (
> devContext->UsbDevice,
> NULL, // Optional
> WDFREQUEST
> NULL, //
> PWDF_REQUEST_SEND_OPTIONS
> &controlSetupPacket,
> &memDesc,
> &bytesTransferred
> );
>
> return status;
> }
>
> But this always results in a blue screen! why?
>
> The same happens when I put it on the usb frame arrival callback.
>
> The only place it worked in know was in device io control events handler.
>
> I need to do this inside the kernel without being triggered from outside.
>
> Any tips?
>
> thanks,
>
> Nuno
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4725 (20091229) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4725 (20091229) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com