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: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Hundreds of millions of users have adopted public cloud storage solutions to satisfy their Private Online File Sharing and Collaboration (OFS) needs. With new headlines on cloud privacy issues appearing almost daily, the need to explore private alternatives has never been stronger. Join ESG Senior Analyst Terri McClure and Connected Data in this on-demand webinar to take a look at the business drivers behind OFS adoption, how organizations can benefit from on-premise deployments, and emerging private OFS …

Most Popular Programming Stories

More for Developers

RSS Feeds