MI_Session_Close function (mi.h)
Closes a session and releases all associated memory.
Syntax
MI_INLINE MI_Result MI_Session_Close(
[in, out] MI_Session *session,
[in, optional] void *completionContext,
[in, out] void(* )(void *completionContext) completionCallback
);
Parameters
[in, out] session
Session handle returned from MI_Application_NewSession.
[in, optional] completionContext
Optional parameter to be returned through the completionCallback callback.
[in, out] completionCallback
Optional callback to make the session close asynchronous. (If this value is NULL, then the close call is synchronous.) If the MI_Session_Close is called from a callback the completion callback must be specified. Not doing so can result in a deadlock.
completionContext
Return value
A value of the MI_Result enumeration that specifies the function return code. This can be one of the following codes.
Remarks
Closing a session will cause all operations that are currently running to be canceled. Canceling operations will cause asynchronous operation callbacks to be called (with the final result of an MI_Operation_Get* function call's moreResults parameter equal to MI_FALSE, although more than one result may be delivered before this happens). Not closing all operation handles that were created with the current session will cause the closing of the session to stop responding for synchronous calls and the asynchronous callback will not be called. Operation and session handles not fully closed will cause the application handle to stop responding during shutdown.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 |
Minimum supported server | Windows Server 2012 |
Target Platform | Windows |
Header | mi.h |
Redistributable | Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2 |