Skip to content

Commit

Permalink
Plumb pidlid through to best name logic
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenegriffin committed Nov 1, 2016
1 parent 29ca7c7 commit 57311f2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
15 changes: 5 additions & 10 deletions InterpretProp.cpp
Expand Up @@ -762,9 +762,7 @@ NamePropNames NameIDToStrings(_In_ LPMAPINAMEID lpNameID, ULONG ulPropTag)
lpNamedPropCacheEntry = FindCacheEntry(PROP_ID(ulPropTag), lpNameID->lpguid, lpNameID->ulKind, lpNameID->Kind.lID, lpNameID->Kind.lpwstrName);
if (lpNamedPropCacheEntry && lpNamedPropCacheEntry->bStringsCached)
{
namePropNames.name = lpNamedPropCacheEntry->lpszPropName;
namePropNames.guid = lpNamedPropCacheEntry->lpszPropGUID;
namePropNames.dasl = lpNamedPropCacheEntry->lpszDASL;
namePropNames = lpNamedPropCacheEntry->namePropNames;
return namePropNames;
}

Expand All @@ -786,16 +784,15 @@ NamePropNames NameIDToStrings(_In_ LPMAPINAMEID lpNameID, ULONG ulPropTag)
if (lpNameID->ulKind == MNID_ID)
{
DebugPrint(DBGNamedProp, L"lpNameID->Kind.lID = 0x%04X = %d\n", lpNameID->Kind.lID, lpNameID->Kind.lID);
auto szName = NameIDToPropName(lpNameID);
namePropNames.pidlid = NameIDToPropName(lpNameID);

if (!szName.empty())
if (!namePropNames.pidlid.empty())
{
// Printing hex first gets a nice sort without spacing tricks
namePropNames.name = format(L"id: 0x%04X=%d = %ws", // STRING_OK
lpNameID->Kind.lID,
lpNameID->Kind.lID,
szName.c_str());

namePropNames.pidlid.c_str());
}
else
{
Expand Down Expand Up @@ -848,9 +845,7 @@ NamePropNames NameIDToStrings(_In_ LPMAPINAMEID lpNameID, ULONG ulPropTag)
// We've built our strings - if we're caching, put them in the cache
if (lpNamedPropCacheEntry)
{
lpNamedPropCacheEntry->lpszPropName = namePropNames.name;
lpNamedPropCacheEntry->lpszPropGUID = namePropNames.guid;
lpNamedPropCacheEntry->lpszDASL = namePropNames.dasl;
lpNamedPropCacheEntry->namePropNames = namePropNames;
lpNamedPropCacheEntry->bStringsCached = true;
}

Expand Down
1 change: 1 addition & 0 deletions InterpretProp.h
Expand Up @@ -17,6 +17,7 @@ struct NamePropNames
wstring name; // Built from ulPropTag & lpMAPIProp
wstring guid; // Built from ulPropTag & lpMAPIProp
wstring dasl; // Built from ulPropTag & lpMAPIProp
wstring pidlid;
};

NamePropNames NameIDToStrings(
Expand Down
4 changes: 1 addition & 3 deletions NamedPropCache.h
Expand Up @@ -21,9 +21,7 @@ class NamedPropCacheEntry
ULONG cbSig; // Size and...
LPBYTE lpSig; // Value of PR_MAPPING_SIGNATURE
bool bStringsCached; // We have cached strings
wstring lpszPropName; // Cached strings
wstring lpszPropGUID;
wstring lpszDASL;
NamePropNames namePropNames;
};
typedef NamedPropCacheEntry *LPNAMEDPROPCACHEENTRY;

Expand Down
4 changes: 4 additions & 0 deletions SingleMAPIPropListCtrl.cpp
Expand Up @@ -661,6 +661,10 @@ void CSingleMAPIPropListCtrl::AddPropToListBox(
{
SetItemText(iRow, pcPROPBESTGUESS, propTagNames.bestGuess);
}
else if (!namePropNames.pidlid.empty())
{
SetItemText(iRow, pcPROPBESTGUESS, namePropNames.pidlid);
}
else if (!namePropNames.name.empty())
{
SetItemText(iRow, pcPROPBESTGUESS, namePropNames.name);
Expand Down

0 comments on commit 57311f2

Please sign in to comment.