?????: ??? APIs ??????? ?????? (GAC) ????? ????? ?? ??????? ?? ??????? (SDK) ?? ?????? ????? ????? ??????? .NET Framework

?????? ????????? ?????? ?????????
???? ???????: 317540 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

?? ??? ??????? ?? ?????? ?????? ????? ?????? ????? ????????? (API) ???? ???? ?? ??????? ?? ????? ??????? ??????? ??????? ??????? (GAC) ?? ????? .NET Framework ????? ?????? ??????? (SDK).

??????? ????

?????: ??? ??????? ?????? ????? ????????? ??? ?? ??????? ????? ?? ??? ????? ?? ??????? ?? ??????? ???? ????????? ?? ???? ??? ??????? ????? ?? ?????? ??? ???????. ??? ?? ?????? ????? ??????? ???????? ???????? ??? ?????? ????? ????????? ???. ??? ??? ?????? GAC ??? ?????? ????? ?? ??????? ????? ?? ??? fragility ??? ??????? ?? ?? ???? ??????? ????? ???? ??? ???? ?? ????????? ?????????? ?? .NET Framework.

???? GAC ????????? ???????? ??? ???? ????????? ??? ???? ???????. ???? ??????? ??????? ????? GAC ?? ??? ??????? ?? ?? ???? ??????? ?? ????????? ?????????? ?? .NET Framework "?" ???? ??????? Microsoft Windows.

??????? ??????? ???????? ????????? ?????? ?? GAC ?? ???? APIs ???? ?? ??????? ?? ??? ???????.

?? ???? ??????? ?????? ????? ????????? ??? ???? ??? ????? ??????? ????? ???????? ??? ??? ????? ????? ?????? ???? ?????????. ??? ?? ?????? ????? ??????? ?????? ?? ????? ????? ?????? ????? ????????? ???. Microsoft Windows Installer ????? ??? ???? ?????? ????????? ??? GAC.

????? ?? ????????? ??? ????????? GAC ???? SDK .NET Framework.

??????? API GAC ?? ???????????? ???????:
  • ??? ????? ????? ??? GAC.
  • ??? ????? ????? ?? GAC.
  • ??? ????? ????? ?? GAC.
  • ??? ????? ????????? ???? ????? ?? GAC.
??????: ??? ??????? CoInitialize(Ex) ??? ??????? ?? ?? ????? ??????? ??????? ?? ??? ?????????.

????? IAssemblyCache

??????? IAssemblyCache ?? ??????? ??? ??????? ?????? ???? ???? ?????? ??? GAC.

?????? ??? ???? CreateAssemblyCache API ?? ???????? CreateAssemblyCache API? ??? ???:
STDAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved); 
??? ????? ???????? ??? ???:
  • ppAsmCache - ?????? ?????? IAssemblyCache
  • dwReserved

???? FUSION_INSTALL_REFERENCE

???? ???? FUSION_INSTALL_REFERENCE ???? ??? ????? ??? ????? ????? ????? ?? 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;
				
???????? ?? ???? ?????? ??? ???:
  • cbSize - ??? ???? ???????.
  • ??? ?? ???? dwFlags - ????? ? ?????.
  • guidScheme - ?????? ???? ??????.
  • szIdentifier - ????? ???? ???? ?????? ??????? ???? ??? ?????? ???????.
  • szNonCannonicalData - ????? ??? ????? ?????? ???? ??????. ???? GAC ??? ??? ???????.
???? ?? ???? ????? ??????? ???? guidScheme ??? ????????? ???????:
  • ??? ??????? ??? FUSION_REFCOUNT_MSI_GUID - ??????? ?? ??? ??????? ???? ?? ??????? ???????? ???? Windows. ??? ????? ????? szIdentifier ??? MSI ?????? szNonCannonicalData ??? Windows Installer. ??? ?????? ??? ?? ??? ??????? ??? ?????? Windows Installer ????.
  • ??? ??????? ??? FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID - ??????? ?? ??? ??????? ???? ???? ?? ?????/????? ???????. ??? szIdentifier ?? ????? ?????? ????????? ?? ????? ??????? ???????? ?????/????? ?????.
  • ??? ??????? ??? FUSION_REFCOUNT_FILEPATH_GUID - ??????? ?? ??? ??????? ???? ??? ????? ??? ?? ???? ???????. ??? szIdentifier ?? ?????? ??? ??? ?????.
  • ??? ??????? ??? FUSION_REFCOUNT_OPAQUE_STRING_GUID - ??????? ?? ??? ??????? ???? ??? ????? ????? ??? ???? ???. ?? szIdentifier ??? ??????? ??? ????. ?? GAC ????? ?????? ?? ???? ????? ??? ???? ??? ????? ??? ????.

???? ASSEMBLY_INFO

???? ???? ASSEMBLY_INFO ????????? ??? ????? ?? ????? ??????? ??????? ???????.

??? ????? ???? ?????? ??? ???:
  • cbAssemblyInfo - ??? ???? ???????. ???? ?????? ??? ?????? ?? ??????? ????????? ?? .NET Framework.
  • ???? dwAssemblyFlags - ??? ???? ?? ???? ?? ?? ASSEMBLYINFO_FLAG_ *.
  • uliAssemblySizeInKB - ??? ??????? ???? ???? ??????? ??????? ???? (KB).
  • pszCurrentAssemblyPathBuf - ???? ??? ?????? ???? ????? ???? ????? ??? ???? ?????? ???? ????? ??? ??????? ???? ???? ??????? ??????. ??? ?? ????? ?????? ?? ???.
  • cchBuf - ??? ?????? ?????? ???? ???? ??? ??? pszCurrentAssemblyPathBug.
???? ?? dwAssemblyFlags ???? ????? ???????:
  • ASSEMBLYINFO_FLAG__INSTALLED - ???? ??? ?? ??????? ???? ??????. ????? ????? ?? ??????? ?????? ?? ?????? .NET Framework.
  • ASSEMBLYINFO_FLAG__PAYLOADRESIDENT - ??? ????? ?? ??????? ?????? .NET Framework.

????? IAssemblyCache::UninstallAssembly

????? ????? IAssemblyCache::UninstallAssembly ???? ????? ?? GAC. ?? ???? ???????? ????????? ?????? ??????? ?????? ??? ??????? ? ??? ????? ??????? ???? ???? ??????? ?? GAC.
    HRESULT UninstallAssembly(
        [in] DWORD dwFlags,
        [in] LPCWSTR pszAssemblyName, 
        [in] LPCFUSION_INSTALL_REFERENCE pRefData, 
        [out, optional] ULONG *pulDisposition
        );

				
??? ????? ???????? ??? ???:
  • dwFlags - ?? ?????? ?????. ??? ?? ???? ???.
  • pszAssemblyName - ??? ???????. Unicode ????? ??? ?????.
  • pRefData - ???? ????? FUSION_INSTALL_REFERENCE. ??? ????? ?? ??? ??? ??????? ???? ?? ???? ??? ??????? ?????. ??? ????? ??????? ???? ???? ????? ?? ????? ???? ??????? ????????? ????????.
  • pulDisposition - ?????? ??? ??? ???? ???? ??? ??????? ???? ??? ?????? ?????? ??????.
??????: ??? ?? ??? pulDisposition ????? pulDisposition ????? ??? ???? ????? ???????:
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED - ??????? ????? ??????? ?? GAC.
  • ?????? IASSEMBLYCACHE_UNINSTALL_DISPOSITION_STILL_IN_USE - ????? ???????. ??? ????? ??? ?????? ?? Microsoft Windows 95 ? Microsoft Windows 98.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED - ??????? ??? ????? ?? GAC.
  • IASSEMBLYCACHE_UNINSTALL_DISPOSITION_DELETE_PENDING - ??? ?????????.
  • ?? ?? ????? IASSEMBLYCACHE_UNINSTALL_DISPOSITION_HAS_INSTALL_REFERENCES - ??????? ?? GAC ???? ???? ???? ????? ???.
  • ?? ??? ?????? ??? IASSEMBLYCACHE_UNINSTALL_DISPOSITION_REFERENCE_NOT_FOUND - ?????? ?????? ?? pRefData ?? GAC.
