Package: mingw32-runtime
Version: 3.13-1
Severity: normal

While developing some code that uses the WinInet APIs using MinGW, I ran
into a problem when trying to set a callback context using
InternetSetOption(). On a Windows XP system it failed and the error
message that I retrieved using FormatMessage() is "The option is
invalid".

It turns out that once upon a time, the smart people at Microsoft
decided to make an incompatible change to the behvaior of
InternetSetOption(). The constant INTERNET_OPTION_CONTEXT_VALUE was
changed from 10 to 45. But the wininet.h shipped with MinGW still has
INTERNET_OPTION_CONTEXT_VALUE defined as 10. 

Using a literal 45 instead of the constant fixed the problem in my code,
but I think that wininet.h should be updated to reflect the changes made
in the Microsoft's PSDK years ago.

MSDN (http://msdn.microsoft.com/en-us/library/aa385328%28VS.85%29.aspx)
has the following to say:

,----
| INTERNET_OPTION_CONTEXT_VALUE
| 
|     45
| 
|     Sets or retrieves a DWORD_PTR that contains the address of the
|     context value associated with this HINTERNET handle. This option can
|     be used on any HINTERNET handle. This is used by InternetQueryOption
|     and InternetSetOption. Previously, this set the context value to the
|     address stored in the lpBuffer pointer. This has been corrected so
|     that the value stored in the buffer is used and the
|     INTERNET_OPTION_CONTEXT_VALUE flag is assigned a new value. The old
|     value, 10, has been preserved so that applications written for the
|     old behavior are still supported.
`----

I am not sure when exactly this change was introduced, but it must have
been a few years at least. (The wininet.h shipped with Microsoft
Platform SDK 2003(R2) defines it as 45 and the copyright notice of that
file is "Copyright (c) 1995-1999 Microsoft Corporation".)

-Hilko

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

mingw32-runtime depends on no packages.

Versions of packages mingw32-runtime recommends:
ii  gcc-mingw32 [mingw32]       4.4.4-0.1+b1 The GNU Compiler Collection (cross

mingw32-runtime suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to