DOC: Τεκμηρίωση δεν καθολικής συγκρότησης (GAC) στο χώρο προσωρινής αποθήκευσης τα API είναι με το .NET Framework Software Development Kit (SDK) τεκμηρίωσης

Μεταφράσεις άρθρων Μεταφράσεις άρθρων
Αναγν. άρθρου: 317540
Ανάπτυξη όλων | Σύμπτυξη όλων

Σε αυτήν τη σελίδα

Περίληψη

Το τοπικό κώδικα διασυνδέσεις προγραμματισμού εφαρμογών (API) που σας επιτρέπουν να αλληλεπιδράτε με τα στο χώρο προσωρινής αποθήκευσης καθολικής συγκρότησης (GAC) δεν τεκμηριώνονται στην τεκμηρίωση του .NET Framework κιτ ανάπτυξης λογισμικού (SDK).

Περισσότερες πληροφορίες

Προσοχή: Μην χρησιμοποιείτε αυτά τα API της εφαρμογής σας για να πραγματοποιήσετε συνδέσεις συγκρότησης ή για να ελέγξετε για την ύπαρξη συγκροτήσεων ή άλλες χρόνο εκτέλεσης, ανάπτυξης ή λειτουργίες κατά το χρόνο σχεδίασης. Μόνο τα διαχειριστικά εργαλεία και προγράμματα εγκατάστασης, πρέπει να χρησιμοποιήσετε αυτά τα API. Εάν χρησιμοποιείτε το GAC, αυτό απευθείας εκθέτει την εφαρμογή σας σε fragility σύνδεσης συγκρότησης ή μπορεί να προκαλέσει την εφαρμογή σας να λειτουργεί σωστά σε μελλοντικές εκδόσεις του .NET Framework.

Το GAC αποθηκεύει συγκροτήσεις που χρησιμοποιούνται από κοινού μεταξύ όλων των εφαρμογών σε έναν υπολογιστή. Η θέση αποθήκευσης πραγματικά και τη δομή του GAC δεν τεκμηριώνεται και μπορεί να αλλάξει σε μελλοντικές εκδόσεις του .NET Framework και το λειτουργικό σύστημα των Microsoft Windows.

Είναι η μόνη υποστηριζόμενη μέθοδος για συγκροτήσεις πρόσβαση στο GAC μέσω του API που αναφέρονται σε αυτό το άρθρο.

Οι περισσότερες εφαρμογές δεν χρειάζεται να χρησιμοποιήσετε αυτά τα API, επειδή η συγκρότηση σύνδεσης εκτελείται αυτόματα κατά το χρόνο εκτέλεσης κοινής γλώσσας. Μόνο προσαρμοσμένη εγκατάσταση προγράμματα ή εργαλεία διαχείρισης, πρέπει να χρησιμοποιήσετε αυτά τα API. Microsoft Windows Installer έχει γνήσια υποστήριξη για την εγκατάσταση του συγκροτήσεις GAC.

Για περισσότερες πληροφορίες σχετικά με συγκροτήσεις GAC, δείτε το .NET Framework SDK.

Χρήση του API GAC στα ακόλουθα σενάρια:
  • Όταν εγκαθιστάτε μια συγκρότηση στο GAC.
  • Κατά την κατάργηση μιας συγκρότησης από το GAC.
  • Όταν εξάγετε μια συγκρότηση από το GAC.
  • Κατά την απαρίθμηση συγκροτήσεις που διατίθενται στο GAC.
ΣΗΜΕΙΩΣΗ:CoInitialize(Ex)πρέπει να κληθεί πριν να χρησιμοποιήσετε οποιαδήποτε από τις συναρτήσεις και διασυνδέσεις που περιγράφονται σε αυτήν την προδιαγραφή.

Διασύνδεση IAssemblyCache

Για ναIAssemblyCacheη διασύνδεση είναι η διασύνδεση ανώτατου επιπέδου που παρέχει πρόσβαση στο GAC.

Για να αποκτήσετε μια παρουσία τουCreateAssemblyCacheAPI, η κλήση τηςCreateAssemblyCacheAPI, as follows:
STDAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved); 
The parameters are defined as follows:
  • ppAsmCache - Pointer to returnIAssemblyCache
  • dwReserved

FUSION_INSTALL_REFERENCE Structure

Για ναFUSION_INSTALL_REFERENCEstructure represents a reference that is made when an application has installed an assembly in the GAC.
    typedef struct _FUSION_INSTALL_REFERENCE_
    {
        DWORD  cbSize;
        DWORD  dwFlags;
        GUID   guidScheme;     // Contains one of the pre-defined GUIDs.
        LPCWSTR szIdentifier;  // Unique identifier for the application that installs this  assembly.
        LPCWSTR szNonCannonicalData;  // Data is description; relevant to the GUID above. 
    } FUSION_INSTALL_REFERENCE, *LPFUSION_INSTALL_REFERENCE;
				
The fields of the structure are defined as follows:
  • cbSize- The size of the structure in bytes.
  • dwFlags- Reserved, must be zero.
  • guidScheme- The entity that adds the reference.
  • szIdentifier- A unique string that identifies the application that installed the assembly.
  • szNonCannonicalData- A string that is only understood by the entity that adds the reference. The GAC only stores this string.
Possible values for theguidSchemefield can be one of the following:
  • FUSION_REFCOUNT_MSI_GUID- The assembly is referenced by an application that has been installed by using Windows Installer. Για ναszIdentifierτο πεδίο έχει οριστεί σεMSIANDszNonCannonicalDataέχει οριστεί σεWindows Installer. This scheme must only be used by Windows Installer itself.
  • FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID- The assembly is referenced by an application that appears inΠροσθαφαίρεση προγραμμάτων. Για ναszIdentifierfield is the token that is used to register the application withAdd/Remove programs.
  • FUSION_REFCOUNT_FILEPATH_GUID- The assembly is referenced by an application that is represented by a file in the file system. Για ναszIdentifierfield is the path to this file.
  • FUSION_REFCOUNT_OPAQUE_STRING_GUID- The assembly is referenced by an application that is only represented by an opaque string. Για ναszIdentifieris this opaque string. The GAC does not perform existence checking for opaque references when you remove this.

