Re: IoFreeWorkItem and return function.



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@xxxxxxx> wrote in message
news:1158030959.302799.58210@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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



.



Relevant Pages

  • Re: Asynchronous Threading Issue
    ... callbacks is that if I use a callback function it will execute on a ... if I use a callback function ... I want to call BeginConnect so that I try to connect without holding up ... but if there's an error connecting I want to ...
    (microsoft.public.dotnet.general)
  • Re: Asynchronous Threading Issue
    ... > callbacks is that if I use a callback function it will execute on a ... if I use a callback function ... > execution on the main thread, but if there's an error connecting I want to ... > which leads me to suspect the way BeginConnect operates ??? ...
    (microsoft.public.dotnet.general)
  • Re: execute() vs executeUpdate() on a prepared statement
    ... but I fogot to mention that for the profiler ... trace, please turn on all errors when running the trace. ... This alias is for newsgroup purposes only. ... >> If I changed the execute() to an executeUpdateand change nothing else, ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Confused about Windows Validation
    ... Enquire, plan and execute. ... "Alias" wrote in message ... > "Gerry Cornell" wrote ... > | Enquire, plan and execute. ...
    (microsoft.public.windowsxp.general)
  • Re: TcpClient BeginRead not spawning new thread
    ... I assume that BeginRead can actually execute the callback function ... within the BeginRead statement, and on same thread? ... In general, you can only assume that asynchronous operations will not block indefinitely, which is the main reason for using them. ... you can always change your delegate to execute its code on a thread pool thread instead ) but that's not a very elegant solution. ...
    (microsoft.public.dotnet.framework)