Skip to content

Commit f23d84a

Browse files
committed
mapi_lib: document handling of TNEF unzoned localtime timestamps
1 parent 3b3887a commit f23d84a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/mapi/tnef.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,14 @@ pack_result tnef_pull::g_attr(TNEF_ATTRIBUTE *r)
737737
r->pvalue = pext->anew<uint64_t>();
738738
if (r->pvalue == nullptr)
739739
return EXT_ERR_ALLOC;
740+
/*
741+
* MS-OXTNEF v §2.1.3.3.4: "The encoding process is
742+
* implementation-dependent". In practice, localtime is used by
743+
* the TNEF writer. But it is not recorded what timezone that
744+
* was done with. Luckily, ATTRIBUTE_ID_DATEMODIFY appears
745+
* again later as a PR_LAST_MODIFICATION_TIME propval with
746+
* PT_SYSTIME, which is known to be always UTC.
747+
*/
740748
TRY(pext->g_uint16(&tmp_dtr.year));
741749
TRY(pext->g_uint16(&tmp_dtr.month));
742750
TRY(pext->g_uint16(&tmp_dtr.day));

0 commit comments

Comments
 (0)