ASSEMBLY_INFO Structure

Για ναASSEMBLY_INFOstructure represents information about an assembly in the assembly cache.

The fields of the structure are defined as follows:
  • cbAssemblyInfo- Size of the structure in bytes. Permits additions to the structure in future version of the .NET Framework.
  • dwAssemblyFlags- Indicates one or more of theASSEMBLYINFO_FLAG_*bits.
  • uliAssemblySizeInKB- The size of the files that make up the assembly in kilobytes (KB).
  • pszCurrentAssemblyPathBuf- A pointer to a string buffer that holds the current path of the directory that contains the files that make up the assembly. The path must end with a zero.
  • cchBuf- Size of the buffer that thepszCurrentAssemblyPathBugfield points to.
dwAssemblyFlagscan have one of the following values:
  • ASSEMBLYINFO_FLAG__INSTALLED- Indicates that the assembly is actually installed. Always set in current version of the .NET Framework.
  • ASSEMBLYINFO_FLAG__PAYLOADRESIDENT- Never set in the current version of the .NET Framework.

IAssemblyCache::UninstallAssembly Method

Για ναIAssemblyCache::UninstallAssemblymethod removes a reference to an assembly from the GAC. If other applications hold no other references to the assembly, the files that make up the assembly are removed from the GAC.
    HRESULT UninstallAssembly(
        [in] DWORD dwFlags,
        [in] LPCWSTR pszAssemblyName, 
        [in] LPCFUSION_INSTALL_REFERENCE pRefData, 
        [out, optional] ULONG *pulDisposition
        );

				
The parameters are defined as follows:
  • dwFlags- No flags defined. Must be zero.
  • pszAssemblyName- The name of the assembly. A zero-ended Unicode string.
  • pRefData- A pointer to aFUSION_INSTALL_REFERENCEδομή. Although this is not recommended, this parameter can be null. The assembly is installed without an application reference, or all existing application references are gone.
  • pulDisposition- Pointer to an integer that indicates the action that is performed by the function.
ΣΗΜΕΙΩΣΗ: ΕάνpulDispositionis not null,pulDispositioncontains one of the following values:
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED- The assembly files have been removed from the GAC.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_STILL_IN_USE- An application is using the assembly. This value is returned on Microsoft Windows 95 and Microsoft Windows 98.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED- The assembly does not exist in the GAC.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_DELETE_PENDING- Not used.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_HAS_INSTALL_REFERENCES- The assembly has not been removed from the GAC because another application reference exists.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_REFERENCE_NOT_FOUND- The reference that is specified inpRefDatais not found in the GAC.
The return values are defined as follows:
  • S_OK- The assembly has been uninstalled.
  • S_FALSE- The operation succeeded, but the assembly was not removed from the GAC. The reason is described inpulDisposition.

IAssemblyCache::QueryAssemblyInfo Method

Για ναIAssemblyCache::QueryAssemblyInfomethod retrieves information about an assembly from the GAC.
    HRESULT QueryAssemblyInfo(
        [in] DWORD dwFlags,
        [in] LPCWSTR pszAssemblyName,
        [in, out] ASSEMBLY_INFO *pAsmInfo
        );
				
The parameters are defined as follows:
  • dwFlags- One ofQUERYASMINFO_FLAG_VALIDATEήQUERYASMINFO_FLAG_GETSIZE:
    • *_VALIDATE- Performs validation of the files in the GAC against the assembly manifest, including hash verification and strong name signature verification.
    • *_GETSIZE- Returns the size of all files in the assembly (disk footprint). If this is not specified, theASSEMBLY_INFO::uliAssemblySizeInKBfield is not modified.
  • pszAssemblyName- Name of the assembly that is queried.
  • pAsmInfo- Pointer to the returnedASSEMBLY_INFOδομή.

IAssemblyCache::InstallAssembly Method

Για ναIAssemblyCache::InstallAssemblymethod adds a new assembly to the GAC. The assembly must be persisted in the file system and is copied to the GAC.
    HRESULT InstallAssembly( // If you use this, fusion will do the streaming & commit.
        [in] DWORD dwFlags,
        [in] LPCWSTR pszManifestFilePath, 
        [in] LPCFUSION_INSTALL_REFERENCE pRefData
        );
				
The parameters are defined as follows:
  • dwFlags- At most, one of the bits of theIASSEMBLYCACHE_INSTALL_FLAG_*μπορούν να καθοριστούν τιμές:
    • * _REFRESH-Εάν έχει ήδη εγκατασταθεί στη συγκρότηση στο GAC και το αρχείο τους αριθμούς έκδοσης της συγκρότησης που εγκαθίσταται είναι το ίδιο ή νεότερη έκδοση, τα αρχεία αντικαθίστανται.
    • * _FORCE_REFRESH-Τα αρχεία από μια υπάρχουσα συγκρότηση αντικαθίστανται ανεξάρτητα από τον αριθμό έκδοσης.
  • pszManifestFilePath-Μια συμβολοσειρά που δείχνουν προς τη βιβλιοθήκη συνδέεται δυναμικών (DLL) που περιέχει διακήρυξη συγκρότησης. Άλλα αρχεία συγκρότηση πρέπει να βρίσκονται στον ίδιο κατάλογο με το αρχείο DLL που περιέχει διακήρυξη συγκρότησης.
  • pRefData-Ένας δείκτης προς έναFUSION_INSTALL_REFERENCEπου υποδεικνύει την εφαρμογή εκ μέρους του οποίου γίνεται εγκατάσταση της συγκρότησης. Αν και δεν συνιστάται, αυτή η παράμετρος μπορεί να είναι null, αλλά αυτό αφήνει τη συγκρότηση χωρίς οποιαδήποτε αναφορά εφαρμογών.

