Click here to Skip to main content
15,895,142 members
Articles / Desktop Programming / MFC

Task Manager Extension 2.0

Rate me:
Please Sign up or sign in to vote.
4.92/5 (149 votes)
22 Jan 2007CDDL11 min read 598.3K   18.7K   263  
Task Manager Extension. This is a Windows Task Manager (NT/2000/XP/2003) plug-in. It adds lots of useful features to the standard Task Manager. It can show process modules, memory map, used handles, open files, file properties and a lot of other info!
//////////////////////////////////////////////////////////////
// File:		// SecurityInformation.h
// File time:	// 25.04.2005	12:34
// Version: 	// 1.0
/******************************************************************************
Module:  AccessData.h
Notices: Copyright (c) 2000 Jeffrey Richter
Modified: Sergey Kolomenkin, 2005
******************************************************************************/
// Description: //////////////////////////////////////////////
//   Some useful routines...
//   

#ifndef _SECURITYINFORMATION_H_UID000000064B899E35
#define _SECURITYINFORMATION_H_UID000000064B899E35

//#include <ACLAPI.h>
#include <ACLUI.h>
#include "../TaskManagerExDll/WinObjects.h"

///////////////////////////////////////////////////////////////////////////////

#ifndef UNICODE
//#error This module must be compiled natively using Unicode.
#endif

///////////////////////////////////////////////////////////////////////////////

typedef struct _ObjectInformation {
	HANDLE			m_hHandle;
	OB_TYPE_ENUM	m_objInternalType;
	TCHAR			m_szName[1024];			// Object name. If empty, then m_hHandle member is used.

	TCHAR			m_szObjectName[2048];	// Screen Name
} ObjectInformation;


///////////////////////////////////////////////////////////////////////////////

class CSecurityInformation: public ISecurityInformation
{
public:

	static CSecurityInformation* CreateInstance(ObjectInformation Info, BOOL fBinary);

	BOOL EditSecurity( HWND hwnd );

private:

	CSecurityInformation(ObjectInformation Info, BOOL fBinary);
	virtual ~CSecurityInformation();

	struct OBJECT_SI_ACCESS
	{
		OB_TYPE_ENUM		m_objInternalType;
		SE_OBJECT_TYPE		m_objSecurType;
		SI_ACCESS m[19+4];
	};

	static GUID				m_guidNULL;
	static OBJECT_SI_ACCESS	m_siAccessAllRights[];
	static SI_ACCESS		m_siAccessBinaryRights[];
	static SI_INHERIT_TYPE	m_siInheritType[];

	ObjectInformation	m_Info;
	ObjTypeInf			m_Type;
	WCHAR				m_szObjectName[2048];	// Screen Name

	BOOL				m_fBinary;

	ULONG				m_nRef;

public:
	HRESULT WINAPI QueryInterface(REFIID riid, PVOID* ppvObj);
	ULONG WINAPI AddRef();
	ULONG WINAPI Release();

private:
	HRESULT WINAPI GetObjectInformation(PSI_OBJECT_INFO pObjectInfo);
	HRESULT WINAPI GetSecurity(SECURITY_INFORMATION RequestedInformation,
						PSECURITY_DESCRIPTOR* ppSecurityDescriptor, BOOL fDefault);
	HRESULT WINAPI SetSecurity(SECURITY_INFORMATION SecurityInformation,
						PSECURITY_DESCRIPTOR pSecurityDescriptor);
	HRESULT WINAPI GetAccessRights(const GUID* pguidObjectType,
						DWORD dwFlags, // si_edit_audits, si_edit_properties
						PSI_ACCESS* ppAccess, ULONG* pcAccesses, ULONG* piDefaultAccess);
	HRESULT WINAPI MapGeneric(const GUID* pguidObjectType,
						UCHAR* pAceFlags, ACCESS_MASK* pMask);
	HRESULT WINAPI GetInheritTypes(PSI_INHERIT_TYPE* ppInheritTypes, 
						ULONG* pcInheritTypes);
	HRESULT WINAPI PropertySheetPageCallback(HWND hwnd, UINT uMsg, 
						SI_PAGE_TYPE uPage);
};


#endif //ifndef _SECURITYINFORMATION_H_UID000000064B899E35

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
Software Developer (Senior)
Belarus Belarus
He is a young and forward-looking software developer. He also has lots of interesting hobbies like snowboarding, bicycle riding, carting racing and of course talking about himself in a third person. Smile | :)

github.com/kolomenkin

Curriculum Vitae

Comments and Discussions