Re: IoFreeWorkItem and return function. by hsphuah
hsphuah
Wed Sep 13 03:50:05 CDT 2006
Thank you for your reply. I definitely know the "return" statement does
in C. My knowledge on device driver is limited and cannot find any
good explaination about IoFreeWorkItem function in the DDK
documentation when I dealed to my posted situation.
My initial thought about the IoFreeWorkItem function was it would work
likes return statement. From your answer, my thought was wrong. I shall
have the return statement if I want to exit my function. Please correct
me if I am wrong.
Thanks.
HS Phuah
Doron Holan [MS] wrote:
> you need the return in the if() if you don't to execute the code after it.
> this is not a workitem quesiton, this is more of a language question.
> perhaps you should brush up on C and what you want to accomplish
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> <hsphuah@usa.com> wrote in message
> news:1158030959.302799.58210@m73g2000cwd.googlegroups.com...
> > Hi all,
> >
> > I am new to device driver development and need an advice. I issue a
> > callback using this IoQueueWorkItem funciton.
> >
> > In my callback function, I have following code:
> >
> > void callback_function(....)
> > {
> > ...
> > if (status)
> > {
> > IoFreeWorkItem(...);
> > return;
> > }
> >
> > ....
> > IoFreeWorkItem;
> > }
> >
> > For the above simple IoFreeWorkItem, do I need to have a return in the
> > if statement?
> >
> > Thanks.
> > HS Phuah
> >