示例#1
0
void CTagArrayEditor::WriteListToTagArray(ULONG ulListNum)
{
	if (!IsValidList(ulListNum)) return;

	// If we're not dirty, don't write
	if (!IsDirty(ulListNum)) return;

	HRESULT hRes = S_OK;
	ULONG ulListCount = GetListCount(ulListNum);
	EC_H(MAPIAllocateBuffer(
		CbNewSPropTagArray(ulListCount),
		(LPVOID*)&m_lpOutputTagArray));
	if (m_lpOutputTagArray)
	{
		m_lpOutputTagArray->cValues = ulListCount;

		ULONG iTagCount = 0;
		for (iTagCount = 0; iTagCount < m_lpOutputTagArray->cValues; iTagCount++)
		{
			SortListData* lpData = GetListRowData(ulListNum, iTagCount);
			if (lpData)
				m_lpOutputTagArray->aulPropTag[iTagCount] = lpData->data.Tag.ulPropTag;
		}

	}
} // CTagArrayEditor::WriteListToTagArray
EXPORT_C TBool CSsmCommandListUtils::IsValidSwpList(const CSsmCommandList& aCommandList)
{
    //Validation 1: A command list used to change the value of a swp must
    // contain exactly one publish swp command
    // and must not contain any publish system state commands

    //Validation 2:In a command list,  if there are one or more commands with their
    //execution behaviour as ESsmDeferredWaitForSignal that should be followed by a
    //SSM_MULTIPLE_WAIT command

    return IsValidList(aCommandList, ESsmCmdPublishSwp)  && ValidateDeferredWaitCommand(aCommandList);
}
示例#3
0
_Check_return_ bool CTagArrayEditor::DoListEdit(ULONG ulListNum, int iItem, _In_ SortListData* lpData)
{
	if (!IsValidList(ulListNum)) return false;
	if (!lpData) return false;

	HRESULT	hRes = S_OK;
	ULONG	ulOrigPropTag = lpData->data.Tag.ulPropTag;
	ULONG	ulNewPropTag = ulOrigPropTag;

	CPropertyTagEditor MyPropertyTag(
		NULL, // title
		NULL, // prompt
		ulOrigPropTag,
		m_bIsAB,
		m_lpMAPIProp,
		this);

	WC_H(MyPropertyTag.DisplayDialog());
	if (S_OK != hRes) return false;
	ulNewPropTag = MyPropertyTag.GetPropertyTag();

	if (ulNewPropTag != ulOrigPropTag)
	{
		CString szTmp;
		lpData->data.Tag.ulPropTag = ulNewPropTag;

		szTmp.Format(_T("0x%08X"), ulNewPropTag); // STRING_OK
		SetListString(ulListNum, iItem, 1, szTmp);

		CString PropTag;
		CString PropType;
		LPTSTR szExactMatch = NULL;
		LPTSTR szPartialMatch = NULL;
		LPTSTR szNamedPropName = NULL;
		LPTSTR szNamedPropGUID = NULL;

		InterpretProp(
			NULL,
			ulNewPropTag,
			m_lpMAPIProp,
			NULL,
			NULL,
			m_bIsAB,
			&szExactMatch, // Built from ulPropTag & bIsAB
			&szPartialMatch, // Built from ulPropTag & bIsAB
			&PropType,
			&PropTag,
			NULL,
			NULL,
			&szNamedPropName, // Built from lpProp & lpMAPIProp
			&szNamedPropGUID, // Built from lpProp & lpMAPIProp
			NULL);
		SetListString(ulListNum, iItem, 2, szExactMatch);
		SetListString(ulListNum, iItem, 3, szPartialMatch);
		SetListString(ulListNum, iItem, 4, PropType);
		SetListString(ulListNum, iItem, 5, szNamedPropName);
		SetListString(ulListNum, iItem, 6, szNamedPropGUID);

		delete[] szPartialMatch;
		delete[] szExactMatch;
		FreeNameIDStrings(szNamedPropName, szNamedPropGUID, NULL);

		ResizeList(ulListNum, false);
		return true;
	}
	return false;
} // CTagArrayEditor::DoListEdit
示例#4
0
void CTagArrayEditor::ReadTagArrayToList(ULONG ulListNum)
{
	if (!IsValidList(ulListNum)) return;

	ClearList(ulListNum);

	InsertColumn(ulListNum, 0, IDS_SHARP);
	InsertColumn(ulListNum, 1, IDS_TAG);
	InsertColumn(ulListNum, 2, IDS_PROPERTYNAMES);
	InsertColumn(ulListNum, 3, IDS_OTHERNAMES);
	InsertColumn(ulListNum, 4, IDS_TYPE);
	InsertColumn(ulListNum, 5, IDS_NAMEDPROPNAME);
	InsertColumn(ulListNum, 6, IDS_NAMEDPROPGUID);

	if (m_lpTagArray)
	{
		CString szTmp;
		ULONG iTagCount = 0;
		ULONG cValues = m_lpTagArray->cValues;

		for (iTagCount = 0; iTagCount < cValues; iTagCount++)
		{
			ULONG ulPropTag = m_lpTagArray->aulPropTag[iTagCount];
			SortListData* lpData = NULL;
			szTmp.Format(_T("%u"), iTagCount); // STRING_OK
			lpData = InsertListRow(ulListNum, iTagCount, szTmp);
			if (lpData)
			{
				lpData->ulSortDataType = SORTLIST_TAGARRAY;
				lpData->data.Tag.ulPropTag = ulPropTag;
				lpData->bItemFullyLoaded = true;
			}

			CString PropTag;
			CString PropType;
			LPTSTR szExactMatch = NULL;
			LPTSTR szPartialMatch = NULL;
			LPTSTR szNamedPropName = NULL;
			LPTSTR szNamedPropGUID = NULL;

			InterpretProp(
				NULL,
				ulPropTag,
				m_lpMAPIProp,
				NULL,
				NULL,
				m_bIsAB,
				&szExactMatch, // Built from ulPropTag & bIsAB
				&szPartialMatch, // Built from ulPropTag & bIsAB
				&PropType,
				&PropTag,
				NULL,
				NULL,
				&szNamedPropName, // Built from lpProp & lpMAPIProp
				&szNamedPropGUID, // Built from lpProp & lpMAPIProp
				NULL);
			SetListString(ulListNum, iTagCount, 1, PropTag);
			SetListString(ulListNum, iTagCount, 2, szExactMatch);
			SetListString(ulListNum, iTagCount, 3, szPartialMatch);
			SetListString(ulListNum, iTagCount, 4, PropType);
			SetListString(ulListNum, iTagCount, 5, szNamedPropName);
			SetListString(ulListNum, iTagCount, 6, szNamedPropGUID);
			delete[] szPartialMatch;
			delete[] szExactMatch;
			FreeNameIDStrings(szNamedPropName, szNamedPropGUID, NULL);
		}
	}
	ResizeList(ulListNum, false);
} // CTagArrayEditor::ReadTagArrayToList