Home | History | Annotate | Download | only in include
      1 /**
      2  * This file is part of the mingw-w64 runtime package.
      3  * No warranty is given; refer to the file DISCLAIMER within this package.
      4  */
      5 
      6 #include <winapifamily.h>
      7 
      8 #ifndef _WSMAN_H_
      9 #define _WSMAN_H_
     10 
     11 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
     12 
     13 #if !defined (WSMAN_API_VERSION_1_0) && !defined (WSMAN_API_VERSION_1_1)
     14 #error Either WSMAN_API_VERSION_1_0 or WSMAN_API_VERSION_1_1 need to be defined before including this header.
     15 #endif
     16 
     17 #define WSMAN_FLAG_REQUESTED_API_VERSION_1_0 0x0
     18 #define WSMAN_FLAG_REQUESTED_API_VERSION_1_1 0x1
     19 
     20 #define WSMAN_OPERATION_INFOV1 0x00000000
     21 #define WSMAN_OPERATION_INFOV2 0xaabbccdd
     22 
     23 #define WSMAN_STREAM_ID_STDIN L"stdin"
     24 #define WSMAN_STREAM_ID_STDOUT L"stdout"
     25 #define WSMAN_STREAM_ID_STDERR L"stderr"
     26 
     27 #define WSMAN_DEFAULT_TIMEOUT_MS 60000
     28 
     29 #define WSMAN_FLAG_RECEIVE_RESULT_NO_MORE_DATA 1
     30 #define WSMAN_FLAG_RECEIVE_FLUSH 2
     31 #define WSMAN_FLAG_RECEIVE_RESULT_DATA_BOUNDARY 4
     32 
     33 #define WSMAN_PLUGIN_PARAMS_MAX_ENVELOPE_SIZE 1
     34 #define WSMAN_PLUGIN_PARAMS_TIMEOUT 2
     35 #define WSMAN_PLUGIN_PARAMS_REMAINING_RESULT_SIZE 3
     36 #define WSMAN_PLUGIN_PARAMS_LARGEST_RESULT_SIZE 4
     37 #define WSMAN_PLUGIN_PARAMS_GET_REQUESTED_LOCALE 5
     38 #define WSMAN_PLUGIN_PARAMS_GET_REQUESTED_DATA_LOCALE 6
     39 
     40 #define WSMAN_PLUGIN_PARAMS_SHAREDHOST 1
     41 #define WSMAN_PLUGIN_PARAMS_RUNAS_USER 2
     42 #define WSMAN_PLUGIN_PARAMS_AUTORESTART 3
     43 #define WSMAN_PLUGIN_PARAMS_HOSTIDLETIMEOUTSECONDS 4
     44 #define WSMAN_PLUGIN_PARAMS_NAME 5
     45 
     46 #define WSMAN_PLUGIN_STARTUP_REQUEST_RECEIVED 0x0
     47 #define WSMAN_PLUGIN_STARTUP_AUTORESTARTED_REBOOT 0x1
     48 #define WSMAN_PLUGIN_STARTUP_AUTORESTARTED_CRASH 0x2
     49 
     50 #define WSMAN_PLUGIN_SHUTDOWN_SYSTEM 1
     51 #define WSMAN_PLUGIN_SHUTDOWN_SERVICE 2
     52 #define WSMAN_PLUGIN_SHUTDOWN_IISHOST 3
     53 #define WSMAN_PLUGIN_SHUTDOWN_IDLETIMEOUT_ELAPSED 4
     54 
     55 #define WSMAN_FLAG_SEND_NO_MORE_DATA 1
     56 
     57 #define WSMAN_SHELL_NS L"http://schemas.microsoft.com/wbem/wsman/1/windows/shell"
     58 #define WSMAN_SHELL_NS_LEN (sizeof (WSMAN_SHELL_NS)/sizeof (WCHAR)-1)
     59 
     60 #define WSMAN_CMDSHELL_URI WSMAN_SHELL_NS L"/cmd"
     61 
     62 #define WSMAN_CMDSHELL_OPTION_CODEPAGE L"WINRS_CODEPAGE"
     63 #define WSMAN_SHELL_OPTION_NOPROFILE L"WINRS_NOPROFILE"
     64 
     65 #define WSMAN_CMDSHELL_OPTION_CONSOLEMODE_STDIN L"WINRS_CONSOLEMODE_STDIN"
     66 #define WSMAN_CMDSHELL_OPTION_SKIP_CMD_SHELL L"WINRS_SKIP_CMD_SHELL"
     67 
     68 #define WSMAN_COMMAND_STATE_DONE WSMAN_SHELL_NS L"/CommandState/Done"
     69 #define WSMAN_COMMAND_STATE_PENDING WSMAN_SHELL_NS L"/CommandState/Pending"
     70 #define WSMAN_COMMAND_STATE_RUNNING WSMAN_SHELL_NS L"/CommandState/Running"
     71 
     72 #define WSMAN_SIGNAL_SHELL_CODE_TERMINATE WSMAN_SHELL_NS L"/signal/terminate"
     73 #define WSMAN_SIGNAL_SHELL_CODE_CTRL_C WSMAN_SHELL_NS L"/signal/ctrl_c"
     74 #define WSMAN_SIGNAL_SHELL_CODE_CTRL_BREAK WSMAN_SHELL_NS L"/signal/ctrl_break"
     75 
     76 #ifdef __cplusplus
     77 extern "C" {
     78 #endif
     79 
     80   typedef enum WSManDataType {
     81     WSMAN_DATA_NONE = 0,
     82     WSMAN_DATA_TYPE_TEXT = 1,
     83     WSMAN_DATA_TYPE_BINARY = 2,
     84     WSMAN_DATA_TYPE_DWORD = 4
     85   } WSManDataType;
     86 
     87   typedef enum WSManAuthenticationFlags {
     88     WSMAN_FLAG_DEFAULT_AUTHENTICATION = 0x0,
     89     WSMAN_FLAG_NO_AUTHENTICATION = 0x1,
     90     WSMAN_FLAG_AUTH_DIGEST = 0x2,
     91     WSMAN_FLAG_AUTH_NEGOTIATE = 0x4,
     92     WSMAN_FLAG_AUTH_BASIC = 0x8,
     93     WSMAN_FLAG_AUTH_KERBEROS = 0x10,
     94     WSMAN_FLAG_AUTH_CLIENT_CERTIFICATE = 0x20
     95 #if WINVER >= 0x600
     96     ,WSMAN_FLAG_AUTH_CREDSSP = 0x80
     97 #endif
     98   } WSManAuthenticationFlags;
     99 
    100   enum WSManProxyAccessType {
    101     WSMAN_OPTION_PROXY_IE_PROXY_CONFIG = 1,
    102     WSMAN_OPTION_PROXY_WINHTTP_PROXY_CONFIG = 2,
    103     WSMAN_OPTION_PROXY_AUTO_DETECT = 4,
    104     WSMAN_OPTION_PROXY_NO_PROXY_SERVER = 8,
    105   };
    106 
    107   typedef enum WSManSessionOption {
    108     WSMAN_OPTION_DEFAULT_OPERATION_TIMEOUTMS = 1,
    109     WSMAN_OPTION_MAX_RETRY_TIME = 11,
    110     WSMAN_OPTION_TIMEOUTMS_CREATE_SHELL = 12,
    111     WSMAN_OPTION_TIMEOUTMS_RUN_SHELL_COMMAND = 13,
    112     WSMAN_OPTION_TIMEOUTMS_RECEIVE_SHELL_OUTPUT = 14,
    113     WSMAN_OPTION_TIMEOUTMS_SEND_SHELL_INPUT = 15,
    114     WSMAN_OPTION_TIMEOUTMS_SIGNAL_SHELL = 16,
    115     WSMAN_OPTION_TIMEOUTMS_CLOSE_SHELL = 17,
    116     WSMAN_OPTION_SKIP_CA_CHECK = 18,
    117     WSMAN_OPTION_SKIP_CN_CHECK = 19,
    118     WSMAN_OPTION_UNENCRYPTED_MESSAGES = 20,
    119     WSMAN_OPTION_UTF16 = 21,
    120     WSMAN_OPTION_ENABLE_SPN_SERVER_PORT = 22,
    121     WSMAN_OPTION_MACHINE_ID = 23,
    122     WSMAN_OPTION_LOCALE = 25,
    123     WSMAN_OPTION_UI_LANGUAGE = 26,
    124     WSMAN_OPTION_MAX_ENVELOPE_SIZE_KB = 28,
    125     WSMAN_OPTION_SHELL_MAX_DATA_SIZE_PER_MESSAGE_KB = 29,
    126     WSMAN_OPTION_REDIRECT_LOCATION = 30,
    127     WSMAN_OPTION_SKIP_REVOCATION_CHECK = 31,
    128     WSMAN_OPTION_ALLOW_NEGOTIATE_IMPLICIT_CREDENTIALS = 32,
    129     WSMAN_OPTION_USE_SSL = 33,
    130     WSMAN_OPTION_USE_INTEARACTIVE_TOKEN = 34
    131   } WSManSessionOption;
    132 
    133   typedef enum WSManShellFlag {
    134     WSMAN_FLAG_NO_COMPRESSION = 0x1,
    135     WSMAN_FLAG_DELETE_SERVER_SESSION = 0x2,
    136     WSMAN_FLAG_SERVER_BUFFERING_MODE_DROP = 0x4,
    137     WSMAN_FLAG_SERVER_BUFFERING_MODE_BLOCK = 0x8,
    138     WSMAN_FLAG_RECEIVE_DELAY_OUTPUT_STREAM = 0x10
    139   } WSManShellFlag;
    140 
    141   typedef enum WSManCallbackFlags {
    142     WSMAN_FLAG_CALLBACK_END_OF_OPERATION = 0x1,
    143     WSMAN_FLAG_CALLBACK_END_OF_STREAM = 0x8,
    144     WSMAN_FLAG_CALLBACK_SHELL_SUPPORTS_DISCONNECT = 0x20,
    145     WSMAN_FLAG_CALLBACK_SHELL_AUTODISCONNECTED = 0x40,
    146     WSMAN_FLAG_CALLBACK_NETWORK_FAILURE_DETECTED = 0x100,
    147     WSMAN_FLAG_CALLBACK_RETRYING_AFTER_NETWORK_FAILURE = 0x200,
    148     WSMAN_FLAG_CALLBACK_RECONNECTED_AFTER_NETWORK_FAILURE = 0x400,
    149     WSMAN_FLAG_CALLBACK_SHELL_AUTODISCONNECTING = 0x800,
    150     WSMAN_FLAG_CALLBACK_RETRY_ABORTED_DUE_TO_INTERNAL_ERROR = 0x1000,
    151     WSMAN_FLAG_CALLBACK_RECEIVE_DELAY_STREAM_REQUEST_PROCESSED = 0x2000
    152   } WSManCallbackFlags;
    153 
    154   typedef struct _WSMAN_DATA_TEXT {
    155     DWORD bufferLength;
    156     PCWSTR buffer;
    157   } WSMAN_DATA_TEXT;
    158 
    159   typedef struct _WSMAN_DATA_BINARY {
    160     DWORD dataLength;
    161     BYTE *data;
    162   } WSMAN_DATA_BINARY;
    163 
    164   typedef struct _WSMAN_DATA {
    165     WSManDataType type;
    166     __C89_NAMELESS union {
    167       WSMAN_DATA_TEXT text;
    168       WSMAN_DATA_BINARY binaryData;
    169       DWORD number;
    170     };
    171   } WSMAN_DATA;
    172 
    173   typedef struct _WSMAN_ERROR {
    174     DWORD code;
    175     PCWSTR errorDetail;
    176     PCWSTR language;
    177     PCWSTR machineName;
    178     PCWSTR pluginName;
    179   } WSMAN_ERROR;
    180 
    181   typedef struct _WSMAN_USERNAME_PASSWORD_CREDS {
    182     PCWSTR username;
    183     PCWSTR password;
    184   } WSMAN_USERNAME_PASSWORD_CREDS;
    185 
    186   typedef struct _WSMAN_AUTHENTICATION_CREDENTIALS {
    187     DWORD authenticationMechanism;
    188     __C89_NAMELESS union {
    189       WSMAN_USERNAME_PASSWORD_CREDS userAccount;
    190       PCWSTR certificateThumbprint;
    191     };
    192   } WSMAN_AUTHENTICATION_CREDENTIALS;
    193 
    194   typedef struct _WSMAN_OPTION {
    195     PCWSTR name;
    196     PCWSTR value;
    197     WINBOOL mustComply;
    198   } WSMAN_OPTION;
    199 
    200   typedef struct _WSMAN_OPTION_SET {
    201     DWORD optionsCount;
    202     WSMAN_OPTION *options;
    203     WINBOOL optionsMustUnderstand;
    204   } WSMAN_OPTION_SET;
    205 
    206   typedef struct _WSMAN_OPTION_SETEX {
    207     DWORD optionsCount;
    208     WSMAN_OPTION *options;
    209     WINBOOL optionsMustUnderstand;
    210     PCWSTR *optionTypes;
    211   } WSMAN_OPTION_SETEX;
    212 
    213   typedef struct _WSMAN_KEY {
    214     PCWSTR key;
    215     PCWSTR value;
    216   } WSMAN_KEY;
    217 
    218   typedef struct _WSMAN_SELECTOR_SET {
    219     DWORD numberKeys;
    220     WSMAN_KEY *keys;
    221   } WSMAN_SELECTOR_SET;
    222 
    223   typedef struct _WSMAN_FRAGMENT {
    224     PCWSTR path;
    225     PCWSTR dialect;
    226   } WSMAN_FRAGMENT;
    227 
    228   typedef struct _WSMAN_FILTER {
    229     PCWSTR filter;
    230     PCWSTR dialect;
    231   } WSMAN_FILTER;
    232 
    233   typedef struct _WSMAN_OPERATION_INFO {
    234     WSMAN_FRAGMENT fragment;
    235     WSMAN_FILTER filter;
    236     WSMAN_SELECTOR_SET selectorSet;
    237     WSMAN_OPTION_SET optionSet;
    238     void *reserved;
    239     DWORD version;
    240   } WSMAN_OPERATION_INFO;
    241 
    242   typedef struct _WSMAN_OPERATION_INFOEX {
    243     WSMAN_FRAGMENT fragment;
    244     WSMAN_FILTER filter;
    245     WSMAN_SELECTOR_SET selectorSet;
    246     WSMAN_OPTION_SETEX optionSet;
    247     DWORD version;
    248     PCWSTR uiLocale;
    249     PCWSTR dataLocale;
    250   } WSMAN_OPERATION_INFOEX;
    251 
    252   typedef struct _WSMAN_PROXY_INFO {
    253     DWORD accessType;
    254     WSMAN_AUTHENTICATION_CREDENTIALS authenticationCredentials;
    255   } WSMAN_PROXY_INFO;
    256 
    257   typedef struct WSMAN_API *WSMAN_API_HANDLE;
    258   typedef struct WSMAN_SESSION *WSMAN_SESSION_HANDLE;
    259   typedef struct WSMAN_OPERATION *WSMAN_OPERATION_HANDLE;
    260   typedef struct WSMAN_SHELL *WSMAN_SHELL_HANDLE;
    261   typedef struct WSMAN_COMMAND *WSMAN_COMMAND_HANDLE;
    262 
    263   typedef struct _WSMAN_STREAM_ID_SET {
    264     DWORD streamIDsCount;
    265     PCWSTR *streamIDs;
    266   } WSMAN_STREAM_ID_SET;
    267 
    268   typedef struct _WSMAN_ENVIRONMENT_VARIABLE {
    269     PCWSTR name;
    270     PCWSTR value;
    271   } WSMAN_ENVIRONMENT_VARIABLE;
    272 
    273   typedef struct _WSMAN_ENVIRONMENT_VARIABLE_SET {
    274     DWORD varsCount;
    275     WSMAN_ENVIRONMENT_VARIABLE *vars;
    276   } WSMAN_ENVIRONMENT_VARIABLE_SET;
    277 
    278   typedef struct _WSMAN_SHELL_STARTUP_INFO_V10 {
    279     WSMAN_STREAM_ID_SET *inputStreamSet;
    280     WSMAN_STREAM_ID_SET *outputStreamSet;
    281     DWORD idleTimeoutMs;
    282     PCWSTR workingDirectory;
    283     WSMAN_ENVIRONMENT_VARIABLE_SET *variableSet;
    284   } WSMAN_SHELL_STARTUP_INFO_V10;
    285 
    286   typedef struct _WSMAN_SHELL_STARTUP_INFO_V11 {
    287     WSMAN_STREAM_ID_SET *inputStreamSet;
    288     WSMAN_STREAM_ID_SET *outputStreamSet;
    289     DWORD idleTimeoutMs;
    290     PCWSTR workingDirectory;
    291     WSMAN_ENVIRONMENT_VARIABLE_SET *variableSet;
    292     PCWSTR name;
    293   } WSMAN_SHELL_STARTUP_INFO_V11;
    294 
    295   typedef struct _WSMAN_SHELL_DISCONNECT_INFO {
    296     DWORD idleTimeoutMs;
    297   } WSMAN_SHELL_DISCONNECT_INFO;
    298 
    299   typedef struct _WSMAN_RECEIVE_DATA_RESULT {
    300     PCWSTR streamId;
    301     WSMAN_DATA streamData;
    302     PCWSTR commandState;
    303     DWORD exitCode;
    304   } WSMAN_RECEIVE_DATA_RESULT;
    305 
    306 #ifdef WSMAN_API_VERSION_1_0
    307   typedef WSMAN_SHELL_STARTUP_INFO_V10 WSMAN_SHELL_STARTUP_INFO;
    308   typedef void (CALLBACK *WSMAN_SHELL_COMPLETION_FUNCTION) (PVOID operationContext, DWORD flags, WSMAN_ERROR *error, WSMAN_SHELL_HANDLE shell, WSMAN_COMMAND_HANDLE command, WSMAN_OPERATION_HANDLE operationHandle, WSMAN_RECEIVE_DATA_RESULT *data);
    309 #else
    310   typedef WSMAN_SHELL_STARTUP_INFO_V11 WSMAN_SHELL_STARTUP_INFO;
    311   typedef void (CALLBACK *WSMAN_SHELL_COMPLETION_FUNCTION) (PVOID operationContext, DWORD flags, WSMAN_ERROR *error, WSMAN_SHELL_HANDLE shell, WSMAN_COMMAND_HANDLE command, WSMAN_OPERATION_HANDLE operationHandle, WSMAN_RESPONSE_DATA *data);
    312 
    313   typedef struct _WSMAN_CONNECT_DATA {
    314     WSMAN_DATA data;
    315   } WSMAN_CONNECT_DATA;
    316 
    317   typedef struct _WSMAN_CREATE_SHELL_DATA {
    318     WSMAN_DATA data;
    319   } WSMAN_CREATE_SHELL_DATA;
    320 
    321   typedef union _WSMAN_RESPONSE_DATA {
    322     WSMAN_RECEIVE_DATA_RESULT receiveData;
    323     WSMAN_CONNECT_DATA connectData;
    324     WSMAN_CREATE_SHELL_DATA createData;
    325   } WSMAN_RESPONSE_DATA;
    326 #endif
    327 
    328   typedef struct _WSMAN_SHELL_ASYNC {
    329     PVOID operationContext;
    330     WSMAN_SHELL_COMPLETION_FUNCTION completionFunction;
    331   } WSMAN_SHELL_ASYNC;
    332 
    333   typedef struct _WSMAN_COMMAND_ARG_SET {
    334     DWORD argsCount;
    335     PCWSTR *args;
    336   } WSMAN_COMMAND_ARG_SET;
    337 
    338   typedef struct _WSMAN_CERTIFICATE_DETAILS {
    339     PCWSTR subject;
    340     PCWSTR issuerName;
    341     PCWSTR issuerThumbprint;
    342     PCWSTR subjectName;
    343   } WSMAN_CERTIFICATE_DETAILS;
    344 
    345   typedef struct _WSMAN_SENDER_DETAILS {
    346     PCWSTR senderName;
    347     PCWSTR authenticationMechanism;
    348     WSMAN_CERTIFICATE_DETAILS *certificateDetails;
    349     HANDLE clientToken;
    350     PCWSTR httpURL;
    351   } WSMAN_SENDER_DETAILS;
    352 
    353   typedef struct _WSMAN_PLUGIN_REQUEST {
    354     WSMAN_SENDER_DETAILS *senderDetails;
    355     PCWSTR locale;
    356     PCWSTR resourceUri;
    357     WSMAN_OPERATION_INFO *operationInfo;
    358     volatile WINBOOL shutdownNotification;
    359     HANDLE shutdownNotificationHandle;
    360     PCWSTR dataLocale;
    361   } WSMAN_PLUGIN_REQUEST;
    362 
    363   typedef struct _WSMAN_AUTHZ_QUOTA {
    364     DWORD maxAllowedConcurrentShells;
    365     DWORD maxAllowedConcurrentOperations;
    366     DWORD timeslotSize;
    367     DWORD maxAllowedOperationsPerTimeslot;
    368   } WSMAN_AUTHZ_QUOTA;
    369 
    370   typedef VOID (WINAPI *WSMAN_PLUGIN_RELEASE_SHELL_CONTEXT) (PVOID shellContext);
    371   typedef VOID (WINAPI *WSMAN_PLUGIN_RELEASE_COMMAND_CONTEXT) (PVOID shellContext, PVOID commandContext);
    372   typedef DWORD (WINAPI *WSMAN_PLUGIN_STARTUP) (DWORD flags, PCWSTR applicationIdentification, PCWSTR extraInfo, PVOID *pluginContext);
    373   typedef DWORD (WINAPI *WSMAN_PLUGIN_SHUTDOWN) (PVOID pluginContext, DWORD flags, DWORD reason);
    374   typedef VOID (WINAPI *WSMAN_PLUGIN_SHELL) (PVOID pluginContext, WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, WSMAN_SHELL_STARTUP_INFO *startupInfo, WSMAN_DATA *inboundShellInformation);
    375   typedef VOID (WINAPI *WSMAN_PLUGIN_COMMAND) (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PVOID shellContext, PCWSTR commandLine, WSMAN_COMMAND_ARG_SET *arguments);
    376   typedef VOID (WINAPI *WSMAN_PLUGIN_SEND) (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PVOID shellContext, PVOID commandContext, PCWSTR stream, WSMAN_DATA *inboundData);
    377   typedef VOID (WINAPI *WSMAN_PLUGIN_RECEIVE) (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PVOID shellContext, PVOID commandContext, WSMAN_STREAM_ID_SET *streamSet);
    378   typedef VOID (WINAPI *WSMAN_PLUGIN_SIGNAL) (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PVOID shellContext, PVOID commandContext, PCWSTR code);
    379   typedef VOID (WINAPI *WSMAN_PLUGIN_CONNECT) (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PVOID shellContext, PVOID commandContext, WSMAN_DATA *inboundConnectInformation);
    380   typedef VOID (WINAPI *WSMAN_PLUGIN_AUTHORIZE_USER) (PVOID pluginContext, WSMAN_SENDER_DETAILS *senderDetails, DWORD flags);
    381   typedef VOID (WINAPI *WSMAN_PLUGIN_AUTHORIZE_OPERATION) (PVOID pluginContext, WSMAN_SENDER_DETAILS *senderDetails, DWORD flags, DWORD operation, PCWSTR action, PCWSTR resourceUri);
    382   typedef VOID (WINAPI *WSMAN_PLUGIN_AUTHORIZE_QUERY_QUOTA) (PVOID pluginContext, WSMAN_SENDER_DETAILS *senderDetails, DWORD flags);
    383   typedef VOID (WINAPI *WSMAN_PLUGIN_AUTHORIZE_RELEASE_CONTEXT) (PVOID userAuthorizationContext);
    384 
    385   DWORD WINAPI WSManInitialize (DWORD flags, WSMAN_API_HANDLE *apiHandle);
    386   DWORD WINAPI WSManDeinitialize (WSMAN_API_HANDLE apiHandle, DWORD flags);
    387   DWORD WINAPI WSManGetErrorMessage (WSMAN_API_HANDLE apiHandle, DWORD flags, PCWSTR languageCode, DWORD errorCode, DWORD messageLength, PWSTR message, DWORD *messageLengthUsed);
    388   DWORD WINAPI WSManCreateSession (WSMAN_API_HANDLE apiHandle, PCWSTR connection, DWORD flags, WSMAN_AUTHENTICATION_CREDENTIALS *serverAuthenticationCredentials, WSMAN_PROXY_INFO *proxyInfo, WSMAN_SESSION_HANDLE *session);
    389   DWORD WINAPI WSManCloseSession (WSMAN_SESSION_HANDLE session, DWORD flags);
    390   DWORD WINAPI WSManSetSessionOption (WSMAN_SESSION_HANDLE session, WSManSessionOption option, WSMAN_DATA *data);
    391   DWORD WINAPI WSManGetSessionOptionAsDword (WSMAN_SESSION_HANDLE session, WSManSessionOption option, DWORD *value);
    392   DWORD WINAPI WSManGetSessionOptionAsString (WSMAN_SESSION_HANDLE session, WSManSessionOption option, DWORD stringLength, PWSTR string, DWORD *stringLengthUsed);
    393   DWORD WINAPI WSManCloseOperation (WSMAN_OPERATION_HANDLE operationHandle, DWORD flags);
    394   void WINAPI WSManCreateShell (WSMAN_SESSION_HANDLE session, DWORD flags, PCWSTR resourceUri, WSMAN_SHELL_STARTUP_INFO *startupInfo, WSMAN_OPTION_SET *options, WSMAN_DATA *createXml, WSMAN_SHELL_ASYNC *async, WSMAN_SHELL_HANDLE *shell);
    395   void WINAPI WSManRunShellCommand (WSMAN_SHELL_HANDLE shell, DWORD flags, PCWSTR commandLine, WSMAN_COMMAND_ARG_SET *args, WSMAN_OPTION_SET *options, WSMAN_SHELL_ASYNC *async, WSMAN_COMMAND_HANDLE *command);
    396   void WINAPI WSManSignalShell (WSMAN_SHELL_HANDLE shell, WSMAN_COMMAND_HANDLE command, DWORD flags, PCWSTR code, WSMAN_SHELL_ASYNC *async, WSMAN_OPERATION_HANDLE *signalOperation);
    397   void WINAPI WSManReceiveShellOutput (WSMAN_SHELL_HANDLE shell, WSMAN_COMMAND_HANDLE command, DWORD flags, WSMAN_STREAM_ID_SET *desiredStreamSet, WSMAN_SHELL_ASYNC *async, WSMAN_OPERATION_HANDLE *receiveOperation);
    398   void WINAPI WSManSendShellInput (WSMAN_SHELL_HANDLE shell, WSMAN_COMMAND_HANDLE command, DWORD flags, PCWSTR streamId, WSMAN_DATA *streamData, WINBOOL endOfStream, WSMAN_SHELL_ASYNC *async, WSMAN_OPERATION_HANDLE *sendOperation);
    399   void WINAPI WSManCloseCommand (WSMAN_COMMAND_HANDLE commandHandle, DWORD flags, WSMAN_SHELL_ASYNC *async);
    400   void WINAPI WSManCloseShell (WSMAN_SHELL_HANDLE shellHandle, DWORD flags, WSMAN_SHELL_ASYNC *async);
    401   DWORD WINAPI WSManPluginReportContext (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PVOID context);
    402   DWORD WINAPI WSManPluginReceiveResult (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, PCWSTR stream, WSMAN_DATA *streamResult, PCWSTR commandState, DWORD exitCode);
    403   DWORD WINAPI WSManPluginOperationComplete (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, DWORD errorCode, PCWSTR extendedInformation);
    404   DWORD WINAPI WSManPluginGetOperationParameters (WSMAN_PLUGIN_REQUEST *requestDetails, DWORD flags, WSMAN_DATA *data);
    405   DWORD WINAPI WSManPluginGetConfiguration (PVOID pluginContext, DWORD flags, WSMAN_DATA *data);
    406   DWORD WINAPI WSManPluginReportCompletion (PVOID pluginContext, DWORD flags);
    407   DWORD WINAPI WSManPluginFreeRequestDetails (WSMAN_PLUGIN_REQUEST *requestDetails);
    408   DWORD WINAPI WSManPluginAuthzUserComplete (WSMAN_SENDER_DETAILS *senderDetails, DWORD flags, PVOID userAuthorizationContext, HANDLE impersonationToken, WINBOOL userIsAdministrator, DWORD errorCode, PCWSTR extendedErrorInformation);
    409   DWORD WINAPI WSManPluginAuthzOperationComplete (WSMAN_SENDER_DETAILS *senderDetails, DWORD flags, PVOID userAuthorizationContext, DWORD errorCode, PCWSTR extendedErrorInformation);
    410   DWORD WINAPI WSManPluginAuthzQueryQuotaComplete (WSMAN_SENDER_DETAILS *senderDetails, DWORD flags, WSMAN_AUTHZ_QUOTA *quota, DWORD errorCode, PCWSTR extendedErrorInformation);
    411 #ifdef WSMAN_API_VERSION_1_1
    412   void WINAPI WSManCreateShellEx (WSMAN_SESSION_HANDLE session, DWORD flags, PCWSTR resourceUri, PCWSTR shellId, WSMAN_SHELL_STARTUP_INFO *startupInfo, WSMAN_OPTION_SET *options, WSMAN_DATA *createXml, WSMAN_SHELL_ASYNC *async, WSMAN_SHELL_HANDLE *shell);
    413   void WINAPI WSManRunShellCommandEx (WSMAN_SHELL_HANDLE shell, DWORD flags, PCWSTR commandId, PCWSTR commandLine, WSMAN_COMMAND_ARG_SET *args, WSMAN_OPTION_SET *options, WSMAN_SHELL_ASYNC *async, WSMAN_COMMAND_HANDLE *command);
    414   void WINAPI WSManDisconnectShell (WSMAN_SHELL_HANDLE shell, DWORD flags, WSMAN_SHELL_DISCONNECT_INFO *disconnectInfo, WSMAN_SHELL_ASYNC *async);
    415   void WINAPI WSManReconnectShell (WSMAN_SHELL_HANDLE shell, DWORD flags, WSMAN_SHELL_ASYNC *async);
    416   void WINAPI WSManReconnectShellCommand (WSMAN_COMMAND_HANDLE commandHandle, DWORD flags, WSMAN_SHELL_ASYNC *async);
    417   void WINAPI WSManConnectShell (WSMAN_SESSION_HANDLE session, DWORD flags, PCWSTR resourceUri, PCWSTR shellID, WSMAN_OPTION_SET *options, WSMAN_DATA *connectXml, WSMAN_SHELL_ASYNC *async, WSMAN_SHELL_HANDLE *shell);
    418   void WINAPI WSManConnectShellCommand (WSMAN_SHELL_HANDLE shell, DWORD flags, PCWSTR commandID, WSMAN_OPTION_SET *options, WSMAN_DATA *connectXml, WSMAN_SHELL_ASYNC *async, WSMAN_COMMAND_HANDLE *command);
    419 #endif
    420 
    421 #ifdef __cplusplus
    422 }
    423 #endif
    424 
    425 #endif
    426 #endif
    427