Re: Is OpenFile asynchronous

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



while the createfile operation is synchronous you can on vista cancel the
createfile request from another thread using CancelSynchronousIo or
CanncelIoEx...but the driver which is implementing the create file request
must support cancelation as well, so it will not always work.

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.


"Skywing [MVP]" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%23r3apiDrGHA.4336@xxxxxxxxxxxxxxxxxxxxxxx
It may be expensive if the the file is opened through the redirector over
the network or through a slow I/O device like a CDROM that might need to
seek for awhile if it already has a large request queue.

--
Ken Johnson (Skywing)
Windows SDK MVP

"anton bassov" <soviet_bloke@xxxxxxxxxxx> wrote in message
news:1153425434.049251.153540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi mate

Why do you think you need to open a file asynchronously, in the first
place???? Please note that my question has nothing to do with IO
operations on file - you may want asynchronous IO, but why opening
handles asynchronously???? After all, opening the existing file is not
really a time-consuming operation, is it?

Anton Bassov


William DePalo [MVP VC++] wrote:
<jondelac@xxxxxxxxx> wrote in message
news:1153365522.921473.33930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to find out of OpenFile is async or can be made async... I
want to open a file over a network share and dont want to wait till
the
file opens... How can I do this?

No, not only is it is not asynchronous, it is deprecated. You should use
CreateFile() instead. But that's not async, either. Can't you just call
the
function in another thread?

Regards,
Will





.



Relevant Pages

  • Re: File Mapping: Win32 differs from x64??
    ... Of course, I should have known, as it does say so in the CreateFile() page ... "Enables subsequent open operations on an object to request write access. ... there CreateFileopens the file happily with the ... SHARE_FILE_WRITE if a writable map exists, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: KMDF USB: Safely handling multiple child requests
    ... b/c you need to guard access to the 2nd list entyr in the request context. ... Can you explain why we should have only one thread to cancel the entire ...
    (microsoft.public.development.device.drivers)
  • Re: DFHSM CANCEL REQUEST
    ... If it is requesting a tape mount, DFHSM should have a message on the ... If you cancel the mount via the console mount request line, ... Subject: DFHSM CANCEL REQUEST ...
    (bit.listserv.ibm-main)
  • Negotiating With TimeWarnerCable (Re: KCAL keeping score)
    ... charge me $4.75 and finally send me a late bill instead of telling me ... ---when I make my annual call to TWC and request they cancel our sub. ... the reason for your cancellation request is ...
    (alt.sports.basketball.nba.la-lakers)
  • IoReadPartitionTable not returning to caller
    ... Driver's readentry point is called with new DeviceObject and new IRP ... Worker thread dequeues read request and processes it successfully ... (FPO: [Non-Fpo]) ... Cancel = 00 ...
    (microsoft.public.development.device.drivers)