PST File Format SDK
v0.4
Loading...
Searching...
No Matches
entryid.h
Go to the documentation of this file.
1
#ifndef PSTSDK_PST_ENTRYID_H
2
#define PSTSDK_PST_ENTRYID_H
3
4
#include "
pstsdk/util/primitives.h
"
5
#include "
pstsdk/util/util.h
"
6
#include <cstdint>
7
#include <vector>
8
9
namespace
pstsdk
{
10
11
enum class
distribution_list_entry_id_type
{
12
one_off
= 0,
13
contact
= 3,
14
personal_distribution_list
= 4,
15
mail_user_gal
= 5,
16
distribution_list_gal
= 6
17
};
18
19
#pragma pack(push, 1)
20
struct
entry_id_header
{
21
const
uint32_t
flags
;
22
const
guid
provider_uid
;
23
};
24
25
struct
entry_id_bytebag
:
entry_id_header
{
26
byte
data
[];
27
};
28
29
struct
distribution_list_wrapped_entry_id
:
entry_id_header
{
30
uint8_t
type
;
31
byte
data
[];
32
33
inline
distribution_list_entry_id_type
get_type
() {
34
return
static_cast<
distribution_list_entry_id_type
>
(
type
& 0x0F);
35
}
36
};
37
42
struct
recipient_oneoff_entry_id
:
entry_id_header
{
43
const
uint16_t
version
;
44
const
uint16_t
meta
;
45
const
byte
data
[];
46
47
// inline bool is_mime() const {
48
// return (meta & 0x0100);
49
// }
50
51
// TODO: 2.2.5.1 says 0x0080 (??), but
52
// https://grep.app/search?q=MAPI_ONE_OFF_UNICODE
53
inline
bool
is_unicode
()
const
{
54
return
(
meta
& 0x8000);
55
}
56
57
inline
std::vector<std::string>
read_strings
()
const
{
58
std::vector<std::string>
strings
;
59
const
char
*begin =
reinterpret_cast<
const
char
*
>
(&
data
[0]);
60
61
while
(
strings
.size() < 3) {
62
size_t
length = 0;
63
if
(
is_unicode
()) {
64
for
(
int
i
= 0;
i
< 256;
i
+= 2) {
65
const
uint16_t *
wc
=
reinterpret_cast<
const
uint16_t *
>
(begin +
i
);
66
if
(*
wc
== 0) {
67
length =
i
;
68
break
;
69
}
70
}
71
72
}
else
{
73
length =
strnlen
(begin, 256);
74
}
75
76
if
(length == 0)
77
break
;
78
79
std::vector<pstsdk::byte>
bytes
(begin, begin + length);
80
strings
.emplace_back(
bytes_to_string
(
bytes
));
81
begin = begin + length + (
is_unicode
() ? 2 : 1);
82
}
83
84
return
strings
;
85
}
86
};
87
#pragma pack(pop)
88
89
}
// namespace pstsdk
90
91
#endif
pstsdk::bth_nonleaf_node
Contains references to other bth_node allocations.
Definition
heap.h:364
pstsdk::bytes_to_string
std::string bytes_to_string(const std::vector< byte > &bytes)
Convert an array of bytes to a std::wstring.
Definition
util.h:310
pstsdk
Contains the definition of all in memory representations of disk structures.
Definition
disk.h:19
pstsdk::distribution_list_entry_id_type
distribution_list_entry_id_type
Definition
entryid.h:11
pstsdk::distribution_list_entry_id_type::mail_user_gal
@ mail_user_gal
pstsdk::distribution_list_entry_id_type::distribution_list_gal
@ distribution_list_gal
pstsdk::distribution_list_entry_id_type::contact
@ contact
pstsdk::distribution_list_entry_id_type::one_off
@ one_off
pstsdk::distribution_list_entry_id_type::personal_distribution_list
@ personal_distribution_list
primitives.h
Primitive structures defined by MS-PST and MAPI.
pstsdk::distribution_list_wrapped_entry_id
Definition
entryid.h:29
pstsdk::distribution_list_wrapped_entry_id::type
uint8_t type
Definition
entryid.h:30
pstsdk::distribution_list_wrapped_entry_id::data
byte data[]
Definition
entryid.h:31
pstsdk::distribution_list_wrapped_entry_id::get_type
distribution_list_entry_id_type get_type()
Definition
entryid.h:33
pstsdk::entry_id_bytebag
Definition
entryid.h:25
pstsdk::entry_id_bytebag::data
byte data[]
Definition
entryid.h:26
pstsdk::entry_id_header
Definition
entryid.h:20
pstsdk::entry_id_header::provider_uid
const guid provider_uid
Definition
entryid.h:22
pstsdk::entry_id_header::flags
const uint32_t flags
Definition
entryid.h:21
pstsdk::guid
A Win32 GUID structure.
Definition
primitives.h:353
pstsdk::recipient_oneoff_entry_id
One-off recipient EntryID [MS-OXCDATA] 2.2.5.1.
Definition
entryid.h:42
pstsdk::recipient_oneoff_entry_id::is_unicode
bool is_unicode() const
Definition
entryid.h:53
pstsdk::recipient_oneoff_entry_id::version
const uint16_t version
Definition
entryid.h:43
pstsdk::recipient_oneoff_entry_id::data
const byte data[]
Definition
entryid.h:45
pstsdk::recipient_oneoff_entry_id::meta
const uint16_t meta
Definition
entryid.h:44
pstsdk::recipient_oneoff_entry_id::read_strings
std::vector< std::string > read_strings() const
Definition
entryid.h:57
util.h
General utility functions and classes.
pstsdk
pst
entryid.h
Generated on Fri Feb 27 2026 00:33:18 for PST File Format SDK by
1.9.8