Andrew Nguyen : taskmgr: Remove all TCHAR macro usage in debug handling code.

Alexandre Julliard julliard at winehq.org
Tue May 17 12:53:00 CDT 2011


Module: wine
Branch: master
Commit: da5623cb83ab76fee58e460c0b2a6bafb6dbfd8f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=da5623cb83ab76fee58e460c0b2a6bafb6dbfd8f

Author: Andrew Nguyen <anguyen at codeweavers.com>
Date:   Tue May 17 05:15:18 2011 -0500

taskmgr: Remove all TCHAR macro usage in debug handling code.

---

 programs/taskmgr/debug.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/programs/taskmgr/debug.c b/programs/taskmgr/debug.c
index cbd3ebf..f6afd45 100644
--- a/programs/taskmgr/debug.c
+++ b/programs/taskmgr/debug.c
@@ -36,7 +36,7 @@
 void ProcessPage_OnDebug(void)
 {
     LVITEMW              lvitem;
-    ULONG                Index;
+    ULONG                Index, Count;
     DWORD                dwProcessId;
     WCHAR                wstrErrorText[256];
     HKEY                 hKey;
@@ -62,7 +62,8 @@ void ProcessPage_OnDebug(void)
     LoadStringW(hInst, IDS_DEBUG_UNABLE2DEBUG, wszUnable2Debug, sizeof(wszUnable2Debug)/sizeof(WCHAR));
     LoadStringW(hInst, IDS_DEBUG_MESSAGE, wszWarnMsg, sizeof(wszWarnMsg)/sizeof(WCHAR));
 
-    for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
+    Count = SendMessageW(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0);
+    for (Index=0; Index<Count; Index++)
     {
         lvitem.mask = LVIF_STATE;
         lvitem.stateMask = LVIS_SELECTED;
@@ -75,9 +76,9 @@ void ProcessPage_OnDebug(void)
             break;
     }
 
+    Count = SendMessageW(hProcessPageListCtrl, LVM_GETSELECTEDCOUNT, 0, 0);
     dwProcessId = PerfDataGetProcessId(Index);
-
-    if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0))
+    if ((Count != 1) || (dwProcessId == 0))
         return;
 
     if (MessageBoxW(hMainWnd, wszWarnMsg, wszWarnTitle, MB_YESNO|MB_ICONWARNING) != IDYES)
@@ -105,7 +106,7 @@ void ProcessPage_OnDebug(void)
 
     RegCloseKey(hKey);
 
-    hDebugEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+    hDebugEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
     if (!hDebugEvent)
     {
         GetLastErrorText(wstrErrorText, sizeof(wstrErrorText)/sizeof(WCHAR));




More information about the wine-cvs mailing list