please dont rip this site Prev Next

EnumServicesStatus info  Overview  Group

The EnumServicesStatus function enumerates services in the specified service control manager database. The name and status of each service are provided.

BOOL EnumServicesStatus(

    SC_HANDLE hSCManager,

// handle to service control manager database

    DWORD dwServiceType,

// type of services to enumerate

    DWORD dwServiceState,

// state of services to enumerate

    LPENUM_SERVICE_STATUS lpServices,

// pointer to service status buffer

    DWORD cbBufSize,

// size of service status buffer

    LPDWORD pcbBytesNeeded,

// pointer to variable for bytes needed

    LPDWORD lpServicesReturned,

// pointer to variable for number returned

    LPDWORD lpResumeHandle 

// pointer to variable for next entry

   );

Parameters

hSCManager
Identifies the service control manager database. The OpenSCManager function returns this handle, which must have SC_MANAGER_ENUMERATE_SERVICE access.
dwServiceType
Specifies the type of services to enumerate. It must be one or both of the following values:

Value

Meaning

SERVICE_WIN32

Enumerates services of type SERVICE_WIN32_OWN_PROCESS and SERVICE_WIN32_SHARE_PROCESS.

SERVICE_DRIVER

Enumerates services of type SERVICE_KERNEL_DRIVER and SERVICE_FILE_SYSTEM_DRIVER.

dwServiceState
Specifies the services to enumerate based on their running state. It must be one or both of the following values:

Value

Meaning

SERVICE_ACTIVE

Enumerates services that are in the following states: SERVICE_START_PENDING, SERVICE_STOP_PENDING, SERVICE_RUNNING, SERVICE_CONTINUE_PENDING, SERVICE_PAUSE_PENDING, and SERVICE_PAUSED.

SERVICE_INACTIVE

Enumerates services that are in the SERVICE_STOPPED state.

SERVICE_STATE_ALL

Combines the following states: SERVICE_ACTIVE and SERVICE_INACTIVE.

lpServices
Points to an array of ENUM_SERVICE_STATUS structures in which the name and service status information for each service in the database is returned. The buffer includes the structures, plus the strings to which their members point.
cbBufSize
Specifies the size, in bytes, of the buffer pointed to by the lpServices parameter.
pcbBytesNeeded
Points to a variable that receives the number of bytes needed to return the remaining service entries.
lpServicesReturned
Points to a variable that receives the number of service entries returned.
lpResumeHandle
Points to a DWORD variable that is used for both input and output. On input, this value specifies the starting point of enumeration. You must set this value to zero the first time this function is called. On output, this value is zero if the function succeeds. However, if the function returns zero and the GetLastError function returns ERROR_MORE_DATA, this value is used to indicate the next service entry to be read when the function is called to retrieve the additional data.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Errors

The following error codes can be set by the service control manager. Other error codes can be set by the registry functions that are called by the service control manager.

Value

Meaning

ERROR_ACCESS_DENIED

The specified handle was not opened with SC_MANAGER_ENUMERATE_SERVICE access.

ERROR_INVALID_HANDLE

The specified handle is invalid.

ERROR_INVALID_PARAMETER

A parameter that was specified is invalid.

ERROR_MORE_DATA

There are more service entries than would fit into the lpServices buffer. The actual number of service entries written to lpServices is returned in the lpServicesReturned parameter. The number of bytes required to get the remaining entries is returned in the pcbBytesNeeded parameter. The remaining services can be enumerated by additional calls to EnumServicesStatus with the lpResumeHandle parameter indicating the next service to read.

See Also

EnumDependentServices, ENUM_SERVICE_STATUS, OpenSCManager 


file: /Techref/os/win/api/win32/func/src/f21_16.htm, 8KB, , updated: 2000/4/7 11:19, local time: 2024/11/22 23:38,
TOP NEW HELP FIND: 
18.117.166.193:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/techref/os/win/api/win32/func/src/f21_16.htm"> EnumServicesStatus</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .