|
2 | 2 | title: "IDiaPropertyStorage | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -dev_langs: |
| 5 | +dev_langs: |
6 | 6 | - "C++"
|
7 |
| -helpviewer_keywords: |
| 7 | +helpviewer_keywords: |
8 | 8 | - "IDiaPropertyStorage interface"
|
9 | 9 | ms.assetid: d3197a38-5973-4e56-873e-4f1b84c3f674
|
10 | 10 | author: "mikejo5000"
|
11 | 11 | ms.author: "mikejo"
|
12 | 12 | manager: jillfra
|
13 |
| -ms.workload: |
| 13 | +ms.workload: |
14 | 14 | - "multiple"
|
15 | 15 | ---
|
16 | 16 | # IDiaPropertyStorage
|
17 |
| -Allows you to read the persistent properties of a DIA property set. |
18 |
| - |
19 |
| -## Syntax |
20 |
| - |
21 |
| -``` |
22 |
| -IDiaPropertyStorage : IUnknown |
23 |
| -``` |
24 |
| - |
25 |
| -## Methods in Vtable Order |
26 |
| - The following table shows the methods of `IDiaPropertyStorage`. |
27 |
| - |
28 |
| -|Method|Description| |
29 |
| -|------------|-----------------| |
30 |
| -|[IDiaPropertyStorage::Enum](../../debugger/debug-interface-access/idiapropertystorage-enum.md)|Gets a pointer to an enumerator for properties within this set.| |
31 |
| -|[IDiaPropertyStorage::ReadBOOL](../../debugger/debug-interface-access/idiapropertystorage-readbool.md)|Reads `BOOL` values in a property set.| |
32 |
| -|[IDiaPropertyStorage::ReadBSTR](../../debugger/debug-interface-access/idiapropertystorage-readbstr.md)|Reads `BSTR` values in a property set.| |
33 |
| -|[IDiaPropertyStorage::ReadDWORD](../../debugger/debug-interface-access/idiapropertystorage-readdword.md)|Reads `DWORD` values in a property set.| |
34 |
| -|[IDiaPropertyStorage::ReadLONG](../../debugger/debug-interface-access/idiapropertystorage-readlong.md)|Reads `LONG` values in a property set.| |
35 |
| -|[IDiaPropertyStorage::ReadMultiple](../../debugger/debug-interface-access/idiapropertystorage-readmultiple.md)|Reads property values in a property set.| |
36 |
| -|[IDiaPropertyStorage::ReadPropertyNames](../../debugger/debug-interface-access/idiapropertystorage-readpropertynames.md)|Gets corresponding string names for given property identifiers.| |
37 |
| -|[IDiaPropertyStorage::ReadULONGLONG](../../debugger/debug-interface-access/idiapropertystorage-readulonglong.md)|Reads `ULONGLONG` values in a property set.| |
38 |
| - |
39 |
| -## Remarks |
40 |
| - Each property within a property set is identified by a property identifier (ID), a four-byte `ULONG` value unique to that set. The properties exposed through the `IDiaPropertyStorage` interface correspond to the properties available in the parent interface. For example, the properties of the [IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md) interface can be accessed by name through the `IDiaPropertyStorage` interface (note, however, that even though the property may be accessible, it does not mean the property is valid for a particular `IDiaSymbol` object). |
41 |
| - |
42 |
| -## Notes for Callers |
43 |
| - Obtain this interface by calling the `QueryInterface` method on another interface. The following interfaces can be queried for the `IDiaPropertyStorage` interface: |
44 |
| - |
45 |
| -- [IDiaSectionContrib](../../debugger/debug-interface-access/idiasectioncontrib.md) |
46 |
| - |
47 |
| -- [IDiaSegment](../../debugger/debug-interface-access/idiasegment.md) |
48 |
| - |
49 |
| -- [IDiaInjectedSource](../../debugger/debug-interface-access/idiainjectedsource.md) |
50 |
| - |
51 |
| -- [IDiaFrameData](../../debugger/debug-interface-access/idiaframedata.md) |
52 |
| - |
53 |
| -- [IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md) |
54 |
| - |
55 |
| -- [IDiaSourceFile](../../debugger/debug-interface-access/idiasourcefile.md) |
56 |
| - |
57 |
| -- [IDiaLineNumber](../../debugger/debug-interface-access/idialinenumber.md) |
58 |
| - |
59 |
| -## Example |
60 |
| - This example shows a function that displays all properties exposed by the `IDiaPropertyStorage` object. See the [IDiaEnumInjectedSources](../../debugger/debug-interface-access/idiaenuminjectedsources.md) interface for an example of how the `IDiaPropertyStorage` interface is obtained from the [IDiaInjectedSource](../../debugger/debug-interface-access/idiainjectedsource.md) interface. |
61 |
| - |
62 |
| -```C++ |
63 |
| -void PrintPropertyStorage(IDiaPropertyStorage* pPropertyStorage) |
64 |
| -{ |
65 |
| - IEnumSTATPROPSTG* pEnumProps; |
66 |
| - STATPROPSTG prop; |
67 |
| - DWORD celt = 1; |
68 |
| - |
69 |
| - if (pPropertyStorage->Enum(&pEnumProps) == S_OK) |
70 |
| - { |
71 |
| - while (pEnumProps->Next(celt, &prop, &celt) == S_OK) |
72 |
| - { |
73 |
| - PROPSPEC pspec = { PRSPEC_PROPID, prop.propid }; |
74 |
| - PROPVARIANT vt = { VT_EMPTY }; |
75 |
| - |
76 |
| - if (pPropertyStorage->ReadMultiple( 1, &pspec, &vt) == S_OK) |
77 |
| - { |
78 |
| - switch( vt.vt ){ |
79 |
| - case VT_BOOL: |
80 |
| - wprintf( L"%32s:\t %s\n", prop.lpwstrName, vt.bVal ? L"true" : L"false" ); |
81 |
| - break; |
82 |
| - case VT_I2: |
83 |
| - wprintf( L"%32s:\t %d\n", prop.lpwstrName, vt.iVal ); |
84 |
| - break; |
85 |
| - case VT_UI2: |
86 |
| - wprintf( L"%32s:\t %d\n", prop.lpwstrName, vt.uiVal ); |
87 |
| - break; |
88 |
| - case VT_I4: |
89 |
| - wprintf( L"%32s:\t %d\n", prop.lpwstrName, vt.intVal ); |
90 |
| - break; |
91 |
| - case VT_UI4: |
92 |
| - wprintf( L"%32s:\t 0x%0x\n", prop.lpwstrName, vt.uintVal ); |
93 |
| - break; |
94 |
| - case VT_UI8: |
95 |
| - wprintf( L"%32s:\t 0x%x\n", prop.lpwstrName, vt.uhVal.QuadPart ); |
96 |
| - break; |
97 |
| - case VT_BSTR: |
98 |
| - wprintf( L"%32s:\t %s\n", prop.lpwstrName, vt.bstrVal ); |
99 |
| - break; |
100 |
| - case VT_UNKNOWN: |
101 |
| - wprintf( L"%32s:\t %p\n", prop.lpwstrName, vt.punkVal ); |
102 |
| - break; |
103 |
| - case VT_SAFEARRAY: |
104 |
| - break; |
105 |
| - default: |
106 |
| - break; |
107 |
| - } |
108 |
| - VariantClear((VARIANTARG*) &vt); |
109 |
| - } |
110 |
| - } |
111 |
| - pEnumProps->Release(); |
112 |
| - } |
113 |
| -} |
114 |
| -``` |
115 |
| - |
116 |
| -## Requirements |
117 |
| - Header: Dia2.h |
118 |
| - |
119 |
| - Library: diaguids.lib |
120 |
| - |
121 |
| - DLL: msdia80.dll |
122 |
| - |
123 |
| -## See Also |
124 |
| - [Interfaces (Debug Interface Access SDK)](../../debugger/debug-interface-access/interfaces-debug-interface-access-sdk.md) |
125 |
| - [IDiaSession::getEnumTables](../../debugger/debug-interface-access/idiasession-getenumtables.md) |
126 |
| - [IDiaSectionContrib](../../debugger/debug-interface-access/idiasectioncontrib.md) |
127 |
| - [IDiaSegment](../../debugger/debug-interface-access/idiasegment.md) |
128 |
| - [IDiaInjectedSource](../../debugger/debug-interface-access/idiainjectedsource.md) |
129 |
| - [IDiaFrameData](../../debugger/debug-interface-access/idiaframedata.md) |
130 |
| - [IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md) |
131 |
| - [IDiaSourceFile](../../debugger/debug-interface-access/idiasourcefile.md) |
132 |
| - [IDiaLineNumber](../../debugger/debug-interface-access/idialinenumber.md) |
133 |
| - [IDiaEnumInjectedSources](../../debugger/debug-interface-access/idiaenuminjectedsources.md) |
| 17 | +Allows you to read the persistent properties of a DIA property set. |
| 18 | + |
| 19 | +## Syntax |
| 20 | + |
| 21 | +``` |
| 22 | +IDiaPropertyStorage : IUnknown |
| 23 | +``` |
| 24 | + |
| 25 | +## Methods in Vtable Order |
| 26 | +The following table shows the methods of `IDiaPropertyStorage`. |
| 27 | + |
| 28 | +|Method|Description| |
| 29 | +|------------|-----------------| |
| 30 | +|[IDiaPropertyStorage::Enum](../../debugger/debug-interface-access/idiapropertystorage-enum.md)|Gets a pointer to an enumerator for properties within this set.| |
| 31 | +|[IDiaPropertyStorage::ReadBOOL](../../debugger/debug-interface-access/idiapropertystorage-readbool.md)|Reads `BOOL` values in a property set.| |
| 32 | +|[IDiaPropertyStorage::ReadBSTR](../../debugger/debug-interface-access/idiapropertystorage-readbstr.md)|Reads `BSTR` values in a property set.| |
| 33 | +|[IDiaPropertyStorage::ReadDWORD](../../debugger/debug-interface-access/idiapropertystorage-readdword.md)|Reads `DWORD` values in a property set.| |
| 34 | +|[IDiaPropertyStorage::ReadLONG](../../debugger/debug-interface-access/idiapropertystorage-readlong.md)|Reads `LONG` values in a property set.| |
| 35 | +|[IDiaPropertyStorage::ReadMultiple](../../debugger/debug-interface-access/idiapropertystorage-readmultiple.md)|Reads property values in a property set.| |
| 36 | +|[IDiaPropertyStorage::ReadPropertyNames](../../debugger/debug-interface-access/idiapropertystorage-readpropertynames.md)|Gets corresponding string names for given property identifiers.| |
| 37 | +|[IDiaPropertyStorage::ReadULONGLONG](../../debugger/debug-interface-access/idiapropertystorage-readulonglong.md)|Reads `ULONGLONG` values in a property set.| |
| 38 | + |
| 39 | +## Remarks |
| 40 | +Each property within a property set is identified by a property identifier (ID), a four-byte `ULONG` value unique to that set. The properties exposed through the `IDiaPropertyStorage` interface correspond to the properties available in the parent interface. For example, the properties of the [IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md) interface can be accessed by name through the `IDiaPropertyStorage` interface (note, however, that even though the property may be accessible, it does not mean the property is valid for a particular `IDiaSymbol` object). |
| 41 | + |
| 42 | +## Notes for Callers |
| 43 | +Obtain this interface by calling the `QueryInterface` method on another interface. The following interfaces can be queried for the `IDiaPropertyStorage` interface: |
| 44 | + |
| 45 | +- [IDiaSectionContrib](../../debugger/debug-interface-access/idiasectioncontrib.md) |
| 46 | + |
| 47 | +- [IDiaSegment](../../debugger/debug-interface-access/idiasegment.md) |
| 48 | + |
| 49 | +- [IDiaInjectedSource](../../debugger/debug-interface-access/idiainjectedsource.md) |
| 50 | + |
| 51 | +- [IDiaFrameData](../../debugger/debug-interface-access/idiaframedata.md) |
| 52 | + |
| 53 | +- [IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md) |
| 54 | + |
| 55 | +- [IDiaSourceFile](../../debugger/debug-interface-access/idiasourcefile.md) |
| 56 | + |
| 57 | +- [IDiaLineNumber](../../debugger/debug-interface-access/idialinenumber.md) |
| 58 | + |
| 59 | +## Example |
| 60 | +This example shows a function that displays all properties exposed by the `IDiaPropertyStorage` object. See the [IDiaEnumInjectedSources](../../debugger/debug-interface-access/idiaenuminjectedsources.md) interface for an example of how the `IDiaPropertyStorage` interface is obtained from the [IDiaInjectedSource](../../debugger/debug-interface-access/idiainjectedsource.md) interface. |
| 61 | + |
| 62 | +```C++ |
| 63 | +void PrintPropertyStorage(IDiaPropertyStorage* pPropertyStorage) |
| 64 | +{ |
| 65 | + IEnumSTATPROPSTG* pEnumProps; |
| 66 | + STATPROPSTG prop; |
| 67 | + DWORD celt = 1; |
| 68 | + |
| 69 | + if (pPropertyStorage->Enum(&pEnumProps) == S_OK) |
| 70 | + { |
| 71 | + while (pEnumProps->Next(celt, &prop, &celt) == S_OK) |
| 72 | + { |
| 73 | + PROPSPEC pspec = { PRSPEC_PROPID, prop.propid }; |
| 74 | + PROPVARIANT vt = { VT_EMPTY }; |
| 75 | + |
| 76 | + if (pPropertyStorage->ReadMultiple( 1, &pspec, &vt) == S_OK) |
| 77 | + { |
| 78 | + switch( vt.vt ){ |
| 79 | + case VT_BOOL: |
| 80 | + wprintf( L"%32s:\t %s\n", prop.lpwstrName, vt.bVal ? L"true" : L"false" ); |
| 81 | + break; |
| 82 | + case VT_I2: |
| 83 | + wprintf( L"%32s:\t %d\n", prop.lpwstrName, vt.iVal ); |
| 84 | + break; |
| 85 | + case VT_UI2: |
| 86 | + wprintf( L"%32s:\t %d\n", prop.lpwstrName, vt.uiVal ); |
| 87 | + break; |
| 88 | + case VT_I4: |
| 89 | + wprintf( L"%32s:\t %d\n", prop.lpwstrName, vt.intVal ); |
| 90 | + break; |
| 91 | + case VT_UI4: |
| 92 | + wprintf( L"%32s:\t 0x%0x\n", prop.lpwstrName, vt.uintVal ); |
| 93 | + break; |
| 94 | + case VT_UI8: |
| 95 | + wprintf( L"%32s:\t 0x%x\n", prop.lpwstrName, vt.uhVal.QuadPart ); |
| 96 | + break; |
| 97 | + case VT_BSTR: |
| 98 | + wprintf( L"%32s:\t %s\n", prop.lpwstrName, vt.bstrVal ); |
| 99 | + break; |
| 100 | + case VT_UNKNOWN: |
| 101 | + wprintf( L"%32s:\t %p\n", prop.lpwstrName, vt.punkVal ); |
| 102 | + break; |
| 103 | + case VT_SAFEARRAY: |
| 104 | + break; |
| 105 | + default: |
| 106 | + break; |
| 107 | + } |
| 108 | + VariantClear((VARIANTARG*) &vt); |
| 109 | + } |
| 110 | + } |
| 111 | + pEnumProps->Release(); |
| 112 | + } |
| 113 | +} |
| 114 | +``` |
| 115 | +
|
| 116 | +## Requirements |
| 117 | +Header: Dia2.h |
| 118 | +
|
| 119 | +Library: diaguids.lib |
| 120 | +
|
| 121 | +DLL: msdia80.dll |
| 122 | +
|
| 123 | +## See Also |
| 124 | +[Interfaces (Debug Interface Access SDK)](../../debugger/debug-interface-access/interfaces-debug-interface-access-sdk.md) |
| 125 | +[IDiaSession::getEnumTables](../../debugger/debug-interface-access/idiasession-getenumtables.md) |
| 126 | +[IDiaSectionContrib](../../debugger/debug-interface-access/idiasectioncontrib.md) |
| 127 | +[IDiaSegment](../../debugger/debug-interface-access/idiasegment.md) |
| 128 | +[IDiaInjectedSource](../../debugger/debug-interface-access/idiainjectedsource.md) |
| 129 | +[IDiaFrameData](../../debugger/debug-interface-access/idiaframedata.md) |
| 130 | +[IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md) |
| 131 | +[IDiaSourceFile](../../debugger/debug-interface-access/idiasourcefile.md) |
| 132 | +[IDiaLineNumber](../../debugger/debug-interface-access/idialinenumber.md) |
| 133 | +[IDiaEnumInjectedSources](../../debugger/debug-interface-access/idiaenuminjectedsources.md) |
0 commit comments