Διασύνδεση IAssemblyName

Για ναIAssemblyNameδιασύνδεση αντιπροσωπεύει το όνομα συγκρότησης. Όνομα συγκρότησης περιλαμβάνει ένα προκαθορισμένο σύνολο ζεύγη ονόματος-τιμής. Το όνομα συγκρότησης περιγράφεται λεπτομερώς στο .NET Framework SDK.
[
        local,
        object,
        uuid(CD193BC0-B4BC-11d2-9833-00C04FC31D2E),
        pointer_default(unique)
]
interface IAssemblyName: IUnknown
				
Μια παρουσία τουIAssemblyNameis obtained by calling theCreateAssemblyNameObject API:
STDAPI CreateAssemblyNameObject(LPASSEMBLYNAME *ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved);
The parameters are defined as follows:
  • ppAssemblyNameObj- Pointer to a memory location that receives theIAssemblyNamepointer that is created.
  • szAssemblyName- A string representation of the assembly name or of a full assembly reference that is determined bydwFlags. The string representation can be null.
  • dwFlags- Zero or more of the bits that are defined in theCREATE_ASM_NAME_OBJ_FLAGSη απαρίθμηση.
  • pvReserved- Must be null.

CREATE_ASM_NAME_OBJ_FLAGS Enumeration

Για ναCREATE_ASM_NAME_OBJ_FLAGSenumeration contains the following values:
  • CANOF_PARSE_DISPLAY_NAME- If this flag is specified, theszAssemblyNameparameter is a full assembly name and is parsed to the individual properties. If the flag is not specified,szAssemblyNameis the "Name" portion of the assembly name.
  • CANOF_SET_DEFAULT_VALUES- If this flag is specified, certain properties, such as processor architecture, are set to their default values.
    typedef enum {
         CANOF_PARSE_DISPLAY_NAME = 0x1,
         CANOF_SET_DEFAULT_VALUES = 0x2
    } CREATE_ASM_NAME_OBJ_FLAGS;
				

ASM_NAME Enumeration

Για ναASM_NAMEenumeration property ID describes the valid names of the name-value pairs in an assembly name. See the .NET Framework SDK for a description of these properties.
    typedef enum
    {
        ASM_NAME_PUBLIC_KEY = 0,
        ASM_NAME_PUBLIC_KEY_TOKEN,
        ASM_NAME_HASH_VALUE,
        ASM_NAME_NAME,
        ASM_NAME_MAJOR_VERSION,
        ASM_NAME_MINOR_VERSION,
        ASM_NAME_BUILD_NUMBER,
        ASM_NAME_REVISION_NUMBER,
        ASM_NAME_CULTURE,
        ASM_NAME_PROCESSOR_ID_ARRAY,
        ASM_NAME_OSINFO_ARRAY,
        ASM_NAME_HASH_ALGID,
        ASM_NAME_ALIAS,
        ASM_NAME_CODEBASE_URL,
        ASM_NAME_CODEBASE_LASTMOD,
        ASM_NAME_NULL_PUBLIC_KEY,
        ASM_NAME_NULL_PUBLIC_KEY_TOKEN,
        ASM_NAME_CUSTOM,
        ASM_NAME_NULL_CUSTOM,                
        ASM_NAME_MVID,
        ASM_NAME_MAX_PARAMS
    } ASM_NAME;
				

IAssemblyName::SetProperty Method

Για ναIAssemblyName::SetPropertymethod adds a name-value pair to the assembly name, or, if a name-value pair with the same name already exists, modifies or deletes the value of a name-value pair.
    HRESULT SetProperty(
        [in]    DWORD  PropertyId, 
        [in]    LPVOID pvProperty,
        [in]    DWORD  cbProperty);
				
The parameters are defined as follows:
  • PropertyId- The ID that represents the name part of the name-value pair that is to be added or to be modified. Valid property IDs are defined in theASM_NAMEη απαρίθμηση.
  • pvProperty- A pointer to a buffer that contains the value of the property.
  • cbProperty- The length of thepvPropertybuffer in bytes. Εάν,cbPropertyis zero, the name-value pair is removed from the assembly name.

IAssemblyName::GetProperty Method

Για ναIAssemblyName::GetPropertymethod retrieves the value of a name-value pair in the assembly name that specifies the name.
    HRESULT GetProperty(
        [in]         DWORD    PropertyId, 
        [out]        LPVOID   pvProperty,
        [in, out]    LPDWORD  pcbProperty);
				
The parameters are defined as follows:
  • PropertyId- The ID that represents the name of the name-value pair whose value is to be retrieved. Specified property IDs are defined in theASM_NAMEη απαρίθμηση.
  • pvProperty- A pointer to a buffer that is to contain the value of the property.
  • cbProperty- The length of thepvPropertybuffer, in bytes.

IAssemblyName::Finalize Method

Για ναIAssemblyName::Finalizemethod freezes an assembly name. Additional calls toIAssemblyName::SetPropertyare unsuccessful after this method has been called.
HRESULT Finalize();

IAssemblyName::GetDisplayName Method

Για ναIAssemblyName::GetDisplayNamemethod returns a string representation of the assembly name.
    HRESULT  GetDisplayName(
        [out]       LPOLESTR  szDisplayName,
        [in, out]   LPDWORD   pccDisplayName,
        [in]        DWORD     dwDisplayFlags);
				
