ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION structure (winnt.h)

La structure ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION est utilisée par la fonction QueryActCtxW .

Syntaxe

typedef struct _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION {
  DWORD         ulFlags;
  DWORD         ulEncodedAssemblyIdentityLength;
  DWORD         ulManifestPathType;
  DWORD         ulManifestPathLength;
  LARGE_INTEGER liManifestLastWriteTime;
  DWORD         ulPolicyPathType;
  DWORD         ulPolicyPathLength;
  LARGE_INTEGER liPolicyLastWriteTime;
  DWORD         ulMetadataSatelliteRosterIndex;
  DWORD         ulManifestVersionMajor;
  DWORD         ulManifestVersionMinor;
  DWORD         ulPolicyVersionMajor;
  DWORD         ulPolicyVersionMinor;
  DWORD         ulAssemblyDirectoryNameLength;
  PCWSTR        lpAssemblyEncodedAssemblyIdentity;
  PCWSTR        lpAssemblyManifestPath;
  PCWSTR        lpAssemblyPolicyPath;
  PCWSTR        lpAssemblyDirectoryName;
  DWORD         ulFileCount;
} ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION, *PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;

Membres

ulFlags

Cette valeur est toujours 0.

ulEncodedAssemblyIdentityLength

Longueur de l’identité d’assembly encodée en octets.

ulManifestPathType

Cette valeur est toujours une constante.

ulManifestPathLength

Longueur du chemin du manifeste d’assembly en octets.

liManifestLastWriteTime

La dernière fois que le manifeste a été écrit. Il se présente sous la forme d’une structure de données FILETIME .

ulPolicyPathType

Cette valeur est toujours une constante.

ulPolicyPathLength

Longueur du chemin d’accès de la stratégie d’éditeur en octets.

liPolicyLastWriteTime

La dernière fois que la stratégie a été écrite. Il se présente sous la forme d’une structure de données FILETIME .

ulMetadataSatelliteRosterIndex

Index de liste satellite de métadonnées.

ulManifestVersionMajor

Version majeure de l’assembly interrogé par QueryActCtxW. Pour plus d’informations, consultez Versions d’assembly.

ulManifestVersionMinor

Version mineure de l’assembly interrogé par QueryActCtxW. Pour plus d’informations, consultez Versions d’assembly.

ulPolicyVersionMajor

Version principale d’une stratégie, le cas échéant.

ulPolicyVersionMinor

Version mineure d’une stratégie, le cas échéant.

ulAssemblyDirectoryNameLength

Longueur du nom du répertoire d’assembly en octets.

lpAssemblyEncodedAssemblyIdentity

Pointeur vers une chaîne terminée par null qui contient un format textuel de l’identité de l’assembly.

lpAssemblyManifestPath

Pointeur vers une chaîne terminée par null qui indique le chemin d’accès d’origine au manifeste de cet assembly.

lpAssemblyPolicyPath

Pointeur vers une chaîne terminée par null qui indique le chemin d’accès de l’assembly de stratégie utilisé pour déterminer que cette version de l’assembly doit être chargée. Si ce membre a la valeur Null, aucune stratégie n’a été utilisée pour décider de charger cette version.

lpAssemblyDirectoryName

Pointeur vers une chaîne terminée par null qui indique le dossier à partir duquel cet assembly a été chargé.

ulFileCount

Remarques

Si QueryActCtxW est appelé avec l’option AssemblyDetailedInformationInActivationContext et que la fonction réussit, les informations de la mémoire tampon retournée sont sous la forme de la structure ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION .

PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION pAssemblyInfo = NULL;
ACTIVATION_CONTEXT_QUERY_INDEX QueryIndex;
BOOL fSuccess = FALSE;
SIZE_T cbRequired;
HANDLE hActCtx = INVALID_HANDLE_VALUE;
BYTE bTemporaryBuffer[512];
PVOID pvDataBuffer = (PVOID)bTemporaryBuffer;
SIZE_T cbAvailable = sizeof(bTemporaryBuffer);

// Request the first file in the root assembly
QueryIndex.ulAssemblyIndex = 1;
QueryIndex.ulFileIndexInAssembly = 0;

if (GetCurrentActCtx(&hActCtx)) {

    // Attempt to use our stack-based buffer first - if that's not large
    // enough, allocate from the heap and try again.
    fSuccess = QueryActCtxW(
        0, 
        hActCtx, 
        (PVOID)&QueryIndex, 
        AssemblyDetailedInformationInActivationContext,
        pvDataBuffer,
        cbAvailable,
        &cbRequired);

    // Failed, because the buffer was too small.
    if (!fSuccess && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {

        // Allocate what we need from the heap - fail if there isn't enough
        // memory to do so.        
        pvDataBuffer = HeapAlloc(GetProcessHeap(), 0, cbRequired);
        if (pvDataBuffer == NULL) {
            fSuccess = FALSE;
            goto DoneQuerying;
        }
        cbAvailable = cbRequired;

        // If this fails again, exit out.
        fSuccess = QueryActCtxW(
            0, 
            hActCtx,
            (PVOID)&QueryIndex,
            AssemblyDetailedInformationInActivationContext,
            pvDataBuffer,
            cbAvailable,
            &cbRequired);

    }

    if (fSuccess) {
        // Now that we've found the assembly info, cast our target buffer back to
        // the assembly info pointer.  Use pAssemblyInfo->lpFileName
        pAssemblyInfo = (PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION)pvDataBuffer;
    }
}

DoneQuerying:
    if (hActCtx != INVALID_HANDLE_VALUE)
        ReleaseActCtx(hActCtx);

    if (pvDataBuffer && (pvDataBuffer != bTemporaryBuffer)) {
        HeapFree(GetProcessHeap(), 0, pvDataBuffer);
        pvDataBuffer = 0;
    }

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows XP [applications de bureau uniquement]
Serveur minimal pris en charge Windows Server 2003 [applications de bureau uniquement]
En-tête winnt.h (inclure Windows.h)