Updating WiX toolset 2.

This commit is contained in:
McMak 2015-04-27 20:01:19 +03:00
parent cb25d8a5ae
commit 157715cb94
199 changed files with 50941 additions and 0 deletions

View file

@ -0,0 +1,700 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="BalBaseBootstrapperApplication.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//-------------------------------------------------------------------------------------------------
#include <windows.h>
#include <msiquery.h>
#include "IBootstrapperEngine.h"
#include "IBootstrapperApplication.h"
#include "balutil.h"
#include "balretry.h"
class CBalBaseBootstrapperApplication : public IBootstrapperApplication
{
public: // IUnknown
virtual STDMETHODIMP QueryInterface(
__in REFIID riid,
__out LPVOID *ppvObject
)
{
if (!ppvObject)
{
return E_INVALIDARG;
}
*ppvObject = NULL;
if (::IsEqualIID(__uuidof(IBootstrapperApplication), riid))
{
*ppvObject = static_cast<IBootstrapperApplication*>(this);
}
else if (::IsEqualIID(IID_IUnknown, riid))
{
*ppvObject = static_cast<IUnknown*>(this);
}
else // no interface for requested iid
{
return E_NOINTERFACE;
}
AddRef();
return S_OK;
}
virtual STDMETHODIMP_(ULONG) AddRef()
{
return ::InterlockedIncrement(&this->m_cReferences);
}
virtual STDMETHODIMP_(ULONG) Release()
{
long l = ::InterlockedDecrement(&this->m_cReferences);
if (0 < l)
{
return l;
}
delete this;
return 0;
}
public: // IBootstrapperApplication
virtual STDMETHODIMP OnStartup()
{
return S_OK;
}
virtual STDMETHODIMP_(int) OnShutdown()
{
return IDNOACTION;
}
virtual STDMETHODIMP_(int) OnSystemShutdown(
__in DWORD dwEndSession,
__in int /*nRecommendation*/
)
{
// Allow requests to shut down when critical or not applying.
if (ENDSESSION_CRITICAL & dwEndSession || !m_fApplying)
{
return IDOK;
}
return IDCANCEL;
}
virtual STDMETHODIMP_(int) OnDetectBegin(
__in BOOL /*fInstalled*/,
__in DWORD /*cPackages*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectForwardCompatibleBundle(
__in_z LPCWSTR /*wzBundleId*/,
__in BOOTSTRAPPER_RELATION_TYPE /*relationType*/,
__in_z LPCWSTR /*wzBundleTag*/,
__in BOOL /*fPerMachine*/,
__in DWORD64 /*dw64Version*/,
__in int nRecommendation
)
{
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(int) OnDetectUpdateBegin(
__in_z LPCWSTR /*wzUpdateLocation*/,
__in int nRecommendation
)
{
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(int) OnDetectUpdate(
__in_z LPCWSTR /*wzUpdateLocation*/,
__in DWORD64 /*dw64Size*/,
__in DWORD64 /*dw64Version*/,
__in_z LPCWSTR /*wzTitle*/,
__in_z LPCWSTR /*wzSummary*/,
__in_z LPCWSTR /*wzContentType*/,
__in_z LPCWSTR /*wzContent*/,
__in int nRecommendation
)
{
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(void) OnDetectUpdateComplete(
__in HRESULT /*hrStatus*/,
__in_z_opt LPCWSTR /*wzUpdateLocation*/
)
{
}
virtual STDMETHODIMP_(int) OnDetectCompatiblePackage(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzCompatiblePackageId*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectPriorBundle(
__in_z LPCWSTR /*wzBundleId*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectPackageBegin(
__in_z LPCWSTR /*wzPackageId*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectRelatedBundle(
__in_z LPCWSTR /*wzBundleId*/,
__in BOOTSTRAPPER_RELATION_TYPE /*relationType*/,
__in_z LPCWSTR /*wzBundleTag*/,
__in BOOL /*fPerMachine*/,
__in DWORD64 /*dw64Version*/,
__in BOOTSTRAPPER_RELATED_OPERATION /*operation*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectRelatedMsiPackage(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzProductCode*/,
__in BOOL /*fPerMachine*/,
__in DWORD64 /*dw64Version*/,
__in BOOTSTRAPPER_RELATED_OPERATION /*operation*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectTargetMsiPackage(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzProductCode*/,
__in BOOTSTRAPPER_PACKAGE_STATE /*patchState*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDetectMsiFeature(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzFeatureId*/,
__in BOOTSTRAPPER_FEATURE_STATE /*state*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(void) OnDetectPackageComplete(
__in_z LPCWSTR /*wzPackageId*/,
__in HRESULT /*hrStatus*/,
__in BOOTSTRAPPER_PACKAGE_STATE /*state*/
)
{
}
virtual STDMETHODIMP_(void) OnDetectComplete(
__in HRESULT /*hrStatus*/
)
{
}
virtual STDMETHODIMP_(int) OnPlanBegin(
__in DWORD /*cPackages*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnPlanRelatedBundle(
__in_z LPCWSTR /*wzBundleId*/,
__inout BOOTSTRAPPER_REQUEST_STATE* /*pRequestedState*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnPlanPackageBegin(
__in_z LPCWSTR /*wzPackageId*/,
__inout BOOTSTRAPPER_REQUEST_STATE* /*pRequestState*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnPlanCompatiblePackage(
__in_z LPCWSTR /*wzPackageId*/,
__inout BOOTSTRAPPER_REQUEST_STATE* /*pRequestedState*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnPlanTargetMsiPackage(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzProductCode*/,
__inout BOOTSTRAPPER_REQUEST_STATE* /*pRequestedState*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnPlanMsiFeature(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzFeatureId*/,
__inout BOOTSTRAPPER_FEATURE_STATE* /*pRequestedState*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(void) OnPlanPackageComplete(
__in_z LPCWSTR /*wzPackageId*/,
__in HRESULT /*hrStatus*/,
__in BOOTSTRAPPER_PACKAGE_STATE /*state*/,
__in BOOTSTRAPPER_REQUEST_STATE /*requested*/,
__in BOOTSTRAPPER_ACTION_STATE /*execute*/,
__in BOOTSTRAPPER_ACTION_STATE /*rollback*/
)
{
}
virtual STDMETHODIMP_(void) OnPlanComplete(
__in HRESULT /*hrStatus*/
)
{
}
virtual STDMETHODIMP_(int) OnApplyBegin()
{
m_fApplying = TRUE;
m_dwProgressPercentage = 0;
m_dwOverallProgressPercentage = 0;
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
// DEPRECATED: this will be merged with OnApplyBegin in wix4.
virtual STDMETHODIMP_(void) OnApplyPhaseCount(
__in DWORD /*dwPhaseCount*/
)
{
}
virtual STDMETHODIMP_(int) OnElevate()
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnRegisterBegin()
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(void) OnRegisterComplete(
__in HRESULT /*hrStatus*/
)
{
return;
}
virtual STDMETHODIMP_(void) OnUnregisterBegin()
{
return;
}
virtual STDMETHODIMP_(void) OnUnregisterComplete(
__in HRESULT /*hrStatus*/
)
{
return;
}
virtual STDMETHODIMP_(int) OnApplyComplete(
__in HRESULT /*hrStatus*/,
__in BOOTSTRAPPER_APPLY_RESTART restart
)
{
m_fApplying = FALSE;
return BOOTSTRAPPER_APPLY_RESTART_REQUIRED == restart ? IDRESTART : CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnCacheBegin()
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnCachePackageBegin(
__in_z LPCWSTR /*wzPackageId*/,
__in DWORD /*cCachePayloads*/,
__in DWORD64 /*dw64PackageCacheSize*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnCacheAcquireBegin(
__in_z LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in BOOTSTRAPPER_CACHE_OPERATION /*operation*/,
__in_z LPCWSTR /*wzSource*/
)
{
BalRetryStartPackage(BALRETRY_TYPE_CACHE, wzPackageOrContainerId, wzPayloadId);
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnCacheAcquireProgress(
__in_z LPCWSTR /*wzPackageOrContainerId*/,
__in_z_opt LPCWSTR /*wzPayloadId*/,
__in DWORD64 /*dw64Progress*/,
__in DWORD64 /*dw64Total*/,
__in DWORD /*dwOverallPercentage*/
)
{
HRESULT hr = S_OK;
int nResult = IDNOACTION;
// Send progress even though we don't update the numbers to at least give the caller an opportunity
// to cancel.
if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
{
hr = m_pEngine->SendEmbeddedProgress(m_dwProgressPercentage, m_dwOverallProgressPercentage, &nResult);
BalExitOnFailure(hr, "Failed to send embedded cache progress.");
}
LExit:
return FAILED(hr) ? IDERROR : CheckCanceled() ? IDCANCEL : nResult;
}
virtual STDMETHODIMP_(int) OnCacheAcquireComplete(
__in_z LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in HRESULT hrStatus,
__in int nRecommendation
)
{
int nResult = CheckCanceled() ? IDCANCEL : BalRetryEndPackage(BALRETRY_TYPE_CACHE, wzPackageOrContainerId, wzPayloadId, hrStatus);
return IDNOACTION == nResult ? nRecommendation : nResult;
}
virtual STDMETHODIMP_(int) OnCacheVerifyBegin(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzPayloadId*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnCacheVerifyComplete(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzPayloadId*/,
__in HRESULT /*hrStatus*/,
__in int nRecommendation
)
{
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(int) OnCachePackageComplete(
__in_z LPCWSTR /*wzPackageId*/,
__in HRESULT /*hrStatus*/,
__in int nRecommendation
)
{
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(void) OnCacheComplete(
__in HRESULT /*hrStatus*/
)
{
}
virtual STDMETHODIMP_(int) OnExecuteBegin(
__in DWORD /*cExecutingPackages*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnExecutePackageBegin(
__in_z LPCWSTR wzPackageId,
__in BOOL fExecute
)
{
// Only track retry on execution (not rollback).
if (fExecute)
{
BalRetryStartPackage(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL);
}
m_fRollingBack = !fExecute;
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnExecutePatchTarget(
__in_z LPCWSTR /*wzPackageId*/,
__in_z LPCWSTR /*wzTargetProductCode*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnError(
__in BOOTSTRAPPER_ERROR_TYPE errorType,
__in_z LPCWSTR wzPackageId,
__in DWORD dwCode,
__in_z LPCWSTR /*wzError*/,
__in DWORD /*dwUIHint*/,
__in DWORD /*cData*/,
__in_ecount_z_opt(cData) LPCWSTR* /*rgwzData*/,
__in int nRecommendation
)
{
BalRetryErrorOccurred(wzPackageId, dwCode);
if (BOOTSTRAPPER_DISPLAY_FULL == m_display)
{
if (BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_SERVER == errorType ||BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_PROXY == errorType)
{
nRecommendation = IDTRYAGAIN;
}
}
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(int) OnProgress(
__in DWORD dwProgressPercentage,
__in DWORD dwOverallProgressPercentage
)
{
HRESULT hr = S_OK;
int nResult = IDNOACTION;
m_dwProgressPercentage = dwProgressPercentage;
m_dwOverallProgressPercentage = dwOverallProgressPercentage;
if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
{
hr = m_pEngine->SendEmbeddedProgress(m_dwProgressPercentage, m_dwOverallProgressPercentage, &nResult);
BalExitOnFailure(hr, "Failed to send embedded overall progress.");
}
LExit:
return FAILED(hr) ? IDERROR : CheckCanceled() ? IDCANCEL : nResult;
}
virtual STDMETHODIMP_(int) OnDownloadPayloadBegin(
__in_z LPCWSTR /*wzPayloadId*/,
__in_z LPCWSTR /*wzPayloadFileName*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnDownloadPayloadComplete(
__in_z LPCWSTR /*wzPayloadId*/,
__in_z LPCWSTR /*wzPayloadFileName*/,
__in HRESULT /*hrStatus*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnExecuteProgress(
__in_z LPCWSTR /*wzPackageId*/,
__in DWORD /*dwProgressPercentage*/,
__in DWORD /*dwOverallProgressPercentage*/
)
{
HRESULT hr = S_OK;
int nResult = IDNOACTION;
// Send progress even though we don't update the numbers to at least give the caller an opportunity
// to cancel.
if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
{
hr = m_pEngine->SendEmbeddedProgress(m_dwProgressPercentage, m_dwOverallProgressPercentage, &nResult);
BalExitOnFailure(hr, "Failed to send embedded execute progress.");
}
LExit:
return FAILED(hr) ? IDERROR : CheckCanceled() ? IDCANCEL : nResult;
}
virtual STDMETHODIMP_(int) OnExecuteMsiMessage(
__in_z LPCWSTR /*wzPackageId*/,
__in INSTALLMESSAGE /*mt*/,
__in UINT /*uiFlags*/,
__in_z LPCWSTR /*wzMessage*/,
__in DWORD /*cData*/,
__in_ecount_z_opt(cData) LPCWSTR* /*rgwzData*/,
__in int nRecommendation
)
{
return CheckCanceled() ? IDCANCEL : nRecommendation;
}
virtual STDMETHODIMP_(int) OnExecuteFilesInUse(
__in_z LPCWSTR /*wzPackageId*/,
__in DWORD /*cFiles*/,
__in_ecount_z(cFiles) LPCWSTR* /*rgwzFiles*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnExecutePackageComplete(
__in_z LPCWSTR wzPackageId,
__in HRESULT hrExitCode,
__in BOOTSTRAPPER_APPLY_RESTART /*restart*/,
__in int nRecommendation
)
{
int nResult = CheckCanceled() ? IDCANCEL : CheckCanceled() ? IDCANCEL : BalRetryEndPackage(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL, hrExitCode);
return IDNOACTION == nResult ? nRecommendation : nResult;
}
virtual STDMETHODIMP_(void) OnExecuteComplete(
__in HRESULT /*hrStatus*/
)
{
}
virtual STDMETHODIMP_(int) OnResolveSource(
__in_z LPCWSTR /*wzPackageOrContainerId*/,
__in_z_opt LPCWSTR /*wzPayloadId*/,
__in_z LPCWSTR /*wzLocalSource*/,
__in_z_opt LPCWSTR /*wzDownloadSource*/
)
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(int) OnLaunchApprovedExeBegin()
{
return CheckCanceled() ? IDCANCEL : IDNOACTION;
}
virtual STDMETHODIMP_(void) OnLaunchApprovedExeComplete(
__in HRESULT /*hrStatus*/,
__in DWORD /*dwProcessId*/
)
{
}
protected:
//
// PromptCancel - prompts the user to close (if not forced).
//
virtual BOOL PromptCancel(
__in HWND hWnd,
__in BOOL fForceCancel,
__in_z LPCWSTR wzMessage,
__in_z LPCWSTR wzCaption
)
{
::EnterCriticalSection(&m_csCanceled);
// Only prompt the user to close if we have not canceled already.
if (!m_fCanceled)
{
if (fForceCancel)
{
m_fCanceled = TRUE;
}
else
{
m_fCanceled = (IDYES == ::MessageBoxW(hWnd, wzMessage, wzCaption, MB_YESNO | MB_ICONEXCLAMATION));
}
}
::LeaveCriticalSection(&m_csCanceled);
return m_fCanceled;
}
//
// CheckCanceled - waits if the cancel dialog is up and checks to see if the user canceled the operation.
//
BOOL CheckCanceled()
{
::EnterCriticalSection(&m_csCanceled);
::LeaveCriticalSection(&m_csCanceled);
return m_fRollingBack ? FALSE : m_fCanceled;
}
BOOL IsRollingBack()
{
return m_fRollingBack;
}
BOOL IsCanceled()
{
return m_fCanceled;
}
CBalBaseBootstrapperApplication(
__in IBootstrapperEngine* pEngine,
__in const BOOTSTRAPPER_COMMAND* pCommand,
__in DWORD dwRetryCount = 0,
__in DWORD dwRetryTimeout = 1000
)
{
m_cReferences = 1;
m_display = pCommand->display;
m_restart = pCommand->restart;
pEngine->AddRef();
m_pEngine = pEngine;
::InitializeCriticalSection(&m_csCanceled);
m_fCanceled = FALSE;
m_fApplying = FALSE;
m_fRollingBack = FALSE;
BalRetryInitialize(dwRetryCount, dwRetryTimeout);
}
virtual ~CBalBaseBootstrapperApplication()
{
BalRetryUninitialize();
::DeleteCriticalSection(&m_csCanceled);
ReleaseNullObject(m_pEngine);
}
private:
long m_cReferences;
BOOTSTRAPPER_DISPLAY m_display;
BOOTSTRAPPER_RESTART m_restart;
IBootstrapperEngine* m_pEngine;
CRITICAL_SECTION m_csCanceled;
BOOL m_fCanceled;
BOOL m_fApplying;
BOOL m_fRollingBack;
DWORD m_dwProgressPercentage;
DWORD m_dwOverallProgressPercentage;
};

View file

@ -0,0 +1,767 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="IBootstrapperApplication.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// IBootstrapperApplication implemented by a bootstrapper application and used by bootstrapper engine.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
enum BOOTSTRAPPER_DISPLAY
{
BOOTSTRAPPER_DISPLAY_UNKNOWN,
BOOTSTRAPPER_DISPLAY_EMBEDDED,
BOOTSTRAPPER_DISPLAY_NONE,
BOOTSTRAPPER_DISPLAY_PASSIVE,
BOOTSTRAPPER_DISPLAY_FULL,
};
enum BOOTSTRAPPER_RESTART
{
BOOTSTRAPPER_RESTART_UNKNOWN,
BOOTSTRAPPER_RESTART_NEVER,
BOOTSTRAPPER_RESTART_PROMPT,
BOOTSTRAPPER_RESTART_AUTOMATIC,
BOOTSTRAPPER_RESTART_ALWAYS,
};
enum BOOTSTRAPPER_RESUME_TYPE
{
BOOTSTRAPPER_RESUME_TYPE_NONE,
BOOTSTRAPPER_RESUME_TYPE_INVALID, // resume information is present but invalid
BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, // relaunched after an unexpected interruption
BOOTSTRAPPER_RESUME_TYPE_REBOOT_PENDING, // reboot has not taken place yet
BOOTSTRAPPER_RESUME_TYPE_REBOOT, // relaunched after reboot
BOOTSTRAPPER_RESUME_TYPE_SUSPEND, // relaunched after suspend
BOOTSTRAPPER_RESUME_TYPE_ARP, // launched from ARP
};
enum BOOTSTRAPPER_ERROR_TYPE
{
BOOTSTRAPPER_ERROR_TYPE_ELEVATE, // error occurred trying to elevate.
BOOTSTRAPPER_ERROR_TYPE_WINDOWS_INSTALLER, // error came from windows installer.
BOOTSTRAPPER_ERROR_TYPE_EXE_PACKAGE, // error came from an exe package.
BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_SERVER, // error occurred trying to authenticate with HTTP server.
BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_PROXY, // error occurred trying to authenticate with HTTP proxy.
BOOTSTRAPPER_ERROR_TYPE_APPLY, // error occurred during apply.
};
enum BOOTSTRAPPER_RELATED_OPERATION
{
BOOTSTRAPPER_RELATED_OPERATION_NONE,
BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE,
BOOTSTRAPPER_RELATED_OPERATION_MINOR_UPDATE,
BOOTSTRAPPER_RELATED_OPERATION_MAJOR_UPGRADE,
BOOTSTRAPPER_RELATED_OPERATION_REMOVE,
BOOTSTRAPPER_RELATED_OPERATION_INSTALL,
BOOTSTRAPPER_RELATED_OPERATION_REPAIR,
};
enum BOOTSTRAPPER_CACHE_OPERATION
{
BOOTSTRAPPER_CACHE_OPERATION_COPY,
BOOTSTRAPPER_CACHE_OPERATION_DOWNLOAD,
BOOTSTRAPPER_CACHE_OPERATION_EXTRACT,
};
enum BOOTSTRAPPER_APPLY_RESTART
{
BOOTSTRAPPER_APPLY_RESTART_NONE,
BOOTSTRAPPER_APPLY_RESTART_REQUIRED,
BOOTSTRAPPER_APPLY_RESTART_INITIATED,
};
enum BOOTSTRAPPER_RELATION_TYPE
{
BOOTSTRAPPER_RELATION_NONE,
BOOTSTRAPPER_RELATION_DETECT,
BOOTSTRAPPER_RELATION_UPGRADE,
BOOTSTRAPPER_RELATION_ADDON,
BOOTSTRAPPER_RELATION_PATCH,
BOOTSTRAPPER_RELATION_DEPENDENT,
BOOTSTRAPPER_RELATION_UPDATE,
};
struct BOOTSTRAPPER_COMMAND
{
BOOTSTRAPPER_ACTION action;
BOOTSTRAPPER_DISPLAY display;
BOOTSTRAPPER_RESTART restart;
LPWSTR wzCommandLine;
int nCmdShow;
BOOTSTRAPPER_RESUME_TYPE resumeType;
HWND hwndSplashScreen;
// If this was run from a related bundle, specifies the relation type
BOOTSTRAPPER_RELATION_TYPE relationType;
BOOL fPassthrough;
LPWSTR wzLayoutDirectory;
};
DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-AB06-099D717C67FE")
{
// OnStartup - called when the engine is ready for the bootstrapper application to start.
//
STDMETHOD(OnStartup)() = 0;
// OnShutdown - called after the bootstrapper application quits the engine.
//
// Return:
// IDRESTART instructs the engine to restart. The engine will not launch again after the machine
// is rebooted. Ignored if reboot was already initiated by OnExecutePackageComplete().
//
// IDRELOAD_BOOTSTRAPPER instructs the engine to unload the bootstrapper application and restart
// the engine which will load the bootstrapper application again. Typically
// used to switch from a native bootstrapper application to a managed one.
//
// All other return codes are ignored.
STDMETHOD_(int, OnShutdown)() = 0;
// OnSystemShutdown - called when the operating system is instructed to shutdown the machine.
//
// Return:
// IDCANCEL instructs the engine to block the shutdown of the machine.
//
// All other return codes allow the shutdown to commence.
STDMETHOD_(int, OnSystemShutdown)(
__in DWORD dwEndSession,
__in int nRecommendation
) = 0;
// OnDetectBegin - called when the engine begins detection.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectBegin)(
__in BOOL fInstalled,
__in DWORD cPackages
) = 0;
// OnDetectForwardCompatibleBundle - called when the engine detects a forward compatible bundle.
//
// Return:
// IDOK instructs the engine to use the forward compatible bundle.
//
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to not use the forward compatible bundle.
STDMETHOD_(int, OnDetectForwardCompatibleBundle)(
__in_z LPCWSTR wzBundleId,
__in BOOTSTRAPPER_RELATION_TYPE relationType,
__in_z LPCWSTR wzBundleTag,
__in BOOL fPerMachine,
__in DWORD64 dw64Version,
__in int nRecommendation
) = 0;
// OnDetectUpdateBegin - called when the engine begins detection for bundle update.
//
// Return:
// IDOK instructs the engine to attempt update detection.
//
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to skip update detection.
STDMETHOD_(int, OnDetectUpdateBegin)(
__in_z LPCWSTR wzUpdateLocation,
__in int nRecommendation
) = 0;
// OnDetectUpdate - called when the engine has an update candidate for bundle update.
//
// Return:
// IDOK instructs the engine to stop further update detection.
//
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to process further update candidates.
STDMETHOD_(int, OnDetectUpdate)(
__in_z_opt LPCWSTR wzUpdateLocation,
__in DWORD64 dw64Size,
__in DWORD64 dw64Version,
__in_z_opt LPCWSTR wzTitle,
__in_z_opt LPCWSTR wzSummary,
__in_z_opt LPCWSTR wzContentType,
__in_z_opt LPCWSTR wzContent,
__in int nRecommendation
) = 0;
// OnDetectUpdateComplete - called when the engine completes detection for bundle update.
//
// Remarks:
// wzUpdateLocation is null if no update was available.
STDMETHOD_(void, OnDetectUpdateComplete)(
__in HRESULT hrStatus,
__in_z_opt LPCWSTR wzUpdateLocation
) = 0;
// OnDetectRelatedBundle - called when the engine detects a related bundle.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectRelatedBundle)(
__in_z LPCWSTR wzBundleId,
__in BOOTSTRAPPER_RELATION_TYPE relationType,
__in_z LPCWSTR wzBundleTag,
__in BOOL fPerMachine,
__in DWORD64 dw64Version,
__in BOOTSTRAPPER_RELATED_OPERATION operation
) = 0;
// OnDetectPackageBegin - called when the engine begins detecting a package.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectPackageBegin)(
__in_z LPCWSTR wzPackageId
) = 0;
// OnDetectCompatiblePackage - called when the engine detects that a package is not installed but a newer package using the same provider key is.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectCompatiblePackage)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzCompatiblePackageId
) = 0;
// OnDetectRelatedMsiPackage - called when the engine begins detects a related package.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectRelatedMsiPackage)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzProductCode,
__in BOOL fPerMachine,
__in DWORD64 dw64Version,
__in BOOTSTRAPPER_RELATED_OPERATION operation
) = 0;
// OnDetectTargetMsiPackage - called when the engine detects a target MSI package for
// an MSP package.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectTargetMsiPackage)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzProductCode,
__in BOOTSTRAPPER_PACKAGE_STATE patchState
) = 0;
// OnDetectMsiFeature - called when the engine detects a feature in an MSI package.
//
// Return:
// IDCANCEL instructs the engine to stop detection.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnDetectMsiFeature)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzFeatureId,
__in BOOTSTRAPPER_FEATURE_STATE state
) = 0;
// OnDetectPackageComplete - called after the engine detects a package.
//
STDMETHOD_(void, OnDetectPackageComplete)(
__in_z LPCWSTR wzPackageId,
__in HRESULT hrStatus,
__in BOOTSTRAPPER_PACKAGE_STATE state
) = 0;
// OnDetectPackageComplete - called after the engine completes detection.
//
STDMETHOD_(void, OnDetectComplete)(
__in HRESULT hrStatus
) = 0;
// OnPlanBegin - called when the engine begins planning.
//
// Return:
// IDCANCEL instructs the engine to stop planning.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnPlanBegin)(
__in DWORD cPackages
) = 0;
// OnPlanRelatedBundle - called when the engine begins planning a related bundle.
//
// Return:
// IDCANCEL instructs the engine to stop planning.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnPlanRelatedBundle)(
__in_z LPCWSTR wzBundleId,
__inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
) = 0;
// OnPlanPackageBegin - called when the engine begins planning a package.
//
// Return:
// IDCANCEL instructs the engine to stop planning.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnPlanPackageBegin)(
__in_z LPCWSTR wzPackageId,
__inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
) = 0;
// OnPlanCompatiblePackage - called when the engine plans a newer, compatible package using the same provider key.
//
// Return:
// IDCANCEL instructs the engine to stop planning.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnPlanCompatiblePackage)(
__in_z LPCWSTR wzPackageId,
__inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
) = 0;
// OnPlanTargetMsiPackage - called when the engine plans an MSP package
// to apply to an MSI package.
//
// Return:
// IDCANCEL instructs the engine to stop planning.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnPlanTargetMsiPackage)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzProductCode,
__inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
) = 0;
// OnPlanMsiFeature - called when the engine plans a feature in an
// MSI package.
//
// Return:
// IDCANCEL instructs the engine to stop planning.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnPlanMsiFeature)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzFeatureId,
__inout BOOTSTRAPPER_FEATURE_STATE* pRequestedState
) = 0;
// OnPlanPackageComplete - called after the engine plans a package.
//
STDMETHOD_(void, OnPlanPackageComplete)(
__in_z LPCWSTR wzPackageId,
__in HRESULT hrStatus,
__in BOOTSTRAPPER_PACKAGE_STATE state,
__in BOOTSTRAPPER_REQUEST_STATE requested,
__in BOOTSTRAPPER_ACTION_STATE execute,
__in BOOTSTRAPPER_ACTION_STATE rollback
) = 0;
// OnPlanComplete - called when the engine completes planning.
//
STDMETHOD_(void, OnPlanComplete)(
__in HRESULT hrStatus
) = 0;
// OnApplyBegin - called when the engine begins applying the plan.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnApplyBegin)() = 0;
// DEPRECATED: In wix4, this will be merged with OnApplyBegin.
// OnApplyPhaseCount - called right after OnApplyBegin.
//
STDMETHOD_(void, OnApplyPhaseCount)(
__in DWORD dwPhaseCount
) = 0;
// OnElevate - called before the engine displays an elevation prompt.
// Will only happen once per execution of the engine.
//
// Return:
// IDCANCEL instructs the engine to abort elevation and stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnElevate)() = 0;
// OnProgress - called when the engine makes progress.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnProgress)(
__in DWORD dwProgressPercentage,
__in DWORD dwOverallPercentage
) = 0;
// OnError - called when the engine encounters an error.
//
// Return:
// uiFlags is a combination of valid ID* return values appropriate for
// the error.
//
// IDNOACTION instructs the engine to pass the error through to default
// handling which usually results in the apply failing.
STDMETHOD_(int, OnError)(
__in BOOTSTRAPPER_ERROR_TYPE errorType,
__in_z_opt LPCWSTR wzPackageId,
__in DWORD dwCode,
__in_z_opt LPCWSTR wzError,
__in DWORD uiFlags,
__in DWORD cData,
__in_ecount_z_opt(cData) LPCWSTR* rgwzData,
__in int nRecommendation
) = 0;
// OnRegisterBegin - called when the engine registers the bundle.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnRegisterBegin)() = 0;
// OnRegisterComplete - called when the engine registration is
// complete.
//
STDMETHOD_(void, OnRegisterComplete)(
__in HRESULT hrStatus
) = 0;
// OnCacheBegin - called when the engine begins caching.
//
// Return:
// IDCANCEL instructs the engine to stop caching.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnCacheBegin)() = 0;
// OnCachePackageBegin - called when the engine begins caching
// a package.
//
// Return:
// IDCANCEL instructs the engine to stop caching.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnCachePackageBegin)(
__in_z LPCWSTR wzPackageId,
__in DWORD cCachePayloads,
__in DWORD64 dw64PackageCacheSize
) = 0;
// OnCacheAcquireBegin - called when the engine begins copying or
// downloading a payload to the working folder.
//
// Return:
// IDCANCEL instructs the engine to stop caching.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnCacheAcquireBegin)(
__in_z_opt LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in BOOTSTRAPPER_CACHE_OPERATION operation,
__in_z LPCWSTR wzSource
) = 0;
// OnCacheAcquireProgress - called when the engine makes progresss copying
// or downloading a payload to the working folder.
//
// Return:
// IDCANCEL instructs the engine to stop caching.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnCacheAcquireProgress)(
__in_z_opt LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in DWORD64 dw64Progress,
__in DWORD64 dw64Total,
__in DWORD dwOverallPercentage
) = 0;
// OnResolveSource - called when a payload or container cannot be found locally.
//
// Parameters:
// wzPayloadId will be NULL when resolving a container.
// wzDownloadSource will be NULL if the container or payload does not provide a DownloadURL.
//
// Return:
// IDRETRY instructs the engine to try the local source again.
//
// IDDOWNLOAD instructs the engine to try the download source.
//
// All other return codes result in an error.
//
// Notes:
// It is expected the BA may call IBurnCore::SetLocalSource() or IBurnCore::SetDownloadSource()
// to update the source location before returning IDRETRY or IDDOWNLOAD.
STDMETHOD_(int, OnResolveSource)(
__in_z LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in_z LPCWSTR wzLocalSource,
__in_z_opt LPCWSTR wzDownloadSource
) = 0;
// OnCacheAcquireComplete - called after the engine copied or downloaded
// a payload to the working folder.
//
// Return:
// IDRETRY instructs the engine to try the copy or download of the payload again.
//
// All other return codes are ignored.
STDMETHOD_(int, OnCacheAcquireComplete)(
__in_z_opt LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in HRESULT hrStatus,
__in int nRecommendation
) = 0;
// OnCacheVerifyBegin - called when the engine begins to verify then copy
// a payload or container to the package cache folder.
//
// Return:
// IDCANCEL instructs the engine to stop caching.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnCacheVerifyBegin)(
__in_z_opt LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId
) = 0;
// OnCacheVerifyComplete - called after the engine verifies and copies
// a payload or container to the package cache folder.
//
// Return:
// IDRETRY instructs the engine to try the verification of the payload again.
// Ignored if hrStatus is success.
//
// IDTRYAGAIN instructs the engine to acquire the payload again. Ignored if
// hrStatus is success.
//
// All other return codes are ignored.
STDMETHOD_(int, OnCacheVerifyComplete)(
__in_z_opt LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in HRESULT hrStatus,
__in int nRecommendation
) = 0;
// OnCachePackageComplete - called after the engine attempts to copy or download all
// payloads of a package into the package cache folder.
//
// Return:
// IDIGNORE instructs the engine to ignore non-vital package failures and continue with the
// caching. Ignored if hrStatus is a success or the package is vital.
//
// IDRETRY instructs the engine to try the acquisition and verification of the package
// again. Ignored if hrStatus is a success.
//
// All other return codes are ignored.
STDMETHOD_(int, OnCachePackageComplete)(
__in_z LPCWSTR wzPackageId,
__in HRESULT hrStatus,
__in int nRecommendation
) = 0;
// OnCacheComplete - called when the engine caching is complete.
//
STDMETHOD_(void, OnCacheComplete)(
__in HRESULT hrStatus
) = 0;
// OnExecuteBegin - called when the engine begins executing the plan.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnExecuteBegin)(
__in DWORD cExecutingPackages
) = 0;
// OnExecuteBegin - called when the engine begins executing a package.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnExecutePackageBegin)(
__in_z LPCWSTR wzPackageId,
__in BOOL fExecute
) = 0;
// OnExecutePatchTarget - called when the engine executes one or more patches targeting
// a product.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnExecutePatchTarget)(
__in_z LPCWSTR wzPackageId,
__in_z LPCWSTR wzTargetProductCode
) = 0;
// OnExecuteProgress - called when the engine makes progress executing a package.
//
// Return:
// IDCANCEL instructs the engine to stop applying.
//
// IDNOACTION instructs the engine to continue.
STDMETHOD_(int, OnExecuteProgress)(
__in_z LPCWSTR wzPackageId,
__in DWORD dwProgressPercentage,
__in DWORD dwOverallPercentage
) = 0;
// OnExecuteMsiMessage - called when the engine receives an MSI package message.
//
// Return:
// uiFlags is a combination of valid ID* return values appropriate for
// the message.
//
// IDNOACTION instructs the engine to pass the message through to default
// handling which usually results in the execution continuing.
STDMETHOD_(int, OnExecuteMsiMessage)(
__in_z LPCWSTR wzPackageId,
__in INSTALLMESSAGE mt,
__in UINT uiFlags,
__in_z LPCWSTR wzMessage,
__in DWORD cData,
__in_ecount_z_opt(cData) LPCWSTR* rgwzData,
__in int nRecommendation
) = 0;
// OnExecuteFilesInUse - called when the engine encounters files in use while
// executing a package.
//
// Return:
// IDOK instructs the engine to let the Restart Manager attempt to close the
// applications to avoid a restart.
//
// IDCANCEL instructs the engine to abort the execution and start rollback.
//
// IDIGNORE instructs the engine to ignore the running applications. A restart will be
// required.
//
// IDRETRY instructs the engine to check if the applications are still running again.
//
// IDNOACTION is equivalent to ignoring the running applications. A restart will be
// required.
STDMETHOD_(int, OnExecuteFilesInUse)(
__in_z LPCWSTR wzPackageId,
__in DWORD cFiles,
__in_ecount_z(cFiles) LPCWSTR* rgwzFiles
) = 0;
// OnExecutePackageComplete - called when a package execution is complete.
//
// Parameters:
// restart will indicate whether this package requires a reboot or initiated the reboot already.
//
// Return:
// IDIGNORE instructs the engine to ignore non-vital package failures and continue with the
// install. Ignored if hrStatus is a success or the package is vital.
//
// IDRETRY instructs the engine to try the execution of the package again. Ignored if hrStatus
// is a success.
//
// IDRESTART instructs the engine to stop processing the chain and restart. The engine will
// launch again after the machine is restarted.
//
// IDSUSPEND instructs the engine to stop processing the chain and suspend the current state.
//
// All other return codes are ignored.
STDMETHOD_(int, OnExecutePackageComplete)(
__in_z LPCWSTR wzPackageId,
__in HRESULT hrStatus,
__in BOOTSTRAPPER_APPLY_RESTART restart,
__in int nRecommendation
) = 0;
// OnExecuteComplete - called when the engine execution is complete.
//
STDMETHOD_(void, OnExecuteComplete)(
__in HRESULT hrStatus
) = 0;
// OnUnregisterBegin - called when the engine unregisters the bundle.
//
STDMETHOD_(void, OnUnregisterBegin)() = 0;
// OnUnregisterComplete - called when the engine unregistration is complete.
//
STDMETHOD_(void, OnUnregisterComplete)(
__in HRESULT hrStatus
) = 0;
// OnApplyComplete - called after the plan has been applied.
//
// Parameters:
// restart will indicate whether any package required a reboot or initiated the reboot already.
//
// Return:
// IDRESTART instructs the engine to restart. The engine will not launch again after the machine
// is rebooted. Ignored if reboot was already initiated by OnExecutePackageComplete().
//
// All other return codes are ignored.
STDMETHOD_(int, OnApplyComplete)(
__in HRESULT hrStatus,
__in BOOTSTRAPPER_APPLY_RESTART restart
) = 0;
// OnLaunchApprovedExeBegin - called before trying to launch the preapproved executable.
//
STDMETHOD_(int, OnLaunchApprovedExeBegin)() = 0;
// OnLaunchApprovedExeComplete - called after trying to launch the preapproved executable.
//
// Parameters:
// dwProcessId is only valid if the operation succeeded.
//
STDMETHOD_(void, OnLaunchApprovedExeComplete)(
__in HRESULT hrStatus,
__in DWORD dwProcessId
) = 0;
};
extern "C" typedef HRESULT (WINAPI *PFN_BOOTSTRAPPER_APPLICATION_CREATE)(
__in IBootstrapperEngine* pEngine,
__in const BOOTSTRAPPER_COMMAND* pCommand,
__out IBootstrapperApplication** ppApplication
);
extern "C" typedef void (WINAPI *PFN_BOOTSTRAPPER_APPLICATION_DESTROY)();

