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: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • 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.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds