WSManPluginReceiveResult function (wsman.h)

Reports results for the WSMAN_PLUGIN_RECEIVE plug-in call and is used by most shell plug-ins that return results. After all of the data is received, the WSManPluginOperationComplete method must be called.

Syntax

DWORD WSManPluginReceiveResult(
  [in]           WSMAN_PLUGIN_REQUEST *requestDetails,
  [in]           DWORD                flags,
  [in, optional] PCWSTR               stream,
  [in, optional] WSMAN_DATA           *streamResult,
  [in, optional] PCWSTR               commandState,
  [in]           DWORD                exitCode
);

Parameters

[in] requestDetails

A pointer to a WSMAN_PLUGIN_REQUEST structure that specifies the resource URI, options, locale, shutdown flag, and handle for the request.

[in] flags

Reserved for future use. Must be set to zero.

[in, optional] stream

Specifies the stream that the data is associated with. Any stream can be used, but the standard streams are STDIN, STDOUT, and STDERR.

[in, optional] streamResult

A pointer to a WSMAN_DATA structure that specifies the result object that is returned to the client. The result can be in either binary or XML format.

[in, optional] commandState

Specifies the state of the command. This parameter must be set either to one of the following values or to a value defined by the plug-in.

WSMAN_RECEIVE_STATE_NONE

The operation requires no action.

WSMAN_RECEIVE_STATE_NORMAL_TERMINATION

The operation was terminated normally.

WSMAN_RECEIVE_STATE_ABNORMAL_TERMINATION

The operation was terminated unexpectedly.

WSMAN_RECEIVE_STATE_WAITING

The operation is waiting for input.

WSMAN_RECEIVE_STATE_INPUT_REQUIRED

The operation requires command-line input.

[in] exitCode

Ignored in all cases except when commandState is either WSMAN_RECEIVE_STATE_NORMAL_TERMINATION or WSMAN_RECEIVE_STATE_ABNORMAL_TERMINATION. Each result can have separate error codes. If the command or stream has failed, the plug-in must call the WSManPluginOperationComplete method.

Return value

None

Requirements

Requirement Value
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Target Platform Windows
Header wsman.h
Library WsmSvc.lib
DLL WsmSvc.dll
Redistributable Windows Management Framework on Windows Server 2008 with SP2 and Windows Vista with SP2