mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
[TASKMGR]
- fix CIDs 731628 (unlikely buffer overrun), 500038 (dead code), 1101977 (unchecked return value) svn path=/trunk/; revision=64890
This commit is contained in:
parent
6256673633
commit
6f16539c0c
4 changed files with 17 additions and 15 deletions
|
@ -204,10 +204,13 @@ void UpdateColumnDataHints(void)
|
||||||
HDITEM hditem;
|
HDITEM hditem;
|
||||||
WCHAR text[260];
|
WCHAR text[260];
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
|
ULONG uItems;
|
||||||
WCHAR szTemp[256];
|
WCHAR szTemp[256];
|
||||||
unsigned int i;
|
UINT i;
|
||||||
|
|
||||||
for (Index=0; Index<(ULONG)SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); Index++)
|
uItems = min(SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0), COLUMN_NMAX);
|
||||||
|
|
||||||
|
for (Index=0; Index<uItems; Index++)
|
||||||
{
|
{
|
||||||
memset(&hditem, 0, sizeof(HDITEM));
|
memset(&hditem, 0, sizeof(HDITEM));
|
||||||
|
|
||||||
|
|
|
@ -120,17 +120,15 @@ void GraphCtrl_Dispose(TGraphCtrl* this)
|
||||||
if (this->m_brushBack != NULL) DeleteObject(this->m_brushBack);
|
if (this->m_brushBack != NULL) DeleteObject(this->m_brushBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd, UINT nID)
|
void GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd, UINT nID)
|
||||||
{
|
{
|
||||||
BOOL result = 0;
|
|
||||||
|
|
||||||
GraphCtrl_Init(this);
|
GraphCtrl_Init(this);
|
||||||
this->m_hParentWnd = hParentWnd;
|
this->m_hParentWnd = hParentWnd;
|
||||||
this->m_hWnd = hWnd;
|
this->m_hWnd = hWnd;
|
||||||
|
|
||||||
GraphCtrl_Resize(this);
|
GraphCtrl_Resize(this);
|
||||||
if (result != 0)
|
|
||||||
GraphCtrl_InvalidateCtrl(this, FALSE);
|
return;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double dUpper, int nDecimalPlaces)
|
void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double dUpper, int nDecimalPlaces)
|
||||||
|
|
|
@ -88,7 +88,7 @@ extern WNDPROC OldGraphCtrlWndProc;
|
||||||
double GraphCtrl_AppendPoint(TGraphCtrl* this,
|
double GraphCtrl_AppendPoint(TGraphCtrl* this,
|
||||||
double dNewPoint0, double dNewPoint1,
|
double dNewPoint0, double dNewPoint1,
|
||||||
double dNewPoint2, double dNewPoint3);
|
double dNewPoint2, double dNewPoint3);
|
||||||
BOOL GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd,
|
void GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd,
|
||||||
UINT nID);
|
UINT nID);
|
||||||
void GraphCtrl_Dispose(TGraphCtrl* this);
|
void GraphCtrl_Dispose(TGraphCtrl* this);
|
||||||
void GraphCtrl_DrawPoint(TGraphCtrl* this);
|
void GraphCtrl_DrawPoint(TGraphCtrl* this);
|
||||||
|
|
|
@ -154,13 +154,14 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
||||||
/* Get a token for this process. */
|
/* Get a token for this process. */
|
||||||
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
|
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
|
||||||
/* Get the LUID for the debug privilege. */
|
/* Get the LUID for the debug privilege. */
|
||||||
LookupPrivilegeValueW(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid);
|
if(LookupPrivilegeValueW(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid))
|
||||||
|
{
|
||||||
|
tkp.PrivilegeCount = 1; /* one privilege to set */
|
||||||
|
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||||
|
|
||||||
tkp.PrivilegeCount = 1; /* one privilege to set */
|
/* Get the debug privilege for this process. */
|
||||||
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
|
||||||
|
}
|
||||||
/* Get the debug privilege for this process. */
|
|
||||||
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
|
|
||||||
CloseHandle(hToken);
|
CloseHandle(hToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue