WSManSendShellInput function

Pipes the input stream to a running command or to the shell.

Syntax

void WSManSendShellInput(
  WSMAN_SHELL_HANDLE     shell,
  WSMAN_COMMAND_HANDLE   command,
  DWORD                  flags,
  PCWSTR                 streamId,
  WSMAN_DATA             *streamData,
  BOOL                   endOfStream,
  WSMAN_SHELL_ASYNC      *async,
  WSMAN_OPERATION_HANDLE *sendOperation
);

Parameters

shell

Specifies the shell handle returned by a WSManCreateShell call. This parameter cannot be NULL.

command

Specifies the command handle returned by a WSManRunShellCommand call. This handle should be closed by calling the WSManCloseCommand method.

flags

Reserved for future use. Must be set to zero.

streamId

Specifies the input stream ID. This parameter cannot be NULL.

streamData

Uses the WSMAN_DATA structure to specify the stream data to be sent to the command or shell. This structure should be allocated by the calling client and must remain allocated until WSManSendShellInput completes. If the end of the stream has been reached, the endOfStream parameter should be set to TRUE.

endOfStream

Set to TRUE, if the end of the stream has been reached. Otherwise, this parameter is set to FALSE.

async

Defines an asynchronous structure. The asynchronous structure contains an optional user context and a mandatory callback function. See the WSMAN_SHELL_ASYNC structure for more information. This parameter cannot be NULL and should be closed by calling the WSManCloseCommand method.

sendOperation

Defines the operation handle for the send operation. This handle is returned from a successful call of the function and can be used to asynchronously cancel the send operation. This handle should be closed by calling the WSManCloseOperation method. This parameter cannot be NULL.

Return Value

This function does not return a value.

Requirements

   
Windows version Windows 7 Windows Server 2008 R2
Target Platform Windows
Header wsman.h
Library WsmSvc.lib
DLL WsmSvc.dll