Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

API for NT services

Posted on 1998-08-18
2
Medium Priority
?
241 Views
Last Modified: 2013-11-20
Hi,

I'm writing a VC++ 5.0 application on NT 4.0
I need to get a list of all services on the NT system and all their attributes(running, stopped, automatic start, hardware profile settings, etc.)
Is there an API that gives me access to this information?
Does anyone have some source code you can point me at?

thanks,
ralph
0
Comment
Question by:rakhras
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
jdyer earned 150 total points
ID: 1320962
Use the GetService function with is part of the wsock32 library. Here is the declaration, if you need the definition, I will post a comment with it.

INT GetService(
 
    DWORD  dwNameSpace,      // specifies name space or spaces to search
    PGUID  lpGuid,      // points to GUID service type
    LPTSTR  lpServiceName,      // points to service name
    DWORD  dwProperties,      // specifies service information to be obtained
    LPVOID  lpBuffer,      // points to buffer to receive service information
    LPDWORD  lpdwBufferSize,      // points to size of buffer, size of service information
    LPSERVICE_ASYNC_INFO  lpServiceAsyncInfo       // reserved for future use, must be NULL
   );

Regards,
  jdyer
0
 
LVL 1

Expert Comment

by:jdyer
ID: 1320963
Also checkout EnumServicesStatus!

Regards,
  jdyer
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question