Solved

API for NT services

Posted on 1998-08-18
2
240 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 50 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

632 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