The parameters are defined as follows:
  • szDisplayName- A pointer to a buffer that is to contain the display name. The display name is returned in Unicode.
  • pccDisplayName- The size of the buffer in characters (on input). The length of the returned display name (on return).
  • dwDisplayFlags- One or more of the bits defined in theASM_DISPLAY_FLAGSenumeration:
    • *_VERSION- Includes the version number as part of the display name.
    • *_CULTURE- Includes the culture.
    • *_PUBLIC_KEY_TOKEN- Includes the public key token.
    • *_PUBLIC_KEY- Includes the public key.
    • *_CUSTOM- Includes the custom part of the assembly name.
    • *_PROCESSORARCHITECTURE- Includes the processor architecture.
    • *_LANGUAGEID- Includes the language ID.
    typedef enum
    {
        ASM_DISPLAYF_VERSION    = 0x1,
        ASM_DISPLAYF_CULTURE    = 0x2,
        ASM_DISPLAYF_PUBLIC_KEY_TOKEN = 0x4,
        ASM_DISPLAYF_PUBLIC_KEY = 0x8,
        ASM_DISPLAYF_CUSTOM     = 0x10,
        ASM_DISPLAYF_PROCESSORARCHITECTURE = 0x20,
        ASM_DISPLAYF_LANGUAGEID     = 0x40

    } ASM_DISPLAY_FLAGS;
				

IAssemblyName::GetName Method

Για ναIAssemblyName::GetNamemethod returns the name part of the assembly name.
    HRESULT GetName(
        [in, out] LPDWORD lpcwBuffer,
        [out] WCHAR *pwzName);
				
The parameters are defined as follows:
  • lpcwBuffer- Size of thepwszNamebuffer (on input). Length of the name (on return).
  • pwszName- Pointer to the buffer that is to contain the name part of the assembly name.

IAssemblyName::GetVersion Method

Για ναIAssemblyName::GetVersionmethod returns the version part of the assembly name.
HRESULT GetVersion(
        [out] LPDWORD pdwVersionHi,
        [out] LPDWORD pdwVersionLow);
				
The parameters are defined as follows:
  • pdwVersionHi- Pointer to a DWORD that contains the upper 32 bits of the version number.
  • pdwVersionLow- Pointer to a DWORD that contain the lower 32 bits of the version number.

IAssemblyName::IsEqual Method

Για ναIAssemblyName::IsEqualmethod compares the assembly name to another assembly names.
    HRESULT IsEqual(
        [in] IAssemblyName *pName,
        [in] DWORD dwCmpFlags);
				
The parameters are defined as follows:
  • pName- The assembly name to compare to.
  • dwCmpFlags- Indicates which part of the assembly name to use in the comparison.
Values are one or more of the bits defined in theASM_CMP_FLAGSenumeration:
    typedef enum
    {
        ASM_CMPF_NAME            = 0x1,
        ASM_CMPF_MAJOR_VERSION   = 0x2,
        ASM_CMPF_MINOR_VERSION   = 0x4,
        ASM_CMPF_BUILD_NUMBER    = 0x8,
        ASM_CMPF_REVISION_NUMBER = 0x10,
        ASM_CMPF_PUBLIC_KEY_TOKEN = 0x20,
        ASM_CMPF_CULTURE         = 0x40,
        ASM_CMPF_CUSTOM          = 0x80,
        ASM_CMPF_ALL = ASM_CMPF_NAME | ASM_CMPF_MAJOR_VERSION | ASM_CMPF_MINOR_VERSION |
                       ASM_CMPF_REVISION_NUMBER | ASM_CMPF_BUILD_NUMBER |
                       ASM_CMPF_PUBLIC_KEY_TOKEN | ASM_CMPF_CULTURE | ASM_CMPF_CUSTOM,
        // For strongly named assemblies, ASM_CMPF_DEFAULT==ASM_CMPF_ALL.
        // For simply named assemblies, this is also true. However, when
        // performing IAssemblyName::IsEqual, the build number/revision 
        // number will be removed from the comparison.
        ASM_CMPF_DEFAULT = 0x100
    } ASM_CMP_FLAGS;                       
				
The return values are as follows:
  • S_OK:- The names match according to the comparison criteria.
  • S_FALSE:- The names do not match.

IAssemblyName::Clone Method

Για ναIAssemblyName::Clonemethod creates a copy of an assembly name.
    HRESULT Clone(
        [out] IAssemblyName **pName);
				

IAssemblyEnum Interface

Για ναIAssemblyEnuminterface enumerates the assemblies in the GAC.
 [
        local,
        object,
        uuid(21b8916c-f28e-11d2-a473-00c04f8ef448),
        pointer_default(unique)
]
interface IAssemblyEnum : IUnknown
				
Για να αποκτήσετε μια παρουσία τουCreateAssemblyEnumAPI, η κλήση τηςCreateAssemblyNameObjectAPI, as follows:
STDAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved, IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved);
The parameters are defined as follows:
  • pEnum- Pointer to a memory location that contains theIAssemblyEnumδείκτης.
  • pUnkReserved- Must be null.
  • pName- An assembly name that is used to filter the enumeration. Can be null to enumerate all assemblies in the GAC.
  • dwFlags- Exactly one bit from theASM_CACHE_FLAGSη απαρίθμηση.
  • pvReserved- Must be NULL.

ASM_CACHE_FLAGS Enumeration

Για ναASM_CACHE_FLAGSenumeration contains the following values:
  • ASM_CACHE_ZAP- Enumerates the cache of precompiled assemblies by using Ngen.exe.
  • ASM_CACHE_GAC- Enumerates the GAC.
  • ASM_CACHE_DOWNLOAD- Enumerates the assemblies that have been downloaded on-demand or that have been shadow-copied.
