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

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

  • On-demand Event Event Date: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

Most Popular Programming Stories

More for Developers

RSS Feeds