| wsman.h (6.1.7601.18619-Windows_7.0) | | wsman.h (6.3.9600.17415-Windows_8.1) |
| //***************************************************************************** | | //***************************************************************************** |
| // Copyright (C) 2007 Microsoft Corporation | | // Copyright (C) 2007 Microsoft Corporation |
| // All rights reserved. | | // All rights reserved. |
| // | | // |
| // Definition file for WSMAN | | // Definition file for WSMAN |
| //***************************************************************************** | | //***************************************************************************** |
| | |
| #ifndef _WSMAN_H_ | | #ifndef _WSMAN_H_ |
| #define _WSMAN_H_ | | #define _WSMAN_H_ |
|
| | #include <winapifamily.h> |
| | |
| | #pragma region Desktop Family |
| | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| | |
| #include <specstrings.h> | | #include <specstrings.h> |
| | |
| #if defined(WSMAN_API_VERSION_1_0) | | #if defined(WSMAN_API_VERSION_1_0) |
|
| | #elif defined(WSMAN_API_VERSION_1_1) |
| #else | | #else |
|
| #error "Define WSMAN_API_VERSION_1_0 before including wsman.h" | | #error "Define WSMAN_API_VERSION_1_0 or WSMAN_API_VERSION_1_1 before including w
sman.h" |
| #endif | | #endif |
| | |
|
| | #define WSMAN_FLAG_REQUESTED_API_VERSION_1_0 0x0 |
| | #define WSMAN_FLAG_REQUESTED_API_VERSION_1_1 0x1 |
| | |
| #ifdef __cplusplus | | #ifdef __cplusplus |
| extern "C" { | | extern "C" { |
| #endif | | #endif |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSMan - Public Client API v1.0 | | // WSMan - Public Client API v1.0 |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| | |
| skipping to change at line 50 | | skipping to change at line 58 |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // data as text | | // data as text |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_DATA_TEXT | | typedef struct _WSMAN_DATA_TEXT |
| { | | { |
| DWORD bufferLength; | | DWORD bufferLength; |
|
| __in_ecount(bufferLength) PCWSTR buffer; | | _In_reads_(bufferLength) PCWSTR buffer; |
| }WSMAN_DATA_TEXT; | | }WSMAN_DATA_TEXT; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // binary data used by API like for example WSManSendShellInput and | | // binary data used by API like for example WSManSendShellInput and |
| // WSManReceiveShellOutput for Shell API, the data can be stream text | | // WSManReceiveShellOutput for Shell API, the data can be stream text |
| // (ANSI/UNICODE), binary content or objects or partial or full XML | | // (ANSI/UNICODE), binary content or objects or partial or full XML |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_DATA_BINARY | | typedef struct _WSMAN_DATA_BINARY |
| { | | { |
| DWORD dataLength; | | DWORD dataLength; |
|
| __in_ecount(dataLength) BYTE *data; | | _In_reads_(dataLength) BYTE *data; |
| }WSMAN_DATA_BINARY; | | }WSMAN_DATA_BINARY; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // type of the data used by the WSMAN_DATA structure | | // type of the data used by the WSMAN_DATA structure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| enum WSManDataType | | enum WSManDataType |
| { | | { |
| | |
| skipping to change at line 115 | | skipping to change at line 123 |
| // This error structure is used by callbacks to return detailed error informati
on. | | // This error structure is used by callbacks to return detailed error informati
on. |
| // | | // |
| // The error structure can contain also a transport error. | | // The error structure can contain also a transport error. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| typedef struct _WSMAN_ERROR | | typedef struct _WSMAN_ERROR |
| { | | { |
| DWORD code; | | DWORD code; |
| // extended error information | | // extended error information |
|
| __in_opt PCWSTR errorDetail; // extended error description from the fault; | | _In_opt_ PCWSTR errorDetail; // extended error description from the fault; |
| // it can be NULL, for example in out of memory
conditions | | // it can be NULL, for example in out of memory
conditions |
|
| __in_opt PCWSTR language; // language for error description (RFC 3066 lan | | _In_opt_ PCWSTR language; // language for error description (RFC 3066 lan |
| guage code); it can be NULL | | guage code); it can be NULL |
| __in_opt PCWSTR machineName; // machine id; it can be NULL | | _In_opt_ PCWSTR machineName; // machine id; it can be NULL |
| __in_opt PCWSTR pluginName; // Plug-in name for errors generated by plug-in | | _In_opt_ PCWSTR pluginName; // Plug-in name for errors generated by plug-in |
| s. Otherwise NULL. | | s. Otherwise NULL. |
| } WSMAN_ERROR; | | } WSMAN_ERROR; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Username and password on the remote machine | | // Username and password on the remote machine |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_USERNAME_PASSWORD_CREDS | | typedef struct _WSMAN_USERNAME_PASSWORD_CREDS |
| { | | { |
|
| __in PCWSTR username; | | _In_ PCWSTR username; |
| __in PCWSTR password; | | _In_ PCWSTR password; |
| } WSMAN_USERNAME_PASSWORD_CREDS; | | } WSMAN_USERNAME_PASSWORD_CREDS; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // flags used by the authenticationMechanism member of WSMAN_AUTHENTICATION_CRED
ENTIALS structure | | // flags used by the authenticationMechanism member of WSMAN_AUTHENTICATION_CRED
ENTIALS structure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| enum WSManAuthenticationFlags | | enum WSManAuthenticationFlags |
| { | | { |
| WSMAN_FLAG_DEFAULT_AUTHENTICATION = 0x0, //Use the default authentica
tion | | WSMAN_FLAG_DEFAULT_AUTHENTICATION = 0x0, //Use the default authentica
tion |
| | |
| skipping to change at line 187 | | skipping to change at line 195 |
| typedef struct _WSMAN_OPTION | | typedef struct _WSMAN_OPTION |
| { | | { |
| PCWSTR name; | | PCWSTR name; |
| PCWSTR value; | | PCWSTR value; |
| BOOL mustComply; | | BOOL mustComply; |
| } WSMAN_OPTION; | | } WSMAN_OPTION; |
| | |
| typedef struct _WSMAN_OPTION_SET | | typedef struct _WSMAN_OPTION_SET |
| { | | { |
| DWORD optionsCount; | | DWORD optionsCount; |
|
| __in_ecount_opt(optionsCount) WSMAN_OPTION *options; | | _In_reads_opt_(optionsCount) WSMAN_OPTION *options; |
| BOOL optionsMustUnderstand; | | BOOL optionsMustUnderstand; |
| } WSMAN_OPTION_SET; | | } WSMAN_OPTION_SET; |
| | |
|
| | typedef struct _WSMAN_OPTION_SETEX |
| | { |
| | DWORD optionsCount; |
| | _In_reads_opt_(optionsCount) WSMAN_OPTION *options; |
| | BOOL optionsMustUnderstand; |
| | _In_reads_opt_(optionsCount) PCWSTR *optionTypes; |
| | } WSMAN_OPTION_SETEX; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Structures containing information for addressing the endpoint. | | // Structures containing information for addressing the endpoint. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_KEY | | typedef struct _WSMAN_KEY |
| { | | { |
| PCWSTR key; | | PCWSTR key; |
| PCWSTR value; | | PCWSTR value; |
| } WSMAN_KEY; | | } WSMAN_KEY; |
| | |
| typedef struct _WSMAN_SELECTOR_SET | | typedef struct _WSMAN_SELECTOR_SET |
| { | | { |
| DWORD numberKeys; // Number of keys (selectors) | | DWORD numberKeys; // Number of keys (selectors) |
|
| __in_ecount_opt(numberKeys) WSMAN_KEY *keys; // Array of key names and valu
es | | _In_reads_opt_(numberKeys) WSMAN_KEY *keys; // Array of key names and value
s |
| } WSMAN_SELECTOR_SET; | | } WSMAN_SELECTOR_SET; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Structure reserved for future use (Fragment Level WS-Transfer) | | // Structure reserved for future use (Fragment Level WS-Transfer) |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_FRAGMENT | | typedef struct _WSMAN_FRAGMENT |
| { | | { |
|
| __in PCWSTR path; // fragment path - WS-Transfer | | _In_ PCWSTR path; // fragment path - WS-Transfer |
| __in_opt PCWSTR dialect; // dialect for Fragment path | | _In_opt_ PCWSTR dialect; // dialect for Fragment path |
| | |
| } WSMAN_FRAGMENT; | | } WSMAN_FRAGMENT; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Structure reserved for future use (Filter Enumeration/Eventing) | | // Structure reserved for future use (Filter Enumeration/Eventing) |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_FILTER | | typedef struct _WSMAN_FILTER |
| { | | { |
|
| __in PCWSTR filter; // filter enumeration/subscription - allows | | _In_ PCWSTR filter; // filter enumeration/subscription - allows |
| ad-hoc queries using quey languages like SQL | | ad-hoc queries using quey languages like SQL |
| __in_opt PCWSTR dialect; // dialect for filter predicate | | _In_opt_ PCWSTR dialect; // dialect for filter predicate |
| | |
| } WSMAN_FILTER; | | } WSMAN_FILTER; |
| | |
|
| | #define WSMAN_OPERATION_INFOV1 0x00000000 |
| | #define WSMAN_OPERATION_INFOV2 0xaabbccdd |
| | |
| typedef struct _WSMAN_OPERATION_INFO | | typedef struct _WSMAN_OPERATION_INFO |
| { | | { |
|
| __in_opt WSMAN_FRAGMENT fragment; // optional element to suppor | | _In_opt_ WSMAN_FRAGMENT fragment; // optional element to suppor |
| t Fragment transfer or | | t Fragment transfer or |
| __in_opt WSMAN_FILTER filter; // optional Filter WS-Enumera | | _In_opt_ WSMAN_FILTER filter; // optional Filter WS-Enumera |
| te/WS-Eventing | | te/WS-Eventing |
| __in_opt WSMAN_SELECTOR_SET selectorSet; | | _In_opt_ WSMAN_SELECTOR_SET selectorSet; |
| __in_opt WSMAN_OPTION_SET optionSet; | | _In_opt_ WSMAN_OPTION_SET optionSet; |
| | _In_opt_ void *reserved; |
| | DWORD version; |
| } WSMAN_OPERATION_INFO; | | } WSMAN_OPERATION_INFO; |
| | |
|
| | typedef struct _WSMAN_OPERATION_INFOEX |
| | { |
| | _In_opt_ WSMAN_FRAGMENT fragment; // optional element to suppor |
| | t Fragment transfer or |
| | _In_opt_ WSMAN_FILTER filter; // optional Filter WS-Enumera |
| | te/WS-Eventing |
| | _In_opt_ WSMAN_SELECTOR_SET selectorSet; |
| | _In_opt_ WSMAN_OPTION_SETEX optionSet; |
| | DWORD version; |
| | _In_opt_ PCWSTR uiLocale; |
| | _In_opt_ PCWSTR dataLocale; |
| | } WSMAN_OPERATION_INFOEX; |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Client Initialization/Deinitialization functions | | // Client Initialization/Deinitialization functions |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| typedef struct WSMAN_API *WSMAN_API_HANDLE; | | typedef struct WSMAN_API *WSMAN_API_HANDLE; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // This API is used to initialize the WinRM client; | | // This API is used to initialize the WinRM client; |
| // It can be used by different clients on the same process, ie svchost.exe. | | // It can be used by different clients on the same process, ie svchost.exe. |
| // Returns a nonzero error code upon failure | | // Returns a nonzero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManInitialize( | | DWORD WINAPI WSManInitialize( |
| DWORD flags, | | DWORD flags, |
|
| __out WSMAN_API_HANDLE *apiHandle | | _Out_ WSMAN_API_HANDLE *apiHandle |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // This API deinitializes the Winrm client stack; all operations will | | // This API deinitializes the Winrm client stack; all operations will |
| // finish before this API will return; this is a sync call; | | // finish before this API will return; this is a sync call; |
| // it is highly recommended that all operations are explictly cancelled | | // it is highly recommended that all operations are explictly cancelled |
| // and all sessions are closed before calling this API | | // and all sessions are closed before calling this API |
| // Returns non zero error code upon failure | | // Returns non zero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManDeinitialize( | | DWORD WINAPI WSManDeinitialize( |
|
| __inout_opt WSMAN_API_HANDLE apiHandle, | | _Inout_opt_ WSMAN_API_HANDLE apiHandle, |
| DWORD flags | | DWORD flags |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // This API returns a NULL terminated unicode string containing the message | | // This API returns a NULL terminated unicode string containing the message |
| // of an error number and an optional language identifier. The optional | | // of an error number and an optional language identifier. The optional |
| // parameter languageCode specifies the UI language as RFC 3066 language code | | // parameter languageCode specifies the UI language as RFC 3066 language code |
| // that should be used to localize the message (if not specified, the thread's | | // that should be used to localize the message (if not specified, the thread's |
| // UI language will be used). If the function cannot find a message for that | | // UI language will be used). If the function cannot find a message for that |
| // language, it returns ERROR_RESOURCE_LANG_NOT_FOUND. The function copies | | // language, it returns ERROR_RESOURCE_LANG_NOT_FOUND. The function copies |
| // the formatted message text to an output buffer. | | // the formatted message text to an output buffer. |
| // | | // |
| // Returns non zero error code upon failure. If the output buffer is not | | // Returns non zero error code upon failure. If the output buffer is not |
| // big enough or NULL, the function returns ERROR_INSUFFICIENT_BUFFER and | | // big enough or NULL, the function returns ERROR_INSUFFICIENT_BUFFER and |
| // the messageLengthUsed parameter contains the requested size of the buffer. | | // the messageLengthUsed parameter contains the requested size of the buffer. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManGetErrorMessage( | | DWORD WINAPI WSManGetErrorMessage( |
|
| __in WSMAN_API_HANDLE apiHandle, | | _In_ WSMAN_API_HANDLE apiHandle, |
| DWORD flags, // reserved for future use; must be 0 | | _Reserved_ DWORD flags, // reserved for future use; must be 0 |
| __in_opt PCWSTR languageCode, // the RFC 3066 language code; it can be NU | | _In_opt_ PCWSTR languageCode, // the RFC 3066 language code; it can be NU |
| LL | | LL |
| DWORD errorCode, // error code for the requested error message | | DWORD errorCode, // error code for the requested error message |
| DWORD messageLength, // message length, including NULL terminator | | DWORD messageLength, // message length, including NULL terminator |
|
| __out_ecount_part_opt(messageLength, *messageLengthUsed) PWSTR message, | | _Out_writes_to_opt_(messageLength, *messageLengthUsed) PWSTR message, |
| __out DWORD* messageLengthUsed // effective message length, including NULL | | _Out_ DWORD* messageLengthUsed // effective message length, including NULL |
| terminator | | terminator |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Unsigned long integer value that contains the proxy access type | | // Unsigned long integer value that contains the proxy access type |
| // By default, wsman uses WSMAN_OPTION_PROXY_WINHTTP_PROXY_CONFIG - | | // By default, wsman uses WSMAN_OPTION_PROXY_WINHTTP_PROXY_CONFIG - |
| // the proxy settings configured for WinHTTP. The WinHTTP proxy settings | | // the proxy settings configured for WinHTTP. The WinHTTP proxy settings |
| // can be set with Proxycfg.exe or by using netsh command. | | // can be set with Proxycfg.exe or by using netsh command. |
| // When WSMAN_OPTION_PROXY_IE_PROXY_CONFIG is specified, the current user's | | // When WSMAN_OPTION_PROXY_IE_PROXY_CONFIG is specified, the current user's |
| // Internet Explorer proxy settings for the current active network connection. | | // Internet Explorer proxy settings for the current active network connection. |
| | |
| skipping to change at line 333 | | skipping to change at line 364 |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Structure used to set the proxy information per session | | // Structure used to set the proxy information per session |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| typedef struct _WSMAN_PROXY_INFO | | typedef struct _WSMAN_PROXY_INFO |
| { | | { |
| DWORD accessType; | | DWORD accessType; |
|
| __in_opt WSMAN_AUTHENTICATION_CREDENTIALS authenticationCredentials; // cred
entials and authentication scheme used for proxy | | _In_opt_ WSMAN_AUTHENTICATION_CREDENTIALS authenticationCredentials; // cred
entials and authentication scheme used for proxy |
| } WSMAN_PROXY_INFO; | | } WSMAN_PROXY_INFO; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Client Session | | // Client Session |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct WSMAN_SESSION *WSMAN_SESSION_HANDLE; | | typedef struct WSMAN_SESSION *WSMAN_SESSION_HANDLE; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Creates a session which can be used to perform subsequent operations | | // Creates a session which can be used to perform subsequent operations |
| // Returns a non zero error code upon failure | | // Returns a non zero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManCreateSession( | | DWORD WINAPI WSManCreateSession( |
|
| __in WSMAN_API_HANDLE apiHandle, | | _In_ WSMAN_API_HANDLE apiHandle, |
| __in_opt PCWSTR connection, // if NULL, then connect | | _In_opt_ PCWSTR connection, // if NULL, then connect |
| ion will default to localhost | | ion will default to localhost |
| DWORD flags, | | DWORD flags, |
|
| __in_opt WSMAN_AUTHENTICATION_CREDENTIALS *serverAuthenticationCredentials, | | _In_opt_ WSMAN_AUTHENTICATION_CREDENTIALS *serverAuthenticationCredentials, |
| __in_opt WSMAN_PROXY_INFO *proxyInfo, | | _In_opt_ WSMAN_PROXY_INFO *proxyInfo, |
| __out WSMAN_SESSION_HANDLE *session | | _Out_ WSMAN_SESSION_HANDLE *session |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Frees memory of session and closes all related operations before returning; t
his is sync call | | // Frees memory of session and closes all related operations before returning; t
his is sync call |
| // it is recommended that all pending operations are either completed or cancell
ed before calling this API | | // it is recommended that all pending operations are either completed or cancell
ed before calling this API |
| // Returns a non zero error code upon failure | | // Returns a non zero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManCloseSession( | | DWORD WINAPI WSManCloseSession( |
|
| __inout_opt WSMAN_SESSION_HANDLE session, | | _Inout_opt_ WSMAN_SESSION_HANDLE session, |
| DWORD flags | | DWORD flags |
| ); | | ); |
| | |
| // | | // |
| // default operation timeout for network operations - 1 min = 60000ms | | // default operation timeout for network operations - 1 min = 60000ms |
| // | | // |
| #define WSMAN_DEFAULT_TIMEOUT_MS 60000 | | #define WSMAN_DEFAULT_TIMEOUT_MS 60000 |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| | |
| skipping to change at line 388 | | skipping to change at line 419 |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| enum WSManSessionOption | | enum WSManSessionOption |
| { | | { |
| // | | // |
| //Timeouts | | //Timeouts |
| // | | // |
| | |
| WSMAN_OPTION_DEFAULT_OPERATION_TIMEOUTMS = 1,// DWORD - default timeout in m
s that applies to all operations on the client side | | WSMAN_OPTION_DEFAULT_OPERATION_TIMEOUTMS = 1,// DWORD - default timeout in m
s that applies to all operations on the client side |
| | |
|
| | WSMAN_OPTION_MAX_RETRY_TIME = 11, // DWORD (read only) - maximum
time for Robust connection retries |
| WSMAN_OPTION_TIMEOUTMS_CREATE_SHELL = 12,// DWORD - timeout in ms for W
SManCreateShell operations | | WSMAN_OPTION_TIMEOUTMS_CREATE_SHELL = 12,// DWORD - timeout in ms for W
SManCreateShell operations |
| WSMAN_OPTION_TIMEOUTMS_RUN_SHELL_COMMAND =13,// DWORD - timeout in ms for WS
ManRunShellCommand operations | | WSMAN_OPTION_TIMEOUTMS_RUN_SHELL_COMMAND =13,// DWORD - timeout in ms for WS
ManRunShellCommand operations |
| WSMAN_OPTION_TIMEOUTMS_RECEIVE_SHELL_OUTPUT =14,// DWORD - timeout in ms for
WSManReceiveShellOutput operations | | WSMAN_OPTION_TIMEOUTMS_RECEIVE_SHELL_OUTPUT =14,// DWORD - timeout in ms for
WSManReceiveShellOutput operations |
| WSMAN_OPTION_TIMEOUTMS_SEND_SHELL_INPUT = 15,// DWORD - timeout in ms for W
SManSendShellInput operations | | WSMAN_OPTION_TIMEOUTMS_SEND_SHELL_INPUT = 15,// DWORD - timeout in ms for W
SManSendShellInput operations |
| WSMAN_OPTION_TIMEOUTMS_SIGNAL_SHELL = 16,// DWORD - timeout in ms for W
SManSignalShell and WSManCloseCommand operations | | WSMAN_OPTION_TIMEOUTMS_SIGNAL_SHELL = 16,// DWORD - timeout in ms for W
SManSignalShell and WSManCloseCommand operations |
| WSMAN_OPTION_TIMEOUTMS_CLOSE_SHELL = 17,// DWORD - timeout in ms for W
SManCloseShell operations | | WSMAN_OPTION_TIMEOUTMS_CLOSE_SHELL = 17,// DWORD - timeout in ms for W
SManCloseShell operations |
| | |
| // | | // |
| // connection options | | // connection options |
| // | | // |
| | |
| skipping to change at line 419 | | skipping to change at line 451 |
| // | | // |
| WSMAN_OPTION_LOCALE = 25,// string - RFC 3066 language c
ode | | WSMAN_OPTION_LOCALE = 25,// string - RFC 3066 language c
ode |
| WSMAN_OPTION_UI_LANGUAGE = 26,// string - RFC 3066 language c
ode | | WSMAN_OPTION_UI_LANGUAGE = 26,// string - RFC 3066 language c
ode |
| WSMAN_OPTION_MAX_ENVELOPE_SIZE_KB = 28,// DWORD - max SOAP envelope si
ze (kb) - default 150kb from winrm config | | WSMAN_OPTION_MAX_ENVELOPE_SIZE_KB = 28,// DWORD - max SOAP envelope si
ze (kb) - default 150kb from winrm config |
| // (see 'winrm help config' for
more details); the client SOAP packet size cannot surpass | | // (see 'winrm help config' for
more details); the client SOAP packet size cannot surpass |
| // this value; this value will
be also sent to the server in the SOAP request as a | | // this value; this value will
be also sent to the server in the SOAP request as a |
| // MaxEnvelopeSize header; the
server will use min(MaxEnvelopeSizeKb from server configuration, | | // MaxEnvelopeSize header; the
server will use min(MaxEnvelopeSizeKb from server configuration, |
| // MaxEnvelopeSize value from S
OAP). | | // MaxEnvelopeSize value from S
OAP). |
| WSMAN_OPTION_SHELL_MAX_DATA_SIZE_PER_MESSAGE_KB = 29,// DWORD (read only) -
max data size (kb) provided by the client, guaranteed by | | WSMAN_OPTION_SHELL_MAX_DATA_SIZE_PER_MESSAGE_KB = 29,// DWORD (read only) -
max data size (kb) provided by the client, guaranteed by |
| // the winrm client implem
entation to fit into one SOAP packet; this is an | | // the winrm client implem
entation to fit into one SOAP packet; this is an |
|
| // approximate value calcul
ated based on the WSMAN_OPTION_MAX_ENVELOPE_SIZE_KB (default 150kb), | | // approximate value calcul
ated based on the WSMAN_OPTION_MAX_ENVELOPE_SIZE_KB (default 500kb), |
| // the maximum possible siz
e of the SOAP headers and the overhead of the base64 | | // the maximum possible siz
e of the SOAP headers and the overhead of the base64 |
| // encoding which is specif
ic to WSManSendShellInput API; this option can be used | | // encoding which is specif
ic to WSManSendShellInput API; this option can be used |
| // with WSManGetSessionOpti
onAsDword API; it cannot be used with WSManSetSessionOption API. | | // with WSManGetSessionOpti
onAsDword API; it cannot be used with WSManSetSessionOption API. |
| WSMAN_OPTION_REDIRECT_LOCATION = 30,// string - read-only, cannot s
et | | WSMAN_OPTION_REDIRECT_LOCATION = 30,// string - read-only, cannot s
et |
| WSMAN_OPTION_SKIP_REVOCATION_CHECK = 31,// DWORD - 1 to not validate the r
evocation status on the server certificate; 0 - default | | WSMAN_OPTION_SKIP_REVOCATION_CHECK = 31,// DWORD - 1 to not validate the r
evocation status on the server certificate; 0 - default |
| WSMAN_OPTION_ALLOW_NEGOTIATE_IMPLICIT_CREDENTIALS = 32,// DWORD - 1 to all
ow default credentials for Negotiate (this is for SSL only); 0 - default | | WSMAN_OPTION_ALLOW_NEGOTIATE_IMPLICIT_CREDENTIALS = 32,// DWORD - 1 to all
ow default credentials for Negotiate (this is for SSL only); 0 - default |
|
| WSMAN_OPTION_USE_SSL = 33 // DWORD - When using just a | | WSMAN_OPTION_USE_SSL = 33, // DWORD - When using just |
| machine name in the connection string use an SSL connection. 0 means HTTP, 1 me | | a machine name in the connection string use an SSL connection. 0 means HTTP, 1 m |
| ans HTTPS. Default is 0. | | eans HTTPS. Default is 0. |
| | WSMAN_OPTION_USE_INTEARACTIVE_TOKEN = 34 // DWORD - When creating co |
| | nnection on local machine, use interactive token feature. 1 - default |
| }; | | }; |
| typedef enum WSManSessionOption WSManSessionOption; | | typedef enum WSManSessionOption WSManSessionOption; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManSetSessionOption API - set session options | | // WSManSetSessionOption API - set session options |
| // Returns a non zero error code upon failure | | // Returns a non zero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManSetSessionOption( | | DWORD WINAPI WSManSetSessionOption( |
|
| __in WSMAN_SESSION_HANDLE session, | | _In_ WSMAN_SESSION_HANDLE session, |
| WSManSessionOption option, | | WSManSessionOption option, |
|
| __in WSMAN_DATA *data | | _In_ WSMAN_DATA *data |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManGetSessionOptionAsDword API - get a session option | | // WSManGetSessionOptionAsDword API - get a session option |
| // Returns a non zero error code upon failure | | // Returns a non zero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManGetSessionOptionAsDword( | | DWORD WINAPI WSManGetSessionOptionAsDword( |
|
| __in WSMAN_SESSION_HANDLE session, | | _In_ WSMAN_SESSION_HANDLE session, |
| WSManSessionOption option, | | WSManSessionOption option, |
|
| __inout DWORD *value | | _Inout_ DWORD *value |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManGetSessionOptionAsString API - get a session option | | // WSManGetSessionOptionAsString API - get a session option |
| // Returns a non zero error code upon failure | | // Returns a non zero error code upon failure |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
|
| __success(return == NO_ERROR) | | _Success_(return == NO_ERROR) |
| DWORD WINAPI WSManGetSessionOptionAsString( | | DWORD WINAPI WSManGetSessionOptionAsString( |
|
| __in WSMAN_SESSION_HANDLE session, | | _In_ WSMAN_SESSION_HANDLE session, |
| WSManSessionOption option, | | WSManSessionOption option, |
| DWORD stringLength, | | DWORD stringLength, |
|
| __out_ecount_part_opt(stringLength, *stringLengthUsed) PWSTR string, | | _Out_writes_to_opt_(stringLength, *stringLengthUsed) PWSTR string, |
| __out DWORD* stringLengthUsed | | _Out_ DWORD* stringLengthUsed |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Handle returned by WS-Transfer and WS-Enumerate operations | | // Handle returned by WS-Transfer and WS-Enumerate operations |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct WSMAN_OPERATION *WSMAN_OPERATION_HANDLE; | | typedef struct WSMAN_OPERATION *WSMAN_OPERATION_HANDLE; |
| | |
| // | | // |
| | |
| skipping to change at line 495 | | skipping to change at line 528 |
| // | | // |
| WSMAN_FLAG_CALLBACK_END_OF_OPERATION = 0x1, | | WSMAN_FLAG_CALLBACK_END_OF_OPERATION = 0x1, |
| | |
| // | | // |
| // WSMAN_SHELL_COMPLETION_FUNCTION API specific flags | | // WSMAN_SHELL_COMPLETION_FUNCTION API specific flags |
| // end of a particular stream; it is used for optimization purposes if the
shell | | // end of a particular stream; it is used for optimization purposes if the
shell |
| // knows that no more output will occur for this stream; in some conditions
this | | // knows that no more output will occur for this stream; in some conditions
this |
| // cannot be determined. | | // cannot be determined. |
| // | | // |
| WSMAN_FLAG_CALLBACK_END_OF_STREAM = 0x8, | | WSMAN_FLAG_CALLBACK_END_OF_STREAM = 0x8, |
|
| | |
| | // Flag that if present on CreateShell callback indicates that it supports d |
| | isconnect |
| | WSMAN_FLAG_CALLBACK_SHELL_SUPPORTS_DISCONNECT = 0x20, |
| | |
| | // Flag that indicates that the shell got disconnected due to netowrk failur |
| | e |
| | WSMAN_FLAG_CALLBACK_SHELL_AUTODISCONNECTED = 0x40, |
| | |
| | // Flag indicates that the client shell detected a network failure |
| | WSMAN_FLAG_CALLBACK_NETWORK_FAILURE_DETECTED = 0x100, |
| | |
| | // Flag indicates that client shell is retrying to establish network connect |
| | ion with the server |
| | WSMAN_FLAG_CALLBACK_RETRYING_AFTER_NETWORK_FAILURE = 0x200, |
| | |
| | // Flag indicates that client shell successfully reconnected with the server |
| | after attempting to reconnect to the server |
| | WSMAN_FLAG_CALLBACK_RECONNECTED_AFTER_NETWORK_FAILURE = 0x400, |
| | |
| | // Flag indicates that the client shell attempts to reconnect to the server |
| | failed and hence it is AutoDisconnecting |
| | WSMAN_FLAG_CALLBACK_SHELL_AUTODISCONNECTING = 0x800, |
| | |
| | // Flag indicates that the client shell got into broken state in the middle |
| | of retry notification sequence due to some internal error at wsman layer |
| | WSMAN_FLAG_CALLBACK_RETRY_ABORTED_DUE_TO_INTERNAL_ERROR = 0x1000, |
| | |
| | // Flag that indicates for a receive operation that a delay stream request h |
| | as been processed |
| | WSMAN_FLAG_CALLBACK_RECEIVE_DELAY_STREAM_REQUEST_PROCESSED = 0X2000 |
| }; | | }; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Closes an asynchronous operation; if the callback associated with the operati
on | | // Closes an asynchronous operation; if the callback associated with the operati
on |
| // is pending and have not completed when WSManCloseOperation is called, then | | // is pending and have not completed when WSManCloseOperation is called, then |
| // the function marks the operation for deletion and returns; If the callback w
as not called, | | // the function marks the operation for deletion and returns; If the callback w
as not called, |
| // the operation is cancelled and the operation callback is called with | | // the operation is cancelled and the operation callback is called with |
| // WSMAN_ERROR_OPERATION_ABORTED error; the operation handle is freed in all ca
ses | | // WSMAN_ERROR_OPERATION_ABORTED error; the operation handle is freed in all ca
ses |
| // after the callback returns. | | // after the callback returns. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManCloseOperation( | | DWORD WINAPI WSManCloseOperation( |
|
| __inout_opt WSMAN_OPERATION_HANDLE operationHandle, | | _Inout_opt_ WSMAN_OPERATION_HANDLE operationHandle, |
| DWORD flags | | DWORD flags |
| ); | | ); |
| | |
| // | | // |
| //------------------------------------------------------------------------ | | //------------------------------------------------------------------------ |
| // Shell Client API | | // Shell Client API |
| // The API set includes the ability to create a shell, execute one or | | // The API set includes the ability to create a shell, execute one or |
| // more commands, possibly pipe input stream to the command, collect the | | // more commands, possibly pipe input stream to the command, collect the |
| // output stream from the command, terminate the command and finally | | // output stream from the command, terminate the command and finally |
| // close the shell. The client must retrieve the output initiating | | // close the shell. The client must retrieve the output initiating |
| | |
| skipping to change at line 562 | | skipping to change at line 619 |
| #define WSMAN_STREAM_ID_STDERR L"stderr" | | #define WSMAN_STREAM_ID_STDERR L"stderr" |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // stream selector - array of stream ids; ie L"stdin" or L"stdout" or L"stderr" | | // stream selector - array of stream ids; ie L"stdin" or L"stdout" or L"stderr" |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_STREAM_ID_SET | | typedef struct _WSMAN_STREAM_ID_SET |
| { | | { |
| DWORD streamIDsCount; | | DWORD streamIDsCount; |
|
| __in_ecount_opt(streamIDsCount) PCWSTR *streamIDs; | | _In_reads_opt_(streamIDsCount) PCWSTR *streamIDs; |
| | |
| } WSMAN_STREAM_ID_SET; | | } WSMAN_STREAM_ID_SET; |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // Environment variable | | // Environment variable |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_ENVIRONMENT_VARIABLE | | typedef struct _WSMAN_ENVIRONMENT_VARIABLE |
| { | | { |
| | |
| skipping to change at line 586 | | skipping to change at line 643 |
| } WSMAN_ENVIRONMENT_VARIABLE; | | } WSMAN_ENVIRONMENT_VARIABLE; |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // environment variable set - array of environment variables | | // environment variable set - array of environment variables |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_ENVIRONMENT_VARIABLE_SET | | typedef struct _WSMAN_ENVIRONMENT_VARIABLE_SET |
| { | | { |
| DWORD varsCount; | | DWORD varsCount; |
|
| __in_ecount_opt(varsCount) WSMAN_ENVIRONMENT_VARIABLE *vars; | | _In_reads_opt_(varsCount) WSMAN_ENVIRONMENT_VARIABLE *vars; |
| | |
| } WSMAN_ENVIRONMENT_VARIABLE_SET; | | } WSMAN_ENVIRONMENT_VARIABLE_SET; |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // Shell initialization parameters | | // Shell initialization parameters |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
|
| typedef struct _WSMAN_SHELL_STARTUP_INFO | | typedef struct _WSMAN_SHELL_STARTUP_INFO_V10 |
| { | | { |
| WSMAN_STREAM_ID_SET *inputStreamSet; | | WSMAN_STREAM_ID_SET *inputStreamSet; |
| WSMAN_STREAM_ID_SET *outputStreamSet; | | WSMAN_STREAM_ID_SET *outputStreamSet; |
| DWORD idleTimeoutMs; | | DWORD idleTimeoutMs; |
| PCWSTR workingDirectory; | | PCWSTR workingDirectory; |
| WSMAN_ENVIRONMENT_VARIABLE_SET *variableSet; | | WSMAN_ENVIRONMENT_VARIABLE_SET *variableSet; |
| | |
|
| } WSMAN_SHELL_STARTUP_INFO; | | } WSMAN_SHELL_STARTUP_INFO_V10; |
| | |
| | typedef struct _WSMAN_SHELL_STARTUP_INFO_V11 : _WSMAN_SHELL_STARTUP_INFO_V10 |
| | { |
| | PCWSTR name; |
| | } WSMAN_SHELL_STARTUP_INFO_V11; |
| | |
| | #if defined(WSMAN_API_VERSION_1_0) |
| | typedef WSMAN_SHELL_STARTUP_INFO_V10 WSMAN_SHELL_STARTUP_INFO; |
| | #elif defined(WSMAN_API_VERSION_1_1) |
| | typedef WSMAN_SHELL_STARTUP_INFO_V11 WSMAN_SHELL_STARTUP_INFO; |
| | #endif |
| | |
| | typedef struct _WSMAN_SHELL_DISCONNECT_INFO |
| | { |
| | DWORD idleTimeoutMs; |
| | } WSMAN_SHELL_DISCONNECT_INFO; |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // Pre-defined URIs | | // Pre-defined URIs |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| #define WSMAN_SHELL_NS L"http://schemas.microsoft.com/wbem/wsman/1/windows/shell
" | | #define WSMAN_SHELL_NS L"http://schemas.microsoft.com/wbem/wsman/1/windows/shell
" |
| #define WSMAN_SHELL_NS_LEN (sizeof(WSMAN_SHELL_NS)/sizeof(WCHAR)-1) | | #define WSMAN_SHELL_NS_LEN (sizeof(WSMAN_SHELL_NS)/sizeof(WCHAR)-1) |
| | |
| // | | // |
| | |
| skipping to change at line 631 | | skipping to change at line 704 |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // Windows shell options | | // Windows shell options |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| enum WSManShellFlag | | enum WSManShellFlag |
| { | | { |
| //Turn off compression for Send/Receive operations. By default compression
is | | //Turn off compression for Send/Receive operations. By default compression
is |
| //turned on, but if communicating with a down-level box it may be necessary
to | | //turned on, but if communicating with a down-level box it may be necessary
to |
| //do this. Other reasons for turning it off is due to the extra memory cons
umption | | //do this. Other reasons for turning it off is due to the extra memory cons
umption |
| //and CPU utilization that is used as a result of compression. | | //and CPU utilization that is used as a result of compression. |
|
| WSMAN_FLAG_NO_COMPRESSION = 1 | | WSMAN_FLAG_NO_COMPRESSION = 0x1, |
| | WSMAN_FLAG_DELETE_SERVER_SESSION = 0x2, |
| | //Enable the service to drop operation output when running disconnected |
| | WSMAN_FLAG_SERVER_BUFFERING_MODE_DROP = 0x4, |
| | //Enable the service to block operation progress when output buffers are ful |
| | l |
| | WSMAN_FLAG_SERVER_BUFFERING_MODE_BLOCK = 0x8, |
| | //Enable receive call to not immediately retrieve results. Only applicable f |
| | or Receive calls on commands |
| | WSMAN_FLAG_RECEIVE_DELAY_OUTPUT_STREAM = 0X10 |
| }; | | }; |
| typedef enum WSManShellFlag WSManShellFlag; | | typedef enum WSManShellFlag WSManShellFlag; |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // Windows command shell specific options | | // Windows command shell specific options |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| | |
| skipping to change at line 705 | | skipping to change at line 785 |
| PCWSTR streamId; // string - any output stream name from the list p
assed to | | PCWSTR streamId; // string - any output stream name from the list p
assed to |
| // the server when creating the shell | | // the server when creating the shell |
| WSMAN_DATA streamData; // always data as binary; can be stream text (ANSI
/UNICODE), binary content or objects or partial or full XML | | WSMAN_DATA streamData; // always data as binary; can be stream text (ANSI
/UNICODE), binary content or objects or partial or full XML |
| | |
| // command state string values (shell specific) - the state of the command f
or which status is being reported | | // command state string values (shell specific) - the state of the command f
or which status is being reported |
| PCWSTR commandState; // if WSMAN_COMMAND_STATE_DONE then the command sh
ould be closed at this moment | | PCWSTR commandState; // if WSMAN_COMMAND_STATE_DONE then the command sh
ould be closed at this moment |
| DWORD exitCode; | | DWORD exitCode; |
| | |
| } WSMAN_RECEIVE_DATA_RESULT; | | } WSMAN_RECEIVE_DATA_RESULT; |
| | |
|
| | #if defined(WSMAN_API_VERSION_1_1) |
| | |
| | typedef struct _WSMAN_CONNECT_DATA |
| | { |
| | WSMAN_DATA data; |
| | } WSMAN_CONNECT_DATA; |
| | |
| | typedef struct _WSMAN_CREATE_SHELL_DATA |
| | { |
| | WSMAN_DATA data; |
| | } WSMAN_CREATE_SHELL_DATA; |
| | |
| | typedef union _WSMAN_RESPONSE_DATA |
| | { |
| | WSMAN_RECEIVE_DATA_RESULT receiveData; |
| | WSMAN_CONNECT_DATA connectData; |
| | WSMAN_CREATE_SHELL_DATA createData; |
| | } WSMAN_RESPONSE_DATA; |
| | |
| | #endif |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // Completion function used by all Shell functions | | // Completion function used by all Shell functions |
| // Returns error->code != 0 upon error; use error->errorDetail structure | | // Returns error->code != 0 upon error; use error->errorDetail structure |
| // for extended error informations; the callback is called for each | | // for extended error informations; the callback is called for each |
| // shell operation; after a WSManReceiveShellOutput operation is initiated, | | // shell operation; after a WSManReceiveShellOutput operation is initiated, |
| // the callback is called for each output stream element or if error; | | // the callback is called for each output stream element or if error; |
| // the underlying implementation handles the polling of stream data | | // the underlying implementation handles the polling of stream data |
| // from the command or shell. If WSMAN_COMMAND_STATE_DONE state is received, no
more | | // from the command or shell. If WSMAN_COMMAND_STATE_DONE state is received, no
more |
| // streams will be received from the command, so the command can be closed | | // streams will be received from the command, so the command can be closed |
| | |
| skipping to change at line 727 | | skipping to change at line 827 |
| // If error->code != 0, the result is guaranteed to be NULL | | // If error->code != 0, the result is guaranteed to be NULL |
| // | | // |
| // The error and result objects are allocated and owned by the winrm | | // The error and result objects are allocated and owned by the winrm |
| // client stack; they are valid during the callback only; the user | | // client stack; they are valid during the callback only; the user |
| // has to synchronously copy the data in the callback | | // has to synchronously copy the data in the callback |
| // | | // |
| // This callback function will use the current access token, whether it is | | // This callback function will use the current access token, whether it is |
| // a process or impersonation token. | | // a process or impersonation token. |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
|
| | |
| | #if defined(WSMAN_API_VERSION_1_1) |
| | |
| typedef void (CALLBACK *WSMAN_SHELL_COMPLETION_FUNCTION)( | | typedef void (CALLBACK *WSMAN_SHELL_COMPLETION_FUNCTION)( |
|
| __in_opt PVOID operationContext, //user defined context | | _In_opt_ PVOID operationContext, //user defined context |
| DWORD flags, // one or more flags fr
om WSManCallbackFlags | | DWORD flags, // one or more flags fr
om WSManCallbackFlags |
|
| __in WSMAN_ERROR *error, // error allocated and | | _In_ WSMAN_ERROR *error, // error allocated and |
| owned by the winrm stack; valid in the callback only; | | owned by the winrm stack; valid in the callback only; |
| __in WSMAN_SHELL_HANDLE shell, // shell handle associa | | _In_ WSMAN_SHELL_HANDLE shell, // shell handle associa |
| ted with the user context; must be closed using WSManCloseShell | | ted with the user context; must be closed using WSManCloseShell |
| __in_opt WSMAN_COMMAND_HANDLE command, // command handle assoc | | _In_opt_ WSMAN_COMMAND_HANDLE command, // command handle assoc |
| iated with the user context; must be closed using WSManCloseCommand | | iated with the user context; must be closed using WSManCloseCommand |
| __in_opt WSMAN_OPERATION_HANDLE operationHandle, // valid only for Send/ | | _In_opt_ WSMAN_OPERATION_HANDLE operationHandle, // valid only for Send/ |
| Receive/Signal operations; must be closed using WSManCloseOperation | | Receive/Signal operations; must be closed using WSManCloseOperation |
| __in_opt WSMAN_RECEIVE_DATA_RESULT *data // output data from com | | _In_opt_ WSMAN_RESPONSE_DATA *data // output data from com |
| mand/shell; allocated internally and owned by the winrm stack | | mand/shell; allocated internally and owned by the winrm stack |
| | // valid only within th |
| | is function. Currently used to send back receive stream data and |
| | // open Xml content in |
| | rsp:ConnectResponse |
| | ); |
| | #else |
| | |
| | typedef void (CALLBACK *WSMAN_SHELL_COMPLETION_FUNCTION)( |
| | _In_opt_ PVOID operationContext, //user defined context |
| | DWORD flags, // one or more flags fr |
| | om WSManCallbackFlags |
| | _In_ WSMAN_ERROR *error, // error allocated and |
| | owned by the winrm stack; valid in the callback only; |
| | _In_ WSMAN_SHELL_HANDLE shell, // shell handle associa |
| | ted with the user context; must be closed using WSManCloseShell |
| | _In_opt_ WSMAN_COMMAND_HANDLE command, // command handle assoc |
| | iated with the user context; must be closed using WSManCloseCommand |
| | _In_opt_ WSMAN_OPERATION_HANDLE operationHandle, // valid only for Send/ |
| | Receive/Signal operations; must be closed using WSManCloseOperation |
| | _In_opt_ WSMAN_RECEIVE_DATA_RESULT *data // output data from com |
| | mand/shell; allocated internally and owned by the winrm stack |
| // valid only within th
is function | | // valid only within th
is function |
| ); | | ); |
| | |
|
| | #endif |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Asynchronous structure to be passed to all Shell operations; | | // Asynchronous structure to be passed to all Shell operations; |
| // it contains an optional user context and the callback function | | // it contains an optional user context and the callback function |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_SHELL_ASYNC | | typedef struct _WSMAN_SHELL_ASYNC |
| { | | { |
|
| __in_opt PVOID operationContext; | | _In_opt_ PVOID operationContext; |
| __in WSMAN_SHELL_COMPLETION_FUNCTION completionFunction; | | _In_ WSMAN_SHELL_COMPLETION_FUNCTION completionFunction; |
| } WSMAN_SHELL_ASYNC; | | } WSMAN_SHELL_ASYNC; |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManCreateShell API - wxf:Create | | // WSManCreateShell API - wxf:Create |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| void WINAPI WSManCreateShell( | | void WINAPI WSManCreateShell( |
| | |
|
| __inout WSMAN_SESSION_HANDLE session, | | _Inout_ WSMAN_SESSION_HANDLE session, |
| DWORD flags, | | DWORD flags, |
|
| __in __nullterminated PCWSTR resourceUri, // shell resource URI | | _In_ PCWSTR resourceUri, // shell resource URI |
| __in_opt WSMAN_SHELL_STARTUP_INFO *startupInfo, | | _In_opt_ WSMAN_SHELL_STARTUP_INFO *startupInfo, |
| __in_opt WSMAN_OPTION_SET *options, | | _In_opt_ WSMAN_OPTION_SET *options, |
| __in_opt WSMAN_DATA *createXml, // open content for crea | | _In_opt_ WSMAN_DATA *createXml, // open content for crea |
| te shell | | te shell |
| __in WSMAN_SHELL_ASYNC *async, | | _In_ WSMAN_SHELL_ASYNC *async, |
| __out WSMAN_SHELL_HANDLE *shell // should be closed using WSManCloseShell | | _Out_ WSMAN_SHELL_HANDLE *shell // should be closed using WSManCloseShell |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManRunShellCommand API - rsp:Command | | // WSManRunShellCommand API - rsp:Command |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // array of command arguments | | // array of command arguments |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| typedef struct _WSMAN_COMMAND_ARG_SET | | typedef struct _WSMAN_COMMAND_ARG_SET |
| { | | { |
| DWORD argsCount; | | DWORD argsCount; |
|
| __in_ecount_opt(argsCount) PCWSTR *args; | | _In_reads_opt_(argsCount) PCWSTR *args; |
| | |
| } WSMAN_COMMAND_ARG_SET; | | } WSMAN_COMMAND_ARG_SET; |
| | |
| void WINAPI WSManRunShellCommand( | | void WINAPI WSManRunShellCommand( |
| | |
|
| __inout WSMAN_SHELL_HANDLE shell, | | _Inout_ WSMAN_SHELL_HANDLE shell, |
| DWORD flags, | | DWORD flags, |
|
| __in PCWSTR commandLine, | | _In_ PCWSTR commandLine, |
| __in_opt WSMAN_COMMAND_ARG_SET *args, | | _In_opt_ WSMAN_COMMAND_ARG_SET *args, |
| __in_opt WSMAN_OPTION_SET *options, | | _In_opt_ WSMAN_OPTION_SET *options, |
| __in WSMAN_SHELL_ASYNC *async, | | _In_ WSMAN_SHELL_ASYNC *async, |
| __out WSMAN_COMMAND_HANDLE *command // should be closed using WSManCloseComm | | _Out_ WSMAN_COMMAND_HANDLE *command // should be closed using WSManCloseComm |
| and | | and |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManSignalShell API - rsp:Signal | | // WSManSignalShell API - rsp:Signal |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // control codes for the command | | // control codes for the command |
| // ----------------------------------------------------------------------- | | // ----------------------------------------------------------------------- |
| // | | // |
| #define WSMAN_SIGNAL_SHELL_CODE_TERMINATE WSMAN_SHELL_NS L"/signal/terminate" | | #define WSMAN_SIGNAL_SHELL_CODE_TERMINATE WSMAN_SHELL_NS L"/signal/terminate" |
| #define WSMAN_SIGNAL_SHELL_CODE_CTRL_C WSMAN_SHELL_NS L"/signal/ctrl_c" | | #define WSMAN_SIGNAL_SHELL_CODE_CTRL_C WSMAN_SHELL_NS L"/signal/ctrl_c" |
| #define WSMAN_SIGNAL_SHELL_CODE_CTRL_BREAK WSMAN_SHELL_NS L"/signal/ctrl_break" | | #define WSMAN_SIGNAL_SHELL_CODE_CTRL_BREAK WSMAN_SHELL_NS L"/signal/ctrl_break" |
| | |
| void WINAPI WSManSignalShell( | | void WINAPI WSManSignalShell( |
| | |
|
| __in WSMAN_SHELL_HANDLE shell, | | _In_ WSMAN_SHELL_HANDLE shell, |
| __in_opt WSMAN_COMMAND_HANDLE command, // if NULL, the Signal will b | | _In_opt_ WSMAN_COMMAND_HANDLE command, // if NULL, the Signal will b |
| e sent to the shell | | e sent to the shell |
| DWORD flags, | | DWORD flags, |
|
| __in __nullterminated PCWSTR code, // signal code | | _In_ PCWSTR code, // signal code |
| __in WSMAN_SHELL_ASYNC *async, | | _In_ WSMAN_SHELL_ASYNC *async, |
| __out WSMAN_OPERATION_HANDLE *signalOperation // should be closed using WSM | | _Out_ WSMAN_OPERATION_HANDLE *signalOperation // should be closed using WSM |
| anCloseOperation | | anCloseOperation |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManReceiveShellOutput API - rsp:Receive | | // WSManReceiveShellOutput API - rsp:Receive |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| void WINAPI WSManReceiveShellOutput( | | void WINAPI WSManReceiveShellOutput( |
| | |
|
| __inout WSMAN_SHELL_HANDLE shell, | | _Inout_ WSMAN_SHELL_HANDLE shell, |
| __in_opt WSMAN_COMMAND_HANDLE command, | | _In_opt_ WSMAN_COMMAND_HANDLE command, |
| DWORD flags, | | DWORD flags, |
|
| __in_opt WSMAN_STREAM_ID_SET *desiredStreamSet, // request output from a pa | | _In_opt_ WSMAN_STREAM_ID_SET *desiredStreamSet, // request output from a pa |
| rticular stream or list of streams | | rticular stream or list of streams |
| __in WSMAN_SHELL_ASYNC *async, | | _In_ WSMAN_SHELL_ASYNC *async, |
| __out WSMAN_OPERATION_HANDLE *receiveOperation // should be closed using WSM | | _Out_ WSMAN_OPERATION_HANDLE *receiveOperation // should be closed using WSM |
| anCloseOperation | | anCloseOperation |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManSendShellInput API - rsp:Send | | // WSManSendShellInput API - rsp:Send |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| void WINAPI WSManSendShellInput( | | void WINAPI WSManSendShellInput( |
| | |
|
| __in WSMAN_SHELL_HANDLE shell, | | _In_ WSMAN_SHELL_HANDLE shell, |
| __in_opt WSMAN_COMMAND_HANDLE command, | | _In_opt_ WSMAN_COMMAND_HANDLE command, |
| DWORD flags, | | DWORD flags, |
|
| __in PCWSTR streamId, // input stream name | | _In_ PCWSTR streamId, // input stream name |
| __in WSMAN_DATA *streamData, // data as binary - that can contain tex | | _In_ WSMAN_DATA *streamData, // data as binary - that can contain tex |
| t (ANSI/UNICODE), | | t (ANSI/UNICODE), |
| // binary content or objects or partial
or full XML | | // binary content or objects or partial
or full XML |
| BOOL endOfStream, | | BOOL endOfStream, |
|
| __in WSMAN_SHELL_ASYNC *async, | | _In_ WSMAN_SHELL_ASYNC *async, |
| __out WSMAN_OPERATION_HANDLE *sendOperation // should be closed using WSManC | | _Out_ WSMAN_OPERATION_HANDLE *sendOperation // should be closed using WSManC |
| loseOperation | | loseOperation |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManCloseCommand API | | // WSManCloseCommand API |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Closes a command (signals the termination of a command); the WSManCloseComman
d callback | | // Closes a command (signals the termination of a command); the WSManCloseComman
d callback |
| // is called with WSMAN_FLAG_CALLBACK_END_OF_OPERATION flag as result of this o
peration | | // is called with WSMAN_FLAG_CALLBACK_END_OF_OPERATION flag as result of this o
peration |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| void WINAPI WSManCloseCommand( | | void WINAPI WSManCloseCommand( |
|
| __inout_opt WSMAN_COMMAND_HANDLE commandHandle, | | _Inout_opt_ WSMAN_COMMAND_HANDLE commandHandle, |
| DWORD flags, | | DWORD flags, |
|
| __in WSMAN_SHELL_ASYNC *async | | _In_ WSMAN_SHELL_ASYNC *async |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSManCloseShell API | | // WSManCloseShell API |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Closes a shell; the WSManCloseShell callback is called with | | // Closes a shell; the WSManCloseShell callback is called with |
| // WSMAN_FLAG_CALLBACK_END_OF_OPERATION flag as result of this operation | | // WSMAN_FLAG_CALLBACK_END_OF_OPERATION flag as result of this operation |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| void WINAPI WSManCloseShell( | | void WINAPI WSManCloseShell( |
|
| __inout_opt WSMAN_SHELL_HANDLE shellHandle, | | _Inout_opt_ WSMAN_SHELL_HANDLE shellHandle, |
| DWORD flags, | | DWORD flags, |
|
| __in WSMAN_SHELL_ASYNC *async | | _In_ WSMAN_SHELL_ASYNC *async |
| | ); |
| | |
| | //New APIs defined for disconnect/reconnect |
| | #if defined(WSMAN_API_VERSION_1_1) |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // WSManCreateShellEx API - wxf:Create with specific shell Id. |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManCreateShellEx( |
| | _Inout_ WSMAN_SESSION_HANDLE session, |
| | DWORD flags, |
| | _In_ PCWSTR resourceUri, // shell resource URI |
| | _In_ PCWSTR shellId, |
| | _In_opt_ WSMAN_SHELL_STARTUP_INFO *startupInfo, |
| | _In_opt_ WSMAN_OPTION_SET *options, |
| | _In_opt_ WSMAN_DATA *createXml, // open content for crea |
| | te shell |
| | _In_ WSMAN_SHELL_ASYNC *async, |
| | _Out_ WSMAN_SHELL_HANDLE *shell // should be closed using WSManCloseShell |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // WSManRunShellCommandEx API - rsp:Command with specific command Id. |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManRunShellCommandEx( |
| | |
| | _Inout_ WSMAN_SHELL_HANDLE shell, |
| | DWORD flags, |
| | _In_ PCWSTR commandId, |
| | _In_ PCWSTR commandLine, |
| | _In_opt_ WSMAN_COMMAND_ARG_SET *args, |
| | _In_opt_ WSMAN_OPTION_SET *options, |
| | _In_ WSMAN_SHELL_ASYNC *async, |
| | _Out_ WSMAN_COMMAND_HANDLE *command // should be closed using WSManCloseComm |
| | and |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // WSManDisconnectShell API - rsp:Disconnect |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManDisconnectShell( |
| | _Inout_ WSMAN_SHELL_HANDLE shell, |
| | DWORD flags, |
| | _In_ WSMAN_SHELL_DISCONNECT_INFO* disconnectInfo, |
| | _In_ WSMAN_SHELL_ASYNC *async |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
|
| | // WSManReconnectShell API - rsp:Disconnect |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManReconnectShell( |
| | _Inout_ WSMAN_SHELL_HANDLE shell, |
| | DWORD flags, |
| | _In_ WSMAN_SHELL_ASYNC *async |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // WSManReconnectShell API - rsp:Disconnect |
| | // This is a temporary API for first week's delivery. This will be replaced |
| | // by an API that does not take a callback. Instead the callback supplied to |
| | // WSManRunShellCommand is used to report the completion of this operation |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManReconnectShellCommand( |
| | _Inout_ WSMAN_COMMAND_HANDLE commandHandle, |
| | DWORD flags, |
| | _In_ WSMAN_SHELL_ASYNC *async |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // WSManConnectShell API - rsp:Connect |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManConnectShell( |
| | _Inout_ WSMAN_SESSION_HANDLE session, |
| | DWORD flags, |
| | _In_ PCWSTR resourceUri, |
| | _In_ PCWSTR shellID, // shell Identifier |
| | _In_opt_ WSMAN_OPTION_SET *options, |
| | _In_opt_ WSMAN_DATA *connectXml, // open content for con |
| | nect shell |
| | _In_ WSMAN_SHELL_ASYNC *async, |
| | _Out_ WSMAN_SHELL_HANDLE *shell // should be closed using WSManCloseShell |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // WSManConnectShellCommand API - rsp:Connect |
| | // ----------------------------------------------------------------------------- |
| | // |
| | void WINAPI WSManConnectShellCommand( |
| | _Inout_ WSMAN_SHELL_HANDLE shell, |
| | DWORD flags, |
| | _In_ PCWSTR commandID, //command Identifier |
| | _In_opt_ WSMAN_OPTION_SET *options, |
| | _In_opt_ WSMAN_DATA *connectXml, // open content for connect |
| | command |
| | _In_ WSMAN_SHELL_ASYNC *async, |
| | _Out_ WSMAN_COMMAND_HANDLE *command // should be closed using WSManCloseComm |
| | and |
| | ); |
| | |
| | #endif |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| // Plug-in APIs. These APIs are used by plug-ins for reporting results | | // Plug-in APIs. These APIs are used by plug-ins for reporting results |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ------------------------------------------------------------------------ | | // ------------------------------------------------------------------------ |
| // Sender information | | // Sender information |
| // ------------------------------------------------------------------------ | | // ------------------------------------------------------------------------ |
| // | | // |
| | |
| | |
| skipping to change at line 962 | | skipping to change at line 1186 |
| // the WSMAN_PLUGIN_RELEASE_SHELL_CONTEXT entry point during shell shutdown when | | // the WSMAN_PLUGIN_RELEASE_SHELL_CONTEXT entry point during shell shutdown when |
| // it is safe to delete the plug-in shell context, and WS-Man calls the | | // it is safe to delete the plug-in shell context, and WS-Man calls the |
| // WSMAN_PLUGIN_RELEASE_COMMAND_CONTEXT entry point when it is safe to delete | | // WSMAN_PLUGIN_RELEASE_COMMAND_CONTEXT entry point when it is safe to delete |
| // the plug-in command context. Any context reported through | | // the plug-in command context. Any context reported through |
| // WSManPluginReportContext may not be deleted until the corresponding release | | // WSManPluginReportContext may not be deleted until the corresponding release |
| // function has been called. Failure to follow the contract will result in | | // function has been called. Failure to follow the contract will result in |
| // errors being generated. | | // errors being generated. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManPluginReportContext( | | DWORD WINAPI WSManPluginReportContext( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in PVOID context | | _In_ PVOID context |
| ); | | ); |
| | |
| typedef VOID (WINAPI *WSMAN_PLUGIN_RELEASE_SHELL_CONTEXT)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_RELEASE_SHELL_CONTEXT)( |
|
| __in PVOID shellContext | | _In_ PVOID shellContext |
| ); | | ); |
| | |
| typedef VOID (WINAPI *WSMAN_PLUGIN_RELEASE_COMMAND_CONTEXT)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_RELEASE_COMMAND_CONTEXT)( |
|
| __in PVOID shellContext, | | _In_ PVOID shellContext, |
| __in PVOID commandContext | | _In_ PVOID commandContext |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // This API is used by most a shell plug-in to report data for the Receive | | // This API is used by most a shell plug-in to report data for the Receive |
| // operation. This is the only operation that returns results that has a | | // operation. This is the only operation that returns results that has a |
| // different API due to the extra shell data that is needed. This API | | // different API due to the extra shell data that is needed. This API |
| // is called for every result in the stream. Once all data is received | | // is called for every result in the stream. Once all data is received |
| // the WSManPluginOperationComplete API must be called. | | // the WSManPluginOperationComplete API must be called. |
| // stream and streamResult are one pair of information that if one parameter | | // stream and streamResult are one pair of information that if one parameter |
| | |
| skipping to change at line 998 | | skipping to change at line 1222 |
| // so the API can be used to register the stream data, command state or | | // so the API can be used to register the stream data, command state or |
| // both. | | // both. |
| // flags: | | // flags: |
| // WSMAN_FLAG_RECEIVE_RESULT_NO_MORE_DATA | | // WSMAN_FLAG_RECEIVE_RESULT_NO_MORE_DATA |
| // No more data on this stream. Only valid when a stream is specified. | | // No more data on this stream. Only valid when a stream is specified. |
| // WSMAN_FLAG_RECEIVE_FLUSH | | // WSMAN_FLAG_RECEIVE_FLUSH |
| // Send the data as soon as possible. Normally data is held onto in | | // Send the data as soon as possible. Normally data is held onto in |
| // order to maximise the size of the response packet. This should | | // order to maximise the size of the response packet. This should |
| // only be used if a request/response style of data is needed between | | // only be used if a request/response style of data is needed between |
| // the send and receive data streams. | | // the send and receive data streams. |
|
| | // WSMAN_FLAG_RECEIVE_RESULT_DATA_BOUNDARY |
| | // Data reported is at a boundary. Plugins usually serialize and fragme |
| | nt |
| | // output data objects and push them along the receive byte stream. |
| | // If the current data chunk being reported is an end fragment of the |
| | // data object current processed, plugins would set this flag. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| #define WSMAN_FLAG_RECEIVE_RESULT_NO_MORE_DATA 1 | | #define WSMAN_FLAG_RECEIVE_RESULT_NO_MORE_DATA 1 |
| #define WSMAN_FLAG_RECEIVE_FLUSH 2 | | #define WSMAN_FLAG_RECEIVE_FLUSH 2 |
|
| | #define WSMAN_FLAG_RECEIVE_RESULT_DATA_BOUNDARY 4 |
| | |
| DWORD WINAPI WSManPluginReceiveResult( | | DWORD WINAPI WSManPluginReceiveResult( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in_opt PCWSTR stream, | | _In_opt_ PCWSTR stream, |
| __in_opt WSMAN_DATA *streamResult, | | _In_opt_ WSMAN_DATA *streamResult, |
| __in_opt PCWSTR commandState, | | _In_opt_ PCWSTR commandState, |
| __in DWORD exitCode | | _In_ DWORD exitCode |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // This API is used by all plug-ins to report the completion of an operation. | | // This API is used by all plug-ins to report the completion of an operation. |
| // For operations like Get, Put, Create and Invoke this API is likely to be | | // For operations like Get, Put, Create and Invoke this API is likely to be |
| // called after the result has been called. For Delete operations where no | | // called after the result has been called. For Delete operations where no |
| // result is needed other than status, this API is all that is needed. | | // result is needed other than status, this API is all that is needed. |
| // For more complex operations like Enumerations, Subscriptions and shell | | // For more complex operations like Enumerations, Subscriptions and shell |
| // Receive operations this API is is used to report the completion of the | | // Receive operations this API is is used to report the completion of the |
| // data stream. The Create Shell and Create Command operations must also | | // data stream. The Create Shell and Create Command operations must also |
| // call this when the shell and command operations a completed fully. | | // call this when the shell and command operations a completed fully. |
|
| | // extendedInformation is used by plugin |
| | // - to either report additional faiure information in case of an error |
| | // (errorCode != No_ERROR) or |
| | // - to supply open Xml content in certain wsman responses like rsp:ConnectRespo |
| | nse |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManPluginOperationComplete( | | DWORD WINAPI WSManPluginOperationComplete( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in DWORD errorCode, | | _In_ DWORD errorCode, |
| __in_opt PCWSTR extendedErrorInformation | | _In_opt_ PCWSTR extendedInformation |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| //This API is used to get operational information for items such as timeouts | | //This API is used to get operational information for items such as timeouts |
| //and data restrictions associated with the operation. It is not recommended | | //and data restrictions associated with the operation. It is not recommended |
| //that a plug-in handles these kinds of parameters for anything other than | | //that a plug-in handles these kinds of parameters for anything other than |
| //informational use. | | //informational use. |
| // | | // |
| //Locale parameters return WSMAN_DATA_TEXT, which is owned internally, | | //Locale parameters return WSMAN_DATA_TEXT, which is owned internally, |
| | |
| skipping to change at line 1051 | | skipping to change at line 1285 |
| // | | // |
| | |
| #define WSMAN_PLUGIN_PARAMS_MAX_ENVELOPE_SIZE 1 | | #define WSMAN_PLUGIN_PARAMS_MAX_ENVELOPE_SIZE 1 |
| #define WSMAN_PLUGIN_PARAMS_TIMEOUT 2 | | #define WSMAN_PLUGIN_PARAMS_TIMEOUT 2 |
| #define WSMAN_PLUGIN_PARAMS_REMAINING_RESULT_SIZE 3 | | #define WSMAN_PLUGIN_PARAMS_REMAINING_RESULT_SIZE 3 |
| #define WSMAN_PLUGIN_PARAMS_LARGEST_RESULT_SIZE 4 | | #define WSMAN_PLUGIN_PARAMS_LARGEST_RESULT_SIZE 4 |
| #define WSMAN_PLUGIN_PARAMS_GET_REQUESTED_LOCALE 5 /* Returns WSMAN_DATA_TEXT */ | | #define WSMAN_PLUGIN_PARAMS_GET_REQUESTED_LOCALE 5 /* Returns WSMAN_DATA_TEXT */ |
| #define WSMAN_PLUGIN_PARAMS_GET_REQUESTED_DATA_LOCALE 6 /* Returns WSMAN_DATA_TE
XT */ | | #define WSMAN_PLUGIN_PARAMS_GET_REQUESTED_DATA_LOCALE 6 /* Returns WSMAN_DATA_TE
XT */ |
| | |
| DWORD WINAPI WSManPluginGetOperationParameters ( | | DWORD WINAPI WSManPluginGetOperationParameters ( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __out WSMAN_DATA *data | | _Out_ WSMAN_DATA *data |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
|
| | // This API is used to get plugin configuration information from within the plug |
| | in. |
| | // The plugin can ask for specific data by specifying a different flag for each |
| | as follows: |
| | // WSMAN_PLUGIN_PARAMS_SHAREDHOST 1 Specifies if th |
| | e plugin is configured to run as a shared host or separate host. |
| | // WSMAN_PLUGIN_PARAMS_RUNAS_USER 2 Specifies the R |
| | unAs User configured for the plugin. If no RunAs user is configured, this will r |
| | eturn an empty string. |
| | // WSMAN_PLUGIN_PARAMS_AUTORESTART 3 Specifies if the |
| | plugin is configured to be autorestarted. |
| | // WSMAN_PLUGIN_PARAMS_HOSTIDLETIMEOUTSECONDS 4 Specifies the idle timeout |
| | in seconds configured for the host process. |
| | // ----------------------------------------------------------------------------- |
| | // |
| | #define WSMAN_PLUGIN_PARAMS_SHAREDHOST 1 |
| | #define WSMAN_PLUGIN_PARAMS_RUNAS_USER 2 |
| | #define WSMAN_PLUGIN_PARAMS_AUTORESTART 3 |
| | #define WSMAN_PLUGIN_PARAMS_HOSTIDLETIMEOUTSECONDS 4 |
| | #define WSMAN_PLUGIN_PARAMS_NAME 5 |
| | |
| | DWORD WINAPI WSManPluginGetConfiguration ( |
| | _In_ PVOID pluginContext, |
| | _In_ DWORD flags, |
| | _Out_ WSMAN_DATA *data |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| | // This API is used by plugins to report completion |
| | // flags are reserved |
| | // pluginContext MUST be the same context that plugin provided to the WSManPlugi |
| | nStartup method |
| | // ----------------------------------------------------------------------------- |
| | // |
| | DWORD WINAPI WSManPluginReportCompletion( |
| | _In_ PVOID pluginContext, |
| | _In_ DWORD flags |
| | ); |
| | |
| | // |
| | // ----------------------------------------------------------------------------- |
| // This API is used release memory that is held for the purpose of populating | | // This API is used release memory that is held for the purpose of populating |
| // the WSMAN_PLUGIN_REQUEST that is passed into operation plug-in entry points. | | // the WSMAN_PLUGIN_REQUEST that is passed into operation plug-in entry points. |
| // This API can be called any time between a plug-in entry point is called and | | // This API can be called any time between a plug-in entry point is called and |
| // the entry point calling WSManPluginOperationComplete. This API does not need | | // the entry point calling WSManPluginOperationComplete. This API does not need |
| // to be called. Not calling it will result in all memory being freed up when | | // to be called. Not calling it will result in all memory being freed up when |
| // WSManPluginOperationComplete is called. Calling this method can result in | | // WSManPluginOperationComplete is called. Calling this method can result in |
| // significant amounts of memory to be freed up. After calling this API | | // significant amounts of memory to be freed up. After calling this API |
| // the plug-in must not access any member variables from within the | | // the plug-in must not access any member variables from within the |
| // WSMAN_PLUGIN_REQUEST structure. | | // WSMAN_PLUGIN_REQUEST structure. |
| // A good use of this API is in the following situation: | | // A good use of this API is in the following situation: |
| // A plug-in implements the Shell infrastructure. The WSMAN_PLUGIN_SHELL | | // A plug-in implements the Shell infrastructure. The WSMAN_PLUGIN_SHELL |
| // entry point is called and that method calls WSManPluginReportContext. | | // entry point is called and that method calls WSManPluginReportContext. |
| // No other information from the shell WSMAN_PLUGIN_REQUEST is needed from this | | // No other information from the shell WSMAN_PLUGIN_REQUEST is needed from this |
| // point on and because WSManPluginOperationComplete is not called for | | // point on and because WSManPluginOperationComplete is not called for |
| // potentially a long time in the future, calling WSManPluginFreeRequestDetails | | // potentially a long time in the future, calling WSManPluginFreeRequestDetails |
| // can potentially free a lot of resources. The command and receive entry | | // can potentially free a lot of resources. The command and receive entry |
| // points are also good categories as they are called once, but the plugin may | | // points are also good categories as they are called once, but the plugin may |
| // not call the operation complete method for some time. | | // not call the operation complete method for some time. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
|
| DWORD WINAPI WSManPluginFreeRequestDetails(__in WSMAN_PLUGIN_REQUEST *requestDet
ails); | | DWORD WINAPI WSManPluginFreeRequestDetails(_In_ WSMAN_PLUGIN_REQUEST *requestDet
ails); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Plug-in DLL Entry points. A plug-in needs to have their catalog registered | | // Plug-in DLL Entry points. A plug-in needs to have their catalog registered |
| // with the WSMan service and it contains the names of the plug-in DLL entry | | // with the WSMan service and it contains the names of the plug-in DLL entry |
| // points. The entry points themselves need to conform to these prototype | | // points. The entry points themselves need to conform to these prototype |
| // definitions | | // definitions |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Each plug-in needs to support the Startup callback. A plug-in may be | | // Each plug-in needs to support the Startup callback. A plug-in may be |
| // initialized more than once within the same process, but only once per | | // initialized more than once within the same process, but only once per |
| // applicationIdentification. | | // applicationIdentification. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
|
| | #define WSMAN_PLUGIN_STARTUP_REQUEST_RECEIVED 0x0 |
| | #define WSMAN_PLUGIN_STARTUP_AUTORESTARTED_REBOOT 0x1 |
| | #define WSMAN_PLUGIN_STARTUP_AUTORESTARTED_CRASH 0x2 |
| | |
| typedef DWORD (WINAPI *WSMAN_PLUGIN_STARTUP)( | | typedef DWORD (WINAPI *WSMAN_PLUGIN_STARTUP)( |
|
| __in DWORD flags, | | _In_ DWORD flags, |
| __in PCWSTR applicationIdentification, | | _In_ PCWSTR applicationIdentification, |
| __in_opt PCWSTR extraInfo, | | _In_opt_ PCWSTR extraInfo, |
| __out PVOID *pluginContext | | _Out_ PVOID *pluginContext |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Each plug-in needs to support the Shutdown callback. Each successful call | | // Each plug-in needs to support the Shutdown callback. Each successful call |
| // to Startup will result in a call to Shutdown before the DLL is unloaded. | | // to Startup will result in a call to Shutdown before the DLL is unloaded. |
| // It is important to make sure the plug-in tracks the number of times the | | // It is important to make sure the plug-in tracks the number of times the |
| // Startup entry point is called so the plug-in is not shutdown prematurely. | | // Startup entry point is called so the plug-in is not shutdown prematurely. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| #define WSMAN_PLUGIN_SHUTDOWN_SYSTEM 1 | | #define WSMAN_PLUGIN_SHUTDOWN_SYSTEM 1 |
| #define WSMAN_PLUGIN_SHUTDOWN_SERVICE 2 | | #define WSMAN_PLUGIN_SHUTDOWN_SERVICE 2 |
| #define WSMAN_PLUGIN_SHUTDOWN_IISHOST 3 | | #define WSMAN_PLUGIN_SHUTDOWN_IISHOST 3 |
|
| | #define WSMAN_PLUGIN_SHUTDOWN_IDLETIMEOUT_ELAPSED 4 |
| | |
| typedef DWORD (WINAPI *WSMAN_PLUGIN_SHUTDOWN)( | | typedef DWORD (WINAPI *WSMAN_PLUGIN_SHUTDOWN)( |
|
| __in_opt PVOID pluginContext, | | _In_opt_ PVOID pluginContext, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in DWORD reason | | _In_ DWORD reason |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // A plug-in that supports the Shell operations needs to implement this callback | | // A plug-in that supports the Shell operations needs to implement this callback |
| // to allow commands to be created and to allow data to be streamed into either | | // to allow commands to be created and to allow data to be streamed into either |
| // a shell or command. The plug-in must call WSManPluginReportContext to | | // a shell or command. The plug-in must call WSManPluginReportContext to |
| // report the shell context. Once the shell is completed or when it is closed | | // report the shell context. Once the shell is completed or when it is closed |
| // via the operationClosed boolean value or operationClosedHandle in the | | // via the operationClosed boolean value or operationClosedHandle in the |
| // requestDetails the plug-in needs to call WSManPluginOperationComplete. | | // requestDetails the plug-in needs to call WSManPluginOperationComplete. |
| // The shell is active until this time. | | // The shell is active until this time. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef VOID (WINAPI *WSMAN_PLUGIN_SHELL)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_SHELL)( |
|
| __in PVOID pluginContext, //Relates to context returned from WSMAN_PLUGIN_ | | _In_ PVOID pluginContext, //Relates to context returned from WSMAN_PLUGIN_ |
| STARTUP | | STARTUP |
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in_opt WSMAN_SHELL_STARTUP_INFO *startupInfo, | | _In_opt_ WSMAN_SHELL_STARTUP_INFO *startupInfo, |
| __in_opt WSMAN_DATA *inboundShellInformation | | _In_opt_ WSMAN_DATA *inboundShellInformation |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // A plug-in that supports the Shell operations and needs to create commands | | // A plug-in that supports the Shell operations and needs to create commands |
| // that are associated with the shell needs to implement this callback. | | // that are associated with the shell needs to implement this callback. |
| // The plug-in must call WSManPluginReportContext to | | // The plug-in must call WSManPluginReportContext to |
| // report the command context. Once the command is completed or when it is clos
ed | | // report the command context. Once the command is completed or when it is clos
ed |
| // via the operationClosed boolean value or operationClosedHandle in the | | // via the operationClosed boolean value or operationClosedHandle in the |
| // requestDetails the plug-in needs to call WSManPluginOperationComplete. | | // requestDetails the plug-in needs to call WSManPluginOperationComplete. |
| // The command is active until this time. | | // The command is active until this time. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef VOID (WINAPI *WSMAN_PLUGIN_COMMAND)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_COMMAND)( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in PVOID shellContext, | | _In_ PVOID shellContext, |
| __in PCWSTR commandLine, | | _In_ PCWSTR commandLine, |
| __in_opt WSMAN_COMMAND_ARG_SET *arguments | | _In_opt_ WSMAN_COMMAND_ARG_SET *arguments |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // A plug-in receives an inbound data stream to either the shell or command | | // A plug-in receives an inbound data stream to either the shell or command |
| // via this callback. Each piece of data causes the callback to be called once. | | // via this callback. Each piece of data causes the callback to be called once. |
| // For each piece of data the plug-in calls WSManPluginOperationComplete to | | // For each piece of data the plug-in calls WSManPluginOperationComplete to |
| // acknowledge receipt and to allow the next piece of data to be delivered. | | // acknowledge receipt and to allow the next piece of data to be delivered. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| #define WSMAN_FLAG_SEND_NO_MORE_DATA 1 | | #define WSMAN_FLAG_SEND_NO_MORE_DATA 1 |
| | |
| typedef VOID (WINAPI *WSMAN_PLUGIN_SEND)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_SEND)( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in PVOID shellContext, | | _In_ PVOID shellContext, |
| __in_opt PVOID commandContext, | | _In_opt_ PVOID commandContext, |
| __in PCWSTR stream, | | _In_ PCWSTR stream, |
| __in WSMAN_DATA *inboundData | | _In_ WSMAN_DATA *inboundData |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // A plug-in sends an outbound data stream from either the shell or command | | // A plug-in sends an outbound data stream from either the shell or command |
| // via this callback. This API is called when an inbound request from a client | | // via this callback. This API is called when an inbound request from a client |
| // is received. This callback may be called against the shell and/or command | | // is received. This callback may be called against the shell and/or command |
| // based on the client request. Each piece of data that needs to be sent back | | // based on the client request. Each piece of data that needs to be sent back |
| // to the client is done so through the WSManPluginReceiveResult API. Once | | // to the client is done so through the WSManPluginReceiveResult API. Once |
| // all data has been send, when the stream is terminated via some internal means
, | | // all data has been send, when the stream is terminated via some internal means
, |
| // or if the receive call is cancelled through the operationClosed boolean | | // or if the receive call is cancelled through the operationClosed boolean |
| // value or operationClosedHandle, the plug-in needs to call | | // value or operationClosedHandle, the plug-in needs to call |
| // WSManPluginOperationComplete. The operation is marked as active until this | | // WSManPluginOperationComplete. The operation is marked as active until this |
| // time. | | // time. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef VOID (WINAPI *WSMAN_PLUGIN_RECEIVE)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_RECEIVE)( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in PVOID shellContext, | | _In_ PVOID shellContext, |
| __in_opt PVOID commandContext, | | _In_opt_ PVOID commandContext, |
| __in_opt WSMAN_STREAM_ID_SET *streamSet | | _In_opt_ WSMAN_STREAM_ID_SET *streamSet |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // A plug-in receives an inbound signal to either the shell or command | | // A plug-in receives an inbound signal to either the shell or command |
| // via this callback. Each signal causes the callback to be called once. | | // via this callback. Each signal causes the callback to be called once. |
| // For each call the plug-in calls WSManPluginOperationComplete to | | // For each call the plug-in calls WSManPluginOperationComplete to |
| // acknowledge receipt and to allow the next signal to be received. | | // acknowledge receipt and to allow the next signal to be received. |
| // A signal can cause the shell or command to be terminated, so the result | | // A signal can cause the shell or command to be terminated, so the result |
| // of this callback may be many completion calls for the Signal, Receive, Comman
d | | // of this callback may be many completion calls for the Signal, Receive, Comman
d |
| // and Shell operations. | | // and Shell operations. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef VOID (WINAPI *WSMAN_PLUGIN_SIGNAL)( | | typedef VOID (WINAPI *WSMAN_PLUGIN_SIGNAL)( |
|
| __in WSMAN_PLUGIN_REQUEST *requestDetails, | | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in PVOID shellContext, | | _In_ PVOID shellContext, |
| __in_opt PVOID commandContext, | | _In_opt_ PVOID commandContext, |
| __in PCWSTR code | | _In_ PCWSTR code |
| ); | | ); |
| | |
|
| | typedef VOID (WINAPI* WSMAN_PLUGIN_CONNECT)( |
| | _In_ WSMAN_PLUGIN_REQUEST *requestDetails, |
| | _In_ DWORD flags, |
| | _In_ PVOID shellContext, |
| | _In_opt_ PVOID commandContext, |
| | _In_opt_ WSMAN_DATA *inboundConnectInformation |
| | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Authorization Plug-in Structures | | // Authorization Plug-in Structures |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSMAN_AUTHZ_QUOTA | | // WSMAN_AUTHZ_QUOTA |
| // Any of the maxAllowed entries can be set to MAX_DWORD to mark quota as | | // Any of the maxAllowed entries can be set to MAX_DWORD to mark quota as |
| | |
| skipping to change at line 1263 | | skipping to change at line 1544 |
| // user is allowed to carry out any request at all. The plug-in must call | | // user is allowed to carry out any request at all. The plug-in must call |
| // WSManPluginAuthzUserComplete to report either the user is not authorized | | // WSManPluginAuthzUserComplete to report either the user is not authorized |
| // with ERROR_ACCESS_DENIED or for successful authorization NO_ERROR. | | // with ERROR_ACCESS_DENIED or for successful authorization NO_ERROR. |
| // ERROR_WSMAN_REDIRECT_REQUIRED should be reported if a HTTP redirect is | | // ERROR_WSMAN_REDIRECT_REQUIRED should be reported if a HTTP redirect is |
| // required for this user, in which case the new HTTP URI should be recorded | | // required for this user, in which case the new HTTP URI should be recorded |
| // in the extendedErrorInformation. All other errors are report a failure | | // in the extendedErrorInformation. All other errors are report a failure |
| // to the client but no specific information is reported. | | // to the client but no specific information is reported. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_USER)( | | typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_USER)( |
|
| __in PVOID pluginContext, | | _In_ PVOID pluginContext, |
| __in WSMAN_SENDER_DETAILS *senderDetails, | | _In_ WSMAN_SENDER_DETAILS *senderDetails, |
| __in DWORD flags | | _In_ DWORD flags |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // WSMAN_PLUGIN_AUTHORIZE_USER | | // WSMAN_PLUGIN_AUTHORIZE_USER |
| // Plug-in needs to have a DLL export of WSManPluginAuthzOperation to handle thi
s | | // Plug-in needs to have a DLL export of WSManPluginAuthzOperation to handle thi
s |
| // request. The plug-in must call WSManPluginAuthzUserComplete to report either | | // request. The plug-in must call WSManPluginAuthzUserComplete to report either |
| // the user is not authorized with ERROR_ACCESS_DENIED or for successful | | // the user is not authorized with ERROR_ACCESS_DENIED or for successful |
| // authorization NO_ERROR. All other errors are reported as a failure | | // authorization NO_ERROR. All other errors are reported as a failure |
| // to the client as a SOAP fault with information given in the | | // to the client as a SOAP fault with information given in the |
| // extendedErrorInformation parameter. | | // extendedErrorInformation parameter. |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_OPERATION)( | | typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_OPERATION)( |
|
| __in PVOID pluginContext, | | _In_ PVOID pluginContext, |
| __in WSMAN_SENDER_DETAILS *senderDetails, | | _In_ WSMAN_SENDER_DETAILS *senderDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in DWORD operation, | | _In_ DWORD operation, |
| __in PCWSTR action, | | _In_ PCWSTR action, |
| __in PCWSTR resourceUri | | _In_ PCWSTR resourceUri |
| ); | | ); |
| | |
| typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_QUERY_QUOTA)( | | typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_QUERY_QUOTA)( |
|
| __in PVOID pluginContext, | | _In_ PVOID pluginContext, |
| __in WSMAN_SENDER_DETAILS *senderDetails, | | _In_ WSMAN_SENDER_DETAILS *senderDetails, |
| __in DWORD flags | | _In_ DWORD flags |
| ); | | ); |
| | |
| typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_RELEASE_CONTEXT)( | | typedef VOID (WINAPI * WSMAN_PLUGIN_AUTHORIZE_RELEASE_CONTEXT)( |
|
| __in PVOID userAuthorizationContext | | _In_ PVOID userAuthorizationContext |
| ); | | ); |
| | |
| // | | // |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // Authorization Plug-in Callback methods | | // Authorization Plug-in Callback methods |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| // | | // |
| DWORD WINAPI WSManPluginAuthzUserComplete ( | | DWORD WINAPI WSManPluginAuthzUserComplete ( |
|
| __in WSMAN_SENDER_DETAILS *senderDetails, | | _In_ WSMAN_SENDER_DETAILS *senderDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in_opt PVOID userAuthorizationContext, | | _In_opt_ PVOID userAuthorizationContext, |
| __in_opt HANDLE impersonationToken, | | _In_opt_ HANDLE impersonationToken, |
| __in BOOL userIsAdministrator, | | _In_ BOOL userIsAdministrator, |
| __in DWORD errorCode, | | _In_ DWORD errorCode, |
| __in_opt PCWSTR extendedErrorInformation | | _In_opt_ PCWSTR extendedErrorInformation |
| ); | | ); |
| | |
| DWORD WINAPI WSManPluginAuthzOperationComplete ( | | DWORD WINAPI WSManPluginAuthzOperationComplete ( |
|
| __in WSMAN_SENDER_DETAILS *senderDetails, | | _In_ WSMAN_SENDER_DETAILS *senderDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in_opt PVOID userAuthorizationContext, | | _In_opt_ PVOID userAuthorizationContext, |
| __in DWORD errorCode, | | _In_ DWORD errorCode, |
| __in_opt PCWSTR extendedErrorInformation | | _In_opt_ PCWSTR extendedErrorInformation |
| ); | | ); |
| | |
| DWORD WINAPI WSManPluginAuthzQueryQuotaComplete ( | | DWORD WINAPI WSManPluginAuthzQueryQuotaComplete ( |
|
| __in WSMAN_SENDER_DETAILS *senderDetails, | | _In_ WSMAN_SENDER_DETAILS *senderDetails, |
| __in DWORD flags, | | _In_ DWORD flags, |
| __in_opt WSMAN_AUTHZ_QUOTA *quota, | | _In_opt_ WSMAN_AUTHZ_QUOTA *quota, |
| __in DWORD errorCode, | | _In_ DWORD errorCode, |
| __in_opt PCWSTR extendedErrorInformation | | _In_opt_ PCWSTR extendedErrorInformation |
| ); | | ); |
| | |
| #ifdef __cplusplus | | #ifdef __cplusplus |
| } // end of extern C | | } // end of extern C |
| #endif // __cplusplus | | #endif // __cplusplus |
| | |
|
| | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ |
| | #pragma endregion |
| | |
| #endif // _WSMAN_H_ | | #endif // _WSMAN_H_ |
| | |
| End of changes. 94 change blocks. |
| 198 lines changed or deleted | | 517 lines changed or added |
|