#include <olectl.h>

import "oaidl.idl";
import "ocidl.idl";
#ifndef DISPID_LISTITEM
#define DISPID_LISTITEM     0
#endif

#ifndef DISPID_NEWENUM
#define DISPID_NEWENUM      (-4)
#endif

// Create a non standard disp ID for length which is the Java equivalent to Count
#ifndef DISPID_COLLCOUNT
#define DISPID_COLLCOUNT    (-530)
#endif

// A macro to create the standard collection Methods & Properties: Item, Count, length & _NewEnum
// Count and length return the same thing but one is geared towards VB/Automation
// collections (COUNT) and the other towards Java/JScript (length).
#define COLLECTION_METHODS( type, strHelp ) \
    [propget, id(DISPID_LISTITEM), helpstring(strHelp)] HRESULT \
    Item([in] const VARIANT varIndex, [out, retval] type *pVal);         \
    [propget, id(DISPID_LISTCOUNT), helpstring("Retrieves the number of items in the collection.")] HRESULT \
    Count([out, retval] long *pVal); \
    [propget, id(DISPID_COLLCOUNT), helpstring("Retrieves the number of items in the collection.")] HRESULT \
    length([out, retval] long *pVal); \
    [propget, id(DISPID_NEWENUM), restricted, hidden] HRESULT \
    _NewEnum([out, retval] IUnknown* *pVal);

/*
 * Errors
 */

cpp_quote("#define FACILITY_THINAPPSDK 0xc42")

cpp_quote("#define MAKE_THINAPPSDKHR(Sev, Code) MAKE_HRESULT((Sev), FACILITY_THINAPPSDK, (Code))")
cpp_quote("#define MAKE_THINAPPSDKHR_ERR(Code)  MAKE_THINAPPSDKHR(SEVERITY_ERROR, (Code))")

cpp_quote("#define THINAPPSDK_ERR_UNINSTALLED           MAKE_THINAPPSDKHR_ERR(0x0001)")
cpp_quote("#define THINAPPSDK_ERR_INTERNAL_API_FAILED   MAKE_THINAPPSDKHR_ERR(0x0002)")
cpp_quote("#define THINAPPSDK_ERR_PACKAGE_TYPE_MISMATCH MAKE_THINAPPSDKHR_ERR(0x0003)")
cpp_quote("#define THINAPPSDK_ERR_VERIFY_TOO_SMALL      MAKE_THINAPPSDKHR_ERR(0x0004)")
cpp_quote("#define THINAPPSDK_ERR_APPSYNC_FAILED        MAKE_THINAPPSDKHR_ERR(0x0005)")
cpp_quote("#define THINAPPSDK_ERR_NO_PERUSER_THINDIRECT MAKE_THINAPPSDKHR_ERR(0x0006)")

