Expand Minimize

MI_Application_Close function

Deinitializes the management infrastructure client API that was initialized through a call to MI_Application_Initialize.

Syntax


 MI_INLINE MI_Result MI_Application_Close(
  _Inout_  MI_Application *application
);

Parameters

application [in, out]

Application handle that was initialized through a call to MI_Application_Initialize.

Return value

Return codeDescription
MI_RESULT_OK

The operation succeeded.

MI_RESULT_SERVER_LIMITS_EXCEEDED

There is not enough memory to complete the request.

MI_RESULT_INVALID_PARAMETER

The target application pointer was not valid.

MI_RESULT_FAILED

A failure not covered by other MI_Result error codes.

 

Remarks

MI_Application_Close will unload the entire protocol handling infrastructure and background threads associated with the infrastructure.

MI_Application_Close cancels all active sessions and operations. Sessions created under the target application and those sessions' operations must close before this function will return. Once the API does so, Mi.dll can be unloaded and any caches held within the MI infrastructure are flushed.

MI_Application_Close must not be called from within an asynchronous callback, otherwise it will cause deadlocks.

To avoid a system hang when calling this function, reference count MI_Application and call the MI_Application_Close function only when the AppDomain is shutting down and after all sessions have been closed.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Redistributable

Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2

Header

Mi.h

 

 

Show:
© 2014 Microsoft