MI_Application_Close function (mi.h)

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


MI_INLINE MI_Result MI_Application_Close(
  [in, out] MI_Application *application


[in, out] application

Application handle that was initialized through a call to MI_Application_Initialize.

Return value

This function returns MI_INLINE MI_Result.


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.


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