Expand Minimize

MI_Context_RefuseUnload function

Tells the provider infrastructure not to unload the provider.

Syntax


 MI_INLINE MI_Result MI_Context_RefuseUnload(
  _In_  MI_Context *context
);

Parameters

context [in]

The request context.

Return value

A value of the MI_Result enumeration that specifies the function return code. This can be one of the following codes.

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

One or more parameters passed to the function were not valid.

MI_RESULT_FAILED

A failure not covered by other MI_Result error codes.

 

Remarks

This function stops the WMI server from shutting down the provider. The provider needs to call the MI_Context_RequestUnload function to allow the provider to be unloaded, and that function must use the same context that was used with the MI_Context_RefuseUnload function.

Some providers may use this mechanism to cache expensive data; however, holding a provider open a provider that is rarely touched becomes a performance issue in the long term. A provider that wants to maintain control of the lifetime of its provider should use a decoupled provider. If the provider wants to hold it open for a couple of minutes to maintain caches more efficiently, and if no new requests are received within that time, it should then request unload to shut down the provider and potentially host.

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

See also

MI_Context
MI_Context_RequestUnload

 

 

Show:
© 2014 Microsoft