View file

@ -0,0 +1,36 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="IBootstrapperBAFunction.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//-------------------------------------------------------------------------------------------------
#pragma once
#include <windows.h>
#include "IBootstrapperEngine.h"
interface IBootstrapperBAFunction
{
STDMETHOD(OnDetect)() = 0;
STDMETHOD(OnDetectComplete)() = 0;
STDMETHOD(OnPlan)() = 0;
STDMETHOD(OnPlanComplete)() = 0;
};
#ifdef __cplusplus
extern "C" {
#endif
typedef HRESULT (WINAPI *PFN_BOOTSTRAPPER_BA_FUNCTION_CREATE)(
__in IBootstrapperEngine* pEngine,
__in HMODULE hModule,
__out IBootstrapperBAFunction** ppBAFunction
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,229 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="IBootstrapperEngine.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// IBoostrapperEngine implemented by engine and used by bootstrapper application.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#define IDERROR -1
#define IDNOACTION 0
#define IDDOWNLOAD 101 // Only valid as a return code from OnResolveSource() to instruct the engine to use the download source.
#define IDRESTART 102
#define IDSUSPEND 103
#define IDRELOAD_BOOTSTRAPPER 104
enum BOOTSTRAPPER_ACTION
{
BOOTSTRAPPER_ACTION_UNKNOWN,
BOOTSTRAPPER_ACTION_HELP,
BOOTSTRAPPER_ACTION_LAYOUT,
BOOTSTRAPPER_ACTION_UNINSTALL,
BOOTSTRAPPER_ACTION_INSTALL,
BOOTSTRAPPER_ACTION_MODIFY,
BOOTSTRAPPER_ACTION_REPAIR,
BOOTSTRAPPER_ACTION_UPDATE_REPLACE,
BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED,
};
enum BOOTSTRAPPER_ACTION_STATE
{
BOOTSTRAPPER_ACTION_STATE_NONE,
BOOTSTRAPPER_ACTION_STATE_UNINSTALL,
BOOTSTRAPPER_ACTION_STATE_INSTALL,
BOOTSTRAPPER_ACTION_STATE_ADMIN_INSTALL,
BOOTSTRAPPER_ACTION_STATE_MODIFY,
BOOTSTRAPPER_ACTION_STATE_REPAIR,
BOOTSTRAPPER_ACTION_STATE_MINOR_UPGRADE,
BOOTSTRAPPER_ACTION_STATE_MAJOR_UPGRADE,
BOOTSTRAPPER_ACTION_STATE_PATCH,
};
enum BOOTSTRAPPER_PACKAGE_STATE
{
BOOTSTRAPPER_PACKAGE_STATE_UNKNOWN,
BOOTSTRAPPER_PACKAGE_STATE_OBSOLETE,
BOOTSTRAPPER_PACKAGE_STATE_ABSENT,
BOOTSTRAPPER_PACKAGE_STATE_CACHED,
BOOTSTRAPPER_PACKAGE_STATE_PRESENT,
BOOTSTRAPPER_PACKAGE_STATE_SUPERSEDED,
};
enum BOOTSTRAPPER_REQUEST_STATE
{
BOOTSTRAPPER_REQUEST_STATE_NONE,
BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT,
BOOTSTRAPPER_REQUEST_STATE_ABSENT,
BOOTSTRAPPER_REQUEST_STATE_CACHE,
BOOTSTRAPPER_REQUEST_STATE_PRESENT,
BOOTSTRAPPER_REQUEST_STATE_REPAIR,
};
enum BOOTSTRAPPER_FEATURE_STATE
{
BOOTSTRAPPER_FEATURE_STATE_UNKNOWN,
BOOTSTRAPPER_FEATURE_STATE_ABSENT,
BOOTSTRAPPER_FEATURE_STATE_ADVERTISED,
BOOTSTRAPPER_FEATURE_STATE_LOCAL,
BOOTSTRAPPER_FEATURE_STATE_SOURCE,
};
enum BOOTSTRAPPER_FEATURE_ACTION
{
BOOTSTRAPPER_FEATURE_ACTION_NONE,
BOOTSTRAPPER_FEATURE_ACTION_ADDLOCAL,
BOOTSTRAPPER_FEATURE_ACTION_ADDSOURCE,
BOOTSTRAPPER_FEATURE_ACTION_ADDDEFAULT,
BOOTSTRAPPER_FEATURE_ACTION_REINSTALL,
BOOTSTRAPPER_FEATURE_ACTION_ADVERTISE,
BOOTSTRAPPER_FEATURE_ACTION_REMOVE,
};
enum BOOTSTRAPPER_LOG_LEVEL
{
BOOTSTRAPPER_LOG_LEVEL_NONE, // turns off report (only valid for XXXSetLevel())
BOOTSTRAPPER_LOG_LEVEL_STANDARD, // written if reporting is on
BOOTSTRAPPER_LOG_LEVEL_VERBOSE, // written only if verbose reporting is on
BOOTSTRAPPER_LOG_LEVEL_DEBUG, // reporting useful when debugging code
BOOTSTRAPPER_LOG_LEVEL_ERROR, // always gets reported, but can never be specified
};
enum BOOTSTRAPPER_UPDATE_HASH_TYPE
{
BOOTSTRAPPER_UPDATE_HASH_TYPE_NONE,
BOOTSTRAPPER_UPDATE_HASH_TYPE_SHA1,
};
DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-81512C29C2FB")
{
STDMETHOD(GetPackageCount)(
__out DWORD* pcPackages
) = 0;
STDMETHOD(GetVariableNumeric)(
__in_z LPCWSTR wzVariable,
__out LONGLONG* pllValue
) = 0;
STDMETHOD(GetVariableString)(
__in_z LPCWSTR wzVariable,
__out_ecount_opt(*pcchValue) LPWSTR wzValue,
__inout DWORD* pcchValue
) = 0;
STDMETHOD(GetVariableVersion)(
__in_z LPCWSTR wzVariable,
__out DWORD64* pqwValue
) = 0;
STDMETHOD(FormatString)(
__in_z LPCWSTR wzIn,
__out_ecount_opt(*pcchOut) LPWSTR wzOut,
__inout DWORD* pcchOut
) = 0;
STDMETHOD(EscapeString)(
__in_z LPCWSTR wzIn,
__out_ecount_opt(*pcchOut) LPWSTR wzOut,
__inout DWORD* pcchOut
) = 0;
STDMETHOD(EvaluateCondition)(
__in_z LPCWSTR wzCondition,
__out BOOL* pf
) = 0;
STDMETHOD(Log)(
__in BOOTSTRAPPER_LOG_LEVEL level,
__in_z LPCWSTR wzMessage
) = 0;
STDMETHOD(SendEmbeddedError)(
__in DWORD dwErrorCode,
__in_z_opt LPCWSTR wzMessage,
__in DWORD dwUIHint,
__out int* pnResult
) = 0;
STDMETHOD(SendEmbeddedProgress)(
__in DWORD dwProgressPercentage,
__in DWORD dwOverallProgressPercentage,
__out int* pnResult
) = 0;
STDMETHOD(SetUpdate)(
__in_z_opt LPCWSTR wzLocalSource,
__in_z_opt LPCWSTR wzDownloadSource,
__in DWORD64 qwSize,
__in BOOTSTRAPPER_UPDATE_HASH_TYPE hashType,
__in_bcount_opt(cbHash) BYTE* rgbHash,
__in DWORD cbHash
) = 0;
STDMETHOD(SetLocalSource)(
__in_z LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in_z LPCWSTR wzPath
) = 0;
STDMETHOD(SetDownloadSource)(
__in_z LPCWSTR wzPackageOrContainerId,
__in_z_opt LPCWSTR wzPayloadId,
__in_z LPCWSTR wzUrl,
__in_z_opt LPWSTR wzUser,
__in_z_opt LPWSTR wzPassword
) = 0;
STDMETHOD(SetVariableNumeric)(
__in_z LPCWSTR wzVariable,
__in LONGLONG llValue
) = 0;
STDMETHOD(SetVariableString)(
__in_z LPCWSTR wzVariable,
__in_z_opt LPCWSTR wzValue
) = 0;
STDMETHOD(SetVariableVersion)(
__in_z LPCWSTR wzVariable,
__in DWORD64 qwValue
) = 0;
STDMETHOD(CloseSplashScreen)() = 0;
STDMETHOD(Detect)(
__in_opt HWND hwndParent = NULL
) = 0;
STDMETHOD(Plan)(
__in BOOTSTRAPPER_ACTION action
) = 0;
STDMETHOD(Elevate)(
__in_opt HWND hwndParent
) = 0;
STDMETHOD(Apply)(
__in_opt HWND hwndParent
) = 0;
STDMETHOD(Quit)(
__in DWORD dwExitCode
) = 0;
STDMETHOD(LaunchApprovedExe)(
__in_opt HWND hwndParent,
__in_z LPCWSTR wzApprovedExeForElevationId,
__in_z_opt LPCWSTR wzArguments,
__in DWORD dwWaitForInputIdleTimeout
) = 0;
};

151
tools/WIX/sdk/inc/aclutil.h Normal file
View file

@ -0,0 +1,151 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="aclutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Access Control List helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#include <aclapi.h>
#include <sddl.h>
#define ReleaseSid(x) if (x) { AclFreeSid(x); }
#define ReleaseNullSid(x) if (x) { AclFreeSid(x); x = NULL; }
#ifdef __cplusplus
extern "C" {
#endif
// structs
struct ACL_ACCESS
{
BOOL fDenyAccess;
DWORD dwAccessMask;
// TODO: consider using a union
LPCWSTR pwzAccountName; // NOTE: the last three items in this structure are ignored if this is not NULL
SID_IDENTIFIER_AUTHORITY sia; // used if pwzAccountName is NULL
BYTE nSubAuthorityCount;
DWORD nSubAuthority[8];
};
struct ACL_ACE
{
DWORD dwFlags;
DWORD dwMask;
PSID psid;
};
// functions
HRESULT DAPI AclCheckAccess(
__in HANDLE hToken,
__in ACL_ACCESS* paa
);
HRESULT DAPI AclCheckAdministratorAccess(
__in HANDLE hToken
);
HRESULT DAPI AclCheckLocalSystemAccess(
__in HANDLE hToken
);
HRESULT DAPI AclGetWellKnownSid(
__in WELL_KNOWN_SID_TYPE wkst,
__deref_out PSID* ppsid
);
HRESULT DAPI AclGetAccountSid(
__in_opt LPCWSTR wzSystem,
__in_z LPCWSTR wzAccount,
__deref_out PSID* ppsid
);
HRESULT DAPI AclGetAccountSidString(
__in_z LPCWSTR wzSystem,
__in_z LPCWSTR wzAccount,
__deref_out_z LPWSTR* ppwzSid
);
HRESULT DAPI AclCreateDacl(
__in_ecount(cDeny) ACL_ACE rgaaDeny[],
__in DWORD cDeny,
__in_ecount(cAllow) ACL_ACE rgaaAllow[],
__in DWORD cAllow,
__deref_out ACL** ppAcl
);
HRESULT DAPI AclAddToDacl(
__in ACL* pAcl,
__in_ecount_opt(cDeny) const ACL_ACE rgaaDeny[],
__in DWORD cDeny,
__in_ecount_opt(cAllow) const ACL_ACE rgaaAllow[],
__in DWORD cAllow,
__deref_out ACL** ppAclNew
);
HRESULT DAPI AclMergeDacls(
__in const ACL* pAcl1,
__in const ACL* pAcl2,
__deref_out ACL** ppAclNew
);
HRESULT DAPI AclCreateDaclOld(
__in_ecount(cAclAccesses) ACL_ACCESS* paa,
__in DWORD cAclAccesses,
__deref_out ACL** ppAcl
);
HRESULT DAPI AclCreateSecurityDescriptor(
__in_ecount(cAclAccesses) ACL_ACCESS* paa,
__in DWORD cAclAccesses,
__deref_out SECURITY_DESCRIPTOR** ppsd
);
HRESULT DAPI AclCreateSecurityDescriptorFromDacl(
__in ACL* pACL,
__deref_out SECURITY_DESCRIPTOR** ppsd
);
HRESULT __cdecl AclCreateSecurityDescriptorFromString(
__deref_out SECURITY_DESCRIPTOR** ppsd,
__in_z __format_string LPCWSTR wzSddlFormat,
...
);
HRESULT DAPI AclDuplicateSecurityDescriptor(
__in SECURITY_DESCRIPTOR* psd,
__deref_out SECURITY_DESCRIPTOR** ppsd
);
HRESULT DAPI AclGetSecurityDescriptor(
__in_z LPCWSTR wzObject,
__in SE_OBJECT_TYPE sot,
__in SECURITY_INFORMATION securityInformation,
__deref_out SECURITY_DESCRIPTOR** ppsd
);
HRESULT DAPI AclSetSecurityWithRetry(
__in_z LPCWSTR wzObject,
__in SE_OBJECT_TYPE sot,
__in SECURITY_INFORMATION securityInformation,
__in_opt PSID psidOwner,
__in_opt PSID psidGroup,
__in_opt PACL pDacl,
__in_opt PACL pSacl,
__in DWORD cRetry,
__in DWORD dwWaitMilliseconds
);
HRESULT DAPI AclFreeSid(
__in PSID psid
);
HRESULT DAPI AclFreeDacl(
__in ACL* pACL
);
HRESULT DAPI AclFreeSecurityDescriptor(
__in SECURITY_DESCRIPTOR* psd
);
HRESULT DAPI AclAddAdminToSecurityDescriptor(
__in SECURITY_DESCRIPTOR* pSecurity,
__deref_out SECURITY_DESCRIPTOR** ppSecurityNew
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,96 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="apuputil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Application Update helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseApupChain(p) if (p) { ApupFreeChain(p); p = NULL; }
#define ReleaseNullApupChain(p) if (p) { ApupFreeChain(p); p = NULL; }
const LPCWSTR APPLICATION_SYNDICATION_NAMESPACE = L"http://appsyndication.org/2006/appsyn";
typedef enum APUP_HASH_ALGORITHM
{
APUP_HASH_ALGORITHM_UNKNOWN,
APUP_HASH_ALGORITHM_MD5,
APUP_HASH_ALGORITHM_SHA1,
APUP_HASH_ALGORITHM_SHA256,
} APUP_HASH_ALGORITHM;
struct APPLICATION_UPDATE_ENCLOSURE
{
LPWSTR wzUrl;
LPWSTR wzLocalName;
DWORD64 dw64Size;
BYTE* rgbDigest;
DWORD cbDigest;
APUP_HASH_ALGORITHM digestAlgorithm;
BOOL fInstaller;
};
struct APPLICATION_UPDATE_ENTRY
{
LPWSTR wzApplicationId;
LPWSTR wzApplicationType;
LPWSTR wzTitle;
LPWSTR wzSummary;
LPWSTR wzContentType;
LPWSTR wzContent;
LPWSTR wzUpgradeId;
BOOL fUpgradeExclusive;
DWORD64 dw64Version;
DWORD64 dw64UpgradeVersion;
DWORD64 dw64TotalSize;
DWORD cEnclosures;
APPLICATION_UPDATE_ENCLOSURE* rgEnclosures;
};
struct APPLICATION_UPDATE_CHAIN
{
LPWSTR wzDefaultApplicationId;
LPWSTR wzDefaultApplicationType;
DWORD cEntries;
APPLICATION_UPDATE_ENTRY* rgEntries;
};
HRESULT DAPI ApupAllocChainFromAtom(
__in ATOM_FEED* pFeed,
__out APPLICATION_UPDATE_CHAIN** ppChain
);
HRESULT DAPI ApupFilterChain(
__in APPLICATION_UPDATE_CHAIN* pChain,
__in DWORD64 dw64Version,
__out APPLICATION_UPDATE_CHAIN** ppFilteredChain
);
void DAPI ApupFreeChain(
__in APPLICATION_UPDATE_CHAIN* pChain
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,158 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="atomutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// ATOM helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseAtomFeed(p) if (p) { AtomFreeFeed(p); }
#define ReleaseNullAtomFeed(p) if (p) { AtomFreeFeed(p); p = NULL; }
struct ATOM_UNKNOWN_ATTRIBUTE
{
LPWSTR wzNamespace;
LPWSTR wzAttribute;
LPWSTR wzValue;
ATOM_UNKNOWN_ATTRIBUTE* pNext;
};
struct ATOM_UNKNOWN_ELEMENT
{
LPWSTR wzNamespace;
LPWSTR wzElement;
LPWSTR wzValue;
ATOM_UNKNOWN_ATTRIBUTE* pAttributes;
ATOM_UNKNOWN_ELEMENT* pNext;
};
struct ATOM_LINK
{
LPWSTR wzRel;
LPWSTR wzTitle;
LPWSTR wzType;
LPWSTR wzUrl;
LPWSTR wzValue;
DWORD64 dw64Length;
ATOM_UNKNOWN_ATTRIBUTE* pUnknownAttributes;
ATOM_UNKNOWN_ELEMENT* pUnknownElements;
};
struct ATOM_CONTENT
{
LPWSTR wzType;
LPWSTR wzUrl;
LPWSTR wzValue;
ATOM_UNKNOWN_ELEMENT* pUnknownElements;
};
struct ATOM_AUTHOR
{
LPWSTR wzName;
LPWSTR wzEmail;
LPWSTR wzUrl;
};
struct ATOM_CATEGORY
{
LPWSTR wzLabel;
LPWSTR wzScheme;
LPWSTR wzTerm;
ATOM_UNKNOWN_ELEMENT* pUnknownElements;
};
struct ATOM_ENTRY
{
LPWSTR wzId;
LPWSTR wzSummary;
LPWSTR wzTitle;
FILETIME ftPublished;
FILETIME ftUpdated;
ATOM_CONTENT* pContent;
DWORD cAuthors;
ATOM_AUTHOR* rgAuthors;
DWORD cCategories;
ATOM_CATEGORY* rgCategories;
DWORD cLinks;
ATOM_LINK* rgLinks;
IXMLDOMNode* pixn;
ATOM_UNKNOWN_ELEMENT* pUnknownElements;
};
struct ATOM_FEED
{
LPWSTR wzGenerator;
LPWSTR wzIcon;
LPWSTR wzId;
LPWSTR wzLogo;
LPWSTR wzSubtitle;
LPWSTR wzTitle;
FILETIME ftUpdated;
DWORD cAuthors;
ATOM_AUTHOR* rgAuthors;
DWORD cCategories;
ATOM_CATEGORY* rgCategories;
DWORD cEntries;
ATOM_ENTRY* rgEntries;
DWORD cLinks;
ATOM_LINK* rgLinks;
IXMLDOMNode* pixn;
ATOM_UNKNOWN_ELEMENT* pUnknownElements;
};
HRESULT DAPI AtomInitialize(
);
void DAPI AtomUninitialize(
);
HRESULT DAPI AtomParseFromString(
__in_z LPCWSTR wzAtomString,
__out ATOM_FEED **ppFeed
);
HRESULT DAPI AtomParseFromFile(
__in_z LPCWSTR wzAtomFile,
__out ATOM_FEED **ppFeed
);
HRESULT DAPI AtomParseFromDocument(
__in IXMLDOMDocument* pixdDocument,
__out ATOM_FEED **ppFeed
);
void DAPI AtomFreeFeed(
__in_xcount(pFeed->cItems) ATOM_FEED *pFEED
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,69 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="balcondition.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Bootstrapper Application Layer condition utility.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _BAL_CONDITION
{
LPWSTR sczCondition;
LPWSTR sczMessage;
} BAL_CONDITION;
typedef struct _BAL_CONDITIONS
{
BAL_CONDITION* rgConditions;
DWORD cConditions;
} BAL_CONDITIONS;
/*******************************************************************
BalConditionsParseFromXml - loads the conditions from the UX manifest.
********************************************************************/
DAPI_(HRESULT) BalConditionsParseFromXml(
__in BAL_CONDITIONS* pConditions,
__in IXMLDOMDocument* pixdManifest,
__in_opt WIX_LOCALIZATION* pWixLoc
);
/*******************************************************************
BalConditionEvaluate - evaluates condition against the provided IBurnCore.
NOTE: psczMessage is optional.
********************************************************************/
DAPI_(HRESULT) BalConditionEvaluate(
__in BAL_CONDITION* pCondition,
__in IBootstrapperEngine* pEngine,
__out BOOL* pfResult,
__out_z_opt LPWSTR* psczMessage
);
/*******************************************************************
BalConditionsUninitialize - uninitializes any conditions previously loaded.
********************************************************************/
DAPI_(void) BalConditionsUninitialize(
__in BAL_CONDITIONS* pConditions
);
#ifdef __cplusplus
}
#endif

118
tools/WIX/sdk/inc/balinfo.h Normal file
View file

@ -0,0 +1,118 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="balinfo.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Bootstrapper Application Layer package utility.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef enum BAL_INFO_PACKAGE_TYPE
{
BAL_INFO_PACKAGE_TYPE_UNKNOWN,
BAL_INFO_PACKAGE_TYPE_EXE,
BAL_INFO_PACKAGE_TYPE_MSI,
BAL_INFO_PACKAGE_TYPE_MSP,
BAL_INFO_PACKAGE_TYPE_MSU,
BAL_INFO_PACKAGE_TYPE_BUNDLE_UPGRADE,
BAL_INFO_PACKAGE_TYPE_BUNDLE_ADDON,
BAL_INFO_PACKAGE_TYPE_BUNDLE_PATCH,
} BAL_INFO_PACKAGE_TYPE;
typedef enum BAL_INFO_CACHE_TYPE
{
BAL_INFO_CACHE_TYPE_NO,
BAL_INFO_CACHE_TYPE_YES,
BAL_INFO_CACHE_TYPE_ALWAYS,
} BAL_INFO_CACHE_TYPE;
typedef struct _BAL_INFO_PACKAGE
{
LPWSTR sczId;
LPWSTR sczDisplayName;
LPWSTR sczDescription;
BAL_INFO_PACKAGE_TYPE type;
BOOL fPermanent;
BOOL fVital;
BOOL fDisplayInternalUI;
LPWSTR sczProductCode;
LPWSTR sczUpgradeCode;
LPWSTR sczVersion;
LPWSTR sczInstallCondition;
BAL_INFO_CACHE_TYPE cacheType;
} BAL_INFO_PACKAGE;
typedef struct _BAL_INFO_PACKAGES
{
BAL_INFO_PACKAGE* rgPackages;
DWORD cPackages;
} BAL_INFO_PACKAGES;
typedef struct _BAL_INFO_BUNDLE
{
BOOL fPerMachine;
LPWSTR sczName;
LPWSTR sczLogVariable;
BAL_INFO_PACKAGES packages;
} BAL_INFO_BUNDLE;
/*******************************************************************
BalInfoParseFromXml - loads the bundle and package info from the UX
manifest.
********************************************************************/
DAPI_(HRESULT) BalInfoParseFromXml(
__in BAL_INFO_BUNDLE* pBundle,
__in IXMLDOMDocument* pixdManifest
);
/*******************************************************************
BalInfoAddRelatedBundleAsPackage - adds a related bundle as a package.
********************************************************************/
DAPI_(HRESULT) BalInfoAddRelatedBundleAsPackage(
__in BAL_INFO_PACKAGES* pPackages,
__in LPCWSTR wzId,
__in BOOTSTRAPPER_RELATION_TYPE relationType,
__in BOOL fPerMachine
);
/*******************************************************************
BalInfoFindPackageById - finds a package by its id.
********************************************************************/
DAPI_(HRESULT) BalInfoFindPackageById(
__in BAL_INFO_PACKAGES* pPackages,
__in LPCWSTR wzId,
__out BAL_INFO_PACKAGE** ppPackage
);
/*******************************************************************
BalInfoUninitialize - uninitializes any info previously loaded.
********************************************************************/
DAPI_(void) BalInfoUninitialize(
__in BAL_INFO_BUNDLE* pBundle
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,75 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="balretry.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Bootstrapper Application Layer retry utility.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef enum BALRETRY_TYPE
{
BALRETRY_TYPE_CACHE,
BALRETRY_TYPE_EXECUTE,
} BALRETRY_TYPE;
/*******************************************************************
BalRetryInitialize - initialize the retry count and timeout between
retries (in milliseconds).
********************************************************************/
DAPI_(void) BalRetryInitialize(
__in DWORD dwMaxRetries,
__in DWORD dwTimeout
);
/*******************************************************************
BalRetryUninitialize - call to cleanup any memory allocated during
use of the retry utility.
********************************************************************/
DAPI_(void) BalRetryUninitialize();
/*******************************************************************
BalRetryStartPackage - call when a package begins to be modified. If
the package is being retried, the function will
wait the specified timeout.
********************************************************************/
DAPI_(void) BalRetryStartPackage(
__in BALRETRY_TYPE type,
__in_z_opt LPCWSTR wzPackageId,
__in_z_opt LPCWSTR wzPayloadId
);
/*******************************************************************
BalRetryErrorOccured - call when an error occurs for the retry utility
to consider.
********************************************************************/
DAPI_(void) BalRetryErrorOccurred(
__in_z_opt LPCWSTR wzPackageId,
__in DWORD dwError
);
/*******************************************************************
BalRetryEndPackage - returns IDRETRY is a retry is recommended or
IDNOACTION if a retry is not recommended.
********************************************************************/
DAPI_(int) BalRetryEndPackage(
__in BALRETRY_TYPE type,
__in_z_opt LPCWSTR wzPackageId,
__in_z_opt LPCWSTR wzPayloadId,
__in HRESULT hrError
);
#ifdef __cplusplus
}
#endif

126
tools/WIX/sdk/inc/balutil.h Normal file
View file

@ -0,0 +1,126 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="balutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Burn utility library.
// </summary>
//-------------------------------------------------------------------------------------------------
#include "dutil.h"
#ifdef __cplusplus
extern "C" {
#endif
#define BalExitOnFailure(x, f) if (FAILED(x)) { BalLogError(x, f); ExitTrace(x, f); goto LExit; }
#define BalExitOnFailure1(x, f, s) if (FAILED(x)) { BalLogError(x, f, s); ExitTrace1(x, f, s); goto LExit; }
#define BalExitOnFailure2(x, f, s, t) if (FAILED(x)) { BalLogError(x, f, s, t); ExitTrace2(x, f, s, t); goto LExit; }
#define BalExitOnFailure3(x, f, s, t, u) if (FAILED(x)) { BalLogError(x, f, s, t, u); ExitTrace3(x, f, s, t, u); goto LExit; }
#define BalExitOnRootFailure(x, f) if (FAILED(x)) { BalLogError(x, f); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, f); goto LExit; }
#define BalExitOnRootFailure1(x, f, s) if (FAILED(x)) { BalLogError(x, f, s); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define BalExitOnRootFailure2(x, f, s, t) if (FAILED(x)) { BalLogError(x, f, s, t); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; }
#define BalExitOnRootFailure3(x, f, s, t, u) if (FAILED(x)) { BalLogError(x, f, s, t, u); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace3(x, f, s, t, u); goto LExit; }
#define BalExitOnNullWithLastError(p, x, f) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BalLogError(x, f); ExitTrace(x, f); goto LExit; }
#define BalExitOnNullWithLastError1(p, x, f, s) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BalLogError(x, f, s); ExitTrace1(x, f, s); goto LExit; }
#define FACILITY_WIX 500
static const HRESULT E_WIXSTDBA_CONDITION_FAILED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 1);
static const HRESULT E_MBAHOST_NET452_ON_WIN7RTM = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 1000);
/*******************************************************************
BalInitialize - remembers the engine interface to enable logging and
other functions.
********************************************************************/
DAPI_(void) BalInitialize(
__in IBootstrapperEngine* pEngine
);
/*******************************************************************
BalUninitialize - cleans up utility layer internals.
********************************************************************/
DAPI_(void) BalUninitialize();
/*******************************************************************
BalManifestLoad - loads the Application manifest into an XML document.
********************************************************************/
DAPI_(HRESULT) BalManifestLoad(
__in HMODULE hUXModule,
__out IXMLDOMDocument** ppixdManifest
);
/*******************************************************************
BalFormatString - formats a string using variables in the engine.
Note: Use StrFree() to release psczOut.
********************************************************************/
DAPI_(HRESULT) BalFormatString(
__in_z LPCWSTR wzFormat,
__inout LPWSTR* psczOut
);
/*******************************************************************
BalGetNumericVariable - gets a number from a variable in the engine.
Note: Returns E_NOTFOUND if variable does not exist.
********************************************************************/
DAPI_(HRESULT) BalGetNumericVariable(
__in_z LPCWSTR wzVariable,
__out LONGLONG* pllValue
);
/*******************************************************************
BalStringVariableExists - checks if a string variable exists in the engine.
********************************************************************/
DAPI_(BOOL) BalStringVariableExists(
__in_z LPCWSTR wzVariable
);
/*******************************************************************
BalGetStringVariable - gets a string from a variable in the engine.
Note: Use StrFree() to release psczValue.
********************************************************************/
DAPI_(HRESULT) BalGetStringVariable(
__in_z LPCWSTR wzVariable,
__inout LPWSTR* psczValue
);
/*******************************************************************
BalLog - logs a message with the engine.
********************************************************************/
DAPIV_(HRESULT) BalLog(
__in BOOTSTRAPPER_LOG_LEVEL level,
__in_z __format_string LPCSTR szFormat,
...
);
/*******************************************************************
BalLogError - logs an error message with the engine.
********************************************************************/
DAPIV_(HRESULT) BalLogError(
__in HRESULT hr,
__in_z __format_string LPCSTR szFormat,
...
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,92 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="buffutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Binary serialization helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
// macro definitions
#define ReleaseBuffer ReleaseMem
#define ReleaseNullBuffer ReleaseNullMem
#define BuffFree MemFree
// function declarations
HRESULT BuffReadNumber(
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__inout SIZE_T* piBuffer,
__out DWORD* pdw
);
HRESULT BuffReadNumber64(
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__inout SIZE_T* piBuffer,
__out DWORD64* pdw64
);
HRESULT BuffReadString(
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__inout SIZE_T* piBuffer,
__deref_out_z LPWSTR* pscz
);
HRESULT BuffReadStringAnsi(
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__inout SIZE_T* piBuffer,
__deref_out_z LPSTR* pscz
);
HRESULT BuffReadStream(
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__inout SIZE_T* piBuffer,
__deref_out_bcount(*pcbStream) BYTE** ppbStream,
__out SIZE_T* pcbStream
);
HRESULT BuffWriteNumber(
__deref_out_bcount(*piBuffer) BYTE** ppbBuffer,
__inout SIZE_T* piBuffer,
__in DWORD dw
);
HRESULT BuffWriteNumber64(
__deref_out_bcount(*piBuffer) BYTE** ppbBuffer,
__inout SIZE_T* piBuffer,
__in DWORD64 dw64
);
HRESULT BuffWriteString(
__deref_out_bcount(*piBuffer) BYTE** ppbBuffer,
__inout SIZE_T* piBuffer,
__in_z_opt LPCWSTR scz
);
HRESULT BuffWriteStringAnsi(
__deref_out_bcount(*piBuffer) BYTE** ppbBuffer,
__inout SIZE_T* piBuffer,
__in_z_opt LPCSTR scz
);
HRESULT BuffWriteStream(
__deref_out_bcount(*piBuffer) BYTE** ppbBuffer,
__inout SIZE_T* piBuffer,
__in_bcount(cbStream) const BYTE* pbStream,
__in SIZE_T cbStream
);
#ifdef __cplusplus
}
#endif

41
tools/WIX/sdk/inc/butil.h Normal file
View file

@ -0,0 +1,41 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="butil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for bundle helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
enum BUNDLE_INSTALL_CONTEXT
{
BUNDLE_INSTALL_CONTEXT_MACHINE,
BUNDLE_INSTALL_CONTEXT_USER,
};
HRESULT DAPI BundleGetBundleInfo(
__in LPCWSTR szBundleId, // Bundle code
__in LPCWSTR szAttribute, // attribute name
__out_ecount_opt(*pcchValueBuf) LPWSTR lpValueBuf, // returned value, NULL if not desired
__inout_opt LPDWORD pcchValueBuf // in/out buffer character count
);
HRESULT DAPI BundleEnumRelatedBundle(
__in LPCWSTR lpUpgradeCode,
__in BUNDLE_INSTALL_CONTEXT context,
__inout PDWORD pdwStartIndex,
__out_ecount(MAX_GUID_CHARS+1) LPWSTR lpBundleIdBuf
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,72 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="cabcutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for cabinet creation helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#include <fci.h>
#include <fcntl.h>
#include <msi.h>
// Callback from PFNFCIGETNEXTCABINET CabCGetNextCabinet method
// First argument is the name of splitting cabinet without extension e.g. "cab1"
// Second argument is name of the new cabinet that would be formed by splitting e.g. "cab1b.cab"
// Third argument is the file token of the first file present in the splitting cabinet
typedef void (__stdcall * FileSplitCabNamesCallback)(LPWSTR, LPWSTR, LPWSTR);
#define CAB_MAX_SIZE 0x7FFFFFFF // (see KB: Q174866)
#ifdef __cplusplus
extern "C" {
#endif
extern const int CABC_HANDLE_BYTES;
// time vs. space trade-off
typedef enum COMPRESSION_TYPE
{
COMPRESSION_TYPE_NONE, // fastest
COMPRESSION_TYPE_LOW,
COMPRESSION_TYPE_MEDIUM,
COMPRESSION_TYPE_HIGH, // smallest
COMPRESSION_TYPE_MSZIP
} COMPRESSION_TYPE;
// functions
HRESULT DAPI CabCBegin(
__in_z LPCWSTR wzCab,
__in_z LPCWSTR wzCabDir,
__in DWORD dwMaxFiles,
__in DWORD dwMaxSize,
__in DWORD dwMaxThresh,
__in COMPRESSION_TYPE ct,
__out_bcount(CABC_HANDLE_BYTES) HANDLE *phContext
);
HRESULT DAPI CabCNextCab(
__in_bcount(CABC_HANDLE_BYTES) HANDLE hContext
);
HRESULT DAPI CabCAddFile(
__in_z LPCWSTR wzFile,
__in_z_opt LPCWSTR wzToken,
__in_opt PMSIFILEHASHINFO pmfHash,
__in_bcount(CABC_HANDLE_BYTES) HANDLE hContext
);
HRESULT DAPI CabCFinish(
__in_bcount(CABC_HANDLE_BYTES) HANDLE hContext,
__in_opt FileSplitCabNamesCallback fileSplitCabNamesCallback
);
void DAPI CabCCancel(
__in_bcount(CABC_HANDLE_BYTES) HANDLE hContext
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,66 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="cabutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for cabinet decompression helper functions
// </summary>
//-------------------------------------------------------------------------------------------------
#include <fdi.h>
#include <sys\stat.h>
#ifdef __cplusplus
extern "C" {
#endif
// structs
// callback function prototypes
typedef HRESULT (*CAB_CALLBACK_OPEN_FILE)(LPCWSTR wzFile, INT_PTR* ppFile);
typedef HRESULT (*CAB_CALLBACK_READ_FILE)(INT_PTR pFile, LPVOID pvData, DWORD cbData, DWORD* pcbRead);
typedef HRESULT (*CAB_CALLBACK_WRITE_FILE)(INT_PTR pFile, LPVOID pvData, DWORD cbData, DWORD* pcbRead);
typedef LONG (*CAB_CALLBACK_SEEK_FILE)(INT_PTR pFile, DWORD dwMove, DWORD dwMoveMethod);
typedef HRESULT (*CAB_CALLBACK_CLOSE_FILE)(INT_PTR pFile);
typedef HRESULT (*CAB_CALLBACK_BEGIN_FILE)(LPCWSTR wzFileId, FILETIME* pftFileTime, DWORD cbFileSize, LPVOID pvContext, INT_PTR* ppFile);
typedef HRESULT (*CAB_CALLBACK_END_FILE)(LPCWSTR wzFileId, LPVOID pvContext, INT_PTR pFile);
typedef HRESULT (*CAB_CALLBACK_PROGRESS)(BOOL fBeginFile, LPCWSTR wzFileId, LPVOID pvContext);
// function type with calling convention of __stdcall that .NET 1.1 understands only
// .NET 2.0 will not need this
typedef INT_PTR (FAR __stdcall *STDCALL_PFNFDINOTIFY)(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin);
// functions
HRESULT DAPI CabInitialize(
__in BOOL fDelayLoad
);
void DAPI CabUninitialize(
);
HRESULT DAPI CabExtract(
__in_z LPCWSTR wzCabinet,
__in_z LPCWSTR wzExtractFile,
__in_z LPCWSTR wzExtractDir,
__in_opt CAB_CALLBACK_PROGRESS pfnProgress,
__in_opt LPVOID pvContext,
__in DWORD64 dw64EmbeddedOffset
);
HRESULT DAPI CabEnumerate(
__in_z LPCWSTR wzCabinet,
__in_z LPCWSTR wzEnumerateFile,
__in STDCALL_PFNFDINOTIFY pfnNotify,
__in DWORD64 dw64EmbeddedOffset
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,76 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="certutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Certificate helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#define ReleaseCertStore(p) if (p) { ::CertCloseStore(p, 0); p = NULL; }
#define ReleaseCertContext(p) if (p) { ::CertFreeCertificateContext(p); p = NULL; }
#define ReleaseCertChain(p) if (p) { ::CertFreeCertificateChain(p); p = NULL; }
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI CertReadProperty(
__in PCCERT_CONTEXT pCertContext,
__in DWORD dwProperty,
__out_bcount(*pcbValue) LPVOID pvValue,
__out_opt DWORD* pcbValue
);
HRESULT DAPI CertGetAuthenticodeSigningTimestamp(
__in CMSG_SIGNER_INFO* pSignerInfo,
__out FILETIME* pft
);
HRESULT DAPI GetCryptProvFromCert(
__in_opt HWND hwnd,
__in PCCERT_CONTEXT pCert,
__out HCRYPTPROV *phCryptProv,
__out DWORD *pdwKeySpec,
__in BOOL *pfDidCryptAcquire,
__deref_opt_out LPWSTR *ppwszTmpContainer,
__deref_opt_out LPWSTR *ppwszProviderName,
__out DWORD *pdwProviderType
);
HRESULT DAPI FreeCryptProvFromCert(
__in BOOL fAcquired,
__in HCRYPTPROV hProv,
__in_opt LPWSTR pwszCapiProvider,
__in DWORD dwProviderType,
__in_opt LPWSTR pwszTmpContainer
);
HRESULT DAPI GetProvSecurityDesc(
__in HCRYPTPROV hProv,
__deref_out SECURITY_DESCRIPTOR** pSecurity
);
HRESULT DAPI SetProvSecurityDesc(
__in HCRYPTPROV hProv,
__in SECURITY_DESCRIPTOR* pSecurity
);
BOOL DAPI CertHasPrivateKey(
__in PCCERT_CONTEXT pCertContext,
__out_opt DWORD* pdwKeySpec
);
HRESULT DAPI CertInstallSingleCertificate(
__in HCERTSTORE hStore,
__in PCCERT_CONTEXT pCertContext,
__in LPCWSTR wzName
);
#ifdef __cplusplus
}
#endif

110
tools/WIX/sdk/inc/conutil.h Normal file
View file

@ -0,0 +1,110 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="conutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Console helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ConsoleExitOnFailure(x, c, f) if (FAILED(x)) { ConsoleWriteError(x, c, f); ExitTrace(x, f); goto LExit; }
#define ConsoleExitOnFailure1(x, c, f, s) if (FAILED(x)) { ConsoleWriteError(x, c, f, s, NULL); ExitTrace1(x, f, s); goto LExit; }
#define ConsoleExitOnFailure2(x, c, f, s, t) if (FAILED(x)) { ConsoleWriteError(x, c, f, s, t); ExitTrace2(x, f, s, t); goto LExit; }
#define ConsoleExitOnFailure3(x, c, f, s, t, u) if (FAILED(x)) { ConsoleWriteError(x, c, f, s, t, u); ExitTrace3(x, f, s, t, u); goto LExit; }
#define ConsoleExitOnLastError(x, c, f) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ConsoleWriteError(x, c, f); ExitTrace(x, f); goto LExit; } }
#define ConsoleExitOnLastError1(x, c, f, s) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ConsoleWriteError(x, c, f, s, NULL); ExitTrace1(x, f, s); goto LExit; } }
#define ConsoleExitOnLastError2(x, c, f, s, t) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ConsoleWriteError(x, c, f, s, t); ExitTrace2(x, f, s, t); goto LExit; } }
#define ConsoleExitOnLastError3(x, c, f, s, t, u) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ConsoleWriteError(x, c, f, s, t, u); ExitTrace3(x, f, s, t, u); goto LExit; } }
#define ConsoleExitOnNull(p, x, e, c, f) if (NULL == p) { x = e; ConsoleWriteError(x, c, f); ExitTrace(x, f); goto LExit; }
#define ConsoleExitOnNull1(p, x, e, c, f, s) if (NULL == p) { x = e; ConsoleWriteError(x, c, f, s, NULL); ExitTrace1(x, f, s); goto LExit; }
#define ConsoleExitOnNull2(p, x, e, c, f, s, t) if (NULL == p) { x = e; ConsoleWriteError(x, c, f, s, t); ExitTrace2(x, f, s, t); goto LExit; }
#define ConsoleExitOnNull3(p, x, e, c, f, s, t, u) if (NULL == p) { x = e; ConsoleWriteError(x, c, f, s, t, u); ExitTrace2(x, f, s, t, u); goto LExit; }
// the following macros need to go away
#define ConsoleTrace(l, f) { ConsoleWriteLine(CONSOLE_COLOR_NORMAL, f); Trace(l, f); }
#define ConsoleTrace1(l, f, s) { ConsoleWriteLine(CONSOLE_COLOR_NORMAL, f, s); Trace1(l, f, s); }
#define ConsoleTrace2(l, f, s, t) { ConsoleWriteLine(CONSOLE_COLOR_NORMAL, f, s, t); Trace2(l, f, s, t); }
#define ConsoleTrace3(l, f, s, t, u) { ConsoleWriteLine(CONSOLE_COLOR_NORMAL, f, s, t, u); Trace3(l, f, s, t, u); }
#define ConsoleWarning(f) { ConsoleWriteLine(CONSOLE_COLOR_YELLOW, f); Trace(REPORT_STANDARD, f); }
#define ConsoleWarning1(f, s) { ConsoleWriteLine(CONSOLE_COLOR_YELLOW, f, s); Trace1(REPORT_STANDARD, f, s); }
#define ConsoleWarning2(f, s, t) { ConsoleWriteLine(CONSOLE_COLOR_YELLOW, f, s, t); Trace2(REPORT_STANDARD, f, s, t); }
#define ConsoleWarning3(f, s, t, u) { ConsoleWriteLine(CONSOLE_COLOR_YELLOW, f, s, t, u); Trace3(REPORT_STANDARD, f, s, t, u); }
#define ConsoleError(x, f) { ConsoleWriteError(x, CONSOLE_COLOR_RED, f); TraceError(x, f); }
#define ConsoleError1(x, f, s) { ConsoleWriteError(x, CONSOLE_COLOR_RED, f, s); TraceError1(x, f, s); }
#define ConsoleError2(x, f, s, t) { ConsoleWriteError(x, CONSOLE_COLOR_RED, f, s, t); TraceError2(x, f, s, t); }
#define ConsoleError3(x, f, s, t, u) { ConsoleWriteError(x, CONSOLE_COLOR_RED, f, s, t, u); TraceError3(x, f, s, t, u); }
// enums
typedef enum CONSOLE_COLOR { CONSOLE_COLOR_NORMAL, CONSOLE_COLOR_RED, CONSOLE_COLOR_YELLOW, CONSOLE_COLOR_GREEN } CONSOLE_COLOR;
// structs
// functions
HRESULT DAPI ConsoleInitialize();
void DAPI ConsoleUninitialize();
void DAPI ConsoleGreen();
void DAPI ConsoleRed();
void DAPI ConsoleYellow();
void DAPI ConsoleNormal();
HRESULT DAPI ConsoleWrite(
CONSOLE_COLOR cc,
__in_z __format_string LPCSTR szFormat,
...
);
HRESULT DAPI ConsoleWriteLine(
CONSOLE_COLOR cc,
__in_z __format_string LPCSTR szFormat,
...
);
HRESULT DAPI ConsoleWriteError(
HRESULT hrError,
CONSOLE_COLOR cc,
__in_z __format_string LPCSTR szFormat,
...
);
HRESULT DAPI ConsoleReadW(
__deref_out_z LPWSTR* ppwzBuffer
);
HRESULT DAPI ConsoleReadStringA(
__deref_out_ecount_part(cchCharBuffer,*pcchNumCharReturn) LPSTR* szCharBuffer,
CONST DWORD cchCharBuffer,
__out DWORD* pcchNumCharReturn
);
HRESULT DAPI ConsoleReadStringW(
__deref_out_ecount_part(cchCharBuffer,*pcchNumCharReturn) LPWSTR* szCharBuffer,
CONST DWORD cchCharBuffer,
__out DWORD* pcchNumCharReturn
);
HRESULT DAPI ConsoleReadNonBlockingW(
__deref_out_ecount_opt(*pcchSize) LPWSTR* ppwzBuffer,
__out DWORD* pcchSize,
BOOL fReadLine
);
HRESULT DAPI ConsoleSetReadHidden(void);
HRESULT DAPI ConsoleSetReadNormal(void);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,113 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="cryputil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Cryptography helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#define ReleaseCryptMsg(p) if (p) { ::CryptMsgClose(p); p = NULL; }
#ifdef __cplusplus
extern "C" {
#endif
// Use CRYPTPROTECTMEMORY_BLOCK_SIZE, because it's larger and thus more restrictive than RTL_ENCRYPT_MEMORY_SIZE.
#define CRYP_ENCRYPT_MEMORY_SIZE CRYPTPROTECTMEMORY_BLOCK_SIZE
#define SHA1_HASH_LEN 20
typedef NTSTATUS (APIENTRY *PFN_RTLENCRYPTMEMORY)(
__inout PVOID Memory,
__in ULONG MemoryLength,
__in ULONG OptionFlags
);
typedef NTSTATUS (APIENTRY *PFN_RTLDECRYPTMEMORY)(
__inout PVOID Memory,
__in ULONG MemoryLength,
__in ULONG OptionFlags
);
typedef BOOL (APIENTRY *PFN_CRYPTPROTECTMEMORY)(
__inout LPVOID pData,
__in DWORD cbData,
__in DWORD dwFlags
);
typedef BOOL (APIENTRY *PFN_CRYPTUNPROTECTMEMORY)(
__inout LPVOID pData,
__in DWORD cbData,
__in DWORD dwFlags
);
// function declarations
HRESULT DAPI CrypInitialize();
void DAPI CrypUninitialize();
HRESULT DAPI CrypDecodeObject(
__in_z LPCSTR szStructType,
__in_ecount(cbData) const BYTE* pbData,
__in DWORD cbData,
__in DWORD dwFlags,
__out LPVOID* ppvObject,
__out_opt DWORD* pcbObject
);
HRESULT DAPI CrypMsgGetParam(
__in HCRYPTMSG hCryptMsg,
__in DWORD dwType,
__in DWORD dwIndex,
__out LPVOID* ppvData,
__out_opt DWORD* pcbData
);
HRESULT DAPI CrypHashFile(
__in_z LPCWSTR wzFilePath,
__in DWORD dwProvType,
__in ALG_ID algid,
__out_bcount(cbHash) BYTE* pbHash,
__in DWORD cbHash,
__out_opt DWORD64* pqwBytesHashed
);
HRESULT DAPI CrypHashFileHandle(
__in HANDLE hFile,
__in DWORD dwProvType,
__in ALG_ID algid,
__out_bcount(cbHash) BYTE* pbHash,
__in DWORD cbHash,
__out_opt DWORD64* pqwBytesHashed
);
HRESULT DAPI CrypHashBuffer(
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__in DWORD dwProvType,
__in ALG_ID algid,
__out_bcount(cbHash) BYTE* pbHash,
__in DWORD cbHash
);
HRESULT DAPI CrypEncryptMemory(
__inout LPVOID pData,
__in DWORD cbData,
__in DWORD dwFlags
);
HRESULT DAPI CrypDecryptMemory(
__inout LPVOID pData,
__in DWORD cbData,
__in DWORD dwFlags
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,153 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="custommsierrors.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//-------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Indexes for custom errors in the MSI
//
// Note: Custom Errors must be in the range 25000-30000, all other error
// codes are reserved for the Windows Installer as standard error ranges
// NEVER reuse an error number or you're likely to break the builds.
//---------------------------------------------------------------------------
// Instructions:
// 1. add the index to this file
// 2. define the error table row
// 3. #include CustomMsiErrors to refer to the index
// 4. Import Misc\CustomErrors { MYDEFINE=1 }; with your errorgroup under MYDEFINE
//---------------------------------------------------------------------------
// GLOBAL 25501-25600
#define GLOBAL_ERROR_BASE 25501
#define msierrSecureObjectsFailedCreateSD 25520
#define msierrSecureObjectsFailedSet 25521
#define msierrSecureObjectsUnknownType 25522
#define msierrXmlFileFailedRead 25530
#define msierrXmlFileFailedOpen 25531
#define msierrXmlFileFailedSelect 25532
#define msierrXmlFileFailedSave 25533
#define msierrXmlConfigFailedRead 25540
#define msierrXmlConfigFailedOpen 25541
#define msierrXmlConfigFailedSelect 25542
#define msierrXmlConfigFailedSave 25543
#define msierrFirewallCannotConnect 25580
//---------------------------------------------------------------------------
// Server CustomAction Errors
// SERVER range: 26001-26100
#define SERVER_ERROR_BASE 26000
#define msierrIISCannotConnect 26001
#define msierrIISFailedReadWebSite 26002
#define msierrIISFailedReadWebDirs 26003
#define msierrIISFailedReadVDirs 26004
#define msierrIISFailedReadFilters 26005
#define msierrIISFailedReadAppPool 26006
#define msierrIISFailedReadMimeMap 26007
#define msierrIISFailedReadProp 26008
#define msierrIISFailedReadWebSvcExt 26009
#define msierrIISFailedReadWebError 26010
#define msierrIISFailedReadHttpHeader 26011
#define msierrIISFailedSchedTransaction 26031
#define msierrIISFailedSchedInstallWebs 26032
#define msierrIISFailedSchedInstallWebDirs 26033
#define msierrIISFailedSchedInstallVDirs 26034
#define msierrIISFailedSchedInstallFilters 26035
#define msierrIISFailedSchedInstallAppPool 26036
#define msierrIISFailedSchedInstallProp 26037
#define msierrIISFailedSchedInstallWebSvcExt 26038
#define msierrIISFailedSchedUninstallWebs 26051
#define msierrIISFailedSchedUninstallWebDirs 26052
#define msierrIISFailedSchedUninstallVDirs 26053
#define msierrIISFailedSchedUninstallFilters 26054
#define msierrIISFailedSchedUninstallAppPool 26055
#define msierrIISFailedSchedUninstallProp 26056
#define msierrIISFailedSchedUninstallWebSvcExt 26057
#define msierrIISFailedStartTransaction 26101
#define msierrIISFailedOpenKey 26102
#define msierrIISFailedCreateKey 26103
#define msierrIISFailedWriteData 26104
#define msierrIISFailedCreateApp 26105
#define msierrIISFailedDeleteKey 26106
#define msierrIISFailedDeleteApp 26107
#define msierrIISFailedDeleteValue 26108
#define msierrIISFailedCommitInUse 26109
#define msierrSQLFailedCreateDatabase 26201
#define msierrSQLFailedDropDatabase 26202
#define msierrSQLFailedConnectDatabase 26203
#define msierrSQLFailedExecString 26204
#define msierrSQLDatabaseAlreadyExists 26205
#define msierrPERFMONFailedRegisterDLL 26251
#define msierrPERFMONFailedUnregisterDLL 26252
#define msierrInstallPerfCounterData 26253
#define msierrUninstallPerfCounterData 26254
#define msierrSMBFailedCreate 26301
#define msierrSMBFailedDrop 26302
#define msierrCERTFailedOpen 26351
#define msierrCERTFailedAdd 26352
#define msierrUSRFailedUserCreate 26401
#define msierrUSRFailedUserCreatePswd 26402
#define msierrUSRFailedUserGroupAdd 26403
#define msierrUSRFailedUserCreateExists 26404
#define msierrUSRFailedGrantLogonAsService 26405
#define msierrDependencyMissingDependencies 26451
#define msierrDependencyHasDependents 26452
//--------------------------------------------------------------------------
// Managed code CustomAction Errors
// MANAGED range: 27000-27100
#define MANAGED_ERROR_BASE 27000
#define msierrDotNetRuntimeRequired 27000
//---------------------------------------------------------------------------
// Public CustomAction Errors
// PUBLIC range: 28001-28100
#define PUBLIC_ERROR_BASE 28000
#define msierrComPlusCannotConnect 28001
#define msierrComPlusPartitionReadFailed 28002
#define msierrComPlusPartitionRoleReadFailed 28003
#define msierrComPlusUserInPartitionRoleReadFailed 28004
#define msierrComPlusPartitionUserReadFailed 28005
#define msierrComPlusApplicationReadFailed 28006
#define msierrComPlusApplicationRoleReadFailed 28007
#define msierrComPlusUserInApplicationRoleReadFailed 28008
#define msierrComPlusAssembliesReadFailed 28009
#define msierrComPlusSubscriptionReadFailed 28010
#define msierrComPlusPartitionDependency 28011
#define msierrComPlusPartitionNotFound 28012
#define msierrComPlusPartitionIdConflict 28013
#define msierrComPlusPartitionNameConflict 28014
#define msierrComPlusApplicationDependency 28015
#define msierrComPlusApplicationNotFound 28016
#define msierrComPlusApplicationIdConflict 28017
#define msierrComPlusApplicationNameConflict 28018
#define msierrComPlusApplicationRoleDependency 28019
#define msierrComPlusApplicationRoleNotFound 28020
#define msierrComPlusApplicationRoleConflict 28021
#define msierrComPlusAssemblyDependency 28022
#define msierrComPlusSubscriptionIdConflict 28023
#define msierrComPlusSubscriptionNameConflict 28024
#define msierrComPlusFailedLookupNames 28025
#define msierrMsmqCannotConnect 28101

157
tools/WIX/sdk/inc/deputil.h Normal file
View file

@ -0,0 +1,157 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="deputil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Common function declarations for the dependency/ref-counting feature.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseDependencyArray(rg, c) if (rg) { DepDependencyArrayFree(rg, c); }
#define ReleaseNullDependencyArray(rg, c) if (rg) { DepDependencyArrayFree(rg, c); rg = NULL; }
typedef struct _DEPENDENCY
{
LPWSTR sczKey;
LPWSTR sczName;
} DEPENDENCY;
/***************************************************************************
DepGetProviderInformation - gets the various pieces of data registered
with a dependency.
Note: Returns E_NOTFOUND if the dependency was not found.
***************************************************************************/
DAPI_(HRESULT) DepGetProviderInformation(
__in HKEY hkHive,
__in_z LPCWSTR wzProviderKey,
__deref_out_z_opt LPWSTR* psczId,
__deref_out_z_opt LPWSTR* psczName,
__out_opt DWORD64* pqwVersion
);
/***************************************************************************
DepCheckDependency - Checks that the dependency is registered and within
the proper version range.
Note: Returns E_NOTFOUND if the dependency was not found.
***************************************************************************/
DAPI_(HRESULT) DepCheckDependency(
__in HKEY hkHive,
__in_z LPCWSTR wzProviderKey,
__in_z_opt LPCWSTR wzMinVersion,
__in_z_opt LPCWSTR wzMaxVersion,
__in int iAttributes,
__in STRINGDICT_HANDLE sdDependencies,
__deref_inout_ecount_opt(*pcDependencies) DEPENDENCY** prgDependencies,
__inout LPUINT pcDependencies
);
/***************************************************************************
DepCheckDependents - Checks if any dependents are still installed for the
given provider key.
***************************************************************************/
DAPI_(HRESULT) DepCheckDependents(
__in HKEY hkHive,
__in_z LPCWSTR wzProviderKey,
__in int iAttributes,
__in C_STRINGDICT_HANDLE sdIgnoredDependents,
__deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents,
__inout LPUINT pcDependents
);
/***************************************************************************
DepRegisterDependency - Registers the dependency provider.
***************************************************************************/
DAPI_(HRESULT) DepRegisterDependency(
__in HKEY hkHive,
__in_z LPCWSTR wzProviderKey,
__in_z LPCWSTR wzVersion,
__in_z LPCWSTR wzDisplayName,
__in_z_opt LPCWSTR wzId,
__in int iAttributes
);
/***************************************************************************
DepDependentExists - Determines if a dependent is registered.
Note: Returns S_OK if dependent is registered.
Returns E_FILENOTFOUND if dependent is not registered
***************************************************************************/
DAPI_(HRESULT) DepDependentExists(
__in HKEY hkHive,
__in_z LPCWSTR wzDependencyProviderKey,
__in_z LPCWSTR wzProviderKey
);
/***************************************************************************
DepRegisterDependent - Registers a dependent under the dependency provider.
***************************************************************************/
DAPI_(HRESULT) DepRegisterDependent(
__in HKEY hkHive,
__in_z LPCWSTR wzDependencyProviderKey,
__in_z LPCWSTR wzProviderKey,
__in_z_opt LPCWSTR wzMinVersion,
__in_z_opt LPCWSTR wzMaxVersion,
__in int iAttributes
);
/***************************************************************************
DepUnregisterDependency - Removes the dependency provider.
Note: Caller should call CheckDependents prior to remove a dependency.
Returns E_FILENOTFOUND if the dependency is not registered.
***************************************************************************/
DAPI_(HRESULT) DepUnregisterDependency(
__in HKEY hkHive,
__in_z LPCWSTR wzProviderKey
);
/***************************************************************************
DepUnregisterDependent - Removes a dependent under the dependency provider.
Note: Returns E_FILENOTFOUND if neither the dependency or dependent are
registered.
***************************************************************************/
DAPI_(HRESULT) DepUnregisterDependent(
__in HKEY hkHive,
__in_z LPCWSTR wzDependencyProviderKey,
__in_z LPCWSTR wzProviderKey
);
/***************************************************************************
DependencyArrayAlloc - Allocates or expands an array of DEPENDENCY structs.
***************************************************************************/
DAPI_(HRESULT) DepDependencyArrayAlloc(
__deref_inout_ecount_opt(*pcDependencies) DEPENDENCY** prgDependencies,
__inout LPUINT pcDependencies,
__in_z LPCWSTR wzKey,
__in_z_opt LPCWSTR wzName
);
/***************************************************************************
DepDependencyArrayFree - Frees an array of DEPENDENCY structs.
***************************************************************************/
DAPI_(void) DepDependencyArrayFree(
__in_ecount(cDependencies) DEPENDENCY* rgDependencies,
__in UINT cDependencies
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,79 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="dictutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for string dict helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseDict(sdh) if (sdh) { DictDestroy(sdh); }
#define ReleaseNullDict(sdh) if (sdh) { DictDestroy(sdh); sdh = NULL; }
typedef void* STRINGDICT_HANDLE;
typedef const void* C_STRINGDICT_HANDLE;
extern const int STRINGDICT_HANDLE_BYTES;
typedef enum DICT_FLAG
{
DICT_FLAG_NONE = 0,
DICT_FLAG_CASEINSENSITIVE = 1
} DICT_FLAG;
HRESULT DAPI DictCreateWithEmbeddedKey(
__out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle,
__in DWORD dwNumExpectedItems,
__in_opt void **ppvArray,
__in size_t cByteOffset,
__in DICT_FLAG dfFlags
);
HRESULT DAPI DictCreateStringList(
__out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle,
__in DWORD dwNumExpectedItems,
__in DICT_FLAG dfFlags
);
HRESULT DAPI DictCreateStringListFromArray(
__out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle,
__in_ecount(cStringArray) const LPCWSTR* rgwzStringArray,
__in const DWORD cStringArray,
__in DICT_FLAG dfFlags
);
HRESULT DAPI DictCompareStringListToArray(
__in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdStringList,
__in_ecount(cStringArray) const LPCWSTR* rgwzStringArray,
__in const DWORD cStringArray
);
HRESULT DAPI DictAddKey(
__in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle,
__in_z LPCWSTR szString
);
HRESULT DAPI DictAddValue(
__in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle,
__in void *pvValue
);
HRESULT DAPI DictKeyExists(
__in_bcount(STRINGDICT_HANDLE_BYTES) C_STRINGDICT_HANDLE sdHandle,
__in_z LPCWSTR szString
);
HRESULT DAPI DictGetValue(
__in_bcount(STRINGDICT_HANDLE_BYTES) C_STRINGDICT_HANDLE sdHandle,
__in_z LPCWSTR szString,
__out void **ppvValue
);
void DAPI DictDestroy(
__in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,65 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="dirutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Directory helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
typedef enum DIR_DELETE
{
DIR_DELETE_FILES = 1,
DIR_DELETE_RECURSE = 2,
DIR_DELETE_SCHEDULE = 4,
} DIR_DELETE;
#ifdef __cplusplus
extern "C" {
#endif
BOOL DAPI DirExists(
__in_z LPCWSTR wzPath,
__out_opt DWORD *pdwAttributes
);
HRESULT DAPI DirCreateTempPath(
__in_z LPCWSTR wzPrefix,
__out_ecount_z(cchPath) LPWSTR wzPath,
__in DWORD cchPath
);
HRESULT DAPI DirEnsureExists(
__in_z LPCWSTR wzPath,
__in_opt LPSECURITY_ATTRIBUTES psa
);
HRESULT DAPI DirEnsureDelete(
__in_z LPCWSTR wzPath,
__in BOOL fDeleteFiles,
__in BOOL fRecurse
);
HRESULT DAPI DirEnsureDeleteEx(
__in_z LPCWSTR wzPath,
__in DWORD dwFlags
);
HRESULT DAPI DirGetCurrent(
__deref_out_z LPWSTR* psczCurrentDirectory
);
HRESULT DAPI DirSetCurrent(
__in_z LPCWSTR wzDirectory
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,71 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="downloadengine.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Setup chainer/bootstrapper download engine for WiX toolset.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef HRESULT (WINAPI *LPAUTHENTICATION_ROUTINE)(
__in LPVOID pVoid,
__in HINTERNET hUrl,
__in long lHttpCode,
__out BOOL* pfRetrySend,
__out BOOL* pfRetry
);
typedef int (WINAPI *LPCANCEL_ROUTINE)(
__in HRESULT hrError,
__in_z_opt LPCWSTR wzError,
__in BOOL fAllowRetry,
__in_opt LPVOID pvContext
);
// structs
typedef struct _DOWNLOAD_SOURCE
{
LPWSTR sczUrl;
LPWSTR sczUser;
LPWSTR sczPassword;
} DOWNLOAD_SOURCE;
typedef struct _DOWNLOAD_CACHE_CALLBACK
{
LPPROGRESS_ROUTINE pfnProgress;
LPCANCEL_ROUTINE pfnCancel;
LPVOID pv;
} DOWNLOAD_CACHE_CALLBACK;
typedef struct _DOWNLOAD_AUTHENTICATION_CALLBACK
{
LPAUTHENTICATION_ROUTINE pfnAuthenticate;
LPVOID pv;
} DOWNLOAD_AUTHENTICATION_CALLBACK;
// functions
HRESULT DAPI DownloadUrl(
__in DOWNLOAD_SOURCE* pDownloadSource,
__in DWORD64 dw64AuthoredDownloadSize,
__in LPCWSTR wzDestinationPath,
__in_opt DOWNLOAD_CACHE_CALLBACK* pCache,
__in_opt DOWNLOAD_AUTHENTICATION_CALLBACK* pAuthenticate
);
#ifdef __cplusplus
}
#endif

235
tools/WIX/sdk/inc/dutil.h Normal file
View file

@ -0,0 +1,235 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="dutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for utility layer that provides standard support for asserts, exit macros
// </summary>
//-------------------------------------------------------------------------------------------------
#define DAPI __stdcall
#define DAPIV __cdecl // used only for functions taking variable length arguments
#define DAPI_(type) EXTERN_C type DAPI
#define DAPIV_(type) EXTERN_C type DAPIV
// enums
typedef enum REPORT_LEVEL
{
REPORT_NONE, // turns off report (only valid for XXXSetLevel())
REPORT_WARNING, // written if want only warnings or reporting is on in general
REPORT_STANDARD, // written if reporting is on
REPORT_VERBOSE, // written only if verbose reporting is on
REPORT_DEBUG, // reporting useful when debugging code
REPORT_ERROR, // always gets reported, but can never be specified
} REPORT_LEVEL;
// asserts and traces
typedef BOOL (DAPI *DUTIL_ASSERTDISPLAYFUNCTION)(__in_z LPCSTR sz);
#ifdef __cplusplus
extern "C" {
#endif
void DAPI Dutil_SetAssertModule(__in HMODULE hAssertModule);
void DAPI Dutil_SetAssertDisplayFunction(__in DUTIL_ASSERTDISPLAYFUNCTION pfn);
void DAPI Dutil_Assert(__in_z LPCSTR szFile, __in int iLine);
void DAPI Dutil_AssertSz(__in_z LPCSTR szFile, __in int iLine, __in_z LPCSTR szMsg);
void DAPI Dutil_TraceSetLevel(__in REPORT_LEVEL ll, __in BOOL fTraceFilenames);
REPORT_LEVEL DAPI Dutil_TraceGetLevel();
void __cdecl Dutil_Trace(__in_z LPCSTR szFile, __in int iLine, __in REPORT_LEVEL rl, __in_z __format_string LPCSTR szMessage, ...);
void __cdecl Dutil_TraceError(__in_z LPCSTR szFile, __in int iLine, __in REPORT_LEVEL rl, __in HRESULT hr, __in_z __format_string LPCSTR szMessage, ...);
void DAPI Dutil_RootFailure(__in_z LPCSTR szFile, __in int iLine, __in HRESULT hrError);
#ifdef __cplusplus
}
#endif
#ifdef DEBUG
#define AssertSetModule(m) (void)Dutil_SetAssertModule(m)
#define AssertSetDisplayFunction(pfn) (void)Dutil_SetAssertDisplayFunction(pfn)
#define Assert(f) ((f) ? (void)0 : (void)Dutil_Assert(__FILE__, __LINE__))
#define AssertSz(f, sz) ((f) ? (void)0 : (void)Dutil_AssertSz(__FILE__, __LINE__, sz))
#define TraceSetLevel(l, f) (void)Dutil_TraceSetLevel(l, f)
#define TraceGetLevel() (REPORT_LEVEL)Dutil_TraceGetLevel()
#define Trace(l, f) (void)Dutil_Trace(__FILE__, __LINE__, l, f, NULL)
#define Trace1(l, f, s) (void)Dutil_Trace(__FILE__, __LINE__, l, f, s)
#define Trace2(l, f, s, t) (void)Dutil_Trace(__FILE__, __LINE__, l, f, s, t)
#define Trace3(l, f, s, t, u) (void)Dutil_Trace(__FILE__, __LINE__, l, f, s, t, u)
#define TraceError(x, f) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_ERROR, x, f, NULL)
#define TraceError1(x, f, s) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_ERROR, x, f, s)
#define TraceError2(x, f, s, t) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_ERROR, x, f, s, t)
#define TraceError3(x, f, s, t, u) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_ERROR, x, f, s, t, u)
#define TraceErrorDebug(x, f) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_DEBUG, x, f, NULL)
#define TraceErrorDebug1(x, f, s) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_DEBUG, x, f, s)
#define TraceErrorDebug2(x, f, s, t) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_DEBUG, x, f, s, t)
#define TraceErrorDebug3(x, f, s, t, u) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_DEBUG, x, f, s, t, u)
#else // !DEBUG
#define AssertSetModule(m)
#define AssertSetDisplayFunction(pfn)
#define Assert(f)
#define AssertSz(f, sz)
#define TraceSetLevel(l, f)
#define Trace(l, f)
#define Trace1(l, f, s)
#define Trace2(l, f, s, t)
#define Trace3(l, f, s, t, u)
#define TraceError(x, f)
#define TraceError1(x, f, s)
#define TraceError2(x, f, s, t)
#define TraceError3(x, f, s, t, u)
#define TraceErrorDebug(x, f)
#define TraceErrorDebug1(x, f, s)
#define TraceErrorDebug2(x, f, s, t)
#define TraceErrorDebug3(x, f, s, t, u)
#endif // DEBUG
// ExitTrace can be overriden
#ifndef ExitTrace
#define ExitTrace TraceError
#endif
#ifndef ExitTrace1
#define ExitTrace1 TraceError1
#endif
#ifndef ExitTrace2
#define ExitTrace2 TraceError2
#endif
#ifndef ExitTrace3
#define ExitTrace3 TraceError3
#endif
// Exit macros
#define ExitFunction() { goto LExit; }
#define ExitFunction1(x) { x; goto LExit; }
#define ExitFunctionWithLastError(x) { x = HRESULT_FROM_WIN32(::GetLastError()); goto LExit; }
#define ExitOnLastError(x, s) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; } }
#define ExitOnLastError1(x, f, s) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; } }
#define ExitOnLastError2(x, f, s, t) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; } }
#define ExitOnLastErrorDebugTrace(x, s) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); TraceErrorDebug(x, s); goto LExit; } }
#define ExitOnLastErrorDebugTrace1(x, f, s) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); TraceErrorDebug1(x, f, s); goto LExit; } }
#define ExitOnLastErrorDebugTrace2(x, f, s, t) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); TraceErrorDebug2(x, f, s, t); goto LExit; } }
#define ExitWithLastError(x, s) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; }
#define ExitWithLastError1(x, f, s) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define ExitWithLastError2(x, f, s, t) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; }
#define ExitWithLastError3(x, f, s, t, u) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace3(x, f, s, t, u); goto LExit; }
#define ExitOnFailure(x, s) if (FAILED(x)) { ExitTrace(x, s); goto LExit; }
#define ExitOnFailure1(x, f, s) if (FAILED(x)) { ExitTrace1(x, f, s); goto LExit; }
#define ExitOnFailure2(x, f, s, t) if (FAILED(x)) { ExitTrace2(x, f, s, t); goto LExit; }
#define ExitOnFailure3(x, f, s, t, u) if (FAILED(x)) { ExitTrace3(x, f, s, t, u); goto LExit; }
#define ExitOnRootFailure(x, s) if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; }
#define ExitOnRootFailure1(x, f, s) if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define ExitOnRootFailure2(x, f, s, t) if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; }
#define ExitOnRootFailure3(x, f, s, t, u) if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace3(x, f, s, t, u); goto LExit; }
#define ExitOnFailureDebugTrace(x, s) if (FAILED(x)) { TraceErrorDebug(x, s); goto LExit; }
#define ExitOnFailureDebugTrace1(x, f, s) if (FAILED(x)) { TraceErrorDebug1(x, f, s); goto LExit; }
#define ExitOnFailureDebugTrace2(x, f, s, t) if (FAILED(x)) { TraceErrorDebug2(x, f, s, t); goto LExit; }
#define ExitOnFailureDebugTrace3(x, f, s, t, u) if (FAILED(x)) { TraceErrorDebug3(x, f, s, t, u); goto LExit; }
#define ExitOnNull(p, x, e, s) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; }
#define ExitOnNull1(p, x, e, f, s) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define ExitOnNull2(p, x, e, f, s, t) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; }
#define ExitOnNullWithLastError(p, x, s) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; }
#define ExitOnNullWithLastError1(p, x, f, s) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define ExitOnNullDebugTrace(p, x, e, s) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); TraceErrorDebug(x, s); goto LExit; }
#define ExitOnNullDebugTrace1(p, x, e, f, s) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); TraceErrorDebug1(x, f, s); goto LExit; }
#define ExitOnInvalidHandleWithLastError(p, x, s) if (INVALID_HANDLE_VALUE == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; }
#define ExitOnInvalidHandleWithLastError1(p, x, f, s) if (INVALID_HANDLE_VALUE == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define ExitOnWin32Error(e, x, s) if (ERROR_SUCCESS != e) { x = HRESULT_FROM_WIN32(e); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; }
#define ExitOnWin32Error1(e, x, f, s) if (ERROR_SUCCESS != e) { x = HRESULT_FROM_WIN32(e); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define ExitOnWin32Error2(e, x, f, s, t) if (ERROR_SUCCESS != e) { x = HRESULT_FROM_WIN32(e); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; }
// release macros
#define ReleaseObject(x) if (x) { x->Release(); }
#define ReleaseObjectArray(prg, cel) if (prg) { for (DWORD Dutil_ReleaseObjectArrayIndex = 0; Dutil_ReleaseObjectArrayIndex < cel; ++Dutil_ReleaseObjectArrayIndex) { ReleaseObject(prg[Dutil_ReleaseObjectArrayIndex]); } ReleaseMem(prg); }
#define ReleaseVariant(x) { ::VariantClear(&x); }
#define ReleaseNullObject(x) if (x) { (x)->Release(); x = NULL; }
#define ReleaseCertificate(x) if (x) { ::CertFreeCertificateContext(x); x=NULL; }
#define ReleaseHandle(x) if (x) { ::CloseHandle(x); x = NULL; }
// useful defines and macros
#define Unused(x) ((void)x)
#ifndef countof
#if 1
#define countof(ary) (sizeof(ary) / sizeof(ary[0]))
#else
#ifndef __cplusplus
#define countof(ary) (sizeof(ary) / sizeof(ary[0]))
#else
template<typename T> static char countofVerify(void const *, T) throw() { return 0; }
template<typename T> static void countofVerify(T *const, T *const *) throw() {};
#define countof(arr) (sizeof(countofVerify(arr,&(arr))) * sizeof(arr)/sizeof(*(arr)))
#endif
#endif
#endif
#define roundup(x, n) roundup_typed(x, n, DWORD)
#define roundup_typed(x, n, t) (((t)(x) + ((t)(n) - 1)) & ~((t)(n) - 1))
#define HRESULT_FROM_RPC(x) ((HRESULT) ((x) | FACILITY_RPC))
#ifndef MAXSIZE_T
#define MAXSIZE_T ((SIZE_T)~((SIZE_T)0))
#endif
typedef const BYTE* LPCBYTE;
#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
#define E_PATHNOTFOUND HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)
#define E_INVALIDDATA HRESULT_FROM_WIN32(ERROR_INVALID_DATA)
#define E_INVALIDSTATE HRESULT_FROM_WIN32(ERROR_INVALID_STATE)
#define E_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
#define E_MOREDATA HRESULT_FROM_WIN32(ERROR_MORE_DATA)
#define E_NOMOREITEMS HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS)
#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
#define E_MODNOTFOUND HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND)
#define E_BADCONFIGURATION HRESULT_FROM_WIN32(ERROR_BAD_CONFIGURATION)
#define AddRefAndRelease(x) { x->AddRef(); x->Release(); }
#define MAKEDWORD(lo, hi) ((DWORD)MAKELONG(lo, hi))
#define MAKEQWORDVERSION(mj, mi, b, r) (((DWORD64)MAKELONG(r, b)) | (((DWORD64)MAKELONG(mi, mj)) << 32))
#ifdef __cplusplus
extern "C" {
#endif
// other functions
HRESULT DAPI LoadSystemLibrary(__in_z LPCWSTR wzModuleName, __out HMODULE *phModule);
HRESULT DAPI LoadSystemLibraryWithPath(__in_z LPCWSTR wzModuleName, __out HMODULE *phModule, __deref_out_z_opt LPWSTR* psczPath);
#ifdef __cplusplus
}
#endif

233
tools/WIX/sdk/inc/eseutil.h Normal file
View file

@ -0,0 +1,233 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="eseutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Extensible Storage Engine (Jetblue) helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseEseQuery(pqh) if (pqh) { EseFinishQuery(pqh); }
#define ReleaseNullEseQuery(pqh) if (pqh) { EseFinishQuery(pqh); pqh = NULL; }
struct ESE_COLUMN_SCHEMA
{
JET_COLUMNID jcColumn;
LPCWSTR pszName;
JET_COLTYP jcColumnType;
BOOL fKey; // If this column is part of the key of the table
BOOL fFixed;
BOOL fNullable;
BOOL fAutoIncrement;
};
struct ESE_TABLE_SCHEMA
{
JET_TABLEID jtTable;
LPCWSTR pszName;
DWORD dwColumns;
ESE_COLUMN_SCHEMA *pcsColumns;
};
struct ESE_DATABASE_SCHEMA
{
DWORD dwTables;
ESE_TABLE_SCHEMA *ptsTables;
};
typedef enum ESE_QUERY_TYPE
{
ESE_QUERY_EXACT,
ESE_QUERY_FROM_TOP,
ESE_QUERY_FROM_BOTTOM
} ESE_QUERY_TYPE;
typedef void* ESE_QUERY_HANDLE;
HRESULT DAPI EseBeginSession(
__out JET_INSTANCE *pjiInstance,
__out JET_SESID *pjsSession,
__in_z LPCWSTR pszInstance,
__in_z LPCWSTR pszPath
);
HRESULT DAPI EseEndSession(
__in JET_INSTANCE jiInstance,
__in JET_SESID jsSession
);
HRESULT DAPI EseEnsureDatabase(
__in JET_SESID jsSession,
__in_z LPCWSTR pszFile,
__in ESE_DATABASE_SCHEMA *pdsSchema,
__out JET_DBID* pjdbDb,
__in BOOL fExclusive,
__in BOOL fReadonly
);
HRESULT DAPI EseCloseDatabase(
__in JET_SESID jsSession,
__in JET_DBID jdbDb
);
HRESULT DAPI EseCreateTable(
__in JET_SESID jsSession,
__in JET_DBID jdbDb,
__in_z LPCWSTR pszTable,
__out JET_TABLEID *pjtTable
);
HRESULT DAPI EseOpenTable(
__in JET_SESID jsSession,
__in JET_DBID jdbDb,
__in_z LPCWSTR pszTable,
__out JET_TABLEID *pjtTable
);
HRESULT DAPI EseCloseTable(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable
);
HRESULT DAPI EseEnsureColumn(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable,
__in_z LPCWSTR pszColumnName,
__in JET_COLTYP jcColumnType,
__in ULONG ulColumnSize,
__in BOOL fFixed,
__in BOOL fNullable,
__out_opt JET_COLUMNID *pjcColumn
);
HRESULT DAPI EseGetColumn(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable,
__in_z LPCWSTR pszColumnName,
__out JET_COLUMNID *pjcColumn
);
HRESULT DAPI EseMoveCursor(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable,
__in LONG lRow
);
HRESULT DAPI EseDeleteRow(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable
);
HRESULT DAPI EseBeginTransaction(
__in JET_SESID jsSession
);
HRESULT DAPI EseRollbackTransaction(
__in JET_SESID jsSession,
__in BOOL fAll
);
HRESULT DAPI EseCommitTransaction(
__in JET_SESID jsSession
);
HRESULT DAPI EsePrepareUpdate(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable,
__in ULONG ulPrep
);
HRESULT DAPI EseFinishUpdate(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable,
__in BOOL fSeekToInsertedRecord
);
HRESULT DAPI EseSetColumnBinary(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer
);
HRESULT DAPI EseSetColumnDword(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__in DWORD dwValue
);
HRESULT DAPI EseSetColumnBool(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__in BOOL fValue
);
HRESULT DAPI EseSetColumnString(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__in_z LPCWSTR pszValue
);
HRESULT DAPI EseSetColumnEmpty(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn
);
HRESULT DAPI EseGetColumnBinary(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__deref_out_bcount(*piBuffer) BYTE** ppbBuffer,
__inout SIZE_T* piBuffer
);
HRESULT DAPI EseGetColumnDword(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__out DWORD *pdwValue
);
HRESULT DAPI EseGetColumnBool(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__out BOOL *pfValue
);
HRESULT DAPI EseGetColumnString(
__in JET_SESID jsSession,
__in ESE_TABLE_SCHEMA tsTable,
__in DWORD dwColumn,
__out LPWSTR *ppszValue
);
// Call this once for each key column in the table
HRESULT DAPI EseBeginQuery(
__in JET_SESID jsSession,
__in JET_TABLEID jtTable,
__in ESE_QUERY_TYPE qtQueryType,
__out ESE_QUERY_HANDLE *peqhHandle
);
HRESULT DAPI EseSetQueryColumnBinary(
__in ESE_QUERY_HANDLE eqhHandle,
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer,
__in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
);
HRESULT DAPI EseSetQueryColumnDword(
__in ESE_QUERY_HANDLE eqhHandle,
__in DWORD dwData,
__in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
);
HRESULT DAPI EseSetQueryColumnBool(
__in ESE_QUERY_HANDLE eqhHandle,
__in BOOL fValue,
__in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
);
HRESULT DAPI EseSetQueryColumnString(
__in ESE_QUERY_HANDLE eqhHandle,
__in_z LPCWSTR pszString,
__in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
);
HRESULT DAPI EseFinishQuery(
__in ESE_QUERY_HANDLE eqhHandle
);
// Once all columns have been set up, call this and read the result
HRESULT DAPI EseRunQuery(
__in ESE_QUERY_HANDLE eqhHandle
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,229 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="fileutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for file helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseFile(h) if (INVALID_HANDLE_VALUE != h) { ::CloseHandle(h); h = INVALID_HANDLE_VALUE; }
#define ReleaseFileHandle(h) if (INVALID_HANDLE_VALUE != h) { ::CloseHandle(h); h = INVALID_HANDLE_VALUE; }
#define ReleaseFileFindHandle(h) if (INVALID_HANDLE_VALUE != h) { ::FindClose(h); h = INVALID_HANDLE_VALUE; }
#define FILEMAKEVERSION(major, minor, build, revision) static_cast<DWORD64>((static_cast<DWORD64>(major & 0xFFFF) << 48) \
| (static_cast<DWORD64>(minor & 0xFFFF) << 32) \
| (static_cast<DWORD64>(build & 0xFFFF) << 16) \
| (static_cast<DWORD64>(revision & 0xFFFF)))
typedef enum FILE_ARCHITECTURE
{
FILE_ARCHITECTURE_UNKNOWN,
FILE_ARCHITECTURE_X86,
FILE_ARCHITECTURE_X64,
FILE_ARCHITECTURE_IA64,
} FILE_ARCHITECTURE;
typedef enum FILE_ENCODING
{
FILE_ENCODING_UNSPECIFIED = 0,
// TODO: distinguish between non-BOM utf-8 and ANSI in the future?
FILE_ENCODING_UTF8,
FILE_ENCODING_UTF8_WITH_BOM,
FILE_ENCODING_UTF16,
FILE_ENCODING_UTF16_WITH_BOM,
} FILE_ENCODING;
LPWSTR DAPI FileFromPath(
__in_z LPCWSTR wzPath
);
HRESULT DAPI FileResolvePath(
__in_z LPCWSTR wzRelativePath,
__out LPWSTR *ppwzFullPath
);
HRESULT DAPI FileStripExtension(
__in_z LPCWSTR wzFileName,
__out LPWSTR *ppwzFileNameNoExtension
);
HRESULT DAPI FileChangeExtension(
__in_z LPCWSTR wzFileName,
__in_z LPCWSTR wzNewExtension,
__out LPWSTR *ppwzFileNameNewExtension
);
HRESULT DAPI FileAddSuffixToBaseName(
__in_z LPCWSTR wzFileName,
__in_z LPCWSTR wzSuffix,
__out_z LPWSTR* psczNewFileName
);
HRESULT DAPI FileVersionFromString(
__in_z LPCWSTR wzVersion,
__out DWORD *pdwVerMajor,
__out DWORD* pdwVerMinor
);
HRESULT DAPI FileVersionFromStringEx(
__in_z LPCWSTR wzVersion,
__in DWORD cchVersion,
__out DWORD64* pqwVersion
);
HRESULT DAPI FileVersionToStringEx(
__in DWORD64 qwVersion,
__out LPWSTR* psczVersion
);
HRESULT DAPI FileSetPointer(
__in HANDLE hFile,
__in DWORD64 dw64Move,
__out_opt DWORD64* pdw64NewPosition,
__in DWORD dwMoveMethod
);
HRESULT DAPI FileSize(
__in_z LPCWSTR pwzFileName,
__out LONGLONG* pllSize
);
HRESULT DAPI FileSizeByHandle(
__in HANDLE hFile,
__out LONGLONG* pllSize
);
BOOL DAPI FileExistsEx(
__in_z LPCWSTR wzPath,
__out_opt DWORD *pdwAttributes
);
BOOL DAPI FileExistsAfterRestart(
__in_z LPCWSTR wzPath,
__out_opt DWORD *pdwAttributes
);
HRESULT DAPI FileRemoveFromPendingRename(
__in_z LPCWSTR wzPath
);
HRESULT DAPI FileRead(
__deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
__out DWORD* pcbDest,
__in_z LPCWSTR wzSrcPath
);
HRESULT DAPI FileReadUntil(
__deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
__out_range(<=, cbMaxRead) DWORD* pcbDest,
__in_z LPCWSTR wzSrcPath,
__in DWORD cbMaxRead
);
HRESULT DAPI FileReadPartial(
__deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
__out_range(<=, cbMaxRead) DWORD* pcbDest,
__in_z LPCWSTR wzSrcPath,
__in BOOL fSeek,
__in DWORD cbStartPosition,
__in DWORD cbMaxRead,
__in BOOL fPartialOK
);
HRESULT DAPI FileWrite(
__in_z LPCWSTR pwzFileName,
__in DWORD dwFlagsAndAttributes,
__in_bcount_opt(cbData) LPCBYTE pbData,
__in DWORD cbData,
__out_opt HANDLE* pHandle
);
HRESULT DAPI FileWriteHandle(
__in HANDLE hFile,
__in_bcount_opt(cbData) LPCBYTE pbData,
__in DWORD cbData
);
HRESULT DAPI FileCopyUsingHandles(
__in HANDLE hSource,
__in HANDLE hTarget,
__in DWORD64 cbCopy,
__out_opt DWORD64* pcbCopied
);
HRESULT DAPI FileEnsureCopy(
__in_z LPCWSTR wzSource,
__in_z LPCWSTR wzTarget,
__in BOOL fOverwrite
);
HRESULT DAPI FileEnsureCopyWithRetry(
__in LPCWSTR wzSource,
__in LPCWSTR wzTarget,
__in BOOL fOverwrite,
__in DWORD cRetry,
__in DWORD dwWaitMilliseconds
);
HRESULT DAPI FileEnsureMove(
__in_z LPCWSTR wzSource,
__in_z LPCWSTR wzTarget,
__in BOOL fOverwrite,
__in BOOL fAllowCopy
);
HRESULT DAPI FileEnsureMoveWithRetry(
__in LPCWSTR wzSource,
__in LPCWSTR wzTarget,
__in BOOL fOverwrite,
__in BOOL fAllowCopy,
__in DWORD cRetry,
__in DWORD dwWaitMilliseconds
);
HRESULT DAPI FileCreateTemp(
__in_z LPCWSTR wzPrefix,
__in_z LPCWSTR wzExtension,
__deref_opt_out_z LPWSTR* ppwzTempFile,
__out_opt HANDLE* phTempFile
);
HRESULT DAPI FileCreateTempW(
__in_z LPCWSTR wzPrefix,
__in_z LPCWSTR wzExtension,
__deref_opt_out_z LPWSTR* ppwzTempFile,
__out_opt HANDLE* phTempFile
);
HRESULT DAPI FileVersion(
__in_z LPCWSTR wzFilename,
__out DWORD *pdwVerMajor,
__out DWORD* pdwVerMinor
);
HRESULT DAPI FileIsSame(
__in_z LPCWSTR wzFile1,
__in_z LPCWSTR wzFile2,
__out LPBOOL lpfSameFile
);
HRESULT DAPI FileEnsureDelete(
__in_z LPCWSTR wzFile
);
HRESULT DAPI FileGetTime(
__in_z LPCWSTR wzFile,
__out_opt LPFILETIME lpCreationTime,
__out_opt LPFILETIME lpLastAccessTime,
__out_opt LPFILETIME lpLastWriteTime
);
HRESULT DAPI FileSetTime(
__in_z LPCWSTR wzFile,
__in_opt const FILETIME *lpCreationTime,
__in_opt const FILETIME *lpLastAccessTime,
__in_opt const FILETIME *lpLastWriteTime
);
HRESULT DAPI FileResetTime(
__in_z LPCWSTR wzFile
);
HRESULT DAPI FileExecutableArchitecture(
__in_z LPCWSTR wzFile,
__out FILE_ARCHITECTURE *pArchitecture
);
HRESULT DAPI FileToString(
__in_z LPCWSTR wzFile,
__out LPWSTR *psczString,
__out_opt FILE_ENCODING *pfeEncoding
);
HRESULT DAPI FileFromString(
__in_z LPCWSTR wzFile,
__in DWORD dwFlagsAndAttributes,
__in_z LPCWSTR sczString,
__in FILE_ENCODING feEncoding
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,41 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="gdiputil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// GDI+ helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#define ExitOnGdipFailure(g, x, s) { x = GdipHresultFromStatus(g); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); goto LExit; } }
#define ExitOnGdipFailure1(g, x, f, s) { x = GdipHresultFromStatus(g); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; } }
#define ExitOnGdipFailure2(g, x, f, s, t) { x = GdipHresultFromStatus(g); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; } }
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI GdipBitmapFromResource(
__in_opt HINSTANCE hinst,
__in_z LPCSTR szId,
__out Gdiplus::Bitmap **ppBitmap
);
HRESULT DAPI GdipBitmapFromFile(
__in_z LPCWSTR wzFileName,
__out Gdiplus::Bitmap **ppBitmap
);
HRESULT DAPI GdipHresultFromStatus(
__in Gdiplus::Status gs
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,233 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="iis7util.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// IIS7 helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// IIS Config schema names
#define IIS_CONFIG_ADD L"add"
#define IIS_CONFIG_ALLOWED L"allowed"
#define IIS_CONFIG_APPHOST_ROOT L"MACHINE/WEBROOT/APPHOST"
#define IIS_CONFIG_APPLICATION L"application"
#define IIS_CONFIG_APPPOOL L"applicationPool"
#define IIS_CONFIG_APPPOOL_AUTO L"autoStart"
#define IIS_CONFIG_APPPOOL_SECTION L"system.applicationHost/applicationPools"
#define IIS_CONFIG_AUTOSTART L"serverAutoStart"
#define IIS_CONFIG_BINDING L"binding"
#define IIS_CONFIG_BINDINGINFO L"bindingInformation"
#define IIS_CONFIG_BINDINGS L"bindings"
#define IIS_CONFIG_DESC L"description"
#define IIS_CONFIG_EXECUTABLE L"scriptProcessor"
#define IIS_CONFIG_ENABLED L"enabled"
#define IIS_CONFIG_ENABLE32 L"enable32BitAppOnWin64"
#define IIS_CONFIG_FILEEXT L"fileExtension"
#define IIS_CONFIG_FILTER L"filter"
#define IIS_CONFIG_GROUPID L"groupId"
#define IIS_CONFIG_HEADERS L"customHeaders"
#define IIS_CONFIG_HTTPERRORS_SECTION L"system.webServer/httpErrors"
#define IIS_CONFIG_ID L"id"
#define IIS_CONFIG_ISAPI_SECTION L"system.webServer/isapiFilters"
#define IIS_CONFIG_HTTPPROTO_SECTION L"system.webServer/httpProtocol"
#define IIS_CONFIG_LOG_SECTION L"system.applicationHost/log"
#define IIS_CONFIG_LOG_UTF8 L"logInUTF8"
#define IIS_CONFIG_LIMITS L"limits"
#define IIS_CONFIG_PIPELINEMODE L"managedPipelineMode"
#define IIS_CONFIG_MANAGEDRUNTIMEVERSION L"managedRuntimeVersion"
#define IIS_CONFIG_WEBLOG L"logFile"
#define IIS_CONFIG_LOGFORMAT L"logFormat"
#define IIS_CONFIG_MIMEMAP L"mimeMap"
#define IIS_CONFIG_MIMETYPE L"mimeType"
#define IIS_CONFIG_MODULES L"modules"
#define IIS_CONFIG_NAME L"name"
#define IIS_CONFIG_PATH L"path"
#define IIS_CONFIG_PHYSPATH L"physicalPath"
#define IIS_CONFIG_PROTOCOL L"protocol"
#define IIS_CONFIG_RESTRICTION_SECTION L"system.webServer/security/isapiCgiRestriction"
#define IIS_CONFIG_SITE L"site"
#define IIS_CONFIG_SITE_ID L"id"
#define IIS_CONFIG_SITES_SECTION L"system.applicationHost/sites"
#define IIS_CONFIG_CONNECTTIMEOUT L"connectionTimeout"
#define IIS_CONFIG_VDIR L"virtualDirectory"
#define IIS_CONFIG_VALUE L"value"
#define IIS_CONFIG_VERBS L"verb"
#define IIS_CONFIG_WEBLIMITS_SECTION L"system.applicationHost/webLimits"
#define IIS_CONFIG_WEBLIMITS_MAXBAND L"maxGlobalBandwidth"
#define IIS_CONFIG_TRUE L"true"
#define IIS_CONFIG_FALSE L"false"
#define IIS_CONFIG_ERROR L"error"
#define IIS_CONFIG_STATUSCODE L"statusCode"
#define IIS_CONFIG_SUBSTATUS L"subStatusCode"
#define IIS_CONFIG_LANGPATH L"prefixLanguageFilePath"
#define IIS_CONFIG_RESPMODE L"responseMode"
#define IIS_CONFIG_CLEAR L"clear"
#define IIS_CONFIG_RECYCLING L"recycling"
#define IIS_CONFIG_PEROIDRESTART L"periodicRestart"
#define IIS_CONFIG_TIME L"time"
#define IIS_CONFIG_REQUESTS L"requests"
#define IIS_CONFIG_SCHEDULE L"schedule"
#define IIS_CONFIG_MEMORY L"memory"
#define IIS_CONFIG_PRIVMEMORY L"privateMemory"
#define IIS_CONFIG_PROCESSMODEL L"processModel"
#define IIS_CONFIG_IDLETIMEOUT L"idleTimeout"
#define IIS_CONFIG_QUEUELENGTH L"queueLength"
#define IIS_CONFIG_IDENITITYTYPE L"identityType"
#define IIS_CONFIG_LOCALSYSTEM L"LocalSystem"
#define IIS_CONFIG_LOCALSERVICE L"LocalService"
#define IIS_CONFIG_NETWORKSERVICE L"NetworkService"
#define IIS_CONFIG_SPECIFICUSER L"SpecificUser"
#define IIS_CONFIG_APPLICATIONPOOLIDENTITY L"ApplicationPoolIdentity"
#define IIS_CONFIG_USERNAME L"userName"
#define IIS_CONFIG_PASSWORD L"password"
#define IIS_CONFIG_CPU L"cpu"
#define IIS_CONFIG_LIMIT L"limit"
#define IIS_CONFIG_CPU_ACTION L"action"
#define IIS_CONFIG_KILLW3WP L"KillW3wp"
#define IIS_CONFIG_NOACTION L"NoAction"
#define IIS_CONFIG_RESETINTERVAL L"resetInterval"
#define IIS_CONFIG_MAXWRKPROCESSES L"maxProcesses"
#define IIS_CONFIG_HANDLERS_SECTION L"system.webServer/handlers"
#define IIS_CONFIG_DEFAULTDOC_SECTION L"system.webServer/defaultDocument"
#define IIS_CONFIG_ASP_SECTION L"system.webServer/asp"
#define IIS_CONFIG_SCRIPTERROR L"scriptErrorSentToBrowser"
#define IIS_CONFIG_STATICCONTENT_SECTION L"system.webServer/staticContent"
#define IIS_CONFIG_HTTPEXPIRES L"httpExpires"
#define IIS_CONFIG_MAXAGE L"cacheControlMaxAge"
#define IIS_CONFIG_CLIENTCACHE L"clientCache"
#define IIS_CONFIG_CACHECONTROLMODE L"cacheControlMode"
#define IIS_CONFIG_USEMAXAGE L"UseMaxAge"
#define IIS_CONFIG_USEEXPIRES L"UseExpires"
#define IIS_CONFIG_CACHECUST L"cacheControlCustom"
#define IIS_CONFIG_ASP_SECTION L"system.webServer/asp"
#define IIS_CONFIG_SESSION L"session"
#define IIS_CONFIG_ALLOWSTATE L"allowSessionState"
#define IIS_CONFIG_TIMEOUT L"timeout"
#define IIS_CONFIG_BUFFERING L"bufferingOn"
#define IIS_CONFIG_PARENTPATHS L"enableParentPaths"
#define IIS_CONFIG_SCRIPTLANG L"scriptLanguage"
#define IIS_CONFIG_SCRIPTTIMEOUT L"scriptTimeout"
#define IIS_CONFIG_LIMITS L"limits"
#define IIS_CONFIG_ALLOWDEBUG L"appAllowDebugging"
#define IIS_CONFIG_ALLOWCLIENTDEBUG L"appAllowClientDebug"
#define IIS_CONFIG_CERTIFICATEHASH L"certificateHash"
#define IIS_CONFIG_CERTIFICATESTORENAME L"certificateStoreName"
#define IIS_CONFIG_HTTPLOGGING_SECTION L"system.webServer/httpLogging"
#define IIS_CONFIG_DONTLOG L"dontLog"
typedef BOOL (CALLBACK* ENUMAPHOSTELEMENTPROC)(IAppHostElement*, LPVOID);
typedef BOOL (CALLBACK* VARIANTCOMPARATORPROC)(VARIANT*, VARIANT*);
HRESULT DAPI Iis7PutPropertyVariant(
__in IAppHostElement *pElement,
__in LPCWSTR wzPropName,
__in VARIANT vtPut
);
HRESULT DAPI Iis7PutPropertyInteger(
__in IAppHostElement *pElement,
__in LPCWSTR wzPropName,
__in DWORD dValue
);
HRESULT DAPI Iis7PutPropertyString(
__in IAppHostElement *pElement,
__in LPCWSTR wzPropName,
__in LPCWSTR wzString
);
HRESULT DAPI Iis7PutPropertyBool(
__in IAppHostElement *pElement,
__in LPCWSTR wzPropName,
__in BOOL fValue);
HRESULT DAPI Iis7GetPropertyVariant(
__in IAppHostElement *pElement,
__in LPCWSTR wzPropName,
__in VARIANT* vtGet
);
HRESULT DAPI Iis7GetPropertyString(
__in IAppHostElement *pElement,
__in LPCWSTR wzPropName,
__in LPWSTR* psczGet
);
struct IIS7_APPHOSTELEMENTCOMPARISON
{
LPCWSTR sczElementName;
LPCWSTR sczAttributeName;
VARIANT* pvAttributeValue;
VARIANTCOMPARATORPROC pComparator;
};
BOOL DAPI Iis7IsMatchingAppHostElement(
__in IAppHostElement *pElement,
__in IIS7_APPHOSTELEMENTCOMPARISON* pComparison
);
HRESULT DAPI Iis7FindAppHostElementString(
__in IAppHostElementCollection *pCollection,
__in LPCWSTR wzElementName,
__in LPCWSTR wzAttributeName,
__in LPCWSTR wzAttributeValue,
__out IAppHostElement** ppElement,
__out DWORD* pdwIndex
);
HRESULT DAPI Iis7FindAppHostElementPath(
__in IAppHostElementCollection *pCollection,
__in LPCWSTR wzElementName,
__in LPCWSTR wzAttributeName,
__in LPCWSTR wzAttributeValue,
__out IAppHostElement** ppElement,
__out DWORD* pdwIndex
);
HRESULT DAPI Iis7FindAppHostElementInteger(
__in IAppHostElementCollection *pCollection,
__in LPCWSTR wzElementName,
__in LPCWSTR wzAttributeName,
__in DWORD dwAttributeValue,
__out IAppHostElement** ppElement,
__out DWORD* pdwIndex
);
HRESULT DAPI Iis7FindAppHostElementVariant(
__in IAppHostElementCollection *pCollection,
__in LPCWSTR wzElementName,
__in LPCWSTR wzAttributeName,
__in VARIANT* pvAttributeValue,
__out IAppHostElement** ppElement,
__out DWORD* pdwIndex
);
HRESULT DAPI Iis7EnumAppHostElements(
__in IAppHostElementCollection *pCollection,
__in ENUMAPHOSTELEMENTPROC pCallback,
__in LPVOID pContext,
__out IAppHostElement** ppElement,
__out DWORD* pdwIndex
);
HRESULT DAPI Iis7FindAppHostMethod(
__in IAppHostMethodCollection *pCollection,
__in LPCWSTR wzMethodName,
__out IAppHostMethod** ppMethod,
__out DWORD* pdwIndex
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,49 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="inetutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Internet utilites.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseInternet(h) if (h) { ::InternetCloseHandle(h); h = NULL; }
#define ReleaseNullInternet(h) if (h) { ::InternetCloseHandle(h); h = NULL; }
// functions
HRESULT DAPI InternetGetSizeByHandle(
__in HINTERNET hiFile,
__out LONGLONG* pllSize
);
HRESULT DAPI InternetGetCreateTimeByHandle(
__in HINTERNET hiFile,
__out LPFILETIME pft
);
HRESULT DAPI InternetQueryInfoString(
__in HINTERNET h,
__in DWORD dwInfo,
__deref_out_z LPWSTR* psczValue
);
HRESULT DAPI InternetQueryInfoNumber(
__in HINTERNET h,
__in DWORD dwInfo,
__out LONG* plInfo
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,83 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="iniutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Ini/cfg file helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseIni(ih) if (ih) { IniUninitialize(ih); }
#define ReleaseNullIni(ih) if (ih) { IniUninitialize(ih); ih = NULL; }
typedef void* INI_HANDLE;
typedef const void* C_INI_HANDLE;
extern const int INI_HANDLE_BYTES;
struct INI_VALUE
{
LPCWSTR wzName;
LPCWSTR wzValue;
DWORD dwLineNumber;
};
HRESULT DAPI IniInitialize(
__out_bcount(INI_HANDLE_BYTES) INI_HANDLE* piHandle
);
void DAPI IniUninitialize(
__in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle
);
HRESULT DAPI IniSetOpenTag(
__inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in_z_opt LPCWSTR wzOpenTagPrefix,
__in_z_opt LPCWSTR wzOpenTagPostfix
);
HRESULT DAPI IniSetValueStyle(
__inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in_z_opt LPCWSTR wzValuePrefix,
__in_z_opt LPCWSTR wzValueSeparator
);
HRESULT DAPI IniSetCommentStyle(
__inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in_z_opt LPCWSTR wzLinePrefix
);
HRESULT DAPI IniParse(
__inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in LPCWSTR wzPath,
__out_opt FILE_ENCODING *pfeEncodingFound
);
HRESULT DAPI IniGetValueList(
__in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__deref_out_ecount_opt(pcValues) INI_VALUE** prgivValues,
__out DWORD *pcValues
);
HRESULT DAPI IniGetValue(
__in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in LPCWSTR wzValueName,
__deref_out_z LPWSTR* psczValue
);
HRESULT DAPI IniSetValue(
__in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in LPCWSTR wzValueName,
__in_z_opt LPCWSTR wzValue
);
HRESULT DAPI IniWriteFile(
__in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
__in_z_opt LPCWSTR wzPath,
__in FILE_ENCODING feOverrideEncoding
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,122 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="jsonutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// JavaScript Object Notation (JSON) helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef enum JSON_TOKEN
{
JSON_TOKEN_NONE,
JSON_TOKEN_ARRAY_START,
JSON_TOKEN_ARRAY_VALUE,
JSON_TOKEN_ARRAY_END,
JSON_TOKEN_OBJECT_START,
JSON_TOKEN_OBJECT_KEY,
JSON_TOKEN_OBJECT_VALUE,
JSON_TOKEN_OBJECT_END,
JSON_TOKEN_VALUE,
} JSON_TOKEN;
typedef struct _JSON_VALUE
{
} JSON_VALUE;
typedef struct _JSON_READER
{
CRITICAL_SECTION cs;
LPWSTR sczJson;
LPWSTR pwz;
JSON_TOKEN token;
} JSON_READER;
typedef struct _JSON_WRITER
{
CRITICAL_SECTION cs;
LPWSTR sczJson;
JSON_TOKEN* rgTokenStack;
DWORD cTokens;
DWORD cMaxTokens;
} JSON_WRITER;
DAPI_(HRESULT) JsonInitializeReader(
__in_z LPCWSTR wzJson,
__in JSON_READER* pReader
);
DAPI_(void) JsonUninitializeReader(
__in JSON_READER* pReader
);
DAPI_(HRESULT) JsonReadNext(
__in JSON_READER* pReader,
__out JSON_TOKEN* pToken,
__out JSON_VALUE* pValue
);
DAPI_(HRESULT) JsonReadValue(
__in JSON_READER* pReader,
__in JSON_VALUE* pValue
);
DAPI_(HRESULT) JsonInitializeWriter(
__in JSON_WRITER* pWriter
);
DAPI_(void) JsonUninitializeWriter(
__in JSON_WRITER* pWriter
);
DAPI_(HRESULT) JsonWriteBool(
__in JSON_WRITER* pWriter,
__in BOOL fValue
);
DAPI_(HRESULT) JsonWriteNumber(
__in JSON_WRITER* pWriter,
__in DWORD dwValue
);
DAPI_(HRESULT) JsonWriteString(
__in JSON_WRITER* pWriter,
__in_z LPCWSTR wzValue
);
DAPI_(HRESULT) JsonWriteArrayStart(
__in JSON_WRITER* pWriter
);
DAPI_(HRESULT) JsonWriteArrayEnd(
__in JSON_WRITER* pWriter
);
DAPI_(HRESULT) JsonWriteObjectStart(
__in JSON_WRITER* pWriter
);
DAPI_(HRESULT) JsonWriteObjectKey(
__in JSON_WRITER* pWriter,
__in_z LPCWSTR wzKey
);
DAPI_(HRESULT) JsonWriteObjectEnd(
__in JSON_WRITER* pWriter
);
#ifdef __cplusplus
}
#endif

120
tools/WIX/sdk/inc/locutil.h Normal file
View file

@ -0,0 +1,120 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="locutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for localization helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
struct LOC_STRING
{
LPWSTR wzId;
LPWSTR wzText;
BOOL bOverridable;
};
const int LOC_CONTROL_NOT_SET = INT_MAX;
struct LOC_CONTROL
{
LPWSTR wzControl;
int nX;
int nY;
int nWidth;
int nHeight;
LPWSTR wzText;
};
const int WIX_LOCALIZATION_LANGUAGE_NOT_SET = INT_MAX;
struct WIX_LOCALIZATION
{
DWORD dwLangId;
DWORD cLocStrings;
LOC_STRING* rgLocStrings;
DWORD cLocControls;
LOC_CONTROL* rgLocControls;
};
/********************************************************************
LocProbeForFile - Searches for a localization file on disk.
*******************************************************************/
HRESULT DAPI LocProbeForFile(
__in_z LPCWSTR wzBasePath,
__in_z LPCWSTR wzLocFileName,
__in_z_opt LPCWSTR wzLanguage,
__inout LPWSTR* psczPath
);
/********************************************************************
LocLoadFromFile - Loads a localization file
*******************************************************************/
HRESULT DAPI LocLoadFromFile(
__in_z LPCWSTR wzWxlFile,
__out WIX_LOCALIZATION** ppWixLoc
);
/********************************************************************
LocLoadFromResource - loads a localization file from a module's data
resource.
NOTE: The resource data must be UTF-8 encoded.
*******************************************************************/
HRESULT DAPI LocLoadFromResource(
__in HMODULE hModule,
__in_z LPCSTR szResource,
__out WIX_LOCALIZATION** ppWixLoc
);
/********************************************************************
LocFree - free memory allocated when loading a localization file
*******************************************************************/
void DAPI LocFree(
__in_opt WIX_LOCALIZATION* pWixLoc
);
/********************************************************************
LocLocalizeString - replace any #(loc.id) in a string with the
correct sub string
*******************************************************************/
HRESULT DAPI LocLocalizeString(
__in const WIX_LOCALIZATION* pWixLoc,
__inout LPWSTR* psczInput
);
/********************************************************************
LocGetControl - returns a control's localization information
*******************************************************************/
HRESULT DAPI LocGetControl(
__in const WIX_LOCALIZATION* pWixLoc,
__in_z LPCWSTR wzId,
__out LOC_CONTROL** ppLocControl
);
/********************************************************************
LocGetString - returns a string's localization information
*******************************************************************/
extern "C" HRESULT DAPI LocGetString(
__in const WIX_LOCALIZATION* pWixLoc,
__in_z LPCWSTR wzId,
__out LOC_STRING** ppLocString
);
#ifdef __cplusplus
}
#endif

210
tools/WIX/sdk/inc/logutil.h Normal file
View file

@ -0,0 +1,210 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="logutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Logging helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define LogExitOnFailure(x, i, f) if (FAILED(x)) { LogErrorId(x, i, NULL, NULL, NULL); ExitTrace(x, f); goto LExit; }
#define LogExitOnFailure1(x, i, f, s) if (FAILED(x)) { LogErrorId(x, i, s, NULL, NULL); ExitTrace1(x, f, s); goto LExit; }
#define LogExitOnFailure2(x, i, f, s, t) if (FAILED(x)) { LogErrorId(x, i, s, t, NULL); ExitTrace2(x, f, s, t); goto LExit; }
#define LogExitOnFailure3(x, i, f, s, t, u) if (FAILED(x)) { LogErrorId(x, i, s, t, u); ExitTrace3(x, f, s, t, u); goto LExit; }
#define LogExitOnRootFailure(x, i, f) if (FAILED(x)) { LogErrorId(x, i, NULL, NULL, NULL); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, f); goto LExit; }
#define LogExitOnRootFailure1(x, i, f, s) if (FAILED(x)) { LogErrorId(x, i, s, NULL, NULL); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace1(x, f, s); goto LExit; }
#define LogExitOnRootFailure2(x, i, f, s, t) if (FAILED(x)) { LogErrorId(x, i, s, t, NULL); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace2(x, f, s, t); goto LExit; }
#define LogExitOnRootFailure3(x, i, f, s, t, u) if (FAILED(x)) { LogErrorId(x, i, s, t, u); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace3(x, f, s, t, u); goto LExit; }
typedef HRESULT (DAPI *PFN_LOGSTRINGWORKRAW)(
__in_z LPCSTR szString,
__in_opt LPVOID pvContext
);
// enums
// structs
// functions
BOOL DAPI IsLogInitialized();
BOOL DAPI IsLogOpen();
void DAPI LogInitialize(
__in HMODULE hModule
);
HRESULT DAPI LogOpen(
__in_z_opt LPCWSTR wzDirectory,
__in_z LPCWSTR wzLog,
__in_z_opt LPCWSTR wzPostfix,
__in_z_opt LPCWSTR wzExt,
__in BOOL fAppend,
__in BOOL fHeader,
__out_z_opt LPWSTR* psczLogPath
);
void DAPI LogDisable();
void DAPI LogRedirect(
__in_opt PFN_LOGSTRINGWORKRAW vpfLogStringWorkRaw,
__in_opt LPVOID pvContext
);
HRESULT DAPI LogRename(
__in_z LPCWSTR wzNewPath
);
void DAPI LogClose(
__in BOOL fFooter
);
void DAPI LogUninitialize(
__in BOOL fFooter
);
BOOL DAPI LogIsOpen();
HRESULT DAPI LogSetSpecialParams(
__in_z_opt LPCWSTR wzSpecialBeginLine,
__in_z_opt LPCWSTR wzSpecialAfterTimeStamp,
__in_z_opt LPCWSTR wzSpecialEndLine
);
REPORT_LEVEL DAPI LogSetLevel(
__in REPORT_LEVEL rl,
__in BOOL fLogChange
);
REPORT_LEVEL DAPI LogGetLevel();
HRESULT DAPI LogGetPath(
__out_ecount_z(cchLogPath) LPWSTR pwzLogPath,
__in DWORD cchLogPath
);
HANDLE DAPI LogGetHandle();
HRESULT DAPIV LogString(
__in REPORT_LEVEL rl,
__in_z __format_string LPCSTR szFormat,
...
);
HRESULT DAPI LogStringArgs(
__in REPORT_LEVEL rl,
__in_z __format_string LPCSTR szFormat,
__in va_list args
);
HRESULT DAPIV LogStringLine(
__in REPORT_LEVEL rl,
__in_z __format_string LPCSTR szFormat,
...
);
HRESULT DAPI LogStringLineArgs(
__in REPORT_LEVEL rl,
__in_z __format_string LPCSTR szFormat,
__in va_list args
);
HRESULT DAPI LogIdModuleArgs(
__in REPORT_LEVEL rl,
__in DWORD dwLogId,
__in_opt HMODULE hModule,
__in va_list args
);
/*
* Wraps LogIdModuleArgs, so inline to save the function call
*/
inline HRESULT LogId(
__in REPORT_LEVEL rl,
__in DWORD dwLogId,
...
)
{
HRESULT hr = S_OK;
va_list args;
va_start(args, dwLogId);
hr = LogIdModuleArgs(rl, dwLogId, NULL, args);
va_end(args);
return hr;
}
/*
* Wraps LogIdModuleArgs, so inline to save the function call
*/
inline HRESULT LogIdArgs(
__in REPORT_LEVEL rl,
__in DWORD dwLogId,
__in va_list args
)
{
return LogIdModuleArgs(rl, dwLogId, NULL, args);
}
HRESULT DAPIV LogErrorString(
__in HRESULT hrError,
__in_z __format_string LPCSTR szFormat,
...
);
HRESULT DAPI LogErrorStringArgs(
__in HRESULT hrError,
__in_z __format_string LPCSTR szFormat,
__in va_list args
);
HRESULT DAPI LogErrorIdModule(
__in HRESULT hrError,
__in DWORD dwLogId,
__in_opt HMODULE hModule,
__in_z_opt LPCWSTR wzString1,
__in_z_opt LPCWSTR wzString2,
__in_z_opt LPCWSTR wzString3
);
inline HRESULT LogErrorId(
__in HRESULT hrError,
__in DWORD dwLogId,
__in_z_opt LPCWSTR wzString1,
__in_z_opt LPCWSTR wzString2,
__in_z_opt LPCWSTR wzString3
)
{
return LogErrorIdModule(hrError, dwLogId, NULL, wzString1, wzString2, wzString3);
}
HRESULT DAPI LogHeader();
HRESULT DAPI LogFooter();
HRESULT LogStringWorkRaw(
__in_z LPCSTR szLogData
);
// begin the switch of LogXXX to LogStringXXX
#define Log LogString
#define LogLine LogStringLine
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,65 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="memutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for memory helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseMem(p) if (p) { MemFree(p); }
#define ReleaseNullMem(p) if (p) { MemFree(p); p = NULL; }
HRESULT DAPI MemInitialize();
void DAPI MemUninitialize();
LPVOID DAPI MemAlloc(
__in SIZE_T cbSize,
__in BOOL fZero
);
LPVOID DAPI MemReAlloc(
__in LPVOID pv,
__in SIZE_T cbSize,
__in BOOL fZero
);
HRESULT DAPI MemReAllocSecure(
__in LPVOID pv,
__in SIZE_T cbSize,
__in BOOL fZero,
__deref_out LPVOID* ppvNew
);
HRESULT DAPI MemEnsureArraySize(
__deref_out_bcount(cArray * cbArrayType) LPVOID* ppvArray,
__in DWORD cArray,
__in SIZE_T cbArrayType,
__in DWORD dwGrowthCount
);
HRESULT DAPI MemInsertIntoArray(
__deref_out_bcount((cExistingArray + cNumInsertItems) * cbArrayType) LPVOID* ppvArray,
__in DWORD dwInsertIndex,
__in DWORD cNumInsertItems,
__in DWORD cExistingArray,
__in SIZE_T cbArrayType,
__in DWORD dwGrowthCount
);
HRESULT DAPI MemFree(
__in LPVOID pv
);
SIZE_T DAPI MemSize(
__in LPCVOID pv
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,62 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="metautil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// IIS Metabase helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#include <iadmw.h>
#include <iiscnfg.h>
#include <iwamreg.h>
#include <mddefw.h>
#ifdef __cplusplus
extern "C" {
#endif
// structs
// prototypes
HRESULT DAPI MetaFindWebBase(
__in IMSAdminBaseW* piMetabase,
__in_z LPCWSTR wzIP,
__in int iPort,
__in_z LPCWSTR wzHeader,
__in BOOL fSecure,
__out_ecount(cchWebBase) LPWSTR wzWebBase,
__in DWORD cchWebBase
);
HRESULT DAPI MetaFindFreeWebBase(
__in IMSAdminBaseW* piMetabase,
__out_ecount(cchWebBase) LPWSTR wzWebBase,
__in DWORD cchWebBase
);
HRESULT DAPI MetaOpenKey(
__in IMSAdminBaseW* piMetabase,
__in METADATA_HANDLE mhKey,
__in_z LPCWSTR wzKey,
__in DWORD dwAccess,
__in DWORD cRetries,
__out METADATA_HANDLE* pmh
);
HRESULT DAPI MetaGetValue(
__in IMSAdminBaseW* piMetabase,
__in METADATA_HANDLE mhKey,
__in_z LPCWSTR wzKey,
__inout METADATA_RECORD* pmr
);
void DAPI MetaFreeValue(
__in METADATA_RECORD* pmr
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,49 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="osutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Operating system helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef enum OS_VERSION
{
OS_VERSION_UNKNOWN,
OS_VERSION_WINNT,
OS_VERSION_WIN2000,
OS_VERSION_WINXP,
OS_VERSION_WIN2003,
OS_VERSION_VISTA,
OS_VERSION_WIN2008,
OS_VERSION_WIN7,
OS_VERSION_WIN2008_R2,
OS_VERSION_FUTURE
} OS_VERSION;
void DAPI OsGetVersion(
__out OS_VERSION* pVersion,
__out DWORD* pdwServicePack
);
HRESULT DAPI OsCouldRunPrivileged(
__out BOOL* pfPrivileged
);
HRESULT DAPI OsIsRunningPrivileged(
__out BOOL* pfPrivileged
);
HRESULT DAPI OsIsUacEnabled(
__out BOOL* pfUacEnabled
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,230 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="pathutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for path helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef enum PATH_EXPAND
{
PATH_EXPAND_ENVIRONMENT = 0x0001,
PATH_EXPAND_FULLPATH = 0x0002,
} PATH_EXPAND;
/*******************************************************************
PathCommandLineAppend - appends a command line argument on to a
string such that ::CommandLineToArgv() will shred them correctly
(i.e. quote arguments with spaces in them).
********************************************************************/
DAPI_(HRESULT) PathCommandLineAppend(
__deref_out_z LPWSTR* psczCommandLine,
__in_z LPCWSTR wzArgument
);
/*******************************************************************
PathFile - returns a pointer to the file part of the path.
********************************************************************/
DAPI_(LPWSTR) PathFile(
__in_z LPCWSTR wzPath
);
/*******************************************************************
PathExtension - returns a pointer to the extension part of the path
(including the dot).
********************************************************************/
DAPI_(LPCWSTR) PathExtension(
__in_z LPCWSTR wzPath
);
/*******************************************************************
PathGetDirectory - extracts the directory from a path.
********************************************************************/
DAPI_(HRESULT) PathGetDirectory(
__in_z LPCWSTR wzPath,
__out LPWSTR *psczDirectory
);
/*******************************************************************
PathExpand - gets the full path to a file resolving environment
variables along the way.
********************************************************************/
DAPI_(HRESULT) PathExpand(
__out LPWSTR *psczFullPath,
__in_z LPCWSTR wzRelativePath,
__in DWORD dwResolveFlags
);
/*******************************************************************
PathPrefix - prefixes a full path with \\?\ or \\?\UNC as
appropriate.
********************************************************************/
DAPI_(HRESULT) PathPrefix(
__inout LPWSTR *psczFullPath
);
/*******************************************************************
PathFixedBackslashTerminate - appends a \ if path does not have it
already, but fails if the buffer is
insufficient.
********************************************************************/
DAPI_(HRESULT) PathFixedBackslashTerminate(
__inout_ecount_z(cchPath) LPWSTR wzPath,
__in DWORD_PTR cchPath
);
/*******************************************************************
PathBackslashTerminate - appends a \ if path does not have it
already.
********************************************************************/
DAPI_(HRESULT) PathBackslashTerminate(
__inout LPWSTR* psczPath
);
/*******************************************************************
PathForCurrentProcess - gets the full path to the currently executing
process or (optionally) a module inside the process.
********************************************************************/
DAPI_(HRESULT) PathForCurrentProcess(
__inout LPWSTR *psczFullPath,
__in_opt HMODULE hModule
);
/*******************************************************************
PathRelativeToModule - gets the name of a file in the same
directory as the current process or (optionally) a module inside
the process
********************************************************************/
DAPI_(HRESULT) PathRelativeToModule(
__inout LPWSTR *psczFullPath,
__in_opt LPCWSTR wzFileName,
__in_opt HMODULE hModule
);
/*******************************************************************
PathCreateTempFile
Note: if wzDirectory is null, ::GetTempPath() will be used instead.
if wzFileNameTemplate is null, GetTempFileName() will be used instead.
*******************************************************************/
DAPI_(HRESULT) PathCreateTempFile(
__in_opt LPCWSTR wzDirectory,
__in_opt __format_string LPCWSTR wzFileNameTemplate,
__in DWORD dwUniqueCount,
__in DWORD dwFileAttributes,
__out_opt LPWSTR* psczTempFile,
__out_opt HANDLE* phTempFile
);
/*******************************************************************
PathCreateTimeBasedTempFile - creates an empty temp file based on current
system time
********************************************************************/
DAPI_(HRESULT) PathCreateTimeBasedTempFile(
__in_z_opt LPCWSTR wzDirectory,
__in_z LPCWSTR wzPrefix,
__in_z_opt LPCWSTR wzPostfix,
__in_z LPCWSTR wzExtension,
__deref_opt_out_z LPWSTR* psczTempFile,
__out_opt HANDLE* phTempFile
);
/*******************************************************************
PathCreateTempDirectory
Note: if wzDirectory is null, ::GetTempPath() will be used instead.
*******************************************************************/
DAPI_(HRESULT) PathCreateTempDirectory(
__in_opt LPCWSTR wzDirectory,
__in __format_string LPCWSTR wzDirectoryNameTemplate,
__in DWORD dwUniqueCount,
__out LPWSTR* psczTempDirectory
);
/*******************************************************************
PathGetKnownFolder - returns the path to a well-known shell folder
*******************************************************************/
DAPI_(HRESULT) PathGetKnownFolder(
__in int csidl,
__out LPWSTR* psczKnownFolder
);
/*******************************************************************
PathIsAbsolute - returns true if the path is absolute; false
otherwise.
*******************************************************************/
DAPI_(BOOL) PathIsAbsolute(
__in_z LPCWSTR wzPath
);
/*******************************************************************
PathConcat - like .NET's Path.Combine, lets you build up a path
one piece -- file or directory -- at a time.
*******************************************************************/
DAPI_(HRESULT) PathConcat(
__in_opt LPCWSTR wzPath1,
__in_opt LPCWSTR wzPath2,
__deref_out_z LPWSTR* psczCombined
);
/*******************************************************************
PathEnsureQuoted - ensures that a path is quoted; optionally,
this function also terminates a directory with a backslash
if it is not already.
*******************************************************************/
DAPI_(HRESULT) PathEnsureQuoted(
__inout LPWSTR* ppszPath,
__in BOOL fDirectory
);
/*******************************************************************
PathCompare - compares the fully expanded path of the two paths using
::CompareStringW().
*******************************************************************/
DAPI_(HRESULT) PathCompare(
__in_z LPCWSTR wzPath1,
__in_z LPCWSTR wzPath2,
__out int* pnResult
);
/*******************************************************************
PathCompress - sets the compression state on an existing file or
directory. A no-op on file systems that don't
support compression.
*******************************************************************/
DAPI_(HRESULT) PathCompress(
__in_z LPCWSTR wzPath
);
/*******************************************************************
PathCanonicalizePath - wrapper around PathCanonicalizeW.
*******************************************************************/
DAPI_(HRESULT) PathCanonicalizePath(
__in_z LPCWSTR wzPath,
__deref_out_z LPWSTR* psczCanonicalized
);
/*******************************************************************
PathDirectoryContainsPath - checks if wzPath is located inside
wzDirectory.
*******************************************************************/
DAPI_(HRESULT) PathDirectoryContainsPath(
__in_z LPCWSTR wzDirectory,
__in_z LPCWSTR wzPath
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,34 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="perfutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Performance helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// structs
// functions
void DAPI PerfInitialize(
);
void DAPI PerfClickTime(
__out_opt LARGE_INTEGER* pliElapsed
);
double DAPI PerfConvertToSeconds(
__in const LARGE_INTEGER* pli
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,49 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="polcutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Policy utility functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
const LPCWSTR POLICY_BURN_REGISTRY_PATH = L"WiX\\Burn";
/********************************************************************
PolcReadNumber - reads a number from policy.
NOTE: S_FALSE returned if policy not set.
NOTE: out is set to default on S_FALSE or any error.
********************************************************************/
HRESULT DAPI PolcReadNumber(
__in_z LPCWSTR wzPolicyPath,
__in_z LPCWSTR wzPolicyName,
__in DWORD dwDefault,
__out DWORD* pdw
);
/********************************************************************
PolcReadString - reads a string from policy.
NOTE: S_FALSE returned if policy not set.
NOTE: out is set to default on S_FALSE or any error.
********************************************************************/
HRESULT DAPI PolcReadString(
__in_z LPCWSTR wzPolicyPath,
__in_z LPCWSTR wzPolicyName,
__in_z_opt LPCWSTR wzDefault,
__deref_out_z LPWSTR* pscz
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,85 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="procutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for process helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// structs
typedef struct _PROC_FILESYSTEMREDIRECTION
{
BOOL fDisabled;
LPVOID pvRevertState;
} PROC_FILESYSTEMREDIRECTION;
HRESULT DAPI ProcElevated(
__in HANDLE hProcess,
__out BOOL* pfElevated
);
HRESULT DAPI ProcWow64(
__in HANDLE hProcess,
__out BOOL* pfWow64
);
HRESULT DAPI ProcDisableWowFileSystemRedirection(
__in PROC_FILESYSTEMREDIRECTION* pfsr
);
HRESULT DAPI ProcRevertWowFileSystemRedirection(
__in PROC_FILESYSTEMREDIRECTION* pfsr
);
HRESULT DAPI ProcExec(
__in_z LPCWSTR wzExecutablePath,
__in_z_opt LPCWSTR wzCommandLine,
__in int nCmdShow,
__out HANDLE *phProcess
);
HRESULT DAPI ProcExecute(
__in_z LPWSTR wzCommand,
__out HANDLE *phProcess,
__out_opt HANDLE *phChildStdIn,
__out_opt HANDLE *phChildStdOutErr
);
HRESULT DAPI ProcWaitForCompletion(
__in HANDLE hProcess,
__in DWORD dwTimeout,
__out DWORD *pReturnCode
);
HRESULT DAPI ProcWaitForIds(
__in_ecount(cProcessIds) const DWORD* pdwProcessIds,
__in DWORD cProcessIds,
__in DWORD dwMilliseconds
);
HRESULT DAPI ProcCloseIds(
__in_ecount(cProcessIds) const DWORD* pdwProcessIds,
__in DWORD cProcessIds
);
// following code in proc2utl.cpp due to dependency on PSAPI.DLL.
HRESULT DAPI ProcFindAllIdsFromExeName(
__in_z LPCWSTR wzExeName,
__out DWORD** ppdwProcessIds,
__out DWORD* pcProcessIds
);
// following code in proc3utl.cpp due to dependency on Wtsapi32.DLL.
HRESULT DAPI ProcExecuteAsInteractiveUser(
__in_z LPCWSTR wzExecutablePath,
__in_z LPCWSTR wzCommand,
__out HANDLE *phProcess
);
#ifdef __cplusplus
}
#endif

245
tools/WIX/sdk/inc/regutil.h Normal file
View file

@ -0,0 +1,245 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="regutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Registry helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseRegKey(h) if (h) { ::RegCloseKey(h); h = NULL; }
typedef enum REG_KEY_BITNESS
{
REG_KEY_DEFAULT = 0,
REG_KEY_32BIT = 1,
REG_KEY_64BIT = 2
} REG_KEY_BITNESS;
typedef LSTATUS (APIENTRY *PFN_REGCREATEKEYEXW)(
__in HKEY hKey,
__in LPCWSTR lpSubKey,
__reserved DWORD Reserved,
__in_opt LPWSTR lpClass,
__in DWORD dwOptions,
__in REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition
);
typedef LSTATUS (APIENTRY *PFN_REGOPENKEYEXW)(
__in HKEY hKey,
__in_opt LPCWSTR lpSubKey,
__reserved DWORD ulOptions,
__in REGSAM samDesired,
__out PHKEY phkResult
);
typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYEXW)(
__in HKEY hKey,
__in LPCWSTR lpSubKey,
__in REGSAM samDesired,
__reserved DWORD Reserved
);
typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYW)(
__in HKEY hKey,
__in LPCWSTR lpSubKey
);
typedef LSTATUS (APIENTRY *PFN_REGENUMKEYEXW)(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPWSTR lpName,
__inout LPDWORD lpcName,
__reserved LPDWORD lpReserved,
__inout LPWSTR lpClass,
__inout_opt LPDWORD lpcClass,
__out_opt PFILETIME lpftLastWriteTime
);
typedef LSTATUS (APIENTRY *PFN_REGENUMVALUEW)(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPWSTR lpValueName,
__inout LPDWORD lpcchValueName,
__reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType,
__out_opt LPBYTE lpData,
__out_opt LPDWORD lpcbData
);
typedef LSTATUS (APIENTRY *PFN_REGQUERYINFOKEYW)(
__in HKEY hKey,
__out LPWSTR lpClass,
__inout_opt LPDWORD lpcClass,
__reserved LPDWORD lpReserved,
__out_opt LPDWORD lpcSubKeys,
__out_opt LPDWORD lpcMaxSubKeyLen,
__out_opt LPDWORD lpcMaxClassLen,
__out_opt LPDWORD lpcValues,
__out_opt LPDWORD lpcMaxValueNameLen,
__out_opt LPDWORD lpcMaxValueLen,
__out_opt LPDWORD lpcbSecurityDescriptor,
__out_opt PFILETIME lpftLastWriteTime
);
typedef LSTATUS (APIENTRY *PFN_REGQUERYVALUEEXW)(
__in HKEY hKey,
__in_opt LPCWSTR lpValueName,
__reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
__inout_opt LPDWORD lpcbData
);
typedef LSTATUS (APIENTRY *PFN_REGSETVALUEEXW)(
__in HKEY hKey,
__in_opt LPCWSTR lpValueName,
__reserved DWORD Reserved,
__in DWORD dwType,
__in_bcount_opt(cbData) CONST BYTE* lpData,
__in DWORD cbData
);
typedef LSTATUS (APIENTRY *PFN_REGDELETEVALUEW)(
__in HKEY hKey,
__in_opt LPCWSTR lpValueName
);
HRESULT DAPI RegInitialize();
void DAPI RegUninitialize();
void DAPI RegFunctionOverride(
__in_opt PFN_REGCREATEKEYEXW pfnRegCreateKeyExW,
__in_opt PFN_REGOPENKEYEXW pfnRegOpenKeyExW,
__in_opt PFN_REGDELETEKEYEXW pfnRegDeleteKeyExW,
__in_opt PFN_REGENUMKEYEXW pfnRegEnumKeyExW,
__in_opt PFN_REGENUMVALUEW pfnRegEnumValueW,
__in_opt PFN_REGQUERYINFOKEYW pfnRegQueryInfoKeyW,
__in_opt PFN_REGQUERYVALUEEXW pfnRegQueryValueExW,
__in_opt PFN_REGSETVALUEEXW pfnRegSetValueExW,
__in_opt PFN_REGDELETEVALUEW pfnRegDeleteValueW
);
HRESULT DAPI RegCreate(
__in HKEY hkRoot,
__in_z LPCWSTR wzSubKey,
__in DWORD dwAccess,
__out HKEY* phk
);
HRESULT DAPI RegCreateEx(
__in HKEY hkRoot,
__in_z LPCWSTR wzSubKey,
__in DWORD dwAccess,
__in BOOL fVolatile,
__in_opt SECURITY_ATTRIBUTES* pSecurityAttributes,
__out HKEY* phk,
__out_opt BOOL* pfCreated
);
HRESULT DAPI RegOpen(
__in HKEY hkRoot,
__in_z LPCWSTR wzSubKey,
__in DWORD dwAccess,
__out HKEY* phk
);
HRESULT DAPI RegDelete(
__in HKEY hkRoot,
__in_z LPCWSTR wzSubKey,
__in REG_KEY_BITNESS kbKeyBitness,
__in BOOL fDeleteTree
);
HRESULT DAPI RegKeyEnum(
__in HKEY hk,
__in DWORD dwIndex,
__deref_out_z LPWSTR* psczKey
);
HRESULT DAPI RegValueEnum(
__in HKEY hk,
__in DWORD dwIndex,
__deref_out_z LPWSTR* psczName,
__out_opt DWORD *pdwType
);
HRESULT DAPI RegGetType(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__out DWORD *pdwType
);
HRESULT DAPI RegReadBinary(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__deref_out_bcount_opt(*pcbBuffer) BYTE** ppbBuffer,
__out SIZE_T *pcbBuffer
);
HRESULT DAPI RegReadString(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__deref_out_z LPWSTR* psczValue
);
HRESULT DAPI RegReadStringArray(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__deref_out_ecount_opt(pcStrings) LPWSTR** prgsczStrings,
__out DWORD *pcStrings
);
HRESULT DAPI RegReadVersion(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__out DWORD64* pdw64Version
);
HRESULT DAPI RegReadNumber(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__out DWORD* pdwValue
);
HRESULT DAPI RegReadQword(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__out DWORD64* pqwValue
);
HRESULT DAPI RegWriteBinary(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__in_bcount(cbBuffer) const BYTE *pbBuffer,
__in DWORD cbBuffer
);
HRESULT DAPI RegWriteString(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__in_z_opt LPCWSTR wzValue
);
HRESULT DAPI RegWriteStringArray(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__in_ecount(cValues) LPWSTR *rgwzStrings,
__in DWORD cStrings
);
HRESULT DAPI RegWriteStringFormatted(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__in __format_string LPCWSTR szFormat,
...
);
HRESULT DAPI RegWriteNumber(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__in DWORD dwValue
);
HRESULT DAPI RegWriteQword(
__in HKEY hk,
__in_z_opt LPCWSTR wzName,
__in DWORD64 qwValue
);
HRESULT DAPI RegQueryKey(
__in HKEY hk,
__out_opt DWORD* pcSubKeys,
__out_opt DWORD* pcValues
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,55 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="resrutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Resource read helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI ResGetStringLangId(
__in_opt LPCWSTR wzPath,
__in UINT uID,
__out WORD *pwLangId
);
HRESULT DAPI ResReadString(
__in HINSTANCE hinst,
__in UINT uID,
__deref_out_z LPWSTR* ppwzString
);
HRESULT DAPI ResReadStringAnsi(
__in HINSTANCE hinst,
__in UINT uID,
__deref_out_z LPSTR* ppszString
);
HRESULT DAPI ResReadData(
__in_opt HINSTANCE hinst,
__in_z LPCSTR szDataName,
__deref_out_bcount(*pcb) PVOID *ppv,
__out DWORD *pcb
);
HRESULT DAPI ResExportDataToFile(
__in_z LPCSTR szDataName,
__in_z LPCWSTR wzTargetFile,
__in DWORD dwCreationDisposition
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,43 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="reswutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Resource writer helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI ResWriteString(
__in_z LPCWSTR wzResourceFile,
__in DWORD dwDataId,
__in_z LPCWSTR wzData,
__in WORD wLangId
);
HRESULT DAPI ResWriteData(
__in_z LPCWSTR wzResourceFile,
__in_z LPCSTR szDataName,
__in PVOID pData,
__in DWORD cbData
);
HRESULT DAPI ResImportDataFromFile(
__in_z LPCWSTR wzTargetFile,
__in_z LPCWSTR wzSourceFile,
__in_z LPCSTR szDataName
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,64 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="rexutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Resource Cabinet Extract Utilities
// </summary>
//-------------------------------------------------------------------------------------------------
#include <sys\stat.h>
#include <fdi.h>
#ifdef __cplusplus
extern "C" {
#endif
// defines
#define FILETABLESIZE 40
// structs
struct MEM_FILE
{
LPCBYTE vpStart;
UINT uiCurrent;
UINT uiLength;
};
typedef enum FAKE_FILE_TYPE { NORMAL_FILE, MEMORY_FILE } FAKE_FILE_TYPE;
typedef HRESULT (*REX_CALLBACK_PROGRESS)(BOOL fBeginFile, LPCWSTR wzFileId, LPVOID pvContext);
typedef VOID (*REX_CALLBACK_WRITE)(UINT cb);
struct FAKE_FILE // used __in internal file table
{
BOOL fUsed;
FAKE_FILE_TYPE fftType;
MEM_FILE mfFile; // State for memory file
HANDLE hFile; // Handle for disk file
};
// functions
HRESULT RexInitialize();
void RexUninitialize();
HRESULT RexExtract(
__in_z LPCSTR szResource,
__in_z LPCWSTR wzExtractId,
__in_z LPCWSTR wzExtractDir,
__in_z LPCWSTR wzExtractName,
__in REX_CALLBACK_PROGRESS pfnProgress,
__in REX_CALLBACK_WRITE pfnWrite,
__in LPVOID pvContext
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,56 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="rmutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Restart Manager utility functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _RMU_SESSION *PRMU_SESSION;
HRESULT DAPI RmuJoinSession(
__out PRMU_SESSION *ppSession,
__in_z LPCWSTR wzSessionKey
);
HRESULT DAPI RmuAddFile(
__in PRMU_SESSION pSession,
__in_z LPCWSTR wzPath
);
HRESULT DAPI RmuAddProcessById(
__in PRMU_SESSION pSession,
__in DWORD dwProcessId
);
HRESULT DAPI RmuAddProcessesByName(
__in PRMU_SESSION pSession,
__in_z LPCWSTR wzProcessName
);
HRESULT DAPI RmuAddService(
__in PRMU_SESSION pSession,
__in_z LPCWSTR wzServiceName
);
HRESULT DAPI RmuRegisterResources(
__in PRMU_SESSION pSession
);
HRESULT DAPI RmuEndSession(
__in PRMU_SESSION pSession
);
#ifdef __cplusplus
}
#endif

101
tools/WIX/sdk/inc/rssutil.h Normal file
View file

@ -0,0 +1,101 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="rssutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// RSS helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseRssChannel(p) if (p) { RssFreeChannel(p); }
#define ReleaseNullRssChannel(p) if (p) { RssFreeChannel(p); p = NULL; }
struct RSS_UNKNOWN_ATTRIBUTE
{
LPWSTR wzNamespace;
LPWSTR wzAttribute;
LPWSTR wzValue;
RSS_UNKNOWN_ATTRIBUTE* pNext;
};
struct RSS_UNKNOWN_ELEMENT
{
LPWSTR wzNamespace;
LPWSTR wzElement;
LPWSTR wzValue;
RSS_UNKNOWN_ATTRIBUTE* pAttributes;
RSS_UNKNOWN_ELEMENT* pNext;
};
struct RSS_ITEM
{
LPWSTR wzTitle;
LPWSTR wzLink;
LPWSTR wzDescription;
LPWSTR wzGuid;
FILETIME ftPublished;
LPWSTR wzEnclosureUrl;
DWORD dwEnclosureSize;
LPWSTR wzEnclosureType;
RSS_UNKNOWN_ELEMENT* pUnknownElements;
};
struct RSS_CHANNEL
{
LPWSTR wzTitle;
LPWSTR wzLink;
LPWSTR wzDescription;
DWORD dwTimeToLive;
RSS_UNKNOWN_ELEMENT* pUnknownElements;
DWORD cItems;
RSS_ITEM rgItems[1];
};
HRESULT DAPI RssInitialize(
);
void DAPI RssUninitialize(
);
HRESULT DAPI RssParseFromString(
__in_z LPCWSTR wzRssString,
__out RSS_CHANNEL **ppChannel
);
HRESULT DAPI RssParseFromFile(
__in_z LPCWSTR wzRssFile,
__out RSS_CHANNEL **ppChannel
);
// Adding this until we have the updated specstrings.h
#ifndef __in_xcount
#define __in_xcount(size)
#endif
void DAPI RssFreeChannel(
__in_xcount(pChannel->cItems) RSS_CHANNEL *pChannel
);
#ifdef __cplusplus
}
#endif

271
tools/WIX/sdk/inc/sceutil.h Normal file
View file

@ -0,0 +1,271 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="sceutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for SQL Compact Edition helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#include <sqlce_oledb.h>
#include <sqlce_sync.h>
#include <sqlce_err.h>
typedef void* SCE_DATABASE_HANDLE;
typedef void* SCE_ROW_HANDLE;
typedef void* SCE_QUERY_HANDLE;
typedef void* SCE_QUERY_RESULTS_HANDLE;
extern const int SCE_ROW_HANDLE_BYTES;
extern const int SCE_QUERY_HANDLE_BYTES;
extern const int SCE_QUERY_RESULTS_HANDLE_BYTES;
#define ReleaseSceRow(prrh) if (prrh) { SceFreeRow(prrh); }
#define ReleaseNullSceRow(prrh) if (prrh) { SceFreeRow(prrh); prrh = NULL; }
#define ReleaseSceQuery(pqh) if (pqh) { SceFreeQuery(pqh); }
#define ReleaseNullSceQuery(pqh) if (pqh) { SceFreeQuery(pqh); pqh = NULL; }
#define ReleaseSceQueryResults(pqh) if (pqh) { SceFreeQueryResults(pqh); }
#define ReleaseNullSceQueryResults(pqh) if (pqh) { SceFreeQueryResults(pqh); pqh = NULL; }
struct SCE_COLUMN_SCHEMA
{
LPCWSTR wzName;
DBTYPE dbtColumnType;
DWORD dwLength;
BOOL fPrimaryKey; // If this column is the primary key
BOOL fNullable;
BOOL fAutoIncrement;
LPWSTR wzRelationName;
DWORD dwForeignKeyTable;
DWORD dwForeignKeyColumn;
};
struct SCE_INDEX_SCHEMA
{
LPWSTR wzName;
DWORD *rgColumns;
DWORD cColumns;
};
struct SCE_TABLE_SCHEMA
{
LPCWSTR wzName;
DWORD cColumns;
SCE_COLUMN_SCHEMA *rgColumns;
DWORD cIndexes;
SCE_INDEX_SCHEMA *rgIndexes;
// Internal to SCEUtil - consumers shouldn't access or modify
// TODO: enforce / hide in a handle of some sort?
IRowset *pIRowset;
IRowsetChange *pIRowsetChange;
};
struct SCE_DATABASE_SCHEMA
{
DWORD cTables;
SCE_TABLE_SCHEMA *rgTables;
};
struct SCE_DATABASE
{
SCE_DATABASE_HANDLE sdbHandle;
SCE_DATABASE_SCHEMA *pdsSchema;
};
HRESULT DAPI SceCreateDatabase(
__in_z LPCWSTR sczFile,
__deref_out SCE_DATABASE **ppDatabase
);
HRESULT DAPI SceOpenDatabase(
__in_z LPCWSTR sczFile,
__in LPCWSTR wzSchemaType,
__in DWORD dwExpectedVersion,
__deref_out SCE_DATABASE **ppDatabase,
__in BOOL fReadOnly
);
HRESULT DAPI SceEnsureDatabase(
__in_z LPCWSTR sczFile,
__in LPCWSTR wzSchemaType,
__in DWORD dwExpectedVersion,
__in SCE_DATABASE_SCHEMA *pdsSchema,
__deref_out SCE_DATABASE **ppDatabase
);
HRESULT DAPI SceIsTableEmpty(
__in SCE_DATABASE *pDatabase,
__in DWORD dwTableIndex,
__out BOOL *pfEmpty
);
HRESULT DAPI SceGetFirstRow(
__in SCE_DATABASE *pDatabase,
__in DWORD dwTableIndex,
__deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
);
HRESULT DAPI SceGetNextRow(
__in SCE_DATABASE *pDatabase,
__in DWORD dwTableIndex,
__deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
);
HRESULT DAPI SceBeginTransaction(
__in SCE_DATABASE *pDatabase
);
HRESULT DAPI SceCommitTransaction(
__in SCE_DATABASE *pDatabase
);
HRESULT DAPI SceRollbackTransaction(
__in SCE_DATABASE *pDatabase
);
HRESULT DAPI SceDeleteRow(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
);
HRESULT DAPI ScePrepareInsert(
__in SCE_DATABASE *pDatabase,
__in DWORD dwTableIndex,
__deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
);
HRESULT DAPI SceFinishUpdate(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle
);
HRESULT DAPI SceSetColumnBinary(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex,
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer
);
HRESULT DAPI SceSetColumnDword(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex,
__in const DWORD dwValue
);
HRESULT DAPI SceSetColumnQword(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex,
__in const DWORD64 qwValue
);
HRESULT DAPI SceSetColumnBool(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex,
__in const BOOL fValue
);
HRESULT DAPI SceSetColumnString(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex,
__in_z_opt LPCWSTR wzValue
);
HRESULT DAPI SceSetColumnSystemTime(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex,
__in const SYSTEMTIME *pst
);
HRESULT DAPI SceSetColumnEmpty(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in DWORD dwColumnIndex
);
HRESULT DAPI SceGetColumnBinary(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
__in DWORD dwColumnIndex,
__out_opt BYTE **ppbBuffer,
__inout SIZE_T *pcbBuffer
);
HRESULT DAPI SceGetColumnDword(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
__in DWORD dwColumnIndex,
__out DWORD *pdwValue
);
HRESULT DAPI SceGetColumnQword(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
__in DWORD dwColumnIndex,
__out DWORD64 *pqwValue
);
HRESULT DAPI SceGetColumnBool(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
__in DWORD dwColumnIndex,
__out BOOL *pfValue
);
HRESULT DAPI SceGetColumnString(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
__in DWORD dwColumnIndex,
__out_z LPWSTR *psczValue
);
HRESULT DAPI SceGetColumnSystemTime(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
__in DWORD dwColumnIndex,
__out SYSTEMTIME *pst
);
HRESULT DAPI SceBeginQuery(
__in SCE_DATABASE *pDatabase,
__in DWORD dwTableIndex,
__in DWORD dwIndex,
__deref_out_bcount(SCE_QUERY_HANDLE_BYTES) SCE_QUERY_HANDLE *psqhHandle
);
HRESULT DAPI SceSetQueryColumnBinary(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
__in_bcount(cbBuffer) const BYTE* pbBuffer,
__in SIZE_T cbBuffer
);
HRESULT DAPI SceSetQueryColumnDword(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
__in const DWORD dwValue
);
HRESULT DAPI SceSetQueryColumnQword(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
__in const DWORD64 qwValue
);
HRESULT DAPI SceSetQueryColumnBool(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
__in const BOOL fValue
);
HRESULT DAPI SceSetQueryColumnString(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
__in_z_opt LPCWSTR wzString
);
HRESULT DAPI SceSetQueryColumnSystemTime(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
__in const SYSTEMTIME *pst
);
HRESULT DAPI SceSetQueryColumnEmpty(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle
);
HRESULT DAPI SceRunQueryExact(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE *psqhHandle,
__deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
);
HRESULT DAPI SceRunQueryRange(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE *psqhHandle,
__deref_out_bcount(SCE_QUERY_RESULTS_BYTES) SCE_QUERY_RESULTS_HANDLE *psqrhHandle
);
HRESULT DAPI SceGetNextResultRow(
__in_bcount(SCE_QUERY_RESULTS_BYTES) SCE_QUERY_RESULTS_HANDLE sqrhHandle,
__deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
);
void DAPI SceCloseTable(
__in SCE_TABLE_SCHEMA *pTable
);
HRESULT DAPI SceCloseDatabase(
__in SCE_DATABASE *pDatabase
);
void DAPI SceFreeRow(
__in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle
);
void DAPI SceFreeQuery(
__in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle
);
void DAPI SceFreeQueryResults(
__in_bcount(SCE_QUERY_RESULTS_BYTES) SCE_QUERY_RESULTS_HANDLE sqrhHandle
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,57 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="shelutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for shell helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifndef REFKNOWNFOLDERID
#define REFKNOWNFOLDERID REFGUID
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef BOOL (STDAPICALLTYPE *PFN_SHELLEXECUTEEXW)(
__inout LPSHELLEXECUTEINFOW lpExecInfo
);
void DAPI ShelFunctionOverride(
__in_opt PFN_SHELLEXECUTEEXW pfnShellExecuteExW
);
HRESULT DAPI ShelExec(
__in_z LPCWSTR wzTargetPath,
__in_opt LPCWSTR wzParameters,
__in_opt LPCWSTR wzVerb,
__in_opt LPCWSTR wzWorkingDirectory,
__in int nShowCmd,
__in_opt HWND hwndParent,
__out_opt HANDLE* phProcess
);
HRESULT DAPI ShelExecUnelevated(
__in_z LPCWSTR wzTargetPath,
__in_z_opt LPCWSTR wzParameters,
__in_z_opt LPCWSTR wzVerb,
__in_z_opt LPCWSTR wzWorkingDirectory,
__in int nShowCmd
);
HRESULT DAPI ShelGetFolder(
__out_z LPWSTR* psczFolderPath,
__in int csidlFolder
);
HRESULT DAPI ShelGetKnownFolder(
__out_z LPWSTR* psczFolderPath,
__in REFKNOWNFOLDERID rfidFolder
);
#ifdef __cplusplus
}
#endif

146
tools/WIX/sdk/inc/sqlutil.h Normal file
View file

@ -0,0 +1,146 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="sqlutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// SQL helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#include <cguid.h>
#include <oledberr.h>
#include <sqloledb.h>
#ifdef __cplusplus
extern "C" {
#endif
// Adding this until the SQL annotations are published to specstrings.h
#ifndef __sql_command
#define __sql_command
#endif
// structs
struct SQL_FILESPEC
{
WCHAR wzName[MAX_PATH];
WCHAR wzFilename[MAX_PATH];
WCHAR wzSize[MAX_PATH];
WCHAR wzMaxSize[MAX_PATH];
WCHAR wzGrow[MAX_PATH];
};
// functions
HRESULT DAPI SqlConnectDatabase(
__in_z LPCWSTR wzServer,
__in_z LPCWSTR wzInstance,
__in_z LPCWSTR wzDatabase,
__in BOOL fIntegratedAuth,
__in_z LPCWSTR wzUser,
__in_z LPCWSTR wzPassword,
__out IDBCreateSession** ppidbSession
);
HRESULT DAPI SqlStartTransaction(
__in IDBCreateSession* pidbSession,
__out IDBCreateCommand** ppidbCommand,
__out ITransaction** ppit
);
HRESULT DAPI SqlEndTransaction(
__in ITransaction* pit,
__in BOOL fCommit
);
HRESULT DAPI SqlDatabaseExists(
__in_z LPCWSTR wzServer,
__in_z LPCWSTR wzInstance,
__in_z LPCWSTR wzDatabase,
__in BOOL fIntegratedAuth,
__in_z LPCWSTR wzUser,
__in_z LPCWSTR wzPassword,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlSessionDatabaseExists(
__in IDBCreateSession* pidbSession,
__in_z LPCWSTR wzDatabase,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlDatabaseEnsureExists(
__in_z LPCWSTR wzServer,
__in_z LPCWSTR wzInstance,
__in_z LPCWSTR wzDatabase,
__in BOOL fIntegratedAuth,
__in_z LPCWSTR wzUser,
__in_z LPCWSTR wzPassword,
__in_opt const SQL_FILESPEC* psfDatabase,
__in_opt const SQL_FILESPEC* psfLog,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlSessionDatabaseEnsureExists(
__in IDBCreateSession* pidbSession,
__in_z LPCWSTR wzDatabase,
__in_opt const SQL_FILESPEC* psfDatabase,
__in_opt const SQL_FILESPEC* psfLog,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlCreateDatabase(
__in_z LPCWSTR wzServer,
__in_z LPCWSTR wzInstance,
__in_z LPCWSTR wzDatabase,
__in BOOL fIntegratedAuth,
__in_z LPCWSTR wzUser,
__in_z LPCWSTR wzPassword,
__in_opt const SQL_FILESPEC* psfDatabase,
__in_opt const SQL_FILESPEC* psfLog,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlSessionCreateDatabase(
__in IDBCreateSession* pidbSession,
__in_z LPCWSTR wzDatabase,
__in_opt const SQL_FILESPEC* psfDatabase,
__in_opt const SQL_FILESPEC* psfLog,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlDropDatabase(
__in_z LPCWSTR wzServer,
__in_z LPCWSTR wzInstance,
__in_z LPCWSTR wzDatabase,
__in BOOL fIntegratedAuth,
__in_z LPCWSTR wzUser,
__in_z LPCWSTR wzPassword,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlSessionDropDatabase(
__in IDBCreateSession* pidbSession,
__in_z LPCWSTR wzDatabase,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlSessionExecuteQuery(
__in IDBCreateSession* pidbSession,
__in __sql_command LPCWSTR wzSql,
__out_opt IRowset** ppirs,
__out_opt DBROWCOUNT* pcRows,
__out_opt BSTR* pbstrErrorDescription
);
HRESULT DAPI SqlCommandExecuteQuery(
__in IDBCreateCommand* pidbCommand,
__in __sql_command LPCWSTR wzSql,
__out IRowset** ppirs,
__out DBROWCOUNT* pcRows
);
HRESULT DAPI SqlGetErrorInfo(
__in IUnknown* pObjectWithError,
__in REFIID IID_InterfaceWithError,
__in DWORD dwLocaleId,
__out_opt BSTR* pbstrErrorSource,
__out_opt BSTR* pbstrErrorDescription
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,57 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="srputil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// System restore point helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef enum SRP_ACTION
{
SRP_ACTION_UNKNOWN,
SRP_ACTION_UNINSTALL,
SRP_ACTION_INSTALL,
SRP_ACTION_MODIFY,
} SRP_ACTION;
/********************************************************************
SrpInitialize - initializes system restore point functionality.
*******************************************************************/
DAPI_(HRESULT) SrpInitialize(
__in BOOL fInitializeComSecurity
);
/********************************************************************
SrpUninitialize - uninitializes system restore point functionality.
*******************************************************************/
DAPI_(void) SrpUninitialize();
/********************************************************************
SrpCreateRestorePoint - creates a system restore point.
*******************************************************************/
DAPI_(HRESULT) SrpCreateRestorePoint(
__in_z LPCWSTR wzApplicationName,
__in SRP_ACTION action
);
#ifdef __cplusplus
}
#endif

311
tools/WIX/sdk/inc/strutil.h Normal file
View file

@ -0,0 +1,311 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="strutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for string helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseStr(pwz) if (pwz) { StrFree(pwz); }
#define ReleaseNullStr(pwz) if (pwz) { StrFree(pwz); pwz = NULL; }
#define ReleaseBSTR(bstr) if (bstr) { ::SysFreeString(bstr); }
#define ReleaseNullBSTR(bstr) if (bstr) { ::SysFreeString(bstr); bstr = NULL; }
#define ReleaseStrArray(rg, c) { if (rg) { StrArrayFree(rg, c); } }
#define ReleaseNullStrArray(rg, c) { if (rg) { StrArrayFree(rg, c); c = 0; rg = NULL; } }
#define ReleaseNullStrSecure(pwz) if (pwz) { StrSecureZeroFreeString(pwz); pwz = NULL; }
#define DeclareConstBSTR(bstr_const, wz) const WCHAR bstr_const[] = { 0x00, 0x00, sizeof(wz)-sizeof(WCHAR), 0x00, wz }
#define UseConstBSTR(bstr_const) const_cast<BSTR>(bstr_const + 4)
HRESULT DAPI StrAlloc(
__deref_out_ecount_part(cch, 0) LPWSTR* ppwz,
__in DWORD_PTR cch
);
HRESULT DAPI StrAllocSecure(
__deref_out_ecount_part(cch, 0) LPWSTR* ppwz,
__in DWORD_PTR cch
);
HRESULT DAPI StrTrimCapacity(
__deref_out_z LPWSTR* ppwz
);
HRESULT DAPI StrTrimWhitespace(
__deref_out_z LPWSTR* ppwz,
__in_z LPCWSTR wzSource
);
HRESULT DAPI StrAnsiAlloc(
__deref_out_ecount_part(cch, 0) LPSTR* ppz,
__in DWORD_PTR cch
);
HRESULT DAPI StrAnsiTrimCapacity(
__deref_out_z LPSTR* ppz
);
HRESULT DAPI StrAnsiTrimWhitespace(
__deref_out_z LPSTR* ppz,
__in_z LPCSTR szSource
);
HRESULT DAPI StrAllocString(
__deref_out_ecount_z(cchSource+1) LPWSTR* ppwz,
__in_z LPCWSTR wzSource,
__in DWORD_PTR cchSource
);
HRESULT DAPI StrAllocStringSecure(
__deref_out_ecount_z(cchSource + 1) LPWSTR* ppwz,
__in_z LPCWSTR wzSource,
__in DWORD_PTR cchSource
);
HRESULT DAPI StrAnsiAllocString(
__deref_out_ecount_z(cchSource+1) LPSTR* ppsz,
__in_z LPCWSTR wzSource,
__in DWORD_PTR cchSource,
__in UINT uiCodepage
);
HRESULT DAPI StrAllocStringAnsi(
__deref_out_ecount_z(cchSource+1) LPWSTR* ppwz,
__in_z LPCSTR szSource,
__in DWORD_PTR cchSource,
__in UINT uiCodepage
);
HRESULT DAPI StrAnsiAllocStringAnsi(
__deref_out_ecount_z(cchSource+1) LPSTR* ppsz,
__in_z LPCSTR szSource,
__in DWORD_PTR cchSource
);
HRESULT DAPI StrAllocPrefix(
__deref_out_z LPWSTR* ppwz,
__in_z LPCWSTR wzPrefix,
__in DWORD_PTR cchPrefix
);
HRESULT DAPI StrAllocConcat(
__deref_out_z LPWSTR* ppwz,
__in_z LPCWSTR wzSource,
__in DWORD_PTR cchSource
);
HRESULT DAPI StrAllocConcatSecure(
__deref_out_z LPWSTR* ppwz,
__in_z LPCWSTR wzSource,
__in DWORD_PTR cchSource
);
HRESULT DAPI StrAnsiAllocConcat(
__deref_out_z LPSTR* ppz,
__in_z LPCSTR pzSource,
__in DWORD_PTR cchSource
);
HRESULT __cdecl StrAllocFormatted(
__deref_out_z LPWSTR* ppwz,
__in __format_string LPCWSTR wzFormat,
...
);
HRESULT __cdecl StrAllocFormattedSecure(
__deref_out_z LPWSTR* ppwz,
__in __format_string LPCWSTR wzFormat,
...
);
HRESULT __cdecl StrAnsiAllocFormatted(
__deref_out_z LPSTR* ppsz,
__in __format_string LPCSTR szFormat,
...
);
HRESULT DAPI StrAllocFormattedArgs(
__deref_out_z LPWSTR* ppwz,
__in __format_string LPCWSTR wzFormat,
__in va_list args
);
HRESULT DAPI StrAllocFormattedArgsSecure(
__deref_out_z LPWSTR* ppwz,
__in __format_string LPCWSTR wzFormat,
__in va_list args
);
HRESULT DAPI StrAnsiAllocFormattedArgs(
__deref_out_z LPSTR* ppsz,
__in __format_string LPCSTR szFormat,
__in va_list args
);
HRESULT DAPI StrAllocFromError(
__inout LPWSTR *ppwzMessage,
__in HRESULT hrError,
__in_opt HMODULE hModule,
...
);
HRESULT DAPI StrMaxLength(
__in LPCVOID p,
__out DWORD_PTR* pcch
);
HRESULT DAPI StrSize(
__in LPCVOID p,
__out DWORD_PTR* pcb
);
HRESULT DAPI StrFree(
__in LPVOID p
);
HRESULT DAPI StrReplaceStringAll(
__inout LPWSTR* ppwzOriginal,
__in_z LPCWSTR wzOldSubString,
__in_z LPCWSTR wzNewSubString
);
HRESULT DAPI StrReplaceString(
__inout LPWSTR* ppwzOriginal,
__inout DWORD* pdwStartIndex,
__in_z LPCWSTR wzOldSubString,
__in_z LPCWSTR wzNewSubString
);
HRESULT DAPI StrHexEncode(
__in_ecount(cbSource) const BYTE* pbSource,
__in DWORD_PTR cbSource,
__out_ecount(cchDest) LPWSTR wzDest,
__in DWORD_PTR cchDest
);
HRESULT DAPI StrHexDecode(
__in_z LPCWSTR wzSource,
__out_bcount(cbDest) BYTE* pbDest,
__in DWORD_PTR cbDest
);
HRESULT DAPI StrAllocHexDecode(
__in_z LPCWSTR wzSource,
__out_bcount(*pcbDest) BYTE** ppbDest,
__out_opt DWORD* pcbDest
);
HRESULT DAPI StrAllocBase85Encode(
__in_bcount_opt(cbSource) const BYTE* pbSource,
__in DWORD_PTR cbSource,
__deref_out_z LPWSTR* pwzDest
);
HRESULT DAPI StrAllocBase85Decode(
__in_z LPCWSTR wzSource,
__deref_out_bcount(*pcbDest) BYTE** hbDest,
__out DWORD_PTR* pcbDest
);
HRESULT DAPI MultiSzLen(
__in_ecount(*pcch) __nullnullterminated LPCWSTR pwzMultiSz,
__out DWORD_PTR* pcch
);
HRESULT DAPI MultiSzPrepend(
__deref_inout_ecount(*pcchMultiSz) __nullnullterminated LPWSTR* ppwzMultiSz,
__inout_opt DWORD_PTR *pcchMultiSz,
__in __nullnullterminated LPCWSTR pwzInsert
);
HRESULT DAPI MultiSzFindSubstring(
__in __nullnullterminated LPCWSTR pwzMultiSz,
__in __nullnullterminated LPCWSTR pwzSubstring,
__out_opt DWORD_PTR* pdwIndex,
__deref_opt_out_z LPCWSTR* ppwzFoundIn
);
HRESULT DAPI MultiSzFindString(
__in __nullnullterminated LPCWSTR pwzMultiSz,
__in __nullnullterminated LPCWSTR pwzString,
__out_opt DWORD_PTR* pdwIndex,
__deref_opt_out __nullnullterminated LPCWSTR* ppwzFound
);
HRESULT DAPI MultiSzRemoveString(
__deref_inout __nullnullterminated LPWSTR* ppwzMultiSz,
__in DWORD_PTR dwIndex
);
HRESULT DAPI MultiSzInsertString(
__deref_inout_z LPWSTR* ppwzMultiSz,
__inout_opt DWORD_PTR *pcchMultiSz,
__in DWORD_PTR dwIndex,
__in_z LPCWSTR pwzInsert
);
HRESULT DAPI MultiSzReplaceString(
__deref_inout __nullnullterminated LPWSTR* ppwzMultiSz,
__in DWORD_PTR dwIndex,
__in_z LPCWSTR pwzString
);
LPCWSTR wcsistr(
__in_z LPCWSTR wzString,
__in_z LPCWSTR wzCharSet
);
HRESULT DAPI StrStringToInt16(
__in_z LPCWSTR wzIn,
__in DWORD cchIn,
__out SHORT* psOut
);
HRESULT DAPI StrStringToUInt16(
__in_z LPCWSTR wzIn,
__in DWORD cchIn,
__out USHORT* pusOut
);
HRESULT DAPI StrStringToInt32(
__in_z LPCWSTR wzIn,
__in DWORD cchIn,
__out INT* piOut
);
HRESULT DAPI StrStringToUInt32(
__in_z LPCWSTR wzIn,
__in DWORD cchIn,
__out UINT* puiOut
);
HRESULT DAPI StrStringToInt64(
__in_z LPCWSTR wzIn,
__in DWORD cchIn,
__out LONGLONG* pllOut
);
HRESULT DAPI StrStringToUInt64(
__in_z LPCWSTR wzIn,
__in DWORD cchIn,
__out ULONGLONG* pullOut
);
void DAPI StrStringToUpper(
__inout_z LPWSTR wzIn
);
void DAPI StrStringToLower(
__inout_z LPWSTR wzIn
);
HRESULT DAPI StrAllocStringToUpperInvariant(
__deref_out_z LPWSTR* pscz,
__in_z LPCWSTR wzSource,
__in int cchSource
);
HRESULT DAPI StrAllocStringToLowerInvariant(
__deref_out_z LPWSTR* pscz,
__in_z LPCWSTR wzSource,
__in int cchSource
);
HRESULT DAPI StrArrayAllocString(
__deref_inout_ecount_opt(*pcStrArray) LPWSTR **prgsczStrArray,
__inout LPUINT pcStrArray,
__in_z LPCWSTR wzSource,
__in DWORD_PTR cchSource
);
HRESULT DAPI StrArrayFree(
__in_ecount(cStrArray) LPWSTR *rgsczStrArray,
__in UINT cStrArray
);
HRESULT DAPI StrSplitAllocArray(
__deref_inout_ecount_opt(*pcStrArray) LPWSTR **prgsczStrArray,
__inout LPUINT pcStrArray,
__in_z LPCWSTR wzSource,
__in_z LPCWSTR wzDelim
);
HRESULT DAPI StrSecureZeroString(
__in LPWSTR pwz
);
HRESULT DAPI StrSecureZeroFreeString(
__in LPWSTR pwz
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,31 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="svcutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Windows service helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseServiceHandle(h) if (h) { ::CloseServiceHandle(h); h = NULL; }
HRESULT DAPI SvcQueryConfig(
__in SC_HANDLE sch,
__out QUERY_SERVICE_CONFIGW** ppConfig
);
#ifdef __cplusplus
}
#endif

559
tools/WIX/sdk/inc/thmutil.h Normal file
View file

@ -0,0 +1,559 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="thmutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Theme helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define ReleaseTheme(p) if (p) { ThemeFree(p); p = NULL; }
typedef enum THEME_CONTROL_DATA
{
THEME_CONTROL_DATA_HOVER = 1,
} THEME_CONTROL_DATA;
typedef enum THEME_CONTROL_TYPE
{
THEME_CONTROL_TYPE_UNKNOWN,
THEME_CONTROL_TYPE_BILLBOARD,
THEME_CONTROL_TYPE_BUTTON,
THEME_CONTROL_TYPE_CHECKBOX,
THEME_CONTROL_TYPE_EDITBOX,
THEME_CONTROL_TYPE_HYPERLINK,
THEME_CONTROL_TYPE_HYPERTEXT,
THEME_CONTROL_TYPE_IMAGE,
THEME_CONTROL_TYPE_PROGRESSBAR,
THEME_CONTROL_TYPE_RICHEDIT,
THEME_CONTROL_TYPE_STATIC,
THEME_CONTROL_TYPE_TEXT,
THEME_CONTROL_TYPE_LISTVIEW,
THEME_CONTROL_TYPE_TREEVIEW,
THEME_CONTROL_TYPE_TAB,
} THEME_CONTROL_TYPE;
struct THEME_BILLBOARD
{
HBITMAP hImage;
LPWSTR sczUrl;
};
struct THEME_COLUMN
{
LPWSTR pszName;
UINT uStringId;
int nWidth;
};
struct THEME_TAB
{
LPWSTR pszName;
UINT uStringId;
};
// THEME_ASSIGN_CONTROL_ID - Used to apply a specific id to a named control (usually
// to set the WM_COMMAND).
struct THEME_ASSIGN_CONTROL_ID
{
WORD wId; // id to apply to control
LPCWSTR wzName; // name of control to match
};
const DWORD THEME_FIRST_ASSIGN_CONTROL_ID = 1024; // Recommended first control id to be assigned.
struct THEME_CONTROL
{
THEME_CONTROL_TYPE type;
WORD wId;
WORD wPageId;
LPWSTR sczName; // optional name for control, only used to apply control id.
LPWSTR sczText;
int nX;
int nY;
int nHeight;
int nWidth;
int nSourceX;
int nSourceY;
UINT uStringId;
HBITMAP hImage;
// Don't free these; it's just a handle to the central image lists stored in THEME. The handle is freed once, there.
HIMAGELIST rghImageList[4];
DWORD dwStyle;
DWORD dwExtendedStyle;
DWORD dwInternalStyle;
DWORD dwFontId;
DWORD dwFontHoverId;
DWORD dwFontSelectedId;
// Used by billboard controls
THEME_BILLBOARD* ptbBillboards;
DWORD cBillboards;
WORD wBillboardInterval;
WORD wBillboardUrls;
BOOL fBillboardLoops;
// Used by listview controls
THEME_COLUMN *ptcColumns;
DWORD cColumns;
// Used by tab controls
THEME_TAB *pttTabs;
DWORD cTabs;
// state variables that should be ignored
HWND hWnd;
DWORD dwData; // type specific data
};
struct THEME_IMAGELIST
{
LPWSTR sczName;
HIMAGELIST hImageList;
};
struct THEME_PAGE
{
WORD wId;
LPWSTR sczName;
DWORD cControlIndices;
DWORD* rgdwControlIndices;
};
struct THEME_FONT
{
HFONT hFont;
COLORREF crForeground;
HBRUSH hForeground;
COLORREF crBackground;
HBRUSH hBackground;
};
struct THEME
{
WORD wId;
DWORD dwStyle;
DWORD dwFontId;
HANDLE hIcon;
LPWSTR sczCaption;
int nHeight;
int nWidth;
int nSourceX;
int nSourceY;
UINT uStringId;
HBITMAP hImage;
DWORD cFonts;
THEME_FONT* rgFonts;
DWORD cPages;
THEME_PAGE* rgPages;
DWORD cImageLists;
THEME_IMAGELIST* rgImageLists;
DWORD cControls;
THEME_CONTROL* rgControls;
// state variables that should be ignored
HWND hwndParent; // parent for loaded controls
HWND hwndHover; // current hwnd hovered over
};
/********************************************************************
ThemeInitialize - initialized theme management.
*******************************************************************/
DAPI_(HRESULT) ThemeInitialize(
__in_opt HMODULE hModule
);
/********************************************************************
ThemeUninitialize - unitialize theme management.
*******************************************************************/
DAPI_(void) ThemeUninitialize();
/********************************************************************
ThemeLoadFromFile - loads a theme from a loose file.
*******************************************************************/
DAPI_(HRESULT) ThemeLoadFromFile(
__in_z LPCWSTR wzThemeFile,
__out THEME** ppTheme
);
/********************************************************************
ThemeLoadFromResource - loads a theme from a module's data resource.
NOTE: The resource data must be UTF-8 encoded.
*******************************************************************/
DAPI_(HRESULT) ThemeLoadFromResource(
__in_opt HMODULE hModule,
__in_z LPCSTR szResource,
__out THEME** ppTheme
);
/********************************************************************
ThemeFree - frees any memory associated with a theme.
*******************************************************************/
DAPI_(void) ThemeFree(
__in THEME* pTheme
);
/********************************************************************
ThemeLoadControls - creates the windows for all the theme controls.
*******************************************************************/
DAPI_(HRESULT) ThemeLoadControls(
__in THEME* pTheme,
__in HWND hwndParent,
__in_ecount_opt(cAssignControlIds) const THEME_ASSIGN_CONTROL_ID* rgAssignControlIds,
__in DWORD cAssignControlIds
);
/********************************************************************
ThemeUnloadControls - resets all the theme control windows so the theme
controls can be reloaded.
*******************************************************************/
DAPI_(void) ThemeUnloadControls(
__in THEME* pTheme
);
/********************************************************************
ThemeLocalize - Localizes all of the strings in the them.
*******************************************************************/
DAPI_(HRESULT) ThemeLocalize(
__in THEME *pTheme,
__in const WIX_LOCALIZATION *pLocStringSet
);
DAPI_(HRESULT) ThemeLoadStrings(
__in THEME* pTheme,
__in HMODULE hResModule
);
/********************************************************************
ThemeLoadRichEditFromFile - Attach a richedit control to a RTF file.
*******************************************************************/
DAPI_(HRESULT) ThemeLoadRichEditFromFile(
__in THEME* pTheme,
__in DWORD dwControl,
__in_z LPCWSTR wzFileName,
__in HMODULE hModule
);
/********************************************************************
ThemeLoadRichEditFromResource - Attach a richedit control to resource data.
*******************************************************************/
DAPI_(HRESULT) ThemeLoadRichEditFromResource(
__in THEME* pTheme,
__in DWORD dwControl,
__in_z LPCSTR szResourceName,
__in HMODULE hModule
);
/********************************************************************
ThemeLoadRichEditFromResourceToHWnd - Attach a richedit control (by
HWND) to resource data.
*******************************************************************/
DAPI_(HRESULT) ThemeLoadRichEditFromResourceToHWnd(
__in HWND hWnd,
__in_z LPCSTR szResourceName,
__in HMODULE hModule
);
/********************************************************************
ThemeHandleKeyboardMessage - will translate the message using the active
accelerator table.
*******************************************************************/
DAPI_(BOOL) ThemeHandleKeyboardMessage(
__in_opt THEME* pTheme,
__in HWND hWnd,
__in MSG* pMsg
);
/********************************************************************
ThemeDefWindowProc - replacement for DefWindowProc() when using theme.
*******************************************************************/
LRESULT CALLBACK ThemeDefWindowProc(
__in_opt THEME* pTheme,
__in HWND hWnd,
__in UINT uMsg,
__in WPARAM wParam,
__in LPARAM lParam
);
/********************************************************************
ThemeGetPageIds - gets the page ids for the theme via page names.
*******************************************************************/
DAPI_(void) ThemeGetPageIds(
__in const THEME* pTheme,
__in_ecount(cGetPages) LPCWSTR* rgwzFindNames,
__in_ecount(cGetPages) DWORD* rgdwPageIds,
__in DWORD cGetPages
);
/********************************************************************
ThemeGetPage - gets a theme page by id.
*******************************************************************/
DAPI_(THEME_PAGE*) ThemeGetPage(
__in const THEME* pTheme,
__in DWORD dwPage
);
/********************************************************************
ThemeShowPage - shows or hides all of the controls in the page at one time.
*******************************************************************/
DAPI_(void) ThemeShowPage(
__in THEME* pTheme,
__in DWORD dwPage,
__in int nCmdShow
);
/********************************************************************
ThemeControlExists - check if a control with the specified id exists.
*******************************************************************/
DAPI_(BOOL) ThemeControlExists(
__in THEME* pTheme,
__in DWORD dwControl
);
/********************************************************************
ThemeControlEnable - enables/disables a control.
*******************************************************************/
DAPI_(void) ThemeControlEnable(
__in THEME* pTheme,
__in DWORD dwControl,
__in BOOL fEnable
);
/********************************************************************
ThemeControlEnabled - returns whether a control is enabled/disabled.
*******************************************************************/
DAPI_(BOOL) ThemeControlEnabled(
__in THEME* pTheme,
__in DWORD dwControl
);
/********************************************************************
ThemeControlElevates - sets/removes the shield icon on a control.
*******************************************************************/
DAPI_(void) ThemeControlElevates(
__in THEME* pTheme,
__in DWORD dwControl,
__in BOOL fElevates
);
/********************************************************************
ThemeShowControl - shows/hides a control.
*******************************************************************/
DAPI_(void) ThemeShowControl(
__in THEME* pTheme,
__in DWORD dwControl,
__in int nCmdShow
);
/********************************************************************
ThemeControlVisible - returns whether a control is visible.
*******************************************************************/
DAPI_(BOOL) ThemeControlVisible(
__in THEME* pTheme,
__in DWORD dwControl
);
DAPI_(BOOL) ThemePostControlMessage(
__in THEME* pTheme,
__in DWORD dwControl,
__in UINT Msg,
__in WPARAM wParam,
__in LPARAM lParam
);
DAPI_(LRESULT) ThemeSendControlMessage(
__in THEME* pTheme,
__in DWORD dwControl,
__in UINT Msg,
__in WPARAM wParam,
__in LPARAM lParam
);
/********************************************************************
ThemeDrawBackground - draws the theme background.
*******************************************************************/
DAPI_(HRESULT) ThemeDrawBackground(
__in THEME* pTheme,
__in PAINTSTRUCT* pps
);
/********************************************************************
ThemeDrawControl - draw an owner drawn control.
*******************************************************************/
DAPI_(HRESULT) ThemeDrawControl(
__in THEME* pTheme,
__in DRAWITEMSTRUCT* pdis
);
/********************************************************************
ThemeHoverControl - mark a control as hover.
*******************************************************************/
DAPI_(BOOL) ThemeHoverControl(
__in THEME* pTheme,
__in HWND hwndParent,
__in HWND hwndControl
);
/********************************************************************
ThemeIsControlChecked - gets whether a control is checked. Only
really useful for checkbox controls.
*******************************************************************/
DAPI_(BOOL) ThemeIsControlChecked(
__in THEME* pTheme,
__in DWORD dwControl
);
/********************************************************************
ThemeSetControlColor - sets the color of text for a control.
*******************************************************************/
DAPI_(BOOL) ThemeSetControlColor(
__in THEME* pTheme,
__in HDC hdc,
__in HWND hWnd,
__out HBRUSH* phBackgroundBrush
);
/********************************************************************
ThemeStartBillboard - starts a billboard control changing images according
to their interval.
NOTE: iImage specifies the image to start on. If iImage is
greater than the number of images, the last image shown
will be the start image.
*******************************************************************/
DAPI_(HRESULT) ThemeStartBillboard(
__in const THEME* pTheme,
__in DWORD dwControl,
__in WORD iImage
);
/********************************************************************
ThemeStopBillboard - stops a billboard control from changing images.
*******************************************************************/
DAPI_(HRESULT) ThemeStopBillboard(
__in const THEME* pTheme,
__in DWORD dwControl
);
/********************************************************************
ThemeSetProgressControl - sets the current percentage complete in a
progress bar control.
*******************************************************************/
DAPI_(HRESULT) ThemeSetProgressControl(
__in THEME* pTheme,
__in DWORD dwControl,
__in DWORD dwProgressPercentage
);
/********************************************************************
ThemeSetProgressControlColor - sets the current color of a
progress bar control.
*******************************************************************/
DAPI_(HRESULT) ThemeSetProgressControlColor(
__in THEME* pTheme,
__in DWORD dwControl,
__in DWORD dwColorIndex
);
/********************************************************************
ThemeSetTextControl - sets the text of a control.
*******************************************************************/
DAPI_(HRESULT) ThemeSetTextControl(
__in THEME* pTheme,
__in DWORD dwControl,
__in_z LPCWSTR wzText
);
/********************************************************************
ThemeGetTextControl - gets the text of a control.
*******************************************************************/
DAPI_(HRESULT) ThemeGetTextControl(
__in const THEME* pTheme,
__in DWORD dwControl,
__out LPWSTR* psczText
);
/********************************************************************
ThemeUpdateCaption - updates the caption in the theme.
*******************************************************************/
DAPI_(HRESULT) ThemeUpdateCaption(
__in THEME* pTheme,
__in_z LPCWSTR wzCaption
);
/********************************************************************
ThemeSetFocus - set the focus to the control supplied or the next
enabled control if it is disabled.
*******************************************************************/
DAPI_(void) ThemeSetFocus(
__in THEME* pTheme,
__in DWORD dwControl
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,45 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="timeutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Time helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI TimeFromString(
__in_z LPCWSTR wzTime,
__out FILETIME* pFileTime
);
HRESULT DAPI TimeFromString3339(
__in_z LPCWSTR wzTime,
__out FILETIME* pFileTime
);
HRESULT DAPI TimeCurrentTime(
__deref_out_z LPWSTR* ppwz,
__in BOOL fGMT
);
HRESULT DAPI TimeCurrentDateTime(
__deref_out_z LPWSTR* ppwz,
__in BOOL fGMT
);
HRESULT DAPI TimeSystemDateTime(
__deref_out_z LPWSTR* ppwz,
__in const SYSTEMTIME *pst,
__in BOOL fGMT
);
#ifdef __cplusplus
}
#endif

111
tools/WIX/sdk/inc/uriutil.h Normal file
View file

@ -0,0 +1,111 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="uriutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// URI helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#include "wininet.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum URI_PROTOCOL
{
URI_PROTOCOL_UNKNOWN,
URI_PROTOCOL_FILE,
URI_PROTOCOL_FTP,
URI_PROTOCOL_HTTP,
URI_PROTOCOL_HTTPS,
URI_PROTOCOL_LOCAL,
URI_PROTOCOL_UNC
} URI_PROTOCOL;
typedef struct _URI_INFO
{
INTERNET_SCHEME scheme;
LPWSTR sczHostName;
INTERNET_PORT port;
LPWSTR sczUser;
LPWSTR sczPassword;
LPWSTR sczPath;
LPWSTR sczQueryString;
} URI_INFO;
HRESULT DAPI UriCanonicalize(
__inout_z LPWSTR* psczUri
);
HRESULT DAPI UriCrack(
__in_z LPCWSTR wzUri,
__out_opt INTERNET_SCHEME* pScheme,
__deref_opt_out_z LPWSTR* psczHostName,
__out_opt INTERNET_PORT* pPort,
__deref_opt_out_z LPWSTR* psczUser,
__deref_opt_out_z LPWSTR* psczPassword,
__deref_opt_out_z LPWSTR* psczPath,
__deref_opt_out_z LPWSTR* psczQueryString
);
HRESULT DAPI UriCrackEx(
__in_z LPCWSTR wzUri,
__in URI_INFO* pUriInfo
);
void DAPI UriInfoUninitialize(
__in URI_INFO* pUriInfo
);
HRESULT DAPI UriCreate(
__inout_z LPWSTR* psczUri,
__in INTERNET_SCHEME scheme,
__in_z_opt LPWSTR wzHostName,
__in INTERNET_PORT port,
__in_z_opt LPWSTR wzUser,
__in_z_opt LPWSTR wzPassword,
__in_z_opt LPWSTR wzPath,
__in_z_opt LPWSTR wzQueryString
);
HRESULT DAPI UriCanonicalize(
__inout_z LPWSTR* psczUri
);
HRESULT DAPI UriFile(
__deref_out_z LPWSTR* psczFile,
__in_z LPCWSTR wzUri
);
HRESULT DAPI UriProtocol(
__in_z LPCWSTR wzUri,
__out URI_PROTOCOL* pProtocol
);
HRESULT DAPI UriRoot(
__in_z LPCWSTR wzUri,
__out LPWSTR* ppwzRoot,
__out_opt URI_PROTOCOL* pProtocol
);
HRESULT DAPI UriResolve(
__in_z LPCWSTR wzUri,
__in_opt LPCWSTR wzBaseUri,
__out LPWSTR* ppwzResolvedUri,
__out_opt const URI_PROTOCOL* pResolvedProtocol
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,42 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="userutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// User helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI UserBuildDomainUserName(
__out_ecount_z(cchDest) LPWSTR wzDest,
__in int cchDest,
__in_z LPCWSTR pwzName,
__in_z LPCWSTR pwzDomain
);
HRESULT DAPI UserCheckIsMember(
__in_z LPCWSTR pwzName,
__in_z LPCWSTR pwzDomain,
__in_z LPCWSTR pwzGroupName,
__in_z LPCWSTR pwzGroupDomain,
__out LPBOOL lpfMember
);
HRESULT DAPI UserCreateADsPath(
__in_z LPCWSTR wzObjectDomain,
__in_z LPCWSTR wzObjectName,
__out BSTR *pbstrAdsPath
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,24 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="wcalog.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Private header for internal logging functions
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
BOOL WIXAPI IsVerboseLogging();
HRESULT WIXAPI SetVerboseLoggingAtom(BOOL bValue);
#ifdef __cplusplus
}
#endif

372
tools/WIX/sdk/inc/wcautil.h Normal file
View file

@ -0,0 +1,372 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="wcautil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Windows Installer XML CustomAction utility library.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#define WIXAPI __stdcall
#define ExitTrace WcaLogError
#define ExitTrace1 WcaLogError
#define ExitTrace2 WcaLogError
#define ExitTrace3 WcaLogError
#include "dutil.h"
#define MessageExitOnLastError(x, e, s) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ExitTrace(x, "%s", s); WcaErrorMessage(e, x, MB_OK, 0); goto LExit; } }
#define MessageExitOnLastError1(x, e, f, s) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ExitTrace1(x, f, s); WcaErrorMessage(e, x, MB_OK, 1, s); goto LExit; } }
#define MessageExitOnFailure(x, e, s) if (FAILED(x)) { ExitTrace(x, "%s", s); WcaErrorMessage(e, x, INSTALLMESSAGE_ERROR | MB_OK, 0); goto LExit; }
#define MessageExitOnFailure1(x, e, f, s) if (FAILED(x)) { ExitTrace1(x, f, s); WcaErrorMessage(e, x, INSTALLMESSAGE_ERROR | MB_OK, 1, s); goto LExit; }
#define MessageExitOnFailure2(x, e, f, s, t) if (FAILED(x)) { ExitTrace2(x, f, s, t); WcaErrorMessage(e, x, INSTALLMESSAGE_ERROR | MB_OK, 2, s, t); goto LExit; }
#define MessageExitOnFailure3(x, e, f, s, t, u) if (FAILED(x)) { ExitTrace2(x, f, s, t, u); WcaErrorMessage(e, x, INSTALLMESSAGE_ERROR | MB_OK, 3, s, t, u); goto LExit; }
#define MessageExitOnNullWithLastError(p, x, e, s) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, "%s", s); WcaErrorMessage(e, x, MB_OK, 0); goto LExit; }
#define MessageExitOnNullWithLastError1(p, x, e, f, s) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, f, s); WcaErrorMessage(e, x, MB_OK, 1, s); goto LExit; }
#define MessageExitOnNullWithLastError2(p, x, e, f, s, t) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, f, s, t); WcaErrorMessage(e, x, MB_OK, 2, s, t); goto LExit; }
// Generic action enum.
typedef enum WCA_ACTION
{
WCA_ACTION_NONE,
WCA_ACTION_INSTALL,
WCA_ACTION_UNINSTALL,
} WCA_ACTION;
typedef enum WCA_CASCRIPT
{
WCA_CASCRIPT_SCHEDULED,
WCA_CASCRIPT_ROLLBACK,
} WCA_CASCRIPT;
typedef enum WCA_CASCRIPT_CLOSE
{
WCA_CASCRIPT_CLOSE_PRESERVE,
WCA_CASCRIPT_CLOSE_DELETE,
} WCA_CASCRIPT_CLOSE;
typedef enum WCA_TODO
{
WCA_TODO_UNKNOWN,
WCA_TODO_INSTALL,
WCA_TODO_UNINSTALL,
WCA_TODO_REINSTALL,
} WCA_TODO;
typedef struct WCA_CASCRIPT_STRUCT
{
LPWSTR pwzScriptPath;
HANDLE hScriptFile;
} *WCA_CASCRIPT_HANDLE;
void WIXAPI WcaGlobalInitialize(
__in HINSTANCE hInst
);
void WIXAPI WcaGlobalFinalize();
HRESULT WIXAPI WcaInitialize(
__in MSIHANDLE hInstall,
__in_z PCSTR szCustomActionLogName
);
UINT WIXAPI WcaFinalize(
__in UINT iReturnValue
);
BOOL WIXAPI WcaIsInitialized();
MSIHANDLE WIXAPI WcaGetInstallHandle();
MSIHANDLE WIXAPI WcaGetDatabaseHandle();
const char* WIXAPI WcaGetLogName();
void WIXAPI WcaSetReturnValue(
__in UINT iReturnValue
);
BOOL WIXAPI WcaCancelDetected();
#define LOG_BUFFER 2048
typedef enum LOGLEVEL
{
LOGMSG_TRACEONLY, // Never written to the log file (except in DEBUG builds)
LOGMSG_VERBOSE, // Written to log when LOGVERBOSE
LOGMSG_STANDARD // Written to log whenever informational logging is enabled
} LOGLEVEL;
void __cdecl WcaLog(
__in LOGLEVEL llv,
__in_z __format_string PCSTR fmt, ...
);
BOOL WIXAPI WcaDisplayAssert(
__in LPCSTR sz
);
void __cdecl WcaLogError(
__in HRESULT hr,
__in LPCSTR szMessage,
...
);
UINT WIXAPI WcaProcessMessage(
__in INSTALLMESSAGE eMessageType,
__in MSIHANDLE hRecord
);
UINT __cdecl WcaErrorMessage(
__in int iError,
__in HRESULT hrError,
__in UINT uiType,
__in DWORD cArgs,
...
);
HRESULT WIXAPI WcaProgressMessage(
__in UINT uiCost,
__in BOOL fExtendProgressBar
);
BOOL WIXAPI WcaIsInstalling(
__in INSTALLSTATE isInstalled,
__in INSTALLSTATE isAction
);
BOOL WIXAPI WcaIsReInstalling(
__in INSTALLSTATE isInstalled,
__in INSTALLSTATE isAction
);
BOOL WIXAPI WcaIsUninstalling(
__in INSTALLSTATE isInstalled,
__in INSTALLSTATE isAction
);
HRESULT WIXAPI WcaSetComponentState(
__in_z LPCWSTR wzComponent,
__in INSTALLSTATE isState
);
HRESULT WIXAPI WcaTableExists(
__in_z LPCWSTR wzTable
);
HRESULT WIXAPI WcaOpenView(
__in_z LPCWSTR wzSql,
__out MSIHANDLE* phView
);
HRESULT WIXAPI WcaExecuteView(
__in MSIHANDLE hView,
__in MSIHANDLE hRec
);
HRESULT WIXAPI WcaOpenExecuteView(
__in_z LPCWSTR wzSql,
__out MSIHANDLE* phView
);
HRESULT WIXAPI WcaFetchRecord(
__in MSIHANDLE hView,
__out MSIHANDLE* phRec
);
HRESULT WIXAPI WcaFetchSingleRecord(
__in MSIHANDLE hView,
__out MSIHANDLE* phRec
);
HRESULT WIXAPI WcaGetProperty(
__in_z LPCWSTR wzProperty,
__inout LPWSTR* ppwzData
);
HRESULT WIXAPI WcaGetFormattedProperty(
__in_z LPCWSTR wzProperty,
__out LPWSTR* ppwzData
);
HRESULT WIXAPI WcaGetFormattedString(
__in_z LPCWSTR wzString,
__out LPWSTR* ppwzData
);
HRESULT WIXAPI WcaGetIntProperty(
__in_z LPCWSTR wzProperty,
__inout int* piData
);
HRESULT WIXAPI WcaGetTargetPath(
__in_z LPCWSTR wzFolder,
__out LPWSTR* ppwzData
);
HRESULT WIXAPI WcaSetProperty(
__in_z LPCWSTR wzPropertyName,
__in_z LPCWSTR wzPropertyValue
);
HRESULT WIXAPI WcaSetIntProperty(
__in_z LPCWSTR wzPropertyName,
__in int nPropertyValue
);
BOOL WIXAPI WcaIsPropertySet(
__in LPCSTR szProperty
);
BOOL WIXAPI WcaIsUnicodePropertySet(
__in LPCWSTR wzProperty
);
HRESULT WIXAPI WcaGetRecordInteger(
__in MSIHANDLE hRec,
__in UINT uiField,
__inout int* piData
);
HRESULT WIXAPI WcaGetRecordString(
__in MSIHANDLE hRec,
__in UINT uiField,
__inout LPWSTR* ppwzData
);
HRESULT WIXAPI WcaGetRecordFormattedInteger(
__in MSIHANDLE hRec,
__in UINT uiField,
__out int* piData
);
HRESULT WIXAPI WcaGetRecordFormattedString(
__in MSIHANDLE hRec,
__in UINT uiField,
__inout LPWSTR* ppwzData
);
HRESULT WIXAPI WcaAllocStream(
__deref_out_bcount_part(cbData, 0) BYTE** ppbData,
__in DWORD cbData
);
HRESULT WIXAPI WcaFreeStream(
__in BYTE* pbData
);
HRESULT WIXAPI WcaGetRecordStream(
__in MSIHANDLE hRecBinary,
__in UINT uiField,
__deref_out_bcount_full(*pcbData) BYTE** ppbData,
__out DWORD* pcbData
);
HRESULT WIXAPI WcaSetRecordString(
__in MSIHANDLE hRec,
__in UINT uiField,
__in_z LPCWSTR wzData
);
HRESULT WIXAPI WcaSetRecordInteger(
__in MSIHANDLE hRec,
__in UINT uiField,
__in int iValue
);
HRESULT WIXAPI WcaDoDeferredAction(
__in_z LPCWSTR wzAction,
__in_z LPCWSTR wzCustomActionData,
__in UINT uiCost
);
DWORD WIXAPI WcaCountOfCustomActionDataRecords(
__in_z LPCWSTR wzData
);
HRESULT WIXAPI WcaReadStringFromCaData(
__deref_in LPWSTR* ppwzCustomActionData,
__deref_out_z LPWSTR* ppwzString
);
HRESULT WIXAPI WcaReadIntegerFromCaData(
__deref_in LPWSTR* ppwzCustomActionData,
__out int* piResult
);
HRESULT WIXAPI WcaReadStreamFromCaData(
__deref_in LPWSTR* ppwzCustomActionData,
__deref_out_bcount(*pcbData) BYTE** ppbData,
__out DWORD_PTR* pcbData
);
HRESULT WIXAPI WcaWriteStringToCaData(
__in_z LPCWSTR wzString,
__deref_inout_z LPWSTR* ppwzCustomActionData
);
HRESULT WIXAPI WcaWriteIntegerToCaData(
__in int i,
__deref_out_z_opt LPWSTR* ppwzCustomActionData
);
HRESULT WIXAPI WcaWriteStreamToCaData(
__in_bcount(cbData) const BYTE* pbData,
__in DWORD cbData,
__deref_inout_z_opt LPWSTR* ppwzCustomActionData
);
HRESULT __cdecl WcaAddTempRecord(
__inout MSIHANDLE* phTableView,
__inout MSIHANDLE* phColumns,
__in_z LPCWSTR wzTable,
__out_opt MSIDBERROR* pdbError,
__in UINT uiUniquifyColumn,
__in UINT cColumns,
...
);
HRESULT WIXAPI WcaDumpTable(
__in_z LPCWSTR wzTable
);
HRESULT WIXAPI WcaDeferredActionRequiresReboot();
BOOL WIXAPI WcaDidDeferredActionRequireReboot();
HRESULT WIXAPI WcaCaScriptCreateKey(
__out LPWSTR* ppwzScriptKey
);
HRESULT WIXAPI WcaCaScriptCreate(
__in WCA_ACTION action,
__in WCA_CASCRIPT script,
__in BOOL fImpersonated,
__in_z LPCWSTR wzScriptKey,
__in BOOL fAppend,
__out WCA_CASCRIPT_HANDLE* phScript
);
HRESULT WIXAPI WcaCaScriptOpen(
__in WCA_ACTION action,
__in WCA_CASCRIPT script,
__in BOOL fImpersonated,
__in_z LPCWSTR wzScriptKey,
__out WCA_CASCRIPT_HANDLE* phScript
);
void WIXAPI WcaCaScriptClose(
__in_opt WCA_CASCRIPT_HANDLE hScript,
__in WCA_CASCRIPT_CLOSE closeOperation
);
HRESULT WIXAPI WcaCaScriptReadAsCustomActionData(
__in WCA_CASCRIPT_HANDLE hScript,
__out LPWSTR* ppwzCustomActionData
);
HRESULT WIXAPI WcaCaScriptWriteString(
__in WCA_CASCRIPT_HANDLE hScript,
__in_z LPCWSTR wzValue
);
HRESULT WIXAPI WcaCaScriptWriteNumber(
__in WCA_CASCRIPT_HANDLE hScript,
__in DWORD dwValue
);
void WIXAPI WcaCaScriptFlush(
__in WCA_CASCRIPT_HANDLE hScript
);
void WIXAPI WcaCaScriptCleanup(
__in_z LPCWSTR wzProductCode,
__in BOOL fImpersonated
);
HRESULT WIXAPI QuietExec(
__inout_z LPWSTR wzCommand,
__in DWORD dwTimeout
);
WCA_TODO WIXAPI WcaGetComponentToDo(
__in_z LPCWSTR wzComponentId
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,30 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="wcawow64.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Windows Installer XML CustomAction utility library for Wow64 API-related functionality.
// </summary>
//-------------------------------------------------------------------------------------------------
#include "wcautil.h"
#ifdef __cplusplus
extern "C" {
#endif
HRESULT WIXAPI WcaInitializeWow64();
BOOL WIXAPI WcaIsWow64Process();
BOOL WIXAPI WcaIsWow64Initialized();
HRESULT WIXAPI WcaDisableWow64FSRedirection();
HRESULT WIXAPI WcaRevertWow64FSRedirection();
HRESULT WIXAPI WcaFinalizeWow64();
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,141 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="wcawrapquery.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Windows Installer XML CustomAction utility library wrappers meant to wrap an MSI view as
// opened by an immediate custom action and transmit it to a deferred custom action
// </summary>
//-------------------------------------------------------------------------------------------------
#include "wcautil.h"
// Enumerations
typedef enum eWrapQueryAction
{
wqaTableBegin = 1,
wqaTableFinish,
wqaRowBegin,
wqaRowFinish
} eWrapQueryAction;
typedef enum eColumnDataType
{
cdtString = 1,
cdtInt,
cdtStream,
cdtUnknown
} eColumnDataType;
typedef enum eFormatMaskColumn
{
efmcColumn1 = 1,
efmcColumn2 = 1 << 1,
efmcColumn3 = 1 << 2,
efmcColumn4 = 1 << 3,
efmcColumn5 = 1 << 4,
efmcColumn6 = 1 << 5,
efmcColumn7 = 1 << 6,
efmcColumn8 = 1 << 7,
efmcColumn9 = 1 << 8,
efmcColumn10 = 1 << 9,
efmcColumn11 = 1 << 10,
efmcColumn12 = 1 << 11,
efmcColumn13 = 1 << 12,
efmcColumn14 = 1 << 13,
efmcColumn15 = 1 << 14,
efmcColumn16 = 1 << 15,
efmcColumn17 = 1 << 16,
efmcColumn18 = 1 << 17,
efmcColumn19 = 1 << 18,
efmcColumn20 = 1 << 19,
efmcColumn21 = 1 << 20,
efmcColumn22 = 1 << 21,
efmcColumn23 = 1 << 22,
efmcColumn24 = 1 << 23,
efmcColumn25 = 1 << 24,
efmcColumn26 = 1 << 25,
efmcColumn27 = 1 << 26,
efmcColumn28 = 1 << 27,
efmcColumn29 = 1 << 28,
efmcColumn30 = 1 << 29,
efmcColumn31 = 1 << 30,
efmcColumn32 = 1 << 31,
} eFormatMaskColumn;
// Keeps track of the query instance for the reading CA (deferred CA)
typedef struct WCA_WRAPQUERY_STRUCT
{
// These are used to size our dynamic arrays below
DWORD dwColumns, dwRows, dwNextIndex;
// Dynamic arrays of column schema information
eColumnDataType *pcdtColumnType;
LPWSTR *ppwzColumnNames;
// Dynamic array of raw record data
MSIHANDLE *phRecords;
} *WCA_WRAPQUERY_HANDLE;
// Wrap a query
// Setting the pfFormatMask enables control over which fields will be formatted, and which will be left unchanged
// Setting dwComponentColumn to something other than 0xFFFFFFFF tells WcaWrapQuery to add two additional columns to the right side of the table
// - ISInstalled and ISAction - which map to the ComponentState of the component (the component is found in the column specified)
// Note that if a component is NULL, the component state columns will also be left null, and it will be up to the deferred CA to fail or ignore the case appropriately
// Setting dwDirectoryColumn to something other than 0xFFFFFFFF tells WcaWrapQuery to add two more additional columns to the right side of the table
// - SourcePath and TargetPath - which map to the Directory's Source and Target Path (the directory is found in the column specified)
// Note that if a directory is NULL, the directory source/target path columns will also be left null, and it will be up to the deferred CA to fail or ignore the case appropriately
HRESULT WIXAPI WcaWrapQuery(
__in_z LPCWSTR pwzQuery,
__inout LPWSTR * ppwzCustomActionData,
__in_opt DWORD dwFormatMask,
__in_opt DWORD dwComponentColumn,
__in_opt DWORD dwDirectoryColumn
);
// This wraps an empty table query into the custom action data - this is a way to indicate to the deferred custom action that a necessary table doesn't exist, or its query returned no results
HRESULT WIXAPI WcaWrapEmptyQuery(
__inout LPWSTR * ppwzCustomActionData
);
// Open a new unwrap query operation, with data from the ppwzCustomActionData string
HRESULT WIXAPI WcaBeginUnwrapQuery(
__out WCA_WRAPQUERY_HANDLE * phWrapQuery,
__inout LPWSTR * ppwzCustomActionData
);
// Get the number of records in a query being unwrapped
DWORD WIXAPI WcaGetQueryRecords(
__in const WCA_WRAPQUERY_HANDLE hWrapQuery
);
// This function resets a query back to its first row, so that the next fetch returns the first record
void WIXAPI WcaFetchWrappedReset(
__in WCA_WRAPQUERY_HANDLE hWrapQuery
);
// Fetch the next record in this query
// NOTE: the MSIHANDLE returned by this function should not be released, as it is the same handle used by the query object to maintain the item.
// so, don't use this function with PMSIHANDLE objects!
HRESULT WIXAPI WcaFetchWrappedRecord(
__in WCA_WRAPQUERY_HANDLE hWrapQuery,
__out MSIHANDLE* phRec
);
// Fetch the next record in the query where the string value in column dwComparisonColumn equals the value pwzExpectedValue
// NOTE: the MSIHANDLE returned by this function should not be released, as it is the same handle used by the query object to maintain the item.
// so, don't use this function with PMSIHANDLE objects!
HRESULT WIXAPI WcaFetchWrappedRecordWhereString(
__in WCA_WRAPQUERY_HANDLE hWrapQuery,
__in DWORD dwComparisonColumn,
__in_z LPCWSTR pwzExpectedValue,
__out MSIHANDLE* phRec
);
// Release a query ID (frees memory, and frees the ID for a new query)
void WIXAPI WcaFinishUnwrapQuery(
__in_opt WCA_WRAPQUERY_HANDLE hWrapQuery
);

383
tools/WIX/sdk/inc/wiutil.h Normal file
View file

@ -0,0 +1,383 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="wiutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Windows Installer helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// constants
#define IDNOACTION 0
#define WIU_MB_OKIGNORECANCELRETRY 0xE
#define MAX_DARWIN_KEY 73
#define MAX_DARWIN_COLUMN 255
#define WIU_LOG_DEFAULT INSTALLLOGMODE_FATALEXIT | INSTALLLOGMODE_ERROR | INSTALLLOGMODE_WARNING | \
INSTALLLOGMODE_USER | INSTALLLOGMODE_INFO | INSTALLLOGMODE_RESOLVESOURCE | \
INSTALLLOGMODE_OUTOFDISKSPACE | INSTALLLOGMODE_ACTIONSTART | \
INSTALLLOGMODE_ACTIONDATA | INSTALLLOGMODE_COMMONDATA | INSTALLLOGMODE_PROPERTYDUMP
#define ReleaseMsi(h) if (h) { ::MsiCloseHandle(h); }
#define ReleaseNullMsi(h) if (h) { ::MsiCloseHandle(h); h = NULL; }
typedef enum WIU_RESTART
{
WIU_RESTART_NONE,
WIU_RESTART_REQUIRED,
WIU_RESTART_INITIATED,
} WIU_RESTART;
typedef enum WIU_MSI_EXECUTE_MESSAGE_TYPE
{
WIU_MSI_EXECUTE_MESSAGE_NONE,
WIU_MSI_EXECUTE_MESSAGE_PROGRESS,
WIU_MSI_EXECUTE_MESSAGE_ERROR,
WIU_MSI_EXECUTE_MESSAGE_MSI_MESSAGE,
WIU_MSI_EXECUTE_MESSAGE_MSI_FILES_IN_USE,
} WIU_MSI_EXECUTE_MESSAGE_TYPE;
// structures
typedef struct _WIU_MSI_EXECUTE_MESSAGE
{
WIU_MSI_EXECUTE_MESSAGE_TYPE type;
DWORD dwAllowedResults;
DWORD cData;
LPCWSTR* rgwzData;
INT nResultRecommendation; // recommended return result for this message based on analysis of real world installs.
union
{
struct
{
DWORD dwPercentage;
} progress;
struct
{
DWORD dwErrorCode;
LPCWSTR wzMessage;
} error;
struct
{
INSTALLMESSAGE mt;
LPCWSTR wzMessage;
} msiMessage;
struct
{
DWORD cFiles;
LPCWSTR* rgwzFiles;
} msiFilesInUse;
};
} WIU_MSI_EXECUTE_MESSAGE;
typedef struct _WIU_MSI_PROGRESS
{
DWORD dwTotal;
DWORD dwCompleted;
DWORD dwStep;
BOOL fMoveForward;
BOOL fEnableActionData;
BOOL fScriptInProgress;
} WIU_MSI_PROGRESS;
typedef int (*PFN_MSIEXECUTEMESSAGEHANDLER)(
__in WIU_MSI_EXECUTE_MESSAGE* pMessage,
__in_opt LPVOID pvContext
);
typedef struct _WIU_MSI_EXECUTE_CONTEXT
{
BOOL fRollback;
PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler;
LPVOID pvContext;
WIU_MSI_PROGRESS rgMsiProgress[64];
DWORD dwCurrentProgressIndex;
INSTALLUILEVEL previousInstallUILevel;
HWND hwndPreviousParentWindow;
INSTALLUI_HANDLERW pfnPreviousExternalUI;
INSTALLUI_HANDLER_RECORD pfnPreviousExternalUIRecord;
BOOL fSetPreviousExternalUIRecord;
BOOL fSetPreviousExternalUI;
} WIU_MSI_EXECUTE_CONTEXT;
// typedefs
typedef UINT (WINAPI *PFN_MSIENABLELOGW)(
__in DWORD dwLogMode,
__in_z LPCWSTR szLogFile,
__in DWORD dwLogAttributes
);
typedef UINT (WINAPI *PFN_MSIGETPRODUCTINFOW)(
__in LPCWSTR szProductCode,
__in LPCWSTR szProperty,
__out_ecount_opt(*pcchValue) LPWSTR szValue,
__inout LPDWORD pcchValue
);
typedef INSTALLSTATE (WINAPI *PFN_MSIGETCOMPONENTPATHW)(
__in LPCWSTR szProduct,
__in LPCWSTR szComponent,
__out_ecount_opt(*pcchBuf) LPWSTR lpPathBuf,
__inout_opt LPDWORD pcchBuf
);
typedef INSTALLSTATE (WINAPI *PFN_MSILOCATECOMPONENTW)(
__in LPCWSTR szComponent,
__out_ecount_opt(*pcchBuf) LPWSTR lpPathBuf,
__inout_opt LPDWORD pcchBuf
);
typedef UINT (WINAPI *PFN_MSIGETPRODUCTINFOEXW)(
__in LPCWSTR szProductCode,
__in_opt LPCWSTR szUserSid,
__in MSIINSTALLCONTEXT dwContext,
__in LPCWSTR szProperty,
__out_ecount_opt(*pcchValue) LPWSTR szValue,
__inout_opt LPDWORD pcchValue
);
typedef INSTALLSTATE (WINAPI *PFN_MSIQUERYFEATURESTATEW)(
__in LPCWSTR szProduct,
__in LPCWSTR szFeature
);
typedef UINT (WINAPI *PFN_MSIGETPATCHINFOEXW)(
__in_z LPCWSTR wzPatchCode,
__in_z LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in MSIINSTALLCONTEXT dwContext,
__in_z LPCWSTR wzProperty,
__out_opt LPWSTR wzValue,
__inout DWORD* pcchValue
);
typedef UINT (WINAPI *PFN_MSIDETERMINEPATCHSEQUENCEW)(
__in_z LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in MSIINSTALLCONTEXT context,
__in DWORD cPatchInfo,
__in PMSIPATCHSEQUENCEINFOW pPatchInfo
);
typedef UINT (WINAPI *PFN_MSIDETERMINEAPPLICABLEPATCHESW)(
__in_z LPCWSTR wzProductPackagePath,
__in DWORD cPatchInfo,
__in PMSIPATCHSEQUENCEINFOW pPatchInfo
);
typedef UINT (WINAPI *PFN_MSIINSTALLPRODUCTW)(
__in LPCWSTR szPackagePath,
__in_opt LPCWSTR szCommandLine
);
typedef UINT (WINAPI *PFN_MSICONFIGUREPRODUCTEXW)(
__in LPCWSTR szProduct,
__in int iInstallLevel,
__in INSTALLSTATE eInstallState,
__in_opt LPCWSTR szCommandLine
);
typedef UINT (WINAPI *PFN_MSIREMOVEPATCHESW)(
__in_z LPCWSTR wzPatchList,
__in_z LPCWSTR wzProductCode,
__in INSTALLTYPE eUninstallType,
__in_z_opt LPCWSTR szPropertyList
);
typedef INSTALLUILEVEL (WINAPI *PFN_MSISETINTERNALUI)(
__in INSTALLUILEVEL dwUILevel,
__inout_opt HWND *phWnd
);
typedef UINT (WINAPI *PFN_MSISETEXTERNALUIRECORD)(
__in_opt INSTALLUI_HANDLER_RECORD puiHandler,
__in DWORD dwMessageFilter,
__in_opt LPVOID pvContext,
__out_opt PINSTALLUI_HANDLER_RECORD ppuiPrevHandler
);
typedef INSTALLUI_HANDLERW (WINAPI *PFN_MSISETEXTERNALUIW)(
__in_opt INSTALLUI_HANDLERW puiHandler,
__in DWORD dwMessageFilter,
__in_opt LPVOID pvContext
);
typedef UINT (WINAPI *PFN_MSIENUMPRODUCTSW)(
__in DWORD iProductIndex,
__out_ecount(MAX_GUID_CHARS + 1) LPWSTR lpProductBuf
);
typedef UINT (WINAPI *PFN_MSIENUMPRODUCTSEXW)(
__in_z_opt LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in DWORD dwContext,
__in DWORD dwIndex,
__out_opt WCHAR wzInstalledProductCode[39],
__out_opt MSIINSTALLCONTEXT *pdwInstalledContext,
__out_opt LPWSTR wzSid,
__inout_opt LPDWORD pcchSid
);
typedef UINT (WINAPI *PFN_MSIENUMRELATEDPRODUCTSW)(
__in LPCWSTR lpUpgradeCode,
__reserved DWORD dwReserved,
__in DWORD iProductIndex,
__out_ecount(MAX_GUID_CHARS + 1) LPWSTR lpProductBuf
);
typedef UINT (WINAPI *PFN_MSISOURCELISTADDSOURCEEXW)(
__in LPCWSTR szProductCodeOrPatchCode,
__in_opt LPCWSTR szUserSid,
__in MSIINSTALLCONTEXT dwContext,
__in DWORD dwOptions,
__in LPCWSTR szSource,
__in_opt DWORD dwIndex
);
HRESULT DAPI WiuInitialize(
);
void DAPI WiuUninitialize(
);
void DAPI WiuFunctionOverride(
__in_opt PFN_MSIENABLELOGW pfnMsiEnableLogW,
__in_opt PFN_MSIGETCOMPONENTPATHW pfnMsiGetComponentPathW,
__in_opt PFN_MSILOCATECOMPONENTW pfnMsiLocateComponentW,
__in_opt PFN_MSIQUERYFEATURESTATEW pfnMsiQueryFeatureStateW,
__in_opt PFN_MSIGETPRODUCTINFOW pfnMsiGetProductInfoW,
__in_opt PFN_MSIGETPRODUCTINFOEXW pfnMsiGetProductInfoExW,
__in_opt PFN_MSIINSTALLPRODUCTW pfnMsiInstallProductW,
__in_opt PFN_MSICONFIGUREPRODUCTEXW pfnMsiConfigureProductExW,
__in_opt PFN_MSISETINTERNALUI pfnMsiSetInternalUI,
__in_opt PFN_MSISETEXTERNALUIW pfnMsiSetExternalUIW,
__in_opt PFN_MSIENUMRELATEDPRODUCTSW pfnMsiEnumRelatedProductsW,
__in_opt PFN_MSISETEXTERNALUIRECORD pfnMsiSetExternalUIRecord,
__in_opt PFN_MSISOURCELISTADDSOURCEEXW pfnMsiSourceListAddSourceExW
);
HRESULT DAPI WiuGetComponentPath(
__in_z LPCWSTR wzProductCode,
__in_z LPCWSTR wzComponentId,
__out INSTALLSTATE* pInstallState,
__out_z LPWSTR* psczValue
);
HRESULT DAPI WiuLocateComponent(
__in_z LPCWSTR wzComponentId,
__out INSTALLSTATE* pInstallState,
__out_z LPWSTR* psczValue
);
HRESULT DAPI WiuQueryFeatureState(
__in_z LPCWSTR wzProduct,
__in_z LPCWSTR wzFeature,
__out INSTALLSTATE* pInstallState
);
HRESULT DAPI WiuGetProductInfo(
__in_z LPCWSTR wzProductCode,
__in_z LPCWSTR wzProperty,
__out LPWSTR* psczValue
);
HRESULT DAPI WiuGetProductInfoEx(
__in_z LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in MSIINSTALLCONTEXT dwContext,
__in_z LPCWSTR wzProperty,
__out LPWSTR* psczValue
);
HRESULT DAPI WiuGetProductProperty(
__in MSIHANDLE hProduct,
__in_z LPCWSTR wzProperty,
__out LPWSTR* psczValue
);
HRESULT DAPI WiuGetPatchInfoEx(
__in_z LPCWSTR wzPatchCode,
__in_z LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in MSIINSTALLCONTEXT dwContext,
__in_z LPCWSTR wzProperty,
__out LPWSTR* psczValue
);
HRESULT DAPI WiuDeterminePatchSequence(
__in_z LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in MSIINSTALLCONTEXT context,
__in PMSIPATCHSEQUENCEINFOW pPatchInfo,
__in DWORD cPatchInfo
);
HRESULT DAPI WiuDetermineApplicablePatches(
__in_z LPCWSTR wzProductPackagePath,
__in PMSIPATCHSEQUENCEINFOW pPatchInfo,
__in DWORD cPatchInfo
);
HRESULT DAPI WiuEnumProducts(
__in DWORD iProductIndex,
__out_ecount(MAX_GUID_CHARS + 1) LPWSTR wzProductCode
);
HRESULT DAPI WiuEnumProductsEx(
__in_z_opt LPCWSTR wzProductCode,
__in_z_opt LPCWSTR wzUserSid,
__in DWORD dwContext,
__in DWORD dwIndex,
__out_opt WCHAR wzInstalledProductCode[39],
__out_opt MSIINSTALLCONTEXT *pdwInstalledContext,
__out_opt LPWSTR wzSid,
__inout_opt LPDWORD pcchSid
);
HRESULT DAPI WiuEnumRelatedProducts(
__in_z LPCWSTR wzUpgradeCode,
__in DWORD iProductIndex,
__out_ecount(MAX_GUID_CHARS + 1) LPWSTR wzProductCode
);
HRESULT DAPI WiuEnumRelatedProductCodes(
__in_z LPCWSTR wzUpgradeCode,
__deref_out_ecount_opt(pcRelatedProducts) LPWSTR** prgsczProductCodes,
__out DWORD* pcRelatedProducts,
__in BOOL fReturnHighestVersionOnly
);
HRESULT DAPI WiuEnableLog(
__in DWORD dwLogMode,
__in_z LPCWSTR wzLogFile,
__in DWORD dwLogAttributes
);
HRESULT DAPI WiuInitializeExternalUI(
__in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler,
__in INSTALLUILEVEL internalUILevel,
__in HWND hwndParent,
__in LPVOID pvContext,
__in BOOL fRollback,
__in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
);
void DAPI WiuUninitializeExternalUI(
__in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
);
HRESULT DAPI WiuConfigureProductEx(
__in_z LPCWSTR wzProduct,
__in int iInstallLevel,
__in INSTALLSTATE eInstallState,
__in_z LPCWSTR wzCommandLine,
__out WIU_RESTART* pRestart
);
HRESULT DAPI WiuInstallProduct(
__in_z LPCWSTR wzPackagPath,
__in_z LPCWSTR wzCommandLine,
__out WIU_RESTART* pRestart
);
HRESULT DAPI WiuRemovePatches(
__in_z LPCWSTR wzPatchList,
__in_z LPCWSTR wzProductCode,
__in_z LPCWSTR wzPropertyList,
__out WIU_RESTART* pRestart
);
HRESULT DAPI WiuSourceListAddSourceEx(
__in_z LPCWSTR wzProductCodeOrPatchCode,
__in_z_opt LPCWSTR wzUserSid,
__in MSIINSTALLCONTEXT dwContext,
__in DWORD dwCode,
__in_z LPCWSTR wzSource,
__in_opt DWORD dwIndex
);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,31 @@
//-------------------------------------------------------------------------------------------------
// <copyright file="wuautil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Header for Windows Update Agent helpers.
// </summary>
//-------------------------------------------------------------------------------------------------
#pragma once
#if defined(__cplusplus)
extern "C" {
#endif
HRESULT DAPI WuaPauseAutomaticUpdates();
HRESULT DAPI WuaResumeAutomaticUpdates();
HRESULT DAPI WuaRestartRequired(
__out BOOL* pfRestartRequired
);
#if defined(__cplusplus)
}
#endif

178
tools/WIX/sdk/inc/xmlutil.h Normal file
View file

@ -0,0 +1,178 @@
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="xmlutil.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// XML helper functions.
// </summary>
//-------------------------------------------------------------------------------------------------
// constant XML CLSIDs and IIDs
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument = {0x2933BF90, 0x7B36, 0x11d2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument20 = {0xF6D90F11, 0x9C73, 0x11D3, {0xB3, 0x2E, 0x00, 0xC0, 0x4F, 0x99, 0x0B, 0xB4}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument26 = {0xf5078f1b, 0xc551, 0x11d3, {0x89, 0xb9, 0x00, 0x00, 0xf8, 0x1f, 0xe2, 0x21}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument30 = {0xf5078f32, 0xc551, 0x11d3, {0x89, 0xb9, 0x00, 0x00, 0xf8, 0x1f, 0xe2, 0x21}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument40 = {0x88d969c0, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument50 = {0x88d969e5, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument60 = {0x88d96a05, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
extern __declspec(selectany) const CLSID XmlUtil_CLSID_XMLSchemaCache = {0x88d969c2, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
extern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMDocument = {0x2933BF81, 0x7B36, 0x11D2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};
extern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMDocument2 = {0x2933BF95, 0x7B36, 0x11D2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};
extern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMSchemaCollection = {0x373984C8, 0xB845, 0x449B, {0x91, 0xE7, 0x45, 0xAC, 0x83, 0x03, 0x6A, 0xDE}};
typedef enum XML_LOAD_ATTRIBUTE
{
XML_LOAD_PRESERVE_WHITESPACE = 1,
} XML_LOAD_ATTRIBUTE;
#ifdef __cplusplus
extern "C" {
#endif
HRESULT DAPI XmlInitialize();
void DAPI XmlUninitialize();
HRESULT DAPI XmlCreateElement(
__in IXMLDOMDocument *pixdDocument,
__in_z LPCWSTR wzElementName,
__out IXMLDOMElement **ppixnElement
);
HRESULT DAPI XmlCreateDocument(
__in_opt LPCWSTR pwzElementName,
__out IXMLDOMDocument** ppixdDocument,
__out_opt IXMLDOMElement** ppixeRootElement = NULL
);
HRESULT DAPI XmlLoadDocument(
__in_z LPCWSTR wzDocument,
__out IXMLDOMDocument** ppixdDocument
);
HRESULT DAPI XmlLoadDocumentEx(
__in_z LPCWSTR wzDocument,
__in DWORD dwAttributes,
__out IXMLDOMDocument** ppixdDocument
);
HRESULT DAPI XmlLoadDocumentFromFile(
__in_z LPCWSTR wzPath,
__out IXMLDOMDocument** ppixdDocument
);
HRESULT DAPI XmlLoadDocumentFromBuffer(
__in_bcount(cbSource) const BYTE* pbSource,
__in DWORD cbSource,
__out IXMLDOMDocument** ppixdDocument
);
HRESULT DAPI XmlLoadDocumentFromFileEx(
__in_z LPCWSTR wzPath,
__in DWORD dwAttributes,
__out IXMLDOMDocument** ppixdDocument
);
HRESULT DAPI XmlSelectSingleNode(
__in IXMLDOMNode* pixnParent,
__in_z LPCWSTR wzXPath,
__out IXMLDOMNode **ppixnChild
);
HRESULT DAPI XmlSetAttribute(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzAttribute,
__in_z LPCWSTR pwzAttributeValue
);
HRESULT DAPI XmlCreateTextNode(
__in IXMLDOMDocument *pixdDocument,
__in_z LPCWSTR wzText,
__out IXMLDOMText **ppixnTextNode
);
HRESULT DAPI XmlGetText(
__in IXMLDOMNode* pixnNode,
__deref_out_z BSTR* pbstrText
);
HRESULT DAPI XmlGetAttribute(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzAttribute,
__deref_out_z BSTR* pbstrAttributeValue
);
HRESULT DAPI XmlGetAttributeEx(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR wzAttribute,
__deref_out_z LPWSTR* psczAttributeValue
);
HRESULT DAPI XmlGetYesNoAttribute(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR wzAttribute,
__out BOOL* pfYes
);
HRESULT DAPI XmlGetAttributeNumber(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzAttribute,
__out DWORD* pdwValue
);
HRESULT DAPI XmlGetAttributeNumberBase(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzAttribute,
__in int nBase,
__out DWORD* pdwValue
);
HRESULT DAPI XmlGetAttributeLargeNumber(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzAttribute,
__out DWORD64* pdw64Value
);
HRESULT DAPI XmlGetNamedItem(
__in IXMLDOMNamedNodeMap *pixnmAttributes,
__in_opt LPCWSTR wzName,
__out IXMLDOMNode **ppixnNamedItem
);
HRESULT DAPI XmlSetText(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzText
);
HRESULT DAPI XmlSetTextNumber(
__in IXMLDOMNode *pixnNode,
__in DWORD dwValue
);
HRESULT DAPI XmlCreateChild(
__in IXMLDOMNode* pixnParent,
__in_z LPCWSTR pwzElementType,
__out IXMLDOMNode** ppixnChild
);
HRESULT DAPI XmlRemoveAttribute(
__in IXMLDOMNode* pixnNode,
__in_z LPCWSTR pwzAttribute
);
HRESULT DAPI XmlSelectNodes(
__in IXMLDOMNode* pixnParent,
__in_z LPCWSTR wzXPath,
__out IXMLDOMNodeList **ppixnChild
);
HRESULT DAPI XmlNextAttribute(
__in IXMLDOMNamedNodeMap* pixnnm,
__out IXMLDOMNode** pixnAttribute,
__deref_opt_out_z_opt BSTR* pbstrAttribute
);
HRESULT DAPI XmlNextElement(
__in IXMLDOMNodeList* pixnl,
__out IXMLDOMNode** pixnElement,
__deref_opt_out_z_opt BSTR* pbstrElement
);
HRESULT DAPI XmlRemoveChildren(
__in IXMLDOMNode* pixnSource,
__in_z LPCWSTR pwzXPath
);
HRESULT DAPI XmlSaveDocument(
__in IXMLDOMDocument* pixdDocument,
__inout LPCWSTR wzPath
);
HRESULT DAPI XmlSaveDocumentToBuffer(
__in IXMLDOMDocument* pixdDocument,
__deref_out_bcount(*pcbDest) BYTE** ppbDest,
__out DWORD* pcbDest
);
#ifdef __cplusplus
}
#endif