"Hans Leidekker" hans@it.vu.nl wrote:
+static DWORD map_info_level(DWORD level) +{
- DWORD ret = 0;
- switch (level & QUERY_HEADER_MASK)
- {
- case WINHTTP_QUERY_MIME_VERSION: ret = HTTP_QUERY_MIME_VERSION; break;
- case WINHTTP_QUERY_CONTENT_TYPE: ret = HTTP_QUERY_CONTENT_TYPE; break;
...
- switch (option)
- {
- case WINHTTP_OPTION_CALLBACK: opt = INTERNET_OPTION_CALLBACK; break;
- case WINHTTP_OPTION_CONNECT_TIMEOUT: opt = INTERNET_OPTION_CONNECT_TIMEOUT; break;
Probably a simple lookup table for both mappings above is enough since WINHTTP_QUERY_xxx and WINHTTP_OPTION_xxx values a sequential (perhaps excepting some reserved/undocumented ones).