RmGetList function (restartmanager.h)

Gets a list of all applications and services that are currently using resources that have been registered with the Restart Manager session.

Syntax

DWORD RmGetList(
  [in]                DWORD              dwSessionHandle,
  [out]               UINT               *pnProcInfoNeeded,
  [in, out]           UINT               *pnProcInfo,
  [in, out, optional] RM_PROCESS_INFO [] rgAffectedApps,
  [out]               LPDWORD            lpdwRebootReasons
);

Parameters

[in] dwSessionHandle

A handle to an existing Restart Manager session.

[out] pnProcInfoNeeded

A pointer to an array size necessary to receive RM_PROCESS_INFO structures required to return information for all affected applications and services.

[in, out] pnProcInfo

A pointer to the total number of RM_PROCESS_INFO structures in an array and number of structures filled.

[in, out, optional] rgAffectedApps

An array of RM_PROCESS_INFO structures that list the applications and services using resources that have been registered with the session.

[out] lpdwRebootReasons

Pointer to location that receives a value of the RM_REBOOT_REASON enumeration that describes the reason a system restart is needed.

Return value

This is the most recent error received. The function can return one of the system error codes that are defined in Winerror.h.

Value Meaning
ERROR_SUCCESS
0
The function completed successfully.
ERROR_MORE_DATA
234
This error value is returned by the RmGetList function if the rgAffectedApps buffer is too small to hold all application information in the list.
ERROR_CANCELLED
1223
The current operation is canceled by user.
ERROR_SEM_TIMEOUT
121
A Restart Manager function could not obtain a Registry write mutex in the allotted time. A system restart is recommended because further use of the Restart Manager is likely to fail.
ERROR_BAD_ARGUMENTS
160
One or more arguments are not correct. This error value is returned by the Restart Manager function if a NULL pointer or 0 is passed in a parameter that requires a non-null and non-zero value.
ERROR_WRITE_FAULT
29
An operation was unable to read or write to the registry.
ERROR_OUTOFMEMORY
14
A Restart Manager operation could not complete because not enough memory was available.
ERROR_INVALID_HANDLE
6
No Restart Manager session exists for the handle supplied.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header restartmanager.h
Library Rstrtmgr.lib
DLL Rstrtmgr.dll

See also

RmCancelCurrentTask