IAssemblyName::GetDisplayName
typedef enum
{
    ASM_CACHE_ZAP            = 0x1,
    ASM_CACHE_GAC            = 0x2,
    ASM_CACHE_DOWNLOAD       = 0x4
} ASM_CACHE_FLAGS;
				

IAssemblyEnum::GetNextAssembly Method

Για ναIAssemblyEnum::GetNextAssemblymethod enumerates the assemblies in the GAC.
    HRESULT GetNextAssembly
    (
        [in]                  LPVOID                pvReserved,
        [out]                 IAssemblyName       **ppName,
        [in]                  DWORD                 dwFlags
    );
				
The parameters are defined as follows:
  • pvReserved- Must be null.
  • ppName- Pointer to a memory location that is to receive the interface pointer to the assembly name of the next assembly that is enumerated.
  • dwFlags- Must be zero.

IInstallReferenceItem Interface

Για ναIInstallReferenceIteminterface represents a reference that has been set on an assembly in the GAC. Instances ofIInstallReferenceIteamare returned by theIInstallReferenceEnumΔιασύνδεση.
[
        local,
        object,
        uuid(582dac66-e678-449f-aba6-6faaec8a9394),
        pointer_default(unique)
]
interface IInstallReferenceItem : IUnknown
				

IInstallReferenceItem::GetReference Method

Για ναIInstallReferenceItem::GetReferenceη μέθοδος επιστρέφει μιαFUSION_INSTALL_REFERENCEδομή.
    HRESULT GetReference
    (
    [out] LPFUSION_INSTALL_REFERENCE *ppRefData,
    [in]  DWORD dwFlags,
    [in]  LPVOID pvReserved
    );
				
The parameters are defined as follows:
  • ppRefData-Ένας δείκτης προς έναFUSION_INSTALL_REFERENCEδομή. The memory is allocated by theGetReferencemethod and is freed whenIInstallReferenceItemis released. Callers must not hold a reference to this buffer after theIInstallReferenceItemobject is released.
  • dwFlags- Must be zero.
  • pvReserved- Must be null.

IInstallReferenceEnum Interface

Για ναIInstallReferenceEnuminterface enumerates all references that are set on an assembly in the GAC.

ΣΗΜΕΙΩΣΗ: References that belong to the assembly are locked for changes while those references are being enumerated.
[
        local,
        object,
        uuid(56b1a988-7c0c-4aa2-8639-c3eb5a90226f),
        pointer_default(unique)
]
interface IInstallReferenceEnum : IUnknown
				
Για να αποκτήσετε μια παρουσία τουCreateInstallReferenceEnumAPI, η κλήση τηςCreateInstallReferenceEnumAPI, as follows:
STDAPI CreateInstallReferenceEnum(IInstallReferenceEnum **ppRefEnum, IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved);
The parameters are defined as follows:
  • ppRefEnum- A pointer to a memory location that receives theIInstallReferenceEnumδείκτης.
  • pName- The assembly name for which the references are enumerated.
  • dwFlags- Must be zero.
  • pvReserved- Must be null.

IInstallReferenceEnum::GetNextInstallReferenceItem Method

IInstallReferenceEnum::GetNextInstallReferenceItemreturns the next reference information for an assembly.
    HRESULT GetNextInstallReferenceItem
            (
            [out] IInstallReferenceItem **ppRefItem,
            [in]  DWORD dwFlags,
            [in]  LPVOID pvReserved
            );
				
The parameters are defined as follows:
  • ppRefItem- Pointer to a memory location that receives theIInstallReferenceItemδείκτης.
  • dwFlags- Must be zero.
  • pvReserved- Must be null.
Return values are as follows:
  • S_OK:- The next item is returned successfully.
  • S_FALSE:- No more items.

GetCachePath API

Για ναGetCachePathAPI returns the storage location of the GAC.
STDAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath, PDWORD pcchPath);
The parameters are defined as follows:
  • dwCacheFlags- Exactly one of the bits defined in theASM_CACHE_FLAGSη απαρίθμηση.
  • pwzCachePath- Pointer to a buffer that is to receive the path of the GAC as a Unicode string.
  • pcchPath- Length of thepwszCachePathbuffer, in Unicode characters.
// ==++==
// 
//   Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// ==--==
//+---------------------------------------------------------------------------
// 
//  Microsoft Windows
//  File:       fusion.idl
// 
//  Contents:   Fusion Interfaces
// 
//  Classes:
// 
//  Functions:
// 
// 
//----------------------------------------------------------------------------
cpp_quote("//=--------------------------------------------------------------------------=")
cpp_quote("// fusion.h")
cpp_quote("//=--------------------------------------------------------------------------=")
cpp_quote("// Copyright (c) Microsoft Corporation.  All rights reserved.")
cpp_quote("//")
cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
cpp_quote("// PARTICULAR PURPOSE.")
cpp_quote("//=--------------------------------------------------------------------------=")
cpp_quote("")
cpp_quote("#ifdef _MSC_VER")
cpp_quote("#pragma comment(lib,\"uuid.lib\")")
cpp_quote("#endif")
cpp_quote("")
cpp_quote("//---------------------------------------------------------------------------=")
cpp_quote("// Fusion Interfaces.")
cpp_quote("")

import "objidl.idl";

cpp_quote("#ifdef _MSC_VER")
cpp_quote("#pragma once")
cpp_quote("#endif")

interface IAssemblyCache;
interface IAssemblyCacheItem;
interface IAssemblyName;
interface IAssemblyEnum;


typedef enum
{
    ASM_CACHE_ZAP            = 0x1,
    ASM_CACHE_GAC            = 0x2,
    ASM_CACHE_DOWNLOAD       = 0x4
} ASM_CACHE_FLAGS;

/////////////////////////////////////////////////////////////////////////////// 
// 
// IAssemblyCache
// 
/////////////////////////////////////////////////////////////////////////////// 

