Solved

API for NT services

Posted on 1998-08-18
2
233 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now