From subversion at boxbackup.org Thu Jan 19 18:12:00 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:12:00 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3050 - in box/invisnet/vs2010/0.11/bin: . bbutil bbutil/win32 Message-ID: <20120119181200.9B6F51A32CA@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:11:59 +0000 (Thu, 19 Jan 2012) New Revision: 3050 Added: box/invisnet/vs2010/0.11/bin/bbutil/ box/invisnet/vs2010/0.11/bin/bbutil/bbutil.cpp box/invisnet/vs2010/0.11/bin/bbutil/bbutil.h box/invisnet/vs2010/0.11/bin/bbutil/est.cpp box/invisnet/vs2010/0.11/bin/bbutil/est.h box/invisnet/vs2010/0.11/bin/bbutil/u2w.cpp box/invisnet/vs2010/0.11/bin/bbutil/u2w.h box/invisnet/vs2010/0.11/bin/bbutil/win32/ box/invisnet/vs2010/0.11/bin/bbutil/win32/bbutil.ico box/invisnet/vs2010/0.11/bin/bbutil/win32/bbutil.rc box/invisnet/vs2010/0.11/bin/bbutil/win32/resource.h Log: bbutil - util to import *nix keys Added: box/invisnet/vs2010/0.11/bin/bbutil/bbutil.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/bbutil.cpp (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/bbutil.cpp 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,30 @@ +#include "bbutil.h" + + +int main(int argc, char *argv[]) +{ + switch(argc) { + case 1: + cout << "bbutil" << endl + << endl + << " est " << endl + << endl + << " Estimate disk usage." << endl + << endl + << " u2w " << endl + << endl + << " Imports Unix-style certificate and key files." << endl + << endl; + break; + case 3: + if (!strcmp("est",argv[1])) + do_est(argv[2]); + break; + case 5: + if (!strcmp("u2w",argv[1])) + do_u2w(argv[2],argv[3],argv[4]); + break; + } + + return 0; +} Added: box/invisnet/vs2010/0.11/bin/bbutil/bbutil.h =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/bbutil.h (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/bbutil.h 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,9 @@ +#include "Box.h" + +#include +#include + +#include "est.h" +#include "u2w.h" + +using namespace std; Added: box/invisnet/vs2010/0.11/bin/bbutil/est.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/est.cpp (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/est.cpp 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,87 @@ +#include "bbutil.h" +#include "zlib.h" + + +static uint64_t rawTotal = 0; +static uint64_t cmpTotal = 0; + + +static void recurse(std::string &path) +{ + uint64_t c = 0; + struct dirent *de; + DIR *dir = opendir(path.c_str()); + + while(NULL != (de = readdir(dir))) { + if ('.' == de->d_name[0] && ('\0' == de->d_name[1] || ('.' == de->d_name[1] && '\0' == de->d_name[2]))) + continue; + + std::string str(path); + str.append("\\"); + str.append(de->d_name); + + if (de->d_type & DT_DIR) { + cout << str.c_str() << ": " << rawTotal << " => " << cmpTotal << endl; + recurse(str); + } else { + char inBuf[4096]; + Bytef outBuf[4096]; + z_stream z = { reinterpret_cast(inBuf), + 0, + 0, + outBuf, + sizeof(outBuf), + 0, + NULL, + NULL, + Z_NULL, + Z_NULL, + Z_NULL, + Z_BINARY, + 0, + 0}; + ifstream fs(str, ios_base::binary); + + if (!fs.bad()) { + if (Z_OK == deflateInit(&z,Z_DEFAULT_COMPRESSION)) { + do { + fs.read(inBuf,sizeof(inBuf)); + + z.next_in = reinterpret_cast(inBuf); + z.avail_in = fs.gcount(); + do { + z.next_out = outBuf; + z.avail_out = sizeof(outBuf); + deflate(&z,Z_NO_FLUSH); + } while(z.avail_in > 0); + } while(fs.good()); + do { + z.next_out = outBuf; + z.avail_out = sizeof(outBuf); + } while (Z_OK == deflate(&z,Z_FINISH)); + deflateEnd(&z); + + rawTotal += z.total_in; + cmpTotal += z.total_out; + } else { + cerr << "deflateInit failed" << endl; + } + } else { + cerr << "Failed to open '" << str << "'" << endl; + } + fs.close(); + } + } + closedir(dir); +} + + +void do_est(const char *path) +{ + std::string rpath(path); + + recurse(rpath); + + cout << "Total data read: " << rawTotal << endl; + cout << "Total compressed: " << cmpTotal << endl; +} Added: box/invisnet/vs2010/0.11/bin/bbutil/est.h =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/est.h (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/est.h 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,2 @@ + +extern void do_est(const char *path); Added: box/invisnet/vs2010/0.11/bin/bbutil/u2w.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/u2w.cpp (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/u2w.cpp 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,230 @@ +#include "bbutil.h" + +#include + + + +static HCRYPTPROV getCryptProv() throw(Win32Exception) +{ + HCRYPTPROV hCryptProv = NULL; + + // first delete any existing provider that might be associated with existing certificates + CryptAcquireContext(&hCryptProv,"BoxBackup",MS_ENHANCED_PROV,PROV_RSA_FULL,CRYPT_DELETEKEYSET|CRYPT_MACHINE_KEYSET); + + if (!CryptAcquireContext(&hCryptProv,"BoxBackup",MS_ENHANCED_PROV,PROV_RSA_FULL,CRYPT_MACHINE_KEYSET)) { + if (!CryptAcquireContext(&hCryptProv,"BoxBackup",MS_ENHANCED_PROV,PROV_RSA_FULL,CRYPT_MACHINE_KEYSET|CRYPT_NEWKEYSET)) { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptAcquireContext, "Could not aquire context") + } + } + return hCryptProv; +} + +static void importKeysFile(const char *KeysFile) throw(Win32Exception) +{ + ifstream sKeysFile(KeysFile,ios_base::binary | ios_base::ate); + + if (sKeysFile.bad()) + THROW_EXCEPTION_MESSAGE(Win32Exception, Internal, "Bad KeysFile"); + ifstream::pos_type lenKeysFile = sKeysFile.tellg(); + sKeysFile.seekg(0); + + unique_ptr bufKeysFile(new char[lenKeysFile]); + sKeysFile.read(bufKeysFile.get(),lenKeysFile); + sKeysFile.close(); + + DWORD err; + HKEY hKey = NULL; + try { + if (ERROR_SUCCESS != (err = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Box Backup",0,KEY_QUERY_VALUE|KEY_SET_VALUE,&hKey))) { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_RegOpenKeyEx, "Cannot open SOFTWARE\\Box Backup"); + + } else { + if (ERROR_SUCCESS != (err = RegSetValueEx(hKey, + "FileEncKeys", + 0, + REG_BINARY, + reinterpret_cast(bufKeysFile.get()), + static_cast(lenKeysFile)))) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_RegSetValueEx, "Cannot write FileEncKeys"); + } + + RegCloseKey(hKey); + } + } catch(...) { + if (hKey) + RegCloseKey(hKey); + throw; + } + + cout << "Imported KeysFile (" << KeysFile << ") OK" << endl; +} + +static void importCertificateFile(HCRYPTPROV hCryptProv, const char *CertificateFile) throw(Win32Exception) +{ + ifstream sCertificateFile(CertificateFile, ios_base::ate); + + if (sCertificateFile.bad()) + THROW_EXCEPTION_MESSAGE(Win32Exception, Internal, "Bad CertificateFile"); + ifstream::pos_type lenCertificateFile = sCertificateFile.tellg(); + sCertificateFile.seekg(0); + + unique_ptr bufCertificateFile(new char[lenCertificateFile]); + sCertificateFile.read(bufCertificateFile.get(),lenCertificateFile); + sCertificateFile.close(); + + + HCERTSTORE hSystemStore = NULL; + PCCERT_CONTEXT pCertContext = NULL; + HCRYPTKEY hPubKey = NULL; + + try { + DWORD lenBinary = static_cast(lenCertificateFile * 3 / 4); + unique_ptr binCertificateFile(new BYTE[lenBinary]); + + if (!CryptStringToBinary(bufCertificateFile.get(), + static_cast(lenCertificateFile), + CRYPT_STRING_BASE64HEADER, + binCertificateFile.get(), + &lenBinary, + NULL, + NULL)) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptStringToBinary, "Failed to decode Certificate"); + } + + + if (NULL == (hSystemStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL, CERT_SYSTEM_STORE_LOCAL_MACHINE, L"MY"))) + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CertOpenStore, "Cannot open Local Machine certificate store"); + + if (!CertAddEncodedCertificateToStore(hSystemStore, + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + binCertificateFile.get(), + lenBinary, + CERT_STORE_ADD_REPLACE_EXISTING, + &pCertContext)) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CertAddEncodedCertificateToStore, "Failed to add certificate to store"); + } + + if (!CryptImportPublicKeyInfo(hCryptProv, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &pCertContext->pCertInfo->SubjectPublicKeyInfo, &hPubKey)) + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptImportPublicKeyInfo, "Failed to import Public Key"); + CryptDestroyKey(hPubKey); + + CRYPT_KEY_PROV_INFO cryptKeyProvInfo = { L"BoxBackup",MS_DEF_PROV_W,PROV_RSA_FULL,CRYPT_MACHINE_KEYSET,0,NULL,AT_KEYEXCHANGE }; + + if (!CertSetCertificateContextProperty(pCertContext,CERT_KEY_PROV_INFO_PROP_ID,0,&cryptKeyProvInfo)) + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CertSetCertificateContextProperty, "Failed to set context property"); + + CertFreeCertificateContext(pCertContext); + + } catch(...) { + if (pCertContext) + CertFreeCertificateContext(pCertContext); + if (hSystemStore) + CertCloseStore(hSystemStore,CERT_CLOSE_STORE_FORCE_FLAG); + throw; + } + + cout << "Imported CertificateFile (" << CertificateFile << ") OK" << endl; +} + +void importPrivateKeyFile(HCRYPTPROV hCryptProv, const char *PrivateKeyFile) throw(Win32Exception) +{ + ifstream sPrivateKeyFile(PrivateKeyFile, ios_base::ate); + + if (sPrivateKeyFile.bad()) + THROW_EXCEPTION_MESSAGE(Win32Exception, Internal, "Bad PrivateKeyFile"); + ifstream::pos_type lenPrivateKeyFile = sPrivateKeyFile.tellg(); + sPrivateKeyFile.seekg(0); + + unique_ptr bufPrivateKeyFile(new char[lenPrivateKeyFile]); + sPrivateKeyFile.getline(bufPrivateKeyFile.get(),lenPrivateKeyFile); // eat the first line so decoding doesn't choke + sPrivateKeyFile.read(bufPrivateKeyFile.get(),lenPrivateKeyFile); + sPrivateKeyFile.close(); + + + try { + DWORD lenBinaryPrivateKey = static_cast(lenPrivateKeyFile * 3 / 4); + unique_ptr binPrivateKeyFile(new BYTE[lenBinaryPrivateKey]); + + if (!CryptStringToBinary(bufPrivateKeyFile.get(), + static_cast(lenPrivateKeyFile), + CRYPT_STRING_BASE64, + binPrivateKeyFile.get(), + &lenBinaryPrivateKey, + NULL, + NULL)) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptStringToBinary, "Cannot decode Private Key"); + } + + DWORD lenDecodedPrivateKey = 0; + if (!CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + PKCS_RSA_PRIVATE_KEY, + binPrivateKeyFile.get(), + lenBinaryPrivateKey, + 0, + NULL, + &lenDecodedPrivateKey) && ERROR_MORE_DATA != GetLastError()) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptDecodeObject, "Failed to get buffer length to decode Private Key") + } + + unique_ptr decodedPrivateKey(new BYTE[lenDecodedPrivateKey]); + if (!CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + PKCS_RSA_PRIVATE_KEY, + binPrivateKeyFile.get(), + lenBinaryPrivateKey, + 0, + decodedPrivateKey.get(), + &lenDecodedPrivateKey)) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptDecodeObject, "Failed to decode Private Key") + } + + HCRYPTKEY hPrivKey; + if (!CryptImportKey(hCryptProv, + decodedPrivateKey.get(), + lenDecodedPrivateKey, + NULL, + CRYPT_EXPORTABLE, + &hPrivKey)) + { + THROW_EXCEPTION_MESSAGE(Win32Exception, API_CryptImportKey, "Failed to import Private Key") + } + CryptDestroyKey(hPrivKey); + + } catch(...) { + throw; + } + + cout << "Imported PrivateKeyFile (" << PrivateKeyFile << ") OK" << endl; +} + + +/* + * This is a utility function that can only be called by an administrator. + * I'm assuming things are as they ought to be - there are far better + * and easier ways to do damage to a system than by abusing this code. + */ +void do_u2w(const char *KeysFile, const char *CertificateFile, const char *PrivateKeyFile) throw() +{ + HCRYPTPROV hCryptProv = NULL; + + try { + hCryptProv = getCryptProv(); + + importKeysFile(KeysFile); + importCertificateFile(hCryptProv, CertificateFile); + importPrivateKeyFile(hCryptProv, PrivateKeyFile); + + } catch(Win32Exception &e) { + cout << e.what() << ": " << e.GetMessage() << endl; + } catch(std::exception &e) { + cout << e.what() << endl; + } + + if (hCryptProv) + CryptReleaseContext(hCryptProv,0); +} Added: box/invisnet/vs2010/0.11/bin/bbutil/u2w.h =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/u2w.h (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/u2w.h 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,3 @@ + + +extern void do_u2w(const char *KeysFile, const char *CertificateFile, const char *PrivateKeyFile); Added: box/invisnet/vs2010/0.11/bin/bbutil/win32/bbutil.ico =================================================================== (Binary files differ) Property changes on: box/invisnet/vs2010/0.11/bin/bbutil/win32/bbutil.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: box/invisnet/vs2010/0.11/bin/bbutil/win32/bbutil.rc =================================================================== (Binary files differ) Property changes on: box/invisnet/vs2010/0.11/bin/bbutil/win32/bbutil.rc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: box/invisnet/vs2010/0.11/bin/bbutil/win32/resource.h =================================================================== --- box/invisnet/vs2010/0.11/bin/bbutil/win32/resource.h (rev 0) +++ box/invisnet/vs2010/0.11/bin/bbutil/win32/resource.h 2012-01-19 18:11:59 UTC (rev 3050) @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by bbutil.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif From subversion at boxbackup.org Thu Jan 19 18:18:16 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:18:16 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3051 - box/invisnet/vs2010/0.11/lib/common Message-ID: <20120119181816.C213A1A32FD@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:18:16 +0000 (Thu, 19 Jan 2012) New Revision: 3051 Modified: box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in Log: autogen MC files Modified: box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in =================================================================== --- box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in 2012-01-19 18:11:59 UTC (rev 3050) +++ box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in 2012-01-19 18:18:16 UTC (rev 3051) @@ -2,6 +2,7 @@ # global exception list file my $global_list = '../../ExceptionCodes.txt'; +my $event_messages = '../win32/messages.mc'; my @exception; @@ -50,6 +51,7 @@ open CPP,">autogen_${class}Exception.cpp" or die "Can't open cpp file for writing"; open H,">autogen_${class}Exception.h" or die "Can't open h file for writing"; +open MC,">autogen_${class}Exception.mc" or die "Can't open mc file for writing"; # write header file my $guardname = uc 'AUTOGEN_'.$class.'EXCEPTION_H'; @@ -205,8 +207,24 @@ __E +for(my $e = 0; $e <= $#exception; $e++) +{ + if($exception[$e] ne '') + { + printf MC "MessageId=0x%02X%02X\n",$class_number,$e; + print MC "Severity=Warning\n"; + print MC "SymbolicName=MSG_${exception[$e]}\n"; + if($exception_desc[$e] ne '') + { + print MC $exception_desc[$e]."\n"; + } + print MC "%1\n.\n"; + } +} + close H; close CPP; +close MC; # update the global exception list my $list_before; @@ -281,5 +299,3 @@ print GLOBAL $list_after; close GLOBAL; - - From subversion at boxbackup.org Thu Jan 19 18:24:47 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:24:47 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3052 - box/invisnet/vs2010/0.11/lib/win32 Message-ID: <20120119182447.109F71A332E@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:24:46 +0000 (Thu, 19 Jan 2012) New Revision: 3052 Added: box/invisnet/vs2010/0.11/lib/win32/Win32Exception.cpp box/invisnet/vs2010/0.11/lib/win32/Win32Exception.h box/invisnet/vs2010/0.11/lib/win32/common_FileStream.cpp box/invisnet/vs2010/0.11/lib/win32/unicode.cpp box/invisnet/vs2010/0.11/lib/win32/unicode.h Log: Refactor Win32 code Added: box/invisnet/vs2010/0.11/lib/win32/Win32Exception.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/Win32Exception.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/Win32Exception.cpp 2012-01-19 18:24:46 UTC (rev 3052) @@ -0,0 +1,4 @@ +#include "Box.h" + + +DWORD Win32Exception::mGLE; Added: box/invisnet/vs2010/0.11/lib/win32/Win32Exception.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/Win32Exception.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/Win32Exception.h 2012-01-19 18:24:46 UTC (rev 3052) @@ -0,0 +1,47 @@ +#ifdef WIN32 +# pragma once + +# include "autogen_Win32BaseException.h" + + class Win32Exception : public Win32BaseException + { + public: + Win32Exception(unsigned int SubType, const std::string& rMessage = "") : Win32BaseException(SubType, rMessage) + { + mGLE = GetLastError(); + errno = win2errno(mGLE); + } + + Win32Exception(const Win32Exception &rToCopy) : Win32BaseException(rToCopy.mSubType, rToCopy.mMessage) + { + mGLE = GetLastError(); + errno = win2errno(mGLE); + } + + DWORD GetLastError() + { + return mGLE; + } + + static int win2errno(DWORD gle) throw() + { + switch(gle) { + case ERROR_ACCESS_DENIED: + return EACCES; + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + return ENOENT; + case ERROR_INVALID_PARAMETER: + return EINVAL; + case ERROR_SHARING_VIOLATION: + return EBUSY; + default: + return ENOSYS; + } + } + + protected: + static DWORD mGLE; + }; + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/common_FileStream.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/common_FileStream.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/common_FileStream.cpp 2012-01-19 18:24:46 UTC (rev 3052) @@ -0,0 +1,87 @@ +#include "Box.h" + + +using namespace Win32; + + +static DWORD dwDesiredAccess(int flags) throw() +{ + DWORD desiredAccess = FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA; + + if (flags & O_WRONLY) desiredAccess = FILE_WRITE_DATA; + else if (flags & O_RDWR) desiredAccess |= FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA | FILE_WRITE_EA; + + return desiredAccess; +} +static DWORD dwShareMode(int flags) throw() +{ + DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + + if (flags & O_LOCK) shareMode = 0; + + return shareMode; +} +static DWORD dwCreationDisposition(int flags) throw() +{ + DWORD creationDisposition = OPEN_EXISTING; + + if (flags & O_CREAT) + { + if (flags & O_EXCL) creationDisposition = CREATE_NEW; +// else if (flags & O_TRUNC) creationDisposition = TRUNCATE_EXISTING; + else creationDisposition = OPEN_ALWAYS; + } + else if (flags & O_TRUNC) creationDisposition = CREATE_ALWAYS; + + return creationDisposition; +} +static DWORD dwFlagsAndAttributes(int flags) throw() +{ + DWORD flagsAndAttributes = FILE_FLAG_BACKUP_SEMANTICS; + + if (flags & O_TEMPORARY) flagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE; + + return flagsAndAttributes; +} + +// -------------------------------------------------------------------------- +// +// Function +// Name: openfile +// Purpose: replacement for any open calls - handles unicode +// filenames - supplied in utf8 +// Created: 25th October 2004 +// +// -------------------------------------------------------------------------- +HANDLE openfile(const char *pFileName, int flags, int mode) throw() +{ + HANDLE hFile = INVALID_HANDLE_VALUE; + + try + { + std::string multiPath = ConvertPathToAbsoluteUnicode(pFileName); + std::wstring widePath = multi2wide(multiPath); + + if (INVALID_HANDLE_VALUE == (hFile = CreateFileW(widePath.c_str(), + dwDesiredAccess(flags), + dwShareMode(flags), + NULL, + dwCreationDisposition(flags), + dwFlagsAndAttributes(flags), + NULL))) + { + throw Win32Exception(Win32Exception::API_CreateFile, pFileName); + } + + if ((flags & O_APPEND) && INVALID_SET_FILE_POINTER == SetFilePointer(hFile, 0, NULL, FILE_END)) + throw Win32Exception(Win32Exception::API_SetFilePointer, pFileName); + + return hFile; + } + EMU_EXCEPTION_HANDLING + + if (INVALID_HANDLE_VALUE != hFile) + CloseHandle(hFile); + + return INVALID_HANDLE_VALUE; +} Added: box/invisnet/vs2010/0.11/lib/win32/unicode.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/unicode.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/unicode.cpp 2012-01-19 18:24:46 UTC (rev 3052) @@ -0,0 +1,112 @@ +#include "Box.h" + + +using namespace Win32; + + +// -------------------------------------------------------------------------- +// +// Function +// Name: ConvertToWideString +// Purpose: Converts a string from specified codepage to +// a wide string (wchar_t*). +// In case of fire, logs the error and returns NULL. +// Created: 4th February 2006 +// +// -------------------------------------------------------------------------- +static const wchar_t* ConvertToWideString(const char* pString, unsigned int codepage, bool logErrors) +{ + try + { + return multi2wide(pString,codepage).c_str(); + } + catch(Win32Exception &e) + { + if (logErrors) + BOX_LOG_WIN_ERROR_NUMBER(e.GetMessage(),e.GetLastError()); + } + return NULL; +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: ConvertUtf8ToWideString +// Purpose: Converts a string from UTF-8 to a wide string. +// In case of fire, logs the error and returns NULL. +// Created: 4th February 2006 +// +// -------------------------------------------------------------------------- +const wchar_t* ConvertUtf8ToWideString(const char* pString) throw() +{ + return ConvertToWideString(pString, CP_UTF8, true); +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: ConvertFromWideString +// Purpose: Converts a wide string to a narrow string in the +// specified code page. +// In case of fire, logs the error and returns NULL. +// Created: 4th February 2006 +// +// -------------------------------------------------------------------------- +const char* ConvertFromWideString(const wchar_t* pString, unsigned int codepage, bool logErrors) throw() +{ + try + { + return wide2multi(pString,codepage).c_str(); + } + catch(Win32Exception &e) + { + if (logErrors) + BOX_LOG_WIN_ERROR_NUMBER(e.GetMessage(),e.GetLastError()); + } + return NULL; +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: ConvertEncoding(const std::string&, int, +// std::string&, int) +// Purpose: Converts a string from one code page to another. +// On success, replaces contents of rDest and returns +// true. In case of fire, logs the error and returns +// false. +// Created: 15th October 2006 +// +// -------------------------------------------------------------------------- +bool ConvertEncoding(const std::string& rSource, int sourceCodePage, std::string& rDest, int destCodePage) throw() +{ + try + { + wide2multi( multi2wide(rSource,sourceCodePage), rDest, destCodePage ); + return true; + } + EMU_EXCEPTION_HANDLING_RETURN(false) +} + +bool ConvertToUtf8(const std::string& rSource, std::string& rDest, int sourceCodePage) throw() +{ + return ConvertEncoding(rSource, sourceCodePage, rDest, CP_UTF8); +} + +bool ConvertFromUtf8(const std::string& rSource, std::string& rDest, int destCodePage) throw() +{ + return ConvertEncoding(rSource, CP_UTF8, rDest, destCodePage); +} + +bool ConvertConsoleToUtf8(const std::string& rSource, std::string& rDest) throw() +{ + return ConvertToUtf8(rSource, rDest, GetConsoleCP()); +} + +bool ConvertUtf8ToConsole(const std::string& rSource, std::string& rDest) throw() +{ + return ConvertFromUtf8(rSource, rDest, GetConsoleOutputCP()); +} Added: box/invisnet/vs2010/0.11/lib/win32/unicode.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/unicode.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/unicode.h 2012-01-19 18:24:46 UTC (rev 3052) @@ -0,0 +1,14 @@ +#ifndef EMU_UNICODE_H +# define EMU_UNICODE_H + +# ifdef WIN32 +# pragma once + + extern bool ConvertEncoding (const std::string& rSource, int sourceCodePage, std::string& rDest, int destCodePage) throw(); + extern bool ConvertToUtf8 (const std::string& rSource, std::string& rDest, int sourceCodePage) throw(); + extern bool ConvertFromUtf8 (const std::string& rSource, std::string& rDest, int destCodePage) throw(); + extern bool ConvertUtf8ToConsole(const std::string& rSource, std::string& rDest) throw(); + extern bool ConvertConsoleToUtf8(const std::string& rSource, std::string& rDest) throw(); +# endif + +#endif From subversion at boxbackup.org Thu Jan 19 18:25:17 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:25:17 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3053 - in box/invisnet/vs2010/0.11/lib: backupclient common Message-ID: <20120119182517.2B5071A3356@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:25:17 +0000 (Thu, 19 Jan 2012) New Revision: 3053 Added: box/invisnet/vs2010/0.11/lib/common/Win32PreCompiledHeader.cpp Modified: box/invisnet/vs2010/0.11/lib/backupclient/Win32PreCompiledHeader.cpp Log: pre-compiled headers Modified: box/invisnet/vs2010/0.11/lib/backupclient/Win32PreCompiledHeader.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/backupclient/Win32PreCompiledHeader.cpp 2012-01-19 18:24:46 UTC (rev 3052) +++ box/invisnet/vs2010/0.11/lib/backupclient/Win32PreCompiledHeader.cpp 2012-01-19 18:25:17 UTC (rev 3053) @@ -2,6 +2,4 @@ #include "Box.h" -#ifdef WIN32 -const char pch[] = "Windows Precompiled Header"; -#endif +const char pch[] = "Windows Pre-Compiled Header"; Added: box/invisnet/vs2010/0.11/lib/common/Win32PreCompiledHeader.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/common/Win32PreCompiledHeader.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/common/Win32PreCompiledHeader.cpp 2012-01-19 18:25:17 UTC (rev 3053) @@ -0,0 +1,5 @@ +// A file to allow PCH + +#include "Box.h" + +const char pch[] = "Windows Pre-Compiled Header"; From subversion at boxbackup.org Thu Jan 19 18:26:04 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:26:04 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3054 - in box/invisnet/vs2010/0.11/infrastructure/msvc/2010: . boxbackup boxbackup/bbackupclient boxbackup/bbackupctl boxbackup/bbackupd boxbackup/bbackupquery boxbackup/bbstored boxbackup/bbutil install install/custom Message-ID: <20120119182604.A78701A33AB@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:26:04 +0000 (Thu, 19 Jan 2012) New Revision: 3054 Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj.filters box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj.filters box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj.filters Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupclient/bbackupclient.vcxproj box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupctl/bbackupctl.vcxproj box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupd/bbackupd.vcxproj box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupquery/bbackupquery.vcxproj Log: VS project files Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupclient/bbackupclient.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupclient/bbackupclient.vcxproj 2012-01-19 18:25:17 UTC (rev 3053) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupclient/bbackupclient.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -183,7 +183,16 @@ - + + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupctl/bbackupctl.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupctl/bbackupctl.vcxproj 2012-01-19 18:25:17 UTC (rev 3053) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupctl/bbackupctl.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -253,7 +253,20 @@ - + + $(SolutionDir)..\..\..\lib\common + $(SolutionDir)..\..\..\lib\common + $(SolutionDir)..\..\..\lib\common + $(SolutionDir)..\..\..\lib\common + $(SolutionDir)..\..\..\lib\common + $(SolutionDir)..\..\..\lib\common + 0x0809 + 0x0809 + 0x0809 + 0x0809 + 0x0809 + 0x0809 + Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupd/bbackupd.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupd/bbackupd.vcxproj 2012-01-19 18:25:17 UTC (rev 3053) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupd/bbackupd.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -329,7 +329,20 @@ - + + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupquery/bbackupquery.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupquery/bbackupquery.vcxproj 2012-01-19 18:25:17 UTC (rev 3053) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbackupquery/bbackupquery.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -319,7 +319,20 @@ - + + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -0,0 +1,211 @@ +? + + + + Debug XP + Win32 + + + Debug XP + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2F13350C-C902-47B8-8584-8FA2F6C05917} + bbstored + + + + Application + true + MultiByte + + + Application + true + MultiByte + + + Application + true + MultiByte + + + Application + true + MultiByte + + + Application + false + true + MultiByte + + + Application + false + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + + Level4 + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(SolutionDir)..\..\..\lib\backupstore;$(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\raidfile;$(SolutionDir)..\..\..\lib\server;$(SolutionDir)..\..\..\lib\win32 + _DEBUG;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;%(PreprocessorDefinitions) + 4100 + + + true + + + + + Level4 + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(SolutionDir)..\..\..\lib\backupstore;$(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\raidfile;$(SolutionDir)..\..\..\lib\server;$(SolutionDir)..\..\..\lib\win32 + _DEBUG;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;%(PreprocessorDefinitions) + 4100 + + + true + + + + + Level4 + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(SolutionDir)..\..\..\lib\backupstore;$(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\raidfile;$(SolutionDir)..\..\..\lib\server;$(SolutionDir)..\..\..\lib\win32 + _DEBUG;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;%(PreprocessorDefinitions) + 4100 + + + true + + + + + Level4 + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(SolutionDir)..\..\..\lib\backupstore;$(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\raidfile;$(SolutionDir)..\..\..\lib\server;$(SolutionDir)..\..\..\lib\win32 + _DEBUG;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;%(PreprocessorDefinitions) + 4100 + + + true + + + + + Level3 + MaxSpeed + true + true + $(SolutionDir)..\..\..\lib\backupclient;$(SolutionDir)..\..\..\lib\backupstore;$(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\raidfile;$(SolutionDir)..\..\..\lib\server;$(SolutionDir)..\..\..\lib\win32 + NDEBUG;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;%(PreprocessorDefinitions) + 4100 + MultiThreadedDebugDLL + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + $(SolutionDir)..\..\..\lib\backupclient;$(SolutionDir)..\..\..\lib\backupstore;$(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\raidfile;$(SolutionDir)..\..\..\lib\server;$(SolutionDir)..\..\..\lib\win32 + NDEBUG;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;%(PreprocessorDefinitions) + 4100 + MultiThreadedDebugDLL + + + true + true + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj.filters =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj.filters (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbstored/bbstored.vcxproj.filters 2012-01-19 18:26:04 UTC (rev 3054) @@ -0,0 +1,51 @@ +? + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -0,0 +1,275 @@ +? + + + + Debug XP + Win32 + + + Debug XP + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3} + Win32Proj + bbutil + + + + Application + true + MultiByte + + + Application + true + MultiByte + + + Application + true + MultiByte + + + Application + true + MultiByte + + + Application + false + true + MultiByte + + + Application + false + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + true + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + true + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + true + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + false + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + false + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\boxbackup\$(ProjectName)\ + + + + + + Level3 + Disabled + WIN32;_CONSOLE;_WIN32_WINNT=0x0600;_DEBUG; + $(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\win32;$(SolutionDir)..\..\..\zlib + 4290 + + + Console + true + crypt32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + RequireAdministrator + + + + + + + Level3 + Disabled + WIN32;_CONSOLE;_WIN32_WINNT=0x0501;_DEBUG; + $(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\win32;$(SolutionDir)..\..\..\zlib + 4290 + + + Console + true + crypt32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + RequireAdministrator + + + + + + + Level3 + Disabled + WIN32;_CONSOLE;_WIN32_WINNT=0x0600;_DEBUG;_WIN64; + $(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\win32;$(SolutionDir)..\..\..\zlib + 4290 + + + Console + true + crypt32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + RequireAdministrator + + + + + + + Level3 + Disabled + WIN32;_CONSOLE;_WIN32_WINNT=0x0501;_DEBUG;_WIN64; + $(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\win32;$(SolutionDir)..\..\..\zlib + 4290 + + + Console + true + crypt32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + RequireAdministrator + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_WIN32_WINNT=0x0600;NDEBUG;BOX_RELEASE_BUILD; + $(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\win32;$(SolutionDir)..\..\..\zlib + 4290 + + + Console + true + true + true + crypt32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + RequireAdministrator + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_WIN32_WINNT=0x0600;NDEBUG;BOX_RELEASE_BUILD;_WIN64; + $(SolutionDir)..\..\..\lib\common;$(SolutionDir)..\..\..\lib\win32;$(SolutionDir)..\..\..\zlib + 4290 + + + Console + true + true + true + crypt32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + RequireAdministrator + + + + + + + + + + + + + + + + {80e019ff-948a-44c1-b422-2d9e540f9ff1} + true + false + false + true + false + + + {12881b55-f898-4c2c-9507-658ffb9af053} + + + + + + + + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + 0x0809 + $(SolutionDir)..\..\..\lib\common + + + + + + \ No newline at end of file Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj.filters =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj.filters (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup/bbutil/bbutil.vcxproj.filters 2012-01-19 18:26:04 UTC (rev 3054) @@ -0,0 +1,52 @@ +? + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln 2012-01-19 18:25:17 UTC (rev 3053) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln 2012-01-19 18:26:04 UTC (rev 3054) @@ -120,6 +120,8 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupclient", "boxbackup\bbackupclient\bbackupclient.vcxproj", "{DCEF045D-507C-4137-B11A-C76C4B94DFBA}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbutil", "boxbackup\bbutil\bbutil.vcxproj", "{D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution bbstored|Mixed Platforms = bbstored|Mixed Platforms @@ -134,6 +136,10 @@ Debug With Tests|Win32 = Debug With Tests|Win32 Debug With Tests|x64 = Debug With Tests|x64 Debug With Tests|x86 = Debug With Tests|x86 + Debug XP|Mixed Platforms = Debug XP|Mixed Platforms + Debug XP|Win32 = Debug XP|Win32 + Debug XP|x64 = Debug XP|x64 + Debug XP|x86 = Debug XP|x86 Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 @@ -176,6 +182,13 @@ {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug With Tests|x64.Build.0 = Debug|x64 {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug With Tests|x86.Build.0 = Debug|Win32 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|x64.Build.0 = Debug XP|x64 + {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug XP|x86.ActiveCfg = Debug XP|x64 {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug|Mixed Platforms.Build.0 = Debug|x64 {2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -224,6 +237,13 @@ {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug With Tests|x64.Build.0 = Debug|x64 {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug With Tests|x86.Build.0 = Debug|Win32 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|x64.Build.0 = Debug XP|x64 + {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug XP|x86.ActiveCfg = Debug XP|x64 {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug|Mixed Platforms.Build.0 = Debug|x64 {03734708-A8DD-4F61-A1CE-FDCB32079E9A}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -271,6 +291,13 @@ {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug With Tests|x64.Build.0 = Debug|x64 {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug With Tests|x86.Build.0 = Debug|Win32 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|x64.Build.0 = Debug XP|x64 + {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug XP|x86.ActiveCfg = Debug XP|x64 {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug|Mixed Platforms.Build.0 = Debug|x64 {80E019FF-948A-44C1-B422-2D9E540F9FF1}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -320,6 +347,13 @@ {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug With Tests|x64.Build.0 = Debug|x64 {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug With Tests|x86.Build.0 = Debug|Win32 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|x64.Build.0 = Debug XP|x64 + {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B3B4FE6B-5065-46C4-8664-847F51CC7B7C}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -369,6 +403,13 @@ {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug With Tests|x64.Build.0 = Debug|x64 {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug With Tests|x86.Build.0 = Debug|Win32 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|x64.Build.0 = Debug XP|x64 + {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug XP|x86.ActiveCfg = Debug XP|x64 {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug|Mixed Platforms.Build.0 = Debug|x64 {12881B55-F898-4C2C-9507-658FFB9AF053}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -419,6 +460,13 @@ {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug With Tests|x64.Build.0 = Debug|x64 {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug With Tests|x86.Build.0 = Debug|Win32 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|x64.Build.0 = Debug XP|x64 + {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug XP|x86.ActiveCfg = Debug XP|x64 {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug|Mixed Platforms.Build.0 = Debug|x64 {1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -469,6 +517,13 @@ {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug With Tests|x64.Build.0 = Debug|x64 {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug With Tests|x86.Build.0 = Debug|Win32 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|x64.Build.0 = Debug XP|x64 + {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug XP|x86.ActiveCfg = Debug XP|x64 {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug|Mixed Platforms.Build.0 = Debug|x64 {DCDD2786-23D3-44DB-9509-864DC01DB661}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -518,6 +573,13 @@ {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug With Tests|x64.Build.0 = Debug|x64 {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug With Tests|x86.Build.0 = Debug|Win32 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|x64.Build.0 = Debug XP|x64 + {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug XP|x86.ActiveCfg = Debug XP|x64 {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug|Mixed Platforms.Build.0 = Debug|x64 {719D334E-6432-4005-9AEB-5763C23BE75B}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -569,6 +631,13 @@ {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug With Tests|x64.Build.0 = Debug|x64 {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug With Tests|x86.Build.0 = Debug|Win32 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|x64.Build.0 = Debug XP|x64 + {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug XP|x86.ActiveCfg = Debug XP|x64 {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug|Mixed Platforms.Build.0 = Debug|x64 {682F676C-50F5-45AF-85FA-C23E344583FC}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -617,6 +686,12 @@ {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug With Tests|Win32.ActiveCfg = Debug|x64 {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug With Tests|x64.ActiveCfg = Debug|x86 {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug With Tests|x86.ActiveCfg = Debug|x86 + {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug XP|Mixed Platforms.ActiveCfg = Debug|x64 + {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug XP|Mixed Platforms.Build.0 = Debug|x64 + {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug XP|Win32.ActiveCfg = Debug|x64 + {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug XP|x64.ActiveCfg = Debug|x64 + {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug XP|x64.Build.0 = Debug|x64 + {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug XP|x86.ActiveCfg = Debug|x64 {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug|Mixed Platforms.Build.0 = Debug|x64 {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}.Debug|Win32.ActiveCfg = Debug|x64 @@ -662,6 +737,13 @@ {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug With Tests|Win32.ActiveCfg = Debug XP|x64 {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug With Tests|x64.ActiveCfg = Debug|x64 {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug With Tests|x86.ActiveCfg = Debug|Win32 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|x64.Build.0 = Debug XP|x64 + {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B43EFCBE-06E0-46C4-9502-1D06B713EB57}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -711,6 +793,13 @@ {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug With Tests|x64.Build.0 = Debug|x64 {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug With Tests|x86.Build.0 = Debug|Win32 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|x64.Build.0 = Debug XP|x64 + {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug XP|x86.ActiveCfg = Debug XP|x64 {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug|Mixed Platforms.Build.0 = Debug|x64 {FAEDAF88-9894-4F02-B936-B30674DE9192}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -763,6 +852,13 @@ {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug With Tests|x64.Build.0 = Debug|x64 {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug With Tests|x86.Build.0 = Debug|Win32 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|x64.Build.0 = Debug XP|x64 + {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug XP|x86.ActiveCfg = Debug XP|x64 {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug|Mixed Platforms.Build.0 = Debug|x64 {469ACDA3-2237-414C-BABF-D30FFFF2FE6A}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -812,6 +908,13 @@ {A67946D1-E644-45E1-931B-DA46177F5263}.Debug With Tests|x64.Build.0 = Debug|x64 {A67946D1-E644-45E1-931B-DA46177F5263}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {A67946D1-E644-45E1-931B-DA46177F5263}.Debug With Tests|x86.Build.0 = Debug|Win32 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|x64.Build.0 = Debug XP|x64 + {A67946D1-E644-45E1-931B-DA46177F5263}.Debug XP|x86.ActiveCfg = Debug XP|x64 {A67946D1-E644-45E1-931B-DA46177F5263}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {A67946D1-E644-45E1-931B-DA46177F5263}.Debug|Mixed Platforms.Build.0 = Debug|x64 {A67946D1-E644-45E1-931B-DA46177F5263}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -858,6 +961,13 @@ {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug With Tests|x64.Build.0 = Debug|x64 {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug With Tests|x86.Build.0 = Debug|Win32 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|x64.Build.0 = Debug XP|x64 + {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B83ACC71-7C78-49E5-8F97-5C82ACF6D8E0}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -904,6 +1014,13 @@ {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug With Tests|x64.Build.0 = Debug|x64 {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug With Tests|x86.Build.0 = Debug|Win32 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|x64.Build.0 = Debug XP|x64 + {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B06BDA41-7632-45AB-8975-182A8F61B045}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -950,6 +1067,13 @@ {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug With Tests|x64.Build.0 = Debug|x64 {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug With Tests|x86.Build.0 = Debug|Win32 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|x64.Build.0 = Debug XP|x64 + {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug XP|x86.ActiveCfg = Debug XP|x64 {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug|Mixed Platforms.Build.0 = Debug|x64 {F9267167-D3DA-4E40-BB8D-5B55C4F73952}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -996,6 +1120,13 @@ {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug With Tests|x64.Build.0 = Debug|x64 {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug With Tests|x86.Build.0 = Debug|Win32 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|x64.Build.0 = Debug XP|x64 + {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug XP|x86.ActiveCfg = Debug XP|x64 {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug|Mixed Platforms.Build.0 = Debug|x64 {608EC6B0-6B59-408F-8ED9-EA8B07075E72}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1042,6 +1173,13 @@ {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug With Tests|x64.Build.0 = Debug|x64 {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug With Tests|x86.Build.0 = Debug|Win32 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|x64.Build.0 = Debug XP|x64 + {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug XP|x86.ActiveCfg = Debug XP|x64 {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug|Mixed Platforms.Build.0 = Debug|x64 {AB066751-73D5-4BA2-8BBF-D296EA8ED869}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1088,6 +1226,13 @@ {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug With Tests|x64.Build.0 = Debug|x64 {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug With Tests|x86.Build.0 = Debug|Win32 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|x64.Build.0 = Debug XP|x64 + {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug XP|x86.ActiveCfg = Debug XP|x64 {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug|Mixed Platforms.Build.0 = Debug|x64 {6F538CEA-BA83-49F1-BB21-B3872FDBF3F9}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1134,6 +1279,13 @@ {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug With Tests|x64.Build.0 = Debug|x64 {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug With Tests|x86.Build.0 = Debug|Win32 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|x64.Build.0 = Debug XP|x64 + {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug XP|x86.ActiveCfg = Debug XP|x64 {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug|Mixed Platforms.Build.0 = Debug|x64 {8747F1C0-7CA2-4094-AE57-1DD2BCA65ACE}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1180,6 +1332,13 @@ {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug With Tests|x64.Build.0 = Debug|x64 {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug With Tests|x86.Build.0 = Debug|Win32 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|x64.Build.0 = Debug XP|x64 + {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug XP|x86.ActiveCfg = Debug XP|x64 {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug|Mixed Platforms.Build.0 = Debug|x64 {F7D52517-457A-4418-ABA4-6C1199912E6C}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1226,6 +1385,13 @@ {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug With Tests|x64.Build.0 = Debug|x64 {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug With Tests|x86.Build.0 = Debug|Win32 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|x64.Build.0 = Debug XP|x64 + {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug XP|x86.ActiveCfg = Debug XP|x64 {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug|Mixed Platforms.Build.0 = Debug|x64 {95DEA3EF-B9BC-4F55-9582-421BA4486F43}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1272,6 +1438,13 @@ {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug With Tests|x64.Build.0 = Debug|x64 {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug With Tests|x86.Build.0 = Debug|Win32 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|x64.Build.0 = Debug XP|x64 + {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug XP|x86.ActiveCfg = Debug XP|x64 {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug|Mixed Platforms.Build.0 = Debug|x64 {D20E7E7A-B0B5-4EE7-BDFE-B92A02F298F1}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1318,6 +1491,13 @@ {09724CC1-FE19-42C8-9225-8CD933174743}.Debug With Tests|x64.Build.0 = Debug|x64 {09724CC1-FE19-42C8-9225-8CD933174743}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {09724CC1-FE19-42C8-9225-8CD933174743}.Debug With Tests|x86.Build.0 = Debug|Win32 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|x64.Build.0 = Debug XP|x64 + {09724CC1-FE19-42C8-9225-8CD933174743}.Debug XP|x86.ActiveCfg = Debug XP|x64 {09724CC1-FE19-42C8-9225-8CD933174743}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {09724CC1-FE19-42C8-9225-8CD933174743}.Debug|Mixed Platforms.Build.0 = Debug|x64 {09724CC1-FE19-42C8-9225-8CD933174743}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1364,6 +1544,13 @@ {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug With Tests|x64.Build.0 = Debug|x64 {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug With Tests|x86.Build.0 = Debug|Win32 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|x64.Build.0 = Debug XP|x64 + {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug XP|x86.ActiveCfg = Debug XP|x64 {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug|Mixed Platforms.Build.0 = Debug|x64 {938668AF-D819-4F2E-AACE-C2976E2D0D52}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1410,6 +1597,13 @@ {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug With Tests|x64.Build.0 = Debug|x64 {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug With Tests|x86.Build.0 = Debug|Win32 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|x64.Build.0 = Debug XP|x64 + {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug XP|x86.ActiveCfg = Debug XP|x64 {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug|Mixed Platforms.Build.0 = Debug|x64 {C71F0B00-B320-4A1B-A460-2AAE9079F65E}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1456,6 +1650,13 @@ {9EF7C900-8657-4289-AE62-327670180979}.Debug With Tests|x64.Build.0 = Debug|x64 {9EF7C900-8657-4289-AE62-327670180979}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {9EF7C900-8657-4289-AE62-327670180979}.Debug With Tests|x86.Build.0 = Debug|Win32 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|x64.Build.0 = Debug XP|x64 + {9EF7C900-8657-4289-AE62-327670180979}.Debug XP|x86.ActiveCfg = Debug XP|x64 {9EF7C900-8657-4289-AE62-327670180979}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {9EF7C900-8657-4289-AE62-327670180979}.Debug|Mixed Platforms.Build.0 = Debug|x64 {9EF7C900-8657-4289-AE62-327670180979}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1501,6 +1702,13 @@ {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug With Tests|x64.ActiveCfg = Debug|Win32 {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug With Tests|x86.Build.0 = Debug|Win32 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|x64.Build.0 = Debug XP|x64 + {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug XP|x86.ActiveCfg = Debug XP|x64 {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug|Mixed Platforms.Build.0 = Debug|x64 {1142985B-2BEA-4D7C-B2C9-671564EF542D}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1546,6 +1754,13 @@ {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug With Tests|x64.ActiveCfg = Debug|Win32 {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug With Tests|x86.Build.0 = Debug|Win32 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|x64.Build.0 = Debug XP|x64 + {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug XP|x86.ActiveCfg = Debug XP|x64 {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug|Mixed Platforms.Build.0 = Debug|x64 {388AC2F5-9AC6-4542-8FF0-AD36D4D3298B}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1592,6 +1807,13 @@ {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug With Tests|x64.Build.0 = Debug|x64 {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug With Tests|x86.Build.0 = Debug|Win32 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|x64.Build.0 = Debug XP|x64 + {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug XP|x86.ActiveCfg = Debug XP|x64 {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug|Mixed Platforms.Build.0 = Debug|x64 {3625F7B8-4219-4FAC-87B9-D94A6E608BB5}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1638,6 +1860,13 @@ {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug With Tests|x64.Build.0 = Debug|x64 {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug With Tests|x86.Build.0 = Debug|Win32 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|x64.Build.0 = Debug XP|x64 + {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug XP|x86.ActiveCfg = Debug XP|x64 {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug|Mixed Platforms.Build.0 = Debug|x64 {0E1EC1FB-8EB2-4A7C-9150-6CD4E0086CA6}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1684,6 +1913,13 @@ {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug With Tests|x64.Build.0 = Debug|x64 {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug With Tests|x86.Build.0 = Debug|Win32 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|x64.Build.0 = Debug XP|x64 + {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B161762C-4292-4CCC-AE13-74E2DA529CB0}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1730,6 +1966,13 @@ {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug With Tests|x64.Build.0 = Debug|x64 {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug With Tests|x86.Build.0 = Debug|Win32 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|x64.Build.0 = Debug XP|x64 + {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug XP|x86.ActiveCfg = Debug XP|x64 {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug|Mixed Platforms.Build.0 = Debug|x64 {96FAF72D-4E8E-4436-BDD5-2A028A405D77}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1776,6 +2019,13 @@ {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug With Tests|x64.Build.0 = Debug|x64 {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug With Tests|x86.Build.0 = Debug|Win32 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|x64.Build.0 = Debug XP|x64 + {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug XP|x86.ActiveCfg = Debug XP|x64 {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug|Mixed Platforms.Build.0 = Debug|x64 {4971886F-F50F-4BB2-B183-9BCB58D3619B}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1822,6 +2072,13 @@ {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug With Tests|x64.Build.0 = Debug|x64 {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug With Tests|x86.Build.0 = Debug|Win32 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|x64.Build.0 = Debug XP|x64 + {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug XP|x86.ActiveCfg = Debug XP|x64 {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug|Mixed Platforms.Build.0 = Debug|x64 {87641473-31E7-4D78-9AC8-A44E694BE1B2}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1868,6 +2125,13 @@ {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug With Tests|x64.Build.0 = Debug|x64 {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug With Tests|x86.Build.0 = Debug|Win32 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|x64.Build.0 = Debug XP|x64 + {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B2F98A06-F5C1-4C4F-8032-5FD7C1F611A6}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1914,6 +2178,13 @@ {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug With Tests|x64.Build.0 = Debug|x64 {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug With Tests|x86.Build.0 = Debug|Win32 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|x64.Build.0 = Debug XP|x64 + {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug XP|x86.ActiveCfg = Debug XP|x64 {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug|Mixed Platforms.Build.0 = Debug|x64 {4B5E5BCB-4E9F-42DF-AB5D-65AC8E6D7BBE}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1960,6 +2231,13 @@ {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug With Tests|x64.Build.0 = Debug|x64 {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug With Tests|x86.Build.0 = Debug|Win32 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|x64.Build.0 = Debug XP|x64 + {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug XP|x86.ActiveCfg = Debug XP|x64 {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug|Mixed Platforms.Build.0 = Debug|x64 {9D5C14D9-1850-4738-AC82-1E9F79768CD0}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2006,6 +2284,13 @@ {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug With Tests|x64.Build.0 = Debug|x64 {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug With Tests|x86.Build.0 = Debug|Win32 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|x64.Build.0 = Debug XP|x64 + {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug XP|x86.ActiveCfg = Debug XP|x64 {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug|Mixed Platforms.Build.0 = Debug|x64 {928F2A00-FA85-4F32-88ED-6E0414551578}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2052,6 +2337,13 @@ {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug With Tests|x64.Build.0 = Debug|x64 {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug With Tests|x86.Build.0 = Debug|Win32 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|x64.Build.0 = Debug XP|x64 + {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug XP|x86.ActiveCfg = Debug XP|x64 {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug|Mixed Platforms.Build.0 = Debug|x64 {B5B0C81C-F714-45CF-9A2E-F1283DAFCD82}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2099,6 +2391,12 @@ {126E5DB1-1E81-42C8-9384-715603036B36}.Debug With Tests|Win32.Build.0 = Debug XP|Win32 {126E5DB1-1E81-42C8-9384-715603036B36}.Debug With Tests|x64.ActiveCfg = Debug|Win32 {126E5DB1-1E81-42C8-9384-715603036B36}.Debug With Tests|x86.ActiveCfg = Debug|Win32 + {126E5DB1-1E81-42C8-9384-715603036B36}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|Win32 + {126E5DB1-1E81-42C8-9384-715603036B36}.Debug XP|Mixed Platforms.Build.0 = Debug XP|Win32 + {126E5DB1-1E81-42C8-9384-715603036B36}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {126E5DB1-1E81-42C8-9384-715603036B36}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {126E5DB1-1E81-42C8-9384-715603036B36}.Debug XP|x64.ActiveCfg = Debug XP|Win32 + {126E5DB1-1E81-42C8-9384-715603036B36}.Debug XP|x86.ActiveCfg = Debug XP|Win32 {126E5DB1-1E81-42C8-9384-715603036B36}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {126E5DB1-1E81-42C8-9384-715603036B36}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {126E5DB1-1E81-42C8-9384-715603036B36}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2147,6 +2445,13 @@ {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug With Tests|x64.Build.0 = Debug|x64 {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug With Tests|x86.ActiveCfg = Debug|Win32 {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug With Tests|x86.Build.0 = Debug|Win32 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|x64.Build.0 = Debug XP|x64 + {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug XP|x86.ActiveCfg = Debug XP|x64 {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug|Mixed Platforms.Build.0 = Debug|x64 {995B6A5A-9A87-4CD1-A785-FE62E63251EE}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2192,6 +2497,13 @@ {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug With Tests|Win32.ActiveCfg = Debug XP|x64 {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug With Tests|x64.ActiveCfg = Debug|Win32 {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug With Tests|x86.ActiveCfg = Debug|Win32 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|x64.Build.0 = Debug XP|x64 + {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug XP|x86.ActiveCfg = Debug XP|x64 {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug|Mixed Platforms.Build.0 = Debug|x64 {2F13350C-C902-47B8-8584-8FA2F6C05917}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2237,6 +2549,12 @@ {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug With Tests|x64.ActiveCfg = Debug|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug With Tests|x64.Build.0 = Debug|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug With Tests|x86.ActiveCfg = Debug|x64 + {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug XP|Mixed Platforms.ActiveCfg = Debug|x64 + {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug XP|Mixed Platforms.Build.0 = Debug|x64 + {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug XP|Win32.ActiveCfg = Debug|x64 + {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug XP|x64.ActiveCfg = Debug|x64 + {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug XP|x64.Build.0 = Debug|x64 + {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug XP|x86.ActiveCfg = Debug|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug|Mixed Platforms.Build.0 = Debug|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2269,6 +2587,63 @@ {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.ZLIB With Tests|x64.ActiveCfg = Release|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.ZLIB With Tests|x64.Build.0 = Release|x64 {DCEF045D-507C-4137-B11A-C76C4B94DFBA}.ZLIB With Tests|x86.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.bbstored|Mixed Platforms.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.bbstored|Mixed Platforms.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.bbstored|Win32.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.bbstored|x64.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.bbstored|x64.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.bbstored|x86.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Setup|Mixed Platforms.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Setup|Mixed Platforms.Build.0 = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Setup|Win32.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Setup|x64.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Setup|x64.Build.0 = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Setup|x86.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Tests|Mixed Platforms.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Tests|Mixed Platforms.Build.0 = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Tests|Win32.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Tests|x64.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Tests|x64.Build.0 = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug With Tests|x86.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|Mixed Platforms.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|Mixed Platforms.Build.0 = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|Win32.ActiveCfg = Debug XP|Win32 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|Win32.Build.0 = Debug XP|Win32 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|x64.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|x64.Build.0 = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug XP|x86.ActiveCfg = Debug XP|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|Mixed Platforms.Build.0 = Debug|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|Win32.ActiveCfg = Debug|Win32 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|Win32.Build.0 = Debug|Win32 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|x64.ActiveCfg = Debug|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|x64.Build.0 = Debug|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Debug|x86.ActiveCfg = Debug|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.OpenSSL With Tests|Mixed Platforms.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.OpenSSL With Tests|Mixed Platforms.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.OpenSSL With Tests|Win32.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.OpenSSL With Tests|x64.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.OpenSSL With Tests|x64.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.OpenSSL With Tests|x86.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.PCRE With Tests|Mixed Platforms.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.PCRE With Tests|Mixed Platforms.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.PCRE With Tests|Win32.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.PCRE With Tests|x64.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.PCRE With Tests|x64.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.PCRE With Tests|x86.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|Mixed Platforms.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|Win32.ActiveCfg = Release|Win32 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|Win32.Build.0 = Release|Win32 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|x64.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|x64.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.Release|x86.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.ZLIB With Tests|Mixed Platforms.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.ZLIB With Tests|Mixed Platforms.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.ZLIB With Tests|Win32.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.ZLIB With Tests|x64.ActiveCfg = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.ZLIB With Tests|x64.Build.0 = Release|x64 + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}.ZLIB With Tests|x86.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2286,6 +2661,7 @@ {682F676C-50F5-45AF-85FA-C23E344583FC} = {F3974AEE-1DC5-42B5-B7B7-BF46F6385764} {2F13350C-C902-47B8-8584-8FA2F6C05917} = {F3974AEE-1DC5-42B5-B7B7-BF46F6385764} {DCEF045D-507C-4137-B11A-C76C4B94DFBA} = {F3974AEE-1DC5-42B5-B7B7-BF46F6385764} + {D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3} = {F3974AEE-1DC5-42B5-B7B7-BF46F6385764} {A5D16DCE-9EDA-4DA8-B388-7DC203B6B074} = {22FBB8B1-65F7-4D07-ACBA-192D5E23FD89} {B43EFCBE-06E0-46C4-9502-1D06B713EB57} = {22FBB8B1-65F7-4D07-ACBA-192D5E23FD89} {67F86D22-DC30-49D0-B8CB-154C69DC4497} = {B2DA59E8-34B9-430C-8244-E19CD6381689} Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj 2012-01-19 18:26:04 UTC (rev 3054) @@ -0,0 +1,290 @@ +? + + + + Debug XP + Win32 + + + Debug XP + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B43EFCBE-06E0-46C4-9502-1D06B713EB57} + custom + Win32Proj + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\install\$(ProjectName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\install\$(ProjectName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\install\$(ProjectName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\install\$(ProjectName)\ + true + true + true + true + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\install\$(ProjectName)\ + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\install\$(ProjectName)\ + false + false + + + + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(WIX)sdk\inc;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + 4995 + + + crypt32.lib;msi.lib;dutil_2010.lib;wcautil_2010.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\lib;%(AdditionalLibraryDirectories) + Custom.def + true + Windows + MachineX86 + RequireAdministrator + 1.0.0.0 + + + $(SolutionDir)..\..\..\lib\common + + + + + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(WIX)sdk\inc;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + 4995 + + + crypt32.lib;msi.lib;dutil_2010.lib;wcautil_2010.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\lib;%(AdditionalLibraryDirectories) + Custom.def + true + Windows + MachineX86 + RequireAdministrator + 1.0.0.0 + + + $(SolutionDir)..\..\..\lib\common + + + + + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(WIX)sdk\inc;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Use + Level3 + ProgramDatabase + 4995 + + + crypt32.lib;msi.lib;dutil_2010_x64.lib;wcautil_2010_x64.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\lib;%(AdditionalLibraryDirectories) + Custom.def + true + Windows + RequireAdministrator + 1.0.0.0 + + + $(SolutionDir)..\..\..\lib\common + + + + + Disabled + $(SolutionDir)..\..\..\lib\backupclient;$(WIX)sdk\inc;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Use + Level3 + ProgramDatabase + 4995 + + + crypt32.lib;msi.lib;dutil_2010_x64.lib;wcautil_2010_x64.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\lib;%(AdditionalLibraryDirectories) + Custom.def + true + Windows + RequireAdministrator + 1.0.0.0 + + + $(SolutionDir)..\..\..\lib\common + + + + + MaxSpeed + true + $(SolutionDir)..\..\..\lib\backupclient;$(WIX)sdk\inc;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + true + Use + Level3 + ProgramDatabase + 4995 + + + crypt32.lib;msi.lib;dutil_2010.lib;wcautil_2010.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\lib;%(AdditionalLibraryDirectories) + Custom.def + true + Windows + true + true + MachineX86 + RequireAdministrator + + + $(SolutionDir)..\..\..\lib\common + + + + + MaxSpeed + true + $(SolutionDir)..\..\..\lib\backupclient;$(WIX)sdk\inc;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + true + Use + Level3 + ProgramDatabase + 4995 + + + crypt32.lib;msi.lib;dutil_2010_x64.lib;wcautil_2010_x64.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\lib;%(AdditionalLibraryDirectories) + Custom.def + true + Windows + true + true + RequireAdministrator + + + $(SolutionDir)..\..\..\lib\common + + + + + + + Create + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj.filters =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj.filters (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.vcxproj.filters 2012-01-19 18:26:04 UTC (rev 3054) @@ -0,0 +1,52 @@ +? + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Source Files + + + \ No newline at end of file From subversion at boxbackup.org Thu Jan 19 18:27:44 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:27:44 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3055 - in box/invisnet/vs2010/0.11: bin/bbackupd bin/bbackupquery lib/backupclient lib/common lib/server lib/win32 lib/win32/_sys Message-ID: <20120119182744.A7CD21A345F@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:27:44 +0000 (Thu, 19 Jan 2012) New Revision: 3055 Added: box/invisnet/vs2010/0.11/lib/win32/Win32BaseException.txt box/invisnet/vs2010/0.11/lib/win32/_sys/ box/invisnet/vs2010/0.11/lib/win32/_sys/_iovec.h box/invisnet/vs2010/0.11/lib/win32/_sys/mount.cpp box/invisnet/vs2010/0.11/lib/win32/_sys/mount.h box/invisnet/vs2010/0.11/lib/win32/_sys/resource.cpp box/invisnet/vs2010/0.11/lib/win32/_sys/resource.h box/invisnet/vs2010/0.11/lib/win32/_sys/stat.cpp box/invisnet/vs2010/0.11/lib/win32/_sys/stat.h box/invisnet/vs2010/0.11/lib/win32/_sys/time.cpp box/invisnet/vs2010/0.11/lib/win32/_sys/time.h box/invisnet/vs2010/0.11/lib/win32/_sys/uio.cpp box/invisnet/vs2010/0.11/lib/win32/_sys/uio.h box/invisnet/vs2010/0.11/lib/win32/dirent.cpp box/invisnet/vs2010/0.11/lib/win32/dirent.h box/invisnet/vs2010/0.11/lib/win32/poll.cpp box/invisnet/vs2010/0.11/lib/win32/poll.h box/invisnet/vs2010/0.11/lib/win32/pwd.cpp box/invisnet/vs2010/0.11/lib/win32/pwd.h box/invisnet/vs2010/0.11/lib/win32/unistd.cpp box/invisnet/vs2010/0.11/lib/win32/unistd.h box/invisnet/vs2010/0.11/lib/win32/win32.cpp box/invisnet/vs2010/0.11/lib/win32/win32.h Removed: box/invisnet/vs2010/0.11/lib/win32/pch.cpp Modified: box/invisnet/vs2010/0.11/bin/bbackupd/BackupClientDirectoryRecord.cpp box/invisnet/vs2010/0.11/bin/bbackupd/Win32ServiceFunctions.cpp box/invisnet/vs2010/0.11/bin/bbackupd/bbackupd.cpp box/invisnet/vs2010/0.11/bin/bbackupquery/bbackupquery.cpp box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.cpp box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.cpp box/invisnet/vs2010/0.11/lib/common/Box.h box/invisnet/vs2010/0.11/lib/common/BoxConfig-MSVC.h box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h box/invisnet/vs2010/0.11/lib/common/FileStream.cpp box/invisnet/vs2010/0.11/lib/common/Logging.cpp box/invisnet/vs2010/0.11/lib/common/Logging.h box/invisnet/vs2010/0.11/lib/common/Timer.cpp box/invisnet/vs2010/0.11/lib/common/WaitForEvent.cpp box/invisnet/vs2010/0.11/lib/server/Daemon.cpp box/invisnet/vs2010/0.11/lib/server/LocalProcessStream.cpp box/invisnet/vs2010/0.11/lib/server/SocketStream.cpp box/invisnet/vs2010/0.11/lib/server/SocketStreamTLS.cpp box/invisnet/vs2010/0.11/lib/server/WinNamedPipeStream.cpp box/invisnet/vs2010/0.11/lib/win32/emu.cpp box/invisnet/vs2010/0.11/lib/win32/emu.h box/invisnet/vs2010/0.11/lib/win32/getopt.h Log: Big batch of EMU changes for new Win32 lib Modified: box/invisnet/vs2010/0.11/bin/bbackupd/BackupClientDirectoryRecord.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbackupd/BackupClientDirectoryRecord.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/bin/bbackupd/BackupClientDirectoryRecord.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -290,7 +290,9 @@ // which would normally contain DT_REG, // DT_DIR, etc, but we only use it here and // prefer S_IFREG, S_IFDIR... - int type = en->d_type; + int type = 0; + type = (DT_DIR == en->d_type) ? S_IFDIR : type; + type = (DT_REG == en->d_type) ? S_IFREG : type; #else if(EMU_LSTAT(filename.c_str(), &file_st) != 0) { Modified: box/invisnet/vs2010/0.11/bin/bbackupd/Win32ServiceFunctions.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbackupd/Win32ServiceFunctions.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/bin/bbackupd/Win32ServiceFunctions.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -21,6 +21,8 @@ #include #endif +using namespace Win32; + extern void TerminateService(void); extern unsigned int WINAPI RunService(LPVOID lpParameter); @@ -100,7 +102,7 @@ VOID ServiceMain(DWORD argc, LPTSTR *argv) { // initialise service status - gServiceStatus.dwServiceType = SERVICE_WIN32; + gServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; gServiceStatus.dwCurrentState = SERVICE_STOPPED; gServiceStatus.dwControlsAccepted = 0; gServiceStatus.dwWin32ExitCode = NO_ERROR; @@ -190,9 +192,9 @@ if (!success) { - ErrorHandler("Failed to start service. Did you start " - "Box Backup from the Service Control Manager? " - "(StartServiceCtrlDispatcher)", GetLastError()); +// ErrorHandler("Failed to start service. Did you start " +// "Box Backup from the Service Control Manager? " +// "(StartServiceCtrlDispatcher)", GetLastError()); return 1; } Modified: box/invisnet/vs2010/0.11/bin/bbackupd/bbackupd.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbackupd/bbackupd.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/bin/bbackupd/bbackupd.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -35,7 +35,7 @@ #ifdef WIN32 - EnableBackupRights(); + Win32::EnableBackupRights(); gpDaemonService = new Win32BackupService(); ExitCode = gpDaemonService->Daemon::Main( Modified: box/invisnet/vs2010/0.11/bin/bbackupquery/bbackupquery.cpp =================================================================== --- box/invisnet/vs2010/0.11/bin/bbackupquery/bbackupquery.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/bin/bbackupquery/bbackupquery.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -58,6 +58,10 @@ #include "MemLeakFindOn.h" +#ifdef WIN32 +using namespace Win32; +#endif + void PrintUsageAndExit() { printf("Usage: bbackupquery [-q*|v*|V|W] [-w] " @@ -292,6 +296,17 @@ BOX_FATAL("Invalid configuration file: " << errs); return 1; } +#ifdef WIN32 + char path[MAX_PATH]; + + if(FAILED(SHGetFolderPath(NULL,CSIDL_COMMON_APPDATA,NULL,0,path)) || !PathAppend(path,"Box Backup")) + { + BOX_FATAL("Can't build DataDirectory"); + return 1; + } + + config->AddKeyValue("DataDirectory",path); +#endif // Easier coding const Configuration &conf(*config); @@ -300,13 +315,21 @@ SSLLib::Initialise(); // Read in the certificates creating a TLS context TLSContext tlsContext; +#ifdef WIN32 + std::string certFile(conf.GetKeyValue("AccountNumber")); + std::string keyFile; + std::string caFile; + std::string keysFile; +#else std::string certFile(conf.GetKeyValue("CertificateFile")); std::string keyFile(conf.GetKeyValue("PrivateKeyFile")); std::string caFile(conf.GetKeyValue("TrustedCAsFile")); + std::string keysFile(conf.GetKeyValue("KeysFile")); +#endif tlsContext.Initialise(false /* as client */, certFile.c_str(), keyFile.c_str(), caFile.c_str()); // Initialise keys - BackupClientCryptoKeys_Setup(conf.GetKeyValue("KeysFile").c_str()); + BackupClientCryptoKeys_Setup(keysFile.c_str()); // 2. Connect to server if(!quiet) BOX_INFO("Connecting to store..."); Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -843,7 +843,7 @@ #endif // Try to apply - if(::utimes(Filename, times) != 0) + if(EMU_UTIMES(Filename, times) != 0) { BOX_LOG_SYS_ERROR("Failed to change times of " "file '" << Filename << "'"); Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -385,7 +385,7 @@ if((exists == ObjectExists_NoObject || exists == ObjectExists_File) && - ::mkdir(rLocalDirectoryName.c_str(), S_IRWXU) != 0) + EMU_MKDIR(rLocalDirectoryName.c_str(), S_IRWXU) != 0) { BOX_LOG_SYS_ERROR("Failed to create directory '" << rLocalDirectoryName << "'"); Modified: box/invisnet/vs2010/0.11/lib/common/Box.h =================================================================== --- box/invisnet/vs2010/0.11/lib/common/Box.h 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/Box.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -181,5 +181,7 @@ inline int16_t ntoh(int16_t in) { return ntohs(in); } inline int8_t ntoh(int8_t in) { return in; } +using namespace BoxBackup; + #endif // BOX__H Modified: box/invisnet/vs2010/0.11/lib/common/BoxConfig-MSVC.h =================================================================== --- box/invisnet/vs2010/0.11/lib/common/BoxConfig-MSVC.h 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/BoxConfig-MSVC.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -203,7 +203,7 @@ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ -// #define HAVE_STDINT_H 1 +#define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 Modified: box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h =================================================================== --- box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -120,23 +120,6 @@ #endif #endif -#if defined WIN32 && !defined __MINGW32__ - typedef __int8 int8_t; - typedef __int16 int16_t; - typedef __int32 int32_t; - typedef __int64 int64_t; - - typedef unsigned __int8 u_int8_t; - typedef unsigned __int16 u_int16_t; - typedef unsigned __int32 u_int32_t; - typedef unsigned __int64 u_int64_t; - - #define HAVE_U_INT8_T - #define HAVE_U_INT16_T - #define HAVE_U_INT32_T - #define HAVE_U_INT64_T -#endif // WIN32 && !__MINGW32__ - // Define missing types #ifndef HAVE_UINT8_T typedef u_int8_t uint8_t; @@ -180,10 +163,6 @@ typedef ino_t InodeRefType; #endif -#ifdef WIN32 - #define WIN32_LEAN_AND_MEAN -#endif - #include "emu.h" #ifdef WIN32 Modified: box/invisnet/vs2010/0.11/lib/common/FileStream.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/common/FileStream.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/FileStream.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -67,10 +67,7 @@ { MEMLEAKFINDER_NOT_A_LEAK(this); - #ifdef WIN32 - BOX_LOG_WIN_WARNING_NUMBER("Failed to open file: " << - mFileName, winerrno); - #else + #ifndef WIN32 BOX_LOG_SYS_WARNING("Failed to open file: " << mFileName); #endif Modified: box/invisnet/vs2010/0.11/lib/common/Logging.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/common/Logging.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/Logging.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -16,6 +16,9 @@ // c.f. http://bugs.debian.org/512510 #include +#ifdef HAVE_PROCESS_H + #include +#endif #ifdef HAVE_SYSLOG_H #include #endif Modified: box/invisnet/vs2010/0.11/lib/common/Logging.h =================================================================== --- box/invisnet/vs2010/0.11/lib/common/Logging.h 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/Logging.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -59,7 +59,7 @@ inline std::string GetNativeErrorMessage() { #ifdef WIN32 - return GetErrorMessage(GetLastError()); + return BoxBackup::Win32::GetErrorMessage(GetLastError()); #else std::ostringstream _box_log_line; _box_log_line << std::strerror(errno) << " (" << errno << ")"; @@ -69,13 +69,13 @@ #ifdef WIN32 #define BOX_LOG_WIN_ERROR(stuff) \ - BOX_ERROR(stuff << ": " << GetErrorMessage(GetLastError())) + BOX_ERROR(stuff << ": " << Win32::GetErrorMessage(GetLastError())) #define BOX_LOG_WIN_WARNING(stuff) \ - BOX_WARNING(stuff << ": " << GetErrorMessage(GetLastError())) + BOX_WARNING(stuff << ": " << Win32::GetErrorMessage(GetLastError())) #define BOX_LOG_WIN_ERROR_NUMBER(stuff, number) \ - BOX_ERROR(stuff << ": " << GetErrorMessage(number)) + BOX_ERROR(stuff << ": " << Win32::GetErrorMessage(number)) #define BOX_LOG_WIN_WARNING_NUMBER(stuff, number) \ - BOX_WARNING(stuff << ": " << GetErrorMessage(number)) + BOX_WARNING(stuff << ": " << Win32::GetErrorMessage(number)) #define BOX_LOG_NATIVE_ERROR(stuff) BOX_LOG_WIN_ERROR(stuff) #define BOX_LOG_NATIVE_WARNING(stuff) BOX_LOG_WIN_WARNING(stuff) #else Modified: box/invisnet/vs2010/0.11/lib/common/Timer.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/common/Timer.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/Timer.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -428,8 +428,7 @@ (PVOID)this, delayInMillis, 0, WT_EXECUTEINTIMERTHREAD) == FALSE) { - BOX_ERROR(TIMER_ID "failed to create timer: " << - GetErrorMessage(GetLastError())); + BOX_LOG_WIN_ERROR(TIMER_ID "failed to create timer"); mTimerHandle = INVALID_HANDLE_VALUE; } #endif @@ -454,8 +453,7 @@ if (DeleteTimerQueueTimer(NULL, mTimerHandle, INVALID_HANDLE_VALUE) == FALSE) { - BOX_ERROR(TIMER_ID "failed to delete timer: " << - GetErrorMessage(GetLastError())); + BOX_LOG_WIN_ERROR(TIMER_ID "failed to delete timer"); } mTimerHandle = INVALID_HANDLE_VALUE; } Modified: box/invisnet/vs2010/0.11/lib/common/WaitForEvent.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/common/WaitForEvent.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/common/WaitForEvent.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -163,7 +163,7 @@ } // Poll! - switch(::poll(mpPollInfo, mItems.size(), mTimeout)) + switch(EMU_POLL(mpPollInfo, mItems.size(), mTimeout)) { case -1: // Interrupted system calls aren't an error, just equivalent to a timeout Modified: box/invisnet/vs2010/0.11/lib/server/Daemon.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/server/Daemon.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/server/Daemon.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -9,6 +9,9 @@ #include "Box.h" +#ifdef HAVE_PROCESS_H + #include +#endif #ifdef HAVE_UNISTD_H #include #endif Modified: box/invisnet/vs2010/0.11/lib/server/LocalProcessStream.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/server/LocalProcessStream.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/server/LocalProcessStream.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -121,8 +121,7 @@ HANDLE writeInChild, readFromChild; if(!CreatePipe(&readFromChild, &writeInChild, &secAttr, 0)) { - BOX_ERROR("Failed to CreatePipe for child process: " << - GetErrorMessage(GetLastError())); + BOX_LOG_WIN_ERROR("Failed to CreatePipe for child process"); THROW_EXCEPTION(ServerException, SocketPairFailed) } SetHandleInformation(readFromChild, HANDLE_FLAG_INHERIT, 0); @@ -156,8 +155,7 @@ if(!result) { - BOX_ERROR("Failed to CreateProcess: '" << rCommandLine << - "': " << GetErrorMessage(GetLastError())); + BOX_LOG_WIN_ERROR("Failed to CreateProcess: '" << rCommandLine); CloseHandle(writeInChild); CloseHandle(readFromChild); THROW_EXCEPTION(ServerException, ServerForkError) Modified: box/invisnet/vs2010/0.11/lib/server/SocketStream.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/server/SocketStream.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/server/SocketStream.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -213,7 +213,7 @@ p.fd = mSocketHandle; p.events = POLLIN; p.revents = 0; - switch(::poll(&p, 1, (Timeout == IOStream::TimeOutInfinite)?INFTIM:Timeout)) + switch(EMU_POLL(&p, 1, (Timeout == IOStream::TimeOutInfinite)?INFTIM:Timeout)) { case -1: // error @@ -332,7 +332,7 @@ p.events = POLLOUT; p.revents = 0; - if(::poll(&p, 1, 16000 /* 16 seconds */) == -1) + if(EMU_POLL(&p, 1, 16000 /* 16 seconds */) == -1) { // Don't exception if it's just a signal if(errno != EINTR) Modified: box/invisnet/vs2010/0.11/lib/server/SocketStreamTLS.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/server/SocketStreamTLS.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/server/SocketStreamTLS.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -261,7 +261,7 @@ { poll_timeout = INFTIM; } - result = ::poll(&p, 1, poll_timeout); + result = EMU_POLL(&p, 1, poll_timeout); } while(result == -1 && errno == EINTR); Modified: box/invisnet/vs2010/0.11/lib/server/WinNamedPipeStream.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/server/WinNamedPipeStream.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/server/WinNamedPipeStream.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -26,6 +26,8 @@ #include "MemLeakFindOn.h" +using namespace Win32; + std::string WinNamedPipeStream::sPipeNamePrefix = "\\\\.\\pipe\\"; // -------------------------------------------------------------------------- Added: box/invisnet/vs2010/0.11/lib/win32/Win32BaseException.txt =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/Win32BaseException.txt (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/Win32BaseException.txt 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,34 @@ +EXCEPTION Win32Base 42 + +Internal 0 +API_CertAddEncodedCertificateToStore 1 +API_CertOpenStore 2 +API_CertSetCertificateContextProperty 3 +API_CreateDirectory 4 +API_CreateFile 5 +API_CryptAcquireContext 6 +API_CryptDecodeObject 7 +API_CryptEncodeObject 8 +API_CryptExportKey 9 +API_CryptImportKey 10 +API_CryptImportPublicKeyInfo 11 +API_CryptStringToBinary 12 +API_DeleteFile 13 +API_FileTimeToSystemTime 14 +API_FindFirstFile 15 +API_FindNextFile 16 +API_GetCurrentDirectory 17 +API_GetFileAttributes 18 +API_GetFileInformationByHandle 19 +API_GetStdHandle 20 +API_MoveFile 21 +API_MultiByteToWideChar 22 +API_ReadConsole 23 +API_RegOpenKeyEx 24 +API_RegSetValueEx 25 +API_SetCurrentDirectory 26 +API_SetFileAttributes 27 +API_SetFilePointer 28 +API_SetFileTime 29 +API_SystemTimeToFileTime 30 +API_WideCharToMultiByte 31 Added: box/invisnet/vs2010/0.11/lib/win32/_sys/_iovec.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/_iovec.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/_iovec.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,13 @@ +#ifndef EMU_SYS_IOVEC_H +# define EMU_SYS_IOVEC_H + +# ifdef WIN32 +# pragma once + + struct iovec { + void *iov_base; /* Starting address */ + size_t iov_len; /* Number of bytes */ + }; +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/_sys/mount.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/mount.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/mount.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,39 @@ +#include "Box.h" + + +using namespace Win32; + + +// -------------------------------------------------------------------------- +// +// Function +// Name: statfs +// Purpose: returns the mount point of where a file is located - +// in this case the volume serial number +// Created: 25th October 2004 +// +// -------------------------------------------------------------------------- +int statfs(const char * pName, struct statfs * s) throw() +{ + HANDLE hFile; + + try + { + hFile = OpenFileByNameUtf8(pName, FILE_READ_ATTRIBUTES | FILE_READ_EA); + + BY_HANDLE_FILE_INFORMATION fi; + if (!GetFileInformationByHandle(hFile, &fi)) + throw Win32Exception(Win32Exception::API_GetFileInformationByHandle, pName); + + // convert volume serial number to a string + _ui64toa(fi.dwVolumeSerialNumber, s->f_mntonname + 1, 16); + + // pseudo unix mount point + s->f_mntonname[0] = '\\'; + + CloseHandle(hFile); // close the handle + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} Added: box/invisnet/vs2010/0.11/lib/win32/_sys/mount.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/mount.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/mount.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,10 @@ +#ifndef EMU_SYS_MOUNT_H +# define EMU_SYS_MOUNT_H + +# ifdef WIN32 +# pragma once + + extern int statfs(const char * name, struct statfs * s) throw(); +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/_sys/resource.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/resource.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/resource.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,7 @@ +#include "Box.h" + + +int waitpid(pid_t pid, int *status, int) throw() +{ + return 0; +} Added: box/invisnet/vs2010/0.11/lib/win32/_sys/resource.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/resource.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/resource.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,10 @@ +#ifndef EMU_SYS_RESOURCE_H +# define EMU_SYS_RESOURCE_H + +# ifdef WIN32 +# pragma once + + extern int waitpid(pid_t pid, int *status, int) throw(); +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/_sys/stat.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/stat.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/stat.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,188 @@ +#include "Box.h" + + +using namespace Win32; + + +static time_t ConvertFileTimeToTime_t(FILETIME *fileTime) throw(Win32Exception) +{ + SYSTEMTIME stUTC; + struct tm timeinfo; + + // Convert the last-write time to local time. + if (!FileTimeToSystemTime(fileTime, &stUTC)) + throw Win32Exception(Win32Exception::API_FileTimeToSystemTime); + + memset(&timeinfo, 0, sizeof(timeinfo)); + timeinfo.tm_sec = stUTC.wSecond; + timeinfo.tm_min = stUTC.wMinute; + timeinfo.tm_hour = stUTC.wHour; + timeinfo.tm_mday = stUTC.wDay; + timeinfo.tm_wday = stUTC.wDayOfWeek; + timeinfo.tm_mon = stUTC.wMonth - 1; + // timeinfo.tm_yday = ...; + timeinfo.tm_year = stUTC.wYear - 1900; + + time_t retVal = mktime(&timeinfo) - _timezone; + return retVal; +} + + +static void hstat(HANDLE hFile, struct emu_stat_* st, std::string fileName = "") throw(Win32Exception) +{ + BY_HANDLE_FILE_INFORMATION fi; + if (!GetFileInformationByHandle(hFile, &fi)) + throw Win32Exception(Win32Exception::API_GetFileInformationByHandle); + /* + if (INVALID_FILE_ATTRIBUTES == fi.dwFileAttributes) + { + ::syslog(LOG_WARNING, "Failed to get file attributes: " + "%s", GetErrorMessage(GetLastError()).c_str()); + errno = EACCES; + return -1; + } + */ + memset(st, 0, sizeof(*st)); + + // This is how we get our INODE (equivalent) information + ULARGE_INTEGER conv; + conv.HighPart = fi.nFileIndexHigh; + conv.LowPart = fi.nFileIndexLow; + st->st_ino = conv.QuadPart; + + // get the time information + st->st_ctime = ConvertFileTimeToTime_t(&fi.ftCreationTime); + st->st_atime = ConvertFileTimeToTime_t(&fi.ftLastAccessTime); + st->st_mtime = ConvertFileTimeToTime_t(&fi.ftLastWriteTime); + + if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + st->st_size = 0; + } + else + { + conv.HighPart = fi.nFileSizeHigh; + conv.LowPart = fi.nFileSizeLow; + st->st_size = conv.QuadPart; + } + + // at the mo + st->st_uid = 0; + st->st_gid = 0; + st->st_nlink = 1; + + // the mode of the file + // mode zero will make it impossible to restore on Unix + // (no access to anybody, including the owner). + // we'll fake a sensible mode: + // all objects get user read (0400) + // if it's a directory it gets user execute (0100) + // if it's not read-only it gets user write (0200) + st->st_mode = S_IREAD; + + if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + st->st_mode |= S_IFDIR | S_IEXEC; + } + else + { + st->st_mode |= S_IFREG; + } + + if (!(fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + { + st->st_mode |= S_IWRITE; + } + + // st_dev is normally zero, regardless of the drive letter, + // since backup locations can't normally span drives. However, + // a reparse point does allow all kinds of weird stuff to happen. + // We set st_dev to 1 for a reparse point, so that Box will detect + // a change of device number (from 0) and refuse to recurse down + // the reparse point (which could lead to havoc). + + if (fi.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) + { + st->st_dev = 1; + } + else + { + st->st_dev = 0; + } +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: emu_stat +// Purpose: replacement for the lstat and stat functions. +// Works with unicode filenames supplied in utf8. +// Returns a struct emu_stat to have room for 64-bit +// file identifier in st_ino (mingw allows only 16!) +// Created: 25th October 2004 +// +// -------------------------------------------------------------------------- +int emu_stat(const char * pName, struct emu_stat_ * st) throw() +{ + HANDLE hFile = INVALID_HANDLE_VALUE; + + try + { + hFile = OpenFileByNameUtf8(pName, FILE_READ_ATTRIBUTES | FILE_READ_EA); + hstat(hFile, st, pName); + CloseHandle(hFile); + + return 0; + } + EMU_EXCEPTION_HANDLING + + if (INVALID_HANDLE_VALUE != hFile) + CloseHandle(hFile); + + return -1; +} + +// -------------------------------------------------------------------------- +// +// Function +// Name: emu_fstat +// Purpose: replacement for fstat. Supply a windows handle. +// Returns a struct emu_stat to have room for 64-bit +// file identifier in st_ino (mingw allows only 16!) +// Created: 25th October 2004 +// +// -------------------------------------------------------------------------- +int emu_fstat(HANDLE hdir, struct emu_stat_ * st) +{ + if (hdir == INVALID_HANDLE_VALUE) + { + ::syslog(LOG_ERR, "Error: invalid file handle in emu_fstat()"); + errno = EBADF; + return -1; + } + + try + { + hstat(hdir,st); + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} + + +int emu_mkdir(const char* pPathName, mode_t mode) +{ + try + { + std::string multiPath = ConvertPathToAbsoluteUnicode(pPathName); + std::wstring widePath = multi2wide(multiPath); + + if (!CreateDirectoryW(widePath.c_str(),NULL)) + throw Win32Exception(Win32Exception::API_CreateDirectory); + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} Added: box/invisnet/vs2010/0.11/lib/win32/_sys/stat.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/stat.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/stat.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,67 @@ +#ifndef EMU_SYS_STAT_H +# define EMU_SYS_STAT_H + +# ifdef WIN32 +# pragma once + +# define S_IRWXG 1 +# define S_IRWXO 2 +# define S_ISUID 4 +# define S_ISGID 8 +# define S_ISVTX 16 + +# define EMU_STRUCT_STAT struct emu_stat_ +# define EMU_STAT emu_stat +# define EMU_FSTAT emu_fstat +# define EMU_LSTAT emu_stat +# define EMU_MKDIR emu_mkdir + +# ifndef __MINGW32__ + //not sure if these are correct + //S_IWRITE - writing permitted + //_S_IREAD - reading permitted + //_S_IREAD | _S_IWRITE - +# define S_IRUSR S_IWRITE +# define S_IWUSR S_IREAD +# define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) + +# define S_ISREG(x) (S_IFREG & x) +# define S_ISDIR(x) (S_IFDIR & x) +# endif + + + + //this shouldn't be needed. + struct statfs + { + TCHAR f_mntonname[MAX_PATH]; + }; + + struct emu_stat_ { + int st_dev; + uint64_t st_ino; + short st_mode; + short st_nlink; + short st_uid; + short st_gid; + //_dev_t st_rdev; + uint64_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; + + + extern int emu_stat(const char * pName, struct emu_stat_ * st) throw(); + extern int emu_fstat(HANDLE hdir, struct emu_stat_ * st) throw(); + + extern int emu_mkdir(const char* pPathName, mode_t mode) throw(); +# else +# define EMU_STRUCT_STAT struct stat +# define EMU_STAT ::stat +# define EMU_FSTAT ::fstat +# define EMU_LSTAT ::lstat +# define EMU_MKDIR ::mkdir +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/_sys/time.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/time.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/time.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,73 @@ +#include "Box.h" + + +using namespace Win32; + + +static bool ConvertTime_tToFileTime(const time_t from, FILETIME *pTo) +{ + time_t adjusted = from + _timezone; + struct tm *time_breakdown = gmtime(&adjusted); + if (time_breakdown == NULL) + { + ::syslog(LOG_ERR, "Error: failed to convert time format: " + "%d is not a valid time\n", from); + return false; + } + + SYSTEMTIME stUTC; + stUTC.wSecond = static_cast(time_breakdown->tm_sec); + stUTC.wMinute = static_cast(time_breakdown->tm_min); + stUTC.wHour = static_cast(time_breakdown->tm_hour); + stUTC.wDay = static_cast(time_breakdown->tm_mday); + stUTC.wDayOfWeek = static_cast(time_breakdown->tm_wday); + stUTC.wMonth = static_cast(time_breakdown->tm_mon + 1); + stUTC.wYear = static_cast(time_breakdown->tm_year + 1900); + stUTC.wMilliseconds = static_cast(0); + + // Convert the last-write time to local time. + if (!SystemTimeToFileTime(&stUTC, pTo)) + THROW_EXCEPTION_MESSAGE(Win32Exception, API_SystemTimeToFileTime, "Failed to convert between time formats") + + return true; +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: emu_utimes +// Purpose: replacement for the POSIX utimes() function, +// works with unicode filenames supplied in utf8 format, +// sets creation time instead of last access time. +// Created: 25th July 2006 +// +// -------------------------------------------------------------------------- +int emu_utimes(const char * pName, const struct timeval times[]) +{ + HANDLE hFile = INVALID_HANDLE_VALUE; + + try + { + FILETIME creationTime, + modificationTime; + + ConvertTime_tToFileTime(times[0].tv_sec, &creationTime); + ConvertTime_tToFileTime(times[1].tv_sec, &modificationTime); + + hFile = OpenFileByNameUtf8(pName, FILE_WRITE_ATTRIBUTES); + + if (!SetFileTime(hFile, &creationTime, NULL, &modificationTime)) + throw Win32Exception(Win32Exception::API_SetFileTime, pName); + + CloseHandle(hFile); + + return 0; + } + EMU_EXCEPTION_HANDLING + + if (INVALID_HANDLE_VALUE != hFile) + CloseHandle(hFile); + + return -1; +} Added: box/invisnet/vs2010/0.11/lib/win32/_sys/time.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/time.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/time.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,14 @@ +#ifndef EMU_SYS_TIME_H +# define EMU_SYS_TIME_H + +# ifdef WIN32 +# pragma once + +# define EMU_UTIMES emu_utimes + + extern int emu_utimes(const char * pName, const struct timeval times[]) throw(); +# else +# define EMU_UTIMES ::utimes +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/_sys/uio.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/uio.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/uio.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,40 @@ +#include "Box.h" + + +ssize_t readv(int filedes, const struct iovec *vector, size_t count) +{ + int bytes = 0; + + for (size_t i = 0; i < count; i++) + { + if (vector[i].iov_len > INT_MAX) + return -1; + int result = read(filedes, vector[i].iov_base, static_cast(vector[i].iov_len)); + if (result < 0) + { + return result; + } + bytes += result; + } + + return bytes; +} + +ssize_t writev(int filedes, const struct iovec *vector, size_t count) +{ + int bytes = 0; + + for (size_t i = 0; i < count; i++) + { + if (vector[i].iov_len > INT_MAX) + return -1; + int result = write(filedes, vector[i].iov_base, static_cast(vector[i].iov_len)); + if (result < 0) + { + return result; + } + bytes += result; + } + + return bytes; +} Added: box/invisnet/vs2010/0.11/lib/win32/_sys/uio.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/uio.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/uio.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,13 @@ +#include "_sys/_iovec.h" + +#ifndef EMU_SYS_UIO_H +# define EMU_SYS_UIO_H + +# ifdef WIN32 +# pragma once + + extern ssize_t readv (int filedes, const struct iovec *vector, size_t count) throw(); + extern ssize_t writev(int filedes, const struct iovec *vector, size_t count) throw(); +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/dirent.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/dirent.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/dirent.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,105 @@ +#include "Box.h" + + +struct dirent& dirent::operator =(WIN32_FIND_DATAW& pWFD) +{ + d_type = attr_to_type(pWFD.dwFileAttributes); + d_name_w = pWFD.cFileName; + Win32::wide2multi(d_name_w, d_name_m); + d_namlen = static_cast(d_name_w.size()); + d_name = d_name_m.c_str(); + return *this; +} + +DIR_::DIR_(const char *dir_) +{ + if (!dir_) + THROW_EXCEPTION(Win32Exception, Internal) + if (!*dir_) + THROW_EXCEPTION(Win32Exception, Internal) + std::string tdir(dir_); + if ('\\' != tdir[tdir.size()-1] || '/' != tdir[tdir.size()-1]) + tdir.push_back('\\'); + tdir.push_back('*'); + Win32::multi2wide(tdir, dir); + if (INVALID_HANDLE_VALUE == (hFind = FindFirstFileW(dir.c_str(),&wfd))) + THROW_EXCEPTION(Win32Exception, API_FindFirstFile); +} + +DIR_::~DIR_() +{ + if (INVALID_HANDLE_VALUE != hFind) + FindClose(hFind); +} + +void DIR_::next() +{ + if (!FindNextFileW(hFind,&wfd)) + { + DWORD gle = GetLastError(); + FindClose(hFind); + hFind = INVALID_HANDLE_VALUE; + if (ERROR_NO_MORE_FILES != gle) + { + SetLastError(gle); + THROW_EXCEPTION(Win32Exception, API_FindNextFile); + } + } +} + + +DIR* opendir(const char* name) throw() +{ + DIR *dir = NULL; + + try + { + dir = new DIR(name); + } + catch(...) + { + dir = NULL; // just in case + } + return dir; +} + +struct dirent* readdir(DIR *dir) throw() +{ + struct dirent *de = NULL; + + if (!dir) + { + errno = EINVAL; + } + else if (INVALID_HANDLE_VALUE == dir->hFind) + { + errno = EBADF; + } + else + { + try + { + dir->de = dir->wfd; + dir->next(); + de = &dir->de; + } + EMU_EXCEPTION_HANDLING + } + return de; +} + +int closedir(DIR *dir) +{ + int r = -1; + + if (!dir) + { + errno = EINVAL; + } + else + { + delete dir; + r = 0; + } + return r; +} Added: box/invisnet/vs2010/0.11/lib/win32/dirent.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/dirent.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/dirent.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,44 @@ +#ifndef EMU_DIRENT_H +# define EMU_DIRENT_H + +# ifdef WIN32 +# pragma once + +# define DT_DIR 4 +# define DT_REG 8 + + struct dirent { + uint8_t d_type; /* file type, see below */ + uint16_t d_namlen; /* length of string in d_name */ + const char *d_name; + std::string d_name_m; + std::wstring d_name_w; + + private: + uint8_t attr_to_type(DWORD attr) throw() { + return (attr & FILE_ATTRIBUTE_DIRECTORY) ? DT_DIR : DT_REG; + } + + public: + struct dirent& operator =(WIN32_FIND_DATAW& pWFD); + }; + + typedef struct DIR_ { + HANDLE hFind; + WIN32_FIND_DATAW wfd; + std::wstring dir; + struct dirent de; + + public: + DIR_(const char* dir_); + ~DIR_(); + void next(); + } DIR; + + + extern DIR* opendir(const char* name); + extern struct dirent* readdir(DIR *dir); + extern int closedir(DIR *dir); +# endif + +#endif Modified: box/invisnet/vs2010/0.11/lib/win32/emu.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/emu.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/win32/emu.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -1,92 +1,14 @@ -// Box Backup Win32 native port by Nick Knight +#include "Box.h" -// Need at least 0x0500 to use GetFileSizeEx on Cygwin/MinGW -#define WINVER 0x0500 +#include -#include "emu.h" -#ifdef WIN32 +using namespace Win32; -#include -#include -#include -#include -#include "Shlobj.h" -#include "Shlwapi.h" -#ifdef HAVE_UNISTD_H - #include -#endif - -#include -#include -#include - -// message resource definitions for syslog() -#include "messages.h" - -DWORD winerrno; struct passwd gTempPasswd; -bool EnableBackupRights() -{ - HANDLE hToken; - TOKEN_PRIVILEGES token_priv; - //open current process to adjust privileges - if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, - &hToken)) - { - ::syslog(LOG_ERR, "Failed to open process token: %s", - GetErrorMessage(GetLastError()).c_str()); - return false; - } - - //let's build the token privilege struct - - //first, look up the LUID for the backup privilege - - if (!LookupPrivilegeValue( - NULL, //this system - SE_BACKUP_NAME, //the name of the privilege - &( token_priv.Privileges[0].Luid ))) //result - { - ::syslog(LOG_ERR, "Failed to lookup backup privilege: %s", - GetErrorMessage(GetLastError()).c_str()); - CloseHandle(hToken); - return false; - } - - token_priv.PrivilegeCount = 1; - token_priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - // now set the privilege - // because we're going exit right after dumping the streams, there isn't - // any need to save current state - - if (!AdjustTokenPrivileges( - hToken, //our process token - false, //we're not disabling everything - &token_priv, //address of structure - sizeof(token_priv), //size of structure - NULL, NULL)) //don't save current state - { - //this function is a little tricky - if we were adjusting - //more than one privilege, it could return success but not - //adjust them all - in the general case, you need to trap this - ::syslog(LOG_ERR, "Failed to enable backup privilege: %s", - GetErrorMessage(GetLastError()).c_str()); - CloseHandle(hToken); - return false; - - } - - CloseHandle(hToken); - return true; -} - -// forward declaration -char* ConvertFromWideString(const WCHAR* pString, unsigned int codepage); - // -------------------------------------------------------------------------- // // Function @@ -98,1739 +20,45 @@ // Created: 26th May 2007 // // -------------------------------------------------------------------------- -std::string GetDefaultConfigFilePath(const std::string& rName) +std::string GetDefaultConfigFilePath(const std::string& rName) throw() { // we just ask the system where to get the file... - char path[MAX_PATH]; + wchar_t path[MAX_PATH]; - if(FAILED(SHGetFolderPath(NULL,CSIDL_COMMON_APPDATA,NULL,0,path)) - || FALSE == PathAppend(path,"Box Backup") - || FALSE == PathAppend(path,rName.c_str())) - { - return ""; - } - - return std::string(path); -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: ConvertToWideString -// Purpose: Converts a string from specified codepage to -// a wide string (WCHAR*). Returns a buffer which -// MUST be freed by the caller with delete[]. -// In case of fire, logs the error and returns NULL. -// Created: 4th February 2006 -// -// -------------------------------------------------------------------------- -WCHAR* ConvertToWideString(const char* pString, unsigned int codepage, - bool logErrors) -{ - int len = MultiByteToWideChar - ( - codepage, // source code page - 0, // character-type options - pString, // string to map - -1, // number of bytes in string - auto detect - NULL, // wide-character buffer - 0 // size of buffer - work out - // how much space we need - ); - - if (len == 0) - { - winerrno = GetLastError(); - if (logErrors) - { - ::syslog(LOG_WARNING, - "Failed to convert string to wide string: " - "%s", GetErrorMessage(winerrno).c_str()); - } - errno = EINVAL; - return NULL; - } - - WCHAR* buffer = new WCHAR[len]; - - if (buffer == NULL) - { - if (logErrors) - { - ::syslog(LOG_WARNING, - "Failed to convert string to wide string: " - "out of memory"); - } - winerrno = ERROR_OUTOFMEMORY; - errno = ENOMEM; - return NULL; - } - - len = MultiByteToWideChar - ( - codepage, // source code page - 0, // character-type options - pString, // string to map - -1, // number of bytes in string - auto detect - buffer, // wide-character buffer - len // size of buffer - ); - - if (len == 0) - { - winerrno = GetLastError(); - if (logErrors) - { - ::syslog(LOG_WARNING, - "Failed to convert string to wide string: " - "%s", GetErrorMessage(winerrno).c_str()); - } - errno = EACCES; - delete [] buffer; - return NULL; - } - - return buffer; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: ConvertUtf8ToWideString -// Purpose: Converts a string from UTF-8 to a wide string. -// Returns a buffer which MUST be freed by the caller -// with delete[]. -// In case of fire, logs the error and returns NULL. -// Created: 4th February 2006 -// -// -------------------------------------------------------------------------- -WCHAR* ConvertUtf8ToWideString(const char* pString) -{ - return ConvertToWideString(pString, CP_UTF8, true); -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: ConvertFromWideString -// Purpose: Converts a wide string to a narrow string in the -// specified code page. Returns a buffer which MUST -// be freed by the caller with delete[]. -// In case of fire, logs the error and returns NULL. -// Created: 4th February 2006 -// -// -------------------------------------------------------------------------- -char* ConvertFromWideString(const WCHAR* pString, unsigned int codepage) -{ - int len = WideCharToMultiByte - ( - codepage, // destination code page - 0, // character-type options - pString, // string to map - -1, // number of bytes in string - auto detect - NULL, // output buffer - 0, // size of buffer - work out - // how much space we need - NULL, // replace unknown chars with system default - NULL // don't tell us when that happened - ); - - if (len == 0) - { - ::syslog(LOG_WARNING, - "Failed to convert wide string to narrow: " - "error %d", GetLastError()); - errno = EINVAL; - return NULL; - } - - char* buffer = new char[len]; - - if (buffer == NULL) - { - ::syslog(LOG_WARNING, - "Failed to convert wide string to narrow: " - "out of memory"); - errno = ENOMEM; - return NULL; - } - - len = WideCharToMultiByte - ( - codepage, // source code page - 0, // character-type options - pString, // string to map - -1, // number of bytes in string - auto detect - buffer, // output buffer - len, // size of buffer - NULL, // replace unknown chars with system default - NULL // don't tell us when that happened - ); - - if (len == 0) - { - ::syslog(LOG_WARNING, - "Failed to convert wide string to narrow: " - "error %i", GetLastError()); - errno = EACCES; - delete [] buffer; - return NULL; - } - - return buffer; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: ConvertEncoding(const std::string&, int, -// std::string&, int) -// Purpose: Converts a string from one code page to another. -// On success, replaces contents of rDest and returns -// true. In case of fire, logs the error and returns -// false. -// Created: 15th October 2006 -// -// -------------------------------------------------------------------------- -bool ConvertEncoding(const std::string& rSource, int sourceCodePage, - std::string& rDest, int destCodePage) -{ - WCHAR* pWide = ConvertToWideString(rSource.c_str(), sourceCodePage, - true); - if (pWide == NULL) - { - ::syslog(LOG_ERR, "Failed to convert string '%s' from " - "current code page %d to wide string: %s", - rSource.c_str(), sourceCodePage, - GetErrorMessage(GetLastError()).c_str()); - return false; - } - - char* pConsole = ConvertFromWideString(pWide, destCodePage); - delete [] pWide; - - if (!pConsole) - { - // Error should have been logged by ConvertFromWideString - return false; - } - - rDest = pConsole; - delete [] pConsole; - - return true; -} - -bool ConvertToUtf8(const std::string& rSource, std::string& rDest, - int sourceCodePage) -{ - return ConvertEncoding(rSource, sourceCodePage, rDest, CP_UTF8); -} - -bool ConvertFromUtf8(const std::string& rSource, std::string& rDest, - int destCodePage) -{ - return ConvertEncoding(rSource, CP_UTF8, rDest, destCodePage); -} - -bool ConvertConsoleToUtf8(const std::string& rSource, std::string& rDest) -{ - return ConvertToUtf8(rSource, rDest, GetConsoleCP()); -} - -bool ConvertUtf8ToConsole(const std::string& rSource, std::string& rDest) -{ - return ConvertFromUtf8(rSource, rDest, GetConsoleOutputCP()); -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: ConvertPathToAbsoluteUnicode -// Purpose: Converts relative paths to absolute (with unicode marker) -// Created: 4th February 2006 -// -// -------------------------------------------------------------------------- -std::string ConvertPathToAbsoluteUnicode(const char *pFileName) -{ - std::string filename; - for (int i = 0; pFileName[i] != 0; i++) - { - if (pFileName[i] == '/') - { - filename += '\\'; - } - else - { - filename += pFileName[i]; - } - } - - std::string tmpStr("\\\\?\\"); - - // Is the path relative or absolute? - // Absolute paths on Windows are always a drive letter - // followed by ':' - - char wd[PATH_MAX]; - if (::getcwd(wd, PATH_MAX) == 0) - { - ::syslog(LOG_WARNING, - "Failed to open '%s': path too long", - pFileName); - errno = ENAMETOOLONG; - winerrno = ERROR_INVALID_NAME; - tmpStr = ""; - return tmpStr; - } - - if (filename.length() > 2 && filename[0] == '\\' && - filename[1] == '\\') - { - tmpStr += "UNC\\"; - filename.replace(0, 2, ""); - // \\?\UNC\\ - // see http://msdn2.microsoft.com/en-us/library/aa365247.aspx - } - else if (filename.length() >= 1 && filename[0] == '\\') - { - // root directory of current drive. - tmpStr = wd; - tmpStr.resize(2); // drive letter and colon - } - else if (filename.length() >= 2 && filename[1] != ':') - { - // Must be relative. We need to get the - // current directory to make it absolute. - tmpStr += wd; - if (tmpStr[tmpStr.length()] != '\\') - { - tmpStr += '\\'; - } - } - - tmpStr += filename; - - // We are using direct filename access, which does not support .., - // so we need to implement it ourselves. - - for (std::string::size_type i = 1; i < tmpStr.size() - 3; i++) - { - if (tmpStr.substr(i, 3) == "\\..") - { - std::string::size_type lastSlash = - tmpStr.rfind('\\', i - 1); - - if (lastSlash == std::string::npos) - { - // no previous directory, ignore it, - // CreateFile will fail with error 123 - } - else - { - tmpStr.replace(lastSlash, i + 3 - lastSlash, - ""); - } - - i = lastSlash; - } - } - - return tmpStr; -} - -std::string GetErrorMessage(DWORD errorCode) -{ - char* pMsgBuf = NULL; - - DWORD chars = FormatMessage - ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - errorCode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (char *)(&pMsgBuf), - 0, NULL - ); - - if (chars == 0 || pMsgBuf == NULL) - { - return std::string("failed to get error message"); - } - - // remove embedded newline - pMsgBuf[chars - 1] = 0; - pMsgBuf[chars - 2] = 0; - - std::ostringstream line; - line << pMsgBuf << " (" << errorCode << ")"; - LocalFree(pMsgBuf); - - return line.str(); -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: openfile -// Purpose: replacement for any open calls - handles unicode -// filenames - supplied in utf8 -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -HANDLE openfile(const char *pFileName, int flags, int mode) -{ - winerrno = ERROR_INVALID_FUNCTION; - - std::string AbsPathWithUnicode = - ConvertPathToAbsoluteUnicode(pFileName); - - if (AbsPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return INVALID_HANDLE_VALUE; - } - - WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str()); - // We are responsible for freeing pBuffer - - if (pBuffer == NULL) - { - // error already logged by ConvertUtf8ToWideString() - return INVALID_HANDLE_VALUE; - } - - // flags could be O_WRONLY | O_CREAT | O_RDONLY - DWORD createDisposition = OPEN_EXISTING; - DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE - | FILE_SHARE_DELETE; - DWORD accessRights = FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY - | FILE_READ_EA; - - if (flags & O_WRONLY) - { - accessRights = FILE_WRITE_DATA; - } - else if (flags & O_RDWR) - { - accessRights |= FILE_WRITE_ATTRIBUTES - | FILE_WRITE_DATA | FILE_WRITE_EA; - } - - if (flags & O_CREAT) - { - createDisposition = OPEN_ALWAYS; - } - - if (flags & O_TRUNC) - { - createDisposition = CREATE_ALWAYS; - } - - if ((flags & O_CREAT) && (flags & O_EXCL)) - { - createDisposition = CREATE_NEW; - } - - if (flags & O_LOCK) - { - shareMode = 0; - } - - DWORD winFlags = FILE_FLAG_BACKUP_SEMANTICS; - if (flags & O_TEMPORARY) - { - winFlags |= FILE_FLAG_DELETE_ON_CLOSE; - } - - HANDLE hdir = CreateFileW(pBuffer, - accessRights, - shareMode, - NULL, - createDisposition, - winFlags, - NULL); - - delete [] pBuffer; - - if (hdir == INVALID_HANDLE_VALUE) - { - winerrno = GetLastError(); - switch(winerrno) - { - case ERROR_SHARING_VIOLATION: - errno = EBUSY; - break; - - default: - errno = EINVAL; - } - - ::syslog(LOG_WARNING, "Failed to open file '%s': " - "%s", pFileName, - GetErrorMessage(GetLastError()).c_str()); - - return INVALID_HANDLE_VALUE; - } - - if (flags & O_APPEND) - { - if (SetFilePointer(hdir, 0, NULL, FILE_END) == - INVALID_SET_FILE_POINTER) - { - winerrno = GetLastError(); - errno = EINVAL; - CloseHandle(hdir); - return INVALID_HANDLE_VALUE; - } - } - - winerrno = NO_ERROR; - return hdir; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: emu_fstat -// Purpose: replacement for fstat. Supply a windows handle. -// Returns a struct emu_stat to have room for 64-bit -// file identifier in st_ino (mingw allows only 16!) -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int emu_fstat(HANDLE hdir, struct emu_stat * st) -{ - if (hdir == INVALID_HANDLE_VALUE) - { - ::syslog(LOG_ERR, "Error: invalid file handle in emu_fstat()"); - errno = EBADF; - return -1; - } - - BY_HANDLE_FILE_INFORMATION fi; - if (!GetFileInformationByHandle(hdir, &fi)) - { - ::syslog(LOG_WARNING, "Failed to read file information: " - "%s", GetErrorMessage(GetLastError()).c_str()); - errno = EACCES; - return -1; - } - - if (INVALID_FILE_ATTRIBUTES == fi.dwFileAttributes) - { - ::syslog(LOG_WARNING, "Failed to get file attributes: " - "%s", GetErrorMessage(GetLastError()).c_str()); - errno = EACCES; - return -1; - } - - memset(st, 0, sizeof(*st)); - - // This is how we get our INODE (equivalent) information - ULARGE_INTEGER conv; - conv.HighPart = fi.nFileIndexHigh; - conv.LowPart = fi.nFileIndexLow; - st->st_ino = conv.QuadPart; - - // get the time information - st->st_ctime = ConvertFileTimeToTime_t(&fi.ftCreationTime); - st->st_atime = ConvertFileTimeToTime_t(&fi.ftLastAccessTime); - st->st_mtime = ConvertFileTimeToTime_t(&fi.ftLastWriteTime); - - if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - st->st_size = 0; - } - else - { - conv.HighPart = fi.nFileSizeHigh; - conv.LowPart = fi.nFileSizeLow; - st->st_size = (_off_t)conv.QuadPart; - } - - // at the mo - st->st_uid = 0; - st->st_gid = 0; - st->st_nlink = 1; - - // the mode of the file - // mode zero will make it impossible to restore on Unix - // (no access to anybody, including the owner). - // we'll fake a sensible mode: - // all objects get user read (0400) - // if it's a directory it gets user execute (0100) - // if it's not read-only it gets user write (0200) - st->st_mode = S_IREAD; - - if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - st->st_mode |= S_IFDIR | S_IEXEC; - } - else - { - st->st_mode |= S_IFREG; - } - - if (!(fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - { - st->st_mode |= S_IWRITE; - } - - // st_dev is normally zero, regardless of the drive letter, - // since backup locations can't normally span drives. However, - // a reparse point does allow all kinds of weird stuff to happen. - // We set st_dev to 1 for a reparse point, so that Box will detect - // a change of device number (from 0) and refuse to recurse down - // the reparse point (which could lead to havoc). - - if (fi.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - { - st->st_dev = 1; - } - else - { - st->st_dev = 0; - } - - return 0; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: OpenFileByNameUtf8 -// Purpose: Converts filename to Unicode and returns -// a handle to it. In case of error, sets errno, -// logs the error and returns NULL. -// Created: 10th December 2004 -// -// -------------------------------------------------------------------------- -HANDLE OpenFileByNameUtf8(const char* pFileName, DWORD flags) -{ - std::string AbsPathWithUnicode = - ConvertPathToAbsoluteUnicode(pFileName); - - if (AbsPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return NULL; - } - - WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str()); - // We are responsible for freeing pBuffer - - if (pBuffer == NULL) - { - // error already logged by ConvertUtf8ToWideString() - return NULL; - } - - HANDLE handle = CreateFileW(pBuffer, - flags, - FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); - - if (handle == INVALID_HANDLE_VALUE) - { - // if our open fails we should always be able to - // open in this mode - to get the inode information - // at least one process must have the file open - - // in this case someone else does. - handle = CreateFileW(pBuffer, - READ_CONTROL, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); - } - - delete [] pBuffer; - - if (handle == INVALID_HANDLE_VALUE) - { - DWORD err = GetLastError(); - - if (err == ERROR_FILE_NOT_FOUND || - err == ERROR_PATH_NOT_FOUND) - { - errno = ENOENT; - } - else - { - ::syslog(LOG_WARNING, "Failed to open '%s': " - "%s", pFileName, - GetErrorMessage(err).c_str()); - errno = EACCES; - } - - return NULL; - } - - return handle; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: emu_stat -// Purpose: replacement for the lstat and stat functions. -// Works with unicode filenames supplied in utf8. -// Returns a struct emu_stat to have room for 64-bit -// file identifier in st_ino (mingw allows only 16!) -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int emu_stat(const char * pName, struct emu_stat * st) -{ - HANDLE handle = OpenFileByNameUtf8(pName, - FILE_READ_ATTRIBUTES | FILE_READ_EA); - - if (handle == NULL) - { - // errno already set and error logged by OpenFileByNameUtf8() - return -1; - } - - int retVal = emu_fstat(handle, st); - if (retVal != 0) - { - // error logged, but without filename - ::syslog(LOG_WARNING, "Failed to get file information " - "for '%s'", pName); - } - - // close the handle - CloseHandle(handle); - - return retVal; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: statfs -// Purpose: returns the mount point of where a file is located - -// in this case the volume serial number -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int statfs(const char * pName, struct statfs * s) -{ - HANDLE handle = OpenFileByNameUtf8(pName, - FILE_READ_ATTRIBUTES | FILE_READ_EA); - - if (handle == NULL) - { - // errno already set and error logged by OpenFileByNameUtf8() - return -1; - } - - BY_HANDLE_FILE_INFORMATION fi; - if (!GetFileInformationByHandle(handle, &fi)) - { - ::syslog(LOG_WARNING, "Failed to get file information " - "for '%s': %s", pName, - GetErrorMessage(GetLastError()).c_str()); - CloseHandle(handle); - errno = EACCES; - return -1; - } - - // convert volume serial number to a string - _ui64toa(fi.dwVolumeSerialNumber, s->f_mntonname + 1, 16); - - // pseudo unix mount point - s->f_mntonname[0] = '\\'; - - CloseHandle(handle); // close the handle - - return 0; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: emu_utimes -// Purpose: replacement for the POSIX utimes() function, -// works with unicode filenames supplied in utf8 format, -// sets creation time instead of last access time. -// Created: 25th July 2006 -// -// -------------------------------------------------------------------------- -int emu_utimes(const char * pName, const struct timeval times[]) -{ - FILETIME creationTime; - if (!ConvertTime_tToFileTime(times[0].tv_sec, &creationTime)) - { - errno = EINVAL; - return -1; - } - - FILETIME modificationTime; - if (!ConvertTime_tToFileTime(times[1].tv_sec, &modificationTime)) - { - errno = EINVAL; - return -1; - } - - HANDLE handle = OpenFileByNameUtf8(pName, FILE_WRITE_ATTRIBUTES); - - if (handle == NULL) - { - // errno already set and error logged by OpenFileByNameUtf8() - return -1; - } - - if (!SetFileTime(handle, &creationTime, NULL, &modificationTime)) - { - ::syslog(LOG_ERR, "Failed to set times on '%s': %s", pName, - GetErrorMessage(GetLastError()).c_str()); - CloseHandle(handle); - return 1; - } - - CloseHandle(handle); - return 0; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: emu_chmod -// Purpose: replacement for the POSIX chmod function, -// works with unicode filenames supplied in utf8 format -// Created: 26th July 2006 -// -// -------------------------------------------------------------------------- -int emu_chmod(const char * pName, mode_t mode) -{ - std::string AbsPathWithUnicode = - ConvertPathToAbsoluteUnicode(pName); - - if (AbsPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return -1; - } - - WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str()); - // We are responsible for freeing pBuffer - - if (pBuffer == NULL) - { - // error already logged by ConvertUtf8ToWideString() - free(pBuffer); - return -1; - } - - DWORD attribs = GetFileAttributesW(pBuffer); - if (attribs == INVALID_FILE_ATTRIBUTES) - { - ::syslog(LOG_ERR, "Failed to get file attributes of '%s': %s", - pName, GetErrorMessage(GetLastError()).c_str()); - errno = EACCES; - free(pBuffer); - return -1; - } - - if (mode & S_IWRITE) - { - attribs &= ~FILE_ATTRIBUTE_READONLY; - } - else - { - attribs |= FILE_ATTRIBUTE_READONLY; - } - - if (!SetFileAttributesW(pBuffer, attribs)) - { - ::syslog(LOG_ERR, "Failed to set file attributes of '%s': %s", - pName, GetErrorMessage(GetLastError()).c_str()); - errno = EACCES; - free(pBuffer); - return -1; - } - - delete [] pBuffer; - return 0; -} - - -// -------------------------------------------------------------------------- -// -// Function -// Name: opendir -// Purpose: replacement for unix function, uses win32 findfirst routines -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -DIR *opendir(const char *name) -{ - if (!name || !name[0]) - { - errno = EINVAL; - return NULL; - } - - std::string dirName(name); - - //append a '\' win32 findfirst is sensitive to this - if ( dirName[dirName.size()-1] != '\\' || dirName[dirName.size()-1] != '/' ) - { - dirName += '\\'; - } - - // what is the search string? - everything - dirName += '*'; - - DIR *pDir = new DIR; - if (pDir == NULL) - { - errno = ENOMEM; - return NULL; - } - - pDir->name = ConvertUtf8ToWideString(dirName.c_str()); - // We are responsible for freeing dir->name with delete[] - - if (pDir->name == NULL) - { - delete pDir; - return NULL; - } - - pDir->fd = _wfindfirst((const wchar_t*)pDir->name, &(pDir->info)); - - if (pDir->fd == -1) - { - delete [] pDir->name; - delete pDir; - return NULL; - } - - pDir->result.d_name = 0; - return pDir; -} - -// this kinda makes it not thread friendly! -// but I don't think it needs to be. -char tempbuff[MAX_PATH]; - -// -------------------------------------------------------------------------- -// -// Function -// Name: readdir -// Purpose: as function above -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -struct dirent *readdir(DIR *dp) -{ try { - struct dirent *den = NULL; - - if (dp && dp->fd != -1) + if(SUCCEEDED(SHGetFolderPathW(NULL,CSIDL_COMMON_APPDATA,NULL,0,path)) + && PathAppendW(path,L"Box Backup") + && PathAppendW(path,multi2wide(rName.c_str()).c_str())) { - if (!dp->result.d_name || - _wfindnext(dp->fd, &dp->info) != -1) - { - den = &dp->result; - std::wstring input(dp->info.name); - memset(tempbuff, 0, sizeof(tempbuff)); - WideCharToMultiByte(CP_UTF8, 0, dp->info.name, - -1, &tempbuff[0], sizeof (tempbuff), - NULL, NULL); - //den->d_name = (char *)dp->info.name; - den->d_name = &tempbuff[0]; - if (dp->info.attrib & FILE_ATTRIBUTE_DIRECTORY) - { - den->d_type = S_IFDIR; - } - else - { - den->d_type = S_IFREG; - } - } + return wide2multi(path); } - else - { - errno = EBADF; - } - return den; } - catch (...) - { - printf("Caught readdir"); - } - return NULL; + EMU_EXCEPTION_HANDLING_RETURN("") } -// -------------------------------------------------------------------------- -// -// Function -// Name: closedir -// Purpose: as function above -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int closedir(DIR *dp) -{ - try - { - int finres = -1; - if (dp) - { - if(dp->fd != -1) - { - finres = _findclose(dp->fd); - } - delete [] dp->name; - delete dp; - } - - if (finres == -1) // errors go to EBADF - { - errno = EBADF; - } - - return finres; - } - catch (...) - { - printf("Caught closedir"); - } - return -1; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: poll -// Purpose: a weak implimentation (just enough for box) -// of the unix poll for winsock2 -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int poll (struct pollfd *ufds, unsigned long nfds, int timeout) +int console_read(char* pBuffer, const size_t BufferSize) throw() { + HANDLE hConsole; + try { - fd_set readfd; - fd_set writefd; + if (INVALID_HANDLE_VALUE == (hConsole = GetStdHandle(STD_INPUT_HANDLE))) + throw Win32Exception(Win32Exception::API_GetStdHandle); - FD_ZERO(&readfd); - FD_ZERO(&writefd); + size_t wideSize = BufferSize / 5; + std::unique_ptr wide(new wchar_t[wideSize+1]); - // struct pollfd *ufdsTmp = ufds; + DWORD numCharsRead = 0; + if (!ReadConsoleW(hConsole,wide.get(),static_cast(wideSize),&numCharsRead,NULL)) + throw Win32Exception(Win32Exception::API_ReadConsole); - timeval timOut; - timeval *tmpptr; + wide[numCharsRead] = '\0'; + std::string multi(wide2multi(wide.get())); + strcpy(pBuffer,multi.c_str()); - if (timeout == INFTIM) - tmpptr = NULL; - else - tmpptr = &timOut; - - timOut.tv_sec = timeout / 1000; - timOut.tv_usec = timeout * 1000; - - for (unsigned long i = 0; i < nfds; i++) - { - struct pollfd* ufd = &(ufds[i]); - - if (ufd->events & POLLIN) - { - FD_SET(ufd->fd, &readfd); - } - - if (ufd->events & POLLOUT) - { - FD_SET(ufd->fd, &writefd); - } - - if (ufd->events & ~(POLLIN | POLLOUT)) - { - printf("Unsupported poll bits %d", - ufd->events); - return -1; - } - } - - int nready = select(0, &readfd, &writefd, 0, tmpptr); - - if (nready == SOCKET_ERROR) - { - // int errval = WSAGetLastError(); - - struct pollfd* pufd = ufds; - for (unsigned long i = 0; i < nfds; i++) - { - pufd->revents = POLLERR; - pufd++; - } - return (-1); - } - else if (nready > 0) - { - for (unsigned long i = 0; i < nfds; i++) - { - struct pollfd *ufd = &(ufds[i]); - - if (FD_ISSET(ufd->fd, &readfd)) - { - ufd->revents |= POLLIN; - } - - if (FD_ISSET(ufd->fd, &writefd)) - { - ufd->revents |= POLLOUT; - } - } - } - - return nready; + return static_cast(multi.size()); } - catch (...) - { - printf("Caught poll"); - } - - return -1; + EMU_EXCEPTION_HANDLING_RETURN(-1) } - -// copied from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/eventlog/base/adding_a_source_to_the_registry.asp - -BOOL AddEventSource -( - LPTSTR pszSrcName, // event source name - DWORD dwNum // number of categories -) -{ - // Work out the executable file name, to register ourselves - // as the event source - - WCHAR cmd[MAX_PATH]; - DWORD len = GetModuleFileNameW(NULL, cmd, MAX_PATH); - - if (len == 0) - { - ::syslog(LOG_ERR, "Failed to get the program file name: %s", - GetErrorMessage(GetLastError()).c_str()); - return FALSE; - } - - // Create the event source as a subkey of the log. - - std::string regkey("SYSTEM\\CurrentControlSet\\Services\\EventLog\\" - "Application\\"); - regkey += pszSrcName; - - HKEY hk; - DWORD dwDisp; - - if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, regkey.c_str(), - 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &hk, &dwDisp)) - { - ::syslog(LOG_ERR, "Failed to create the registry key: %s", - GetErrorMessage(GetLastError()).c_str()); - return FALSE; - } - - // Set the name of the message file. - - if (RegSetValueExW(hk, // subkey handle - L"EventMessageFile", // value name - 0, // must be zero - REG_EXPAND_SZ, // value type - (LPBYTE)cmd, // pointer to value data - len*sizeof(WCHAR))) // data size - { - ::syslog(LOG_ERR, "Failed to set the event message file: %s", - GetErrorMessage(GetLastError()).c_str()); - RegCloseKey(hk); - return FALSE; - } - - // Set the supported event types. - - DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | - EVENTLOG_INFORMATION_TYPE; - - if (RegSetValueEx(hk, // subkey handle - "TypesSupported", // value name - 0, // must be zero - REG_DWORD, // value type - (LPBYTE) &dwData, // pointer to value data - sizeof(DWORD))) // length of value data - { - ::syslog(LOG_ERR, "Failed to set the supported types: %s", - GetErrorMessage(GetLastError()).c_str()); - RegCloseKey(hk); - return FALSE; - } - - // Set the category message file and number of categories. - - if (RegSetValueExW(hk, // subkey handle - L"CategoryMessageFile", // value name - 0, // must be zero - REG_EXPAND_SZ, // value type - (LPBYTE)cmd, // pointer to value data - len*sizeof(WCHAR))) // data size - { - ::syslog(LOG_ERR, "Failed to set the category message file: " - "%s", GetErrorMessage(GetLastError()).c_str()); - RegCloseKey(hk); - return FALSE; - } - - if (RegSetValueEx(hk, // subkey handle - "CategoryCount", // value name - 0, // must be zero - REG_DWORD, // value type - (LPBYTE) &dwNum, // pointer to value data - sizeof(DWORD))) // length of value data - { - ::syslog(LOG_ERR, "Failed to set the category count: %s", - GetErrorMessage(GetLastError()).c_str()); - RegCloseKey(hk); - return FALSE; - } - - RegCloseKey(hk); - return TRUE; -} - -static HANDLE gSyslogH = 0; -static bool sHaveWarnedEventLogFull = false; - -void openlog(const char * daemonName, int, int) -{ - std::string nameStr = "Box Backup ("; - nameStr += daemonName; - nameStr += ")"; - - // register a default event source, so that we can - // log errors with the process of adding or registering our own. - gSyslogH = RegisterEventSource( - NULL, // uses local computer - nameStr.c_str()); // source name - if (gSyslogH == NULL) - { - } - - char* name = strdup(nameStr.c_str()); - BOOL success = AddEventSource(name, 0); - free(name); - - if (!success) - { - ::syslog(LOG_ERR, "Failed to add our own event source"); - return; - } - - HANDLE newSyslogH = RegisterEventSource(NULL, nameStr.c_str()); - if (newSyslogH == NULL) - { - ::syslog(LOG_ERR, "Failed to register our own event source: " - "%s", GetErrorMessage(GetLastError()).c_str()); - return; - } - - DeregisterEventSource(gSyslogH); - gSyslogH = newSyslogH; -} - -void closelog(void) -{ - DeregisterEventSource(gSyslogH); -} - -void syslog(int loglevel, const char *frmt, ...) -{ - WORD errinfo; - char buffer[1024]; - std::string sixfour(frmt); - - switch (loglevel) - { - case LOG_INFO: - errinfo = EVENTLOG_INFORMATION_TYPE; - break; - case LOG_ERR: - errinfo = EVENTLOG_ERROR_TYPE; - break; - case LOG_WARNING: - errinfo = EVENTLOG_WARNING_TYPE; - break; - default: - errinfo = EVENTLOG_WARNING_TYPE; - break; - } - - // taken from MSDN - int sixfourpos; - while ( (sixfourpos = (int)sixfour.find("%ll")) != -1 ) - { - // maintain portability - change the 64 bit formater... - std::string temp = sixfour.substr(0,sixfourpos); - temp += "%I64"; - temp += sixfour.substr(sixfourpos+3, sixfour.length()); - sixfour = temp; - } - - // printf("parsed string is:%s\r\n", sixfour.c_str()); - - va_list args; - va_start(args, frmt); - - int len = vsnprintf(buffer, sizeof(buffer)-1, sixfour.c_str(), args); - assert(len >= 0); - if (len < 0) - { - printf("%s\r\n", buffer); - fflush(stdout); - return; - } - - assert((size_t)len < sizeof(buffer)); - buffer[sizeof(buffer)-1] = 0; - - va_end(args); - - if (gSyslogH == 0) - { - printf("%s\r\n", buffer); - fflush(stdout); - return; - } - - WCHAR* pWide = ConvertToWideString(buffer, CP_UTF8, false); - // must delete[] pWide - - DWORD result; - - if (pWide == NULL) - { - std::string buffer2 = buffer; - buffer2 += " (failed to convert string encoding)"; - LPCSTR strings[] = { buffer2.c_str(), NULL }; - - result = ReportEventA(gSyslogH, // event log handle - errinfo, // event type - 0, // category zero - MSG_ERR, // event identifier - - // we will call them all the same - NULL, // no user security identifier - 1, // one substitution string - 0, // no data - strings, // pointer to string array - NULL); // pointer to data - } - else - { - LPCWSTR strings[] = { pWide, NULL }; - result = ReportEventW(gSyslogH, // event log handle - errinfo, // event type - 0, // category zero - MSG_ERR, // event identifier - - // we will call them all the same - NULL, // no user security identifier - 1, // one substitution string - 0, // no data - strings, // pointer to string array - NULL); // pointer to data - delete [] pWide; - } - - if (result == 0) - { - DWORD err = GetLastError(); - if (err == ERROR_LOG_FILE_FULL) - { - if (!sHaveWarnedEventLogFull) - { - printf("Unable to send message to Event Log " - "(Event Log is full):\r\n"); - fflush(stdout); - sHaveWarnedEventLogFull = TRUE; - } - } - else - { - printf("Unable to send message to Event Log: %s:\r\n", - GetErrorMessage(err).c_str()); - fflush(stdout); - } - } - else - { - sHaveWarnedEventLogFull = false; - } -} - -int emu_chdir(const char* pDirName) -{ - /* - std::string AbsPathWithUnicode = - ConvertPathToAbsoluteUnicode(pDirName); - - if (AbsPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return -1; - } - - WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str()); - */ - - WCHAR* pBuffer = ConvertUtf8ToWideString(pDirName); - if (!pBuffer) return -1; - - int result = SetCurrentDirectoryW(pBuffer); - delete [] pBuffer; - - if (result != 0) return 0; - - errno = EACCES; - fprintf(stderr, "Failed to change directory to '%s': %s\n", - pDirName, GetErrorMessage(GetLastError()).c_str()); - return -1; -} - -char* emu_getcwd(char* pBuffer, int BufSize) -{ - DWORD len = GetCurrentDirectoryW(0, NULL); - if (len == 0) - { - errno = EINVAL; - return NULL; - } - - if ((int)len > BufSize) - { - errno = ENAMETOOLONG; - return NULL; - } - - WCHAR* pWide = new WCHAR [len]; - if (!pWide) - { - errno = ENOMEM; - return NULL; - } - - DWORD result = GetCurrentDirectoryW(len, pWide); - if (result <= 0 || result >= len) - { - errno = EACCES; - delete [] pWide; - return NULL; - } - - char* pUtf8 = ConvertFromWideString(pWide, CP_UTF8); - delete [] pWide; - - if (!pUtf8) - { - return NULL; - } - - strncpy(pBuffer, pUtf8, BufSize - 1); - pBuffer[BufSize - 1] = 0; - delete [] pUtf8; - - return pBuffer; -} - -int emu_mkdir(const char* pPathName) -{ - std::string AbsPathWithUnicode = - ConvertPathToAbsoluteUnicode(pPathName); - - if (AbsPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return -1; - } - - WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str()); - if (!pBuffer) - { - return -1; - } - - BOOL result = CreateDirectoryW(pBuffer, NULL); - delete [] pBuffer; - - if (!result) - { - errno = EACCES; - return -1; - } - - return 0; -} - -int emu_unlink(const char* pFileName) -{ - std::string AbsPathWithUnicode = - ConvertPathToAbsoluteUnicode(pFileName); - - if (AbsPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return -1; - } - - WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str()); - if (!pBuffer) - { - return -1; - } - - BOOL result = DeleteFileW(pBuffer); - DWORD err = GetLastError(); - delete [] pBuffer; - - if (!result) - { - if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND) - { - errno = ENOENT; - } - else if (err == ERROR_SHARING_VIOLATION) - { - errno = EBUSY; - } - else if (err == ERROR_ACCESS_DENIED) - { - errno = EACCES; - } - else - { - ::syslog(LOG_WARNING, "Failed to delete file " - "'%s': %s", pFileName, - GetErrorMessage(err).c_str()); - errno = ENOSYS; - } - return -1; - } - - return 0; -} - -int emu_rename(const char* pOldFileName, const char* pNewFileName) -{ - std::string OldPathWithUnicode = - ConvertPathToAbsoluteUnicode(pOldFileName); - - if (OldPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - return -1; - } - - WCHAR* pOldBuffer = ConvertUtf8ToWideString(OldPathWithUnicode.c_str()); - if (!pOldBuffer) - { - return -1; - } - - std::string NewPathWithUnicode = - ConvertPathToAbsoluteUnicode(pNewFileName); - - if (NewPathWithUnicode.size() == 0) - { - // error already logged by ConvertPathToAbsoluteUnicode() - delete [] pOldBuffer; - return -1; - } - - WCHAR* pNewBuffer = ConvertUtf8ToWideString(NewPathWithUnicode.c_str()); - if (!pNewBuffer) - { - delete [] pOldBuffer; - return -1; - } - - BOOL result = MoveFileW(pOldBuffer, pNewBuffer); - DWORD err = GetLastError(); - delete [] pOldBuffer; - delete [] pNewBuffer; - - if (!result) - { - if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND) - { - errno = ENOENT; - } - else if (err == ERROR_SHARING_VIOLATION) - { - errno = EBUSY; - } - else if (err == ERROR_ACCESS_DENIED) - { - errno = EACCES; - } - else - { - ::syslog(LOG_WARNING, "Failed to rename file " - "'%s' to '%s': %s", pOldFileName, pNewFileName, - GetErrorMessage(err).c_str()); - errno = ENOSYS; - } - return -1; - } - - return 0; -} - -int console_read(char* pBuffer, size_t BufferSize) -{ - HANDLE hConsole = GetStdHandle(STD_INPUT_HANDLE); - - if (hConsole == INVALID_HANDLE_VALUE) - { - ::fprintf(stderr, "Failed to get a handle on standard input: " - "%s", GetErrorMessage(GetLastError()).c_str()); - return -1; - } - - size_t WideSize = BufferSize / 5; - WCHAR* pWideBuffer = new WCHAR [WideSize + 1]; - - if (!pWideBuffer) - { - ::perror("Failed to allocate wide character buffer"); - return -1; - } - - DWORD numCharsRead = 0; - - if (!ReadConsoleW( - hConsole, - pWideBuffer, - WideSize, // will not be null terminated by ReadConsole - &numCharsRead, - NULL // reserved - )) - { - ::fprintf(stderr, "Failed to read from console: %s\n", - GetErrorMessage(GetLastError()).c_str()); - return -1; - } - - pWideBuffer[numCharsRead] = 0; - - char* pUtf8 = ConvertFromWideString(pWideBuffer, GetConsoleCP()); - delete [] pWideBuffer; - - strncpy(pBuffer, pUtf8, BufferSize); - delete [] pUtf8; - - return strlen(pBuffer); -} - -int readv (int filedes, const struct iovec *vector, size_t count) -{ - int bytes = 0; - - for (size_t i = 0; i < count; i++) - { - int result = read(filedes, vector[i].iov_base, - vector[i].iov_len); - if (result < 0) - { - return result; - } - bytes += result; - } - - return bytes; -} - -int writev(int filedes, const struct iovec *vector, size_t count) -{ - int bytes = 0; - - for (size_t i = 0; i < count; i++) - { - int result = write(filedes, vector[i].iov_base, - vector[i].iov_len); - if (result < 0) - { - return result; - } - bytes += result; - } - - return bytes; -} - -// need this for conversions -time_t ConvertFileTimeToTime_t(FILETIME *fileTime) -{ - SYSTEMTIME stUTC; - struct tm timeinfo; - - // Convert the last-write time to local time. - FileTimeToSystemTime(fileTime, &stUTC); - - memset(&timeinfo, 0, sizeof(timeinfo)); - timeinfo.tm_sec = stUTC.wSecond; - timeinfo.tm_min = stUTC.wMinute; - timeinfo.tm_hour = stUTC.wHour; - timeinfo.tm_mday = stUTC.wDay; - timeinfo.tm_wday = stUTC.wDayOfWeek; - timeinfo.tm_mon = stUTC.wMonth - 1; - // timeinfo.tm_yday = ...; - timeinfo.tm_year = stUTC.wYear - 1900; - - time_t retVal = mktime(&timeinfo) - _timezone; - return retVal; -} - -bool ConvertTime_tToFileTime(const time_t from, FILETIME *pTo) -{ - time_t adjusted = from + _timezone; - struct tm *time_breakdown = gmtime(&adjusted); - if (time_breakdown == NULL) - { - ::syslog(LOG_ERR, "Error: failed to convert time format: " - "%d is not a valid time\n", from); - return false; - } - - SYSTEMTIME stUTC; - stUTC.wSecond = time_breakdown->tm_sec; - stUTC.wMinute = time_breakdown->tm_min; - stUTC.wHour = time_breakdown->tm_hour; - stUTC.wDay = time_breakdown->tm_mday; - stUTC.wDayOfWeek = time_breakdown->tm_wday; - stUTC.wMonth = time_breakdown->tm_mon + 1; - stUTC.wYear = time_breakdown->tm_year + 1900; - stUTC.wMilliseconds = 0; - - // Convert the last-write time to local time. - if (!SystemTimeToFileTime(&stUTC, pTo)) - { - syslog(LOG_ERR, "Failed to convert between time formats: %s", - GetErrorMessage(GetLastError()).c_str()); - return false; - } - - return true; -} - -#endif // WIN32 - Modified: box/invisnet/vs2010/0.11/lib/win32/emu.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/emu.h 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/win32/emu.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -1,71 +1,73 @@ -// emulates unix syscalls to win32 functions +#ifndef EMU_INCLUDE +# define EMU_INCLUDE -#ifdef WIN32 - #define EMU_STRUCT_STAT struct emu_stat - #define EMU_STAT emu_stat - #define EMU_FSTAT emu_fstat - #define EMU_LSTAT emu_stat -#else - #define EMU_STRUCT_STAT struct stat - #define EMU_STAT ::stat - #define EMU_FSTAT ::fstat - #define EMU_LSTAT ::lstat -#endif +# ifdef WIN32 +# pragma once -#if ! defined EMU_INCLUDE && defined WIN32 -#define EMU_INCLUDE +# include "win32.h" +# include "dirent.h" +# include "getopt.h" +# include "poll.h" +# include "pwd.h" +# include "unicode.h" +# include "unistd.h" +# include "_sys/mount.h" +# include "_sys/resource.h" +# include "_sys/socket.h" +# include "_sys/stat.h" +# include "_sys/syslog.h" +# include "_sys/time.h" +# include "_sys/uio.h" + + + extern passwd gTempPasswd; + + +# define EMU_EXCEPTION_HANDLING \ + catch(std::bad_alloc &e) \ + { \ + (void)e; /* make the compiler happy */ \ + errno = ENOMEM; \ + } \ + catch(Win32Exception &e) \ + { \ + BOX_LOG_WIN_ERROR_NUMBER(e.GetMessage(),e.GetLastError()); \ + } \ + catch(...) \ + { \ + BOX_FATAL("Unexpected exception") \ + } + +# define EMU_EXCEPTION_HANDLING_RETURN(rv) \ + catch(std::bad_alloc &e) \ + { \ + (void)e; /* make the compiler happy */ \ + errno = ENOMEM; \ + } \ + catch(Win32Exception &e) \ + { \ + BOX_LOG_WIN_ERROR_NUMBER(e.GetMessage(),e.GetLastError()); \ + } \ + catch(...) \ + { \ + BOX_FATAL("Unexpected exception") \ + } \ + return rv; + + + // basic types, may be required by other headers since we // don't include sys/types.h -#ifdef __MINGW32__ - #include -#else // MSVC - typedef unsigned __int64 u_int64_t; - typedef unsigned __int64 uint64_t; - typedef __int64 int64_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int32 u_int32_t; - typedef __int32 int32_t; - typedef unsigned __int16 uint16_t; - typedef __int16 int16_t; - typedef unsigned __int8 uint8_t; - typedef __int8 int8_t; -#endif // emulated types, present on MinGW but not MSVC or vice versa #ifdef __MINGW32__ typedef uint32_t u_int32_t; #else - typedef unsigned int mode_t; - typedef unsigned int pid_t; #endif -// set up to include the necessary parts of Windows headers - -#define WIN32_LEAN_AND_MEAN - -#ifndef __MSVCRT_VERSION__ -#define __MSVCRT_VERSION__ 0x0601 -#endif - -// Windows headers - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - // emulated functions #define gmtime_r( _clock, _result ) \ @@ -74,114 +76,20 @@ #define ITIMER_REAL 0 -struct passwd { - char *pw_name; - char *pw_passwd; - int pw_uid; - int pw_gid; - time_t pw_change; - char *pw_class; - char *pw_gecos; - char *pw_dir; - char *pw_shell; - time_t pw_expire; -}; -extern passwd gTempPasswd; -inline struct passwd * getpwnam(const char * name) -{ - //for the mo pretend to be root - gTempPasswd.pw_uid = 0; - gTempPasswd.pw_gid = 0; - return &gTempPasswd; -} -#define S_IRWXG 1 -#define S_IRWXO 2 -#define S_ISUID 4 -#define S_ISGID 8 -#define S_ISVTX 16 -#ifndef __MINGW32__ - //not sure if these are correct - //S_IWRITE - writing permitted - //_S_IREAD - reading permitted - //_S_IREAD | _S_IWRITE - - #define S_IRUSR S_IWRITE - #define S_IWUSR S_IREAD - #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) - #define S_ISREG(x) (S_IFREG & x) - #define S_ISDIR(x) (S_IFDIR & x) -#endif - -inline int chown(const char * Filename, u_int32_t uid, u_int32_t gid) -{ - //important - this needs implementing - //If a large restore is required then - //it needs to restore files AND permissions - //reference AdjustTokenPrivileges - //GetAccountSid - //InitializeSecurityDescriptor - //SetSecurityDescriptorOwner - //The next function looks like the guy to use... - //SetFileSecurity - - //indicate success - return 0; -} - -// Windows and Unix owners and groups are pretty fundamentally different. -// Ben prefers that we kludge here rather than litter the code with #ifdefs. -// Pretend to be root, and pretend that set...() operations succeed. -inline int setegid(int) -{ - return true; -} -inline int seteuid(int) -{ - return true; -} -inline int setgid(int) -{ - return true; -} -inline int setuid(int) -{ - return true; -} -inline int getgid(void) -{ - return 0; -} -inline int getuid(void) -{ - return 0; -} -inline int geteuid(void) -{ - return 0; -} - #ifndef PATH_MAX #define PATH_MAX MAX_PATH #endif -// MinGW provides a getopt implementation -#ifndef __MINGW32__ -#include "getopt.h" -#endif // !__MINGW32__ - #define timespec timeval //win32 deals in usec not nsec - so need to ensure this follows through #define tv_nsec tv_usec -#ifndef __MINGW32__ - typedef int socklen_t; -#endif - #define S_IRGRP S_IWRITE #define S_IWGRP S_IREAD #define S_IROTH S_IWRITE | S_IREAD @@ -207,30 +115,9 @@ #error You must not include the MinGW dirent.h! #endif -struct dirent -{ - char *d_name; - unsigned long d_type; -}; - -struct DIR -{ - intptr_t fd; // filedescriptor - // struct _finddata_t info; - struct _wfinddata_t info; - // struct _finddata_t info; - struct dirent result; // d_name (first time null) - wchar_t *name; // null-terminated byte string -}; - -DIR *opendir(const char *name); -struct dirent *readdir(DIR *dp); -int closedir(DIR *dp); - // local constant to open file exclusively without shared access #define O_LOCK 0x10000 -extern DWORD winerrno; /* used to report errors from openfile() */ HANDLE openfile(const char *filename, int flags, int mode); inline int closefile(HANDLE handle) { @@ -242,165 +129,29 @@ return 0; } -#define LOG_DEBUG LOG_INFO -#define LOG_INFO 6 -#define LOG_NOTICE LOG_INFO -#define LOG_WARNING 4 -#define LOG_ERR 3 -#define LOG_CRIT LOG_ERR -#define LOG_PID 0 -#define LOG_LOCAL5 0 -#define LOG_LOCAL6 0 -void openlog (const char * daemonName, int, int); -void closelog(void); -void syslog (int loglevel, const char *fmt, ...); - -#define LOG_LOCAL0 0 -#define LOG_LOCAL1 0 -#define LOG_LOCAL2 0 -#define LOG_LOCAL3 0 -#define LOG_LOCAL4 0 -#define LOG_LOCAL5 0 -#define LOG_LOCAL6 0 -#define LOG_DAEMON 0 - #ifndef __MINGW32__ #define strtoll _strtoi64 #endif -inline unsigned int sleep(unsigned int secs) -{ - Sleep(secs*1000); - return(ERROR_SUCCESS); -} -#define INFTIM -1 -#if(_WIN32_WINNT < 0x0600) -#define POLLIN 0x1 -#define POLLERR 0x8 -#define POLLOUT 0x4 -#endif -#define SHUT_RDWR SD_BOTH -#define SHUT_RD SD_RECEIVE -#define SHUT_WR SD_SEND -#if(_WIN32_WINNT < 0x0600) -struct pollfd -{ - SOCKET fd; - short int events; - short int revents; -}; -#endif -inline int ioctl(SOCKET sock, int flag, int * something) -{ - //indicate success - return 0; -} - -extern "C" inline int getpid() -{ - return (int)GetCurrentProcessId(); -} - -inline int waitpid(pid_t pid, int *status, int) -{ - return 0; -} - -//this shouldn't be needed. -struct statfs -{ - TCHAR f_mntonname[MAX_PATH]; -}; - -struct emu_stat { - int st_dev; - uint64_t st_ino; - DWORD st_mode; - short st_nlink; - short st_uid; - short st_gid; - //_dev_t st_rdev; - uint64_t st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; - -// need this for conversions -time_t ConvertFileTimeToTime_t(FILETIME *fileTime); -bool ConvertTime_tToFileTime(const time_t from, FILETIME *pTo); - -int emu_chdir (const char* pDirName); -int emu_mkdir (const char* pPathName); -int emu_unlink (const char* pFileName); -int emu_fstat (HANDLE file, struct emu_stat* st); -int emu_stat (const char* pName, struct emu_stat* st); -int emu_utimes (const char* pName, const struct timeval[]); -int emu_chmod (const char* pName, mode_t mode); -char* emu_getcwd (char* pBuffer, int BufSize); -int emu_rename (const char* pOldName, const char* pNewName); - -#define chdir(directory) emu_chdir (directory) -#define mkdir(path, mode) emu_mkdir (path) -#define unlink(file) emu_unlink (file) -#define utimes(buffer, times) emu_utimes (buffer, times) -#define chmod(file, mode) emu_chmod (file, mode) -#define getcwd(buffer, size) emu_getcwd (buffer, size) -#define rename(oldname, newname) emu_rename (oldname, newname) - -// Not safe to replace stat/fstat/lstat on mingw at least, as struct stat -// has a 16-bit st_ino and we need a 64-bit one. -// -// #define stat(filename, struct) emu_stat (filename, struct) -// #define lstat(filename, struct) emu_stat (filename, struct) -// #define fstat(handle, struct) emu_fstat (handle, struct) -// -// But lstat doesn't exist on Windows, so we have to provide something: - -#define lstat(filename, struct) stat(filename, struct) - -int statfs(const char * name, struct statfs * s); - -int poll(struct pollfd *ufds, unsigned long nfds, int timeout); - -struct iovec { - void *iov_base; /* Starting address */ - size_t iov_len; /* Number of bytes */ -}; - -int readv (int filedes, const struct iovec *vector, size_t count); -int writev(int filedes, const struct iovec *vector, size_t count); - // The following functions are not emulations, but utilities for other // parts of the code where Windows API is used or windows-specific stuff // is needed, like codepage conversion. bool EnableBackupRights( void ); -bool ConvertEncoding (const std::string& rSource, int sourceCodePage, - std::string& rDest, int destCodePage); -bool ConvertToUtf8 (const std::string& rSource, std::string& rDest, - int sourceCodePage); -bool ConvertFromUtf8 (const std::string& rSource, std::string& rDest, - int destCodePage); -bool ConvertUtf8ToConsole(const std::string& rSource, std::string& rDest); -bool ConvertConsoleToUtf8(const std::string& rSource, std::string& rDest); - // Utility function which returns a default config file name, // based on the path of the current executable. std::string GetDefaultConfigFilePath(const std::string& rName); -// GetErrorMessage() returns a system error message, like strerror() -// but for Windows error codes. -std::string GetErrorMessage(DWORD errorCode); - // console_read() is a replacement for _cgetws which requires a // relatively recent C runtime lib int console_read(char* pBuffer, size_t BufferSize); #endif // !EMU_INCLUDE && WIN32 + +#endif Modified: box/invisnet/vs2010/0.11/lib/win32/getopt.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/getopt.h 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/win32/getopt.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -37,6 +37,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifdef WIN32 +# pragma once +# ifdef __MINGW32__ +# define _GETOPT_H_ +# else + +# endif +#endif + #ifndef _GETOPT_H_ #define _GETOPT_H_ Deleted: box/invisnet/vs2010/0.11/lib/win32/pch.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/pch.cpp 2012-01-19 18:26:04 UTC (rev 3054) +++ box/invisnet/vs2010/0.11/lib/win32/pch.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -1,5 +0,0 @@ -// A file to allow PCH - -#include "Box.h" - -const char *pch = "Windows Pre-Compiled Header"; Added: box/invisnet/vs2010/0.11/lib/win32/poll.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/poll.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/poll.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,100 @@ +#include "Box.h" + + +#if(_WIN32_WINNT < 0x0600) +// -------------------------------------------------------------------------- +// +// Function +// Name: poll +// Purpose: a weak implimentation (just enough for box) +// of the unix poll for winsock2 +// Created: 25th October 2004 +// +// -------------------------------------------------------------------------- +int emu_poll(struct pollfd *ufds, unsigned long nfds, int timeout) throw() +{ + try + { + fd_set readfd; + fd_set writefd; + + FD_ZERO(&readfd); + FD_ZERO(&writefd); + + // struct pollfd *ufdsTmp = ufds; + + timeval timOut; + timeval *tmpptr; + + if (timeout == INFTIM) + tmpptr = NULL; + else + tmpptr = &timOut; + + timOut.tv_sec = timeout / 1000; + timOut.tv_usec = timeout * 1000; + + for (unsigned long i = 0; i < nfds; i++) + { + struct pollfd* ufd = &(ufds[i]); + + if (ufd->events & POLLIN) + { + FD_SET(ufd->fd, &readfd); + } + + if (ufd->events & POLLOUT) + { + FD_SET(ufd->fd, &writefd); + } + + if (ufd->events & ~(POLLIN | POLLOUT)) + { + printf("Unsupported poll bits %d", + ufd->events); + return -1; + } + } + + int nready = select(0, &readfd, &writefd, 0, tmpptr); + + if (nready == SOCKET_ERROR) + { + // int errval = WSAGetLastError(); + + struct pollfd* pufd = ufds; + for (unsigned long i = 0; i < nfds; i++) + { + pufd->revents = POLLERR; + pufd++; + } + return (-1); + } + else if (nready > 0) + { + for (unsigned long i = 0; i < nfds; i++) + { + struct pollfd *ufd = &(ufds[i]); + + if (FD_ISSET(ufd->fd, &readfd)) + { + ufd->revents |= POLLIN; + } + + if (FD_ISSET(ufd->fd, &writefd)) + { + ufd->revents |= POLLOUT; + } + } + } + + return nready; + } + catch (...) + { + printf("Caught poll"); + } + + return -1; +} +#endif Added: box/invisnet/vs2010/0.11/lib/win32/poll.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/poll.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/poll.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,31 @@ +#ifndef EMU_POLL_H +# define EMU_POLL_H + +# ifdef WIN32 +# pragma once + +# define INFTIM -1 + +# if(_WIN32_WINNT >= 0x0600) +# define EMU_POLL ::WSAPoll +# else +# define POLLIN 0x1 +# define POLLERR 0x8 +# define POLLOUT 0x4 + +# define EMU_POLL ::emu_poll + + struct pollfd + { + SOCKET fd; + short int events; + short int revents; + }; + + extern int emu_poll(struct pollfd *ufds, unsigned long nfds, int timeout) throw(); +# endif +# else +# define EMU_POLL ::poll +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/pwd.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/pwd.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/pwd.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,11 @@ +#include "Box.h" + + +struct passwd * getpwnam(const char * name) throw() +{ + //for the mo pretend to be root + gTempPasswd.pw_uid = 0; + gTempPasswd.pw_gid = 0; + + return &gTempPasswd; +} Added: box/invisnet/vs2010/0.11/lib/win32/pwd.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/pwd.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/pwd.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,18 @@ +#pragma once + +#ifdef WIN32 + struct passwd { + char *pw_name; + char *pw_passwd; + int pw_uid; + int pw_gid; + time_t pw_change; + char *pw_class; + char *pw_gecos; + char *pw_dir; + char *pw_shell; + time_t pw_expire; + }; + + extern struct passwd * getpwnam(const char * name) throw(); +#endif Added: box/invisnet/vs2010/0.11/lib/win32/unistd.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/unistd.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/unistd.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,163 @@ +#include "Box.h" + + +using namespace Win32; + + +int chown(const char * Filename, uint32_t uid, uint32_t gid) throw() +{ + //important - this needs implementing + //If a large restore is required then + //it needs to restore files AND permissions + //reference AdjustTokenPrivileges + //GetAccountSid + //InitializeSecurityDescriptor + //SetSecurityDescriptorOwner + //The next function looks like the guy to use... + //SetFileSecurity + + //indicate success + return 0; +} + + +// Windows and Unix owners and groups are pretty fundamentally different. +// Ben prefers that we kludge here rather than litter the code with #ifdefs. +// Pretend to be root, and pretend that set...() operations succeed. +int setegid(int) throw() +{ + return true; +} +int seteuid(int) throw() +{ + return true; +} +int setgid(int) throw() +{ + return true; +} +int setuid(int) throw() +{ + return true; +} +int getgid(void) throw() +{ + return 0; +} +int getuid(void) throw() +{ + return 0; +} +int geteuid(void) throw() +{ + return 0; +} + +unsigned int sleep(unsigned int secs) throw() +{ + Sleep(secs*1000); + return(ERROR_SUCCESS); +} + + + +int emu_chdir(const char* pDirName) throw() +{ + try + { + std::string multiDir = ConvertPathToAbsoluteUnicode(pDirName); + std::wstring wideDir = multi2wide(multiDir); + + if (!SetCurrentDirectoryW(wideDir.c_str())) + throw Win32Exception(Win32Exception::API_SetCurrentDirectory, pDirName); + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} + +int emu_unlink(const char* pFileName) +{ + try + { + std::string multiPath = ConvertPathToAbsoluteUnicode(pFileName); + std::wstring widePath = multi2wide(multiPath); + + if (!DeleteFileW(widePath.c_str())) + throw Win32Exception(Win32Exception::API_DeleteFile, pFileName); + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} + +// -------------------------------------------------------------------------- +// +// Function +// Name: emu_chmod +// Purpose: replacement for the POSIX chmod function, +// works with unicode filenames supplied in utf8 format +// Created: 26th July 2006 +// +// -------------------------------------------------------------------------- +int emu_chmod(const char * pName, mode_t mode) +{ + try + { + std::string multiPath = ConvertPathToAbsoluteUnicode(pName); + std::wstring widePath = multi2wide(multiPath); + + DWORD attribs; + + if (INVALID_FILE_ATTRIBUTES == (attribs = GetFileAttributesW(widePath.c_str()))) + throw Win32Exception(Win32Exception::API_GetFileAttributes, pName); + + if (mode & S_IWRITE) + { + attribs &= ~FILE_ATTRIBUTE_READONLY; + } + else + { + attribs |= FILE_ATTRIBUTE_READONLY; + } + + if (!SetFileAttributesW(widePath.c_str(), attribs)) + throw Win32Exception(Win32Exception::API_SetFileAttributes); + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} + +char* emu_getcwd(char* pBuffer, size_t BufSize) +{ + try + { + std::string curDir = GetCurrentDirectory(); + + if (curDir.size() >= BufSize) { + errno = ENAMETOOLONG; + } else { + return strcpy(pBuffer, curDir.c_str()); + } + } + EMU_EXCEPTION_HANDLING_RETURN(NULL) +} + +int emu_rename(const char* pOldFileName, const char* pNewFileName) +{ + try + { + std::string oldMultiPath = ConvertPathToAbsoluteUnicode(pOldFileName); + std::wstring oldWidePath = multi2wide(oldMultiPath); + std::string newMultiPath = ConvertPathToAbsoluteUnicode(pNewFileName); + std::wstring newWidePath = multi2wide(newMultiPath); + + if (!MoveFileW(oldWidePath.c_str(), newWidePath.c_str())) + throw Win32Exception(Win32Exception::API_MoveFile); + + return 0; + } + EMU_EXCEPTION_HANDLING_RETURN(-1) +} + Added: box/invisnet/vs2010/0.11/lib/win32/unistd.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/unistd.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/unistd.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,33 @@ +#ifndef EMU_UNISTD_H +# define EMU_UNISTD_H + +# ifdef WIN32 +# pragma once +# ifndef _SSIZE_T_DEFINED +# ifdef _WIN64 + typedef __int64 ssize_t; +# else + typedef __int32 ssize_t; +# endif +# define _SSIZE_T_DEFINED +# endif + + + typedef unsigned int mode_t; + typedef unsigned int pid_t; + + extern int chown(const char * Filename, uint32_t uid, uint32_t gid) throw(); + + extern int setegid(int) throw(); + extern int seteuid(int) throw(); + extern int setgid(int) throw(); + extern int setuid(int) throw(); + extern int getgid(void) throw(); + extern int getuid(void) throw(); + extern int geteuid(void) throw(); + + extern unsigned int sleep(unsigned int secs) throw(); + +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/win32.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/win32.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/win32.cpp 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,269 @@ +#include "Box.h" + + +namespace BoxBackup +{ + namespace Win32 + { + void wide2multi(const std::wstring& wide, std::string& multi, const UINT CodePage) throw(Win32Exception) + { + int len = WideCharToMultiByte(CodePage,0,wide.c_str(),static_cast(wide.size()+1),NULL,0,NULL,NULL); + if (0 == len) + throw Win32Exception(Win32Exception::API_WideCharToMultiByte); + std::unique_ptr buf(new char[len]); + if (0 == WideCharToMultiByte(CodePage,0,wide.c_str(),static_cast(wide.size()+1),buf.get(),len,NULL,NULL)) + throw Win32Exception(Win32Exception::API_WideCharToMultiByte); + multi.assign(buf.get()); + } + + std::string wide2multi(const std::wstring& wide, const UINT CodePage) throw(Win32Exception) + { + std::string multi; + wide2multi(wide,multi,CodePage); + return multi; + } + + void multi2wide(const std::string& multi, std::wstring& wide, const UINT CodePage) throw(Win32Exception) + { + int len = MultiByteToWideChar(CodePage,0,multi.c_str(),static_cast(multi.size()+1),NULL,0); + if (0 == len) + throw Win32Exception(Win32Exception::API_MultiByteToWideChar); + std::unique_ptr buf(new wchar_t[len]); + if (0 == MultiByteToWideChar(CodePage,0,multi.c_str(),static_cast(multi.size()+1),buf.get(),len)) + throw Win32Exception(Win32Exception::API_MultiByteToWideChar); + wide = buf.get(); + } + + std::wstring multi2wide(const std::string& multi, const UINT CodePage) throw(Win32Exception) + { + std::wstring wide; + multi2wide(multi,wide,CodePage); + return wide; + } + + std::string GetCurrentDirectory() throw(Win32Exception) + { + DWORD len = GetCurrentDirectoryW(0, NULL); + if (0 == len) + throw Win32Exception(Win32Exception::API_GetCurrentDirectory); + std::unique_ptr wide(new wchar_t[len]); + if (0 == GetCurrentDirectoryW(len, wide.get())) + throw Win32Exception(Win32Exception::API_GetCurrentDirectory); + return wide2multi(wide.get()); + } + + std::string GetErrorMessage(DWORD errorCode) throw() + { + char* pMsgBuf = NULL; + + DWORD chars = FormatMessage + ( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (char *)(&pMsgBuf), + 0, NULL + ); + + if (chars == 0 || pMsgBuf == NULL) + { + return std::string("failed to get error message"); + } + + // remove embedded newline + pMsgBuf[chars - 1] = 0; + pMsgBuf[chars - 2] = 0; + + std::ostringstream line; + line << pMsgBuf << " (" << errorCode << ")"; + LocalFree(pMsgBuf); + + return line.str(); + } + + // -------------------------------------------------------------------------- + // + // Function + // Name: ConvertPathToAbsoluteUnicode + // Purpose: Converts relative paths to absolute (with unicode marker) + // Created: 4th February 2006 + // + // -------------------------------------------------------------------------- + std::string ConvertPathToAbsoluteUnicode(const char *pFileName) throw(Win32Exception) + { + std::string filename; + for (int i = 0; pFileName[i] != 0; i++) + { + if (pFileName[i] == '/') + { + filename += '\\'; + } + else + { + filename += pFileName[i]; + } + } + + std::string tmpStr("\\\\?\\"); + + // Is the path relative or absolute? + // Absolute paths on Windows are always a drive letter + // followed by ':' + + if (filename.length() > 2 && filename[0] == '\\' && + filename[1] == '\\') + { + tmpStr += "UNC\\"; + filename.replace(0, 2, ""); + // \\?\UNC\\ + // see http://msdn2.microsoft.com/en-us/library/aa365247.aspx + } + else if (filename.length() >= 1 && filename[0] == '\\') + { + // root directory of current drive. + tmpStr = GetCurrentDirectory(); + tmpStr.resize(2); // drive letter and colon + } + else if (filename.length() >= 2 && filename[1] != ':') + { + // Must be relative. We need to get the + // current directory to make it absolute. + tmpStr += GetCurrentDirectory(); + if (tmpStr[tmpStr.length()] != '\\') + { + tmpStr += '\\'; + } + } + + tmpStr += filename; + + // We are using direct filename access, which does not support .., + // so we need to implement it ourselves. + + for (std::string::size_type i = 1; i < tmpStr.size() - 3; i++) + { + if (tmpStr.substr(i, 3) == "\\..") + { + std::string::size_type lastSlash = + tmpStr.rfind('\\', i - 1); + + if (lastSlash == std::string::npos) + { + // no previous directory, ignore it, + // CreateFile will fail with error 123 + } + else + { + tmpStr.replace(lastSlash, i + 3 - lastSlash, + ""); + } + + i = lastSlash; + } + } + + return tmpStr; + } + + // -------------------------------------------------------------------------- + // + // Function + // Name: OpenFileByNameUtf8 + // Purpose: Converts filename to Unicode and returns + // a handle to it. In case of error, sets errno, + // logs the error and returns NULL. + // Created: 10th December 2004 + // + // -------------------------------------------------------------------------- + HANDLE OpenFileByNameUtf8(const char* pFileName, DWORD flags) throw(Win32Exception) + { + std::string multiPath = ConvertPathToAbsoluteUnicode(pFileName); + std::wstring widePath = multi2wide(multiPath); + + HANDLE hFile; + + if (INVALID_HANDLE_VALUE == (hFile = CreateFileW(widePath.c_str(), + flags, + FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL))) + { + // if our open fails we should always be able to + // open in this mode - to get the inode information + // at least one process must have the file open - + // in this case someone else does. + if (INVALID_HANDLE_VALUE == (hFile = CreateFileW(widePath.c_str(), + READ_CONTROL, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL))) + { + throw Win32Exception(Win32Exception::API_CreateFile, pFileName); + } + } + + return hFile; + } + + + bool EnableBackupRights() + { + HANDLE hToken; + TOKEN_PRIVILEGES token_priv; + + //open current process to adjust privileges + if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, + &hToken)) + { + BOX_LOG_WIN_ERROR("Failed to open process token"); + return false; + } + + //let's build the token privilege struct - + //first, look up the LUID for the backup privilege + + if (!LookupPrivilegeValue( + NULL, //this system + SE_BACKUP_NAME, //the name of the privilege + &( token_priv.Privileges[0].Luid ))) //result + { + BOX_LOG_WIN_ERROR("Failed to lookup backup privilege"); + CloseHandle(hToken); + return false; + } + + token_priv.PrivilegeCount = 1; + token_priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + // now set the privilege + // because we're going exit right after dumping the streams, there isn't + // any need to save current state + + if (!AdjustTokenPrivileges( + hToken, //our process token + false, //we're not disabling everything + &token_priv, //address of structure + sizeof(token_priv), //size of structure + NULL, NULL)) //don't save current state + { + //this function is a little tricky - if we were adjusting + //more than one privilege, it could return success but not + //adjust them all - in the general case, you need to trap this + BOX_LOG_WIN_ERROR("Failed to enable backup privilege"); + CloseHandle(hToken); + return false; + + } + + CloseHandle(hToken); + return true; + } + + } +} \ No newline at end of file Added: box/invisnet/vs2010/0.11/lib/win32/win32.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/win32.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/win32.h 2012-01-19 18:27:44 UTC (rev 3055) @@ -0,0 +1,58 @@ +#pragma once + +#ifdef WIN32 +# ifdef _MSC_VER + +# elif defined __MINGW32__ + +# ifndef __MSVCRT_VERSION__ +# define __MSVCRT_VERSION__ 0x0601 +# endif + +# endif + +# define WIN32_LEAN_AND_MEAN +# define NOMINMAX +# include +# include +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include + +# include "Win32Exception.h" + + + namespace BoxBackup + { + namespace Win32 + { + extern void wide2multi(const std::wstring& wide, std::string& multi, const UINT CodePage = CP_UTF8); + extern std::string wide2multi(const std::wstring& wide, const UINT CodePage = CP_UTF8); + extern void multi2wide(const std::string& multi, std::wstring& wide, const UINT CodePage = CP_UTF8); + extern std::wstring multi2wide(const std::string& multi, const UINT CodePage = CP_UTF8); + + extern std::string GetCurrentDirectory(); + extern std::string GetErrorMessage(DWORD errorCode); + + extern std::string ConvertPathToAbsoluteUnicode(const char *pFileName) throw(Win32Exception); + extern HANDLE OpenFileByNameUtf8(const char* pFileName, DWORD flags) throw(Win32Exception); + + extern bool EnableBackupRights(); + } + } + +#endif From subversion at boxbackup.org Thu Jan 19 18:28:55 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 18:28:55 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3056 - in box/invisnet/vs2010/0.11: . infrastructure/msvc/2010/install infrastructure/msvc/2010/install/custom infrastructure/msvc/2010/install/setup Message-ID: <20120119182855.3B27E1A3492@www.boxbackup.org> Author: invisnet Date: 2012-01-19 18:28:55 +0000 (Thu, 19 Jan 2012) New Revision: 3056 Added: box/invisnet/vs2010/0.11/LICENSE-DUAL.rtf box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.rc box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/Product.wxs box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/setup.wixproj Log: WiX setup project Added: box/invisnet/vs2010/0.11/LICENSE-DUAL.rtf =================================================================== --- box/invisnet/vs2010/0.11/LICENSE-DUAL.rtf (rev 0) +++ box/invisnet/vs2010/0.11/LICENSE-DUAL.rtf 2012-01-19 18:28:55 UTC (rev 3056) @@ -0,0 +1,35 @@ +{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 Calibri;}} +{\colortbl ;\red0\green0\blue255;} +{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\sl240\slmult1\lang9\f0\fs22 Box Backup, {\field{\*\fldinst{HYPERLINK "http://www.boxbackup.org/"}}{\fldrslt{\ul\cf1 http://www.boxbackup.org/}}}\f0\fs22\par +\par +Copyright (c) 2003-2010, Ben Summers and contributors.\par +All rights reserved.\par +\par +\pard\sl240\slmult1\qj Note that this project uses mixed licensing. Any file with this license attached, or where the code LICENSE-DUAL appears on the first line, falls under this license. See the file COPYING.txt for more information.\par +\pard\sl240\slmult1\par +\pard\sl240\slmult1\qj This file is dual licensed. You may use and distribute it providing that you comply EITHER with the terms of the BSD license, OR the GPL license. It is not necessary to comply with both licenses, only one.\par +\pard\sl240\slmult1\par +The BSD license option follows:\par +\par +\pard\sl240\slmult1\qj Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\par +\pard\sl240\slmult1\par +\pard{\pntext\f0 1.\tab}{\*\pn\pnlvlbody\pnf0\pnindent0\pnstart1\pndec{\pntxta.}} +\fi-358\li721\sa200\sl240\slmult1\qj Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\par +{\pntext\f0 2.\tab}Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\par +{\pntext\f0 3.\tab}Neither the name of the Box Backup nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\par +\pard\sl240\slmult1\par +\pard\sl240\slmult1\qj THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par +\pard\sl240\slmult1\par +[{\field{\*\fldinst{HYPERLINK "http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22New_BSD_License.22.29"}}{\fldrslt{\ul\cf1 http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22New_BSD_License.22.29}}}\f0\fs22 ]\par +\par +The GPL license option follows:\par +\par +\pard\sl240\slmult1\qj This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\par +\pard\sl240\slmult1\par +\pard\sl240\slmult1\qj This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\par +\pard\sl240\slmult1\par +\pard\sl240\slmult1\qj You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\par +\pard\sl240\slmult1\par +[{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC4"}}{\fldrslt{\ul\cf1 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC4}}}\f0\fs22 ]\par +} + \ No newline at end of file Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.rc =================================================================== (Binary files differ) Property changes on: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/custom.rc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/Product.wxs =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/Product.wxs (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/Product.wxs 2012-01-19 18:28:55 UTC (rev 3056) @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + BoxBackup server name + 0 + test at example.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Installed OR WIX_UPGRADE_DETECTED + + + + + + + + + + + + + + + + + + LicenseAccepted = "1" + LicenseAccepted = "1" AND WIX_UPGRADE_DETECTED = "" + 1 + 1 + WIX_UPGRADE_DETECTED = "" + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/setup.wixproj =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/setup.wixproj (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/setup.wixproj 2012-01-19 18:28:55 UTC (rev 3056) @@ -0,0 +1,113 @@ +? + + + Debug + x86 + 3.5 + {a5d16dce-9eda-4da8-b388-7dc203b6b074} + 2.0 + BoxBackup + Package + $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\x86\install\$(ProjectName)\ + Debug + + + $(SolutionDir)..\..\..\$(Configuration)\$(PlatformShortName)\ + $(SolutionDir)..\..\..\$(Configuration)\x86\install\$(ProjectName)\ + + + Debug + $(SolutionDir)..\..\..\$(Configuration)\amd64\ + $(SolutionDir)..\..\..\$(Configuration)\amd64\install\$(ProjectName)\ + + + $(SolutionDir)..\..\..\$(Configuration)\amd64\ + $(SolutionDir)..\..\..\$(Configuration)\amd64\install\$(ProjectName)\ + + + + + + + bbackupclient + {dcef045d-507c-4137-b11a-c76c4b94dfba} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + bbackupctl + {682f676c-50f5-45af-85fa-c23e344583fc} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + bbackupd + {1e2bcee2-be5b-4366-bad5-4dd50d494fd7} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + bbackupquery + {719d334e-6432-4005-9aeb-5763c23be75b} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + bbutil + {d84ac0c6-6e7d-44aa-a37a-bbc1a599bab3} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + custom + {b43efcbe-06e0-46c4-9502-1d06b713eb57} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + + + $(WixExtDir)\WixUtilExtension.dll + WixUtilExtension + + + $(WixExtDir)\WixUIExtension.dll + WixUIExtension + + + + + + + + + + + + + + \ No newline at end of file From subversion at boxbackup.org Thu Jan 19 19:00:05 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 19:00:05 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3057 - in box/invisnet/vs2010/0.11: infrastructure/msvc/2010 infrastructure/msvc/2010/install/custom infrastructure/msvc/2010/install/setup lib/win32/_sys Message-ID: <20120119190005.393B21A3532@www.boxbackup.org> Author: invisnet Date: 2012-01-19 19:00:04 +0000 (Thu, 19 Jan 2012) New Revision: 3057 Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.cpp box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.def box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/FetchServerCert.cpp box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateCSR.cpp box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateKeyFile.cpp box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/resource.h box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.cpp box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.h box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/targetver.h box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/bblogo.bmp box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/bbsplash.bmp box/invisnet/vs2010/0.11/lib/win32/_sys/socket.h box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.cpp box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.h Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln Log: Add missing files Modified: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln 2012-01-19 18:28:55 UTC (rev 3056) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/boxbackup.sln 2012-01-19 19:00:04 UTC (rev 3057) @@ -21,10 +21,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "crypt", "crypt", "{F6273D56-81D4-4D75-BD47-0EAFDE030BCD}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "pcre\libpcre\libpcre.vcxproj", "{2615F432-7C7A-4B34-BC9A-D0E58ED8E90F}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcretest", "pcre\pcretest\pcretest.vcxproj", "{03734708-A8DD-4F61-A1CE-FDCB32079E9A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzlib", "zlib\libzlib\libzlib.vcxproj", "{80E019FF-948A-44C1-B422-2D9E540F9FF1}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "zlib\example\example.vcxproj", "{B3B4FE6B-5065-46C4-8664-847F51CC7B7C}" EndProject @@ -35,14 +41,26 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupd", "boxbackup\bbackupd\bbackupd.vcxproj", "{1E2BCEE2-BE5B-4366-BAD5-4DD50D494FD7}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "build", "build\build.vcxproj", "{DCDD2786-23D3-44DB-9509-864DC01DB661}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupquery", "boxbackup\bbackupquery\bbackupquery.vcxproj", "{719D334E-6432-4005-9AEB-5763C23BE75B}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupctl", "boxbackup\bbackupctl\bbackupctl.vcxproj", "{682F676C-50F5-45AF-85FA-C23E344583FC}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "setup", "install\setup\setup.wixproj", "{A5D16DCE-9EDA-4DA8-B388-7DC203B6B074}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom", "install\custom\custom.vcxproj", "{B43EFCBE-06E0-46C4-9502-1D06B713EB57}" ProjectSection(ProjectDependencies) = postProject @@ -53,8 +71,14 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libeay", "openssl\libeay\libeay.vcxproj", "{FAEDAF88-9894-4F02-B936-B30674DE9192}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libssl", "openssl\libssl\libssl.vcxproj", "{469ACDA3-2237-414C-BABF-D30FFFF2FE6A}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rsa_test", "openssl\rsa_test\rsa_test.vcxproj", "{A67946D1-E644-45E1-931B-DA46177F5263}" EndProject @@ -117,10 +141,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "run openssl tests", "openssl\run\run.vcxproj", "{995B6A5A-9A87-4CD1-A785-FE62E63251EE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbstored", "boxbackup\bbstored\bbstored.vcxproj", "{2F13350C-C902-47B8-8584-8FA2F6C05917}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupclient", "boxbackup\bbackupclient\bbackupclient.vcxproj", "{DCEF045D-507C-4137-B11A-C76C4B94DFBA}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbutil", "boxbackup\bbutil\bbutil.vcxproj", "{D84AC0C6-6E7D-44AA-A37A-BBC1A599BAB3}" + ProjectSection(ProjectDependencies) = postProject + {DCDD2786-23D3-44DB-9509-864DC01DB661} = {DCDD2786-23D3-44DB-9509-864DC01DB661} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.cpp =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.cpp (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.cpp 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,61 @@ +#include "stdafx.h" + + +// DllMain - Initialize and cleanup WiX custom action utils. +extern "C" BOOL WINAPI DllMain( + __in HINSTANCE hInst, + __in ULONG ulReason, + __in LPVOID + ) +{ + switch(ulReason) + { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} + + +HCRYPTPROV GetCryptContext(void) +{ + HCRYPTPROV hCryptProv = NULL; + + // Force creation of a new container + CryptAcquireContext(&hCryptProv,"BoxBackup",NULL,0,CRYPT_DELETEKEYSET); + CryptAcquireContext(&hCryptProv,"BoxBackup",NULL,PROV_RSA_FULL,CRYPT_MACHINE_KEYSET|CRYPT_NEWKEYSET); + + return hCryptProv; +} + + +char* GetCustomActionData(MSIHANDLE hInstall) +{ + DWORD lenValueBuf = 0; + char* valueBuf = NULL; + UINT uiStat = MsiGetProperty(hInstall, "CustomActionData", "", &lenValueBuf); + //cchValueBuf now contains the size of the property's string, without null termination + if (ERROR_MORE_DATA == uiStat) + { + ++lenValueBuf; // add 1 for null termination + valueBuf = new char[lenValueBuf]; + if (valueBuf) + { + uiStat = MsiGetProperty(hInstall, "CustomActionData", valueBuf, &lenValueBuf); + } + } + if (ERROR_SUCCESS != uiStat && valueBuf != NULL) + { + delete[] valueBuf; + valueBuf = NULL; + SetLastError(uiStat); + } + + return valueBuf; +} Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.def =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.def (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/Custom.def 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,6 @@ +LIBRARY "custom" + +EXPORTS + +GenerateCSR +GenerateKeyFile Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/FetchServerCert.cpp =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/FetchServerCert.cpp (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/FetchServerCert.cpp 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,20 @@ +#include "stdafx.h" + + +UINT __stdcall FetchServerCert(MSIHANDLE hInstall) +{ + HRESULT hr; + + if(FAILED(hr = WcaInitialize(hInstall, "FetchServerCert"))) + { + WcaLogError(hr, "Failed to initialize"); + } + else + { + char *HostName = GetCustomActionData(hInstall); + + + } + +} + Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateCSR.cpp =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateCSR.cpp (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateCSR.cpp 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,309 @@ +#include "stdafx.h" + + +static BOOL CheckPrivateKey(HCRYPTPROV hCryptProv) +{ + HCRYPTKEY hKey = NULL; + BOOL rv = FALSE; + + WcaLog(LOGMSG_STANDARD, "Checking keys"); + if (CryptGenKey(hCryptProv,AT_KEYEXCHANGE,0x08000000|CRYPT_EXPORTABLE,&hKey)) + { + rv = CryptDestroyKey(hKey); + } + WcaLog(LOGMSG_STANDARD, "Checked keys"); + + return rv; +} + + +UINT __stdcall GenerateCSR(MSIHANDLE hInstall) +{ + HRESULT hr; + UINT er = ERROR_INSTALL_FAILURE; + DWORD gle; + char ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD lenComputerName = sizeof(ComputerName); + + if(FAILED(hr = WcaInitialize(hInstall, "GenerateCSR"))) + { + WcaLogError(hr, "Failed to initialize"); + } + else + { + DWORD gle; + HKEY hKey; + + if(ERROR_SUCCESS == (gle = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Box Backup",0,KEY_QUERY_VALUE,&hKey))) + { + DWORD data; + DWORD cb = sizeof(DWORD); + + gle = RegQueryValueEx(hKey,"GeneratedCsrOk",NULL,NULL,(BYTE*)&data,&cb); + + RegCloseKey(hKey); + + if(ERROR_SUCCESS == gle && data) + { + return WcaFinalize(ERROR_SUCCESS); + } + } + } + + if(FALSE == GetComputerName(ComputerName,&lenComputerName)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Look out the window - I think the world just ended!"); + } + else + { + DWORD lenInstallLocation = 0, + lenAccountNumber = 0, + lenEmailAddress = 0; + char *InstallLocation, + *AccountNumber, + *EmailAddress, + *next = NULL; + + InstallLocation = GetCustomActionData(hInstall); + + lenInstallLocation = (DWORD)strlen(InstallLocation = strtok_s(InstallLocation,"\n",&next)); + lenAccountNumber = (DWORD)strlen(AccountNumber = strtok_s(NULL,"\n",&next)); + lenEmailAddress = (DWORD)strlen(EmailAddress = strtok_s(NULL,"\n",&next)); + + + if(SUCCEEDED(hr)) + { + HCRYPTPROV hCryptProv; + + WcaLog(LOGMSG_STANDARD, "Initialized."); + WcaLog(LOGMSG_STANDARD, InstallLocation); + WcaLog(LOGMSG_STANDARD, AccountNumber); + WcaLog(LOGMSG_STANDARD, EmailAddress); + + // Get the crypt context - can't do anything without it + if(NULL == (hCryptProv = GetCryptContext())) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to aquire crypt context"); + } + // Make sure we've got a key that's valid for signing + else if(FALSE == CheckPrivateKey(hCryptProv)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to get private key"); + } + else + { + CERT_RDN_ATTR rgNameAttr[] = { { szOID_ORGANIZATION_NAME, CERT_RDN_PRINTABLE_STRING, 0, NULL }, + { szOID_COMMON_NAME, CERT_RDN_PRINTABLE_STRING, 0, NULL }, + { szOID_RSA_emailAddr, CERT_RDN_IA5_STRING, 0, NULL }, + { szOID_ORGANIZATIONAL_UNIT_NAME, CERT_RDN_PRINTABLE_STRING, 0, NULL } }; + CERT_RDN rgRDN[] = { 4, rgNameAttr }; + CERT_NAME_INFO Name = { 1, rgRDN }; + LPSTR pbCSR = NULL; + char CommonName[128]; + DWORD lenCommonName; + + lenCommonName = sprintf_s(CommonName,"BACKUP-%s",AccountNumber); + rgNameAttr[0].Value.cbData = 3; + rgNameAttr[0].Value.pbData = (BYTE*)"n/a"; + rgNameAttr[1].Value.cbData = lenCommonName; + rgNameAttr[1].Value.pbData = (BYTE*)CommonName; + rgNameAttr[2].Value.cbData = lenEmailAddress; + rgNameAttr[2].Value.pbData = (BYTE*)EmailAddress; + rgNameAttr[3].Value.cbData = lenComputerName; + rgNameAttr[3].Value.pbData = (BYTE*)ComputerName; + + WcaLog(LOGMSG_STANDARD, "Encoding CSR"); + + DWORD cbNameEncoded = 0; + + if(FALSE == CryptEncodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, X509_NAME, &Name, NULL, &cbNameEncoded)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to get buffer size to encode object"); + } + else + { + BYTE *pbNameEncoded = new BYTE[cbNameEncoded]; + + if(FALSE == CryptEncodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, X509_NAME, &Name, pbNameEncoded, &cbNameEncoded)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to encode object"); + } + else + { + DWORD cbPublicKeyInfo = 0; + + WcaLog(LOGMSG_STANDARD, "Exporting public key"); + + if(FALSE == CryptExportPublicKeyInfo(hCryptProv, AT_KEYEXCHANGE, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, NULL, &cbPublicKeyInfo)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to get buffer length for public key"); + } + else + { + char *PublicKeyBuffer = new char[cbPublicKeyInfo]; + CERT_PUBLIC_KEY_INFO* pbPublicKeyInfo = (CERT_PUBLIC_KEY_INFO*) PublicKeyBuffer; + + if(FALSE == CryptExportPublicKeyInfo(hCryptProv, AT_KEYEXCHANGE, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, pbPublicKeyInfo, &cbPublicKeyInfo)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to export public key"); + } + else + { + CRYPT_ALGORITHM_IDENTIFIER SigAlg; + SigAlg.pszObjId = szOID_RSA_SHA1RSA; + SigAlg.Parameters.cbData = 0; + + CERT_REQUEST_INFO CertReqInfo; + CertReqInfo.dwVersion = CERT_REQUEST_V1; + CertReqInfo.Subject.cbData = cbNameEncoded; + CertReqInfo.Subject.pbData = pbNameEncoded; + CertReqInfo.SubjectPublicKeyInfo = *pbPublicKeyInfo; + CertReqInfo.cAttribute = 0; + CertReqInfo.rgAttribute = NULL; + + + DWORD cbSignedEncodedCertReqSize = 0; + + WcaLog(LOGMSG_STANDARD, "Signing certificate"); + + if(FALSE == CryptSignAndEncodeCertificate( + hCryptProv, + AT_KEYEXCHANGE, + X509_ASN_ENCODING, + X509_CERT_REQUEST_TO_BE_SIGNED, + &CertReqInfo, + &SigAlg, + NULL, + NULL, + &cbSignedEncodedCertReqSize)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to get buffer size for csr"); + } + else + { + BYTE* pbSignedEncodedCertReq = new BYTE[cbSignedEncodedCertReqSize]; + + if(FALSE == CryptSignAndEncodeCertificate( + hCryptProv, + AT_KEYEXCHANGE, + X509_ASN_ENCODING, + X509_CERT_REQUEST_TO_BE_SIGNED, + &CertReqInfo, + &SigAlg, + NULL, + pbSignedEncodedCertReq, + &cbSignedEncodedCertReqSize)) + { + hr = HRESULT_FROM_WIN32(hr); + WcaLogError(hr, "Failed to sign and encode certificate"); + } + else + { + DWORD cbCSR = 0; + + WcaLog(LOGMSG_STANDARD, "Binary to string"); + + if(FALSE == CryptBinaryToString(pbSignedEncodedCertReq, cbSignedEncodedCertReqSize, CRYPT_STRING_BASE64REQUESTHEADER, NULL, &cbCSR)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to get buffer size for csr string"); + } + else + { + char *pbCSR = new char[cbCSR]; + + if(FALSE == CryptBinaryToString(pbSignedEncodedCertReq, cbSignedEncodedCertReqSize, CRYPT_STRING_BASE64REQUESTHEADER, pbCSR, &cbCSR)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to get csr as string"); + } + else + { + HANDLE hFile; + char filename[MAX_PATH+1]; + + // Woo! We've got everything + + sprintf_s(filename,sizeof(filename),"%s%s-csr.pem",InstallLocation,AccountNumber); + if(INVALID_HANDLE_VALUE == (hFile = CreateFile(filename,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL)) + && ERROR_FILE_EXISTS != (gle = GetLastError())) + { + hr = HRESULT_FROM_WIN32(gle); + WcaLogError(hr, "Can't create CSR file"); + } + else + { + DWORD nWritten; + + if (FALSE == WriteFile(hFile,pbCSR,cbCSR,&nWritten,NULL) + || cbCSR != nWritten) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to write CSR"); + } + else + { + DWORD gle; + HKEY hKey; + + if(ERROR_SUCCESS != (gle = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Box Backup",0,KEY_SET_VALUE,&hKey))) + { + hr = HRESULT_FROM_WIN32(gle); + WcaLogError(hr, "Failed to open registry key"); + } + else + { + DWORD data = 1; + + if(ERROR_SUCCESS != (gle = RegSetValueEx(hKey,"GeneratedCsrOk",0,REG_DWORD,(BYTE*)&data,sizeof(DWORD)))) + { + hr = HRESULT_FROM_WIN32(gle); + WcaLogError(hr, "Failed to set registry value"); + } + + RegCloseKey(hKey); + } + } + + CloseHandle(hFile); + } + + + if(SUCCEEDED(hr)) + { + er = ERROR_SUCCESS; + } + } + + delete[] pbCSR; + } + } + + delete[] pbSignedEncodedCertReq; + } + } + + delete[] PublicKeyBuffer; + } + } + + delete[] pbNameEncoded; + } + } + + CryptReleaseContext(hCryptProv,0); + } + + delete[] InstallLocation; + } + + return WcaFinalize(er); +} Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateKeyFile.cpp =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateKeyFile.cpp (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/GenerateKeyFile.cpp 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,67 @@ +#include "stdafx.h" + + +UINT __stdcall GenerateKeyFile(MSIHANDLE hInstall) +{ + HRESULT hr; + + if(FAILED(hr = WcaInitialize(hInstall, "GenerateKeyFile"))) + { + WcaLogError(hr, "Failed to initialize"); + } + else + { + DWORD err; + HKEY hKey; + + if(ERROR_SUCCESS != (err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Box Backup", 0, KEY_QUERY_VALUE|KEY_SET_VALUE, &hKey))) + { + hr = HRESULT_FROM_WIN32(err); + WcaLogError(hr, "Failed to open registry key"); + } + else + { + // Make sure we don't stomp on an existing key + if(ERROR_SUCCESS == (err = RegQueryValueEx(hKey, "FileEncKeys", NULL, NULL, NULL, NULL))) + { + hr = HRESULT_FROM_WIN32(err); + } + else + { + HCRYPTPROV hCryptProv; + + if(!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Failed to aquire crypt context"); + } + else + { + BYTE RandomData[BACKUPCRYPTOKEYS_FILE_SIZE]; + + if(!CryptGenRandom(hCryptProv, BACKUPCRYPTOKEYS_FILE_SIZE, RandomData)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + WcaLogError(hr, "Can't get random data"); + } + else + { + if(ERROR_SUCCESS != (err = RegSetValueEx(hKey, "FileEncKeys", 0, REG_BINARY, RandomData, BACKUPCRYPTOKEYS_FILE_SIZE))) + { + hr = HRESULT_FROM_WIN32(err); + WcaLogError(hr, "Failed to set registry value"); + } + + SecureZeroMemory(RandomData, BACKUPCRYPTOKEYS_FILE_SIZE); + } + + CryptReleaseContext(hCryptProv, 0); + } + } + + RegCloseKey(hKey); + } + } + + return WcaFinalize( (SUCCEEDED(hr)) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE ); +} Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/resource.h =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/resource.h (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/resource.h 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by custom.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.cpp =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.cpp (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.cpp 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// custom.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.h =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.h (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/stdafx.h 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,28 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include +#include +#include + +// WiX Header Files: +#include + + +// TODO: reference additional headers your program requires here +#include + + +#include "BackupClientCryptoKeys.h" + + +extern HCRYPTPROV GetCryptContext(void); +extern char* GetCustomActionData(MSIHANDLE hInstall); Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/targetver.h =================================================================== --- box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/targetver.h (rev 0) +++ box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/custom/targetver.h 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,24 @@ +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows XP/2003. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows XP/2003. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 5.0. +#define _WIN32_IE 0x0500 // Change this to the appropriate value to target other versions of IE. +#endif + +#ifndef _WIN32_MSI // Specifies that the minimum required MSI version is MSI 3.1 +#define _WIN32_MSI 310 // Change this to the appropriate value to target other versions of MSI. +#endif Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/bblogo.bmp =================================================================== (Binary files differ) Property changes on: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/bblogo.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/bbsplash.bmp =================================================================== (Binary files differ) Property changes on: box/invisnet/vs2010/0.11/infrastructure/msvc/2010/install/setup/bbsplash.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: box/invisnet/vs2010/0.11/lib/win32/_sys/socket.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/socket.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/socket.h 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,12 @@ +#ifndef EMU_SYS_SOCKET_H +# define EMU_SYS_SOCKET_H + +# ifdef WIN32 +# pragma once + +# define SHUT_RDWR SD_BOTH +# define SHUT_RD SD_RECEIVE +# define SHUT_WR SD_SEND +# endif + +#endif Added: box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.cpp =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.cpp (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.cpp 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,268 @@ +#include "Box.h" + +#include "messages.h" + + +using namespace Win32; + + +// copied from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/eventlog/base/adding_a_source_to_the_registry.asp + +BOOL AddEventSource +( + const char* pszSrcName, // event source name + DWORD dwNum // number of categories +) +{ + // Work out the executable file name, to register ourselves + // as the event source + + WCHAR cmd[MAX_PATH]; + DWORD len = GetModuleFileNameW(NULL, cmd, MAX_PATH); + + if (len == 0) + { + ::syslog(LOG_ERR, "Failed to get the program file name: %s", + GetErrorMessage(GetLastError()).c_str()); + return FALSE; + } + + // Create the event source as a subkey of the log. + + std::string regkey("SYSTEM\\CurrentControlSet\\Services\\EventLog\\" + "Box Backup\\"); + regkey += pszSrcName; + + HKEY hk; + DWORD dwDisp; + + if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, regkey.c_str(), + 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &hk, &dwDisp)) + { + ::syslog(LOG_ERR, "Failed to create the registry key: %s", + GetErrorMessage(GetLastError()).c_str()); + return FALSE; + } + + // Set the name of the message file. + + if (RegSetValueExW(hk, // subkey handle + L"EventMessageFile", // value name + 0, // must be zero + REG_EXPAND_SZ, // value type + (LPBYTE)cmd, // pointer to value data + len*sizeof(WCHAR))) // data size + { + ::syslog(LOG_ERR, "Failed to set the event message file: %s", + GetErrorMessage(GetLastError()).c_str()); + RegCloseKey(hk); + return FALSE; + } + + // Set the supported event types. + + DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | + EVENTLOG_INFORMATION_TYPE; + + if (RegSetValueEx(hk, // subkey handle + "TypesSupported", // value name + 0, // must be zero + REG_DWORD, // value type + (LPBYTE) &dwData, // pointer to value data + sizeof(DWORD))) // length of value data + { + ::syslog(LOG_ERR, "Failed to set the supported types: %s", + GetErrorMessage(GetLastError()).c_str()); + RegCloseKey(hk); + return FALSE; + } + + // Set the category message file and number of categories. + + if (RegSetValueExW(hk, // subkey handle + L"CategoryMessageFile", // value name + 0, // must be zero + REG_EXPAND_SZ, // value type + (LPBYTE)cmd, // pointer to value data + len*sizeof(WCHAR))) // data size + { + ::syslog(LOG_ERR, "Failed to set the category message file: " + "%s", GetErrorMessage(GetLastError()).c_str()); + RegCloseKey(hk); + return FALSE; + } + + if (RegSetValueEx(hk, // subkey handle + "CategoryCount", // value name + 0, // must be zero + REG_DWORD, // value type + (LPBYTE) &dwNum, // pointer to value data + sizeof(DWORD))) // length of value data + { + ::syslog(LOG_ERR, "Failed to set the category count: %s", + GetErrorMessage(GetLastError()).c_str()); + RegCloseKey(hk); + return FALSE; + } + + RegCloseKey(hk); + return TRUE; +} + + +static HANDLE gSyslogH = 0; +static bool sHaveWarnedEventLogFull = false; + +void openlog(const char * daemonName, int, int) +{ + // register a default event source, so that we can + // log errors with the process of adding or registering our own. + gSyslogH = RegisterEventSource( + NULL, // uses local computer + daemonName); // source name + if (gSyslogH == NULL) + { + } + + BOOL success = AddEventSource(daemonName, 0); + + if (!success) + { + ::syslog(LOG_ERR, "Failed to add our own event source"); + return; + } + + HANDLE newSyslogH = RegisterEventSource(NULL, daemonName); + if (newSyslogH == NULL) + { + ::syslog(LOG_ERR, "Failed to register our own event source: " + "%s", GetErrorMessage(GetLastError()).c_str()); + return; + } + + DeregisterEventSource(gSyslogH); + gSyslogH = newSyslogH; +} + +void closelog(void) +{ + DeregisterEventSource(gSyslogH); +} + +void syslog(int loglevel, const char *frmt, ...) +{ + WORD errinfo; + char buffer[1024]; + std::string sixfour(frmt); + + switch (loglevel) + { + case LOG_INFO: + errinfo = EVENTLOG_INFORMATION_TYPE; + break; + case LOG_ERR: + errinfo = EVENTLOG_ERROR_TYPE; + break; + case LOG_WARNING: + default: + errinfo = EVENTLOG_WARNING_TYPE; + break; + } + + // taken from MSDN + int sixfourpos; + while ( (sixfourpos = (int)sixfour.find("%ll")) != -1 ) + { + // maintain portability - change the 64 bit formater... + std::string temp = sixfour.substr(0,sixfourpos); + temp += "%I64"; + temp += sixfour.substr(sixfourpos+3, sixfour.length()); + sixfour = temp; + } + + // printf("parsed string is:%s\r\n", sixfour.c_str()); + + va_list args; + va_start(args, frmt); + + int len = vsnprintf(buffer, sizeof(buffer)-1, sixfour.c_str(), args); + if (len < 0) + { + printf("%s\r\n", buffer); + fflush(stdout); + return; + } + + buffer[sizeof(buffer)-1] = 0; + + va_end(args); + + if (gSyslogH == 0) + { + printf("%s\r\n", buffer); + fflush(stdout); + return; + } + + std::wstring wide = multi2wide(buffer); + + DWORD result; + +/* if (wide == NULL) + { + std::string buffer2 = buffer; + buffer2 += " (failed to convert string encoding)"; + LPCSTR strings[] = { buffer2.c_str(), NULL }; + + result = ReportEventA(gSyslogH, // event log handle + errinfo, // event type + 0, // category zero + MSG_ERR, // event identifier - + // we will call them all the same + NULL, // no user security identifier + 1, // one substitution string + 0, // no data + strings, // pointer to string array + NULL); // pointer to data + } + else*/ + { + LPCWSTR strings[] = { wide.c_str(), NULL }; + result = ReportEventW(gSyslogH, // event log handle + errinfo, // event type + 0, // category zero + MSG_ERR, // event identifier - + // we will call them all the same + NULL, // no user security identifier + 1, // one substitution string + 0, // no data + strings, // pointer to string array + NULL); // pointer to data + } + + if (result == 0) + { + DWORD err = GetLastError(); + if (err == ERROR_LOG_FILE_FULL) + { + if (!sHaveWarnedEventLogFull) + { + printf("Unable to send message to Event Log " + "(Event Log is full):\r\n"); + fflush(stdout); + sHaveWarnedEventLogFull = TRUE; + } + } + else + { + printf("Unable to send message to Event Log: %s:\r\n", + GetErrorMessage(err).c_str()); + fflush(stdout); + } + } + else + { + sHaveWarnedEventLogFull = false; + } +} Added: box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.h =================================================================== --- box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.h (rev 0) +++ box/invisnet/vs2010/0.11/lib/win32/_sys/syslog.h 2012-01-19 19:00:04 UTC (rev 3057) @@ -0,0 +1,28 @@ +#ifndef EMU_SYS_SYSLOG_H +# define EMU_SYS_SYSLOG_H + +# ifdef WIN32 +# pragma once + +# define LOG_DEBUG LOG_INFO +# define LOG_INFO 6 +# define LOG_NOTICE LOG_INFO +# define LOG_WARNING 4 +# define LOG_ERR 3 +# define LOG_CRIT LOG_ERR +# define LOG_PID 0 +# define LOG_LOCAL0 0 +# define LOG_LOCAL1 0 +# define LOG_LOCAL2 0 +# define LOG_LOCAL3 0 +# define LOG_LOCAL4 0 +# define LOG_LOCAL5 0 +# define LOG_LOCAL6 0 +# define LOG_DAEMON 0 + + extern void openlog (const char * daemonName, int, int) throw(); + extern void closelog(void) throw(); + extern void syslog (int loglevel, const char *fmt, ...) throw(); +# endif + +#endif From subversion at boxbackup.org Thu Jan 19 20:44:46 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Thu, 19 Jan 2012 20:44:46 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3058 - box/invisnet/vs2010 Message-ID: <20120119204446.592B51A36E1@www.boxbackup.org> Author: invisnet Date: 2012-01-19 20:44:45 +0000 (Thu, 19 Jan 2012) New Revision: 3058 Added: box/invisnet/vs2010/merge/ Log: From subversion at boxbackup.org Sun Jan 22 16:17:36 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:17:36 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3059 - box/trunk/lib/server Message-ID: <20120122161736.CF9061A3466@www.boxbackup.org> Author: chris Date: 2012-01-22 16:17:36 +0000 (Sun, 22 Jan 2012) New Revision: 3059 Modified: box/trunk/lib/server/Daemon.cpp box/trunk/lib/server/Daemon.h Log: Split option processing out of Daemon::Main() to ease use of Daemon class in tests. Modified: box/trunk/lib/server/Daemon.cpp =================================================================== --- box/trunk/lib/server/Daemon.cpp 2012-01-19 20:44:45 UTC (rev 3058) +++ box/trunk/lib/server/Daemon.cpp 2012-01-22 16:17:36 UTC (rev 3059) @@ -329,10 +329,32 @@ mConfigFileName = rDefaultConfigFile; mAppName = argv[0]; + int ret = ProcessOptions(argc, argv); + if (ret != 0) + { + return ret; + } + + return Main(mConfigFileName); +} + +// -------------------------------------------------------------------------- +// +// Function +// Name: Daemon::ProcessOptions(int argc, const char *argv[]) +// Purpose: Parses command-line options. Useful when you have +// a local Daemon object and don't intend to fork() +// or call Main(). +// Created: 2008/11/04 +// +// -------------------------------------------------------------------------- + +int Daemon::ProcessOptions(int argc, const char *argv[]) +{ #ifdef BOX_RELEASE_BUILD - mLogLevel = Log::NOTICE; // need an int to do math with + mLogLevel = Log::NOTICE; #else - mLogLevel = Log::INFO; // need an int to do math with + mLogLevel = Log::INFO; #endif if (argc == 2 && strcmp(argv[1], "/?") == 0) @@ -393,7 +415,7 @@ new FileLogger(mLogFile, mLogFileLevel)); } - return Main(mConfigFileName); + return 0; } // -------------------------------------------------------------------------- Modified: box/trunk/lib/server/Daemon.h =================================================================== --- box/trunk/lib/server/Daemon.h 2012-01-19 20:44:45 UTC (rev 3058) +++ box/trunk/lib/server/Daemon.h 2012-01-22 16:17:36 UTC (rev 3059) @@ -42,6 +42,7 @@ virtual int Main(const std::string& rDefaultConfigFile, int argc, const char *argv[]); + virtual int ProcessOptions(int argc, const char *argv[]); /* override this Main() if you want custom option processing: */ virtual int Main(const std::string &rConfigFile); From subversion at boxbackup.org Sun Jan 22 16:19:20 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:19:20 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3060 - box/trunk/lib/common Message-ID: <20120122161920.2E7611A3485@www.boxbackup.org> Author: chris Date: 2012-01-22 16:19:19 +0000 (Sun, 22 Jan 2012) New Revision: 3060 Modified: box/trunk/lib/common/Test.h Log: Log disabling of exception logging to help understand test output. Allow std::ostringstream formatting in expected/actual output comparison. Modified: box/trunk/lib/common/Test.h =================================================================== --- box/trunk/lib/common/Test.h 2012-01-22 16:17:36 UTC (rev 3059) +++ box/trunk/lib/common/Test.h 2012-01-22 16:19:19 UTC (rev 3060) @@ -55,6 +55,8 @@ { \ bool didthrow = false; \ HideExceptionMessageGuard hide; \ + BOX_TRACE("Exception logging disabled at " __FILE__ ":" \ + << __LINE__); \ try \ { \ statement; \ @@ -91,8 +93,8 @@ \ if(_exp_str != _found_str) \ { \ - printf("Expected <%s> but found <%s>\n", \ - _exp_str.c_str(), _found_str.c_str()); \ + BOX_ERROR("Expected <" << _exp_str << "> but found <" << \ + _found_str << ">"); \ \ std::ostringstream _oss3; \ _oss3 << #_found << " != " << #_expected; \ From subversion at boxbackup.org Sun Jan 22 16:20:06 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:20:06 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3061 - box/trunk/lib/common Message-ID: <20120122162006.F12F21A34A4@www.boxbackup.org> Author: chris Date: 2012-01-22 16:20:06 +0000 (Sun, 22 Jan 2012) New Revision: 3061 Modified: box/trunk/lib/common/Box.h Log: Allow log level "everything" to log exceptions even if suppressed. Modified: box/trunk/lib/common/Box.h =================================================================== --- box/trunk/lib/common/Box.h 2012-01-22 16:19:19 UTC (rev 3060) +++ box/trunk/lib/common/Box.h 2012-01-22 16:20:06 UTC (rev 3061) @@ -103,7 +103,8 @@ #define THROW_EXCEPTION(type, subtype) \ { \ - if(!HideExceptionMessageGuard::ExceptionsHidden()) \ + if(!HideExceptionMessageGuard::ExceptionsHidden() \ + || Logging::IsEnabled(Log::EVERYTHING)) \ { \ OPTIONAL_DO_BACKTRACE \ BOX_WARNING("Exception thrown: " \ From subversion at boxbackup.org Sun Jan 22 16:20:43 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:20:43 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3062 - box/trunk/lib/common Message-ID: <20120122162043.843F51A34C4@www.boxbackup.org> Author: chris Date: 2012-01-22 16:20:43 +0000 (Sun, 22 Jan 2012) New Revision: 3062 Modified: box/trunk/lib/common/BoxException.h Log: Allow getting the message out of a BoxException. Modified: box/trunk/lib/common/BoxException.h =================================================================== --- box/trunk/lib/common/BoxException.h 2012-01-22 16:20:06 UTC (rev 3061) +++ box/trunk/lib/common/BoxException.h 2012-01-22 16:20:43 UTC (rev 3062) @@ -29,6 +29,7 @@ virtual unsigned int GetType() const throw() = 0; virtual unsigned int GetSubType() const throw() = 0; + virtual const std::string& GetMessage() const = 0; private: }; From subversion at boxbackup.org Sun Jan 22 16:22:04 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:22:04 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3063 - box/trunk/lib/common Message-ID: <20120122162204.101F91A34E7@www.boxbackup.org> Author: chris Date: 2012-01-22 16:22:03 +0000 (Sun, 22 Jan 2012) New Revision: 3063 Modified: box/trunk/lib/common/FileModificationTime.cpp box/trunk/lib/common/FileModificationTime.h Log: File modification time helper functions don't need to modify their arguments, so make them const. Modified: box/trunk/lib/common/FileModificationTime.cpp =================================================================== --- box/trunk/lib/common/FileModificationTime.cpp 2012-01-22 16:20:43 UTC (rev 3062) +++ box/trunk/lib/common/FileModificationTime.cpp 2012-01-22 16:22:03 UTC (rev 3063) @@ -16,7 +16,7 @@ #include "MemLeakFindOn.h" -box_time_t FileModificationTime(EMU_STRUCT_STAT &st) +box_time_t FileModificationTime(const EMU_STRUCT_STAT &st) { #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC box_time_t datamodified = ((int64_t)st.st_mtime) * (MICRO_SEC_IN_SEC_LL); @@ -28,7 +28,7 @@ return datamodified; } -box_time_t FileAttrModificationTime(EMU_STRUCT_STAT &st) +box_time_t FileAttrModificationTime(const EMU_STRUCT_STAT &st) { box_time_t statusmodified = #ifdef HAVE_STRUCT_STAT_ST_MTIMESPEC @@ -47,7 +47,7 @@ return statusmodified; } -box_time_t FileModificationTimeMaxModAndAttr(EMU_STRUCT_STAT &st) +box_time_t FileModificationTimeMaxModAndAttr(const EMU_STRUCT_STAT &st) { #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC box_time_t datamodified = ((int64_t)st.st_mtime) * (MICRO_SEC_IN_SEC_LL); Modified: box/trunk/lib/common/FileModificationTime.h =================================================================== --- box/trunk/lib/common/FileModificationTime.h 2012-01-22 16:20:43 UTC (rev 3062) +++ box/trunk/lib/common/FileModificationTime.h 2012-01-22 16:22:03 UTC (rev 3063) @@ -14,9 +14,9 @@ #include "BoxTime.h" -box_time_t FileModificationTime(EMU_STRUCT_STAT &st); -box_time_t FileAttrModificationTime(EMU_STRUCT_STAT &st); -box_time_t FileModificationTimeMaxModAndAttr(EMU_STRUCT_STAT &st); +box_time_t FileModificationTime(const EMU_STRUCT_STAT &st); +box_time_t FileAttrModificationTime(const EMU_STRUCT_STAT &st); +box_time_t FileModificationTimeMaxModAndAttr(const EMU_STRUCT_STAT &st); #endif // FILEMODIFICATIONTIME__H From subversion at boxbackup.org Sun Jan 22 16:26:38 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:26:38 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3064 - box/trunk/lib/common Message-ID: <20120122162638.89B291A3507@www.boxbackup.org> Author: chris Date: 2012-01-22 16:26:38 +0000 (Sun, 22 Jan 2012) New Revision: 3064 Modified: box/trunk/lib/common/Logging.h Log: Remove unnecessary GetNativeErrorMessage(), add BOX_LOG_SOCKET_ERROR macro. Modified: box/trunk/lib/common/Logging.h =================================================================== --- box/trunk/lib/common/Logging.h 2012-01-22 16:22:03 UTC (rev 3063) +++ box/trunk/lib/common/Logging.h 2012-01-22 16:26:38 UTC (rev 3064) @@ -82,18 +82,7 @@ THROW_EXCEPTION_MESSAGE(exception, subtype, \ BOX_FILE_MESSAGE(filename, message)) -inline std::string GetNativeErrorMessage() -{ #ifdef WIN32 - return GetErrorMessage(GetLastError()); -#else - std::ostringstream _box_log_line; - _box_log_line << std::strerror(errno) << " (" << errno << ")"; - return _box_log_line.str(); -#endif -} - -#ifdef WIN32 #define BOX_LOG_WIN_ERROR(stuff) \ BOX_ERROR(stuff << ": " << GetErrorMessage(GetLastError())) #define BOX_LOG_WIN_WARNING(stuff) \ @@ -105,21 +94,30 @@ #define BOX_LOG_NATIVE_ERROR(stuff) BOX_LOG_WIN_ERROR(stuff) #define BOX_LOG_NATIVE_WARNING(stuff) BOX_LOG_WIN_WARNING(stuff) #define BOX_WIN_ERRNO_MESSAGE(error_number, stuff) \ - stuff << ": " << GetErrorMessage(error_number) << " (" << error_number << ")" + stuff << ": " << GetErrorMessage(error_number) #define THROW_WIN_ERROR_NUMBER(message, error_number, exception, subtype) \ THROW_EXCEPTION_MESSAGE(exception, subtype, \ BOX_WIN_ERRNO_MESSAGE(error_number, message)) #define THROW_WIN_FILE_ERRNO(message, filename, error_number, exception, subtype) \ THROW_WIN_ERROR_NUMBER(BOX_FILE_MESSAGE(filename, message), \ error_number, exception, subtype) + #define THROW_WIN_FILE_ERROR(message, filename, exception, subtype) \ + THROW_WIN_FILE_ERRNO(message, filename, GetLastError(), \ + exception, subtype) #else #define BOX_LOG_NATIVE_ERROR(stuff) BOX_LOG_SYS_ERROR(stuff) #define BOX_LOG_NATIVE_WARNING(stuff) BOX_LOG_SYS_WARNING(stuff) #endif -#define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ +#ifdef WIN32 +# define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ + BOX_LOG_WIN_ERROR_NUMBER(stuff << " (type " << _type << ", name " << \ + _name << ", port " << _port << ")", WSAGetLastError()) +#else +# define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ BOX_LOG_NATIVE_ERROR(stuff << " (type " << _type << ", name " << \ _name << ", port " << _port << ")") +#endif #define BOX_FORMAT_HEX32(number) \ std::hex << \ From subversion at boxbackup.org Sun Jan 22 16:28:01 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:28:01 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3065 - box/trunk/lib/common Message-ID: <20120122162801.6D49D1A3526@www.boxbackup.org> Author: chris Date: 2012-01-22 16:28:01 +0000 (Sun, 22 Jan 2012) New Revision: 3065 Modified: box/trunk/lib/common/FileStream.cpp Log: Log messages on failure to read, write, stat, seek and close files, with the filename. Modified: box/trunk/lib/common/FileStream.cpp =================================================================== --- box/trunk/lib/common/FileStream.cpp 2012-01-22 16:26:38 UTC (rev 3064) +++ box/trunk/lib/common/FileStream.cpp 2012-01-22 16:28:01 UTC (rev 3065) @@ -190,22 +190,23 @@ } else { - BOX_LOG_WIN_ERROR("Failed to read from file: " << mFileName); - r = -1; + THROW_WIN_FILE_ERROR("Failed to read from file", mFileName, + CommonException, OSFileReadError); } + + if(r == -1) + { + THROW_EXCEPTION(CommonException, OSFileReadError) + } #else int r = ::read(mOSFileHandle, pBuffer, NBytes); if(r == -1) { - BOX_LOG_SYS_ERROR("Failed to read from file: " << mFileName); + THROW_SYS_FILE_ERROR("Failed to read from file", mFileName, + CommonException, OSFileReadError); } #endif - if(r == -1) - { - THROW_EXCEPTION(CommonException, OSFileReadError) - } - if(r == 0) { mIsEOF = true; @@ -228,7 +229,7 @@ EMU_STRUCT_STAT st; if(EMU_FSTAT(mOSFileHandle, &st) != 0) { - THROW_EXCEPTION(CommonException, OSFileError) + BOX_LOG_SYS_ERROR(BOX_FILE_MESSAGE("Failed to stat file", mFileName)); } return st.st_size - GetPosition(); @@ -262,14 +263,14 @@ if ((res == 0) || (numBytesWritten != (DWORD)NBytes)) { - // DWORD err = GetLastError(); - THROW_EXCEPTION(CommonException, OSFileWriteError) + THROW_WIN_FILE_ERROR("Failed to write to file", mFileName, + CommonException, OSFileWriteError); } #else if(::write(mOSFileHandle, pBuffer, NBytes) != NBytes) { - BOX_LOG_SYS_ERROR("Failed to write to file: " << mFileName); - THROW_EXCEPTION(CommonException, OSFileWriteError) + THROW_SYS_FILE_ERROR("Failed to write to file", mFileName, + CommonException, OSFileWriteError); } #endif } @@ -292,18 +293,22 @@ #ifdef WIN32 LARGE_INTEGER conv; - conv.HighPart = 0; - conv.LowPart = 0; - conv.LowPart = SetFilePointer(this->mOSFileHandle, 0, &conv.HighPart, FILE_CURRENT); + if(conv.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) + { + THROW_WIN_FILE_ERROR("Failed to seek in file", mFileName, + CommonException, OSFileError); + } + return (IOStream::pos_type)conv.QuadPart; #else // ! WIN32 off_t p = ::lseek(mOSFileHandle, 0, SEEK_CUR); if(p == -1) { - THROW_EXCEPTION(CommonException, OSFileError) + THROW_SYS_FILE_ERROR("Failed to seek in file", mFileName, + CommonException, OSFileError); } return (IOStream::pos_type)p; @@ -328,18 +333,19 @@ #ifdef WIN32 LARGE_INTEGER conv; - conv.QuadPart = Offset; DWORD retVal = SetFilePointer(this->mOSFileHandle, conv.LowPart, &conv.HighPart, ConvertSeekTypeToOSWhence(SeekType)); if(retVal == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) { - THROW_EXCEPTION(CommonException, OSFileError) + THROW_WIN_FILE_ERROR("Failed to seek in file", mFileName, + CommonException, OSFileError); } #else // ! WIN32 if(::lseek(mOSFileHandle, Offset, ConvertSeekTypeToOSWhence(SeekType)) == -1) { - THROW_EXCEPTION(CommonException, OSFileError) + THROW_SYS_FILE_ERROR("Failed to seek in file", mFileName, + CommonException, OSFileError); } #endif // WIN32 @@ -365,12 +371,17 @@ #ifdef WIN32 if(::CloseHandle(mOSFileHandle) == 0) -#else + { + THROW_WIN_FILE_ERROR("Failed to close file", mFileName, + CommonException, OSFileCloseError); + } +#else // ! WIN32 if(::close(mOSFileHandle) != 0) -#endif { - THROW_EXCEPTION(CommonException, OSFileCloseError) + THROW_SYS_FILE_ERROR("Failed to close file", mFileName, + CommonException, OSFileCloseError); } +#endif // WIN32 mOSFileHandle = INVALID_FILE; mIsEOF = true; From subversion at boxbackup.org Sun Jan 22 16:32:08 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:32:08 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3066 - box/trunk/lib/server Message-ID: <20120122163208.03A941A354D@www.boxbackup.org> Author: chris Date: 2012-01-22 16:32:07 +0000 (Sun, 22 Jan 2012) New Revision: 3066 Modified: box/trunk/lib/server/SocketListen.h box/trunk/lib/server/SocketStream.cpp Log: Improve logging of socket errors (create, bind, accept, and poll) Modified: box/trunk/lib/server/SocketListen.h =================================================================== --- box/trunk/lib/server/SocketListen.h 2012-01-22 16:28:01 UTC (rev 3065) +++ box/trunk/lib/server/SocketListen.h 2012-01-22 16:32:07 UTC (rev 3066) @@ -87,12 +87,16 @@ { Close(); } + private: SocketListen(const SocketListen &rToCopy) { } + + int mType, mPort; + std::string mName; + public: - enum { MaxMultipleListenSockets = MaxMultiListenSockets @@ -108,8 +112,8 @@ if(::close(mSocketHandle) == -1) #endif { - BOX_LOG_SYS_ERROR("Failed to close network " - "socket"); + BOX_LOG_SOCKET_ERROR(mType, mName, mPort, + "Failed to close network socket"); THROW_EXCEPTION(ServerException, SocketCloseError) } @@ -127,6 +131,10 @@ // ------------------------------------------------------------------ void Listen(Socket::Type Type, const char *Name, int Port = 0) { + mType = Type; + mName = Name; + mPort = Port; + if(mSocketHandle != -1) { THROW_EXCEPTION(ServerException, SocketAlreadyOpen); @@ -144,7 +152,8 @@ 0 /* let OS choose protocol */); if(mSocketHandle == -1) { - BOX_LOG_SYS_ERROR("Failed to create a network socket"); + BOX_LOG_SOCKET_ERROR(Type, Name, Port, + "Failed to create a network socket"); THROW_EXCEPTION(ServerException, SocketOpenError) } @@ -158,7 +167,8 @@ &option, sizeof(option)) == -1) #endif { - BOX_LOG_SYS_ERROR("Failed to set socket options"); + BOX_LOG_SOCKET_ERROR(Type, Name, Port, + "Failed to set socket options"); THROW_EXCEPTION(ServerException, SocketOpenError) } @@ -167,9 +177,14 @@ || ::listen(mSocketHandle, ListenBacklog) == -1) { int err_number = errno; + + BOX_LOG_SOCKET_ERROR(Type, Name, Port, + "Failed to bind socket"); + // Dispose of the socket ::close(mSocketHandle); mSocketHandle = -1; + THROW_SYS_FILE_ERRNO("Failed to bind or listen " "on socket", Name, err_number, ServerException, SocketBindError); @@ -233,8 +248,8 @@ } else { - BOX_LOG_SYS_ERROR("Failed to poll " - "connection"); + BOX_LOG_SOCKET_ERROR(mType, mName, mPort, + "Failed to poll connection"); THROW_EXCEPTION(ServerException, SocketPollError) } @@ -253,7 +268,8 @@ // Got socket (or error), unlock (implicit in destruction) if(sock == -1) { - BOX_LOG_SYS_ERROR("Failed to accept connection"); + BOX_LOG_SOCKET_ERROR(mType, mName, mPort, + "Failed to accept connection"); THROW_EXCEPTION(ServerException, SocketAcceptError) } Modified: box/trunk/lib/server/SocketStream.cpp =================================================================== --- box/trunk/lib/server/SocketStream.cpp 2012-01-22 16:28:01 UTC (rev 3065) +++ box/trunk/lib/server/SocketStream.cpp 2012-01-22 16:32:07 UTC (rev 3066) @@ -154,14 +154,16 @@ int sockDomain = 0; SocketAllAddr addr; int addrLen = 0; - Socket::NameLookupToSockAddr(addr, sockDomain, Type, rName, Port, addrLen); + Socket::NameLookupToSockAddr(addr, sockDomain, Type, rName, Port, + addrLen); // Create the socket mSocketHandle = ::socket(sockDomain, SOCK_STREAM, 0 /* let OS choose protocol */); if(mSocketHandle == INVALID_SOCKET_VALUE) { - BOX_LOG_SYS_ERROR("Failed to create a network socket"); + BOX_LOG_SOCKET_ERROR(Type, rName, Port, + "Failed to create a network socket"); THROW_EXCEPTION(ServerException, SocketOpenError) } @@ -169,16 +171,11 @@ if(::connect(mSocketHandle, &addr.sa_generic, addrLen) == -1) { // Dispose of the socket + BOX_LOG_SOCKET_ERROR(Type, rName, Port, + "Failed to connect to socket"); #ifdef WIN32 - DWORD err = WSAGetLastError(); ::closesocket(mSocketHandle); - BOX_LOG_WIN_ERROR_NUMBER("Failed to connect to socket " - "(type " << Type << ", name " << rName << - ", port " << Port << ")", err); #else // !WIN32 - BOX_LOG_SYS_ERROR("Failed to connect to socket (type " << - Type << ", name " << rName << ", port " << Port << - ")"); ::close(mSocketHandle); #endif // WIN32 From subversion at boxbackup.org Sun Jan 22 16:35:37 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:35:37 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3067 - box/trunk/lib/backupstore Message-ID: <20120122163537.82A8B1A356F@www.boxbackup.org> Author: chris Date: 2012-01-22 16:35:37 +0000 (Sun, 22 Jan 2012) New Revision: 3067 Modified: box/trunk/lib/backupstore/BackupClientFileAttributes.cpp box/trunk/lib/backupstore/BackupClientFileAttributes.h Log: Allow constructing a BackupClientFileAttributes from a struct EMU_STAT. Modified: box/trunk/lib/backupstore/BackupClientFileAttributes.cpp =================================================================== --- box/trunk/lib/backupstore/BackupClientFileAttributes.cpp 2012-01-22 16:32:07 UTC (rev 3066) +++ box/trunk/lib/backupstore/BackupClientFileAttributes.cpp 2012-01-22 16:35:37 UTC (rev 3067) @@ -123,6 +123,30 @@ // -------------------------------------------------------------------------- // // Function +// Name: BackupClientFileAttributes::BackupClientFileAttributes() +// Purpose: Artifical constructor +// Created: 2011/12/06 +// +// -------------------------------------------------------------------------- +BackupClientFileAttributes::BackupClientFileAttributes(const EMU_STRUCT_STAT &st) +: mpClearAttributes(0) +{ + ASSERT(sizeof(u_int64_t) == sizeof(box_time_t)); + StreamableMemBlock *pnewAttr = new StreamableMemBlock; + FillAttributes(*pnewAttr, (const char *)NULL, st, true); + + // Attributes ready. Encrypt into this block + EncryptAttr(*pnewAttr); + + // Store the new attributes + RemoveClear(); + mpClearAttributes = pnewAttr; + pnewAttr = 0; +} + +// -------------------------------------------------------------------------- +// +// Function // Name: BackupClientFileAttributes::BackupClientFileAttributes(const BackupClientFileAttributes &) // Purpose: Copy constructor // Created: 2003/10/07 @@ -436,12 +460,15 @@ // -------------------------------------------------------------------------- // // Function -// Name: BackupClientFileAttributes::ReadAttributesLink() +// Name: BackupClientFileAttributes::FillAttributes() // Purpose: Private function, handles standard attributes for all objects // Created: 2003/10/07 // // -------------------------------------------------------------------------- -void BackupClientFileAttributes::FillAttributes(StreamableMemBlock &outputBlock, const char *Filename, EMU_STRUCT_STAT &st, bool ZeroModificationTimes) +void BackupClientFileAttributes::FillAttributes( + StreamableMemBlock &outputBlock, const char *Filename, + const EMU_STRUCT_STAT &st, bool ZeroModificationTimes +) { outputBlock.ResizeBlock(sizeof(attr_StreamFormat)); attr_StreamFormat *pattr = (attr_StreamFormat*)outputBlock.GetBuffer(); @@ -475,7 +502,9 @@ // -------------------------------------------------------------------------- // // Function -// Name: BackupClientFileAttributes::ReadAttributesLink() +// Name: BackupClientFileAttributes::FillAttributesLink( +// StreamableMemBlock &outputBlock, +// const char *Filename, struct stat &st) // Purpose: Private function, handles the case where a symbolic link is needed // Created: 2003/10/07 // @@ -507,7 +536,7 @@ // -------------------------------------------------------------------------- // // Function -// Name: BackupClientFileAttributes::ReadExtendedAttr(const char *, unsigned char**) +// Name: BackupClientFileAttributes::FillExtendedAttr(const char *, unsigned char**) // Purpose: Private function, read the extended attributes of the file into the block // Created: 2005/06/12 // Modified: box/trunk/lib/backupstore/BackupClientFileAttributes.h =================================================================== --- box/trunk/lib/backupstore/BackupClientFileAttributes.h 2012-01-22 16:32:07 UTC (rev 3066) +++ box/trunk/lib/backupstore/BackupClientFileAttributes.h 2012-01-22 16:35:37 UTC (rev 3067) @@ -29,6 +29,7 @@ { public: BackupClientFileAttributes(); + BackupClientFileAttributes(const EMU_STRUCT_STAT &st); BackupClientFileAttributes(const BackupClientFileAttributes &rToCopy); BackupClientFileAttributes(const StreamableMemBlock &rToCopy); ~BackupClientFileAttributes(); @@ -60,7 +61,7 @@ private: static void FillAttributes(StreamableMemBlock &outputBlock, - const char *Filename, EMU_STRUCT_STAT &st, + const char *Filename, const EMU_STRUCT_STAT &st, bool ZeroModificationTimes); static void FillAttributesLink(StreamableMemBlock &outputBlock, const char *Filename, struct stat &st); void WriteExtendedAttr(const char *Filename, int xattrOffset) const; From subversion at boxbackup.org Sun Jan 22 16:36:27 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:36:27 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3068 - box/trunk/lib/backupstore Message-ID: <20120122163627.E162E1A3591@www.boxbackup.org> Author: chris Date: 2012-01-22 16:36:27 +0000 (Sun, 22 Jan 2012) New Revision: 3068 Modified: box/trunk/lib/backupstore/BackupStoreDirectory.cpp box/trunk/lib/backupstore/BackupStoreDirectory.h Log: Rename the BackupStoreDirectory::AddEntry's AttributesModTime parameter to AttributesHash to avoid misleading the reader. Modified: box/trunk/lib/backupstore/BackupStoreDirectory.cpp =================================================================== --- box/trunk/lib/backupstore/BackupStoreDirectory.cpp 2012-01-22 16:35:37 UTC (rev 3067) +++ box/trunk/lib/backupstore/BackupStoreDirectory.cpp 2012-01-22 16:36:27 UTC (rev 3068) @@ -115,7 +115,8 @@ // // Function // Name: BackupStoreDirectory::ReadFromStream(IOStream &, int) -// Purpose: Reads the directory contents from a stream. Exceptions will yeild incomplete reads. +// Purpose: Reads the directory contents from a stream. +// Exceptions will result in incomplete reads. // Created: 2003/08/26 // // -------------------------------------------------------------------------- @@ -131,7 +132,12 @@ // Check magic value... if(OBJECTMAGIC_DIR_MAGIC_VALUE != ntohl(hdr.mMagicValue)) { - THROW_EXCEPTION(BackupStoreException, BadDirectoryFormat) + THROW_EXCEPTION_MESSAGE(BackupStoreException, BadDirectoryFormat, + "Wrong magic number in directory object " << + BOX_FORMAT_OBJECTID(mObjectID) << ": expected " << + BOX_FORMAT_HEX32(OBJECTMAGIC_DIR_MAGIC_VALUE) << + " but found " << + BOX_FORMAT_HEX32(ntohl(hdr.mMagicValue))); } // Get data @@ -307,9 +313,13 @@ // Created: 2003/08/27 // // -------------------------------------------------------------------------- -BackupStoreDirectory::Entry *BackupStoreDirectory::AddEntry(const BackupStoreFilename &rName, box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags, box_time_t AttributesModTime) +BackupStoreDirectory::Entry * +BackupStoreDirectory::AddEntry(const BackupStoreFilename &rName, + box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, + int16_t Flags, uint64_t AttributesHash) { - Entry *pnew = new Entry(rName, ModificationTime, ObjectID, SizeInBlocks, Flags, AttributesModTime); + Entry *pnew = new Entry(rName, ModificationTime, ObjectID, + SizeInBlocks, Flags, AttributesHash); try { mEntries.push_back(pnew); Modified: box/trunk/lib/backupstore/BackupStoreDirectory.h =================================================================== --- box/trunk/lib/backupstore/BackupStoreDirectory.h 2012-01-22 16:35:37 UTC (rev 3067) +++ box/trunk/lib/backupstore/BackupStoreDirectory.h 2012-01-22 16:36:27 UTC (rev 3068) @@ -149,7 +149,10 @@ bool StreamAttributes = true, bool StreamDependencyInfo = true) const; Entry *AddEntry(const Entry &rEntryToCopy); - Entry *AddEntry(const BackupStoreFilename &rName, box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags, box_time_t AttributesModTime); + Entry *AddEntry(const BackupStoreFilename &rName, + box_time_t ModificationTime, int64_t ObjectID, + int64_t SizeInBlocks, int16_t Flags, + uint64_t AttributesHash); void DeleteEntry(int64_t ObjectID); Entry *FindEntryByID(int64_t ObjectID) const; From subversion at boxbackup.org Sun Jan 22 16:39:12 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 16:39:12 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3069 - box/trunk/lib/server Message-ID: <20120122163912.34D6E1A35AF@www.boxbackup.org> Author: chris Date: 2012-01-22 16:39:12 +0000 (Sun, 22 Jan 2012) New Revision: 3069 Modified: box/trunk/lib/server/Protocol.cpp Log: Catch trying to send a zero-length stream, which will cause an assertion failure on the other side. Modified: box/trunk/lib/server/Protocol.cpp =================================================================== --- box/trunk/lib/server/Protocol.cpp 2012-01-22 16:36:27 UTC (rev 3068) +++ box/trunk/lib/server/Protocol.cpp 2012-01-22 16:39:12 UTC (rev 3069) @@ -688,6 +688,17 @@ // Can't send this using the fixed size header uncertainSize = true; } + + if(streamSize == 0) + { + // Server protocol will throw an assertion failure if we + // try to send a stream whose size is definitely zero: + // ASSERT FAILED: [BytesToRead > 0] at PartialReadStream.cpp:31 + // so catch this on the client side to help debugging + THROW_EXCEPTION_MESSAGE(ServerException, Protocol_BadUsage, + "Sending a stream with a definite size of zero " + "is not allowed in the protocol"); + } // Inform sub class InformStreamSending(streamSize); From subversion at boxbackup.org Sun Jan 22 19:37:13 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 19:37:13 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3070 - box/trunk/infrastructure Message-ID: <20120122193713.A62E91A3854@www.boxbackup.org> Author: chris Date: 2012-01-22 19:37:13 +0000 (Sun, 22 Jan 2012) New Revision: 3070 Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp Log: Print the message of the exception that caused a test to fail. Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp =================================================================== --- box/trunk/infrastructure/buildenv-testmain-template.cpp 2012-01-22 16:39:12 UTC (rev 3069) +++ box/trunk/infrastructure/buildenv-testmain-template.cpp 2012-01-22 19:37:13 UTC (rev 3070) @@ -369,6 +369,12 @@ return returncode; } + catch(BoxException &e) + { + printf("FAILED: Exception caught: %s: %s\n", e.what(), + e.GetMessage().c_str()); + return 1; + } catch(std::exception &e) { printf("FAILED: Exception caught: %s\n", e.what()); From subversion at boxbackup.org Sun Jan 22 19:39:40 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 19:39:40 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3071 - box/trunk/bin/bbackupd Message-ID: <20120122193940.3C8061A3873@www.boxbackup.org> Author: chris Date: 2012-01-22 19:39:39 +0000 (Sun, 22 Jan 2012) New Revision: 3071 Modified: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h Log: Allow getting the object ID out from a BackupClientDirectoryRecord. Modified: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h =================================================================== --- box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h 2012-01-22 19:37:13 UTC (rev 3070) +++ box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h 2012-01-22 19:39:39 UTC (rev 3071) @@ -141,6 +141,8 @@ std::string ConvertVssPathToRealPath(const std::string &rVssPath, const Location& rBackupLocation); + int64_t GetObjectID() const { return mObjectID; } + private: void DeleteSubDirectories(); BackupStoreDirectory *FetchDirectoryListing(SyncParams &rParams); @@ -167,7 +169,6 @@ BackupStoreDirectory::Entry* pEntry, const std::string &rFilename); -private: int64_t mObjectID; std::string mSubDirName; bool mInitialSyncDone; From subversion at boxbackup.org Sun Jan 22 19:40:06 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Sun, 22 Jan 2012 19:40:06 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3072 - box/trunk/bin/bbackupquery Message-ID: <20120122194006.2EBA61A3891@www.boxbackup.org> Author: chris Date: 2012-01-22 19:40:06 +0000 (Sun, 22 Jan 2012) New Revision: 3072 Modified: box/trunk/bin/bbackupquery/BackupQueries.h Log: Add missing typedef to allow use of ReturnCode enum. Modified: box/trunk/bin/bbackupquery/BackupQueries.h =================================================================== --- box/trunk/bin/bbackupquery/BackupQueries.h 2012-01-22 19:39:39 UTC (rev 3071) +++ box/trunk/bin/bbackupquery/BackupQueries.h 2012-01-22 19:40:06 UTC (rev 3072) @@ -367,7 +367,7 @@ class ReturnCode { public: - enum { + typedef enum { Command_OK = 0, Compare_Same = 1, Compare_Different, From subversion at boxbackup.org Mon Jan 23 00:40:42 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Mon, 23 Jan 2012 00:40:42 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3073 - box/trunk/lib/common Message-ID: <20120123004042.95CC31A3D2D@www.boxbackup.org> Author: chris Date: 2012-01-23 00:40:42 +0000 (Mon, 23 Jan 2012) New Revision: 3073 Modified: box/trunk/lib/common/Box.h Log: Log exceptions with backtrace even if suppressed when log level is Log::EVERYTHING also for exceptions with messages. Modified: box/trunk/lib/common/Box.h =================================================================== --- box/trunk/lib/common/Box.h 2012-01-22 19:40:06 UTC (rev 3072) +++ box/trunk/lib/common/Box.h 2012-01-23 00:40:42 UTC (rev 3073) @@ -118,7 +118,8 @@ { \ std::ostringstream _box_throw_line; \ _box_throw_line << message; \ - if(!HideExceptionMessageGuard::ExceptionsHidden()) \ + if(!HideExceptionMessageGuard::ExceptionsHidden() \ + || Logging::IsEnabled(Log::EVERYTHING)) \ { \ OPTIONAL_DO_BACKTRACE \ BOX_WARNING("Exception thrown: " \ From subversion at boxbackup.org Mon Jan 23 01:32:09 2012 From: subversion at boxbackup.org (subversion at boxbackup.org) Date: Mon, 23 Jan 2012 01:32:09 +0000 (GMT) Subject: [Box Backup-commit] COMMIT r3074 - box/trunk/lib/common Message-ID: <20120123013209.2CF811A3D79@www.boxbackup.org> Author: chris Date: 2012-01-23 01:32:08 +0000 (Mon, 23 Jan 2012) New Revision: 3074 Modified: box/trunk/lib/common/Box.h box/trunk/lib/common/Logging.cpp box/trunk/lib/common/Logging.h Log: Allow overriding Logging::Guard to dump stack backtraces as well. Modified: box/trunk/lib/common/Box.h =================================================================== --- box/trunk/lib/common/Box.h 2012-01-23 00:40:42 UTC (rev 3073) +++ box/trunk/lib/common/Box.h 2012-01-23 01:32:08 UTC (rev 3074) @@ -17,6 +17,8 @@ #include "BoxPlatform.h" +#include + // uncomment this line to enable full memory leak finding on all // malloc-ed blocks (at least, ones used by the STL) //#define MEMLEAKFINDER_FULL_MALLOC_MONITORING @@ -104,8 +106,15 @@ #define THROW_EXCEPTION(type, subtype) \ { \ if(!HideExceptionMessageGuard::ExceptionsHidden() \ - || Logging::IsEnabled(Log::EVERYTHING)) \ + || Logging::Guard::IsGuardingFrom(Log::EVERYTHING)) \ { \ + std::auto_ptr guard; \ + \ + if(Logging::Guard::IsGuardingFrom(Log::EVERYTHING)) \ + { \ + guard.reset(new Logging::Guard(Log::EVERYTHING)); \ + } \ + \ OPTIONAL_DO_BACKTRACE \ BOX_WARNING("Exception thrown: " \ #type "(" #subtype ") " \ @@ -119,8 +128,15 @@ std::ostringstream _box_throw_line; \ _box_throw_line << message; \ if(!HideExceptionMessageGuard::ExceptionsHidden() \ - || Logging::IsEnabled(Log::EVERYTHING)) \ + || Logging::Guard::IsGuardingFrom(Log::EVERYTHING)) \ { \ + std::auto_ptr guard; \ + \ + if(Logging::Guard::IsGuardingFrom(Log::EVERYTHING)) \ + { \ + guard.reset(new Logging::Guard(Log::EVERYTHING)); \ + } \ + \ OPTIONAL_DO_BACKTRACE \ BOX_WARNING("Exception thrown: " \ #type "(" #subtype ") (" << message << \ Modified: box/trunk/lib/common/Logging.cpp =================================================================== --- box/trunk/lib/common/Logging.cpp 2012-01-23 00:40:42 UTC (rev 3073) +++ box/trunk/lib/common/Logging.cpp 2012-01-23 01:32:08 UTC (rev 3074) @@ -46,6 +46,9 @@ Logging Logging::sGlobalLogging; //automatic initialisation std::string Logging::sProgramName; +int Logging::Guard::sGuardCount = 0; +Log::Level Logging::Guard::sOriginalLevel = Log::INVALID; + Logging::Logging() { ASSERT(!spConsole); Modified: box/trunk/lib/common/Logging.h =================================================================== --- box/trunk/lib/common/Logging.h 2012-01-23 00:40:42 UTC (rev 3073) +++ box/trunk/lib/common/Logging.h 2012-01-23 01:32:08 UTC (rev 3074) @@ -303,17 +303,33 @@ { private: Log::Level mOldLevel; + static int sGuardCount; + static Log::Level sOriginalLevel; public: Guard(Log::Level newLevel) { mOldLevel = Logging::GetGlobalLevel(); + if(sGuardCount == 0) + { + sOriginalLevel = mOldLevel; + } + sGuardCount++; Logging::SetGlobalLevel(newLevel); } ~Guard() { + sGuardCount--; Logging::SetGlobalLevel(mOldLevel); } + + static bool IsActive() { return (sGuardCount > 0); } + static Log::Level GetOriginalLevel() { return sOriginalLevel; } + static bool IsGuardingFrom(Log::Level originalLevel) + { + return IsActive() && + (int)sOriginalLevel >= (int)originalLevel; + } }; class Tagger