Solved

API for NT services

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries DB2 Query 2 97
Smart Camera scanning and reading information 3 113
modThree challenge 4 96
Problem to event 3 102
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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…
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.

809 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