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 | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NS:winnt._ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION |
ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION (winnt.h) |
The ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION structure is used by the QueryActCtxW function. |
|
setup\activation_context_compatibility_information.htm |
setup |
d8c1ef4a-8e64-45bd-a185-b4af7932a0d2 |
12/05/2018 |
*PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION structure [Setup API], PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION structure pointer [Setup API], _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, setup.activation_context_compatibility_information, winnt/ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, winnt/PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION |
winnt.h |
Windows.h |
Windows |
Windows 7 [desktop apps only] |
Windows Server 2008 R2 [desktop apps only] |
Windows |
ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION, *PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION |
19H1 |
|
|
|
|
|
|
The ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION structure is used by the QueryActCtxW function.
The number of compatibility elements defined in the application manifest.
This is an array of COMPATIBILITY_CONTEXT_ELEMENT structures. Each structure describes one compatibility element in the application manifest.
The following example requires Windows Server 2008 R2 or Windows 7 and shows the method to retrieve information about the compatibility context.
HANDLE ActCtxHandle=INVALID_HANDLE_VALUE;
SIZE_T BytesWritten=0;
PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION CtxCompatInfo=NULL;
// Query the compatibility information size
bReturn = QueryActCtxW(0,
ActCtxHandle,
NULL,
CompatibilityInformationInActivationContext,
NULL,
0,
&BytesWritten);
if (bReturn == FALSE && GetLastError() !=ERROR_INSUFFICIENT_BUFFER)
{
goto EXIT;
}
CtxCompatInfo =
(PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, BytesWritten);
if (CtxCompatInfo==NULL)
{
// Out of memory
goto EXIT;
}
// Query the compatibility information
bReturn = QueryActCtxW(0,
ActCtxHandle,
NULL,
CompatibilityInformationInActivationContext,
CtxCompatInfo,
BytesWritten,
&BytesWritten);
if (bReturn==FALSE)
{
// Unexpected error: use GetLastError() to check
goto EXIT;
}
for (DWORD ElementIndex=0; ElementIndex < CtxCompatInfo->ElementCount; ElementIndex ++)
{
PCOMPATIBILITY_CONTEXT_ELEMENT ContextElement = &CtxCompatInfo->Elements[ElementIndex];
if (ContextElement->Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS)
{
if (memcmp(&ContextElement->Id, &WIN7_CONTEXT_GUID, sizeof (GUID))==0)
{printf_s("Windows 7 is supported");}
}
}
EXIT:
if (ActCtxHandle != INVALID_HANDLE_VALUE)
{
ReleaseActCtx (ActCtxHandle)
}
if (CtxCompatInfo != NULL)
{
RtlFreeHeap (RtlProcessHeap (), 0, CtxCompatInfo);
CtxCompatInfo = NULL;
}