Writefileex and readfileex

Source: Internet
Author: User

Bool writefileex (
Handle hfile,
Lpcvoid lpbuffer,
DWORD nnumberofbytestowrite,
Lpoverlapped,
Lpoverlapped_completion_routine lpcompletionroutine
);

Description: writes data to a file. This function can only be used for asynchronous I/O operations, that is, overlapped I/O. Note: writefile () can be used for synchronous and asynchronous I/O operations.

Hfile: file handle, which can be created using the createfile () function. This function can be called only when the file handle created using the file_flag_overlapped flag is used.
Lpbuffer: pointer to data
Nnumberofbytestowrite: number of bytes to be written.
Lpoverlapped: pointer to the overlapped variable.
Lpcompletionroutine: function pointer. This can be called asynchronous procedure CALS (APCs ). Function prototype:
Void callback fileiocompletionroutine (
DWORD dwerrorcode,
DWORD dwnumberofbytestransfered,
Lpoverlapped
);
Note the following:
1. Only "ex" readfile () and writefile () can be used in asynchronous process calls ().
2. In readfileex () and writefileex (). The hevent field in the specified overlapped does not need to be used to place an event handle. Free to use. Average
Useful pointers can be placed here.

Bool readfileex (
Handle hfile,
Lpvoid lpbuffer,
DWORD nnumberofbytestoread,
Lpoverlapped,
Lpoverlapped_completion_routine lpcompletionroutine
);
Description: reads data. The parameters are the same as those above.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.