Expand Minimize

CoDecrementMTAUsage function

Releases the increment made by a previous call to the CoIncrementMTAUsage function.

Syntax


HRESULT WINAPI CoDecrementMTAUsage(
  _In_  CO_MTA_USAGE_COOKIE Cookie
);

Parameters

Cookie [in]

A PVOID variable that was set by a previous call to the CoIncrementMTAUsage function.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Cookie must be a valid value returned by a successful previous call to the CoIncrementMTAUsage function. If the overall count of MTA usage reaches 0, including both through this API and through the CoInitializeEx and CoUninitialize functions, the system frees resources related to MTA support.

You can call CoIncrementMTAUsage from one thread and CoDecrementMTAUsage from another as long as a cookie previously returned by CoIncrementMTAUsage is passed to CoDecrementMTAUsage.

Don't call CoDecrementMTAUsage during process shutdown or inside dllmain. You can call CoDecrementMTAUsage before the call to start the shutdown process.

Requirements

Header

Combaseapi.h

See also

CoIncrementMTAUsage

 

 

Community Additions

ADD
Show:
© 2014 Microsoft