WSMAN_PLUGIN_COMMAND callback function (wsman.h)

Defines the command callback for a plug-in. This function is called when a request for a command is received. All Windows Remote Management plug-ins that support shell operations and need to create commands must implement this callback.

The DLL entry point name must be WSManPluginCommand.

Syntax

WSMAN_PLUGIN_COMMAND WsmanPluginCommand;

void WsmanPluginCommand(
  WSMAN_PLUGIN_REQUEST *requestDetails,
  DWORD flags,
  PVOID shellContext,
  PCWSTR commandLine,
  WSMAN_COMMAND_ARG_SET *arguments
)
{...}

Parameters

requestDetails

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

flags

Reserved for future use. Must be set to zero.

shellContext

Specifies the context returned from creating the shell for which this command needs to be associated.

commandLine

Specifies the command line to be run.

arguments

A pointer to a WSMAN_COMMAND_ARG_SET structure that specifies the command-line arguments to be passed to the command.

Return value

None

Remarks

The WinRM (WinRM) plug-in will call the WSManPluginReportContext method to register a command context for the command. All operations on this command are passed into this context. The context must be valid until the WSManPluginOperationComplete method is called by the plug-in to indicate that either the command is complete or the shell was shut down. All parameters passed in are valid until the WinRM plug-in calls WSManPluginOperationComplete.

Requirements

Requirement Value
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Target Platform Windows
Header wsman.h
Redistributable Windows Management Framework on Windows Server 2008 with SP2, Windows Vista with SP1, and Windows Vista with SP2