??? ????? ??? ??????? ??? ???:
  • ?? ????? ????? S_OK - ???????.
  • S_FALSE - ???? ??????? ???? ?? ??? ????? ??????? ?? GAC. ??? ??? ????? ?? pulDisposition.

????? IAssemblyCache::QueryAssemblyInfo

????? IAssemblyCache::QueryAssemblyInfo ???????? ??????? ??? ????? ?? GAC.
    HRESULT QueryAssemblyInfo(
        [in] DWORD dwFlags,
        [in] LPCWSTR pszAssemblyName,
        [in, out] ASSEMBLY_INFO *pAsmInfo
        );
				
??? ????? ???????? ??? ???:
  • dwFlags - ??? QUERYASMINFO_FLAG_VALIDATE ?? QUERYASMINFO_FLAG_GETSIZE:
    • * _VALIDATE-????? ?????? ?? ??? ??????? ?? GAC ????? ?? ??? ??????? ??? ?? ??? ?????? ?? ??????? ?????? ?? ????? ????? ??????.
    • * _GETSIZE-????? ??? ???? ??????? ?? ??????? (??? ?????). ??? ?? ??? ?????? ?? ??? ????? ??? ASSEMBLY_INFO::uliAssemblySizeInKB.
  • pszAssemblyName - ??? ??????? ???? ?? ????????? ???.
  • pAsmInfo - ?????? ??? ???? ASSEMBLY_INFO ???? ?? ???????.

????? IAssemblyCache::InstallAssembly

????? ????? IAssemblyCache::InstallAssembly ????? ????? ??? GAC. ??? ?? ???? ?????? ???? ???? ?? ???? ??????? ??????? ?? ????? ??? GAC.
    HRESULT InstallAssembly( // If you use this, fusion will do the streaming & commit.
        [in] DWORD dwFlags,
        [in] LPCWSTR pszManifestFilePath, 
        [in] LPCFUSION_INSTALL_REFERENCE pRefData
        );
				
??? ????? ???????? ???????:
  • ???? ????? dwFlags - ?? ?????? ????? ?? ????? IASSEMBLYCACHE_INSTALL_FLAG_ * ????:
    • * _REFRESH - ??? ?? ?????? ????? ??????? ?? GAC ?? ????? ????? ????? ??????? ????? ????? ?? ??????? ??? ??????? ???????.
    • * _FORCE_REFRESH-??? ??????? ??? ??????? ???????? ??????? ??? ????? ?? ??? ??????? ????? ???.
  • pszManifestFilePath - ????? ???? ??? ??? ???? ??????? (DLL) ???? ????? ??? ??? ??????? ??????. ??? ?? ?????? ??????? ??????? ???? ?? ??? ?????? ?? DLL ???? ????? ??? ??? ??????? ??????.
  • pRefData - ???? FUSION_INSTALL_REFERENCE ???? ???? ??? ????? ??? ????? ??????? ????? ?????? ??. ??? ????? ?? ??? ??? ??????? ???? ?? ???? ???? ??? ??????? ????? ???? ??? ???? ??????? ???? ?? ???? ???????.

????? IAssemblyName

???? ????? IAssemblyName ??? ??? ?????. ????? ??? ????? ?????? predetermined ?? ????? ????? - ??????. ??? ??? ??? ??????? ???????? ?? SDK .NET Framework.
[
        local,
        object,
        uuid(CD193BC0-B4BC-11d2-9833-00C04FC31D2E),
        pointer_default(unique)
]
interface IAssemblyName: IUnknown
				
??? ?????? ??? ???? IAssemblyName ?? ???? ??????? API CreateAssemblyNameObject:
STDAPI CreateAssemblyNameObject(LPASSEMBLYNAME *ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved);
??? ????? ???????? ??? ???:
  • ppAssemblyNameObj - ?????? ??? ???? ????? ????? ?????? IAssemblyName ???? ??? ??????.
  • szAssemblyName - ????? ????? ?? ??? ??????? ?? ???? ??????? ?????? ???? ????? dwFlags. ???? ????? ????? ?????.
  • dwFlags - ??? ?? ???? ?? ?????? ???? ?? ??????? ?? ????? CREATE_ASM_NAME_OBJ_FLAGS.
  • ??? ?? ???? pvReserved - ?????.

????? CREATE_ASM_NAME_OBJ_FLAGS

????? ??????? CREATE_ASM_NAME_OBJ_FLAGS ????? ???????:
  • CANOF_PARSE_DISPLAY_NAME - ??? ?? ????? ??? ??????? ??????? szAssemblyName ?? ??? ????? ???? ???? ????? ????? ?????. ??? ?? ??? ????? ??????? szAssemblyName ?? ??? "?????" ??? ???????.
  • ??? ????? CANOF_SET_DEFAULT_VALUES - ??? ???? ??? ??????? ??????? ? ??? ???????? ??? ????? ??????? ??? ????? ??????????.
    typedef enum {
         CANOF_PARSE_DISPLAY_NAME = 0x1,
         CANOF_SET_DEFAULT_VALUES = 0x2
    } CREATE_ASM_NAME_OBJ_FLAGS;
				

????? ASM_NAME

??? ????? ??????? ASM_NAME ????? ??????? ??????? ?? ????? ????? - ?????? ?? ??? ?????. ???? .NET Framework SDK ?????? ??? ??? ??? ???????.
    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

????? IAssemblyName::SetProperty ???? ??? ????? - ?????? ??? ??? ??????? ?? ??? ??? ??? - ???? ???? ????? ??????, ????? ?? ??? ?????? ??? ??? - ????.
    HRESULT SetProperty(
        [in]    DWORD  PropertyId, 
        [in]    LPVOID pvProperty,
        [in]    DWORD  cbProperty);
				
??? ????? ???????? ??? ???:
  • PropertyId-"??????" ???? ??? ????? ?? ??? ????? - ?????? ?????? ??????? ?? ???????. ??? ????? ?????? ????? ????? ?? ????? ASM_NAME.
  • pvProperty - ???? ??? ?????? ???? ???? ????? ??? ???? ???????.
  • cbProperty - ??? ?????? ?????? pvProperty ???????. ???? cbProperty ?????? ??? ????? ??? ??? - ???? ??? ???????.

????? IAssemblyName::GetProperty

????? IAssemblyName::GetProperty ??????? ???? ??? ??? - ???? ?? ??? ??????? ???? ???? ?????.
    HRESULT GetProperty(
        [in]         DWORD    PropertyId, 
        [out]        LPVOID   pvProperty,
        [in, out]    LPDWORD  pcbProperty);
				
??? ????? ???????? ??? ???:
  • PropertyId-"??????" ???? ??? ??? ??? - ???? ????? ??? ???????. ?? ????? ??????? ??????? ?????? ?? ????? ASM_NAME.
  • pvProperty - ???? ??? ?????? ???? ???? ????? ??? ???? ???????.
  • cbProperty - ??? ?????? ?????? pvProperty ???????.

????? IAssemblyName::Finalize

????? ????? IAssemblyName::Finalize ??? ??? ?????. ??????? ?????? ??? IAssemblyName::SetProperty ???? ??? ??????? ??? ??????? ??? ???????.
HRESULT Finalize();

????? IAssemblyName::GetDisplayName

???? ??????? IAssemblyName::GetDisplayName ????? ????? ??? ???????.
    HRESULT  GetDisplayName(
        [out]       LPOLESTR  szDisplayName,
        [in, out]   LPDWORD   pccDisplayName,
        [in]        DWORD     dwDisplayFlags);
				
??? ????? ???????? ??? ???:
  • szDisplayName - ???? ??? ?????? ???? ???? ????? ??? ??? ?????. ??? ????? ??? ????? ?? Unicode.
  • pccDisplayName - ??? ?????? ?????? ?? ?????? (??? ???????). ??? ??? ????? ???? ?? ?????? (??? ?????).
  • dwDisplayFlags - ???? ?? ???? ?? ?????? ???????? ?? ????? ASM_DISPLAY_FLAGS:
    • * _VERSION-????? ??? ????? ???? ?? ??? ?????.
    • * _CULTURE-????? ???????? ????????.
    • * _PUBLIC_KEY_TOKEN-????? ??? ??????? ???????.
    • * _PUBLIC_KEY-????? ??????? ???????.
    • * _CUSTOM-????? ??? ??? ??????? ???????.
    • * _PROCESSORARCHITECTURE-????? ????? ???????.
    • * _LANGUAGEID-????? ????? ?????.
    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

???? ??????? IAssemblyName::GetName ??? ????? ?? ??? ???????.
    HRESULT GetName(
        [in, out] LPDWORD lpcwBuffer,
        [out] WCHAR *pwzName);
				
??? ????? ???????? ??? ???:
  • lpcwBuffer - ??? ?????? ?????? pwszName (??? ???????). ??? ????? (??? ?????).
  • pwszName - ?????? ??? ?????? ?????? ???? ????? ??? ??? ????? ?? ??? ???????.

????? IAssemblyName::GetVersion

???? ??????? IAssemblyName::GetVersion ??? ????? ?? ??? ???????.
HRESULT GetVersion(
        [out] LPDWORD pdwVersionHi,
        [out] LPDWORD pdwVersionLow);
				
??? ????? ???????? ??? ???:
  • pdwVersionHi - ?????? ??? DWORD ????? ??? 32 ?? ???? ??? ?????.
  • pdwVersionLow - ?????? ??? DWORD ???? ????? ??? 32 ?? ??? ?? ??? ???????.

????? IAssemblyName::IsEqual

????? IAssemblyName::IsEqual ?????? ??? ??????? ??? ????? ????????? ???.
    HRESULT IsEqual(
        [in] IAssemblyName *pName,
        [in] DWORD dwCmpFlags);
				
??? ????? ???????? ??? ???:
  • pName - ??? ??????? ???????.
  • dwCmpFlags - ???? ??? ?? ??? ?? ??? ??????? ???? ???? ???????? ?? ????????.
???? ????? ?? ???? ?? ?????? ???????? ?? ????? ASM_CMP_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 comparison.
        ASM_CMPF_DEFAULT = 0x100
    } ASM_CMP_FLAGS;                       
				
??? ??????? ??? ???:
  • S_OK:-??????? ?????? ???????? ??? ?????? ????????.
  • S_FALSE:-??????? ??? ???????.

????? IAssemblyName::Clone

????? ????? IAssemblyName::Clone ???? ???? ???????.
    HRESULT Clone(
        [out] IAssemblyName **pName);
				

????? IAssemblyEnum

????? ????? IAssemblyEnum ????????? ?? GAC.
 [
        local,
        object,
        uuid(21b8916c-f28e-11d2-a473-00c04f8ef448),
        pointer_default(unique)
]
interface IAssemblyEnum : IUnknown
				
?????? ??? ???? CreateAssemblyEnum API ?? ???????? CreateAssemblyNameObject API? ??? ???:
STDAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved, IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved);
??? ????? ???????? ??? ???:
  • pEnum - ?????? ??? ???? ????? ???? ????? ??? ?????? IAssemblyEnum.
  • ??? ?? ???? pUnkReserved - ?????.
  • pName - ??? ????? ???? ??????? ?? ????? ???????. ???? ?? ???? ?????? ????? ???? ????????? ?? GAC.
  • dwFlags - ?? ???? ?? ??????? ASM_CACHE_FLAGS ??????.
  • ??? pvReserved - NULL.

????? ASM_CACHE_FLAGS

????? ??????? ASM_CACHE_FLAGS ????? ???????:
  • ????? ASM_CACHE_ZAP - ????? ??????? ?????? ????????? precompiled ???????? Ngen.exe.
  • ????? ASM_CACHE_GAC - GAC.
  • ????? ASM_CACHE_DOWNLOAD - ????????? ???? ?? ??????? ??? ????? ?? ???? ?? ??? ????.
IAssemblyName::GetDisplayName
typedef enum
{
    ASM_CACHE_ZAP            = 0x1,
    ASM_CACHE_GAC            = 0x2,
    ASM_CACHE_DOWNLOAD       = 0x4
} ASM_CACHE_FLAGS;
				

????? IAssemblyEnum::GetNextAssembly

????? ??????? IAssemblyEnum::GetNextAssembly ????????? ?? GAC.
    HRESULT GetNextAssembly
    (
        [in]                  LPVOID                pvReserved,
        [out]                 IAssemblyName       **ppName,
        [in]                  DWORD                 dwFlags
    );
				
