Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

488 lines
15 KiB

//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation 1998.
//
// cs.idl
//
// Methods for the class store
//
//--------------------------------------------------------------------------
import "unknwn.idl";
import "wtypes.idl";
import "appmgmt.h";
//
// Package Information consists of one or more
// PACKAGEDETAIL - Info about an implemetation code package
//
//
// Package Flag Values returned in PACKAGEDETAIL
//
// Please note that the ACTFLG_ExcludeX86OnWin64 flag's value is not arbitrary. This value was
// chosen for NT 5.1 because NT 5.0 preserves this value in class store operations. In NT 5.0,
// this value was assigned to ACTFLG_X86OnAlpha. Since alpha support was removed later on in
// NT 5.0, this flag has no meaning for NT 5.0. We want to re-use it though since if we used
// some value that NT 5.0 didn't use, NT 5.0 class store tools called by admin components
// would not preserve the value (they would reset it). Using a value that NT 5.0 thinks it owns
// means that it will be preserved even when NT 5.0 tools are used to manage NT 5.1 deployments
// with this flag set.
//
// special activation flags
// const DWORD UNUSED = 0x1;
// const DWORD UNUSED = 0x2;
const DWORD ACTFLG_UninstallUnmanaged = 0x4; // no longer used by clients as of xpsp1, still set by the ui to clear flags for backwards compat reasons -- uninstall unmanaged version before assigning
const DWORD ACTFLG_Published = 0x8; // this is a Published app
const DWORD ACTFLG_POSTBETA3 = 0x10; // this package was deployed after Beta 3 of Win2k
const DWORD ACTFLG_UserInstall = 0x20; // this app may be installed via Add/Remove programs
const DWORD ACTFLG_OnDemandInstall = 0x40; // this app may be auto installed OnDemand
const DWORD ACTFLG_Orphan = 0x80; // this app is Orphaned
const DWORD ACTFLG_Uninstall = 0x100; // this app is to be treated as Uninstalled
const DWORD ACTFLG_Pilot = 0x200; // this app is available as a Pilot Only.
const DWORD ACTFLG_Assigned = 0x400; // this is an Assigned app
const DWORD ACTFLG_OrphanOnPolicyRemoval = 0x800; // Orphaned when Policy is Removed
const DWORD ACTFLG_UninstallOnPolicyRemoval = 0x1000; // Uninstall when Policy is Removed
const DWORD ACTFLG_InstallUserAssign = 0x2000; // do full install for user assigned app
const DWORD ACTFLG_ForceUpgrade = 0x4000; // require older versions to be upgraded to this version
const DWORD ACTFLG_MinimalInstallUI = 0x8000; // this package only supports minimal UI
const DWORD ACTFLG_ExcludeX86OnWin64 = 0x10000; // this is an x86 package that should not be executed on Win64
const DWORD ACTFLG_IgnoreLanguage = 0x20000; // this package is suitable for any language
const DWORD ACTFLG_HasUpgrades = 0x40000; // this package has upgrades
const DWORD ACTFLG_FullInstallUI = 0x80000; // this package has full install ui instead of basic
const DWORD ACTFLG_PreserveClasses = 0x100000; // preserves classes during a redeploy operation during a redeploy in a domain rename
//
// APPQUERY flags
//
const DWORD APPQUERY_ALL = 1; // retrieves every app object in the class store
const DWORD APPQUERY_ADMINISTRATIVE = 2; // retrieves apps suitable for administration
const DWORD APPQUERY_POLICY = 3; // retrieves apps suitable for policy
const DWORD APPQUERY_USERDISPLAY = 4; // retrieves apps suitable for display to the user
const DWORD APPQUERY_RSOP_LOGGING = 5; // retrieves apps to be logged by RSOP
const DWORD APPQUERY_RSOP_ARP = 6; // retrieves apps to be logged by RSOP
// upgrade type flags
const DWORD UPGFLG_Uninstall = 0x1; // The app upgrades this script and requires an Uninstall
const DWORD UPGFLG_NoUninstall = 0x2; // The app upgrades this script and does not require an Uninstall
const DWORD UPGFLG_UpgradedBy = 0x4; // This is an UpgradedBy relationship. The application is upgraded
const DWORD UPGFLG_Enforced = 0x8; // autodetected upgrades.
// types of package formats
typedef [v1_enum] enum _CLASSPATHTYPE {
ExeNamePath,
DllNamePath,
TlbNamePath,
CabFilePath,
InfFilePath,
DrwFilePath,
SetupNamePath
} CLASSPATHTYPE;
typedef struct tagUPGRADEINFO {
LPOLESTR szClassStore;
GUID PackageGuid;
GUID GpoId;
DWORD Flag;
} UPGRADEINFO;
const DWORD CLSCTX64_INPROC_SERVER = 0x10000000;
const DWORD CLSCTX64_INPROC_HANDLER = 0x20000000;
typedef struct tagCLASSDETAIL {
CLSID Clsid;
CLSID TreatAs;
DWORD dwComClassContext;
DWORD cProgId;
DWORD cMaxProgId;
[size_is(cProgId)] LPOLESTR *prgProgId;
} CLASSDETAIL;
//
// PACKAGEDETAIL structure
//
typedef struct tagACTVATIONINFO
{
UINT cClasses;
[size_is(cClasses)] CLASSDETAIL *pClasses;
UINT cShellFileExt;
[size_is(cShellFileExt)] LPOLESTR *prgShellFileExt;
[size_is(cShellFileExt)] UINT *prgPriority;
UINT cInterfaces;
[size_is(cInterfaces)] IID *prgInterfaceId;
UINT cTypeLib;
[size_is(cTypeLib)] GUID *prgTlbId;
BOOL bHasClasses;
} ACTIVATIONINFO;
typedef struct tagINSTALLINFO
{
DWORD dwActFlags;
CLASSPATHTYPE PathType;
LPOLESTR pszScriptPath;
LPOLESTR pszSetupCommand;
LPOLESTR pszUrl;
ULONGLONG Usn;
UINT InstallUiLevel;
GUID *pClsid;
GUID ProductCode;
GUID PackageGuid;
GUID Mvipc;
DWORD dwVersionHi;
DWORD dwVersionLo;
DWORD dwRevision;
UINT cUpgrades;
[size_is(cUpgrades)] UPGRADEINFO *prgUpgradeInfoList;
ULONG cScriptLen;
} INSTALLINFO;
typedef struct tagPLATFORMINFO
{
UINT cPlatforms;
[size_is(cPlatforms)] CSPLATFORM *prgPlatform;
UINT cLocales;
[size_is(cLocales)] LCID *prgLocale;
} PLATFORMINFO;
typedef struct tagPACKAGEDETAIL
{
LPOLESTR pszPackageName;
LPOLESTR pszPublisher;
UINT cSources;
[size_is(cSources)] LPOLESTR *pszSourceList;
UINT cCategories;
[size_is(cCategories)] GUID *rpCategory;
ACTIVATIONINFO *pActInfo;
PLATFORMINFO *pPlatformInfo;
INSTALLINFO *pInstallInfo;
} PACKAGEDETAIL;
//+---------------------------------------------------------------------------
// Contents: Enum Interfaces for Class Store
//----------------------------------------------------------------------------
cpp_quote("#ifndef _LPCSADMNENUM_DEFINED")
cpp_quote("#define _LPCSADMNENUM_DEFINED")
typedef struct tagPACKAGEDISPINFO
{
LPOLESTR pszPackageName;
DWORD dwActFlags;
CLASSPATHTYPE PathType;
LPOLESTR pszScriptPath;
LPOLESTR pszPublisher;
LPOLESTR pszUrl;
UINT InstallUiLevel;
GUID ProductCode;
GUID PackageGuid;
ULONGLONG Usn;
DWORD dwVersionHi;
DWORD dwVersionLo;
DWORD dwRevision;
GUID GpoId;
UINT cUpgrades;
[size_is(cUpgrades)] UPGRADEINFO *prgUpgradeInfoList;
LANGID LangId;
BYTE* rgSecurityDescriptor;
UINT cbSecurityDescriptor;
WCHAR* pszGpoPath;
DWORD MatchedArchitecture;
UINT cArchitectures;
[size_is(cArchitectures)] DWORD* prgArchitectures;
UINT cTransforms;
[size_is(cTransforms)] LPOLESTR* prgTransforms;
UINT cCategories;
[size_is(cTransforms)] LPOLESTR* prgCategories;
} PACKAGEDISPINFO;
//
// IEnumPackage
// ============
//
[
local,
object,
uuid(00000193-0000-0000-C000-000000000046)
]
interface IEnumPackage : IUnknown
{
//---- Next()
//
// Arguments: celt number of elements to fetch
// pceltFetched number fetched
// rgelt contents of fetch
//
// Returns: S_OK
// S_FALSE (Not enough elements fetched.)
HRESULT Next(
[in] ULONG celt,
[out, size_is(celt), length_is(*pceltFetched)] PACKAGEDISPINFO *rgelt,
[out] ULONG *pceltFetched);
//---- Skip()
//
// Arguments: celt number of elements to skip.
//
// Returns: S_OK
// S_FALSE (Not enough elements skipped.)
HRESULT Skip(
[in] ULONG celt);
//---- Reset()
HRESULT Reset();
// The clone method is unneeded and thus not implemented
// HRESULT Clone(
// [out] IEnumPackage **ppenum);
}
cpp_quote("#endif")
//----------------------------------------------------------------------------
// The Class Store Access Interface.
//----------------------------------------------------------------------------
[
local,
object,
uuid(00000190-0000-0000-C000-000000000046)
]
interface IClassAccess : IUnknown
{
// GetAppInfo
//
// Class Store look up method used by OLE and Shell for auto install of missing
// apps and components.
//
HRESULT GetAppInfo(
[in] uCLSSPEC * pClassSpec, // Class Spec (CLSID/Ext/MIME)
[in] QUERYCONTEXT * pQryContext, // Query Attributes
[out] PACKAGEDISPINFO * pPackageInfo
);
//
// EnumPackages
//
// Class Store package enumeration.
// This method returns an Enumerator for the list of application
// packages in the class store.
//
HRESULT EnumPackages (
[in, unique] LPOLESTR pszPackageName,
[in, unique] GUID *pCategory,
[in, unique] ULONGLONG *pLastUsn,
[in] DWORD dwAppFlags,
[out] IEnumPackage **ppIEnumPackage
);
HRESULT SetClassStorePath (
[in, unique] LPOLESTR pszClassStorePath,
[in, unique] void* pRsopUserToken
);
}
//----------------------------------------------------------------------------
// The Class Store Admin Interface.
//----------------------------------------------------------------------------
//
// IClassAdmin
// ===========
//
[
local,
object,
uuid(00000191-0000-0000-C000-000000000046)
]
interface IClassAdmin : IUnknown
{
HRESULT GetGPOInfo(
[out] GUID *pGPOId,
[out] LPOLESTR *pszPolicyName
);
HRESULT AddPackage(
[in] PACKAGEDETAIL *pPackageDetail,
[out] GUID *pPkgGuid
);
HRESULT RemovePackage(
[in] LPOLESTR pszPackageName,
[in] DWORD dwFlags
);
HRESULT ChangePackageProperties(
[in] LPOLESTR pszPackageName,
[in, unique] LPOLESTR pszNewName,
[in, unique] DWORD *pdwFlags,
[in, unique] LPOLESTR pszUrl,
[in, unique] LPOLESTR pszScriptPath,
[in, unique] UINT *pInstallUiLevel,
[in, unique] DWORD *pdwRevision
);
HRESULT ChangePackageCategories(
[in] LPOLESTR pszPackageName,
[in] UINT cCategories,
[in, size_is(cCategories), unique] GUID *rpCategory
);
HRESULT ChangePackageSourceList(
[in] LPOLESTR pszPackageName,
[in] UINT cSources,
[in, size_is(cSources), unique] LPOLESTR *pszSourceList
);
HRESULT ChangePackageUpgradeList(
[in] LPOLESTR pszPackageName,
[in] UINT cUpgrades,
[in, size_is(cUpgrades), unique] UPGRADEINFO *prgUpgradeInfoList
);
HRESULT ChangePackageUpgradeInfoIncremental(
[in] GUID PkgGuid,
[in] UPGRADEINFO UpgradeInfo,
[in] DWORD OpFlags
);
HRESULT SetPriorityByFileExt(
[in] LPOLESTR pszPackageName,
[in] LPOLESTR pszFileExt,
[in] UINT Priority
);
HRESULT EnumPackages(
[in, unique] LPOLESTR pszFileExt,
[in, unique] GUID *pCategory,
[in] DWORD dwAppFlags,
[in, unique] DWORD *pdwLocale,
[in, unique] CSPLATFORM *pPlatform,
[out] IEnumPackage **ppIEnumPackage
);
HRESULT GetPackageDetails (
[in] LPOLESTR pszPackageName,
[out] PACKAGEDETAIL *pPackageDetail
);
HRESULT GetPackageDetailsFromGuid (
[in] GUID PkgGuid,
[out] PACKAGEDETAIL *pPackageDetail
);
HRESULT GetAppCategories (
[in] LCID Locale,
[out] APPCATEGORYINFOLIST *pAppCategoryList
);
HRESULT RegisterAppCategory (
[in] APPCATEGORYINFO *pAppCategory
);
HRESULT UnregisterAppCategory (
[in] GUID *pAppCategoryId
);
HRESULT Cleanup (
[in] FILETIME *pTimeBefore
);
HRESULT GetDNFromPackageName(
[in] LPOLESTR pszPackageName,
[out] LPOLESTR *szDN
);
HRESULT RedeployPackage(
[in] GUID *pPackageGuid,
[in] PACKAGEDETAIL *pPackageDetail
);
}
cpp_quote("//------------------------- Priorities and weights")
cpp_quote("")
cpp_quote("// ")
cpp_quote("// File Extension priority")
cpp_quote("// ")
cpp_quote("// 1 bit (0)")
cpp_quote("//")
cpp_quote("#define PRI_EXTN_FACTOR (1 << 0)")
cpp_quote("")
cpp_quote("//")
cpp_quote("// CLSCTX priority")
cpp_quote("//")
cpp_quote("// 2 bits (7:8)")
cpp_quote("//")
cpp_quote("#define PRI_CLSID_INPSVR (3 << 7)")
cpp_quote("#define PRI_CLSID_LCLSVR (2 << 7)")
cpp_quote("#define PRI_CLSID_REMSVR (1 << 7)")
cpp_quote("")
cpp_quote("//")
cpp_quote("// UI Language priority")
cpp_quote("//")
cpp_quote("// 3 bits (9:11)")
cpp_quote("//")
cpp_quote("#define PRI_LANG_ALWAYSMATCH (4 << 9)")
cpp_quote("#define PRI_LANG_SYSTEMLOCALE (3 << 9)")
cpp_quote("#define PRI_LANG_ENGLISH (2 << 9)")
cpp_quote("#define PRI_LANG_NEUTRAL (1 << 9)")
cpp_quote("")
cpp_quote("//")
cpp_quote("// Architecture priority")
cpp_quote("//")
cpp_quote("// 2 bits (12:13)")
cpp_quote("//")
cpp_quote("#define PRI_ARCH_PREF1 (2 << 12)")
cpp_quote("#define PRI_ARCH_PREF2 (1 << 12)")