Added "/analyze" flag for compile in order to activate Code Analysis in Visual Studio 2008+. Resolved some of these warnings.

This commit is contained in:
Sorin Sbarnea
2009-12-21 16:52:47 +00:00
parent ba7ec582c3
commit 9face38556
12 changed files with 1419 additions and 1381 deletions

View File

@@ -672,8 +672,8 @@ CArchDaemonWindows::serviceMain(DWORD argc, LPTSTR* argvIn)
myArgv.push_back(argv[0]);
// get pointers
for (size_t i = 0; i < args.size(); ++i) {
myArgv.push_back(args[i].c_str());
for (size_t j = 0; j < args.size(); ++j) {
myArgv.push_back(args[j].c_str());
}
// adjust argc/argv

View File

@@ -297,7 +297,7 @@ CArchMultithreadWindows::newThread(ThreadFunc func, void* data)
thread->m_userData = data;
// create thread
unsigned int id;
unsigned int id = 0;
thread->m_thread = reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0,
threadFunc, (void*)thread, 0, &id));
thread->m_id = static_cast<DWORD>(id);

View File

@@ -129,16 +129,19 @@ bool
CArchSystemWindows::isWOW64() const
{
#if WINVER >= _WIN32_WINNT_WINXP
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
LPFN_ISWOW64PROCESS fnIsWow64Process =
(LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
BOOL bIsWow64 = FALSE;
if(NULL != fnIsWow64Process &&
fnIsWow64Process(GetCurrentProcess(), &bIsWow64) &&
bIsWow64)
{
return true;
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
HMODULE hModule = GetModuleHandle(TEXT("kernel32"));
if (!hModule) return FALSE;
LPFN_ISWOW64PROCESS fnIsWow64Process =
(LPFN_ISWOW64PROCESS) GetProcAddress(hModule, "IsWow64Process");
BOOL bIsWow64 = FALSE;
if(NULL != fnIsWow64Process &&
fnIsWow64Process(GetCurrentProcess(), &bIsWow64) &&
bIsWow64)
{
return true;
}
#endif
return false;