[
uuid(E3F97F12-A364-4CC2-A687-20082EF07D0F),
helpstring("ThinApp SDK Type Library"),
version(1.0)
]
library ThinAppSDK
{
	typedef [public] enum tagTHINAPP_TYPE
	{
		[helpstring("Not a ThinApp package")]                      THINAPP_TYPE_UNKNOWN             = 0,
		[helpstring("ThinApp main data container")]                THINAPP_TYPE_MAIN_DATA_CONTAINER = 1,
		[helpstring("ThinApp shortcut executable")]                THINAPP_TYPE_SHORTCUT_EXE        = 2,
		[helpstring("ThinApp .msi containing virtual package")]    THINAPP_TYPE_THICK_MSI           = 3,
		[helpstring("ThinApp .msi containing shortcut info only")] THINAPP_TYPE_THIN_MSI            = 4,
		[helpstring("ThinApp 4.0.1 or older .msi")]                THINAPP_TYPE_OLD_MSI             = 5,
	}
	THINAPP_TYPE;

	typedef [public] enum tagTHINAPP_HASH_TYPE
	{
		[helpstring("MD5 hash")]   THINAPP_HASH_TYPE_MD5  = 0,
		[helpstring("SHA-1 hash")] THINAPP_HASH_TYPE_SHA1 = 1,
	}
	THINAPP_HASH_TYPE;

	typedef [public] enum tagTHINAPP_REGISTER_FLAGS
	{
		[helpstring("Register per user, if not present register per machine (all users)")] THINAPP_REGISTER_PERUSER          = 1,
		[helpstring("Don't register in Add/Remove Programs")]                              THINAPP_REGISTER_NOARP            = 2,
		[helpstring("Don't unregister apps for which the user is no longer authorized")]   THINAPP_REGISTER_KEEPUNAUTHORIZED = 4,
		[helpstring("Re-create all shortcuts and registry keys")]                          THINAPP_REGISTER_REREGISTER       = 8,
		[helpstring("Don't refresh the desktop upon completion")]                          THINAPP_REGISTER_NODESKTOPREFRESH = 32,
	}
	THINAPP_REGISTER_FLAGS;

   typedef [public] enum tagTHINAPP_UNREGISTER_FLAGS
   {
		[helpstring("Suppress error messages")] THINAPP_UNREGISTER_QUIET = 16,
   }
   THINAPP_UNREGISTER_FLAGS;

	typedef [public] enum tagTHINAPP_APPSYNC_FLAGS
	{
		[helpstring("Show a progress dialog")] THINAPP_APPSYNC_SHOW_PROGRESS = 1,
	}
	THINAPP_APPSYNC_FLAGS;

	typedef [public] enum tagTHINAPP_VERIFYCONTENTS_TYPE
	{
		[helpstring("Exact match")] THINAPP_VERIFYCONTENTS_EXACT = 1,
		[helpstring("Match regular expression")] THINAPP_VERIFYCONTENTS_REGEXP = 2
	}
	THINAPP_VERIFYCONTENTS_TYPE;

	interface IThinApp_Packages;
	interface IThinApp_VFolder;
	interface IThinApp_VFolders;
	interface IThinApp_VRegKeys;

	//  Primary dispatch interface for IThinApp_VFile
	[uuid(ADF62A0D-982C-4DB9-A678-293183342124), oleautomation, dual, nonextensible]
	interface IThinApp_VFile : IDispatch
	{
		[propget, helpstring("Return the attributes of the file"), id(1024)]
			HRESULT Attributes([out, retval] long *Attributes);
		[propget, helpstring("Return the date the file was created"), id(1025)]
			HRESULT DateCreated([out, retval] DATE *DateCreated);
		[propget, helpstring("Return the date the file was last accessed"), id(1026)]
			HRESULT DateLastAccessed([out, retval] DATE *DateLastAccessed);
		[propget, helpstring("Return the date the file was last modified"), id(1027)]
			HRESULT DateLastModified([out, retval] DATE *DateLastModified);
		[propget, helpstring("Return the version of the file"), id(1028)]
			HRESULT FileVersion([out, retval] BSTR *FileVersion);
		[propget, helpstring("Return the internal name from the version information"), id(1029)]
			HRESULT InternalName([out, retval] BSTR *InternalName);
		[propget, helpstring("Return the language from the version information"), id(1030)]
			HRESULT Language([out, retval] BSTR *Language);
		[propget, helpstring("Return the manufacturer from the version information"), id(1031)]
			HRESULT Manufacturer([out, retval] BSTR *Manufacturer);
		[propget, helpstring("Return the name of the file"), id(1032)]
			HRESULT Name([out, retval] BSTR *Name);
		[propget, helpstring("Return a ThinApp.VFolder object representing the parent of the file"), id(1033)]
			HRESULT ParentFolder([out, retval] IThinApp_VFolder **ParentFolder);
		[propget, helpstring("Return the full path name (in macro format) of the file"), id(1034)]
			HRESULT Path([out, retval] BSTR *Path);
		[propget, helpstring("Return the product name from the version information"), id(1035)]
			HRESULT ProductName([out, retval] BSTR *ProductName);
		[propget, helpstring("Return the product version from the version information"), id(1036)]
			HRESULT ProductVersion([out, retval] BSTR *ProductVersion);
		[propget, helpstring("Return the ThinApp-style short (8.3) name of the file"), id(1037)]
			HRESULT ShortName([out, retval] BSTR *ShortName);
		[propget, helpstring("Return the ThinApp-style short (8.3) path of the file"), id(1038)]
			HRESULT ShortPath([out, retval] BSTR *ShortPath);
		[propget, helpstring("Return the size of the file, in bytes"), id(1039)]
			HRESULT Size([out, retval] unsigned hyper *Size);
		[propget, helpstring("Return the translation key from the version information"), id(1040)]
			HRESULT TranslationKey([out, retval] BSTR *TranslationKey);
		[propget, helpstring("Return the type of the file, based on its extension"), id(1041)]
			HRESULT Type([out, retval] BSTR *Type);

		[helpstring("Return a hash of the file contents"), id(1042)]
			HRESULT GetHash([in] THINAPP_HASH_TYPE HashType, [out, retval] BSTR *Hash);
		[helpstring("Verify if the contents of the file at the offset given matches Expected"), id(1043)]
			HRESULT VerifyContents([in] hyper Offset, [in] VARIANT Expected, THINAPP_VERIFYCONTENTS_TYPE MatchType, [out, retval] boolean *Matches);
	};

	//  Primary dispatch interface for IThinApp_VFiles
	[uuid(4C23084D-48EF-410D-8493-A1FB5C1A2031), oleautomation, dual]
	interface IThinApp_VFiles : IDispatch
	{
		COLLECTION_METHODS(IThinApp_VFile *, "Get a file from the collection")
	};

	//  Primary dispatch interface for IThinApp_VFolder
	[uuid(8601A548-D939-4BEC-85C1-0D640DE71B4C), oleautomation, dual, nonextensible]
	interface IThinApp_VFolder : IDispatch
	{
		[propget, helpstring("Return the attributes of the folder"), id(1024)]
			HRESULT Attributes([out, retval] long *Attributes);
		[propget, helpstring("Return the date the folder was created"), id(1025)]
			HRESULT DateCreated([out, retval] DATE *DateCreated);
		[propget, helpstring("Return the date the folder was last accessed"), id(1026)]
			HRESULT DateLastAccessed([out, retval] DATE *DateLastAccessed);
		[propget, helpstring("Return the date the folder was last modified"), id(1027)]
			HRESULT DateLastModified([out, retval] DATE *DateLastModified);
		[propget, helpstring("Return a collection of ThinApp.VFile objects for all the files stored in the folder"), id(1028)]
			HRESULT Files([out, retval] IThinApp_VFiles **Files);
		[propget, helpstring("Check if this folder is the root folder of the virtual file system"), id(1029)]
			HRESULT IsRootFolder([out, retval] boolean *IsRootFolder);
		[propget, helpstring("Return the name of the folder"), id(1030)]
			HRESULT Name([out, retval] BSTR *Name);
		[propget, helpstring("Return a ThinApp.VFolder object representing the parent of the folder"), id(1031)]
			HRESULT ParentFolder([out, retval] IThinApp_VFolder **ParentFolder);
		[propget, helpstring("Return the full path name (in macro format) of the file"), id(1032)]
			HRESULT Path([out, retval] BSTR *Path);
		[propget, helpstring("Return the ThinApp-style short (8.3) name of the file"), id(1033)]
			HRESULT ShortName([out, retval] BSTR *ShortName);
		[propget, helpstring("Return the ThinApp-style short (8.3) path of the file"), id(1034)]
			HRESULT ShortPath([out, retval] BSTR *ShortPath);
		[propget, helpstring("Return the size of all files in the folder and subfolders, in bytes"), id(1035)]
			HRESULT Size([out, retval] unsigned hyper *Size);
		[propget, helpstring("Return a collection of ThinApp.VFolder objects for all subfolders"), id(1036)]
			HRESULT SubFolders([out, retval] IThinApp_VFolders **SubFolders);

		[helpstring("Returns a collection of ThinApp.VFile objects for all the files in this folder with a given extension"), id(1037)]
			HRESULT GetFilesByExtension([in] BSTR Extension, [out, retval] IThinApp_VFiles **Files);
	};

	//  Primary dispatch interface for IThinApp_VFolders
	[uuid(B498C448-05A3-4d5b-9B4E-FB8427DD9E2D), oleautomation, dual]
	interface IThinApp_VFolders : IDispatch
	{
		COLLECTION_METHODS(IThinApp_VFolder *, "Get a folder from the collection")
	};

	//  Primary dispatch interface for IThinApp_VFileSystemObject
	[uuid(7ADFD2AD-E19D-4B1E-9C71-ADBB474E3962), oleautomation, dual, nonextensible]
	interface IThinApp_VFileSystemObject : IDispatch
	{
		[helpstring("Constructs a new path name by appending a name to a path"), id(1024)]
			HRESULT BuildPath([in] BSTR OldPath, [in] BSTR Name, [out, retval] BSTR *NewPath);
		[helpstring("Check if a drive exists in the virtual file system"), id(1025)]
			HRESULT DriveExists([in] BSTR DriveSpec, [out, retval] boolean *Exists);
		[helpstring("Check if a file exists in the virtual file system"), id(1026)]
			HRESULT FileExists([in] BSTR MacroFileSpec, [out, retval] boolean *Exists);
		[helpstring("Check if a folder exists in the virtual file system"), id(1027)]
			HRESULT FolderExists([in] BSTR MacroFileSpec, [out, retval] boolean *Exists);
		[helpstring("Return the base part (the name without extension or path) of a file name"), id(1028)]
			HRESULT GetBaseName([in] BSTR FileSpec, [out, retval] BSTR *BaseName);
		[helpstring("Return the extension part of a file name"), id(1029)]
			HRESULT GetExtensionName([in] BSTR FileSpec, [out, retval] BSTR *ExtensionName);
		[helpstring("Return a ThinApp.VFile object for the file specified"), id(1030)]
			HRESULT GetFile([in] BSTR MacroFileSpec, [out, retval] IThinApp_VFile **File);
		[helpstring("Return the file name part from a full path specification"), id(1032)]
			HRESULT GetFileName([in] BSTR FileSpec, [out, retval] BSTR *FileName);
		[helpstring("Return the version of the file specified"), id(1033)]
			HRESULT GetFileVersion([in] BSTR MacroFileSpec, [out, retval] BSTR *Version);
		[helpstring("Return a ThinApp.VFolder object for the folder specified"), id(1034)]
			HRESULT GetFolder([in] BSTR MacroFileSpec, [out, retval] IThinApp_VFolder **Folder);
		[helpstring("Return the name of the parent folder for the file/folder specified"), id(1035)]
			HRESULT GetParentFolderName([in] BSTR FileSpec, [out, retval] BSTR *ParentFolderName);
	};

	//  Primary dispatch interface for IThinApp_VRegValue
	[uuid(D91E24D7-8824-4C3F-9F80-0AF851B20A38), oleautomation, dual, nonextensible]
	interface IThinApp_VRegValue : IDispatch
	{
		[propget, helpstring("Return the name of the value"), id(1024)]
			HRESULT Name([out, retval] BSTR *Name);
		[propget, helpstring("Return the type of the value"), id(1025)]
			HRESULT Type([out, retval] long *Type);
		[propget, helpstring("Return the data of the value"), id(1026)]
			HRESULT Data([out, retval] VARIANT *Value);
	};

	//  Primary dispatch interface for IThinApp_VRegValues
	[uuid(76B5E3C9-7FE0-439C-8B34-F238A3953200), oleautomation, dual]
	interface IThinApp_VRegValues : IDispatch
	{
		COLLECTION_METHODS(IThinApp_VRegValue *, "Get a registry value from the collection")
	};

	//  Primary dispatch interface for IThinApp_VRegKey
	[uuid(E4F15EA3-299B-4665-89BC-DCF8617F4030), oleautomation, dual, nonextensible]
	interface IThinApp_VRegKey : IDispatch
	{
		[propget, helpstring("Return a collection of ThinApp.VRegKey objects for all subkeys"), id(1024)]
			HRESULT SubKeys([out, retval] IThinApp_VRegKeys **SubKeys);
		[propget, helpstring("Return a collection of ThinApp.VRegValue objects for all values of this key"), id(1025)]
			HRESULT Values([out, retval] IThinApp_VRegValues **Values);
	};

	//  Primary dispatch interface for IThinApp_VRegKey2
	[uuid(0E712873-42B4-4ECD-BAFE-B8F800576ED9), oleautomation, dual, nonextensible]
	interface IThinApp_VRegKey2 : IThinApp_VRegKey
	{
		[propget, helpstring("Return the name of the key"), id(1026)]
			HRESULT Name([out, retval] BSTR *Name);
	};

	//  Primary dispatch interface for IThinApp_VRegKeys
	[uuid(62A14BBB-01CB-4F59-956F-F726D47C3389), oleautomation, dual]
	interface IThinApp_VRegKeys : IDispatch
	{
		COLLECTION_METHODS(IThinApp_VRegKey *, "Get a registry key from the collection")
	};

	//  Primary dispatch interface for IThinApp_VRegistryObject
	[uuid(CB7383C6-9F9F-47C1-8F06-C4E3997BE652), oleautomation, dual, nonextensible]
	interface IThinApp_VRegistryObject : IDispatch
	{
		[helpstring("Returns a ThinApp.VRegKey object for the specified key"), id(1024)]
			HRESULT OpenKey([in] BSTR Base, [in] BSTR KeyPath, [out, retval] IThinApp_VRegKey **Key);
	}

	//  Primary dispatch interface for IThinApp_Option
	[uuid(FCAE9FBF-FB9E-4BE0-A53A-104FC1DFBEB6), oleautomation, dual, nonextensible]
	interface IThinApp_Option : IDispatch
	{
		[propget, helpstring("Return the name of the option"), id(1024)]
			HRESULT Name([out, retval] BSTR *Name);
		[propget, helpstring("Return the value name of the option"), id(1025)]
			HRESULT Value([out, retval] BSTR *Value);
	};

	//  Primary dispatch interface for IThinApp_Options
	[uuid(F4ED0ED0-962C-4734-9608-92820C89C573), oleautomation, dual]
	interface IThinApp_Options : IDispatch
	{
		COLLECTION_METHODS(IThinApp_Option *, "Get an option from the collection")
	};

	//  Primary dispatch interface for IThinApp_Package
	[uuid(B8A7A75F-867F-42C5-9645-ACEC7FCAE91D), oleautomation, dual, nonextensible]
	interface IThinApp_Package : IDispatch
	{
		[propget, helpstring("Return the inventory name of this package"), id(1024)]
			HRESULT InventoryName([out, retval] BSTR *InventoryName);
		[propget, helpstring("Return the name of the primary data container for this package"), id(1025)]
			HRESULT MainDataContainer([out, retval] BSTR *MainDataContainer);
		[propget, helpstring("Return MSI version number of this package"), id(1026)]
			HRESULT MSIVersion([out, retval] BSTR *MSIVersion);
		[propget, helpstring("Return the ThinApp type of this package"), id(1027)]
			HRESULT ThinAppType([out, retval] THINAPP_TYPE *ThinAppType);
		[propget, helpstring("Return the ThinApp version used to create this package"), id(1028)]
			HRESULT ThinAppVersion([out, retval] BSTR *ThinAppVersion);

		[helpstring("Indicates whether an AppSync update is available"), id(1029)]
			HRESULT AppSyncUpdateAvailable([in] VARIANT AppSyncURL, [out, retval] boolean *Available);
		[helpstring("Return a collection of ThinApp.Option objects"), id(1032)]
			HRESULT GetOptions([out, retval] IThinApp_Options **Options);
		[helpstring("Return a collection of ThinApp.Package objects for all optional AppLinks"), id(1033)]
			HRESULT GetOptionalAppLinks([in] BSTR AppLinkPath, [out, retval] IThinApp_Packages **OptionalAppLinks);
		[helpstring("Return a collection of ThinApp.Package objects for all required AppLinks"), id(1034)]
			HRESULT GetRequiredAppLinks([in] BSTR AppLinkPath, [out, retval] IThinApp_Packages **RequiredAppLinks);
		[helpstring("Return a semicolon-separated list of shortcuts for this package"), id(1035)]
			HRESULT GetShortcutList([out, retval] BSTR *ShortcutList);
		[helpstring("Return a ThinApp.VFileSystemObject"), id(1036)]
			HRESULT GetVFileSystemObject([in] long Reserved, [out, retval] IThinApp_VFileSystemObject **VFileSystemObject);
		[helpstring("Return a ThinApp.VRegistryObject"), id(1037)]
			HRESULT GetVRegistryObject([in] long Reserved, [out, retval] IThinApp_VRegistryObject **VRegistryObject);
		[helpstring("Expands a macro and returns the full path"), id(1038)]
			HRESULT MacroToPath([in] BSTR MacroFileSpec, [out, retval] BSTR *FileSpec);
		[helpstring("Converts a path to its macro form"), id(1039)]
			HRESULT PathToMacro([in] BSTR FileSpec, [out, retval] BSTR *MacroFileSpec);
		[helpstring("Retrieves the icon for the main data container, a shortcut executable or the package as a whole and stores it in a .ico file"), id(1040)]
			HRESULT RetrieveIcon([in] BSTR IconFileName, [in] VARIANT FileName);
		[helpstring("Extract files from a thick MSI and install them on a workstation"), id(1041)]
			HRESULT Install([in] VARIANT InstallDir, [in] long Flags);
		[helpstring("Install the shortcuts file type associations etc. on a workstation"), id(1042)]
			HRESULT Register([in] long Flags);
		[helpstring("Unregister shortcuts, file type associations etc."), id(1043)]
		  HRESULT Unregister();
		[helpstring("Uninstall a package from a workstation"), id(1044)]
			HRESULT Uninstall();
		[helpstring("Update the package if an update is available"), id(1045)]
			HRESULT AppSync([in] long Flags, [in] VARIANT AppSyncURL);
	};

	//  Primary dispatch interface for IThinApp_Package2
	[uuid(99FDBA5F-1E98-4725-ABBB-51016B2ABA9C), oleautomation, dual, nonextensible]
	interface IThinApp_Package2 : IThinApp_Package
	{
		[helpstring("Unregister shortcuts, file type associations etc."), id(1046)]
		  HRESULT UnregisterEx([in] long Flags);
   };

	//  Primary dispatch interface for IThinApp_Packages
	[uuid(6317B341-4E59-464D-B42A-AEC9D416C2F6), oleautomation, dual]
	interface IThinApp_Packages : IDispatch
	{
		COLLECTION_METHODS(IThinApp_Package *, "Get a package from the collection")
	};

	//  Primary dispatch interface for IThinApp_Management
	[uuid(6D52EC83-0257-418C-9F18-B3AB13D2E90D), oleautomation, dual, nonextensible]
	interface IThinApp_Management : IDispatch
	{
		[helpstring("Return the ThinApp type of a file"), id(1024)]
			HRESULT GetThinAppType([in] BSTR FileSpec, [out, retval] THINAPP_TYPE *ThinAppType);
		[helpstring("Return a ThinApp.Package object for the file"), id(1025)]
			HRESULT OpenPackage([in] BSTR FileSpec, [out, retval] IThinApp_Package **Package);
	};

	//  Primary dispatch interface for IThinApp_Management2
	[uuid(D209B6C0-B58A-43E6-BD7A-581AFCF3A055), oleautomation, dual, nonextensible]
	interface IThinApp_Management2 : IThinApp_Management
	{
		[helpstring("Notify shell of changes"), id(1026)]
        HRESULT RefreshDesktop();
   };

	//  Class information for CThinApp_Management
	[uuid(86CB2272-319C-46AC-96DA-430D26EAF6A0)]
	coclass CThinApp_Management
	{
		[default] interface IThinApp_Management2;
	};

	////////////////////////////////////////////////////////////////////////////////
	//
	// Thinstall legacy API. Do not use for new code.
	//

	typedef [public] enum tagIsolationModeType
	{
		[helpstring("Consult sandbox, read-only, and system. system modifications to sandbox")]
			IsolationWriteCopy = 1,
		[helpstring("Consult sandbox, read-only, and system. system modifications to system")]
			IsolationMerged = 2,
		[helpstring("consult sandbox & read-only image")]
			IsolationFull = 3,
		[helpstring("consult sandbox only  (key has been previously deleted)")]
			IsolationSandboxOnly = 4
	} IsolationModeType;

	typedef [public] struct tagThinstallPackageInfo
	{
		DWORD BuildVersionNumber;

		DWORD TotalOptions;
		LPCWSTR *OptionNames, *OptionValues;
	} ThinstallPackageInfo;

	typedef [public] enum tagSandboxStatusFlags
	{
		MachineAppLocalSandboxFound    = 1,
		AppLocalSandboxFound           = 2,
		GlobalMachineLocalSandboxFound = 4,
		GlobalLocalSandboxFound        = 8,
		MachineSandboxFound            = 16,
		UserSandboxFound               = 32,	
		ActiveSandboxIsLocked          = 64
	} SandboxStatusFlags;

	[uuid(6719C5C1-938D-4100-AAA9-1305D15D9154)]
	interface IThinstallLegacyApi : IClassFactory
	{
		HRESULT CreateTextRegistryFile(LPCWSTR ProjectLocation, HKEY base, HANDLE *UnicodeTextFile);
		HRESULT WriteRegistrySubkeyFromMacrovisionsprintf(HANDLE UnicodeTextFile, LPCWSTR Subkey, IsolationModeType Isolation);
		HRESULT WriteRegistryValueFromMacrovisionsprintf(HANDLE UnicodeTextFile, LPCWSTR ValueName, DWORD ValueType, LPCWSTR ValueData);
		HRESULT CloseTextRegistryFile(HANDLE UnicodeTextFile);

		HRESULT GetPackageInfo(LPCWSTR ExePackage, ThinstallPackageInfo *Info, DWORD *InfoSizeInBytes);
		HRESULT LocateSandBoxPath(LPCWSTR ExePackage, LPWSTR ReturnedPath, DWORD *ReturnedPathSizeInChars, DWORD *StatusFlags);
		HRESULT GetProcessInfo(DWORD ProcessID, 
		                       LPWSTR Module0Filename, DWORD Module0FilenameSizeInChars, 
		                       LPWSTR PackageFilename, DWORD PackageFilenameSizeInChars, 
		                       LPWSTR StartEXEFilename, DWORD StartEXEFilenameSizeInChars, 
		                       LPWSTR StartWorkingDirectory, DWORD StartWorkingDirectorySizeInChars);
	};

	//  Class information for CThinstallLegacyApi
	[uuid(B52567E6-42B8-4f24-86E0-85FAB7C2CBB3)]
	coclass CThinstallLegacyApi
	{
		[default] interface IThinstallLegacyApi;
	};

};
