by Todd G. Nist
Program source is available for download: w-findservice.w
This is a program for an NT environment which will determine all of the computers on a given network and which services they are running. You can then inquire of a given server what the status is of a services and it will return weather it is running, in error, etc...
It has only been tested under NT 4.0 with service pack 3. You will have to be logged into and authenticated on the network in order to inquire of the status of services running on other machines in the network.
API-procedures used in this example are listed here to be included in the search index: PROCEDURE CloseServiceHandle EXTERNAL "advapi32.dll" PROCEDURE EnumServicesStatusA EXTERNAL "advapi32.dll" PROCEDURE OpenSCManagerA EXTERNAL "advapi32.dll" PROCEDURE OpenServiceA EXTERNAL "advapi32.dll" PROCEDURE QueryServiceConfigA EXTERNAL "advapi32.dll" PROCEDURE QueryServiceStatus EXTERNAL "advapi32.dll" PROCEDURE NetServerEnum EXTERNAL "Netapi32.dll" PROCEDURE NetApiBufferFree EXTERNAL "Netapi32.dll" PROCEDURE lstrcpyW EXTERNAL "kernel32.dll" PROCEDURE lstrlen EXTERNAL "kernel32.dll" PROCEDURE RtlMoveMemory EXTERNAL "kernel32.dll" PROCEDURE WideCharToMultiByte EXTERNAL "kernel32.dll" PROCEDURE GetComputerNameA EXTERNAL "kernel32.dll"
w-findservice.w.zip : example program