Commit 6b89c2d8 authored by Bernd Machenschalk's avatar Bernd Machenschalk
Browse files

MinGW doesn't like to cast 64Bit void* to DWORDs

parent e5e4cdee
......@@ -60,6 +60,11 @@ typedef NTSTATUS (WINAPI *tNTQSI)(
PULONG ReturnLength
);
#ifdef __MINGW64__
#define PTRASINT UINT64
#else
#define PTRASINT DWORD
#endif
// Look in the registry for the specified value user the BOINC diagnostics
// hive.
......@@ -215,7 +220,7 @@ int diagnostics_finish_thread_list() {
// Return a pointer to the thread entry.
//
PBOINC_THREADLISTENTRY diagnostics_find_thread_entry(DWORD dwThreadId) {
PBOINC_THREADLISTENTRY diagnostics_find_thread_entry(PTRASINT dwThreadId) {
PBOINC_THREADLISTENTRY pThread = NULL;
UINT uiIndex = 0;
size_t size = 0;
......@@ -311,7 +316,7 @@ int diagnostics_update_thread_list() {
// Enumerate the threads
for(uiSystemIndex = 0; uiSystemIndex < pProcesses->ThreadCount; uiSystemIndex++) {
pThread = &pProcesses->Threads[uiSystemIndex];
pThreadEntry = diagnostics_find_thread_entry((DWORD)pThread->ClientId.UniqueThread);
pThreadEntry = diagnostics_find_thread_entry((PTRASINT)pThread->ClientId.UniqueThread);
if (pThreadEntry) {
pThreadEntry->crash_kernel_time = (FLOAT)pThread->KernelTime.QuadPart;
......@@ -325,12 +330,12 @@ int diagnostics_update_thread_list() {
hThread = OpenThread(
THREAD_ALL_ACCESS,
FALSE,
(DWORD)(pThread->ClientId.UniqueThread)
(PTRASINT)(pThread->ClientId.UniqueThread)
);
pThreadEntry = new BOINC_THREADLISTENTRY;
diagnostics_init_thread_entry(pThreadEntry);
pThreadEntry->thread_id = (DWORD)(pThread->ClientId.UniqueThread);
pThreadEntry->thread_id = (PTRASINT)(pThread->ClientId.UniqueThread);
pThreadEntry->thread_handle = hThread;
pThreadEntry->crash_kernel_time = (FLOAT)pThread->KernelTime.QuadPart;
pThreadEntry->crash_user_time = (FLOAT)pThread->UserTime.QuadPart;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment