summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/cpuusage.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-07-03 19:23:06 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-07-03 19:23:06 +0000
commit0f95cbb4a9f1c9a613dccb9d53f5ddb50a8cadd7 (patch)
tree18921c83b3a45c5790f9cfd8b2a584262e0154ae /plugins/AutoShutdown/cpuusage.cpp
parente30f0fae7e19f4aa879c04005af9701f8995d3ef (diff)
AutoShutdown:
code cleaning x64 compilation fix git-svn-id: http://svn.miranda-ng.org/main/trunk@742 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/cpuusage.cpp')
-rw-r--r--plugins/AutoShutdown/cpuusage.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/plugins/AutoShutdown/cpuusage.cpp b/plugins/AutoShutdown/cpuusage.cpp
index a1f4d4e5d3..d99be4a6fe 100644
--- a/plugins/AutoShutdown/cpuusage.cpp
+++ b/plugins/AutoShutdown/cpuusage.cpp
@@ -47,21 +47,7 @@ static BOOL WinNT_PerfStatsSwitch(TCHAR *pszServiceName,BOOL fDisable)
return fSwitched;
}
-#if !defined(_UNICODE)
-static void Win9x_PerfStatsSwitch(HKEY hKey,char *pszAction,char *pszName)
-{
- DWORD dwData,dwSize;
- dwSize=sizeof(dwData);
- if(!RegOpenKeyExA(hKey,pszAction,0,KEY_QUERY_VALUE,&hKey)) {
- /* a simple query does the trick (data and size must not be NULL!) */
- RegQueryValueExA(hKey,pszName,NULL,NULL,(BYTE*)&dwData,&dwSize);
- RegCloseKey(hKey);
- }
-}
-#endif
-
/************************* Poll Thread ********************************/
-
struct CpuUsageThreadParams {
DWORD dwDelayMillis;
CPUUSAGEAVAILPROC pfnDataAvailProc;
@@ -85,38 +71,6 @@ static BOOL CallBackAndWait(struct CpuUsageThreadParams *param,BYTE nCpuUsage)
return !Miranda_Terminated();
}
-#if !defined(_UNICODE)
-static void Win9x_PollThread(struct CpuUsageThreadParams *param)
-{
- HKEY hKeyStats,hKeyData;
- DWORD dwBufferSize,dwData;
-
- if(!RegOpenKeyExA(HKEY_DYN_DATA,"PerfStats",0,KEY_QUERY_VALUE,&hKeyStats)) {
- /* start query */
- /* not needed for kernel
- * Win9x_PerfStatsSwitch(hKeyStats,"StartSrv","KERNEL"); */
- Win9x_PerfStatsSwitch(hKeyStats,"StartStat","KERNEL\\CPUUsage");
- /* retrieve cpu usage */
- if(!RegOpenKeyExA(hKeyStats,"StatData",0,KEY_QUERY_VALUE,&hKeyData)) {
- dwBufferSize=sizeof(dwData);
- while(!RegQueryValueExA(hKeyData,"KERNEL\\CPUUsage",NULL,NULL,(BYTE*)&dwData,&dwBufferSize)) {
- dwBufferSize=sizeof(dwData);
- if(!CallBackAndWait(param,(BYTE)dwData)) break;
- }
- RegCloseKey(hKeyData);
- }
- /* stop query */
- Win9x_PerfStatsSwitch(hKeyStats,"StopStat","KERNEL\\CPUUsage");
- /* not needed for kernel
- * Win9x_PerfStatsSwitch(hKeyStats,"StopSrv","KERNEL"); */
- RegCloseKey(hKeyStats);
- }
- /* return error for PollCpuUsage() if never succeeded */
- if(param->hFirstEvent!=NULL) SetEvent(param->hFirstEvent);
- mir_free(param);
-}
-#endif /* !_UNICODE */
-
static void WinNT_PollThread(void *vparam)
{
CpuUsageThreadParams *param = (CpuUsageThreadParams*)vparam;