diff --git a/lib/boinc_win.h b/lib/boinc_win.h index a6f61cbe64..d1a533631d 100644 --- a/lib/boinc_win.h +++ b/lib/boinc_win.h @@ -236,6 +236,9 @@ extern "C" { #endif void __cdecl _fpreset (void); void __cdecl fpreset (void); +#define SetClassLongPtr SetClassLong +#define GCLP_HICON GCL_HICON +#define GCLP_HICONSM GCL_HICONSM #ifdef __cplusplus } #endif diff --git a/lib/diagnostics_win.C b/lib/diagnostics_win.C index 69bec820b7..d185d574d8 100644 --- a/lib/diagnostics_win.C +++ b/lib/diagnostics_win.C @@ -35,6 +35,7 @@ #include "str_util.h" #include "util.h" +#define BOINC_VERSION_STRING "5.10.0" // NtQuerySystemInformation typedef NTSTATUS (WINAPI *tNTQSI)( @@ -72,7 +73,7 @@ BOOL diagnostics_get_registry_value(LPCTSTR lpName, LPDWORD lpdwType, LPDWORD lp lRetVal = RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Diagnostics"), - NULL, + (DWORD)NULL, KEY_READ, &hKey ); @@ -81,7 +82,7 @@ BOOL diagnostics_get_registry_value(LPCTSTR lpName, LPDWORD lpdwType, LPDWORD lp lRetVal = RegOpenKeyEx( HKEY_CURRENT_USER, _T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Diagnostics"), - NULL, + (DWORD)NULL, KEY_READ, &hKey ); @@ -336,10 +337,10 @@ int diagnostics_get_process_information(PVOID* ppBuffer, PULONG pcbBuffer) { ); if (Status == STATUS_INFO_LENGTH_MISMATCH) { - HeapFree(hHeap, NULL, *ppBuffer); + HeapFree(hHeap, (DWORD)NULL, *ppBuffer); *pcbBuffer *= 2; } else if (!NT_SUCCESS(Status)) { - HeapFree(hHeap, NULL, *ppBuffer); + HeapFree(hHeap, (DWORD)NULL, *ppBuffer); retval = Status; } } while (Status == STATUS_INFO_LENGTH_MISMATCH); @@ -433,7 +434,7 @@ int diagnostics_update_thread_list_NT() { // Release resources if (hThreadListSync) ReleaseMutex(hThreadListSync); - if (pBuffer) HeapFree(GetProcessHeap(), NULL, pBuffer); + if (pBuffer) HeapFree(GetProcessHeap(), (DWORD)NULL, pBuffer); return 0; } @@ -525,7 +526,7 @@ int diagnostics_update_thread_list_XP() { // Release resources if (hThreadListSync) ReleaseMutex(hThreadListSync); - if (pBuffer) HeapFree(GetProcessHeap(), NULL, pBuffer); + if (pBuffer) HeapFree(GetProcessHeap(), (DWORD)NULL, pBuffer); return 0; } @@ -1050,8 +1051,8 @@ int diagnostics_message_monitor_dump() { // See: http://support.microsoft.com/kb/q173260/ // UINT WINAPI diagnostics_message_monitor(LPVOID /* lpParameter */) { - DWORD dwEvent = NULL; - DWORD dwCurrentProcessId = NULL; + DWORD dwEvent = (DWORD)NULL; + DWORD dwCurrentProcessId = (DWORD)NULL; BOOL bContinue = TRUE; DWORD dwRepeatMessageCounter = 0; DWORD dwRepeatMessageProcessId = 0; @@ -1216,7 +1217,7 @@ typedef struct _BOINC_WINDOWCAPTURE { DWORD window_thread_id; } BOINC_WINDOWCAPTURE, *PBOINC_WINDOWCAPTURE; -static UINT uiExceptionMonitorThreadId = NULL; +static UINT uiExceptionMonitorThreadId = (UINT)NULL; static HANDLE hExceptionMonitorThread = NULL; static HANDLE hExceptionMonitorHalt = NULL; static HANDLE hExceptionMonitorStartedEvent = NULL; @@ -1707,7 +1708,7 @@ UINT diagnostics_determine_exit_code() { UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID /* lpParameter */) { - DWORD dwEvent = NULL; + DWORD dwEvent = (DWORD)NULL; BOOL bContinue = TRUE; BOOL bDebuggerInitialized = FALSE; HANDLE hEvents[2]; diff --git a/lib/md5_file.C b/lib/md5_file.C index f2db9d342f..32dc8a67d5 100644 --- a/lib/md5_file.C +++ b/lib/md5_file.C @@ -107,7 +107,7 @@ int make_random_string(char* out) { if (!f) { return -1; } - int n = fread(buf, 32, 1, f); + size_t n = fread(buf, 32, 1, f); fclose(f); if (n != 1) return -1; #endif diff --git a/lib/miofile.C b/lib/miofile.C index ffa61864cd..92cbedadaf 100644 --- a/lib/miofile.C +++ b/lib/miofile.C @@ -72,8 +72,8 @@ int MIOFILE::printf(const char* format, ...) { } else if (f) { retval = vfprintf(f, format, ap); } else { - int cursize = strlen(wbuf); - int remaining_len = len - cursize; + size_t cursize = strlen(wbuf); + size_t remaining_len = len - cursize; retval = vsnprintf(wbuf+cursize, remaining_len, format, ap); } va_end(ap); diff --git a/lib/procinfo_win.C b/lib/procinfo_win.C index 81f5618058..f4be60b4bb 100644 --- a/lib/procinfo_win.C +++ b/lib/procinfo_win.C @@ -1,3 +1,4 @@ +#include "boinc_win.h" #include "error_numbers.h" #include "diagnostics_win.h" #include "procinfo.h" diff --git a/lib/stackwalker_win.cpp b/lib/stackwalker_win.cpp index a9ce21a290..3805bc1a45 100644 --- a/lib/stackwalker_win.cpp +++ b/lib/stackwalker_win.cpp @@ -594,7 +594,7 @@ int DebuggerInitialize( LPCSTR pszBOINCLocation, LPCSTR pszSymbolStore, BOOL bPr free( tt ); // Setting symbol options to the WinDbg defaults. - symOptions = NULL; + symOptions = (DWORD)NULL; symOptions |= SYMOPT_CASE_INSENSITIVE; symOptions |= SYMOPT_LOAD_LINES; symOptions |= SYMOPT_OMAP_FIND_NEAREST; @@ -937,10 +937,10 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context) // Zero out params so we have fresh parameters through the next interation - StackFrame.Params[0] = NULL; - StackFrame.Params[1] = NULL; - StackFrame.Params[2] = NULL; - StackFrame.Params[3] = NULL; + StackFrame.Params[0] = (DWORD64)NULL; + StackFrame.Params[1] = (DWORD64)NULL; + StackFrame.Params[2] = (DWORD64)NULL; + StackFrame.Params[3] = (DWORD64)NULL; // no return address means no deeper stackframe