taskmgr: Remove all TCHAR macro usage in debug channel dialog code.

This commit is contained in:
Andrew Nguyen 2011-05-18 07:06:29 -05:00 committed by Alexandre Julliard
parent 6867393614
commit 1d9b7bda82
2 changed files with 18 additions and 15 deletions

View File

@ -2,7 +2,7 @@ MODULE = taskmgr.exe
APPMODE = -mwindows -mno-cygwin APPMODE = -mwindows -mno-cygwin
IMPORTS = psapi shell32 comctl32 user32 gdi32 advapi32 IMPORTS = psapi shell32 comctl32 user32 gdi32 advapi32
EXTRAINCL = -I$(top_srcdir)/include/msvcrt EXTRAINCL = -I$(top_srcdir)/include/msvcrt
EXTRADEFS = -DNO_LIBWINE_PORT EXTRADEFS = -DNO_LIBWINE_PORT -DWINE_NO_UNICODE_MACROS
MODCFLAGS = @BUILTINFLAG@ MODCFLAGS = @BUILTINFLAG@
C_SRCS = \ C_SRCS = \

View File

@ -81,26 +81,27 @@ BOOL AreDebugChannelsSupported(void)
static DWORD get_selected_pid(void) static DWORD get_selected_pid(void)
{ {
LVITEM lvitem; LVITEMW lvitem;
ULONG Index; ULONG Index, Count;
DWORD dwProcessId; DWORD dwProcessId;
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.mask = LVIF_STATE;
lvitem.stateMask = LVIS_SELECTED; lvitem.stateMask = LVIS_SELECTED;
lvitem.iItem = Index; lvitem.iItem = Index;
lvitem.iSubItem = 0; lvitem.iSubItem = 0;
SendMessage(hProcessPageListCtrl, LVM_GETITEM, 0, (LPARAM) &lvitem); SendMessageW(hProcessPageListCtrl, LVM_GETITEMW, 0, (LPARAM) &lvitem);
if (lvitem.state & LVIS_SELECTED) if (lvitem.state & LVIS_SELECTED)
break; break;
} }
Count = SendMessageW(hProcessPageListCtrl, LVM_GETSELECTEDCOUNT, 0, 0);
dwProcessId = PerfDataGetProcessId(Index); dwProcessId = PerfDataGetProcessId(Index);
if ((Count != 1) || (dwProcessId == 0))
if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0))
return 0; return 0;
return dwProcessId; return dwProcessId;
} }
@ -108,17 +109,19 @@ static DWORD get_selected_pid(void)
static int list_channel_CB(HANDLE hProcess, void* addr, struct __wine_debug_channel* channel, void* user) static int list_channel_CB(HANDLE hProcess, void* addr, struct __wine_debug_channel* channel, void* user)
{ {
int j; int j;
WCHAR val[2]; WCHAR nameW[sizeof(channel->name)], val[2];
LVITEMA lvitem; LVITEMW lvitem;
int index; int index;
HWND hChannelLV = user; HWND hChannelLV = user;
MultiByteToWideChar(CP_ACP, 0, channel->name, sizeof(channel->name), nameW, sizeof(nameW)/sizeof(WCHAR));
lvitem.mask = LVIF_TEXT; lvitem.mask = LVIF_TEXT;
lvitem.pszText = channel->name; lvitem.pszText = nameW;
lvitem.iItem = 0; lvitem.iItem = 0;
lvitem.iSubItem = 0; lvitem.iSubItem = 0;
index = ListView_InsertItem(hChannelLV, &lvitem); index = ListView_InsertItemW(hChannelLV, &lvitem);
if (index == -1) return 0; if (index == -1) return 0;
val[1] = '\0'; val[1] = '\0';
@ -209,13 +212,13 @@ static void DebugChannels_FillList(HWND hChannelLV)
{ {
HANDLE hProcess; HANDLE hProcess;
SendMessage(hChannelLV, LVM_DELETEALLITEMS, 0, 0); SendMessageW(hChannelLV, LVM_DELETEALLITEMS, 0, 0);
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_READ, FALSE, get_selected_pid()); hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_READ, FALSE, get_selected_pid());
if (!hProcess) return; /* FIXME messagebox */ if (!hProcess) return; /* FIXME messagebox */
SendMessage(hChannelLV, WM_SETREDRAW, FALSE, 0); SendMessageW(hChannelLV, WM_SETREDRAW, FALSE, 0);
enum_channel(hProcess, list_channel_CB, (void*)hChannelLV); enum_channel(hProcess, list_channel_CB, (void*)hChannelLV);
SendMessage(hChannelLV, WM_SETREDRAW, TRUE, 0); SendMessageW(hChannelLV, WM_SETREDRAW, TRUE, 0);
CloseHandle(hProcess); CloseHandle(hProcess);
} }
@ -287,7 +290,7 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
if (!hProcess) return; /* FIXME message box */ if (!hProcess) return; /* FIXME message box */
lhti.pt = nmia->ptAction; lhti.pt = nmia->ptAction;
hChannelLV = GetDlgItem(hDlg, IDC_DEBUG_CHANNELS_LIST); hChannelLV = GetDlgItem(hDlg, IDC_DEBUG_CHANNELS_LIST);
SendMessage(hChannelLV, LVM_SUBITEMHITTEST, 0, (LPARAM)&lhti); SendMessageW(hChannelLV, LVM_SUBITEMHITTEST, 0, (LPARAM)&lhti);
if (nmia->iSubItem >= 1 && nmia->iSubItem <= 4) if (nmia->iSubItem >= 1 && nmia->iSubItem <= 4)
{ {
WCHAR val[2]; WCHAR val[2];