From a83c265e215a9fa072e5cd3096ecb94d47466497 Mon Sep 17 00:00:00 2001 From: npmccallum Date: Wed, 20 Jan 2010 16:11:40 +0000 Subject: yet another set of build fixes for win32 git-svn-id: http://libproxy.googlecode.com/svn/trunk@485 c587cffe-e639-0410-9787-d7902ae8ed56 --- libproxy/modules/config_w32reg.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'libproxy/modules') diff --git a/libproxy/modules/config_w32reg.cpp b/libproxy/modules/config_w32reg.cpp index f47cfa5..65be5d6 100644 --- a/libproxy/modules/config_w32reg.cpp +++ b/libproxy/modules/config_w32reg.cpp @@ -16,21 +16,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ******************************************************************************/ -#include - #include "../module_types.hpp" +#include using namespace com::googlecode::libproxy; #define W32REG_OFFSET_PAC (1 << 2) #define W32REG_OFFSET_WPAD (1 << 3) #define W32REG_BASEKEY "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" +#define W32REG_BUFFLEN 1024 -static bool _get_registry(const char *key, const char *name, uchar **sval, uint32_t *slen, uint32_t *ival) { +static bool _get_registry(const char *key, const char *name, char **sval, uint32_t *slen, uint32_t *ival) { HKEY hkey; LONG result; DWORD type; - DWORD buflen = 1024; - BYTE buffer[buflen]; + DWORD buflen = W32REG_BUFFLEN; + BYTE buffer[W32REG_BUFFLEN]; // Don't allow the caller to specify both sval and ival if (sval && ival) @@ -65,9 +65,9 @@ static bool _get_registry(const char *key, const char *name, uchar **sval, uint3 } static bool _is_enabled(uint8_t type) { - uchar *data = NULL; - uint32_t dlen = 0; - bool result = false; + char *data = NULL; + uint32_t dlen = 0; + bool result = false; // Get the binary value DefaultConnectionSettings if (!_get_registry(W32REG_BASEKEY "\\Connections", "DefaultConnectionSettings", &data, &dlen, NULL)) @@ -84,7 +84,7 @@ static bool _is_enabled(uint8_t type) { static map _parse_manual(string data) { // ProxyServer comes in two formats: // 1.2.3.4:8080 or ftp=1.2.3.4:8080;https=1.2.3.4:8080... - map rval; + map rval; // If we have the second format, do recursive parsing, // then handle just the first entry @@ -101,7 +101,7 @@ static map _parse_manual(string data) { // Otherwise set the value for this single entry and return string protocol = data.substr(0, data.find("=")); - try { rval[protocol] = url(protocol + "://" + data.substr(data.find("=")+1)); } + try { rval[protocol] = url(protocol + "://" + data.substr(data.find("=")+1)).to_string(); } catch (parse_error&) {} return rval; @@ -137,15 +137,15 @@ public: delete tmp; // First we look for an exact match - if (manual.find(dst.get_scheme()) != map::end) + if (manual.find(dst.get_scheme()) != manual.end()) return manual[dst.get_scheme()]; // Next we look for http - else if (manual.find("http") != map::end) + else if (manual.find("http") != manual.end()) return manual["http"]; // Last we look for socks - else if (manual.find("socks") != map::end) + else if (manual.find("socks") != manual.end()) return manual["socks"]; } -- cgit v1.2.1