Author: gschneider
Date: Fri Apr 9 00:10:45 2010
New Revision: 46782
URL:
http://svn.reactos.org/svn/reactos?rev=46782&view=rev
Log:
[TASKMGR]
- Don't try to query a performance index when switching from application to process
tab
- Query a process index instead: "go to process" works now
Modified:
trunk/reactos/base/applications/taskmgr/applpage.c
trunk/reactos/base/applications/taskmgr/perfdata.c
trunk/reactos/base/applications/taskmgr/procpage.c
Modified: trunk/reactos/base/applications/taskmgr/applpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/applpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/applpage.c [iso-8859-1] Fri Apr 9 00:10:45
2010
@@ -49,7 +49,7 @@
void ApplicationPageShowContextMenu1(void);
void ApplicationPageShowContextMenu2(void);
int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM
lParamSort);
-int PerfGetIndexByProcessId(DWORD dwProcessId);
+int ProcGetIndexByProcessId(DWORD dwProcessId);
#if 0
void SwitchToThisWindow (
@@ -878,7 +878,6 @@
LPAPPLICATION_PAGE_LIST_ITEM pAPLI = NULL;
LV_ITEM item;
int i;
- /* NMHDR nmhdr; */
for (i=0; i<ListView_GetItemCount(hApplicationPageListCtrl); i++) {
memset(&item, 0, sizeof(LV_ITEM));
@@ -902,7 +901,7 @@
/*
* Select the process item in the list
*/
- i = PerfGetIndexByProcessId(dwProcessId);
+ i = ProcGetIndexByProcessId(dwProcessId);
if (i != -1)
{
ListView_SetItemState(hProcessPageListCtrl,
Modified: trunk/reactos/base/applications/taskmgr/perfdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] Fri Apr 9 00:10:45
2010
@@ -387,27 +387,6 @@
return bSuccessful;
}
-int PerfGetIndexByProcessId(DWORD dwProcessId)
-{
- int FoundIndex = -1;
- ULONG Index;
-
- EnterCriticalSection(&PerfDataCriticalSection);
-
- for (Index = 0; Index < ProcessCount; Index++)
- {
- if (PtrToUlong(pPerfData[Index].ProcessId) == dwProcessId)
- {
- FoundIndex = Index;
- break;
- }
- }
-
- LeaveCriticalSection(&PerfDataCriticalSection);
-
- return FoundIndex;
-}
-
ULONG PerfDataGetProcessId(ULONG Index)
{
ULONG ProcessId;
Modified: trunk/reactos/base/applications/taskmgr/procpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/procpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/procpage.c [iso-8859-1] Fri Apr 9 00:10:45
2010
@@ -54,6 +54,27 @@
DWORD WINAPI ProcessPageRefreshThread(void *lpParameter);
int ProcessRunning(ULONG ProcessId);
+int ProcGetIndexByProcessId(DWORD dwProcessId)
+{
+ int i;
+ LVITEM item;
+ LPPROCESS_PAGE_LIST_ITEM pData;
+
+ for (i=0; i<ListView_GetItemCount(hProcessPageListCtrl); i++)
+ {
+ memset(&item, 0, sizeof(LV_ITEM));
+ item.mask = LVIF_PARAM;
+ item.iItem = i;
+ (void)ListView_GetItem(hProcessPageListCtrl, &item);
+ pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
+ if (PerfDataGetProcessId(pData->Index) == dwProcessId)
+ {
+ return i;
+ }
+ }
+ return 0;
+}
+
DWORD GetSelectedProcessId(void)
{
int Index;
@@ -427,7 +448,9 @@
pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
if (!ProcessRunning(pData->ProcessId))
{
- (void)ListView_DeleteItem(hProcessPageListCtrl, i);
+ MessageBox(NULL, L"Processs is dead", L"HM?", MB_OK);
+ if (ListView_DeleteItem(hProcessPageListCtrl, i) == FALSE)
+ MessageBox(NULL, L"Deletion failed", L"HM!", MB_OK);
HeapFree(GetProcessHeap(), 0, pData);
}
}