[
        local,
        object,
        uuid(e707dcde-d1cd-11d2-bab9-00c04f8eceae),
        pointer_default(unique)
]
interface IAssemblyCache : IUnknown
{
    cpp_quote("// {8cedc215-ac4b-488b-93c0-a50a49cb2fb8}")
    cpp_quote("DEFINE_GUID(FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID, 0x8cedc215, 0xac4b, 0x488b, 0x93, 0xc0, _
0xa5, 0x0a, 0x49, 0xcb, 0x2f, 0xb8);")
    cpp_quote("")
    cpp_quote("// {b02f9d65-fb77-4f7a-afa5-b391309f11c9}")
    cpp_quote("DEFINE_GUID(FUSION_REFCOUNT_FILEPATH_GUID, 0xb02f9d65, 0xfb77, 0x4f7a, 0xaf, 0xa5, 0xb3, 0x91, _
0x30, 0x9f, 0x11, 0xc9);")
    cpp_quote("")
    cpp_quote("// {2ec93463-b0c3-45e1-8364-327e96aea856}")
    cpp_quote("DEFINE_GUID(FUSION_REFCOUNT_OPAQUE_STRING_GUID, 0x2ec93463, 0xb0c3, 0x45e1, 0x83, 0x64, 0x32, _
0x7e, 0x96, 0xae, 0xa8, 0x56);")

    cpp_quote(" // {25df0fc1-7f97-4070-add7-4b13bbfd7cb8} // this GUID cannot be used for installing into GAC.")
    cpp_quote("DEFINE_GUID(FUSION_REFCOUNT_MSI_GUID,  0x25df0fc1, 0x7f97, 0x4070, 0xad, 0xd7, 0x4b, 0x13, 0xbb, 0xfd, _
0x7c, 0xb8); ")


    typedef struct _FUSION_INSTALL_REFERENCE_
    {
        DWORD  cbSize;
        DWORD  dwFlags;
        GUID   guidScheme; // contains one of the pre-defined guids.
        LPCWSTR szIdentifier;  // unique identifier for app installing this  assembly.
        LPCWSTR szNonCannonicalData;  // data is description; relevent to the guid above 
    } FUSION_INSTALL_REFERENCE, *LPFUSION_INSTALL_REFERENCE;

    typedef const FUSION_INSTALL_REFERENCE  *LPCFUSION_INSTALL_REFERENCE;


    typedef struct _ASSEMBLY_INFO
    {
        ULONG cbAssemblyInfo; // size of this structure for future expansion
        DWORD dwAssemblyFlags;
        ULARGE_INTEGER uliAssemblySizeInKB;
        LPWSTR pszCurrentAssemblyPathBuf;
        ULONG   cchBuf; // size of path buf.
    } ASSEMBLY_INFO;

    cpp_quote("#define IASSEMBLYCACHE_INSTALL_FLAG_REFRESH       (0x00000001)")
    cpp_quote("#define IASSEMBLYCACHE_INSTALL_FLAG_FORCE_REFRESH (0x00000002)")

    cpp_quote("#define IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED (1)")
    cpp_quote("#define IASSEMBLYCACHE_UNINSTALL_DISPOSITION_STILL_IN_USE (2)")
    cpp_quote("#define IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED (3)")
    cpp_quote("#define IASSEMBLYCACHE_UNINSTALL_DISPOSITION_DELETE_PENDING (4)")
    cpp_quote("#define IASSEMBLYCACHE_UNINSTALL_DISPOSITION_HAS_INSTALL_REFERENCES (5)")
    cpp_quote("#define IASSEMBLYCACHE_UNINSTALL_DISPOSITION_REFERENCE_NOT_FOUND (6)")

    cpp_quote("#define QUERYASMINFO_FLAG_VALIDATE        (0x00000001)")
    cpp_quote("#define QUERYASMINFO_FLAG_GETSIZE         (0x00000002)")

    // these flags are for dwAssemblyFlags field in struct _ASSEMBLY_INFO  
    cpp_quote("#define ASSEMBLYINFO_FLAG_INSTALLED       (0x00000001)")
    cpp_quote("#define ASSEMBLYINFO_FLAG_PAYLOADRESIDENT (0x00000002)")

    HRESULT UninstallAssembly(
        [in] DWORD dwFlags,
        [in] LPCWSTR pszAssemblyName, 
        [in] LPCFUSION_INSTALL_REFERENCE pRefData, 
        [out, optional] ULONG *pulDisposition
        );
 
    HRESULT QueryAssemblyInfo(
        [in] DWORD dwFlags,
        [in] LPCWSTR pszAssemblyName,
        [in, out] ASSEMBLY_INFO *pAsmInfo
        );
 
    HRESULT CreateAssemblyCacheItem( 
        [in] DWORD dwFlags,
        [in] PVOID pvReserved,
        [out] IAssemblyCacheItem **ppAsmItem,
        [in, optional] LPCWSTR pszAssemblyName  // uncanonicalized, comma separated name=value pairs.
        );
        
    HRESULT CreateAssemblyScavenger
    (
        [out]   IUnknown **ppUnkReserved
    );

    HRESULT InstallAssembly( // if you use this, fusion will do the streaming & commit.
        [in] DWORD dwFlags,
        [in] LPCWSTR pszManifestFilePath, 
        [in] LPCFUSION_INSTALL_REFERENCE pRefData
        );

}


/////////////////////////////////////////////////////////////////////////////// 
// 
// IAssemblyCacheItem
// 
/////////////////////////////////////////////////////////////////////////////// 

