#include "taskmgr.h"
#include ".\procpage.h"
//-------------------------------------------------------------函数声明--------------------------------------------
BOOL InsertIntoSortedArray(CPtrArray * pArray, CProcInfo * pProc);
BOOL ResortArray(CPtrArray ** ppArray);
//-------------------------------------------------------------变量声明--------------------------------------------
SYSTEM_BASIC_INFORMATION g_BasicInfo;
DWORD g_cProcesses = 0;
//
// Table of which resource IDs in the column selection dialog
// correspond to which columns
//
int g_aDlgColIDs[] =
{
IDC_IMAGENAME,
IDC_PID,
// #ifdef _HYDRA_
IDC_USERNAME,
IDC_SESSIONID,
// #endif
IDC_CPU,
IDC_CPUTIME,
IDC_MEMUSAGE,
IDC_MEMPEAK,
IDC_MEMUSAGEDIFF,
IDC_PAGEFAULTS,
IDC_PAGEFAULTSDIFF,
IDC_COMMITCHARGE,
IDC_PAGEDPOOL,
IDC_NONPAGEDPOOL,
IDC_BASEPRIORITY,
IDC_HANDLECOUNT,
IDC_THREADCOUNT,
IDC_USEROBJECTS,
IDC_GDIOBJECTS,
IDC_READOPERCOUNT,
IDC_WRITEOPERCOUNT,
IDC_OTHEROPERCOUNT,
IDC_READXFERCOUNT,
IDC_WRITEXFERCOUNT,
IDC_OTHERXFERCOUNT
};
//
// Column Default Info
//
struct
{
INT Format;
INT Width;
} ColumnDefaults[NUM_COLUMN] =
{
{ LVCFMT_LEFT, 0x6B }, // COL_IMAGENAME
{ LVCFMT_RIGHT, 50 }, // COL_PID
//#ifdef _HYDRA_
{ LVCFMT_LEFT, 0x6B }, // COL_USERNAME
{ LVCFMT_RIGHT, 70 }, // COL_SESSIONID
//#endif
{ LVCFMT_RIGHT, 35}, // COL_CPU
{ LVCFMT_RIGHT, 70 }, // COL_CPUTIME
{ LVCFMT_RIGHT, 70 }, // COL_MEMUSAGE
{ LVCFMT_RIGHT, 100 }, // COL_MEMPEAK
{ LVCFMT_RIGHT, 70 }, // COL_MEMUSAGEDIFF
{ LVCFMT_RIGHT, 70 }, // COL_PAGEFAULTS
{ LVCFMT_RIGHT, 70 }, // COL_PAGEFAULTSDIFF
{ LVCFMT_RIGHT, 70 }, // COL_COMMITCHARGE
{ LVCFMT_RIGHT, 70 }, // COL_PAGEDPOOL
{ LVCFMT_RIGHT, 70 }, // COL_NONPAGEDPOOL
{ LVCFMT_RIGHT, 60 }, // COL_BASEPRIORITY
{ LVCFMT_RIGHT, 60 }, // COL_HANDLECOUNT
{ LVCFMT_RIGHT, 60 }, // COL_THREADCOUNT
{ LVCFMT_RIGHT, 60 }, // COL_USEROBJECTS
{ LVCFMT_RIGHT, 60 }, // COL_GDIOBJECTS
{ LVCFMT_RIGHT, 70 }, // COL_READOPERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_WRITEOPERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_OTHEROPERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_READXFERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_WRITEXFERCOUNT
{ LVCFMT_RIGHT, 70 } // COL_OTHERXFERCOUNT
};
/*++ class CProcPage::SetupColumns
Class Description:
Removes any existing columns from the process listview and
adds all of the columns listed in the g_Options.m_ActiveProcCol array.
Arguments:
Return Value:
HRESULT
Revision History:
Nov-16-95 Davepl Created
--*/
static const _aIDColNames[NUM_COLUMN] =
{
IDS_COL_IMAGENAME,
IDS_COL_PID,
// #ifdef _HYDRA_
IDS_COL_USERNAME,
IDS_COL_SESSIONID,
// #endif
IDS_COL_CPU,
IDS_COL_CPUTIME,
IDS_COL_MEMUSAGE,
IDS_COL_MEMPEAK,
IDS_COL_MEMUSAGEDIFF,
IDS_COL_PAGEFAULTS,
IDS_COL_PAGEFAULTSDIFF,
IDS_COL_COMMITCHARGE,
IDS_COL_PAGEDPOOL,
IDS_COL_NONPAGEDPOOL,
IDS_COL_BASEPRIORITY,
IDS_COL_HANDLECOUNT,
IDS_COL_THREADCOUNT,
IDS_COL_USEROBJECTS,
IDS_COL_GDIOBJECTS,
IDS_COL_READOPERCOUNT,
IDS_COL_WRITEOPERCOUNT,
IDS_COL_OTHEROPERCOUNT,
IDS_COL_READXFERCOUNT,
IDS_COL_WRITEXFERCOUNT,
IDS_COL_OTHERXFERCOUNT
};
static struct
{
size_t cbOffset;
UINT idString;
}
g_OffsetMap[] =
{
{ FIELD_OFFSET(CSysInfo, m_cHandles), IDC_TOTAL_HANDLES },
{ FIELD_OFFSET(CSysInfo, m_cThreads), IDC_TOTAL_THREADS },
{ FIELD_OFFSET(CSysInfo, m_cProcesses), IDC_TOTAL_PROCESSES },
{ FIELD_OFFSET(CSysInfo, m_dwPhysicalMemory), IDC_TOTAL_PHYSICAL },
{ FIELD_OFFSET(CSysInfo, m_dwPhysAvail), IDC_AVAIL_PHYSICAL },
{ FIELD_OFFSET(CSysInfo, m_dwFileCache), IDC_FILE_CACHE },
{ FIELD_OFFSET(CSysInfo, m_dwCommitTotal), IDC_COMMIT_TOTAL },
{ FIELD_OFFSET(CSysInfo, m_dwCommitLimit), IDC_COMMIT_LIMIT },
{ FIELD_OFFSET(CSysInfo, m_dwCommitPeak), IDC_COMMIT_PEAK },
{ FIELD_OFFSET(CSysInfo, m_dwKernelPaged), IDC_KERNEL_PAGED },
{ FIELD_OFFSET(CSysInfo, m_dwKernelNP), IDC_KERNEL_NONPAGED },
{ FIELD_OFFSET(CSysInfo, m_dwKernelTotal), IDC_KERNEL_TOTAL },
};
//---------------------------------------------------------------------------------------------------------
CProcPage::CProcPage(void)
{
m_hPage = NULL;
m_hwndTabs = NULL;
m_pProcArray = NULL;
m_pvBuffer = NULL;
m_cbBuffer = 0;
m_fPaused = FALSE;
m_pszDebugger = NULL;
OnSettingsChange();
}
CProcPage::~CProcPage(void)
{
if (m_pProcArray)
{
INT c = m_pProcArray->GetSize();
while (c)
{
delete (CProcInfo *) (m_pProcArray->GetAt(c - 1));
c--;
}
delete m_pProcArray;
}
}
//-----------------------------------------------------------全局函数-----------------------------------------------
/*++ InsertIntoSortedArray
Class Description:
Sticks a CProcInfo ptr into the ptrarray supplied at the
appropriate location based on the current sort column (which
is used by the Compare member function)
Arguments:
pArray - The CPtrArray to add to
pProc - The CProcInfo object to add to the array
Return Value:
TRUE if successful, FALSE if fails
Revision History:
Nov-20-95 Davepl Created
--*/
// REVIEW (davepl) Use binary insert here, not linear
BOOL InsertIntoSortedArray(CPtrArray * pArray, CProcInfo * pProc)
{
INT cItems = pArray->GetSize();
for (INT iIndex = 0; iIndex < cItems; iIndex++)
{
CProcInfo * pTmp = (CProcInfo *) pArray->GetAt(iIndex);
if (pProc->Compare(pTmp) < 0)
{
return pArray->InsertAt(iIndex, pProc);
}
}
return pArray->Add(pProc);
}
/*++ IsTerminalServer
Routine Description:
One time call to ValidateProductSuite to
determine if we're running terminalServer
Arguments:
< None >
Return Value:
BOOL
Revision History:
Jun-30-98 alhen revised ( no creation info supplied )
--*/
BOOL IsTerminalServer()
{
static BOOL s_bIsTerminalServer = ValidateProductSuite( );
// if the exports are not available it's just the same that terminal server
// is not properly configured and terminal services options should not be available
return( s_bIsTerminalServer && gpfnWinStationGetProcessSid != NULL && gpfnCachedGetUserFromSid != NULL );
}
/* ++ ValidateProductSuite
Routine Description:
Retrieves OSVERSIONINFO, but we're only interested
in the wSuiteMask
Arguments:
< None >
Return Value:
BOOL
Revision History:
Jul-1-98 alhen
-- */
BOOL ValidateProductSuite( )
{
OSVERSIONINFOEXW osVersionInfo;
DWORDLONG dwlConditionMask = 0;
ZeroMemory( &osVersionInfo , sizeof( OSVERSIONINFOEX ) );
osVersionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX );
osVersionInfo.wSuiteMask = VER_SUITE_TERMINAL;
VER_SET_CONDITION( dwlConditionMask, VER_SUITENAME, VER_AND );
return VerifyVersionInfo( &osVersionInfo , VER_SUITENAME , dwlConditionMask );
}
//
// Take two unsigned 64-bit values an
小码叔
- 粉丝: 5177
- 资源: 5296
最新资源
- PLC 西门子smart200 锁机 最新原创有图片证明配对应西门子smart700IE V3程序,分期期付款 动态验证码,无限次加密 程序例程
- 汇编语言基础入门知识和案例
- 基于ssm的就业信息管理系统源码(java毕业设计完整源码+LW).zip
- 土豆缺陷识别数据集,使用yolov11格式标注,8034张图片,识别率在81.2%,可识别损坏的土豆缺陷土豆,病菌感染的土豆,正常土豆等
- 无刷电机FOC控制量产方案,原理图,PCB,源代码,元器件BOM 可用于电动三轮,电动车等代步工具上,代码基于C语言,功能丰富,具有刹车功能、助力功能、欠压检测、巡航功能、防盗、自学习、故障显示等功
- 土豆缺陷识别数据集,使用yolov9格式标注,8034张图片,识别率在81.2%,可识别损坏的土豆缺陷土豆,病菌感染的土豆,正常土豆等
- matlab绘图的.m文件,里面涉及到字体大小,横纵坐标调整等操作,有需要自取
- 建筑地震保护系统建模与分析:基于小振幅及榫头锁入条件的研究
- 基于ssm的二手交易平台网站源码(java毕业设计完整源码+LW).zip
- 土豆缺陷识别数据集,使用yolov8格式标注,8034张图片,识别率在81.2%,可识别损坏的土豆缺陷土豆,病菌感染的土豆,正常土豆等
- 基于ssm的家用电器销售网站源码(java毕业设计完整源码+LW).zip
- 不同颜色正方体检测59-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 基于ssm的影院管理系统源码(java毕业设计完整源码+LW).zip
- 土豆缺陷识别数据集,使用yolov7格式标注,8034张图片,识别率在81.2%,可识别损坏的土豆缺陷土豆,病菌感染的土豆,正常土豆等
- 开发者专用浏览器 免费浏览器 - 干净好用的浏览器
- java超市综合管理信息系统源代码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