
Ящик для предложений: sales@blogslov.ru
Send Wix-commits mailing list submissions to
wix-commits@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/wix-commits
or, via email, send a message with subject or body 'help' to
wix-commits-request@lists.sourceforge.net
You can reach the person managing the list at
wix-commits-owner@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Wix-commits digest..."
Today's Topics:
1. wix2.0/src/ca/serverca/scasched precomp.h, 1.4, 1.5
scacert.cpp, 1.3, 1.4 scafilter.cpp, 1.3, 1.4 scaiis.cpp, 1.3,
1.4 scaiis.h, 1.2, 1.3 scawebappext.cpp, 1.3, 1.4 scawebappext.h,
1.3, 1.4 scasql.h, 1.3, NONE (Rob Mensching)
----------------------------------------------------------------------
Message: 1
Date: Wed, 27 Jun 2007 05:42:54 +0000
From: Rob Mensching
Subject: [WiX-commits] wix2.0/src/ca/serverca/scasched precomp.h, 1.4,
1.5 scacert.cpp, 1.3, 1.4 scafilter.cpp, 1.3, 1.4 scaiis.cpp, 1.3, 1.4
scaiis.h, 1.2, 1.3 scawebappext.cpp, 1.3, 1.4 scawebappext.h, 1.3, 1.4
scasql.h, 1.3, NONE
To: wix-commits@lists.sourceforge.net
Message-ID:
Update of /cvsroot/wix/wix2.0/src/ca/serverca/scasched
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6008/src/ca/serverca/scasched
Modified Files:
precomp.h scacert.cpp scafilter.cpp scaiis.cpp scaiis.h
scawebappext.cpp scawebappext.h
Removed Files:
scasql.h
Log Message:
RobMen: SFBUG:1680666 - Correctly modularize RemoveIniFile.DirProperites.
AaronSte: SFBUG:1675664 - Marking ComboBox value attribute as localizable.
BobArnso: sfbug:1680395 - emit File/@Source instead of src
RobMen: Make the Server CustomActions TSAware to handle TS correctly.
AaronSte: SFBUG:1687206 - Update Tallow so DllRegisterServer captures will work
on Windows Vista from an elevated cmd prompt.
RobMen: SFBUG:1690263 - make Directory (and Name) required, since they are.
BobArnso: Clarify error message that Express editions of Visual Studio aren't
supported, only Standard and above.
RobMen: SFBUG:1670978 - fix multiple IIS Filter install/uninstall.
FGrohn: Move to Windows Vista SDK.
RobMen: SFBUG:1712448 - remove dead CreateElement attribute.
RobMen: SFBUG:1710222 - fix modularization on certificate CustomActions.
RobMen: SFBUG:1707259 - fix nasty memory violation
RobMen: SFBUG:1710227 - update certificate CustomAction to handle modularized
BinaryKey and CertificatePaths.
RobMen: SFBUG:1716160 - fix string overflow error for XmlFile and XmlConfig
Index: scawebappext.h
===================================================================
RCS file: /cvsroot/wix/wix2.0/src/ca/serverca/scasched/scawebappext.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** scawebappext.h 24 May 2006 23:29:30 -0000 1.3
--- scawebappext.h 27 Jun 2007 05:42:52 -0000 1.4
***************
*** 21,31 ****
struct SCA_WEB_APPLICATION_EXTENSION
{
! WCHAR wzExtension[MAX_DARWIN_COLUMN + 1];
! WCHAR wzVerbs[MAX_DARWIN_COLUMN + 1];
! WCHAR wzExecutable[MAX_DARWIN_COLUMN + 1];
! int iAttributes;
! SCA_WEB_APPLICATION_EXTENSION* pswappextNext;
};
--- 21,31 ----
struct SCA_WEB_APPLICATION_EXTENSION
{
! WCHAR wzExtension[MAX_DARWIN_COLUMN + 1];
! WCHAR wzVerbs[MAX_DARWIN_COLUMN + 1];
! WCHAR wzExecutable[MAX_DARWIN_COLUMN + 1];
! int iAttributes;
! SCA_WEB_APPLICATION_EXTENSION* pswappextNext;
};
***************
*** 33,48 ****
// prototypes
HRESULT ScaWebAppExtensionsRead(
! LPCWSTR wzApplication,
! SCA_WEB_APPLICATION_EXTENSION** ppswappextList
! );
HRESULT ScaWebAppExtensionsWrite(
! IMSAdminBase* piMetabase,
! LPCWSTR wzRootOfWeb,
! SCA_WEB_APPLICATION_EXTENSION* pswappextList
! );
void ScaWebAppExtensionsFreeList(
! SCA_WEB_APPLICATION_EXTENSION* pswappextList
! );
!
--- 33,47 ----
// prototypes
HRESULT ScaWebAppExtensionsRead(
! __in LPCWSTR wzApplication,
! __inout SCA_WEB_APPLICATION_EXTENSION** ppswappextList
! );
HRESULT ScaWebAppExtensionsWrite(
! __in IMSAdminBase* piMetabase,
! __in LPCWSTR wzRootOfWeb,
! __in SCA_WEB_APPLICATION_EXTENSION* pswappextList
! );
void ScaWebAppExtensionsFreeList(
! __in SCA_WEB_APPLICATION_EXTENSION* pswappextList
! );
Index: scafilter.cpp
===================================================================
RCS file: /cvsroot/wix/wix2.0/src/ca/serverca/scasched/scafilter.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** scafilter.cpp 24 May 2006 23:29:30 -0000 1.3
--- scafilter.cpp 27 Jun 2007 05:42:52 -0000 1.4
***************
*** 21,218 ****
// sql queries
! LPCWSTR vcsFilterQuery = L"SELECT `Web_`, `Name`, `Component_`, `Path`, `Description`, `Flags`, `LoadOrder` "
! L"FROM `IIsFilter`";
enum eFilterQuery { fqWeb = 1, fqFilter, fqComponent , fqPath, fqDescription, fqFlags, fqLoadOrder };
// prototypes
! static HRESULT AddFilterToList(SCA_FILTER** ppsfList);
! UINT __stdcall ScaFiltersRead(IMSAdminBase* piMetabase,
! SCA_WEB* pswList, SCA_FILTER** ppsfList)
{
! HRESULT hr = S_OK;
! UINT er = ERROR_SUCCESS;
! PMSIHANDLE hView, hRec;
! PMSIHANDLE hViewWeb, hRecWeb;
! BOOL fIIsWebFilterTable = FALSE;
! LPWSTR pwzData = NULL;
! SCA_FILTER* psf = NULL;
! DWORD dwLen = 0;
! // check for required table
! if (S_OK != WcaTableExists(L"IIsFilter"))
! {
! WcaLog(LOGMSG_VERBOSE, "Skipping ScaInstallFilters() - no IIsFilter table");
! ExitFunction1(hr = S_FALSE);
! }
! // loop through all the filters
! hr = WcaOpenExecuteView(vcsFilterQuery, &hView);
! ExitOnFailure(hr, "Failed to open view on IIsFilter table");
! while (S_OK == (hr = WcaFetchRecord(hView, &hRec)))
! {
! hr = AddFilterToList(ppsfList);
! ExitOnFailure(hr, "failed to add filter to list");
! psf = *ppsfList;
! // get component install state
! hr = WcaGetRecordString(hRec, fqComponent, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Component_");
! er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzData, &psf->isInstalled, &psf->isAction);
! hr = HRESULT_FROM_WIN32(er);
! ExitOnFailure(hr, "Failed to get Component state for filter");
! ::ZeroMemory(psf->wzFilterRoot, sizeof(psf->wzFilterRoot));
! hr = WcaGetRecordString(hRec, fqWeb, &pwzData);
! ExitOnFailure(hr, "Failed to get Web for VirtualDir");
! if (*pwzData)
! {
! dwLen = countof(psf->wzWebBase);
! hr = ScaWebsGetBase(piMetabase, pswList, pwzData, psf->wzWebBase, &dwLen);
! ExitOnFailure(hr, "Failed to get base of web for Filter");
! StringCchPrintfW(psf->wzFilterRoot, countof(psf->wzFilterRoot), L"%s/Filters", psf->wzWebBase);
! }
! else
! {
! StringCchCopyW(psf->wzFilterRoot, countof(psf->wzFilterRoot), L"/LM/W3SVC/Filters");
! }
! // filter key
! hr = WcaGetRecordString(hRec, fqFilter, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Filter");
! StringCchCopyW(psf->wzKey, countof(psf->wzKey), pwzData);
! // filter path
! hr = WcaGetRecordFormattedString(hRec, fqPath, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Path");
! StringCchCopyW(psf->wzPath, countof(psf->wzPath), pwzData);
! // filter description
! hr = WcaGetRecordFormattedString(hRec, fqDescription, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Description");
! StringCchCopyW(psf->wzDescription, countof(psf->wzDescription), pwzData);
! // filter flags
! hr = WcaGetRecordInteger(hRec, fqFlags, &psf->iFlags);
! ExitOnFailure(hr, "Failed to get Filter.Flags");
! // filter load order
! hr = WcaGetRecordInteger(hRec, fqLoadOrder, &psf->iLoadOrder);
! ExitOnFailure(hr, "Failed to get Filter.LoadOrder");
! }
! if (E_NOMOREITEMS == hr)
! hr = S_OK;
! ExitOnFailure(hr, "Failure while processing filters");
LExit:
! ReleaseStr(pwzData);
! return hr;
}
! HRESULT ScaFiltersInstall(IMSAdminBase* piMetabase, SCA_FILTER* psfList)
{
! HRESULT hr = S_OK;
! SCA_FILTER* psf = psfList;
! while (psf)
! {
! if (WcaIsInstalling(psf->isInstalled, psf->isAction))
! {
! hr = ScaCreateMetabaseKey(piMetabase, psf->wzFilterRoot, psf->wzKey);
! ExitOnFailure1(hr, "Failed to create key for filter '%S'", psf->wzKey);
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_KEY_TYPE, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)L"IIsFilter");
! ExitOnFailure1(hr, "Failed to write key type for filter '%S'", psf->wzKey);
! // filter path
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_FILTER_IMAGE_PATH, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)psf->wzPath);
! ExitOnFailure1(hr, "Failed to write Path for filter '%S'", psf->wzKey);
! // filter description
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_FILTER_DESCRIPTION, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)psf->wzDescription);
! ExitOnFailure1(hr, "Failed to write Description for filter ''%S", psf->wzKey);
! // filter flags
! if (MSI_NULL_INTEGER != psf->iFlags)
! {
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_FILTER_FLAGS, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, DWORD_METADATA, (LPVOID)((DWORD_PTR)psf->iFlags));
! ExitOnFailure1(hr, "Failed to write Flags for filter '%S'", psf->wzKey);
! }
! // filter load order
! if (MSI_NULL_INTEGER != psf->iLoadOrder)
! {
! hr = ScaAddFilterToLoadOrder(piMetabase, psf->wzFilterRoot, psf->wzKey, psf->iLoadOrder);
! ExitOnFailure1(hr, "Failed to add filter '%S' to load order", psf->wzKey);
! }
! }
! psf = psf->psfNext;
! }
LExit:
! return hr;
}
! HRESULT ScaFiltersUninstall(IMSAdminBase* piMetabase, SCA_FILTER* psfList)
{
! HRESULT hr = S_OK;
! SCA_FILTER* psf = psfList;
! while (psf)
! {
! if (WcaIsUninstalling(psf->isInstalled, psf->isAction))
! {
! hr = ScaRemoveFilterFromLoadOrder(piMetabase, psf->wzFilterRoot, psf->wzKey);
! ExitOnFailure1(hr, "Failed to remove filter '%S' from load order", psf->wzKey);
! // remove the filter from the load order and remove the filter's key
! hr = ScaDeleteMetabaseKey(piMetabase, psf->wzFilterRoot, psf->wzKey);
! ExitOnFailure1(hr, "Failed to remove web '%S' from metabase", psf->wzKey);
! }
! psf = psf->psfNext;
! }
LExit:
! return hr;
}
! void ScaFiltersFreeList(SCA_FILTER* psfList)
{
! SCA_FILTER* psfDelete = psfList;
! while (psfList)
! {
! psfDelete = psfList;
! psfList = psfList->psfNext;
! MemFree(psfDelete);
! }
}
// private helper functions
! static HRESULT AddFilterToList(SCA_FILTER** ppsfList)
{
! HRESULT hr = S_OK;
! SCA_FILTER* psf = (SCA_FILTER*)MemAlloc(sizeof(SCA_FILTER), TRUE);
! ExitOnNull(psf, hr, E_OUTOFMEMORY, "failed to add filter to filter list");
!
! psf->psfNext = *ppsfList;
! *ppsfList = psf;
LExit:
! return hr;
}
--- 21,502 ----
// sql queries
! LPCWSTR vcsFilterQuery = L"SELECT `Web_`, `Name`, `Component_`, `Path`, `Description`, `Flags`, `LoadOrder` FROM `IIsFilter` ORDER BY `Web_`";
enum eFilterQuery { fqWeb = 1, fqFilter, fqComponent , fqPath, fqDescription, fqFlags, fqLoadOrder };
// prototypes
! static HRESULT AddFilterToList(
! __in SCA_FILTER** ppsfList
! );
! static HRESULT ReadFilterLoadOrder(
! __in IMSAdminBase* piMetabase,
! __in LPCWSTR wzFilterRoot,
! __out LPWSTR *ppwzLoadOrder
! );
! static HRESULT AddFilterToLoadOrder(
! __in LPCWSTR wzFilter,
! __in int iLoadOrder,
! __inout LPWSTR *ppwzLoadOrder
! );
! static HRESULT RemoveFilterFromLoadOrder(
! __in LPCWSTR wzFilter,
! __inout LPWSTR *ppwzLoadOrder
! );
! UINT __stdcall ScaFiltersRead(
! __in IMSAdminBase* piMetabase,
! __in SCA_WEB* pswList,
! __inout SCA_FILTER** ppsfList
! )
{
! HRESULT hr = S_OK;
! UINT er = ERROR_SUCCESS;
! PMSIHANDLE hView, hRec;
! PMSIHANDLE hViewWeb, hRecWeb;
! BOOL fIIsWebFilterTable = FALSE;
! LPWSTR pwzData = NULL;
! SCA_FILTER* psf = NULL;
! DWORD dwLen = 0;
! // check for required table
! if (S_OK != WcaTableExists(L"IIsFilter"))
! {
! WcaLog(LOGMSG_VERBOSE, "Skipping ScaInstallFilters() - no IIsFilter table");
! ExitFunction1(hr = S_FALSE);
! }
! // loop through all the filters
! hr = WcaOpenExecuteView(vcsFilterQuery, &hView);
! ExitOnFailure(hr, "Failed to open view on IIsFilter table");
! while (S_OK == (hr = WcaFetchRecord(hView, &hRec)))
! {
! hr = AddFilterToList(ppsfList);
! ExitOnFailure(hr, "failed to add filter to list");
! psf = *ppsfList;
! // get component install state
! hr = WcaGetRecordString(hRec, fqComponent, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Component_");
! er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzData, &psf->isInstalled, &psf->isAction);
! hr = HRESULT_FROM_WIN32(er);
! ExitOnFailure(hr, "Failed to get Component state for filter");
! ::ZeroMemory(psf->wzFilterRoot, sizeof(psf->wzFilterRoot));
! hr = WcaGetRecordString(hRec, fqWeb, &pwzData);
! ExitOnFailure(hr, "Failed to get Web for VirtualDir");
! if (*pwzData)
! {
! dwLen = countof(psf->wzWebBase);
! hr = ScaWebsGetBase(piMetabase, pswList, pwzData, psf->wzWebBase, &dwLen);
! ExitOnFailure(hr, "Failed to get base of web for Filter");
! StringCchPrintfW(psf->wzFilterRoot, countof(psf->wzFilterRoot), L"%s/Filters", psf->wzWebBase);
! }
! else
! {
! StringCchCopyW(psf->wzFilterRoot, countof(psf->wzFilterRoot), L"/LM/W3SVC/Filters");
! }
! // filter key
! hr = WcaGetRecordString(hRec, fqFilter, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Filter");
! StringCchCopyW(psf->wzKey, countof(psf->wzKey), pwzData);
! // filter path
! hr = WcaGetRecordFormattedString(hRec, fqPath, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Path");
! StringCchCopyW(psf->wzPath, countof(psf->wzPath), pwzData);
! // filter description
! hr = WcaGetRecordFormattedString(hRec, fqDescription, &pwzData);
! ExitOnFailure(hr, "Failed to get Filter.Description");
! StringCchCopyW(psf->wzDescription, countof(psf->wzDescription), pwzData);
! // filter flags
! hr = WcaGetRecordInteger(hRec, fqFlags, &psf->iFlags);
! ExitOnFailure(hr, "Failed to get Filter.Flags");
! // filter load order
! hr = WcaGetRecordInteger(hRec, fqLoadOrder, &psf->iLoadOrder);
! ExitOnFailure(hr, "Failed to get Filter.LoadOrder");
! }
! if (E_NOMOREITEMS == hr)
! {
! hr = S_OK;
! }
! ExitOnFailure(hr, "Failure while processing filters");
LExit:
! ReleaseStr(pwzData);
! return hr;
}
! HRESULT ScaFiltersInstall(
! __in IMSAdminBase* piMetabase,
! __in SCA_FILTER* psfList
! )
{
! HRESULT hr = S_OK;
! SCA_FILTER* psf = psfList;
! LPCWSTR wzPreviousFilterRoot = NULL;
! LPWSTR pwzLoadOrder = NULL;
! while (psf)
! {
! if (WcaIsInstalling(psf->isInstalled, psf->isAction))
! {
! if (!wzPreviousFilterRoot || CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, wzPreviousFilterRoot, -1, psf->wzFilterRoot, -1))
! {
! if (pwzLoadOrder)
! {
! hr = ScaWriteMetabaseValue(piMetabase, wzPreviousFilterRoot, L"", MD_FILTER_LOAD_ORDER, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)pwzLoadOrder);
! ExitOnFailure(hr, "Failed to write filter load order to metabase");
! ReleaseNullStr(pwzLoadOrder);
! }
! hr = ReadFilterLoadOrder(piMetabase, psf->wzFilterRoot, &pwzLoadOrder);
! ExitOnFailure(hr, "Failed to read filter load order.");
! wzPreviousFilterRoot = psf->wzFilterRoot;
! }
! hr = ScaCreateMetabaseKey(piMetabase, psf->wzFilterRoot, psf->wzKey);
! ExitOnFailure1(hr, "Failed to create key for filter '%S'", psf->wzKey);
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_KEY_TYPE, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)L"IIsFilter");
! ExitOnFailure1(hr, "Failed to write key type for filter '%S'", psf->wzKey);
! // filter path
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_FILTER_IMAGE_PATH, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)psf->wzPath);
! ExitOnFailure1(hr, "Failed to write Path for filter '%S'", psf->wzKey);
!
! // filter description
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_FILTER_DESCRIPTION, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)psf->wzDescription);
! ExitOnFailure1(hr, "Failed to write Description for filter '%S'", psf->wzKey);
!
! // filter flags
! if (MSI_NULL_INTEGER != psf->iFlags)
! {
! hr = ScaWriteMetabaseValue(piMetabase, psf->wzFilterRoot, psf->wzKey, MD_FILTER_FLAGS, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, DWORD_METADATA, (LPVOID)((DWORD_PTR)psf->iFlags));
! ExitOnFailure1(hr, "Failed to write Flags for filter '%S'", psf->wzKey);
! }
!
! // filter load order
! if (MSI_NULL_INTEGER != psf->iLoadOrder)
! {
! hr = AddFilterToLoadOrder(psf->wzKey, psf->iLoadOrder, &pwzLoadOrder);
! ExitOnFailure1(hr, "Failed to add filter '%S' to load order.", psf->wzKey);
! }
! }
!
! psf = psf->psfNext;
! }
!
! if (pwzLoadOrder)
! {
! Assert(wzPreviousFilterRoot && *wzPreviousFilterRoot);
!
! hr = ScaWriteMetabaseValue(piMetabase, wzPreviousFilterRoot, L"", MD_FILTER_LOAD_ORDER, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)pwzLoadOrder);
! ExitOnFailure(hr, "Failed to write filter load order to metabase");
! }
LExit:
! ReleaseStr(pwzLoadOrder);
! return hr;
}
! HRESULT ScaFiltersUninstall(
! __in IMSAdminBase* piMetabase,
! __in SCA_FILTER* psfList
! )
{
! HRESULT hr = S_OK;
! SCA_FILTER* psf = psfList;
! LPCWSTR wzPreviousFilterRoot = NULL;
! LPWSTR pwzLoadOrder = NULL;
! while (psf)
! {
! if (WcaIsUninstalling(psf->isInstalled, psf->isAction))
! {
! if (!wzPreviousFilterRoot || CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, 0, wzPreviousFilterRoot, -1, psf->wzFilterRoot, -1))
! {
! if (pwzLoadOrder)
! {
! hr = ScaWriteMetabaseValue(piMetabase, wzPreviousFilterRoot, L"", MD_FILTER_LOAD_ORDER, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)pwzLoadOrder);
! ExitOnFailure(hr, "Failed to write filter load order to metabase");
! ReleaseNullStr(pwzLoadOrder);
! }
! hr = ReadFilterLoadOrder(piMetabase, psf->wzFilterRoot, &pwzLoadOrder);
! ExitOnFailure(hr, "Failed to read filter load order.");
!
! wzPreviousFilterRoot = psf->wzFilterRoot;
! }
!
! hr = RemoveFilterFromLoadOrder(psf->wzKey, &pwzLoadOrder);
! ExitOnFailure1(hr, "Failed to remove filter '%S' from load order", psf->wzKey);
!
! // remove the filter from the load order and remove the filter's key
! hr = ScaDeleteMetabaseKey(piMetabase, psf->wzFilterRoot, psf->wzKey);
! ExitOnFailure1(hr, "Failed to remove web '%S' from metabase", psf->wzKey);
! }
!
! psf = psf->psfNext;
! }
!
! if (pwzLoadOrder)
! {
! Assert(wzPreviousFilterRoot && *wzPreviousFilterRoot);
!
! hr = ScaWriteMetabaseValue(piMetabase, wzPreviousFilterRoot, L"", MD_FILTER_LOAD_ORDER, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)pwzLoadOrder);
! ExitOnFailure(hr, "Failed to write filter load order to metabase");
! }
LExit:
! return hr;
}
! void ScaFiltersFreeList(
! __in SCA_FILTER* psfList
! )
{
! SCA_FILTER* psfDelete = psfList;
! while (psfList)
! {
! psfDelete = psfList;
! psfList = psfList->psfNext;
! MemFree(psfDelete);
! }
}
// private helper functions
! static HRESULT AddFilterToList(
! __inout SCA_FILTER** ppsfList)
{
! HRESULT hr = S_OK;
! SCA_FILTER* psf = (SCA_FILTER*)MemAlloc(sizeof(SCA_FILTER), TRUE);
! ExitOnNull(psf, hr, E_OUTOFMEMORY, "failed to add filter to filter list");
!
! psf->psfNext = *ppsfList;
! *ppsfList = psf;
LExit:
! return hr;
! }
!
!
! static HRESULT ReadFilterLoadOrder(
! __in IMSAdminBase* piMetabase,
! __in LPCWSTR wzFilterRoot,
! __out LPWSTR *ppwzLoadOrder
! )
! {
! HRESULT hr = S_OK;
! METADATA_HANDLE mhRoot = NULL;
!
! METADATA_RECORD mr;
! DWORD dwRequired = 0;
! DWORD cchData = 255;
!
! ::ZeroMemory(&mr, sizeof(mr));
! mr.dwMDIdentifier = MD_FILTER_LOAD_ORDER;
! mr.dwMDAttributes = METADATA_NO_ATTRIBUTES;
! mr.dwMDUserType = IIS_MD_UT_SERVER;
! mr.dwMDDataType = ALL_METADATA;
! mr.dwMDDataLen = cchData;
! mr.pbMDData = static_cast(MemAlloc(mr.dwMDDataLen * sizeof(WCHAR), TRUE));
! ExitOnNull(mr.pbMDData, hr, E_OUTOFMEMORY, "failed to allocate memory for MDData in metadata record");
!
! hr = piMetabase->OpenKey(METADATA_MASTER_ROOT_HANDLE, wzFilterRoot, METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10, &mhRoot);
! for (int i = 0; i < 30 && HRESULT_FROM_WIN32(ERROR_PATH_BUSY) == hr; i++)
! {
! ::Sleep(1000);
! WcaLog(LOGMSG_STANDARD, "Failed to open root key, retrying %d time(s)...", i);
! hr = piMetabase->OpenKey(METADATA_MASTER_ROOT_HANDLE, wzFilterRoot, METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10, &mhRoot);
! }
!
! if (SUCCEEDED(hr))
! {
! hr = piMetabase->GetData(mhRoot, L"", &mr, &dwRequired);
! if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr)
! {
! mr.dwMDDataLen = cchData = dwRequired;
!
! LPVOID pv = MemReAlloc(mr.pbMDData, mr.dwMDDataLen * sizeof(WCHAR), TRUE);
! ExitOnNull(pv, hr, E_OUTOFMEMORY, "failed to allocate memory for MDData in metadata record");
! mr.pbMDData = static_cast(pv);
!
! hr = piMetabase->GetData(mhRoot, L"", &mr, &dwRequired);
! }
! }
!
! // The /Filters node or /Filters/FilterLoadOrder property might not exist (yet).
! if (HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == hr || MD_ERROR_DATA_NOT_FOUND == hr)
! {
! hr = S_OK;
! }
! ExitOnFailure(hr, "Failed to get filter load order.");
!
! hr = StrAllocString(ppwzLoadOrder, reinterpret_cast(mr.pbMDData), 0);
! ExitOnFailure(hr, "Failed to allocate string for filter load order.");
!
! LExit:
! ReleaseMem(mr.pbMDData);
!
! if (mhRoot)
! {
! piMetabase->CloseKey(mhRoot);
! }
!
! return hr;
! }
!
!
! static HRESULT AddFilterToLoadOrder(
! __in LPCWSTR wzFilter,
! __in int iLoadOrder,
! __inout LPWSTR *ppwzLoadOrder
! )
! {
! HRESULT hr = S_OK;
! LPCWSTR wzLoadOrder = *ppwzLoadOrder;
! int cchFilter = lstrlenW(wzFilter);
! LPWSTR pwzTemp = NULL;
!
! // If the filter name ends with '\0' or ',' and
! // the filter name begins at the beginning of the list or with ','
! // Then we've found the exact filter by name.
! //
! // If the filter isn't already in the load order, add it
! if (wzLoadOrder && *wzLoadOrder)
! {
! LPCWSTR pwz = wcsstr(wzLoadOrder, wzFilter);
!
! if (NULL != pwz &&
! (L'\0' == *(pwz + cchFilter) || L',' == *(pwz + cchFilter)) &&
! (pwz == wzLoadOrder || L',' == *(pwz - 1)))
! {
! // Filter already in the load order, no work to do.
! }
! else
! {
! pwz = NULL;
! if (0 wzExtension, countof(pswappext->wzExtension), pwzData);
! // application extension verbs
! hr = WcaGetRecordString(hRec, wappextqVerbs, &pwzData);
! ExitOnFailure1(hr, "Failed to get Verbs for Application: '%S'", wzApplication);
! StringCchCopyW(pswappext->wzVerbs, countof(pswappext->wzVerbs), pwzData);
! // extension executeable
! hr = WcaGetRecordFormattedString(hRec, wappextqExecutable, &pwzData);
! ExitOnFailure1(hr, "Failed to get Executable for Application: '%S'", wzApplication);
! StringCchCopyW(pswappext->wzExecutable, countof(pswappext->wzExecutable), pwzData);
! hr = WcaGetRecordInteger(hRec, wappextqAttributes, &pswappext->iAttributes);
! if (S_FALSE == hr)
! {
! pswappext->iAttributes = 0;
! hr = S_OK;
! }
! ExitOnFailure(hr, "Failed to get App isolation");
! *ppswappextList = AddAppExtToList(*ppswappextList, pswappext);
! pswappext = NULL; // set the appext NULL so it doesn't accidentally get freed below
! }
! if (E_NOMOREITEMS == hr)
! hr = S_OK;
LExit:
! // if anything was left over after an error clean it all up
! if (pswappext)
! ScaWebAppExtensionsFreeList(pswappext);
! ReleaseStr(pwzData);
! return hr;
}
! HRESULT ScaWebAppExtensionsWrite(IMSAdminBase* piMetabase, LPCWSTR wzRootOfWeb,
! SCA_WEB_APPLICATION_EXTENSION* pswappextList
! )
{
! HRESULT hr = S_OK;
! LPWSTR wzAppExt = NULL;
! DWORD cchAppExt;
! WCHAR wzAppExtension[1024];
! WCHAR wzAppExtensions[65536];
! SCA_WEB_APPLICATION_EXTENSION* pswappext = NULL;
! if (!pswappextList)
! ExitFunction();
! ::ZeroMemory(wzAppExtensions, sizeof(wzAppExtensions));
! wzAppExt = wzAppExtensions;
! cchAppExt = countof(wzAppExtensions);
! pswappext = pswappextList;
! while (pswappext)
! {
! if (0 == lstrcmpW(wzAppExtension, L"*"))
! StringCchPrintfW(wzAppExtension, countof(wzAppExtension), L"*,%s,%d", pswappext->wzExecutable, pswappext->iAttributes);
! else if (*pswappext->wzExtension)
! StringCchPrintfW(wzAppExtension, countof(wzAppExtension), L".%s,%s,%d", pswappext->wzExtension, pswappext->wzExecutable, pswappext->iAttributes);
! else // blank means "*" (all)
! StringCchPrintfW(wzAppExtension, countof(wzAppExtension), L"*,%s,%d", pswappext->wzExecutable, pswappext->iAttributes);
! // if verbs were specified and not the keyword "all"
! if (pswappext->wzVerbs[0] && CSTR_EQUAL != CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pswappext->wzVerbs, -1, L"all", -1))
! {
! StringCchCatW(wzAppExtension, countof(wzAppExtension), L",");
! StringCchCatW(wzAppExtension, countof(wzAppExtension), pswappext->wzVerbs);
! }
! StringCchCopyW(wzAppExt, cchAppExt, wzAppExtension);
! wzAppExt += lstrlenW(wzAppExtension) + 1;
! cchAppExt -= lstrlenW(wzAppExtension) + 1;
! pswappext = pswappext->pswappextNext;
! }
! if (*wzAppExtensions)
! {
! hr = ScaWriteMetabaseValue(piMetabase, wzRootOfWeb, NULL, MD_SCRIPT_MAPS, METADATA_INHERIT, IIS_MD_UT_FILE, MULTISZ_METADATA, wzAppExtensions);
! ExitOnFailure1(hr, "Failed to write AppExtension: '%S'", wzAppExtension);
! }
LExit:
! return hr;
}
void ScaWebAppExtensionsFreeList(
! SCA_WEB_APPLICATION_EXTENSION* pswappextList
! )
{
! SCA_WEB_APPLICATION_EXTENSION* pswappextDelete = pswappextList;
! while (pswappextList)
! {
! pswappextDelete = pswappextList;
! pswappextList = pswappextList->pswappextNext;
! MemFree(pswappextDelete);
! }
}
--- 20,192 ----
// sql queries
! LPCWSTR vcsWebAppExtensionQuery = L"SELECT `Extension`, `Verbs`, `Executable`, `Attributes` FROM `IIsWebApplicationExtension` WHERE `Application_`=?";
! enum eWebAppExtensionQuery { wappextqExtension = 1, wappextqVerbs, wappextqExecutable, wappextqAttributes };
// prototypes for private helper functions
static HRESULT NewAppExt(
! __out SCA_WEB_APPLICATION_EXTENSION** ppswappext
! );
! static SCA_WEB_APPLICATION_EXTENSION* AddAppExtToList(
! __in SCA_WEB_APPLICATION_EXTENSION* pswappextList,
! __in SCA_WEB_APPLICATION_EXTENSION* pswappext
! );
HRESULT ScaWebAppExtensionsRead(
! __in LPCWSTR wzApplication,
! __inout SCA_WEB_APPLICATION_EXTENSION** ppswappextList
! )
{
! HRESULT hr = S_OK;
! PMSIHANDLE hView, hRec;
! SCA_WEB_APPLICATION_EXTENSION* pswappext = NULL;
! LPWSTR pwzData = NULL;
! // check pre-requisites
! hr = WcaTableExists(L"IIsWebApplicationExtension");
! if (S_FALSE == hr)
! ExitFunction();
! // convert the string into a msi record
! hRec = ::MsiCreateRecord(1);
! hr = WcaSetRecordString(hRec, 1, wzApplication);
! ExitOnFailure(hr, "Failed to set record to look up Web Application");
! // open and execute the view on the applicatoin extension table
! hr = WcaOpenView(vcsWebAppExtensionQuery, &hView);
! ExitOnFailure(hr, "Failed to open view on IIsWebApplicationExtension table");
! hr = WcaExecuteView(hView, hRec);
! ExitOnFailure1(hr, "Failed to execute view on IIsWebApplicationExtension table looking Application: %S", wzApplication);
! // get the application extention information
! while (S_OK == (hr = WcaFetchRecord(hView, &hRec)))
! {
! hr = NewAppExt(&pswappext);
! ExitOnFailure(hr, "failed to create new web app extension");
! // get the extension
! hr = WcaGetRecordString(hRec, wappextqExtension, &pwzData);
! ExitOnFailure(hr, "Failed to get Web Application Extension");
! StringCchCopyW(pswappext->wzExtension, countof(pswappext->wzExtension), pwzData);
! // application extension verbs
! hr = WcaGetRecordString(hRec, wappextqVerbs, &pwzData);
! ExitOnFailure1(hr, "Failed to get Verbs for Application: '%S'", wzApplication);
! StringCchCopyW(pswappext->wzVerbs, countof(pswappext->wzVerbs), pwzData);
! // extension executeable
! hr = WcaGetRecordFormattedString(hRec, wappextqExecutable, &pwzData);
! ExitOnFailure1(hr, "Failed to get Executable for Application: '%S'", wzApplication);
! StringCchCopyW(pswappext->wzExecutable, countof(pswappext->wzExecutable), pwzData);
! hr = WcaGetRecordInteger(hRec, wappextqAttributes, &pswappext->iAttributes);
! if (S_FALSE == hr)
! {
! pswappext->iAttributes = 0;
! hr = S_OK;
! }
! ExitOnFailure(hr, "Failed to get App isolation");
! *ppswappextList = AddAppExtToList(*ppswappextList, pswappext);
! pswappext = NULL; // set the appext NULL so it doesn't accidentally get freed below
! }
! if (E_NOMOREITEMS == hr)
! {
! hr = S_OK;
! }
LExit:
! // if anything was left over after an error clean it all up
! if (pswappext)
! {
! ScaWebAppExtensionsFreeList(pswappext);
! }
! ReleaseStr(pwzData);
! return hr;
}
! HRESULT ScaWebAppExtensionsWrite(
! __in IMSAdminBase* piMetabase,
! __in LPCWSTR wzRootOfWeb,
! __in SCA_WEB_APPLICATION_EXTENSION* pswappextList
! )
{
! HRESULT hr = S_OK;
! LPWSTR wzAppExt = NULL;
! DWORD cchAppExt;
! WCHAR wzAppExtension[1024];
! WCHAR wzAppExtensions[65536];
! SCA_WEB_APPLICATION_EXTENSION* pswappext = NULL;
! if (!pswappextList)
! {
! ExitFunction();
! }
! ::ZeroMemory(wzAppExtensions, sizeof(wzAppExtensions));
! wzAppExt = wzAppExtensions;
! cchAppExt = countof(wzAppExtensions);
! pswappext = pswappextList;
! while (pswappext)
! {
! if (0 == lstrcmpW(wzAppExtension, L"*"))
! {
! StringCchPrintfW(wzAppExtension, countof(wzAppExtension), L"*,%s,%d", pswappext->wzExecutable, pswappext->iAttributes);
! }
! else if (*pswappext->wzExtension)
! {
! StringCchPrintfW(wzAppExtension, countof(wzAppExtension), L".%s,%s,%d", pswappext->wzExtension, pswappext->wzExecutable, pswappext->iAttributes);
! }
! else // blank means "*" (all)
! {
! StringCchPrintfW(wzAppExtension, countof(wzAppExtension), L"*,%s,%d", pswappext->wzExecutable, pswappext->iAttributes);
! }
! // if verbs were specified and not the keyword "all"
! if (pswappext->wzVerbs[0] && CSTR_EQUAL != CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pswappext->wzVerbs, -1, L"all", -1))
! {
! StringCchCatW(wzAppExtension, countof(wzAppExtension), L",");
! StringCchCatW(wzAppExtension, countof(wzAppExtension), pswappext->wzVerbs);
! }
! StringCchCopyW(wzAppExt, cchAppExt, wzAppExtension);
! wzAppExt += lstrlenW(wzAppExtension) + 1;
! cchAppExt -= lstrlenW(wzAppExtension) + 1;
! pswappext = pswappext->pswappextNext;
! }
! if (*wzAppExtensions)
! {
! hr = ScaWriteMetabaseValue(piMetabase, wzRootOfWeb, NULL, MD_SCRIPT_MAPS, METADATA_INHERIT, IIS_MD_UT_FILE, MULTISZ_METADATA, wzAppExtensions);
! ExitOnFailure1(hr, "Failed to write AppExtension: '%S'", wzAppExtension);
! }
LExit:
! return hr;
}
void ScaWebAppExtensionsFreeList(
! __in SCA_WEB_APPLICATION_EXTENSION* pswappextList
! )
{
! SCA_WEB_APPLICATION_EXTENSION* pswappextDelete = pswappextList;
! while (pswappextList)
! {
! pswappextDelete = pswappextList;
! pswappextList = pswappextList->pswappextNext;
! MemFree(pswappextDelete);
! }
}
***************
*** 184,218 ****
static HRESULT NewAppExt(
! SCA_WEB_APPLICATION_EXTENSION** ppswappext
! )
{
! HRESULT hr = S_OK;
! SCA_WEB_APPLICATION_EXTENSION* pswappext = (SCA_WEB_APPLICATION_EXTENSION*)MemAlloc(sizeof(SCA_WEB_APPLICATION_EXTENSION), TRUE);
! ExitOnNull(pswappext, hr, E_OUTOFMEMORY, "failed to allocate memory for new web app ext element");
!
! *ppswappext = pswappext;
LExit:
! return hr;
}
! SCA_WEB_APPLICATION_EXTENSION* AddAppExtToList(
! SCA_WEB_APPLICATION_EXTENSION* pswappextList,
! SCA_WEB_APPLICATION_EXTENSION* pswappext
! )
{
! if (pswappextList)
! {
! SCA_WEB_APPLICATION_EXTENSION* pswappextT = pswappextList;
! while (pswappextT->pswappextNext)
! pswappextT = pswappextT->pswappextNext;
! pswappextT->pswappextNext = pswappext;
! }
! else
! pswappextList = pswappext;
! return pswappextList;
}
-
--- 196,233 ----
static HRESULT NewAppExt(
! __out SCA_WEB_APPLICATION_EXTENSION** ppswappext
! )
{
! HRESULT hr = S_OK;
! SCA_WEB_APPLICATION_EXTENSION* pswappext = (SCA_WEB_APPLICATION_EXTENSION*)MemAlloc(sizeof(SCA_WEB_APPLICATION_EXTENSION), TRUE);
! ExitOnNull(pswappext, hr, E_OUTOFMEMORY, "failed to allocate memory for new web app ext element");
!
! *ppswappext = pswappext;
LExit:
! return hr;
}
! static SCA_WEB_APPLICATION_EXTENSION* AddAppExtToList(
! __in SCA_WEB_APPLICATION_EXTENSION* pswappextList,
! __in SCA_WEB_APPLICATION_EXTENSION* pswappext
! )
{
! if (pswappextList)
! {
! SCA_WEB_APPLICATION_EXTENSION* pswappextT = pswappextList;
! while (pswappextT->pswappextNext)
! {
! pswappextT = pswappextT->pswappextNext;
! }
! pswappextT->pswappextNext = pswappext;
! }
! else
! {
! pswappextList = pswappext;
! }
! return pswappextList;
}
Index: scaiis.cpp
===================================================================
RCS file: /cvsroot/wix/wix2.0/src/ca/serverca/scasched/scaiis.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** scaiis.cpp 24 May 2006 23:29:30 -0000 1.3
--- scaiis.cpp 27 Jun 2007 05:42:52 -0000 1.4
***************
*** 120,380 ****
- HRESULT ScaAddFilterToLoadOrder(IMSAdminBase* piMetabase, LPCWSTR wzFilterRoot,
- LPCWSTR wzFilter, int iLoadOrder)
- {
- Assert(piMetabase);
-
- HRESULT hr = S_OK;
-
- METADATA_HANDLE mhRoot = 0;
- int i;
- int cFilter = lstrlenW(wzFilter);
-
- METADATA_RECORD mr;
- DWORD dwRequired = 0;
- DWORD cchData = 255;
- ::ZeroMemory(&mr, sizeof(mr));
- mr.dwMDIdentifier = MD_FILTER_LOAD_ORDER;
- mr.dwMDAttributes = METADATA_NO_ATTRIBUTES;
- mr.dwMDUserType = IIS_MD_UT_SERVER;
- mr.dwMDDataType = ALL_METADATA;
- mr.dwMDDataLen = cchData;
- mr.pbMDData = (BYTE*)new WCHAR[mr.dwMDDataLen];
- ExitOnNull(mr.pbMDData, hr, E_OUTOFMEMORY, "failed to allocate memory for MDData in metadata record");
- ::ZeroMemory(mr.pbMDData, mr.dwMDDataLen * sizeof(WCHAR));
-
- WCHAR* pwzLoadOrder = NULL;
- DWORD cchLoadOrder = 0;
- LPWSTR pwz = NULL;
-
- hr = piMetabase->OpenKey(METADATA_MASTER_ROOT_HANDLE, wzFilterRoot, METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10, &mhRoot);
- for (i = 0; i < 30 && HRESULT_FROM_WIN32(ERROR_PATH_BUSY) == hr; i++)
- {
- ::Sleep(1000);
- WcaLog(LOGMSG_STANDARD, "Failed to open root key, retrying %d time(s)...", i);
- hr = piMetabase->OpenKey(METADATA_MASTER_ROOT_HANDLE, wzFilterRoot, METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10, &mhRoot);
- }
-
- if (SUCCEEDED(hr))
- {
- hr = piMetabase->GetData(mhRoot, L"", &mr, &dwRequired);
- if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr)
- {
- mr.dwMDDataLen = cchData = dwRequired;
- delete [] mr.pbMDData;
- mr.pbMDData = (BYTE*)new WCHAR[mr.dwMDDataLen];
- ExitOnNull(mr.pbMDData, hr, E_OUTOFMEMORY, "failed to allocate memory for MDData in metadata record");
- ::ZeroMemory(mr.pbMDData, mr.dwMDDataLen * sizeof(WCHAR));
-
- hr = piMetabase->GetData(mhRoot, L"", &mr, &dwRequired);
- }
- }
-
- //
- // Allow adding a Filter if /Filters node or /Filters/FilterLoadOrder property
- // doesn't exist (yet)
- //
- if (HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == hr || MD_ERROR_DATA_NOT_FOUND == hr)
- hr = S_OK;
- ExitOnFailure(hr, "Failed to get filter load order");
-
- //
- // If the filter name ends with '\0' or ',' and
- // the filter name begins at the beginning of the list or with ','
- // Then we've found the exact filter by name.
- //
- // If the filter isn't already in the load order, add it
- //
- if (mr.pbMDData)
- {
- pwz = const_cast(wcsstr(reinterpret_cast(mr.pbMDData), wzFilter));
-
- if (NULL != pwz &&
- (L'\0' == *(pwz + cFilter) || L',' == *(pwz + cFilter)) &&
- (pwz == reinterpret_cast(mr.pbMDData) || L',' == *(pwz-1)))
- {
- }
- else
- {
- pwz = NULL;
- if (0 CloseKey(mhRoot);
-
- return hr;
- }
-
-
- HRESULT ScaRemoveFilterFromLoadOrder(IMSAdminBase* piMetabase,
- LPCWSTR wzFilterRoot, LPCWSTR wzFilter)
- {
- Assert(piMetabase);
- HRESULT hr = S_OK;
-
- METADATA_HANDLE mhRoot = 0;
- int i;
- int cFilter = lstrlenW(wzFilter);
-
- LPCWSTR pwzStart = NULL;
- LPCWSTR pwzFind = NULL;
- LPCWSTR pwzNext = NULL;
- LPWSTR pwzLoadOrder = NULL;
- DWORD cchLoadOrder = 0;
-
- DWORD cchData = 0;
- METADATA_RECORD mr;
- ::ZeroMemory(&mr, sizeof(mr));
- mr.dwMDIdentifier = MD_FILTER_LOAD_ORDER;
- mr.dwMDAttributes = METADATA_NO_ATTRIBUTES;
- mr.dwMDUserType = IIS_MD_UT_SERVER;
- mr.dwMDDataType = ALL_METADATA;
- mr.dwMDDataLen = cchData = 0;
- mr.pbMDData = NULL;
-
- // open the filter metabase key
- hr = piMetabase->OpenKey(METADATA_MASTER_ROOT_HANDLE, wzFilterRoot, METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10, &mhRoot);
- for (i = 0; i < 30 && HRESULT_FROM_WIN32(ERROR_PATH_BUSY) == hr; i++)
- {
- ::Sleep(1000);
- WcaLog(LOGMSG_STANDARD, "Failed to open root key, retrying %d time(s)...", i);
- hr = piMetabase->OpenKey(METADATA_MASTER_ROOT_HANDLE, wzFilterRoot, METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10, &mhRoot);
- }
-
- if (HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == hr || MD_ERROR_DATA_NOT_FOUND == hr)
- {
- WcaLog(LOGMSG_STANDARD, "No Filter to remove at path: '%S'", wzFilterRoot);
- hr = S_OK;
- ExitFunction();
- }
- ExitOnFailure(hr, "Failed to open filter root key");
-
- hr = MetaGetValue(piMetabase, mhRoot, L"", &mr);
- ExitOnFailure1(hr, "Failed to get load order for '%S'", wzFilterRoot);
- ExitOnNull1(mr.pbMDData, hr, E_UNEXPECTED, "Failed to get load order for '%S'", wzFilterRoot);
-
- pwzStart = (LPWSTR)mr.pbMDData;
- do
- {
- if (!pwzFind)
- pwzFind = pwzStart;
- else
- pwzFind += cFilter;
-
- pwzFind = wcsstr(pwzFind, wzFilter);
- if (!pwzFind)
- break;
-
- //
- // Make sure to only match [wzFilter] and NOT foobar[wzFilter]
- //
- if ( pwzFind > pwzStart && L',' != *(pwzFind-1) )
- continue;
-
- if (L',' == *(pwzFind + cFilter))
- pwzNext = pwzFind + cFilter + 1;
- else if(L'\0' == *(pwzFind + cFilter))
- pwzNext = pwzFind + cFilter;
- }while (!pwzNext);
-
- if (!pwzFind)
- {
- hr = S_FALSE;
- WcaLog(LOGMSG_STANDARD, "Filter '%S' was not load order: '%S'", wzFilter, wzFilterRoot);
- ExitFunction();
- }
-
- cchLoadOrder = mr.dwMDDataLen + 1;
- pwzLoadOrder = new WCHAR[cchLoadOrder];
- ::ZeroMemory(pwzLoadOrder, (mr.dwMDDataLen + 1) * sizeof(WCHAR));
-
- //
- // The substring of FilterLoadOrder PRIOR to "Filter", not including trailing ","
- // If "Filter" was first, string remains "" because of ZeroMemory(pwzLoadOrder) above
- //
- if (pwzFind != pwzStart)
- {
- StringCchCopyNW(pwzLoadOrder, cchLoadOrder, pwzStart, pwzFind - pwzStart - 1);
- }
-
- //
- // If the "Filter" being removed is not first or last, add a ","
- //
- if (pwzFind != pwzStart && NULL != *pwzNext )
- {
- StringCchCatW(pwzLoadOrder, cchLoadOrder, L",");
- }
-
- //
- // The substring of FilterLoadOrder AFTER "Filter", not including any leading ","
- // pwzNext is "" if "Filter" is last
- //
- StringCchCatW(pwzLoadOrder, cchLoadOrder, pwzNext);
-
- //
- // TODO: Finally, remove ANY other instance of wzFilter in pwzLoadOrder
- //
-
- hr = ScaWriteMetabaseValue(piMetabase, wzFilterRoot, L"", MD_FILTER_LOAD_ORDER, METADATA_NO_ATTRIBUTES, IIS_MD_UT_SERVER, STRING_METADATA, (LPVOID)pwzLoadOrder);
- ExitOnFailure1(hr, "Failed to remove Filter '%S'from load order", wzFilter);
-
- LExit:
- if (pwzLoadOrder)
- delete [] pwzLoadOrder;
-
- MetaFreeValue(&mr);
-
- if (mhRoot)
- piMetabase->CloseKey(mhRoot);
-
- return hr;
- }
-
-
HRESULT ScaCreateMetabaseKey(IMSAdminBase* piMetabase, LPCWSTR wzRootKey,
LPCWSTR wzSubKey)
--- 120,123 ----
------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
------------------------------
_______________________________________________
Wix-commits mailing list
Wix-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-commits
End of Wix-commits Digest, Vol 11, Issue 58
*******************************************
P.S. И не забудьте послать роботу вашу рекламу :)
Обработано объявлений: 11776
Стас Давыдов & Outcorp © 2007