taskmgr: Converted some functions and variables to Unicode.

This commit is contained in:
Vladimir Pankratov 2008-08-20 08:35:51 +00:00 committed by Alexandre Julliard
parent bc4ded7469
commit 91227d9138
1 changed files with 33 additions and 28 deletions

View File

@ -4,6 +4,7 @@
* perfpage.c * perfpage.c
* *
* Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org> * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
* Copyright (C) 2008 Vladimir Pankratov
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -26,10 +27,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <malloc.h> #include <malloc.h>
#include <memory.h> #include <memory.h>
#include <tchar.h>
#include <stdio.h> #include <stdio.h>
#include <winnt.h> #include <winnt.h>
#include "wine/unicode.h"
#include "taskmgr.h" #include "taskmgr.h"
#include "perfdata.h" #include "perfdata.h"
#include "graphctl.h" #include "graphctl.h"
@ -138,7 +139,11 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
ULONG TotalThreads; ULONG TotalThreads;
ULONG TotalProcesses; ULONG TotalProcesses;
TCHAR Text[260]; WCHAR Text[256];
static const WCHAR wszFormatDigit[] = {'%','d',0};
static const WCHAR wszMemUsage[] = {'M','e','m',' ','U','s','a','g','e',':',' ',
'%','d','K',' ','/',' ','%','d','K',0};
/* Create the event */ /* Create the event */
hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
@ -175,14 +180,14 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
CommitChargeTotal = PerfDataGetCommitChargeTotalK(); CommitChargeTotal = PerfDataGetCommitChargeTotalK();
CommitChargeLimit = PerfDataGetCommitChargeLimitK(); CommitChargeLimit = PerfDataGetCommitChargeLimitK();
CommitChargePeak = PerfDataGetCommitChargePeakK(); CommitChargePeak = PerfDataGetCommitChargePeakK();
_ultoa(CommitChargeTotal, Text, 10); wsprintfW(Text, wszFormatDigit, CommitChargeTotal);
SetWindowText(hPerformancePageCommitChargeTotalEdit, Text); SetWindowTextW(hPerformancePageCommitChargeTotalEdit, Text);
_ultoa(CommitChargeLimit, Text, 10); wsprintfW(Text, wszFormatDigit, CommitChargeLimit);
SetWindowText(hPerformancePageCommitChargeLimitEdit, Text); SetWindowTextW(hPerformancePageCommitChargeLimitEdit, Text);
_ultoa(CommitChargePeak, Text, 10); wsprintfW(Text, wszFormatDigit, CommitChargePeak);
SetWindowText(hPerformancePageCommitChargePeakEdit, Text); SetWindowTextW(hPerformancePageCommitChargePeakEdit, Text);
wsprintf(Text, _T("Mem Usage: %dK / %dK"), CommitChargeTotal, CommitChargeLimit); wsprintfW(Text, wszMemUsage, CommitChargeTotal, CommitChargeLimit);
SendMessage(hStatusWnd, SB_SETTEXT, 2, (LPARAM)Text); SendMessageW(hStatusWnd, SB_SETTEXTW, 2, (LPARAM)Text);
/* /*
* Update the kernel memory info * Update the kernel memory info
@ -190,12 +195,12 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
KernelMemoryTotal = PerfDataGetKernelMemoryTotalK(); KernelMemoryTotal = PerfDataGetKernelMemoryTotalK();
KernelMemoryPaged = PerfDataGetKernelMemoryPagedK(); KernelMemoryPaged = PerfDataGetKernelMemoryPagedK();
KernelMemoryNonPaged = PerfDataGetKernelMemoryNonPagedK(); KernelMemoryNonPaged = PerfDataGetKernelMemoryNonPagedK();
_ultoa(KernelMemoryTotal, Text, 10); wsprintfW(Text, wszFormatDigit, KernelMemoryTotal);
SetWindowText(hPerformancePageKernelMemoryTotalEdit, Text); SetWindowTextW(hPerformancePageKernelMemoryTotalEdit, Text);
_ultoa(KernelMemoryPaged, Text, 10); wsprintfW(Text, wszFormatDigit, KernelMemoryPaged);
SetWindowText(hPerformancePageKernelMemoryPagedEdit, Text); SetWindowTextW(hPerformancePageKernelMemoryPagedEdit, Text);
_ultoa(KernelMemoryNonPaged, Text, 10); wsprintfW(Text, wszFormatDigit, KernelMemoryNonPaged);
SetWindowText(hPerformancePageKernelMemoryNonPagedEdit, Text); SetWindowTextW(hPerformancePageKernelMemoryNonPagedEdit, Text);
/* /*
* Update the physical memory info * Update the physical memory info
@ -203,12 +208,12 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK(); PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK();
PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK(); PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK();
PhysicalMemorySystemCache = PerfDataGetPhysicalMemorySystemCacheK(); PhysicalMemorySystemCache = PerfDataGetPhysicalMemorySystemCacheK();
_ultoa(PhysicalMemoryTotal, Text, 10); wsprintfW(Text, wszFormatDigit, PhysicalMemoryTotal);
SetWindowText(hPerformancePagePhysicalMemoryTotalEdit, Text); SetWindowTextW(hPerformancePagePhysicalMemoryTotalEdit, Text);
_ultoa(PhysicalMemoryAvailable, Text, 10); wsprintfW(Text, wszFormatDigit, PhysicalMemoryAvailable);
SetWindowText(hPerformancePagePhysicalMemoryAvailableEdit, Text); SetWindowTextW(hPerformancePagePhysicalMemoryAvailableEdit, Text);
_ultoa(PhysicalMemorySystemCache, Text, 10); wsprintfW(Text, wszFormatDigit, PhysicalMemorySystemCache);
SetWindowText(hPerformancePagePhysicalMemorySystemCacheEdit, Text); SetWindowTextW(hPerformancePagePhysicalMemorySystemCacheEdit, Text);
/* /*
* Update the totals info * Update the totals info
@ -216,12 +221,12 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
TotalHandles = PerfDataGetSystemHandleCount(); TotalHandles = PerfDataGetSystemHandleCount();
TotalThreads = PerfDataGetTotalThreadCount(); TotalThreads = PerfDataGetTotalThreadCount();
TotalProcesses = PerfDataGetProcessCount(); TotalProcesses = PerfDataGetProcessCount();
_ultoa(TotalHandles, Text, 10); wsprintfW(Text, wszFormatDigit, TotalHandles);
SetWindowText(hPerformancePageTotalsHandleCountEdit, Text); SetWindowTextW(hPerformancePageTotalsHandleCountEdit, Text);
_ultoa(TotalThreads, Text, 10); wsprintfW(Text, wszFormatDigit, TotalThreads);
SetWindowText(hPerformancePageTotalsThreadCountEdit, Text); SetWindowTextW(hPerformancePageTotalsThreadCountEdit, Text);
_ultoa(TotalProcesses, Text, 10); wsprintfW(Text, wszFormatDigit, TotalProcesses);
SetWindowText(hPerformancePageTotalsProcessCountEdit, Text); SetWindowTextW(hPerformancePageTotalsProcessCountEdit, Text);
/* /*
* Redraw the graphs * Redraw the graphs