Hi, Tony.
Thank you very much.
Use a worker thread from a completion routine; that is one of the primary
reasons completion routines are used in drivers in the first place.In your IRP_MJ handler code allocate the work item, mark the IRP as pending,
set the completion routine - passing the work item to the completion routine
via the context mechanism. Send the IRP to the next driver (IoCallDriver) and
return STATUS_PENDING (ignore the return code from the lower driver).In the completion routine, initialize the work item and then post it (or call
the work routine directly if you are operating at PASSIVE_LEVEL). Return
STATUS_MORE_PROCESSING_REQUIRED.In the work routine, you know you are called at PASSIVE_LEVEL. Block and
wait or do whatever other processing is required. Safe, OS-approved.Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
–http://www.eyou.com
–Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡
–http://vip.eyou.com
–¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû