diff options
author | valerino <valerino@te4i.com> | 2010-05-20 22:53:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-05-24 11:46:45 -0400 |
commit | 8d31141ccbdbeee9589d04ea99819af7aa35193b (patch) | |
tree | 42b596b609a885d04a6a985b07b95fbd4d4ce015 /src/or/config.c | |
parent | ddf250119df44927c424512f286a3255aea1d16b (diff) | |
download | tor-8d31141ccbdbeee9589d04ea99819af7aa35193b.tar.gz tor-8d31141ccbdbeee9589d04ea99819af7aa35193b.zip |
Port Tor to work on Windows CE
Most of the changes here are switches to use APIs available on Windows
CE. The most pervasive change is that Windows CE only provides the
wide-character ("FooW") variants of most of the windows function, and
doesn't support the older ASCII verions at all.
This patch will require use of the wcecompat library to get working
versions of the posix-style fd-based file IO functions.
[commit message by nickm]
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index 5d07cd7343..82184c77d6 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -217,8 +217,12 @@ static config_var_t _option_vars[] = { V(ExitPortStatistics, BOOL, "0"), V(ExtraInfoStatistics, BOOL, "0"), +#if defined (WINCE) + V(FallbackNetworkstatusFile, FILENAME, "fallback-consensus"), +#else V(FallbackNetworkstatusFile, FILENAME, SHARE_DATADIR PATH_SEPARATOR "tor" PATH_SEPARATOR "fallback-consensus"), +#endif V(FascistFirewall, BOOL, "0"), V(FirewallPorts, CSV, ""), V(FastFirstHopPK, BOOL, "1"), @@ -3697,6 +3701,7 @@ get_windows_conf_root(void) { static int is_set = 0; static char path[MAX_PATH+1]; + WCHAR wpath[MAX_PATH] = {0}; LPITEMIDLIST idl; IMalloc *m; @@ -3714,7 +3719,7 @@ get_windows_conf_root(void) #define APPDATA_PATH CSIDL_APPDATA #endif if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, APPDATA_PATH, &idl))) { - GetCurrentDirectory(MAX_PATH, path); + getcwd(path,MAX_PATH); is_set = 1; log_warn(LD_CONFIG, "I couldn't find your application data folder: are you " @@ -3723,7 +3728,9 @@ get_windows_conf_root(void) return path; } /* Convert the path from an "ID List" (whatever that is!) to a path. */ - result = SHGetPathFromIDList(idl, path); + result = SHGetPathFromIDListW(idl, wpath); + wcstombs(path,wpath,MAX_PATH); + /* Now we need to free the */ SHGetMalloc(&m); if (m) { |