NT Service Manager

Maybe sometimes someone wants to control services. If he or she is administrator, I thing this program may be helpful. Things to try:
1. Double-click list item to see dependencies.
2. Press F1 to see a-quite-not-usual-about-box.
3. Control services via start/stop/pause down-left buttons.
4. Right-click on list to customize appearance..
5. Click on list header to sort items. Multiple sort in future.
6. Look in source code if you found something.

You will easily recognise HTML static (from Codeguru) and some other burrowed stuff...


Tips for:
- services control (start/stop/continue) over Intranet;
- establish if an user is NT Administrator;
- 'relief' button
and more.



Establish if an user is NT Administrator:



BOOL
UserIsNTAdmin()
{
BOOL bIsAdmin = FALSE;

HANDLE hProcess, hAccessToken;
UCHAR InfoBuffer[INFOBUFFERSIZE];
PTOKEN_GROUPS ptgGroups = (PTOKEN_GROUPS)InfoBuffer;
DWORD dwInfoBufferSize;
PSID psidAdministrators;
SID_IDENTIFIER_AUTHORITY siaNTAuthority = SECURITY_NT_AUTHORITY;
UINT uCount;

hProcess = GetCurrentProcess();
if(!OpenProcessToken(hProcess, TOKEN_READ, &hAccessToken))
return FALSE;

bIsAdmin = GetTokenInformation(hAccessToken, TokenGroups, InfoBuffer, INFOBUFFERSIZE, &dwInfoBufferSize);
CloseHandle(hAccessToken);

if(!bIsAdmin)
return FALSE;

if(!AllocateAndInitializeSid(&siaNTAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0, &psidAdministrators))
return FALSE;

bIsAdmin = FALSE;
for(uCount = 0; uCount < ptgGroups->GroupCount; uCount++)
{
if(EqualSid(psidAdministrators, ptgGroups->Groups[uCount].Sid))
{
bIsAdmin = TRUE;
break;
}
}
FreeSid(psidAdministrators);

return bIsAdmin;
}

Downloads

Download demo project - 36 KB

Download source - 54 KB

Download images - 44 KB

History



Comments

  • No worky

    Posted by Legacy on 04/11/2003 12:00am

    Originally posted by: tj dudere

    no worky

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • IBM Worklight is a mobile application development platform that lets you extend your business to mobile devices. It is designed to provide an open, comprehensive platform to build, run and manage HTML5, hybrid and native mobile apps.

  • A modern mobile IT strategy is no longer an option, it is an absolute business necessity. Today's most productive employees are not tied to a desk, an office, or a location. They are mobile. And your company's IT strategy has to be ready to support them with easy, reliable, 24/7 access to the business information they need, from anywhere in the world, across a broad range of communication devices. Here's how some of the nation's most progressive corporations are meeting the many needs of their mobile workers …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds