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

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • QA teams don't have time to test everything yet they can't afford to ship buggy code. Learn how Coverity can help organizations shrink their testing cycles and reduce regression risk by focusing their manual and automated testing based on the impact of change.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds