summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/cpuusage.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-07-03 17:22:40 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-07-03 17:22:40 +0000
commitad4e888349c2d220828c93d2d50635ff23a6fc72 (patch)
treefaec91eff1839928805c2fbfe6d04b37723dc028 /plugins/AutoShutdown/cpuusage.cpp
parent49566229022ee6e96eac0888f9c0501fcd92033b (diff)
AutoShutdown:
plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/cpuusage.cpp')
-rw-r--r--plugins/AutoShutdown/cpuusage.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/AutoShutdown/cpuusage.cpp b/plugins/AutoShutdown/cpuusage.cpp
index 1270fe02ec..a1f4d4e5d3 100644
--- a/plugins/AutoShutdown/cpuusage.cpp
+++ b/plugins/AutoShutdown/cpuusage.cpp
@@ -117,8 +117,10 @@ static void Win9x_PollThread(struct CpuUsageThreadParams *param)
}
#endif /* !_UNICODE */
-static void WinNT_PollThread(struct CpuUsageThreadParams *param)
+static void WinNT_PollThread(void *vparam)
{
+ CpuUsageThreadParams *param = (CpuUsageThreadParams*)vparam;
+
DWORD dwBufferSize=0,dwCount;
BYTE *pBuffer=NULL;
PERF_DATA_BLOCK *pPerfData=NULL;
@@ -143,8 +145,8 @@ static void WinNT_PollThread(struct CpuUsageThreadParams *param)
dwCounterId=240; /* '% Total processor time' counter */
pwszInstanceName=NULL;
}
- _itow(dwObjectId,wszValueName,10);
- fSwitched=WinNT_PerfStatsSwitch(_T("PerfOS"),FALSE);
+ _itot_s(dwObjectId, wszValueName, 10);
+ fSwitched = WinNT_PerfStatsSwitch(_T("PerfOS"), FALSE);
/* poll */
for(;;) {
@@ -245,13 +247,10 @@ DWORD PollCpuUsage(CPUUSAGEAVAILPROC pfnDataAvailProc,LPARAM lParam,DWORD dwDela
return 0;
}
/* start thread */
-#if defined(_UNICODE)
- if(mir_forkthread(WinNT_PollThread,param)!=-1)
-#else
- if(mir_forkthread(IsWinVerNT()?WinNT_PollThread:Win9x_PollThread,param)!=-1)
-#endif
+ if((int)mir_forkthread(WinNT_PollThread, param) != -1)
WaitForSingleObject(hFirstEvent,INFINITE); /* wait for first success */
- else mir_free(param); /* thread not started */
+ else
+ mir_free(param); /* thread not started */
CloseHandle(hFirstEvent);
return idThread;
}