Windows Dev Center

WSManSendShellInput function

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

Syntax


void WINAPI WSManSendShellInput(
  _In_     HANDLE            shell,
  _In_opt_ HANDLE            command,
           DWORD             flags,
  _In_     PCWSTR            streamId,
  _In_     WSMAN_DATA        *streamData,
           BOOL              endOfStream,
  _In_     WSMAN_SHELL_ASYNC *async,
  _Out_    HANDLE            *sendOperation
);

Parameters

shell [in]

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

command [in, optional]

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 [in]

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

streamData [in]

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 [in]

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 [out]

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

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Redistributable

Windows Management Framework on Windows Server 2008 with SP2, Windows Server 2003 with SP2, Windows Vista with SP1, and Windows Vista with SP2

Header

Wsman.h

Library

WsmSvc.lib

DLL

WsmSvc.dll

 

 

Show:
© 2015 Microsoft