From: Kerem Gümrükcü on
Hi,

what is the best way to abort a synchronous function call or
better to say make the call abortable,...

Regards

Kerem

--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Latest Project: http://www.pro-it-education.de/software/deviceremover
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------

From: m on
Obviously, this depends on the function in question. If the API is in
Windows or a third party library, then the best advise I can give is don't
try.

If you want to write or modify one of your own APIs to be abortable, then I
can suggest that this is commonly done by replacing a call to
WaitForSingleObject with a call to WaitForMultipleObects + CancelIo & the
abort achieved by a call to SetEvent. Of course, the implementation details
of your API will dictate how cancelation should proceed since it depends on
where in the execution you want the call to be cancelable - clearly, there
will be some places that will execute before cancelation is possible, and
after it is no longer possible.

"Kerem G�mr�kc�" <kareem114(a)hotmail.com> wrote in message
news:O6zbp1ZgKHA.1648(a)TK2MSFTNGP05.phx.gbl...
> Hi,
>
> what is the best way to abort a synchronous function call or
> better to say make the call abortable,...
>
> Regards
>
> Kerem
>
> --
> -----------------------
> Beste Gr�sse / Best regards / Votre bien devoue
> Kerem G�mr�kc�
> Latest Project: http://www.pro-it-education.de/software/deviceremover
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------

From: Pavel A. on
"Kerem G�mr�kc�" <kareem114(a)hotmail.com> wrote in message
news:O6zbp1ZgKHA.1648(a)TK2MSFTNGP05.phx.gbl...
> Hi,
>
> what is the best way to abort a synchronous function call or
> better to say make the call abortable,...


On Vista+ there's a new API, CancelSynchronousIo to cancel functions that
were not
cancelable before (like CreateFile). But this is only for NT6.

--pa