??? ????? ???????? ??? ???:
  • ??? ?? ???? pvReserved - ?????.
  • ppName - ?????? ??? ???? ????? ?? ?? ????? ??? ??? ??????? ??????? ?????? ???? ??? ????? ???? ?????.
  • ??? dwFlags - ???.

????? IInstallReferenceItem

???? ????? IInstallReferenceItem ???? ???? ?? ?????? ??? ????? ?? GAC. ??? ????? ?????? IInstallReferenceIteam ?????? ????? IInstallReferenceEnum.
[
        local,
        object,
        uuid(582dac66-e678-449f-aba6-6faaec8a9394),
        pointer_default(unique)
]
interface IInstallReferenceItem : IUnknown
				

????? IInstallReferenceItem::GetReference

???? ??????? IInstallReferenceItem::GetReference ???? FUSION_INSTALL_REFERENCE.
    HRESULT GetReference
    (
    [out] LPFUSION_INSTALL_REFERENCE *ppRefData,
    [in]  DWORD dwFlags,
    [in]  LPVOID pvReserved
    );
				
??? ????? ???????? ??? ???:
  • ppRefData - ???? ????? FUSION_INSTALL_REFERENCE. ??? ????? ?????? ??????? GetReference ??????? ?? ??? ????? ??? ????? IInstallReferenceItem. ??? ?? ?? ???? ???????? ???? ??? ??? ?????? ?????? ??? ????? ???? IInstallReferenceItem.
  • ??? dwFlags - ???.
  • ??? ?? ???? pvReserved - ?????.

????? IInstallReferenceEnum

????? IInstallReferenceEnum ????? ???? ??????? ???? ??? ??????? ??? ????? ?? GAC.

??????: ??? ????? ??????? ???? ????? ??? ??????? ??????? ????? ????? ??? ???????.
[
        local,
        object,
        uuid(56b1a988-7c0c-4aa2-8639-c3eb5a90226f),
        pointer_default(unique)
]
interface IInstallReferenceEnum : IUnknown
				
?????? ??? ???? CreateInstallReferenceEnum API ?? ???????? CreateInstallReferenceEnum API? ??? ???:
STDAPI CreateInstallReferenceEnum(IInstallReferenceEnum **ppRefEnum, IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved);
??? ????? ???????? ??? ???:
  • ppRefEnum - ???? ??? ???? ????? ????? ?????? IInstallReferenceEnum.
  • pName - ??? ??????? ??? ????? ???????.
  • ??? dwFlags - ???.
  • ??? ?? ???? pvReserved - ?????.

????? IInstallReferenceEnum::GetNextInstallReferenceItem

????? IInstallReferenceEnum::GetNextInstallReferenceItem ??????? ??????? ???? ?????.
    HRESULT GetNextInstallReferenceItem
            (
            [out] IInstallReferenceItem **ppRefItem,
            [in]  DWORD dwFlags,
            [in]  LPVOID pvReserved
            );
				
??? ????? ???????? ??? ???:
  • ppRefItem - ?????? ??? ???? ????? ????? ?????? IInstallReferenceItem.
  • ??? dwFlags - ???.
  • ??? ?? ???? pvReserved - ?????.
??? ??????? ???????:
  • S_OK:-??? ????? ?????? ?????? ?????.
  • S_FALSE:-?? ???? ?????? ?? ???????.

GetCachePath API

????? GetCachePath API ???? ??????? GAC.
STDAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath, PDWORD pcchPath);
??? ????? ???????? ??? ???:
  • dwCacheFlags - ??? ?????? ???????? ?? ????? ASM_CACHE_FLAGS ??????.
  • pwzCachePath - ?????? ??? ?????? ???? ?? ????? ???? GAC ?????? Unicode.
  • pcchPath - ??? ?????? ?????? pwszCachePath ?? ???? Unicode.
// ==++==
// 
//   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 - ????? ??? ??????: 02/???/1424 - ??????: 3.0
????? ???
  • Microsoft .NET Framework Software Development Kit 1.0 Service Pack 2
  • Microsoft .NET Framework Software Development Kit 1.0 Service Pack 2
????? ??????: 
kbmt kbbug kbdocerr kbpending KB317540 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????317540
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

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