Wireshark-bugs: [Wireshark-bugs] [Bug 4030] GeoIP issues.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4030
--- Comment #25 from Guy Harris <guy@xxxxxxxxxxxx> 2011-10-11 18:54:57 PDT ---
ReadFile(), unfortunately, deals directly with Win32 HANDLEs rather than MSVC
file descriptors; I'm not certain how well MSVC-library I/O on a file
descriptor and Win32 I/O on the HANDLE corresponding to the descriptor works.
_get_osfhandle() can be used to get the HANDLE corresponding to a file
descriptor. The "Low-Level I/O" page
http://msdn.microsoft.com/en-us/library/40bbyw78.aspx
does say "These functions invoke the operating system directly for lower-level
operation than that provided by stream I/O. Low-level input and output calls do
not buffer or format data.", which hopefully means that, for example, _read()
is a wrapper around ReadFile() that gets the HANDLE and passes the buffer and
count down to ReadFile(), in which case our pread() would be a similar wrapper
around ReadFile().
According to
http://msdn.microsoft.com/en-us/library/aa365467%28VS.85%29.aspx
ReadFile(), when called with a pointer to an OVERLAPPED structure, does not
adjust the file pointer for the HANDLE, just as, according to
http://pubs.opengroup.org/onlinepubs/9699919799/toc.htm
pread() doesn't adjust the file pointer.
--
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are watching all bug changes.