Ejemplo n.º 1
0
bool CFindFidMid::DoContentsTablePerRowWork(_In_ LPSRow lpSRow, ULONG /*ulCurRow*/)
{
	if (!lpSRow) return false;

	LPSPropValue lpPropMid = NULL;
	LPSPropValue lpPropSubject = NULL;
	LPSPropValue lpPropClass = NULL;
	LPWSTR lpszThisMid = NULL;
	LPTSTR lpszSubject = _T("");
	LPTSTR lpszClass = _T("");

	lpPropMid = PpropFindProp(lpSRow->lpProps,lpSRow->cValues,PidTagMid);
	if (lpPropMid)
	{
		lpszThisMid = FidMidToSzString(lpPropMid->Value.li.QuadPart,false);
		DebugPrint(DBGGeneric,"CFindFidMid::DoContentsTablePerRowWork: Found MID %ws\n", lpszThisMid);
	}
	else
	{
		// Nothing left to do if we can't find a mid
		DebugPrint(DBGGeneric,"CFindFidMid::DoContentsTablePerRowWork: No MID found\n");
		return false;
	}

	// Check for a MID match
	if (wcscmp(m_szMid, L"") == 0 || _wcsicmp(m_szMid, lpszThisMid) == 0
		|| (wcschr(lpszThisMid, L'-') != 0 && _wcsicmp(m_szMid, wcschr(lpszThisMid, L'-') + 1) == 0))
	{
		// If we haven't already, print the folder info
		if (!m_fFIDPrinted)
		{
			PrintFolder(m_szCurrentFid, m_szFolderOffset);
			m_fFIDPrinted = true;
		}

		lpPropSubject = PpropFindProp(lpSRow->lpProps,lpSRow->cValues,PR_SUBJECT);
		if (lpPropSubject)
		{
			lpszSubject = lpPropSubject->Value.LPSZ;
		}

		lpPropClass = PpropFindProp(lpSRow->lpProps, lpSRow->cValues, PR_MESSAGE_CLASS);
		if (lpPropClass)
		{
			lpszClass = lpPropClass->Value.LPSZ;
		}

		PrintMessage(lpszThisMid, m_fAssociated, lpszSubject, lpszClass);
		DebugPrint(DBGGeneric, "EnumMessages::ProcessRow: Matched MID %ws, \"%s\", \"%s\"\n", lpszThisMid, lpszSubject, lpszClass);
	}
	// Don't open the message - the row is enough
	return false;
} // CFindFidMid::DoContentsTablePerRowWork
Ejemplo n.º 2
0
void PrintAll(void)
    {
    PrintFolder( &DbaseRoot ) ;
    }
Ejemplo n.º 3
0
void CFindFidMid::BeginFolderWork()
{
	DebugPrint(DBGGeneric,"CFindFidMid::BeginFolderWork: m_szFolderOffset %s\n", m_szFolderOffset);
	m_fFIDMatch = false;
	m_fFIDExactMatch = false;
	m_fFIDPrinted = false;
	delete[] m_szCurrentFid;
	m_szCurrentFid = NULL;
	if (!m_lpFolder) return;

	HRESULT hRes = S_OK;
	ULONG ulProps = NULL;
	LPSPropValue lpProps = NULL;

	enum
	{
		ePR_DISPLAY_NAME_W,
		ePidTagFolderId,
		NUM_COLS
	};
	static const SizedSPropTagArray(NUM_COLS,sptaFolderProps) =
	{
		NUM_COLS,
		PR_DISPLAY_NAME_W,
		PidTagFolderId
	};

	WC_H_GETPROPS(m_lpFolder->GetProps(
		(LPSPropTagArray) &sptaFolderProps,
		NULL,
		&ulProps,
		&lpProps));
	DebugPrint(DBGGeneric,"CFindFidMid::DoFolderPerHierarchyTableRowWork: m_szFolderOffset %s\n",m_szFolderOffset);

	// Now get the FID
	LPWSTR lpszDisplayName = NULL;

	if (lpProps && PR_DISPLAY_NAME_W == lpProps[ePR_DISPLAY_NAME_W].ulPropTag)
	{
		lpszDisplayName = lpProps[ePR_DISPLAY_NAME_W].Value.lpszW;
	}

	if (lpProps && PidTagFolderId == lpProps[ePidTagFolderId].ulPropTag)
	{
		m_szCurrentFid = FidMidToSzString(lpProps[ePidTagFolderId].Value.li.QuadPart,false);
		DebugPrint(DBGGeneric, "CFindFidMid::DoFolderPerHierarchyTableRowWork: Found FID %ws for %ws\n", m_szCurrentFid, lpszDisplayName);
	}
	else
	{
		// Nothing left to do if we can't find a fid.
		DebugPrint(DBGGeneric,"CFindFidMid::DoFolderPerHierarchyTableRowWork: No FID found for %ws\n", lpszDisplayName);
		return;
	}

	// If FidMidToSzString failed, we're done.
	if (!m_szCurrentFid) return;

	// Check for FID matches - no fid matches all folders
	if (NULL == m_szFid)
	{
		m_fFIDMatch = true;
		m_fFIDExactMatch = false;
	}
	// Passed in Fid matches the found Fid exactly, or matches the tail exactly
	// For instance, both 3-15632 and 15632 will match against an input fid of 15632
	else if (_wcsicmp(m_szFid, m_szCurrentFid) == 0
		|| (wcschr(m_szCurrentFid, '-') != 0 && _wcsicmp(m_szFid, wcschr(m_szCurrentFid, '-') + 1) == 0))
	{
		m_fFIDMatch = true;
		m_fFIDExactMatch = true;
	}

	if (m_fFIDMatch)
	{
		DebugPrint(DBGGeneric,"CFindFidMid::DoFolderPerHierarchyTableRowWork: Matched FID %ws\n", m_szFid);
		// Print out the folder
		if (m_szMid == NULL || m_fFIDExactMatch)
		{
			PrintFolder(m_szCurrentFid, m_szFolderOffset);
			m_fFIDPrinted = true;
		}
	}
} // CFindFidMid::BeginFolderWork