I have two HANDLEs and they are created from the same file,
in such condition I want to write on offset from 1 to 100 using the first HANDLE,
and from 101 to 200 using the 2nd HANDLE, from 201 to 300 using the first HANDLE,
…,
How can I make this operation seems like a sequential write and no time is wasted
between positioning the the pointers in the HANDLE?
You should be able to do asynchronous overlapped IO.
To get you started, look at the WriteFile win32 API call. It discusses how to use CreateFile with the FLAG_FILE_OVERLAPPED flag. You then call WriteFile and pass in an OVERLAPPED parameter, which contains the offset to start writing at and an event handle, which gets signaled when the IO is complete.
Alternativally, you can call WriteFileEx, which calls a function that you supply when the IO is complete, rather than signaling an event.
Note that you should write in blocks of 4K (4096) bytes rather then in blocks of 100 bytes, since this is the size of page files in Windows; it will speed up your IO considerably. Also note that this should only require one file handle, rather than multiple.