[
        local,
        object,
        uuid(9e3aaeb4-d1cd-11d2-bab9-00c04f8eceae),
        pointer_default(unique)
]
interface IAssemblyCacheItem : IUnknown
{
    cpp_quote("#define STREAM_FORMAT_COMPLIB_MODULE    0")
    cpp_quote("#define STREAM_FORMAT_COMPLIB_MANIFEST  1")
    cpp_quote("#define STREAM_FORMAT_WIN32_MODULE      2")
    cpp_quote("#define STREAM_FORMAT_WIN32_MANIFEST    4")
    
    cpp_quote("#define IASSEMBLYCACHEITEM_COMMIT_FLAG_REFRESH       (0x00000001)")
    cpp_quote("#define IASSEMBLYCACHEITEM_COMMIT_FLAG_FORCE_REFRESH (0x00000002)")
    
    cpp_quote("#define IASSEMBLYCACHEITEM_COMMIT_DISPOSITION_INSTALLED (1)") // first time install
    cpp_quote("#define IASSEMBLYCACHEITEM_COMMIT_DISPOSITION_REFRESHED (2)") // overwrite, if existing
    cpp_quote("#define IASSEMBLYCACHEITEM_COMMIT_DISPOSITION_ALREADY_INSTALLED (3)") // existing, 
    

    HRESULT CreateStream(
        [in] DWORD dwFlags,                         // For general API flags
        [in] LPCWSTR pszStreamName,                 // Name of the stream to be passed in
        [in] DWORD dwFormat,                        // format of the file to be streamed in.
        [in] DWORD dwFormatFlags,                   // format-specific flags
        [out] IStream **ppIStream,
        [in, optional] ULARGE_INTEGER *puliMaxSize  // Max size of the Stream.
        );
 
    HRESULT Commit
    (
        [in] DWORD dwFlags, // For general API flags like IASSEMBLYCACHEITEM _COMMIT_FLAG_REFRESH 
        [out, optional] ULONG *pulDisposition
    ); 
 
    HRESULT AbortItem(); // If you have created IAssemblyCacheItem and don't plan to use it, its good idea to call 
    AbortItem before releasing it.

}



/////////////////////////////////////////////////////////////////////////////// 
// 
// IAssemblyName
// 
/////////////////////////////////////////////////////////////////////////////// 

[
        local,
        object,
        uuid(CD193BC0-B4BC-11d2-9833-00C04FC31D2E),
        pointer_default(unique)
]
interface IAssemblyName: IUnknown
{
    typedef [unique] IAssemblyName *LPASSEMBLYNAME;
    
    typedef enum {
         CANOF_PARSE_DISPLAY_NAME = 0x1,
         CANOF_SET_DEFAULT_VALUES = 0x2
    } CREATE_ASM_NAME_OBJ_FLAGS;
    
    typedef enum
    {
        ASM_NAME_PUBLIC_KEY = 0,
        ASM_NAME_PUBLIC_KEY_TOKEN,
        ASM_NAME_HASH_VALUE,
        ASM_NAME_NAME,
        ASM_NAME_MAJOR_VERSION,
        ASM_NAME_MINOR_VERSION,
        ASM_NAME_BUILD_NUMBER,
        ASM_NAME_REVISION_NUMBER,
        ASM_NAME_CULTURE,
        ASM_NAME_PROCESSOR_ID_ARRAY,
        ASM_NAME_OSINFO_ARRAY,
        ASM_NAME_HASH_ALGID,
        ASM_NAME_ALIAS,
        ASM_NAME_CODEBASE_URL,
        ASM_NAME_CODEBASE_LASTMOD,
        ASM_NAME_NULL_PUBLIC_KEY,
        ASM_NAME_NULL_PUBLIC_KEY_TOKEN,
        ASM_NAME_CUSTOM,
        ASM_NAME_NULL_CUSTOM,                
        ASM_NAME_MVID,
        ASM_NAME_MAX_PARAMS
    } ASM_NAME;
    
    typedef enum
    {
        ASM_DISPLAYF_VERSION    = 0x1,
        ASM_DISPLAYF_CULTURE    = 0x2,
        ASM_DISPLAYF_PUBLIC_KEY_TOKEN = 0x4,
        ASM_DISPLAYF_PUBLIC_KEY = 0x8,
        ASM_DISPLAYF_CUSTOM     = 0x10,
        ASM_DISPLAYF_PROCESSORARCHITECTURE = 0x20,
        ASM_DISPLAYF_LANGUAGEID     = 0x40

    } ASM_DISPLAY_FLAGS;
    
    typedef enum
    {
        ASM_CMPF_NAME            = 0x1,
        ASM_CMPF_MAJOR_VERSION   = 0x2,
        ASM_CMPF_MINOR_VERSION   = 0x4,
        ASM_CMPF_BUILD_NUMBER    = 0x8,
        ASM_CMPF_REVISION_NUMBER = 0x10,
        ASM_CMPF_PUBLIC_KEY_TOKEN = 0x20,
        ASM_CMPF_CULTURE         = 0x40,
        ASM_CMPF_CUSTOM          = 0x80,
        ASM_CMPF_ALL = ASM_CMPF_NAME | ASM_CMPF_MAJOR_VERSION | ASM_CMPF_MINOR_VERSION |
                       ASM_CMPF_REVISION_NUMBER | ASM_CMPF_BUILD_NUMBER |
                       ASM_CMPF_PUBLIC_KEY_TOKEN | ASM_CMPF_CULTURE | ASM_CMPF_CUSTOM,
        // For strongly named assemblies, ASM_CMPF_DEFAULT==ASM_CMPF_ALL.
        // For simply named assemblies, this is also true, however, when
        // performing IAssemblyName::IsEqual, the build number/revision 
        // number will be removed from the comparision.
        ASM_CMPF_DEFAULT = 0x100
    } ASM_CMP_FLAGS;                       

