source: trunk/Utilities/EnumerateAudioDevices/MainDialog.h @ 522

Last change on this file since 522 was 522, checked in by roman, 8 years ago

VS2013 upgrade, added some detail to the output

  • Property svn:keywords set to Id
File size: 52.2 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2011
3// Created by Roman Ryltsov roman@alax.info
4
5#pragma once
6
7#include <mmdeviceapi.h>
8#include <mmreg.h>
9#include <functiondiscoverykeys.h>
10#include <propkey.h>
11#include <devpkey.h>
12#include "AboutDialog.h"
13
14////////////////////////////////////////////////////////////
15// CMainDialog
16
17class CMainDialog : 
18        public CDialogImpl<CMainDialog>,
19        public CDialogResize<CMainDialog>
20{
21public:
22        enum { IDD = IDD_MAIN };
23
24BEGIN_MSG_MAP_EX(CMainDialog)
25        //CHAIN_MSG_MAP(CMainDialog)
26        CHAIN_MSG_MAP(CDialogResize<CMainDialog>)
27        MSG_WM_INITDIALOG(OnInitDialog)
28        MSG_WM_SYSCOMMAND(OnSysCommand)
29        COMMAND_ID_HANDLER_EX(IDCANCEL, OnCommand)
30        COMMAND_ID_HANDLER_EX(IDOK, OnCommand)
31END_MSG_MAP()
32
33BEGIN_DLGRESIZE_MAP(CMainDialog)
34        DLGRESIZE_CONTROL(IDC_TEXT, DLSZ_SIZE_X | DLSZ_SIZE_Y)
35        DLGRESIZE_CONTROL(IDOK, DLSZ_MOVE_X | DLSZ_MOVE_Y)
36END_DLGRESIZE_MAP()
37
38private:
39        CRoEdit m_TextEdit;
40
41public:
42// CMainDialog
43        static BOOL IsWaveFormatExKey(const PROPERTYKEY& Key)
44        {
45                if(Key == PKEY_AudioEngine_DeviceFormat)
46                        return TRUE;
47                if(Key == PKEY_AudioEngine_OEMFormat)
48                        return TRUE;
49                class __declspec(uuid("{3D6E1656-2E50-4C4C-8D85-D0ACAE3C6C68}")) A;
50                if(Key.fmtid == __uuidof(A) && (Key.pid == 2 || Key.pid == 3))
51                        return TRUE;
52                class __declspec(uuid("{E4870E26-3CC5-4CD2-BA46-CA0A9A70ED04}")) B;
53                if(Key.fmtid == __uuidof(B) && Key.pid == 0) // PKEY_AudioEngine_??? endpointkeys.h
54                        return TRUE;
55                class __declspec(uuid("{624F56DE-FD24-473E-814A-DE40AACAED16}")) C;
56                if(Key.fmtid == __uuidof(C) && Key.pid == 3)
57                        return TRUE;
58                return FALSE;
59        }
60
61// Window message handelrs
62        LRESULT OnInitDialog(HWND, LPARAM) throw()
63        {
64                SetIcon(AtlLoadIcon(IDI_MODULE), TRUE);
65                SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)), FALSE);
66                CMenuHandle Menu = GetSystemMenu(FALSE);
67                _W(Menu.AppendMenu(MF_SEPARATOR));
68                _W(Menu.AppendMenu(MF_STRING, ID_APP_ABOUT, _T("&About...")));
69                DlgResize_Init();
70                _W(CenterWindow());
71                _ATLTRY
72                {
73                        CWaitCursor WaitCursor;
74                        CString sText;
75                        #pragma region The Enumeration
76                        _ATLTRY
77                        {
78                                CComPtr<IMMDeviceEnumerator> pMmDeviceEnumerator;
79                                __C(pMmDeviceEnumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator)));
80                                CComPtr<IMMDeviceCollection> pMmDeviceCollection;
81                                __C(pMmDeviceEnumerator->EnumAudioEndpoints(eAll, DEVICE_STATEMASK_ALL, &pMmDeviceCollection));
82                                UINT nDeviceCount = 0;
83                                __C(pMmDeviceCollection->GetCount(&nDeviceCount));
84                                for(UINT nDeviceIndex = 0; nDeviceIndex < nDeviceCount; nDeviceIndex++)
85                                        _ATLTRY
86                                        {
87                                                sText.AppendFormat(_T("Device %d:\r\n"), nDeviceIndex);
88                                                CComPtr<IMMDevice> pMmDevice;
89                                                __C(pMmDeviceCollection->Item(nDeviceIndex, &pMmDevice));
90                                                CComHeapPtr<WCHAR> pszIdentifier;
91                                                __C(pMmDevice->GetId(&pszIdentifier));
92                                                sText.AppendFormat(_T("\t") _T("Identifier\t%ls\r\n"), pszIdentifier);
93                                                #pragma region State
94                                                DWORD nState = 0;
95                                                __C(pMmDevice->GetState(&nState));
96                                                static const CFlagNameT<DWORD> g_pDeviceStateMap[] = 
97                                                {
98                                                        #define A(x) { x, #x },
99                                                        A(DEVICE_STATE_ACTIVE)
100                                                        A(DEVICE_STATE_DISABLED)
101                                                        A(DEVICE_STATE_NOTPRESENT)
102                                                        A(DEVICE_STATE_UNPLUGGED)
103                                                        #undef A
104                                                };
105                                                sText.AppendFormat(_T("\t") _T("State\t%s\t0x%02X\r\n"), FormatFlagsT(g_pDeviceStateMap, nState), nState);
106                                                #pragma endregion State
107                                                #pragma region Property Store
108                                                sText.AppendFormat(_T("\t") _T("Properties:\r\n"));
109                                                CComPtr<IPropertyStore> pPropertyStore;
110                                                __C(pMmDevice->OpenPropertyStore(STGM_READ, &pPropertyStore));
111                                                DWORD nPropertyCount = 0;
112                                                __C(pPropertyStore->GetCount(&nPropertyCount));
113                                                for(DWORD nPropertyIndex = 0; nPropertyIndex < nPropertyCount; nPropertyIndex++)
114                                                        _ATLTRY
115                                                        {
116                                                                PROPERTYKEY Key;
117                                                                __C(pPropertyStore->GetAt(nPropertyIndex, &Key));
118                                                                PROPVARIANT Value;
119                                                                PropVariantInit(&Value);
120                                                                __C(pPropertyStore->GetValue(Key, &Value));
121                                                                _ATLTRY
122                                                                {
123                                                                        CString sKeyName;
124                                                                        // NOTE: This is brought to you by regexp .+{PKEY_[^,]+}.+ -> A(\1)
125                                                                        #pragma region Named SDK constants
126                                                                        #define A(x) { &x, #x },
127                                                                        #define B(x) { &reinterpret_cast<const PROPERTYKEY&>(x), #x },
128                                                                        static const struct 
129                                                                        { 
130                                                                                const PROPERTYKEY* pKey; 
131                                                                                LPCSTR pszName; 
132                                                                        } g_pMap[] = 
133                                                                        {
134                                                                                #pragma region functiondiscoverykeys.h
135                                                                                A(PKEY_NAME)
136                                                                                A(PKEY_Device_DeviceDesc)
137                                                                                A(PKEY_Device_HardwareIds)
138                                                                                A(PKEY_Device_CompatibleIds)
139                                                                                A(PKEY_Device_Service)
140                                                                                A(PKEY_Device_Class)
141                                                                                A(PKEY_Device_ClassGuid)
142                                                                                A(PKEY_Device_Driver)
143                                                                                A(PKEY_Device_ConfigFlags)
144                                                                                A(PKEY_Device_Manufacturer)
145                                                                                A(PKEY_Device_FriendlyName)
146                                                                                A(PKEY_Device_LocationInfo)
147                                                                                A(PKEY_Device_PDOName)
148                                                                                A(PKEY_Device_Capabilities)
149                                                                                A(PKEY_Device_UINumber)
150                                                                                A(PKEY_Device_UpperFilters)
151                                                                                A(PKEY_Device_LowerFilters)
152                                                                                A(PKEY_Device_BusTypeGuid)
153                                                                                A(PKEY_Device_LegacyBusType)
154                                                                                A(PKEY_Device_BusNumber)
155                                                                                A(PKEY_Device_EnumeratorName)
156                                                                                A(PKEY_Device_Security)
157                                                                                A(PKEY_Device_SecuritySDS)
158                                                                                A(PKEY_Device_DevType)
159                                                                                A(PKEY_Device_Exclusive)
160                                                                                A(PKEY_Device_Characteristics)
161                                                                                A(PKEY_Device_Address)
162                                                                                A(PKEY_Device_UINumberDescFormat)
163                                                                                A(PKEY_Device_PowerData)
164                                                                                A(PKEY_Device_RemovalPolicy)
165                                                                                A(PKEY_Device_RemovalPolicyDefault)
166                                                                                A(PKEY_Device_RemovalPolicyOverride)
167                                                                                A(PKEY_Device_InstallState)
168                                                                                A(PKEY_Device_LocationPaths)
169                                                                                A(PKEY_Device_BaseContainerId)
170                                                                                A(PKEY_Device_DevNodeStatus)
171                                                                                A(PKEY_Device_ProblemCode)
172                                                                                A(PKEY_Device_EjectionRelations)
173                                                                                A(PKEY_Device_RemovalRelations)
174                                                                                A(PKEY_Device_PowerRelations)
175                                                                                A(PKEY_Device_BusRelations)
176                                                                                A(PKEY_Device_Parent)
177                                                                                A(PKEY_Device_Children)
178                                                                                A(PKEY_Device_Siblings)
179                                                                                A(PKEY_Device_TransportRelations)
180                                                                                A(PKEY_Device_Reported)
181                                                                                A(PKEY_Device_Legacy)
182                                                                                A(PKEY_Device_InstanceId)
183                                                                                A(PKEY_Device_ContainerId)
184                                                                                A(PKEY_Device_ModelId)
185                                                                                A(PKEY_Device_FriendlyNameAttributes)
186                                                                                A(PKEY_Device_ManufacturerAttributes)
187                                                                                A(PKEY_Device_PresenceNotForDevice)
188                                                                                A(PKEY_Numa_Proximity_Domain)
189                                                                                A(PKEY_Device_DHP_Rebalance_Policy)
190                                                                                A(PKEY_Device_Numa_Node)
191                                                                                A(PKEY_Device_BusReportedDeviceDesc)
192                                                                                A(PKEY_Device_InstallInProgress)
193                                                                                A(PKEY_Device_DriverDate)
194                                                                                A(PKEY_Device_DriverVersion)
195                                                                                A(PKEY_Device_DriverDesc)
196                                                                                A(PKEY_Device_DriverInfPath)
197                                                                                A(PKEY_Device_DriverInfSection)
198                                                                                A(PKEY_Device_DriverInfSectionExt)
199                                                                                A(PKEY_Device_MatchingDeviceId)
200                                                                                A(PKEY_Device_DriverProvider)
201                                                                                A(PKEY_Device_DriverPropPageProvider)
202                                                                                A(PKEY_Device_DriverCoInstallers)
203                                                                                A(PKEY_Device_ResourcePickerTags)
204                                                                                A(PKEY_Device_ResourcePickerExceptions)
205                                                                                A(PKEY_Device_DriverRank)
206                                                                                A(PKEY_Device_DriverLogoLevel)
207                                                                                A(PKEY_Device_NoConnectSound)
208                                                                                A(PKEY_Device_GenericDriverInstalled)
209                                                                                A(PKEY_Device_AdditionalSoftwareRequested)
210                                                                                A(PKEY_Device_SafeRemovalRequired)
211                                                                                A(PKEY_Device_SafeRemovalRequiredOverride)
212                                                                                A(PKEY_DrvPkg_Model)
213                                                                                A(PKEY_DrvPkg_VendorWebSite)
214                                                                                A(PKEY_DrvPkg_DetailedDescription)
215                                                                                A(PKEY_DrvPkg_DocumentationLink)
216                                                                                A(PKEY_DrvPkg_Icon)
217                                                                                A(PKEY_DrvPkg_BrandingIcon)
218                                                                                A(PKEY_DeviceClass_UpperFilters)
219                                                                                A(PKEY_DeviceClass_LowerFilters)
220                                                                                A(PKEY_DeviceClass_Security)
221                                                                                A(PKEY_DeviceClass_SecuritySDS)
222                                                                                A(PKEY_DeviceClass_DevType)
223                                                                                A(PKEY_DeviceClass_Exclusive)
224                                                                                A(PKEY_DeviceClass_Characteristics)
225                                                                                A(PKEY_DeviceClass_Name)
226                                                                                A(PKEY_DeviceClass_ClassName)
227                                                                                A(PKEY_DeviceClass_Icon)
228                                                                                A(PKEY_DeviceClass_ClassInstaller)
229                                                                                A(PKEY_DeviceClass_PropPageProvider)
230                                                                                A(PKEY_DeviceClass_NoInstallClass)
231                                                                                A(PKEY_DeviceClass_NoDisplayClass)
232                                                                                A(PKEY_DeviceClass_SilentInstall)
233                                                                                A(PKEY_DeviceClass_NoUseClass)
234                                                                                A(PKEY_DeviceClass_DefaultService)
235                                                                                A(PKEY_DeviceClass_IconPath)
236                                                                                A(PKEY_DeviceClass_ClassCoInstallers)
237                                                                                A(PKEY_DeviceInterface_FriendlyName)
238                                                                                A(PKEY_DeviceInterface_Enabled)
239                                                                                A(PKEY_DeviceInterface_ClassGuid)
240                                                                                A(PKEY_DeviceInterfaceClass_DefaultInterface)
241                                                                                #pragma endregion
242                                                                                #pragma region functiondiscoverykeys_devpkey.h
243                                                                                A(PKEY_NAME)
244                                                                                A(PKEY_Device_DeviceDesc)
245                                                                                A(PKEY_Device_HardwareIds)
246                                                                                A(PKEY_Device_CompatibleIds)
247                                                                                A(PKEY_Device_Service)
248                                                                                A(PKEY_Device_Class)
249                                                                                A(PKEY_Device_ClassGuid)
250                                                                                A(PKEY_Device_Driver)
251                                                                                A(PKEY_Device_ConfigFlags)
252                                                                                A(PKEY_Device_Manufacturer)
253                                                                                A(PKEY_Device_FriendlyName)
254                                                                                A(PKEY_Device_LocationInfo)
255                                                                                A(PKEY_Device_PDOName)
256                                                                                A(PKEY_Device_Capabilities)
257                                                                                A(PKEY_Device_UINumber)
258                                                                                A(PKEY_Device_UpperFilters)
259                                                                                A(PKEY_Device_LowerFilters)
260                                                                                A(PKEY_Device_BusTypeGuid)
261                                                                                A(PKEY_Device_LegacyBusType)
262                                                                                A(PKEY_Device_BusNumber)
263                                                                                A(PKEY_Device_EnumeratorName)
264                                                                                A(PKEY_Device_Security)
265                                                                                A(PKEY_Device_SecuritySDS)
266                                                                                A(PKEY_Device_DevType)
267                                                                                A(PKEY_Device_Exclusive)
268                                                                                A(PKEY_Device_Characteristics)
269                                                                                A(PKEY_Device_Address)
270                                                                                A(PKEY_Device_UINumberDescFormat)
271                                                                                A(PKEY_Device_PowerData)
272                                                                                A(PKEY_Device_RemovalPolicy)
273                                                                                A(PKEY_Device_RemovalPolicyDefault)
274                                                                                A(PKEY_Device_RemovalPolicyOverride)
275                                                                                A(PKEY_Device_InstallState)
276                                                                                A(PKEY_Device_LocationPaths)
277                                                                                A(PKEY_Device_BaseContainerId)
278                                                                                A(PKEY_Device_DevNodeStatus)
279                                                                                A(PKEY_Device_ProblemCode)
280                                                                                A(PKEY_Device_EjectionRelations)
281                                                                                A(PKEY_Device_RemovalRelations)
282                                                                                A(PKEY_Device_PowerRelations)
283                                                                                A(PKEY_Device_BusRelations)
284                                                                                A(PKEY_Device_Parent)
285                                                                                A(PKEY_Device_Children)
286                                                                                A(PKEY_Device_Siblings)
287                                                                                A(PKEY_Device_TransportRelations)
288                                                                                A(PKEY_Device_Reported)
289                                                                                A(PKEY_Device_Legacy)
290                                                                                A(PKEY_Device_InstanceId)
291                                                                                A(PKEY_Device_ContainerId)
292                                                                                A(PKEY_Device_ModelId)
293                                                                                A(PKEY_Device_FriendlyNameAttributes)
294                                                                                A(PKEY_Device_ManufacturerAttributes)
295                                                                                A(PKEY_Device_PresenceNotForDevice)
296                                                                                A(PKEY_Numa_Proximity_Domain)
297                                                                                A(PKEY_Device_DHP_Rebalance_Policy)
298                                                                                A(PKEY_Device_Numa_Node)
299                                                                                A(PKEY_Device_BusReportedDeviceDesc)
300                                                                                A(PKEY_Device_InstallInProgress)
301                                                                                A(PKEY_Device_DriverDate)
302                                                                                A(PKEY_Device_DriverVersion)
303                                                                                A(PKEY_Device_DriverDesc)
304                                                                                A(PKEY_Device_DriverInfPath)
305                                                                                A(PKEY_Device_DriverInfSection)
306                                                                                A(PKEY_Device_DriverInfSectionExt)
307                                                                                A(PKEY_Device_MatchingDeviceId)
308                                                                                A(PKEY_Device_DriverProvider)
309                                                                                A(PKEY_Device_DriverPropPageProvider)
310                                                                                A(PKEY_Device_DriverCoInstallers)
311                                                                                A(PKEY_Device_ResourcePickerTags)
312                                                                                A(PKEY_Device_ResourcePickerExceptions)
313                                                                                A(PKEY_Device_DriverRank)
314                                                                                A(PKEY_Device_DriverLogoLevel)
315                                                                                A(PKEY_Device_NoConnectSound)
316                                                                                A(PKEY_Device_GenericDriverInstalled)
317                                                                                A(PKEY_Device_AdditionalSoftwareRequested)
318                                                                                A(PKEY_Device_SafeRemovalRequired)
319                                                                                A(PKEY_Device_SafeRemovalRequiredOverride)
320                                                                                A(PKEY_DrvPkg_Model)
321                                                                                A(PKEY_DrvPkg_VendorWebSite)
322                                                                                A(PKEY_DrvPkg_DetailedDescription)
323                                                                                A(PKEY_DrvPkg_DocumentationLink)
324                                                                                A(PKEY_DrvPkg_Icon)
325                                                                                A(PKEY_DrvPkg_BrandingIcon)
326                                                                                A(PKEY_DeviceClass_UpperFilters)
327                                                                                A(PKEY_DeviceClass_LowerFilters)
328                                                                                A(PKEY_DeviceClass_Security)
329                                                                                A(PKEY_DeviceClass_SecuritySDS)
330                                                                                A(PKEY_DeviceClass_DevType)
331                                                                                A(PKEY_DeviceClass_Exclusive)
332                                                                                A(PKEY_DeviceClass_Characteristics)
333                                                                                A(PKEY_DeviceClass_Name)
334                                                                                A(PKEY_DeviceClass_ClassName)
335                                                                                A(PKEY_DeviceClass_Icon)
336                                                                                A(PKEY_DeviceClass_ClassInstaller)
337                                                                                A(PKEY_DeviceClass_PropPageProvider)
338                                                                                A(PKEY_DeviceClass_NoInstallClass)
339                                                                                A(PKEY_DeviceClass_NoDisplayClass)
340                                                                                A(PKEY_DeviceClass_SilentInstall)
341                                                                                A(PKEY_DeviceClass_NoUseClass)
342                                                                                A(PKEY_DeviceClass_DefaultService)
343                                                                                A(PKEY_DeviceClass_IconPath)
344                                                                                A(PKEY_DeviceClass_ClassCoInstallers)
345                                                                                A(PKEY_DeviceInterface_FriendlyName)
346                                                                                A(PKEY_DeviceInterface_Enabled)
347                                                                                A(PKEY_DeviceInterface_ClassGuid)
348                                                                                A(PKEY_DeviceInterfaceClass_DefaultInterface)
349                                                                                #pragma endregion
350                                                                                #pragma region mmdeviceapi.h
351                                                                                A(PKEY_AudioEndpoint_FormFactor)
352                                                                                A(PKEY_AudioEndpoint_ControlPanelPageProvider)
353                                                                                A(PKEY_AudioEndpoint_Association)
354                                                                                A(PKEY_AudioEndpoint_PhysicalSpeakers)
355                                                                                A(PKEY_AudioEndpoint_GUID)
356                                                                                A(PKEY_AudioEndpoint_Disable_SysFx)
357                                                                                A(PKEY_AudioEndpoint_FullRangeSpeakers)
358                                                                                A(PKEY_AudioEndpoint_Supports_EventDriven_Mode)
359                                                                                A(PKEY_AudioEndpoint_JackSubType)
360                                                                                A(PKEY_AudioEngine_DeviceFormat)
361                                                                                A(PKEY_AudioEngine_OEMFormat)
362                                                                                #pragma endregion
363                                                                                #pragma region propkey.h
364                                                                                A(PKEY_Audio_ChannelCount)
365                                                                                A(PKEY_Audio_Compression)
366                                                                                A(PKEY_Audio_EncodingBitrate)
367                                                                                A(PKEY_Audio_Format)
368                                                                                A(PKEY_Audio_IsVariableBitRate)
369                                                                                A(PKEY_Audio_PeakValue)
370                                                                                A(PKEY_Audio_SampleRate)
371                                                                                A(PKEY_Audio_SampleSize)
372                                                                                A(PKEY_Audio_StreamName)
373                                                                                A(PKEY_Audio_StreamNumber)
374                                                                                A(PKEY_Calendar_Duration)
375                                                                                A(PKEY_Calendar_IsOnline)
376                                                                                A(PKEY_Calendar_IsRecurring)
377                                                                                A(PKEY_Calendar_Location)
378                                                                                A(PKEY_Calendar_OptionalAttendeeAddresses)
379                                                                                A(PKEY_Calendar_OptionalAttendeeNames)
380                                                                                A(PKEY_Calendar_OrganizerAddress)
381                                                                                A(PKEY_Calendar_OrganizerName)
382                                                                                A(PKEY_Calendar_ReminderTime)
383                                                                                A(PKEY_Calendar_RequiredAttendeeAddresses)
384                                                                                A(PKEY_Calendar_RequiredAttendeeNames)
385                                                                                A(PKEY_Calendar_Resources)
386                                                                                A(PKEY_Calendar_ResponseStatus)
387                                                                                A(PKEY_Calendar_ShowTimeAs)
388                                                                                A(PKEY_Calendar_ShowTimeAsText)
389                                                                                A(PKEY_Communication_AccountName)
390                                                                                A(PKEY_Communication_DateItemExpires)
391                                                                                A(PKEY_Communication_FollowupIconIndex)
392                                                                                A(PKEY_Communication_HeaderItem)
393                                                                                A(PKEY_Communication_PolicyTag)
394                                                                                A(PKEY_Communication_SecurityFlags)
395                                                                                A(PKEY_Communication_Suffix)
396                                                                                A(PKEY_Communication_TaskStatus)
397                                                                                A(PKEY_Communication_TaskStatusText)
398                                                                                A(PKEY_Computer_DecoratedFreeSpace)
399                                                                                A(PKEY_Contact_Anniversary)
400                                                                                A(PKEY_Contact_AssistantName)
401                                                                                A(PKEY_Contact_AssistantTelephone)
402                                                                                A(PKEY_Contact_Birthday)
403                                                                                A(PKEY_Contact_BusinessAddress)
404                                                                                A(PKEY_Contact_BusinessAddressCity)
405                                                                                A(PKEY_Contact_BusinessAddressCountry)
406                                                                                A(PKEY_Contact_BusinessAddressPostalCode)
407                                                                                A(PKEY_Contact_BusinessAddressPostOfficeBox)
408                                                                                A(PKEY_Contact_BusinessAddressState)
409                                                                                A(PKEY_Contact_BusinessAddressStreet)
410                                                                                A(PKEY_Contact_BusinessFaxNumber)
411                                                                                A(PKEY_Contact_BusinessHomePage)
412                                                                                A(PKEY_Contact_BusinessTelephone)
413                                                                                A(PKEY_Contact_CallbackTelephone)
414                                                                                A(PKEY_Contact_CarTelephone)
415                                                                                A(PKEY_Contact_Children)
416                                                                                A(PKEY_Contact_CompanyMainTelephone)
417                                                                                A(PKEY_Contact_Department)
418                                                                                A(PKEY_Contact_EmailAddress)
419                                                                                A(PKEY_Contact_EmailAddress2)
420                                                                                A(PKEY_Contact_EmailAddress3)
421                                                                                A(PKEY_Contact_EmailAddresses)
422                                                                                A(PKEY_Contact_EmailName)
423                                                                                A(PKEY_Contact_FileAsName)
424                                                                                A(PKEY_Contact_FirstName)
425                                                                                A(PKEY_Contact_FullName)
426                                                                                A(PKEY_Contact_Gender)
427                                                                                A(PKEY_Contact_GenderValue)
428                                                                                A(PKEY_Contact_Hobbies)
429                                                                                A(PKEY_Contact_HomeAddress)
430                                                                                A(PKEY_Contact_HomeAddressCity)
431                                                                                A(PKEY_Contact_HomeAddressCountry)
432                                                                                A(PKEY_Contact_HomeAddressPostalCode)
433                                                                                A(PKEY_Contact_HomeAddressPostOfficeBox)
434                                                                                A(PKEY_Contact_HomeAddressState)
435                                                                                A(PKEY_Contact_HomeAddressStreet)
436                                                                                A(PKEY_Contact_HomeFaxNumber)
437                                                                                A(PKEY_Contact_HomeTelephone)
438                                                                                A(PKEY_Contact_IMAddress)
439                                                                                A(PKEY_Contact_Initials)
440                                                                                A(PKEY_Contact_JA_CompanyNamePhonetic)
441                                                                                A(PKEY_Contact_JA_FirstNamePhonetic)
442                                                                                A(PKEY_Contact_JA_LastNamePhonetic)
443                                                                                A(PKEY_Contact_JobTitle)
444                                                                                A(PKEY_Contact_Label)
445                                                                                A(PKEY_Contact_LastName)
446                                                                                A(PKEY_Contact_MailingAddress)
447                                                                                A(PKEY_Contact_MiddleName)
448                                                                                A(PKEY_Contact_MobileTelephone)
449                                                                                A(PKEY_Contact_NickName)
450                                                                                A(PKEY_Contact_OfficeLocation)
451                                                                                A(PKEY_Contact_OtherAddress)
452                                                                                A(PKEY_Contact_OtherAddressCity)
453                                                                                A(PKEY_Contact_OtherAddressCountry)
454                                                                                A(PKEY_Contact_OtherAddressPostalCode)
455                                                                                A(PKEY_Contact_OtherAddressPostOfficeBox)
456                                                                                A(PKEY_Contact_OtherAddressState)
457                                                                                A(PKEY_Contact_OtherAddressStreet)
458                                                                                A(PKEY_Contact_PagerTelephone)
459                                                                                A(PKEY_Contact_PersonalTitle)
460                                                                                A(PKEY_Contact_PrimaryAddressCity)
461                                                                                A(PKEY_Contact_PrimaryAddressCountry)
462                                                                                A(PKEY_Contact_PrimaryAddressPostalCode)
463                                                                                A(PKEY_Contact_PrimaryAddressPostOfficeBox)
464                                                                                A(PKEY_Contact_PrimaryAddressState)
465                                                                                A(PKEY_Contact_PrimaryAddressStreet)
466                                                                                A(PKEY_Contact_PrimaryEmailAddress)
467                                                                                A(PKEY_Contact_PrimaryTelephone)
468                                                                                A(PKEY_Contact_Profession)
469                                                                                A(PKEY_Contact_SpouseName)
470                                                                                A(PKEY_Contact_Suffix)
471                                                                                A(PKEY_Contact_TelexNumber)
472                                                                                A(PKEY_Contact_TTYTDDTelephone)
473                                                                                A(PKEY_Contact_WebPage)
474                                                                                A(PKEY_AcquisitionID)
475                                                                                A(PKEY_ApplicationName)
476                                                                                A(PKEY_Author)
477                                                                                A(PKEY_Capacity)
478                                                                                A(PKEY_Category)
479                                                                                A(PKEY_Comment)
480                                                                                A(PKEY_Company)
481                                                                                A(PKEY_ComputerName)
482                                                                                A(PKEY_ContainedItems)
483                                                                                A(PKEY_ContentStatus)
484                                                                                A(PKEY_ContentType)
485                                                                                A(PKEY_Copyright)
486                                                                                A(PKEY_DateAccessed)
487                                                                                A(PKEY_DateAcquired)
488                                                                                A(PKEY_DateArchived)
489                                                                                A(PKEY_DateCompleted)
490                                                                                A(PKEY_DateCreated)
491                                                                                A(PKEY_DateImported)
492                                                                                A(PKEY_DateModified)
493                                                                                A(PKEY_DueDate)
494                                                                                A(PKEY_EndDate)
495                                                                                A(PKEY_FileAllocationSize)
496                                                                                A(PKEY_FileAttributes)
497                                                                                A(PKEY_FileCount)
498                                                                                A(PKEY_FileDescription)
499                                                                                A(PKEY_FileExtension)
500                                                                                A(PKEY_FileFRN)
501                                                                                A(PKEY_FileName)
502                                                                                A(PKEY_FileOwner)
503                                                                                A(PKEY_FileVersion)
504                                                                                A(PKEY_FindData)
505                                                                                A(PKEY_FlagColor)
506                                                                                A(PKEY_FlagColorText)
507                                                                                A(PKEY_FlagStatus)
508                                                                                A(PKEY_FlagStatusText)
509                                                                                A(PKEY_FreeSpace)
510                                                                                A(PKEY_FullText)
511                                                                                A(PKEY_Identity)
512                                                                                A(PKEY_Identity_Blob)
513                                                                                A(PKEY_Identity_DisplayName)
514                                                                                A(PKEY_Identity_IsMeIdentity)
515                                                                                A(PKEY_Identity_PrimaryEmailAddress)
516                                                                                A(PKEY_Identity_ProviderID)
517                                                                                A(PKEY_Identity_UniqueID)
518                                                                                A(PKEY_Identity_UserName)
519                                                                                A(PKEY_IdentityProvider_Name)
520                                                                                A(PKEY_IdentityProvider_Picture)
521                                                                                A(PKEY_ImageParsingName)
522                                                                                A(PKEY_Importance)
523                                                                                A(PKEY_ImportanceText)
524                                                                                A(PKEY_IsAttachment)
525                                                                                A(PKEY_IsDefaultNonOwnerSaveLocation)
526                                                                                A(PKEY_IsDefaultSaveLocation)
527                                                                                A(PKEY_IsDeleted)
528                                                                                A(PKEY_IsEncrypted)
529                                                                                A(PKEY_IsFlagged)
530                                                                                A(PKEY_IsFlaggedComplete)
531                                                                                A(PKEY_IsIncomplete)
532                                                                                A(PKEY_IsLocationSupported)
533                                                                                A(PKEY_IsPinnedToNameSpaceTree)
534                                                                                A(PKEY_IsRead)
535                                                                                A(PKEY_IsSearchOnlyItem)
536                                                                                A(PKEY_IsSendToTarget)
537                                                                                A(PKEY_IsShared)
538                                                                                A(PKEY_ItemAuthors)
539                                                                                A(PKEY_ItemClassType)
540                                                                                A(PKEY_ItemDate)
541                                                                                A(PKEY_ItemFolderNameDisplay)
542                                                                                A(PKEY_ItemFolderPathDisplay)
543                                                                                A(PKEY_ItemFolderPathDisplayNarrow)
544                                                                                A(PKEY_ItemName)
545                                                                                A(PKEY_ItemNameDisplay)
546                                                                                A(PKEY_ItemNamePrefix)
547                                                                                A(PKEY_ItemParticipants)
548                                                                                A(PKEY_ItemPathDisplay)
549                                                                                A(PKEY_ItemPathDisplayNarrow)
550                                                                                A(PKEY_ItemType)
551                                                                                A(PKEY_ItemTypeText)
552                                                                                A(PKEY_ItemUrl)
553                                                                                A(PKEY_Keywords)
554                                                                                A(PKEY_Kind)
555                                                                                A(PKEY_KindText)
556                                                                                A(PKEY_Language)
557                                                                                A(PKEY_MileageInformation)
558                                                                                A(PKEY_MIMEType)
559                                                                                A(PKEY_Null)
560                                                                                A(PKEY_OfflineAvailability)
561                                                                                A(PKEY_OfflineStatus)
562                                                                                A(PKEY_OriginalFileName)
563                                                                                A(PKEY_OwnerSID)
564                                                                                A(PKEY_ParentalRating)
565                                                                                A(PKEY_ParentalRatingReason)
566                                                                                A(PKEY_ParentalRatingsOrganization)
567                                                                                A(PKEY_ParsingBindContext)
568                                                                                A(PKEY_ParsingName)
569                                                                                A(PKEY_ParsingPath)
570                                                                                A(PKEY_PerceivedType)
571                                                                                A(PKEY_PercentFull)
572                                                                                A(PKEY_Priority)
573                                                                                A(PKEY_PriorityText)
574                                                                                A(PKEY_Project)
575                                                                                A(PKEY_ProviderItemID)
576                                                                                A(PKEY_Rating)
577                                                                                A(PKEY_RatingText)
578                                                                                A(PKEY_Sensitivity)
579                                                                                A(PKEY_SensitivityText)
580                                                                                A(PKEY_SFGAOFlags)
581                                                                                A(PKEY_SharedWith)
582                                                                                A(PKEY_ShareUserRating)
583                                                                                A(PKEY_SharingStatus)
584                                                                                A(PKEY_Shell_OmitFromView)
585                                                                                A(PKEY_SimpleRating)
586                                                                                A(PKEY_Size)
587                                                                                A(PKEY_SoftwareUsed)
588                                                                                A(PKEY_SourceItem)
589                                                                                A(PKEY_StartDate)
590                                                                                A(PKEY_Status)
591                                                                                A(PKEY_Subject)
592                                                                                A(PKEY_Thumbnail)
593                                                                                A(PKEY_ThumbnailCacheId)
594                                                                                A(PKEY_ThumbnailStream)
595                                                                                A(PKEY_Title)
596                                                                                A(PKEY_TotalFileSize)
597                                                                                A(PKEY_Trademarks)
598                                                                                A(PKEY_Device_PrinterURL)
599                                                                                A(PKEY_DeviceInterface_PrinterDriverDirectory)
600                                                                                A(PKEY_DeviceInterface_PrinterDriverName)
601                                                                                A(PKEY_DeviceInterface_PrinterName)
602                                                                                A(PKEY_DeviceInterface_PrinterPortName)
603                                                                                A(PKEY_Devices_BatteryLife)
604                                                                                A(PKEY_Devices_BatteryPlusCharging)
605                                                                                A(PKEY_Devices_BatteryPlusChargingText)
606                                                                                A(PKEY_Devices_Category_Desc_Singular)
607                                                                                A(PKEY_Devices_CategoryGroup_Desc)
608                                                                                A(PKEY_Devices_Category_Desc_Plural)
609                                                                                A(PKEY_Devices_ChargingState)
610                                                                                A(PKEY_Devices_IsConnected)
611                                                                                A(PKEY_Devices_ContainerId)
612                                                                                A(PKEY_Devices_DefaultTooltip)
613                                                                                A(PKEY_Devices_DeviceDescription1)
614                                                                                A(PKEY_Devices_DeviceDescription2)
615                                                                                A(PKEY_Devices_DiscoveryMethod)
616                                                                                A(PKEY_Devices_FriendlyName)
617                                                                                A(PKEY_Devices_FunctionPaths)
618                                                                                A(PKEY_Devices_InterfacePaths)
619                                                                                A(PKEY_Devices_IsDefaultDevice)
620                                                                                A(PKEY_Devices_IsNetworkDevice)
621                                                                                A(PKEY_Devices_IsSharedDevice)
622                                                                                A(PKEY_Devices_IsSoftwareInstalling)
623                                                                                A(PKEY_Devices_LaunchDeviceStageFromExplorer)
624                                                                                A(PKEY_Devices_IsLocalMachine)
625                                                                                A(PKEY_Devices_Manufacturer)
626                                                                                A(PKEY_Devices_MissedCalls)
627                                                                                A(PKEY_Devices_ModelName)
628                                                                                A(PKEY_Devices_ModelNumber)
629                                                                                A(PKEY_Devices_NetworkedTooltip)
630                                                                                A(PKEY_Devices_NetworkName)
631                                                                                A(PKEY_Devices_NetworkType)
632                                                                                A(PKEY_Devices_NewPictures)
633                                                                                A(PKEY_Devices_Notification)
634                                                                                A(PKEY_Devices_Notification_LowBattery)
635                                                                                A(PKEY_Devices_Notification_MissedCall)
636                                                                                A(PKEY_Devices_Notification_NewMessage)
637                                                                                A(PKEY_Devices_Notification_NewVoicemail)
638                                                                                A(PKEY_Devices_Notification_StorageFull)
639                                                                                A(PKEY_Devices_Notification_StorageFullLinkText)
640                                                                                A(PKEY_Devices_NotificationStore)
641                                                                                A(PKEY_Devices_IsNotWorkingProperly)
642                                                                                A(PKEY_Devices_IsPaired)
643                                                                                A(PKEY_Devices_PrimaryCategory)
644                                                                                A(PKEY_Devices_Roaming)
645                                                                                A(PKEY_Devices_SafeRemovalRequired)
646                                                                                A(PKEY_Devices_SharedTooltip)
647                                                                                A(PKEY_Devices_SignalStrength)
648                                                                                A(PKEY_Devices_Status1)
649                                                                                A(PKEY_Devices_Status2)
650                                                                                A(PKEY_Devices_StorageCapacity)
651                                                                                A(PKEY_Devices_StorageFreeSpace)
652                                                                                A(PKEY_Devices_StorageFreeSpacePercent)
653                                                                                A(PKEY_Devices_TextMessages)
654                                                                                A(PKEY_Devices_Voicemail)
655                                                                                A(PKEY_Document_ByteCount)
656                                                                                A(PKEY_Document_CharacterCount)
657                                                                                A(PKEY_Document_ClientID)
658                                                                                A(PKEY_Document_Contributor)
659                                                                                A(PKEY_Document_DateCreated)
660                                                                                A(PKEY_Document_DatePrinted)
661                                                                                A(PKEY_Document_DateSaved)
662                                                                                A(PKEY_Document_Division)
663                                                                                A(PKEY_Document_DocumentID)
664                                                                                A(PKEY_Document_HiddenSlideCount)
665                                                                                A(PKEY_Document_LastAuthor)
666                                                                                A(PKEY_Document_LineCount)
667                                                                                A(PKEY_Document_Manager)
668                                                                                A(PKEY_Document_MultimediaClipCount)
669                                                                                A(PKEY_Document_NoteCount)
670                                                                                A(PKEY_Document_PageCount)
671                                                                                A(PKEY_Document_ParagraphCount)
672                                                                                A(PKEY_Document_PresentationFormat)
673                                                                                A(PKEY_Document_RevisionNumber)
674                                                                                A(PKEY_Document_Security)
675                                                                                A(PKEY_Document_SlideCount)
676                                                                                A(PKEY_Document_Template)
677                                                                                A(PKEY_Document_TotalEditingTime)
678                                                                                A(PKEY_Document_Version)
679                                                                                A(PKEY_Document_WordCount)
680                                                                                A(PKEY_DRM_DatePlayExpires)
681                                                                                A(PKEY_DRM_DatePlayStarts)
682                                                                                A(PKEY_DRM_Description)
683                                                                                A(PKEY_DRM_IsProtected)
684                                                                                A(PKEY_DRM_PlayCount)
685                                                                                A(PKEY_GPS_Altitude)
686                                                                                A(PKEY_GPS_AltitudeDenominator)
687                                                                                A(PKEY_GPS_AltitudeNumerator)
688                                                                                A(PKEY_GPS_AltitudeRef)
689                                                                                A(PKEY_GPS_AreaInformation)
690                                                                                A(PKEY_GPS_Date)
691                                                                                A(PKEY_GPS_DestBearing)
692                                                                                A(PKEY_GPS_DestBearingDenominator)
693                                                                                A(PKEY_GPS_DestBearingNumerator)
694                                                                                A(PKEY_GPS_DestBearingRef)
695                                                                                A(PKEY_GPS_DestDistance)
696                                                                                A(PKEY_GPS_DestDistanceDenominator)
697                                                                                A(PKEY_GPS_DestDistanceNumerator)
698                                                                                A(PKEY_GPS_DestDistanceRef)
699                                                                                A(PKEY_GPS_DestLatitude)
700                                                                                A(PKEY_GPS_DestLatitudeDenominator)
701                                                                                A(PKEY_GPS_DestLatitudeNumerator)
702                                                                                A(PKEY_GPS_DestLatitudeRef)
703                                                                                A(PKEY_GPS_DestLongitude)
704                                                                                A(PKEY_GPS_DestLongitudeDenominator)
705                                                                                A(PKEY_GPS_DestLongitudeNumerator)
706                                                                                A(PKEY_GPS_DestLongitudeRef)
707                                                                                A(PKEY_GPS_Differential)
708                                                                                A(PKEY_GPS_DOP)
709                                                                                A(PKEY_GPS_DOPDenominator)
710                                                                                A(PKEY_GPS_DOPNumerator)
711                                                                                A(PKEY_GPS_ImgDirection)
712                                                                                A(PKEY_GPS_ImgDirectionDenominator)
713                                                                                A(PKEY_GPS_ImgDirectionNumerator)
714                                                                                A(PKEY_GPS_ImgDirectionRef)
715                                                                                A(PKEY_GPS_Latitude)
716                                                                                A(PKEY_GPS_LatitudeDenominator)
717                                                                                A(PKEY_GPS_LatitudeNumerator)
718                                                                                A(PKEY_GPS_LatitudeRef)
719                                                                                A(PKEY_GPS_Longitude)
720                                                                                A(PKEY_GPS_LongitudeDenominator)
721                                                                                A(PKEY_GPS_LongitudeNumerator)
722                                                                                A(PKEY_GPS_LongitudeRef)
723                                                                                A(PKEY_GPS_MapDatum)
724                                                                                A(PKEY_GPS_MeasureMode)
725                                                                                A(PKEY_GPS_ProcessingMethod)
726                                                                                A(PKEY_GPS_Satellites)
727                                                                                A(PKEY_GPS_Speed)
728                                                                                A(PKEY_GPS_SpeedDenominator)
729                                                                                A(PKEY_GPS_SpeedNumerator)
730                                                                                A(PKEY_GPS_SpeedRef)
731                                                                                A(PKEY_GPS_Status)
732                                                                                A(PKEY_GPS_Track)
733                                                                                A(PKEY_GPS_TrackDenominator)
734                                                                                A(PKEY_GPS_TrackNumerator)
735                                                                                A(PKEY_GPS_TrackRef)
736                                                                                A(PKEY_GPS_VersionID)
737                                                                                A(PKEY_Image_BitDepth)
738                                                                                A(PKEY_Image_ColorSpace)
739                                                                                A(PKEY_Image_CompressedBitsPerPixel)
740                                                                                A(PKEY_Image_CompressedBitsPerPixelDenominator)
741                                                                                A(PKEY_Image_CompressedBitsPerPixelNumerator)
742                                                                                A(PKEY_Image_Compression)
743                                                                                A(PKEY_Image_CompressionText)
744                                                                                A(PKEY_Image_Dimensions)
745                                                                                A(PKEY_Image_HorizontalResolution)
746                                                                                A(PKEY_Image_HorizontalSize)
747                                                                                A(PKEY_Image_ImageID)
748                                                                                A(PKEY_Image_ResolutionUnit)
749                                                                                A(PKEY_Image_VerticalResolution)
750                                                                                A(PKEY_Image_VerticalSize)
751                                                                                A(PKEY_Journal_Contacts)
752                                                                                A(PKEY_Journal_EntryType)
753                                                                                A(PKEY_LayoutPattern_ContentViewModeForBrowse)
754                                                                                A(PKEY_LayoutPattern_ContentViewModeForSearch)
755                                                                                A(PKEY_Link_Arguments)
756                                                                                A(PKEY_Link_Comment)
757                                                                                A(PKEY_Link_DateVisited)
758                                                                                A(PKEY_Link_Description)
759                                                                                A(PKEY_Link_Status)
760                                                                                A(PKEY_Link_TargetExtension)
761                                                                                A(PKEY_Link_TargetParsingPath)
762                                                                                A(PKEY_Link_TargetSFGAOFlags)
763                                                                                A(PKEY_Media_AuthorUrl)
764                                                                                A(PKEY_Media_AverageLevel)
765                                                                                A(PKEY_Media_ClassPrimaryID)
766                                                                                A(PKEY_Media_ClassSecondaryID)
767                                                                                A(PKEY_Media_CollectionGroupID)
768                                                                                A(PKEY_Media_CollectionID)
769                                                                                A(PKEY_Media_ContentDistributor)
770                                                                                A(PKEY_Media_ContentID)
771                                                                                A(PKEY_Media_CreatorApplication)
772                                                                                A(PKEY_Media_CreatorApplicationVersion)
773                                                                                A(PKEY_Media_DateEncoded)
774                                                                                A(PKEY_Media_DateReleased)
775                                                                                A(PKEY_Media_Duration)
776                                                                                A(PKEY_Media_DVDID)
777                                                                                A(PKEY_Media_EncodedBy)
778                                                                                A(PKEY_Media_EncodingSettings)
779                                                                                A(PKEY_Media_FrameCount)
780                                                                                A(PKEY_Media_MCDI)
781                                                                                A(PKEY_Media_MetadataContentProvider)
782                                                                                A(PKEY_Media_Producer)
783                                                                                A(PKEY_Media_PromotionUrl)
784                                                                                A(PKEY_Media_ProtectionType)
785                                                                                A(PKEY_Media_ProviderRating)
786                                                                                A(PKEY_Media_ProviderStyle)
787                                                                                A(PKEY_Media_Publisher)
788                                                                                A(PKEY_Media_SubscriptionContentId)
789                                                                                A(PKEY_Media_SubTitle)
790                                                                                A(PKEY_Media_UniqueFileIdentifier)
791                                                                                A(PKEY_Media_UserNoAutoInfo)
792                                                                                A(PKEY_Media_UserWebUrl)
793                                                                                A(PKEY_Media_Writer)
794                                                                                A(PKEY_Media_Year)
795                                                                                A(PKEY_Message_AttachmentContents)
796                                                                                A(PKEY_Message_AttachmentNames)
797                                                                                A(PKEY_Message_BccAddress)
798                                                                                A(PKEY_Message_BccName)
799                                                                                A(PKEY_Message_CcAddress)
800                                                                                A(PKEY_Message_CcName)
801                                                                                A(PKEY_Message_ConversationID)
802                                                                                A(PKEY_Message_ConversationIndex)
803                                                                                A(PKEY_Message_DateReceived)
804                                                                                A(PKEY_Message_DateSent)
805                                                                                A(PKEY_Message_Flags)
806                                                                                A(PKEY_Message_FromAddress)
807                                                                                A(PKEY_Message_FromName)
808                                                                                A(PKEY_Message_HasAttachments)
809                                                                                A(PKEY_Message_IsFwdOrReply)
810                                                                                A(PKEY_Message_MessageClass)
811                                                                                A(PKEY_Message_ProofInProgress)
812                                                                                A(PKEY_Message_SenderAddress)
813                                                                                A(PKEY_Message_SenderName)
814                                                                                A(PKEY_Message_Store)
815                                                                                A(PKEY_Message_ToAddress)
816                                                                                A(PKEY_Message_ToDoFlags)
817                                                                                A(PKEY_Message_ToDoTitle)
818                                                                                A(PKEY_Message_ToName)
819                                                                                A(PKEY_Music_AlbumArtist)
820                                                                                A(PKEY_Music_AlbumID)
821                                                                                A(PKEY_Music_AlbumTitle)
822                                                                                A(PKEY_Music_Artist)
823                                                                                A(PKEY_Music_BeatsPerMinute)
824                                                                                A(PKEY_Music_Composer)
825                                                                                A(PKEY_Music_Conductor)
826                                                                                A(PKEY_Music_ContentGroupDescription)
827                                                                                A(PKEY_Music_DisplayArtist)
828                                                                                A(PKEY_Music_Genre)
829                                                                                A(PKEY_Music_InitialKey)
830                                                                                A(PKEY_Music_IsCompilation)
831                                                                                A(PKEY_Music_Lyrics)
832                                                                                A(PKEY_Music_Mood)
833                                                                                A(PKEY_Music_PartOfSet)
834                                                                                A(PKEY_Music_Period)
835                                                                                A(PKEY_Music_SynchronizedLyrics)
836                                                                                A(PKEY_Music_TrackNumber)
837                                                                                A(PKEY_Note_Color)
838                                                                                A(PKEY_Note_ColorText)
839                                                                                A(PKEY_Photo_Aperture)
840                                                                                A(PKEY_Photo_ApertureDenominator)
841                                                                                A(PKEY_Photo_ApertureNumerator)
842                                                                                A(PKEY_Photo_Brightness)
843                                                                                A(PKEY_Photo_BrightnessDenominator)
844                                                                                A(PKEY_Photo_BrightnessNumerator)
845                                                                                A(PKEY_Photo_CameraManufacturer)
846                                                                                A(PKEY_Photo_CameraModel)
847                                                                                A(PKEY_Photo_CameraSerialNumber)
848                                                                                A(PKEY_Photo_Contrast)
849                                                                                A(PKEY_Photo_ContrastText)
850                                                                                A(PKEY_Photo_DateTaken)
851                                                                                A(PKEY_Photo_DigitalZoom)
852                                                                                A(PKEY_Photo_DigitalZoomDenominator)
853                                                                                A(PKEY_Photo_DigitalZoomNumerator)
854                                                                                A(PKEY_Photo_Event)
855                                                                                A(PKEY_Photo_EXIFVersion)
856                                                                                A(PKEY_Photo_ExposureBias)
857                                                                                A(PKEY_Photo_ExposureBiasDenominator)
858                                                                                A(PKEY_Photo_ExposureBiasNumerator)
859                                                                                A(PKEY_Photo_ExposureIndex)
860                                                                                A(PKEY_Photo_ExposureIndexDenominator)
861                                                                                A(PKEY_Photo_ExposureIndexNumerator)
862                                                                                A(PKEY_Photo_ExposureProgram)
863                                                                                A(PKEY_Photo_ExposureProgramText)
864                                                                                A(PKEY_Photo_ExposureTime)
865                                                                                A(PKEY_Photo_ExposureTimeDenominator)
866                                                                                A(PKEY_Photo_ExposureTimeNumerator)
867                                                                                A(PKEY_Photo_Flash)
868                                                                                A(PKEY_Photo_FlashEnergy)
869                                                                                A(PKEY_Photo_FlashEnergyDenominator)
870                                                                                A(PKEY_Photo_FlashEnergyNumerator)
871                                                                                A(PKEY_Photo_FlashManufacturer)
872                                                                                A(PKEY_Photo_FlashModel)
873                                                                                A(PKEY_Photo_FlashText)
874                                                                                A(PKEY_Photo_FNumber)
875                                                                                A(PKEY_Photo_FNumberDenominator)
876                                                                                A(PKEY_Photo_FNumberNumerator)
877                                                                                A(PKEY_Photo_FocalLength)
878                                                                                A(PKEY_Photo_FocalLengthDenominator)
879                                                                                A(PKEY_Photo_FocalLengthInFilm)
880                                                                                A(PKEY_Photo_FocalLengthNumerator)
881                                                                                A(PKEY_Photo_FocalPlaneXResolution)
882                                                                                A(PKEY_Photo_FocalPlaneXResolutionDenominator)
883                                                                                A(PKEY_Photo_FocalPlaneXResolutionNumerator)
884                                                                                A(PKEY_Photo_FocalPlaneYResolution)
885                                                                                A(PKEY_Photo_FocalPlaneYResolutionDenominator)
886                                                                                A(PKEY_Photo_FocalPlaneYResolutionNumerator)
887                                                                                A(PKEY_Photo_GainControl)
888                                                                                A(PKEY_Photo_GainControlDenominator)
889                                                                                A(PKEY_Photo_GainControlNumerator)
890                                                                                A(PKEY_Photo_GainControlText)
891                                                                                A(PKEY_Photo_ISOSpeed)
892                                                                                A(PKEY_Photo_LensManufacturer)
893                                                                                A(PKEY_Photo_LensModel)
894                                                                                A(PKEY_Photo_LightSource)
895                                                                                A(PKEY_Photo_MakerNote)
896                                                                                A(PKEY_Photo_MakerNoteOffset)
897                                                                                A(PKEY_Photo_MaxAperture)
898                                                                                A(PKEY_Photo_MaxApertureDenominator)
899                                                                                A(PKEY_Photo_MaxApertureNumerator)
900                                                                                A(PKEY_Photo_MeteringMode)
901                                                                                A(PKEY_Photo_MeteringModeText)
902                                                                                A(PKEY_Photo_Orientation)
903                                                                                A(PKEY_Photo_OrientationText)
904                                                                                A(PKEY_Photo_PeopleNames)
905                                                                                A(PKEY_Photo_PhotometricInterpretation)
906                                                                                A(PKEY_Photo_PhotometricInterpretationText)
907                                                                                A(PKEY_Photo_ProgramMode)
908                                                                                A(PKEY_Photo_ProgramModeText)
909                                                                                A(PKEY_Photo_RelatedSoundFile)
910                                                                                A(PKEY_Photo_Saturation)
911                                                                                A(PKEY_Photo_SaturationText)
912                                                                                A(PKEY_Photo_Sharpness)
913                                                                                A(PKEY_Photo_SharpnessText)
914                                                                                A(PKEY_Photo_ShutterSpeed)
915                                                                                A(PKEY_Photo_ShutterSpeedDenominator)
916                                                                                A(PKEY_Photo_ShutterSpeedNumerator)
917                                                                                A(PKEY_Photo_SubjectDistance)
918                                                                                A(PKEY_Photo_SubjectDistanceDenominator)
919                                                                                A(PKEY_Photo_SubjectDistanceNumerator)
920                                                                                A(PKEY_Photo_TagViewAggregate)
921                                                                                A(PKEY_Photo_TranscodedForSync)
922                                                                                A(PKEY_Photo_WhiteBalance)
923                                                                                A(PKEY_Photo_WhiteBalanceText)
924                                                                                A(PKEY_PropGroup_Advanced)
925                                                                                A(PKEY_PropGroup_Audio)
926                                                                                A(PKEY_PropGroup_Calendar)
927                                                                                A(PKEY_PropGroup_Camera)
928                                                                                A(PKEY_PropGroup_Contact)
929                                                                                A(PKEY_PropGroup_Content)
930                                                                                A(PKEY_PropGroup_Description)
931                                                                                A(PKEY_PropGroup_FileSystem)
932                                                                                A(PKEY_PropGroup_General)
933                                                                                A(PKEY_PropGroup_GPS)
934                                                                                A(PKEY_PropGroup_Image)
935                                                                                A(PKEY_PropGroup_Media)
936                                                                                A(PKEY_PropGroup_MediaAdvanced)
937                                                                                A(PKEY_PropGroup_Message)
938                                                                                A(PKEY_PropGroup_Music)
939                                                                                A(PKEY_PropGroup_Origin)
940                                                                                A(PKEY_PropGroup_PhotoAdvanced)
941                                                                                A(PKEY_PropGroup_RecordedTV)
942                                                                                A(PKEY_PropGroup_Video)
943                                                                                A(PKEY_InfoTipText)
944                                                                                A(PKEY_PropList_ConflictPrompt)
945                                                                                A(PKEY_PropList_ContentViewModeForBrowse)
946                                                                                A(PKEY_PropList_ContentViewModeForSearch)
947                                                                                A(PKEY_PropList_ExtendedTileInfo)
948                                                                                A(PKEY_PropList_FileOperationPrompt)
949                                                                                A(PKEY_PropList_FullDetails)
950                                                                                A(PKEY_PropList_InfoTip)
951                                                                                A(PKEY_PropList_NonPersonal)
952                                                                                A(PKEY_PropList_PreviewDetails)
953                                                                                A(PKEY_PropList_PreviewTitle)
954                                                                                A(PKEY_PropList_QuickTip)
955                                                                                A(PKEY_PropList_TileInfo)
956                                                                                A(PKEY_PropList_XPDetailsPanel)
957                                                                                A(PKEY_RecordedTV_ChannelNumber)
958                                                                                A(PKEY_RecordedTV_Credits)
959                                                                                A(PKEY_RecordedTV_DateContentExpires)
960                                                                                A(PKEY_RecordedTV_EpisodeName)
961                                                                                A(PKEY_RecordedTV_IsATSCContent)
962                                                                                A(PKEY_RecordedTV_IsClosedCaptioningAvailable)
963                                                                                A(PKEY_RecordedTV_IsDTVContent)
964                                                                                A(PKEY_RecordedTV_IsHDContent)
965                                                                                A(PKEY_RecordedTV_IsRepeatBroadcast)
966                                                                                A(PKEY_RecordedTV_IsSAP)
967                                                                                A(PKEY_RecordedTV_NetworkAffiliation)
968                                                                                A(PKEY_RecordedTV_OriginalBroadcastDate)
969                                                                                A(PKEY_RecordedTV_ProgramDescription)
970                                                                                A(PKEY_RecordedTV_RecordingTime)
971                                                                                A(PKEY_RecordedTV_StationCallSign)
972                                                                                A(PKEY_RecordedTV_StationName)
973                                                                                A(PKEY_Search_AutoSummary)
974                                                                                A(PKEY_Search_ContainerHash)
975                                                                                A(PKEY_Search_Contents)
976                                                                                A(PKEY_Search_EntryID)
977                                                                                A(PKEY_Search_ExtendedProperties)
978                                                                                A(PKEY_Search_GatherTime)
979                                                                                A(PKEY_Search_HitCount)
980                                                                                A(PKEY_Search_IsClosedDirectory)
981                                                                                A(PKEY_Search_IsFullyContained)
982                                                                                A(PKEY_Search_QueryFocusedSummary)
983                                                                                A(PKEY_Search_QueryFocusedSummaryWithFallback)
984                                                                                A(PKEY_Search_Rank)
985                                                                                A(PKEY_Search_Store)
986                                                                                A(PKEY_Search_UrlToIndex)
987                                                                                A(PKEY_Search_UrlToIndexWithModificationTime)
988                                                                                A(PKEY_DescriptionID)
989                                                                                A(PKEY_InternalName)
990                                                                                A(PKEY_Link_TargetSFGAOFlagsStrings)
991                                                                                A(PKEY_Link_TargetUrl)
992                                                                                A(PKEY_NamespaceCLSID)
993                                                                                A(PKEY_Shell_SFGAOFlagsStrings)
994                                                                                A(PKEY_AppUserModel_ExcludeFromShowInNewInstall)
995                                                                                A(PKEY_AppUserModel_ID)
996                                                                                A(PKEY_AppUserModel_IsDestListSeparator)
997                                                                                A(PKEY_AppUserModel_PreventPinning)
998                                                                                A(PKEY_AppUserModel_RelaunchCommand)
999                                                                                A(PKEY_AppUserModel_RelaunchDisplayNameResource)
1000                                                                                A(PKEY_AppUserModel_RelaunchIconResource)
1001                                                                                A(PKEY_Software_DateLastUsed)
1002                                                                                A(PKEY_Software_ProductName)
1003                                                                                A(PKEY_Sync_Comments)
1004                                                                                A(PKEY_Sync_ConflictDescription)
1005                                                                                A(PKEY_Sync_ConflictFirstLocation)
1006                                                                                A(PKEY_Sync_ConflictSecondLocation)
1007                                                                                A(PKEY_Sync_HandlerCollectionID)
1008                                                                                A(PKEY_Sync_HandlerID)
1009                                                                                A(PKEY_Sync_HandlerName)
1010                                                                                A(PKEY_Sync_HandlerType)
1011                                                                                A(PKEY_Sync_HandlerTypeLabel)
1012                                                                                A(PKEY_Sync_ItemID)
1013                                                                                A(PKEY_Sync_ItemName)
1014                                                                                A(PKEY_Sync_ProgressPercentage)
1015                                                                                A(PKEY_Sync_State)
1016                                                                                A(PKEY_Sync_Status)
1017                                                                                A(PKEY_Task_BillingInformation)
1018                                                                                A(PKEY_Task_CompletionStatus)
1019                                                                                A(PKEY_Task_Owner)
1020                                                                                A(PKEY_Video_Compression)
1021                                                                                A(PKEY_Video_Director)
1022                                                                                A(PKEY_Video_EncodingBitrate)
1023                                                                                A(PKEY_Video_FourCC)
1024                                                                                A(PKEY_Video_FrameHeight)
1025                                                                                A(PKEY_Video_FrameRate)
1026                                                                                A(PKEY_Video_FrameWidth)
1027                                                                                A(PKEY_Video_HorizontalAspectRatio)
1028                                                                                A(PKEY_Video_SampleSize)
1029                                                                                A(PKEY_Video_StreamName)
1030                                                                                A(PKEY_Video_StreamNumber)
1031                                                                                A(PKEY_Video_TotalBitrate)
1032                                                                                A(PKEY_Video_TranscodedForSync)
1033                                                                                A(PKEY_Video_VerticalAspectRatio)
1034                                                                                A(PKEY_Volume_FileSystem)
1035                                                                                A(PKEY_Volume_IsMappedDrive)
1036                                                                                A(PKEY_Volume_IsRoot)
1037                                                                                #pragma endregion
1038                                                                                #pragma region devpkey.h
1039                                                                                B(DEVPKEY_NAME)
1040                                                                                B(DEVPKEY_Device_DeviceDesc)
1041                                                                                B(DEVPKEY_Device_HardwareIds)
1042                                                                                B(DEVPKEY_Device_CompatibleIds)
1043                                                                                B(DEVPKEY_Device_Service)
1044                                                                                B(DEVPKEY_Device_Class)
1045                                                                                B(DEVPKEY_Device_ClassGuid)
1046                                                                                B(DEVPKEY_Device_Driver)
1047                                                                                B(DEVPKEY_Device_ConfigFlags)
1048                                                                                B(DEVPKEY_Device_Manufacturer)
1049                                                                                B(DEVPKEY_Device_FriendlyName)
1050                                                                                B(DEVPKEY_Device_LocationInfo)
1051                                                                                B(DEVPKEY_Device_PDOName)
1052                                                                                B(DEVPKEY_Device_Capabilities)
1053                                                                                B(DEVPKEY_Device_UINumber)
1054                                                                                B(DEVPKEY_Device_UpperFilters)
1055                                                                                B(DEVPKEY_Device_LowerFilters)
1056                                                                                B(DEVPKEY_Device_BusTypeGuid)
1057                                                                                B(DEVPKEY_Device_LegacyBusType)
1058                                                                                B(DEVPKEY_Device_BusNumber)
1059                                                                                B(DEVPKEY_Device_EnumeratorName)
1060                                                                                B(DEVPKEY_Device_Security)
1061                                                                                B(DEVPKEY_Device_SecuritySDS)
1062                                                                                B(DEVPKEY_Device_DevType)
1063                                                                                B(DEVPKEY_Device_Exclusive)
1064                                                                                B(DEVPKEY_Device_Characteristics)
1065                                                                                B(DEVPKEY_Device_Address)
1066                                                                                B(DEVPKEY_Device_UINumberDescFormat)
1067                                                                                B(DEVPKEY_Device_PowerData)
1068                                                                                B(DEVPKEY_Device_RemovalPolicy)
1069                                                                                B(DEVPKEY_Device_RemovalPolicyDefault)
1070                                                                                B(DEVPKEY_Device_RemovalPolicyOverride)
1071                                                                                B(DEVPKEY_Device_InstallState)
1072                                                                                B(DEVPKEY_Device_LocationPaths)
1073                                                                                B(DEVPKEY_Device_BaseContainerId)
1074                                                                                B(DEVPKEY_Device_DevNodeStatus)
1075                                                                                B(DEVPKEY_Device_ProblemCode)
1076                                                                                B(DEVPKEY_Device_EjectionRelations)
1077                                                                                B(DEVPKEY_Device_RemovalRelations)
1078                                                                                B(DEVPKEY_Device_PowerRelations)
1079                                                                                B(DEVPKEY_Device_BusRelations)
1080                                                                                B(DEVPKEY_Device_Parent)
1081                                                                                B(DEVPKEY_Device_Children)
1082                                                                                B(DEVPKEY_Device_Siblings)
1083                                                                                B(DEVPKEY_Device_TransportRelations)
1084                                                                                B(DEVPKEY_Device_Reported)
1085                                                                                B(DEVPKEY_Device_Legacy)
1086                                                                                B(DEVPKEY_Device_InstanceId)
1087                                                                                B(DEVPKEY_Device_ContainerId)
1088                                                                                B(DEVPKEY_Device_ModelId)
1089                                                                                B(DEVPKEY_Device_FriendlyNameAttributes)
1090                                                                                B(DEVPKEY_Device_ManufacturerAttributes)
1091                                                                                B(DEVPKEY_Device_PresenceNotForDevice)
1092                                                                                B(DEVPKEY_Numa_Proximity_Domain)
1093                                                                                B(DEVPKEY_Device_DHP_Rebalance_Policy)
1094                                                                                B(DEVPKEY_Device_Numa_Node)
1095                                                                                B(DEVPKEY_Device_BusReportedDeviceDesc)
1096                                                                                B(DEVPKEY_Device_SessionId)
1097                                                                                B(DEVPKEY_Device_InstallDate)
1098                                                                                B(DEVPKEY_Device_FirstInstallDate)
1099                                                                                B(DEVPKEY_Device_DriverDate)
1100                                                                                B(DEVPKEY_Device_DriverVersion)
1101                                                                                B(DEVPKEY_Device_DriverDesc)
1102                                                                                B(DEVPKEY_Device_DriverInfPath)
1103                                                                                B(DEVPKEY_Device_DriverInfSection)
1104                                                                                B(DEVPKEY_Device_DriverInfSectionExt)
1105                                                                                B(DEVPKEY_Device_MatchingDeviceId)
1106                                                                                B(DEVPKEY_Device_DriverProvider)
1107                                                                                B(DEVPKEY_Device_DriverPropPageProvider)
1108                                                                                B(DEVPKEY_Device_DriverCoInstallers)
1109                                                                                B(DEVPKEY_Device_ResourcePickerTags)
1110                                                                                B(DEVPKEY_Device_ResourcePickerExceptions)
1111                                                                                B(DEVPKEY_Device_DriverRank)
1112                                                                                B(DEVPKEY_Device_DriverLogoLevel)
1113                                                                                B(DEVPKEY_Device_NoConnectSound)
1114                                                                                B(DEVPKEY_Device_GenericDriverInstalled)
1115                                                                                B(DEVPKEY_Device_AdditionalSoftwareRequested)
1116                                                                                B(DEVPKEY_Device_SafeRemovalRequired)
1117                                                                                B(DEVPKEY_Device_SafeRemovalRequiredOverride)
1118                                                                                B(DEVPKEY_DrvPkg_Model)
1119                                                                                B(DEVPKEY_DrvPkg_VendorWebSite)
1120                                                                                B(DEVPKEY_DrvPkg_DetailedDescription)
1121                                                                                B(DEVPKEY_DrvPkg_DocumentationLink)
1122                                                                                B(DEVPKEY_DrvPkg_Icon)
1123                                                                                B(DEVPKEY_DrvPkg_BrandingIcon)
1124                                                                                B(DEVPKEY_DeviceClass_UpperFilters)
1125                                                                                B(DEVPKEY_DeviceClass_LowerFilters)
1126                                                                                B(DEVPKEY_DeviceClass_Security)
1127                                                                                B(DEVPKEY_DeviceClass_SecuritySDS)
1128                                                                                B(DEVPKEY_DeviceClass_DevType)
1129                                                                                B(DEVPKEY_DeviceClass_Exclusive)
1130                                                                                B(DEVPKEY_DeviceClass_Characteristics)
1131                                                                                B(DEVPKEY_DeviceClass_Name)
1132                                                                                B(DEVPKEY_DeviceClass_ClassName)
1133                                                                                B(DEVPKEY_DeviceClass_Icon)
1134                                                                                B(DEVPKEY_DeviceClass_ClassInstaller)
1135                                                                                B(DEVPKEY_DeviceClass_PropPageProvider)
1136                                                                                B(DEVPKEY_DeviceClass_NoInstallClass)
1137                                                                                B(DEVPKEY_DeviceClass_NoDisplayClass)
1138                                                                                B(DEVPKEY_DeviceClass_SilentInstall)
1139                                                                                B(DEVPKEY_DeviceClass_NoUseClass)
1140                                                                                B(DEVPKEY_DeviceClass_DefaultService)
1141                                                                                B(DEVPKEY_DeviceClass_IconPath)
1142                                                                                B(DEVPKEY_DeviceClass_DHPRebalanceOptOut)
1143                                                                                B(DEVPKEY_DeviceClass_ClassCoInstallers)
1144                                                                                B(DEVPKEY_DeviceInterface_FriendlyName)
1145                                                                                B(DEVPKEY_DeviceInterface_Enabled)
1146                                                                                B(DEVPKEY_DeviceInterface_ClassGuid)
1147                                                                                B(DEVPKEY_DeviceInterfaceClass_DefaultInterface)
1148                                                                                B(DEVPKEY_DeviceDisplay_IsShowInDisconnectedState)
1149                                                                                B(DEVPKEY_DeviceDisplay_IsNotInterestingForDisplay)
1150                                                                                B(DEVPKEY_DeviceDisplay_Category)
1151                                                                                B(DEVPKEY_DeviceDisplay_UnpairUninstall)
1152                                                                                B(DEVPKEY_DeviceDisplay_RequiresUninstallElevation)
1153                                                                                B(DEVPKEY_DeviceDisplay_AlwaysShowDeviceAsConnected)
1154                                                                                #pragma endregion
1155                                                                        };
1156                                                                        #undef A
1157                                                                        #undef B
1158                                                                        #pragma endregion
1159                                                                        for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++)
1160                                                                                if(g_pMap[nIndex].pKey->fmtid == Key.fmtid && g_pMap[nIndex].pKey->pid == Key.pid)
1161                                                                                {
1162                                                                                        sKeyName = CA2CT(g_pMap[nIndex].pszName);
1163                                                                                        break;
1164                                                                                }
1165                                                                        if(sKeyName.IsEmpty())
1166                                                                                sKeyName = AtlFormatString(_T("%ls, %d"), _PersistHelper::StringFromIdentifier(Key.fmtid), Key.pid);
1167                                                                        #pragma region String Value
1168                                                                        CString sValue;
1169                                                                        HRESULT nChangeTypeResult = E_FAIL;
1170                                                                        // NOTE: See http://msdn.microsoft.com/en-us/library/cc235506%28v=prot.10%29.aspx
1171                                                                        switch(Value.vt)
1172                                                                        {
1173                                                                        case VT_LPSTR:
1174                                                                                sValue = CA2CT(Value.pszVal);
1175                                                                                nChangeTypeResult = S_OK;
1176                                                                                break;
1177                                                                        case VT_LPWSTR:
1178                                                                                sValue = CW2CT(Value.pwszVal);
1179                                                                                nChangeTypeResult = S_OK;
1180                                                                                break;
1181                                                                        case VT_BLOB:
1182                                                                                sValue = AtlFormatString(_T("%d bytes of BLOB"), Value.blob.cbSize);
1183                                                                                if(Value.blob.cbSize)
1184                                                                                {
1185                                                                                        sValue += _T(", ");
1186                                                                                        CRoArrayT<CString> Array;
1187                                                                                        static const SIZE_T g_nMaximalSize = 128;
1188                                                                                        if(Value.blob.cbSize <= g_nMaximalSize)
1189                                                                                        {
1190                                                                                                for(ULONG nIndex = 0; nIndex < Value.blob.cbSize; nIndex++)
1191                                                                                                        _W(Array.Add(AtlFormatString(_T("%02X"), Value.blob.pBlobData[nIndex])) >= 0);
1192                                                                                        } else
1193                                                                                        {
1194                                                                                                for(ULONG nIndex = 0; nIndex < g_nMaximalSize - 8; nIndex++)
1195                                                                                                        _W(Array.Add(AtlFormatString(_T("%02X"), Value.blob.pBlobData[nIndex])) >= 0);
1196                                                                                                _W(Array.Add(_T("...")) >= 0);
1197                                                                                                for(ULONG nIndex = 0; nIndex < 4; nIndex++)
1198                                                                                                        _W(Array.Add(AtlFormatString(_T("%02X"), Value.blob.pBlobData[Value.blob.cbSize - 4 + nIndex])) >= 0);
1199                                                                                        }
1200                                                                                        sValue += _StringHelper::Join(Array, _T(" "));
1201                                                                                }
1202                                                                                nChangeTypeResult = S_OK;
1203                                                                                break;
1204                                                                        case VT_CLSID:
1205                                                                                sValue = CW2CT(_PersistHelper::StringFromIdentifier(*Value.puuid));
1206                                                                                nChangeTypeResult = S_OK;
1207                                                                                break;
1208                                                                        }
1209                                                                        #pragma region Variant as String
1210                                                                        CComVariant vValue;
1211                                                                        if(FAILED(nChangeTypeResult))
1212                                                                        {
1213                                                                                nChangeTypeResult = vValue.ChangeType(VT_BSTR, &reinterpret_cast<VARIANT&>(Value));
1214                                                                                if(SUCCEEDED(nChangeTypeResult))
1215                                                                                        sValue = CW2CT(vValue.bstrVal);
1216                                                                                else
1217                                                                                        sValue = _T("???");
1218                                                                        }
1219                                                                        #pragma endregion
1220                                                                        #pragma endregion
1221                                                                        #pragma region Variant Type
1222                                                                        static const CEnumerationNameT<VARTYPE> g_pVarTypeMap[] = 
1223                                                                        {
1224                                                                                #define A(x) { x, #x },
1225                                                                                A(VT_EMPTY)
1226                                                                                A(VT_NULL)
1227                                                                                A(VT_I2)
1228                                                                                A(VT_I4)
1229                                                                                A(VT_R4)
1230                                                                                A(VT_R8)
1231                                                                                A(VT_CY)
1232                                                                                A(VT_DATE)
1233                                                                                A(VT_BSTR)
1234                                                                                A(VT_DISPATCH)
1235                                                                                A(VT_ERROR)
1236                                                                                A(VT_BOOL)
1237                                                                                A(VT_VARIANT)
1238                                                                                A(VT_UNKNOWN)
1239                                                                                A(VT_DECIMAL)
1240                                                                                A(VT_I1)
1241                                                                                A(VT_UI1)
1242                                                                                A(VT_UI2)
1243                                                                                A(VT_UI4)
1244                                                                                A(VT_I8)
1245                                                                                A(VT_UI8)
1246                                                                                A(VT_INT)
1247                                                                                A(VT_UINT)
1248                                                                                A(VT_VOID)
1249                                                                                A(VT_HRESULT)
1250                                                                                A(VT_PTR)
1251                                                                                A(VT_SAFEARRAY)
1252                                                                                A(VT_CARRAY)
1253                                                                                A(VT_USERDEFINED)
1254                                                                                A(VT_LPSTR)
1255                                                                                A(VT_LPWSTR)
1256                                                                                A(VT_RECORD)
1257                                                                                A(VT_INT_PTR)
1258                                                                                A(VT_UINT_PTR)
1259                                                                                A(VT_FILETIME)
1260                                                                                A(VT_BLOB)
1261                                                                                A(VT_STREAM)
1262                                                                                A(VT_STORAGE)
1263                                                                                A(VT_STREAMED_OBJECT)
1264                                                                                A(VT_STORED_OBJECT)
1265                                                                                A(VT_BLOB_OBJECT)
1266                                                                                A(VT_CF)
1267                                                                                A(VT_CLSID)
1268                                                                                A(VT_VERSIONED_STREAM)
1269                                                                                #undef A
1270                                                                        };
1271                                                                        #pragma endregion
1272                                                                        #pragma region Detail
1273                                                                        CString sDetail;
1274                                                                        if(Key == PKEY_AudioEndpoint_FormFactor && Value.vt == VT_UI4)
1275                                                                        {
1276                                                                                static const CEnumerationNameT<UINT32> g_pMap[] = 
1277                                                                                {
1278                                                                                        #define A(x) { x, #x },
1279                                                                                        A(RemoteNetworkDevice)
1280                                                                                        A(Speakers)
1281                                                                                        A(LineLevel)
1282                                                                                        A(Headphones)
1283                                                                                        A(Microphone)
1284                                                                                        A(Headset)
1285                                                                                        A(Handset)
1286                                                                                        A(UnknownDigitalPassthrough)
1287                                                                                        A(SPDIF)
1288                                                                                        A(DigitalAudioDisplayDevice)
1289                                                                                        A(UnknownFormFactor)
1290                                                                                        #undef A
1291                                                                                };
1292                                                                                sDetail = FormatEnumerationT(g_pMap, Value.uintVal);
1293                                                                        } else
1294                                                                        if(IsWaveFormatExKey(Key) && Value.vt == VT_BLOB && Value.blob.cbSize >= sizeof (WAVEFORMATEX))
1295                                                                        {
1296                                                                                const WAVEFORMATEX* pWaveFormatEx = (const WAVEFORMATEX*) Value.blob.pBlobData;
1297                                                                                CRoArrayT<CString> Array;
1298                                                                                Array.Add(AtlFormatString(_T("wFormatTag 0x%02X"), pWaveFormatEx->wFormatTag));
1299                                                                                Array.Add(AtlFormatString(_T("nChannels %d"), pWaveFormatEx->nChannels));
1300                                                                                Array.Add(AtlFormatString(_T("nSamplesPerSec %d"), pWaveFormatEx->nSamplesPerSec));
1301                                                                                Array.Add(AtlFormatString(_T("nAvgBytesPerSec %d"), pWaveFormatEx->nAvgBytesPerSec));
1302                                                                                Array.Add(AtlFormatString(_T("nBlockAlign %d"), pWaveFormatEx->nBlockAlign));
1303                                                                                Array.Add(AtlFormatString(_T("wBitsPerSample %d"), pWaveFormatEx->wBitsPerSample));
1304                                                                                Array.Add(AtlFormatString(_T("cbSize %d"), pWaveFormatEx->cbSize));
1305                                                                                if(Value.blob.cbSize >= sizeof (WAVEFORMATEXTENSIBLE) && pWaveFormatEx->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
1306                                                                                {
1307                                                                                        const WAVEFORMATEXTENSIBLE* pWaveFormatExtensible = (const WAVEFORMATEXTENSIBLE*) pWaveFormatEx;
1308                                                                                        Array.Add(AtlFormatString(_T("wValidBitsPerSample %d"), pWaveFormatExtensible->Samples.wValidBitsPerSample));
1309                                                                                        Array.Add(AtlFormatString(_T("dwChannelMask 0x%02X"), pWaveFormatExtensible->dwChannelMask));
1310                                                                                        Array.Add(AtlFormatString(_T("SubFormat %ls"), _PersistHelper::StringFromIdentifier(pWaveFormatExtensible->SubFormat)));
1311                                                                                }
1312                                                                                sDetail = _StringHelper::Join(Array, _T("; "));
1313                                                                        }
1314                                                                        #pragma endregion
1315                                                                        sText.Append(_StringHelper::Join<CString>(6, _T("\t"), 
1316                                                                                _T(""),
1317                                                                                _T(""),
1318                                                                                sKeyName, 
1319                                                                                sValue,
1320                                                                                FormatEnumerationT(g_pVarTypeMap, Value.vt),
1321                                                                                sDetail,
1322                                                                                0) + _T("\r\n"));
1323                                                                }
1324                                                                _ATLCATCHALL()
1325                                                                {
1326                                                                        _V(PropVariantClear(&Value));
1327                                                                        _ATLRETHROW;
1328                                                                }
1329                                                                __C(PropVariantClear(&Value));
1330                                                        }
1331                                                        _ATLCATCH(Exception)
1332                                                        {
1333                                                                _Z_ATLEXCEPTION(Exception);
1334                                                                sText.AppendFormat(_T("\t\t") _T("Error 0x%08X\r\n"), (HRESULT) Exception);
1335                                                        }
1336                                                #pragma endregion
1337                                        }
1338                                        _ATLCATCH(Exception)
1339                                        {
1340                                                _Z_ATLEXCEPTION(Exception);
1341                                                sText.AppendFormat(_T("\t") _T("Error 0x%08X\r\n"), (HRESULT) Exception);
1342                                        }
1343                        }
1344                        _ATLCATCH(Exception)
1345                        {
1346                                _Z_ATLEXCEPTION(Exception);
1347                                sText.AppendFormat(_T("Error 0x%08X\r\n"), (HRESULT) Exception);
1348                        }
1349                        #pragma endregion
1350                        m_TextEdit = GetDlgItem(IDC_TEXT);
1351                        m_TextEdit.SetValue(sText);
1352                }
1353                _ATLCATCHALL()
1354                {
1355                        _Z_EXCEPTION();
1356                }
1357                return TRUE;
1358        }
1359        LRESULT OnSysCommand(UINT nCommand, CPoint)
1360        {
1361                switch(nCommand)
1362                {
1363                case ID_APP_ABOUT:
1364                        {
1365                                CAboutDialog Dialog;
1366                                Dialog.DoModal(m_hWnd);
1367                        }
1368                        break;
1369                default:
1370                        SetMsgHandled(FALSE);
1371                }
1372                return 0;
1373        }
1374        LRESULT OnCommand(UINT, INT nIdentifier, HWND)
1375        {
1376                _W(EndDialog(nIdentifier));
1377                return 0;
1378        }
1379};
Note: See TracBrowser for help on using the repository browser.