Skip to content

Latest commit

 

History

History
95 lines (74 loc) · 3.65 KB

nf-winbase-activateactctx.md

File metadata and controls

95 lines (74 loc) · 3.65 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winbase.ActivateActCtx
ActivateActCtx function (winbase.h)
The ActivateActCtx function activates the specified activation context.
ActivateActCtx
ActivateActCtx function [Side-by-side Assemblies]
_win32_activateactctx
setup.activateactctx
winbase/ActivateActCtx
setup\activateactctx.htm
setup
03381d95-1b5d-4b70-8c86-937ab9b2672d
12/05/2018
ActivateActCtx, ActivateActCtx function [Side-by-side Assemblies], _win32_activateactctx, setup.activateactctx, winbase/ActivateActCtx
winbase.h
Windows.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
Kernel32.lib
Kernel32.dll
Windows
19H1
ActivateActCtx
winbase/ActivateActCtx
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-sidebyside-l1-1-0.dll
KernelBase.dll
ActivateActCtx

ActivateActCtx function

-description

The ActivateActCtx function activates the specified activation context. It does this by pushing the specified activation context to the top of the activation stack. The specified activation context is thus associated with the current thread and any appropriate side-by-side API functions.

-parameters

-param hActCtx [in]

Handle to an ACTCTX structure that contains information on the activation context that is to be made active.

-param lpCookie [out]

Pointer to a ULONG_PTR that functions as a cookie, uniquely identifying a specific, activated activation context.

-returns

If the function succeeds, it returns TRUE. Otherwise, it returns FALSE.

This function sets errors that can be retrieved by calling GetLastError. For an example, see Retrieving the Last-Error Code. For a complete list of error codes, see System Error Codes.

-remarks

The lpCookie parameter is later passed to DeactivateActCtx, which verifies the pairing of calls to ActivateActCtx and DeactivateActCtx and ensures that the appropriate activation context is being deactivated. This is done because the deactivation of activation contexts must occur in the reverse order of activation.

The activation of activation contexts can be understood as pushing an activation context onto a stack of activation contexts. The activation context you activate through this function redirects any binding to DLLs, window classes, COM servers, type libraries, and mutexes for any side-by-side APIs you call.

The top item of an activation context stack is the active, default-activation context of the current thread. If a null activation context handle is pushed onto the stack, thereby activating it, the default settings in the original manifest override all activation contexts that are lower on the stack.

-see-also

ACTCTX

DeactivateActCtx