    HRESULT SetProperty(
        [in]    DWORD  PropertyId, 
        [in]    LPVOID pvProperty,
        [in]    DWORD  cbProperty);

    HRESULT GetProperty(
        [in]         DWORD    PropertyId, 
        [out]        LPVOID   pvProperty,
        [in, out]    LPDWORD  pcbProperty);

    HRESULT Finalize();

    HRESULT  GetDisplayName(
        [out]       LPOLESTR  szDisplayName,
        [in, out]   LPDWORD   pccDisplayName,
        [in]        DWORD     dwDisplayFlags);

    HRESULT BindToObject(
        [in]      REFIID               refIID,
        [in]      IUnknown            *pUnkSink, 
        [in]      IUnknown            *pUnkContext,
        [in]      LPCOLESTR            szCodeBase,
        [in]      LONGLONG             llFlags,
        [in]      LPVOID               pvReserved,
        [in]      DWORD                cbReserved,
        [out]     LPVOID               *ppv);


    HRESULT GetName(
        [in, out] LPDWORD lpcwBuffer,
        [out] WCHAR *pwzName);
        
    HRESULT GetVersion(
        [out] LPDWORD pdwVersionHi,
        [out] LPDWORD pdwVersionLow);

    HRESULT IsEqual(
        [in] IAssemblyName *pName,
        [in] DWORD dwCmpFlags);
        
    HRESULT Clone(
        [out] IAssemblyName **pName);
        

}

/////////////////////////////////////////////////////////////////////////////// 
// 
// IAssemblyEnum
// 
/////////////////////////////////////////////////////////////////////////////// 
[
        local,
        object,
        uuid(21b8916c-f28e-11d2-a473-00c04f8ef448),
        pointer_default(unique)
]
interface IAssemblyEnum : IUnknown
{

    HRESULT GetNextAssembly
    (
        [in]                  LPVOID                pvReserved,
        [out]                 IAssemblyName       **ppName,
        [in]                  DWORD                 dwFlags
    );

    HRESULT Reset(void);

    HRESULT Clone 
    (
        [out] IAssemblyEnum **ppEnum
    );
    
}


/////////////////////////////////////////////////////////////////////////////// 
// 
// IInstallReferenceItem
// 
/////////////////////////////////////////////////////////////////////////////// 

[
        local,
        object,
        uuid(582dac66-e678-449f-aba6-6faaec8a9394),
        pointer_default(unique)
]
interface IInstallReferenceItem : IUnknown
{
    HRESULT GetReference
    (
    [out] LPFUSION_INSTALL_REFERENCE *ppRefData,
    [in]  DWORD dwFlags,
    [in]  LPVOID pvReserved
    );
}

/////////////////////////////////////////////////////////////////////////////// 
// 
// IInstallReferenceEnum
// 
/////////////////////////////////////////////////////////////////////////////// 

[
        local,
        object,
        uuid(56b1a988-7c0c-4aa2-8639-c3eb5a90226f),
        pointer_default(unique)
]
interface IInstallReferenceEnum : IUnknown
{
    HRESULT GetNextInstallReferenceItem
            (
            [out] IInstallReferenceItem **ppRefItem,
            [in]  DWORD dwFlags,
            [in]  LPVOID pvReserved
            );
}

#pragma midl_echo("STDAPI CreateInstallReferenceEnum(IInstallReferenceEnum **ppRefEnum, IAssemblyName *pName, DWORD dwFlags, _
LPVOID pvReserved);      ")
#pragma midl_echo("STDAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved, IAssemblyName *pName, DWORD dwFlags, _
LPVOID pvReserved);      ") 
#pragma midl_echo("STDAPI CreateAssemblyNameObject(LPASSEMBLYNAME *ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, _
LPVOID pvReserved);             ")
#pragma midl_echo("STDAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved); ")
#pragma midl_echo("STDAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath, PDWORD pcchPath); ")
				

Ιδιότητες

Αναγν. άρθρου: 317540 - Τελευταία αναθεώρηση: Τρίτη, 21 Δεκεμβρίου 2010 - Αναθεώρηση: 2.0
Λέξεις-κλειδιά: 
kbbug kbdocerr kbpending kbmt KB317540 KbMtel
Μηχανικά μεταφρασμένο
ΣΗΜΑΝΤΙΚΟ: Αυτό το άρθρο είναι προϊόν λογισμικού μηχανικής μετάφρασης της Microsoft και όχι ανθρώπινης μετάφρασης. Η Microsoft σάς προσφέρει άρθρα που είναι προϊόντα ανθρώπινης αλλά και μηχανικής μετάφρασης έτσι ώστε να έχετε πρόσβαση σε όλα τα άρθρα της Γνωσιακής Βάσης μας στη δική σας γλώσσα. Ωστόσο, ένα άρθρο που έχει προκύψει από μηχανική μετάφραση δεν είναι πάντα άριστης ποιότητας. Ενδέχεται να περιέχει λεξιλογικά, συντακτικά ή γραμματικά λάθη, όπως ακριβώς τα λάθη που θα έκανε ένας μη φυσικός ομιλητής επιχειρώντας να μιλήσει τη γλώσσα σας. Η Microsoft δεν φέρει καμία ευθύνη για τυχόν ανακρίβειες, σφάλματα ή ζημίες που προκύψουν λόγω τυχόν παρερμηνειών στη μετάφραση του περιεχομένου ή χρήσης του από τους πελάτες της. Επίσης, η Microsoft πραγματοποιεί συχνά ενημερώσεις στο λογισμικό μηχανικής μετάφρασης.
Η αγγλική έκδοση αυτού του άρθρου είναι η ακόλουθη:317540
Αποποίηση ευθυνών για περιεχόμενο της Γνωσιακής Βάσης (KB) που έχει αποσυρθεί
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Αποστολή σχολίων

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com