Export (0) Print
Expand All

RmAddFilter function

Modifies the shutdown or restart actions that are applied to an application or service. The primary installer can call the RmAddFilter function multiple times. The most recent call overrides any previous modifications to the same file, process, or service.

Syntax


DWORD WINAPI RmAddFilter(
  _In_      DWORD dwSessionHandle,
  _In_opt_  LPCWSTR strFilename,
  _In_opt_  RM_UNIQUE_PROCESS *Application,
  _In_opt_  LPCWSTR strShortServiceName,
  _In_      RM_FILTER_ACTION ActionType
);

Parameters

dwSessionHandle [in]

A handle to an existing Restart Manager session.

strFilename [in, optional]

A pointer to a null-terminated string value that contains the full path to the application's executable file. Modifications to shutdown or restart actions are applied for the application that is referenced by the full path. This parameter must be NULL if the Application or strServiceShortName parameter is non-NULL.

Application [in, optional]

A pointer to a RM_UNIQUE_PROCESS structure for the application. Modifications to shutdown or restart actions are applied for the application that is referenced by the RM_UNIQUE_PROCESS structure. This parameter must be NULL if the strFilename or strShortServiceName parameter is non-NULL.

strShortServiceName [in, optional]

A pointer to a null-terminated string value that contains the short service name. Modifications to shutdown or restart actions are applied for the service that is referenced by short service filename. This parameter must be NULL if the strFilename or Application parameter is non-NULL.

ActionType [in]

An RM_FILTER_ACTION enumeration value that specifies the type of modification to be applied.

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.

ValueMeaning
ERROR_SUCCESS
0

The function completed successfully.

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 as a parameter that requires a non-null and non-zero value.

ERROR_SESSION_CREDENTIAL_CONFLICT
1219

This error is returned when a secondary installer calls this function. This function is only available to primary installers.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

RestartManager.h

Library

Rstrtmgr.lib

DLL

Rstrtmgr.dll

See also

RmGetFilterList

 

 

Community Additions

ADD
Show:
© 2014 Microsoft