Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2757 lines
91 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994-2000.
  5. //
  6. // File: PLIST.CXX
  7. //
  8. // Contents: CPropertyList methods
  9. // Responsible for parsing and managing the friendly name file.
  10. //
  11. // History: 17-May-94 t-jeffc Created.
  12. //
  13. //----------------------------------------------------------------------------
  14. #include <pch.cxx>
  15. #pragma hdrstop
  16. #include <shlguid.h>
  17. #include <ciguid.hxx>
  18. #include <nntpprop.hxx>
  19. // regulates access to the global file prop list.
  20. extern CStaticMutexSem g_mtxFilePropList;
  21. // regulates access to prop list iterators.
  22. CStaticMutexSem g_mtxPropListIter;
  23. // The 'friendly name file' is parsed on a line by line basis. The property
  24. // specification are in the [Names] section of the file.
  25. //
  26. // Each line must have the following form:
  27. //
  28. // FriendlyName [ "(" [ TypeWidthSpec ] ")" ] ["="] PropertySetGuid PropertySpec
  29. //
  30. // where:
  31. // FriendlyName - a whitespace delimited 'friendly' name for the property
  32. // TypeWidthSpec - one of:
  33. // DBTYPE_Type
  34. // Width
  35. // Type "," Width
  36. // where Type is a string specifying the property type
  37. // for comparison purposes, and Width is an integer
  38. // specifying the display field width
  39. // PropertySetGuid - a guid in the standard form
  40. // PropertySpec - either a property name or PropID
  41. //
  42. // Blank lines are allowed, and comments are recognized as any line with "#"
  43. // as the first non-whitespace character.
  44. //
  45. // (also note that the "=" above is optional, but I think it looks nice...)
  46. #ifndef PIDISI_FILETYPE
  47. #define PIDISI_FILETYPE 0x00000002L // VT_LPWSTR
  48. #define PIDISI_CX 0x00000003L // VT_UI4
  49. #define PIDISI_CY 0x00000004L // VT_UI4
  50. #define PIDISI_RESOLUTIONX 0x00000005L // VT_UI4
  51. #define PIDISI_RESOLUTIONY 0x00000006L // VT_UI4
  52. #define PIDISI_BITDEPTH 0x00000007L // VT_UI4
  53. #define PIDISI_COLORSPACE 0x00000008L // VT_LPWSTR
  54. #define PIDISI_COMPRESSION 0x00000009L // VT_LPWSTR
  55. #define PIDISI_TRANSPARENCY 0x0000000AL // VT_UI4
  56. #define PIDISI_GAMMAVALUE 0x0000000BL // VT_UI4
  57. #define PIDISI_FRAMECOUNT 0x0000000CL // VT_UI4
  58. #define PIDISI_DIMENSIONS 0x0000000DL // VT_LPWSTR
  59. #endif
  60. #ifndef PSGUID_FlashPix
  61. #define PSGUID_FlashPix { 0x56616500L, 0xC154, 0x11CE, 0x85, 0x53, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x5B }
  62. #define PID_File_source 0x21000000 // VT_UI4: File source
  63. #define PID_Scene_type 0x21000001 // VT_UI4: Scene type
  64. #define PID_Creation_path_vector 0x21000002 // VT_UI4 | VT_VECTOR: Creation path vector
  65. #define PID_Software_Name_Manufacturer_Release 0x21000003 // VT_LPWSTR: Software Name/Manufacturer/Release
  66. #define PID_User_defined_ID 0x21000004 // VT_LPWSTR: User defined ID
  67. #define PID_Sharpness_approximation 0x21000005 // VT_R4: Sharpness approximation
  68. #define PID_Copyright_message 0x22000000 // VT_LPWSTR: Copyright message
  69. #define PID_Legal_broker_for_the_original_image 0x22000001 // VT_LPWSTR: Legal broker for the original image
  70. #define PID_Legal_broker_for_the_digital_image 0x22000002 // VT_LPWSTR: Legal broker for the digital image
  71. #define PID_Authorship 0x22000003 // VT_LPWSTR: Authorship
  72. #define PID_Intellectual_property_notes 0x22000004 // VT_LPWSTR: Intellectual property notes
  73. #define PID_Test_target_in_the_image 0x23000000 // VT_UI4: Test target in the image
  74. #define PID_Group_caption 0x23000002 // VT_LPWSTR: Group caption
  75. #define PID_Caption_text 0x23000003 // VT_LPWSTR: Caption text
  76. #define PID_People_in_the_image 0x23000004 // VT_LPWSTR | VT_VECTOR
  77. #define PID_Things_in_the_image 0x23000007 // VT_LPWSTR | VT_VECTOR
  78. #define PID_Date_of_the_original_image 0x2300000A // VT_FILETIME
  79. #define PID_Events_in_the_image 0x2300000B // VT_LPWSTR | VT_VECTOR
  80. #define PID_Places_in_the_image 0x2300000C // VT_LPWSTR | VT_VECTOR
  81. #define PID_Content_description_notes 0x2300000F // VT_LPWSTR: Content description notes
  82. #define PID_Camera_manufacturer_name 0x24000000 // VT_LPWSTR: Camera manufacturer name
  83. #define PID_Camera_model_name 0x24000001 // VT_LPWSTR: Camera model name
  84. #define PID_Camera_serial_number 0x24000002 // VT_LPWSTR: Camera serial number
  85. #define PID_Capture_date 0x25000000 // VT_FILETIME: Capture date
  86. #define PID_Exposure_time 0x25000001 // VT_R4: Exposure time
  87. #define PID_F_number 0x25000002 // VT_R4: F-number
  88. #define PID_Exposure_program 0x25000003 // VT_UI4: Exposure program
  89. #define PID_Brightness_value 0x25000004 // VT_R4 | VT_VECTOR
  90. #define PID_Exposure_bias_value 0x25000005 // VT_R4: Exposure bias value
  91. #define PID_Subject_distance 0x25000006 // VT_R4 | VT_VECTOR
  92. #define PID_Metering_mode 0x25000007 // VT_UI4: Metering mode
  93. #define PID_Scene_illuminant 0x25000008 // VT_UI4: Scene illuminant
  94. #define PID_Focal_length 0x25000009 // VT_R4: Focal length
  95. #define PID_Maximum_aperture_value 0x2500000A // VT_R4: Maximum aperture value
  96. #define PID_Flash 0x2500000B // VT_UI4: Flash
  97. #define PID_Flash_energy 0x2500000C // VT_R4: Flash energy
  98. #define PID_Flash_return 0x2500000D // VT_UI4: Flash return
  99. #define PID_Back_light 0x2500000E // VT_UI4: Back light
  100. #define PID_Subject_location 0x2500000F // VT_R4 | VT_VECTOR
  101. #define PID_Exposure_index 0x25000010 // VT_R4: Exposure index
  102. #define PID_Special_effects_optical_filter 0x25000011 // VT_UI4 | VT_VECTOR
  103. #define PID_Per_picture_notes 0x25000012 // VT_LPWSTR: Per picture notes
  104. #define PID_Sensing_method 0x26000000 // VT_UI4: Sensing method
  105. #define PID_Focal_plane_X_resolution 0x26000001 // VT_R4: Focal plane X resolution
  106. #define PID_Focal_plane_Y_resolution 0x26000002 // VT_R4: Focal plane Y resolution
  107. #define PID_Focal_plane_resolution_unit 0x26000003 // VT_UI4: Focal plane resolution unit
  108. #define PID_Spatial_frequency_response 0x26000004 // VT_VARIANT | VT_VECTOR
  109. #define PID_CFA_pattern 0x26000005 // VT_VARIANT | VT_VECTOR
  110. #define PID_Spectral_sensitivity 0x26000006 // VT_LPWSTR: Spectral sensitivity
  111. #define PID_ISO_speed_ratings 0x26000007 // VT_UI2 | VT_VECTOR
  112. #define PID_OECF 0x26000008 // VT_VARIANT | VT_VECTOR: OECF
  113. #define PID_Film_brand 0x27000000 // VT_LPWSTR: Film brand
  114. #define PID_Film_category 0x27000001 // VT_UI4: Film category
  115. #define PID_Film_size 0x27000002 // VT_VARIANT | VT_VECTOR: Film size
  116. #define PID_Film_roll_number 0x27000003 // VT_UI4: Film roll number
  117. #define PID_Film_frame_number 0x27000004 // VT_UI4: Film frame number
  118. #define PID_Original_scanned_image_size 0x29000000 // VT_VARIANT | VT_VECTOR: Original scanned image size
  119. #define PID_Original_document_size 0x29000001 // VT_VARIANT | VT_VECTOR: Original document size
  120. #define PID_Original_medium 0x29000002 // VT_UI4: Original medium
  121. #define PID_Type_of_original 0x29000003 // VT_UI4: Type of original
  122. #define PID_Scanner_manufacturer_name 0x28000000 // VT_LPWSTR: Scanner manufacturer name
  123. #define PID_Scanner_model_name 0x28000001 // VT_LPWSTR: Scanner model name
  124. #define PID_Scanner_serial_number 0x28000002 // VT_LPWSTR: Scanner serial number
  125. #define PID_Scan_software 0x28000003 // VT_LPWSTR: Scan software
  126. #define PID_Scan_software_revision_date 0x28000004 // VT_DATE: Scan software revision date
  127. #define PID_Service_bureau_organization_name 0x28000005 // VT_LPWSTR: Service bureau/organization name
  128. #define PID_Scan_operator_ID 0x28000006 // VT_LPWSTR: Scan operator ID
  129. #define PID_Scan_date 0x28000008 // VT_FILETIME: Scan date
  130. #define PID_Last_modified_date 0x28000009 // VT_FILETIME: Last modified date
  131. #define PID_Scanner_pixel_size 0x2800000A // VT_R4: Scanner pixel size
  132. #endif // PIDISI_FILETYPE
  133. //+-------------------------------------------------------------------------
  134. //
  135. // Function: HashFun
  136. //
  137. // Arguments: [pwcName] -- string to hash
  138. //
  139. // History: 26-Aug-97 KrishnaN Added this nifty comment block.
  140. //
  141. // Notes: Hash function #1 from tplist.cxx
  142. //
  143. //--------------------------------------------------------------------------
  144. ULONG HashFun( WCHAR const * pwcName )
  145. {
  146. WCHAR const *pwcStart = pwcName;
  147. ULONG ulHash = 0;
  148. while ( 0 != *pwcName )
  149. {
  150. ulHash <<= 1;
  151. ulHash += *pwcName;
  152. pwcName++;
  153. }
  154. ulHash <<= 1;
  155. ulHash += CiPtrToUlong( pwcName - pwcStart );
  156. return ulHash;
  157. } //HashFun
  158. // strings corresponding to the property type enum in plist.hxx
  159. struct PropertyTypeArrayEntry
  160. {
  161. WCHAR * wcsTypeName;
  162. DBTYPE dbType;
  163. };
  164. // Ordered by expected frequency
  165. static const PropertyTypeArrayEntry parseTypes[] =
  166. {
  167. { L"DBTYPE_WSTR", DBTYPE_WSTR }, // wide null terminated string
  168. { L"DBTYPE_BYREF", DBTYPE_BYREF }, // a pointer
  169. { L"VT_FILETIME", VT_FILETIME }, // I8 filetime
  170. { L"DBTYPE_FILETIME", DBTYPE_FILETIME }, // I8 filetime
  171. { L"DBTYPE_BSTR", DBTYPE_BSTR }, // a BSTR
  172. { L"DBTYPE_STR", DBTYPE_STR }, // null terminated string
  173. { L"DBTYPE_I4", DBTYPE_I4 }, // 4 byte signed int
  174. { L"DBTYPE_UI4", DBTYPE_UI4 }, // 4 byte unsigned int
  175. { L"DBTYPE_I8", DBTYPE_I8 }, // 8 byte signed int
  176. { L"DBTYPE_UI8", DBTYPE_UI8 }, // 8 byte unsigned int
  177. { L"DBTYPE_I1", DBTYPE_I1 }, // signed char
  178. { L"DBTYPE_UI1", DBTYPE_UI1 }, // unsigned char
  179. { L"DBTYPE_I2", DBTYPE_I2 }, // 2 byte signed int
  180. { L"DBTYPE_UI2", DBTYPE_UI2 }, // 2 byte unsigned int
  181. { L"DBTYPE_R4", DBTYPE_R4 }, // 4 byte float
  182. { L"DBTYPE_R8", DBTYPE_R8 }, // 8 byte float
  183. { L"DBTYPE_CY", DBTYPE_CY }, // currency (LONG_LONG)
  184. { L"DBTYPE_DATE", DBTYPE_DATE }, // date (double)
  185. { L"DBTYPE_BOOL", DBTYPE_BOOL }, // BOOL (true=-1, false=0)
  186. { L"DBTYPE_GUID", DBTYPE_GUID }, // a guid
  187. { L"DBTYPE_VECTOR", DBTYPE_VECTOR }, // a vector
  188. { L"DBTYPE_ERROR", DBTYPE_ERROR }, // an error
  189. { L"DBTYPE_DECIMAL", DBTYPE_DECIMAL }, // decimal
  190. // { L"DBTYPE_ARRAY" , DBTYPE_ARRAY }, // an array
  191. };
  192. unsigned cParseTypes = sizeof parseTypes / sizeof parseTypes[0];
  193. WCHAR const * CEmptyPropertyList::GetPropTypeName( unsigned i )
  194. {
  195. Win4Assert( i < GetPropTypeCount() );
  196. return parseTypes[i].wcsTypeName;
  197. }
  198. DBTYPE CEmptyPropertyList::GetPropType( unsigned i )
  199. {
  200. Win4Assert( i < GetPropTypeCount() );
  201. return parseTypes[i].dbType;
  202. }
  203. unsigned CEmptyPropertyList::GetPropTypeCount()
  204. {
  205. return cParseTypes;
  206. }
  207. //+-------------------------------------------------------------------------
  208. //
  209. // Function: FindPropType
  210. //
  211. // Arguments: [wcsType] -- string name to lookup.
  212. //
  213. // Returns: Index into the parseTypes array or ULONG_MAX if not found.
  214. //
  215. // History: 26-Aug-97 KrishnaN Added this nifty comment block.
  216. //
  217. //--------------------------------------------------------------------------
  218. unsigned FindPropType( WCHAR const * wcsType )
  219. {
  220. for ( unsigned i = 0; i < cParseTypes; i++ )
  221. if ( !wcscmp( parseTypes[i].wcsTypeName, wcsType ) )
  222. return i;
  223. return ULONG_MAX;
  224. }
  225. //+-------------------------------------------------------------------------
  226. //
  227. // Member: CEmptyPropertyList::QueryInterface, public
  228. //
  229. // Arguments: [ifid] -- Interface id
  230. // [ppiuk] -- Interface return pointer
  231. //
  232. // History: 26-Aug-97 KrishnaN Created
  233. //
  234. //--------------------------------------------------------------------------
  235. STDMETHODIMP CEmptyPropertyList::QueryInterface( REFIID ifid, void ** ppiuk )
  236. {
  237. if (0 == ppiuk)
  238. return E_INVALIDARG;
  239. if (IID_IColumnMapper == ifid )
  240. {
  241. *ppiuk = (void *)((IColumnMapper *)this);
  242. }
  243. else if ( IID_IUnknown == ifid )
  244. {
  245. *ppiuk = (void *)((IUnknown *)this);
  246. }
  247. else
  248. {
  249. *ppiuk = 0;
  250. return E_NOINTERFACE;
  251. }
  252. AddRef();
  253. return S_OK;
  254. }
  255. //+-------------------------------------------------------------------------
  256. //
  257. // Member: CEmptyPropertyList::AddRef, public
  258. //
  259. // Synopsis: Reference the virtual table.
  260. //
  261. // History: 26-Aug-97 KrishnaN Created
  262. //
  263. //--------------------------------------------------------------------------
  264. STDMETHODIMP_(ULONG) CEmptyPropertyList::AddRef(void)
  265. {
  266. return InterlockedIncrement( &_cRefs );
  267. }
  268. //+-------------------------------------------------------------------------
  269. //
  270. // Member: CEmptyPropertyList::Release, public
  271. //
  272. // Synopsis: De-Reference the virtual table.
  273. //
  274. // Effects: If the ref count goes to 0 then the table is deleted.
  275. //
  276. // History: 26-Aug-97 KrishnaN Created
  277. //
  278. //--------------------------------------------------------------------------
  279. STDMETHODIMP_(ULONG) CEmptyPropertyList::Release(void)
  280. {
  281. unsigned long uTmp;
  282. //
  283. // We need to manage the global prop list file ptr to ensure that
  284. // concurrently running queries use the same instance, but the
  285. // ptr gets deleted when the last of the concurrent queries releases
  286. // the global ptr.
  287. //
  288. {
  289. CLock lock(g_mtxFilePropList);
  290. uTmp = InterlockedDecrement( &_cRefs );
  291. // At this point, no one else should be mucking with _cRefs. The AddRef
  292. // we do happens under g_mtxFilePropList, so we are fine!
  293. if (0 == uTmp && CLocalGlobalPropertyList::_pGlobalPropListFile == this)
  294. {
  295. //
  296. // If this is the last instance of the global prop list, set the
  297. // global pointer to 0 before deleting it.
  298. //
  299. CLocalGlobalPropertyList::_pGlobalPropListFile = 0;
  300. }
  301. }
  302. if (0 == uTmp)
  303. {
  304. Win4Assert(CLocalGlobalPropertyList::_pGlobalPropListFile != this);
  305. delete this;
  306. }
  307. return(uTmp);
  308. }
  309. //
  310. // IColumnMapper methods
  311. //
  312. //+-------------------------------------------------------------------------
  313. //
  314. // Member: CEmptyPropertyList::GetPropInfoFromName, public
  315. //
  316. // Synopsis: Get property info. from name.
  317. //
  318. // Parameters: [wcsPropName] -- Property name to look up.
  319. // [ppPropId] -- Ptr to return Id of the property.
  320. // [pPropType] -- Ptr to return type of the property.
  321. // [puiWidth] -- Ptr to return property width.
  322. //
  323. // History: 26-Aug-97 KrishnaN Created
  324. //
  325. //--------------------------------------------------------------------------
  326. SCODE CEmptyPropertyList::GetPropInfoFromName(const WCHAR *wcsPropName,
  327. DBID * *ppPropId,
  328. DBTYPE *pPropType,
  329. unsigned int *puiWidth)
  330. {
  331. //
  332. // Callers can pass in 0 for pPropType and puiWidth if they
  333. // don't care about them.
  334. //
  335. if (0 == wcsPropName || 0 == ppPropId)
  336. return E_INVALIDARG;
  337. BOOL fSuccess = GetPropInfo(wcsPropName, (CDbColId **)ppPropId, pPropType, puiWidth);
  338. return fSuccess ? S_OK : E_FAIL;
  339. }
  340. //+-------------------------------------------------------------------------
  341. //
  342. // Member: CEmptyPropertyList::GetPropInfoFromId, public
  343. //
  344. // Synopsis: Get property info. from dbid.
  345. //
  346. // Parameters: [pPropId] -- Ptr to prop to look up.
  347. // [pwcsName] -- Ptr to return property name.
  348. // [pPropType] -- Ptr to return type of the property.
  349. // [puiWidth] -- Ptr to return property width.
  350. //
  351. // History: 26-Aug-97 KrishnaN Created
  352. //
  353. //--------------------------------------------------------------------------
  354. SCODE CEmptyPropertyList::GetPropInfoFromId(const DBID *pPropId,
  355. WCHAR * *pwcsName,
  356. DBTYPE *pPropType,
  357. unsigned int *puiWidth)
  358. {
  359. //
  360. // Callers can pass in 0 for pPropType and puiWidth if they
  361. // don't care about them.
  362. //
  363. if (0 == pwcsName || 0 == pPropId)
  364. return E_INVALIDARG;
  365. BOOL fSuccess = GetPropInfo((CDbColId const &)*pPropId,
  366. (WCHAR const **)pwcsName,
  367. pPropType,
  368. puiWidth);
  369. return fSuccess ? S_OK : E_FAIL;
  370. }
  371. //+-------------------------------------------------------------------------
  372. //
  373. // Member: CEmptyPropertyList::EnumPropInfo, public
  374. //
  375. // Synopsis: Gets the i-th entry from the list of properties.
  376. //
  377. // Parameters: [iEntry] -- i-th entry to retrieve (0-based).
  378. // [pwcsName] -- Ptr to return property name.
  379. // [ppPropId] -- Ptr to return Id of the property.
  380. // [pPropType] -- Ptr to return type of the property.
  381. // [puiWidth] -- Ptr to return property width.
  382. //
  383. // Notes: A single global mutex is used for interlocking. It's just not
  384. // worth it to have a CRITICAL_SECTION in each CEmptyPropertyList.
  385. //
  386. // History: 26-Aug-97 KrishnaN Created
  387. //
  388. //--------------------------------------------------------------------------
  389. SCODE CEmptyPropertyList::EnumPropInfo(ULONG iEntry,
  390. const WCHAR * *pwcsName,
  391. DBID * *ppPropId,
  392. DBTYPE *pPropType,
  393. unsigned int *puiWidth)
  394. {
  395. CLock lock(g_mtxPropListIter);
  396. //
  397. // Callers can pass in 0 for pPropType and puiWidth if they
  398. // don't care about them.
  399. //
  400. if (0 == pwcsName || 0 == ppPropId)
  401. return E_INVALIDARG;
  402. // iEntry is 0-based.
  403. CPropEntry const *pPropEntry = 0;
  404. //
  405. // If iEntry is > what was last retrieved, walk to that item in the
  406. // iterator. If iEntry is <= what we have, we need to start from the
  407. // beginning, because we can only walk forward.
  408. //
  409. if (iEntry <= _iLastEntryPos)
  410. {
  411. delete _pPropIterator;
  412. _pPropIterator = new CPropEntryIter(*this);
  413. _iLastEntryPos = 0;
  414. pPropEntry = _pPropIterator->Next();
  415. }
  416. // Now move (iEntry - _iLastEntryPos) times to get to the desired entry.
  417. for (ULONG ulCurrentEntry = _iLastEntryPos;
  418. ulCurrentEntry < iEntry;
  419. ulCurrentEntry++)
  420. {
  421. pPropEntry = _pPropIterator->Next();
  422. if (0 != pPropEntry)
  423. _iLastEntryPos++;
  424. else // Reached the end of the list!
  425. break;
  426. }
  427. if (0 == pPropEntry)
  428. return E_INVALIDARG;
  429. *pwcsName = pPropEntry->GetName();
  430. *ppPropId = (DBID *) (pPropEntry->PropSpec().CastToStruct());
  431. if (pPropType)
  432. *pPropType = pPropEntry->GetPropType();
  433. if (puiWidth)
  434. *puiWidth = pPropEntry->GetWidth();
  435. return S_OK;
  436. }
  437. //+---------------------------------------------------------------------------
  438. //
  439. // Member: CEmptyPropertyList::GetPropInfo, public
  440. //
  441. // Synopsis: Given a friendly property name, return information about
  442. // that property (including a CDbColId).
  443. //
  444. // Arguments: wcsPropName -- friendly property name
  445. // *ppprop -- if ppprop != 0, returns a pointer to the CDbColId
  446. // *pproptype -- if proptype != 0, returns the DBTYPE
  447. // *puWidth -- if pulWidth != 0, returns the output field width
  448. //
  449. // History: 17-May-94 t-jeffc Created.
  450. //
  451. //----------------------------------------------------------------------------
  452. BOOL CEmptyPropertyList::GetPropInfo(WCHAR const * wcsPropName,
  453. CDbColId ** ppprop,
  454. DBTYPE * pproptype,
  455. unsigned int * puWidth )
  456. {
  457. WCHAR awc[MAX_PROPNAME_LENGTH + 1];
  458. unsigned cc = wcslen( wcsPropName );
  459. if ( cc > MAX_PROPNAME_LENGTH )
  460. cc = MAX_PROPNAME_LENGTH;
  461. RtlCopyMemory( awc, wcsPropName, cc * sizeof(WCHAR) );
  462. awc[cc] = 0;
  463. _wcsupr( awc );
  464. CPropEntry const * ppentry = Find( awc );
  465. if( 0 == ppentry )
  466. return FALSE;
  467. if( ppprop )
  468. *ppprop = &((CDbColId &) ppentry->PropSpec());
  469. if( pproptype )
  470. *pproptype = ppentry->GetPropType();
  471. if( puWidth )
  472. *puWidth = ppentry->GetWidth();
  473. return TRUE;
  474. }
  475. //+---------------------------------------------------------------------------
  476. //
  477. // Member: CEmptyPropertyList::GetPropInfo, public
  478. //
  479. // Synopsis: Given a CDbColId, return information about
  480. // that property.
  481. //
  482. // Arguments: prop -- property specifier
  483. // *ppprop -- if ppprop != 0, returns a pointer to the CDbColId
  484. // *pproptype -- if proptype != 0, returns the DBTYPE
  485. // *puWidth -- if pulWidth != 0, returns the output field width
  486. //
  487. // Notes: Overloaded the other GetPropInfo to help the column display
  488. // routines.
  489. //
  490. // History: 17-May-94 t-jeffc Created.
  491. //
  492. //----------------------------------------------------------------------------
  493. BOOL CEmptyPropertyList::GetPropInfo(CDbColId const & prop,
  494. WCHAR const ** pwcsName,
  495. DBTYPE * pproptype,
  496. unsigned int * puWidth )
  497. {
  498. CPropEntry const * ppentry = Find( prop );
  499. if( ppentry == 0 )
  500. return FALSE;
  501. if( pwcsName )
  502. *pwcsName = ppentry->GetName();
  503. if( pproptype )
  504. *pproptype = ppentry->GetPropType();
  505. if( puWidth )
  506. *puWidth = ppentry->GetWidth();
  507. return TRUE;
  508. } //GetPropInfo
  509. // StaticPropertyList methods
  510. //+---------------------------------------------------------------------------
  511. //
  512. // Member: CStaticPropertyList::Find, public
  513. //
  514. // Synopsis: Attempt to find an entry in the list.
  515. //
  516. // Arguments: wcsName -- friendly property name to find
  517. //
  518. // Returns a pointer to the CPropEntry if found, 0 otherwise.
  519. //
  520. // History: 17-May-94 t-jeffc Created.
  521. // 28-Aug-97 KrishnaN Static prop lookup only.
  522. //
  523. //----------------------------------------------------------------------------
  524. CPropEntry const * CStaticPropertyList::Find( WCHAR const * wcsName )
  525. {
  526. Win4Assert ( sizeof SPropEntry == sizeof CPropEntry );
  527. if( 0 == wcsName )
  528. return 0;
  529. CPropEntry const * ppentry = 0;
  530. unsigned iHash = HashFun( wcsName ) % cStaticPropHash;
  531. for( ppentry = _aStaticEntries[ iHash ];
  532. 0 != ppentry;
  533. ppentry = ppentry->Next() )
  534. {
  535. if ( ppentry->NameMatch( wcsName ) )
  536. break;
  537. }
  538. return ppentry;
  539. }
  540. //+---------------------------------------------------------------------------
  541. //
  542. // Member: CEmptyPropertyList::Find, public
  543. //
  544. // Synopsis: Attempt to find an entry in the list.
  545. //
  546. // Arguments: prop -- CDbColId of property to find
  547. //
  548. // Notes: Overloaded Find( WCHAR const * ) to help the column display
  549. // routines.
  550. //
  551. // Returns a pointer to the CPropEntry if found, 0 otherwise.
  552. //
  553. // History: 17-May-94 t-jeffc Created.
  554. //
  555. //----------------------------------------------------------------------------
  556. CPropEntry const * CEmptyPropertyList::Find( CDbColId const & prop )
  557. {
  558. CPropEntryIter iter( *this );
  559. CPropEntry const * ppentry;
  560. while ( ppentry = iter.Next() )
  561. {
  562. CDbColId const & ps = ppentry->PropSpec();
  563. if ( ps == prop )
  564. break;
  565. }
  566. return ppentry;
  567. }
  568. //+---------------------------------------------------------------------------
  569. //
  570. // Member: CStaticPropertyList::Next, public
  571. //
  572. // Synopsis: Gets the next property during an enumeration
  573. //
  574. // Returns: The next property entry or 0 for end of enumeration
  575. //
  576. // History: 21-Jul-97 dlee Moved from .hxx and added header
  577. //
  578. //----------------------------------------------------------------------------
  579. CPropEntry const * CStaticPropertyList::Next()
  580. {
  581. ULONG cLimit = cStaticPropHash;
  582. if ( _icur < cLimit )
  583. {
  584. if ( 0 == _pcur )
  585. {
  586. do
  587. {
  588. _icur++;
  589. if ( _icur == cLimit )
  590. break;
  591. _pcur = _aStaticEntries[ _icur ];
  592. } while ( 0 == _pcur );
  593. }
  594. if ( 0 != _pcur )
  595. {
  596. CPropEntry const *p = _pcur;
  597. _pcur = _pcur->Next();
  598. return p;
  599. }
  600. }
  601. return 0;
  602. } //Next
  603. //+---------------------------------------------------------------------------
  604. //
  605. // Member: CStaticPropertyList::InitIterator, public
  606. //
  607. // Synopsis: Initialize the iterator
  608. //
  609. // History: 29-Aug-97 KrishnaN Created
  610. //
  611. //----------------------------------------------------------------------------
  612. void CStaticPropertyList::InitIterator()
  613. {
  614. _icur = 0;
  615. _pcur = _aStaticEntries[0];
  616. }
  617. CPropertyList::~CPropertyList()
  618. {
  619. ClearList();
  620. }
  621. //+---------------------------------------------------------------------------
  622. //
  623. // Member: CPropertyList::FindDynamic, private
  624. //
  625. // Synopsis: Attempt to find an entry in the list.
  626. //
  627. // Arguments: wcsName -- friendly property name to find
  628. //
  629. // Returns a pointer to the CPropEntry if found, 0 otherwise.
  630. //
  631. // History: 17-May-94 t-jeffc Created.
  632. //
  633. //----------------------------------------------------------------------------
  634. CPropEntry const * CPropertyList::Find( WCHAR const * wcsName )
  635. {
  636. Win4Assert( sizeof SPropEntry == sizeof CPropEntry );
  637. if( wcsName == 0 )
  638. return 0;
  639. unsigned iHash = HashFun( wcsName ) % cPropHash;
  640. for( CPropEntry * ppentry = _aEntries[ iHash ];
  641. 0 != ppentry;
  642. ppentry = ppentry->Next() )
  643. {
  644. if( ppentry->NameMatch( wcsName ) )
  645. break;
  646. }
  647. return ppentry;
  648. }
  649. //+---------------------------------------------------------------------------
  650. //
  651. // Member: CPropertyList::AddEntry, private
  652. //
  653. // Synopsis: Adds a CPropEntry to the list. Verifies that the name
  654. // isn't already in the list.
  655. //
  656. // Arguments: ppentryNew -- pointer to the CPropEntry to add
  657. // iLine -- line number we're parsing
  658. //
  659. // History: 17-May-94 t-jeffc Created.
  660. //
  661. //----------------------------------------------------------------------------
  662. void CPropertyList::AddEntry( CPropEntry * ppentryNew, int iLine )
  663. {
  664. if( Find( ppentryNew->GetName() ) )
  665. THROW( CPListException( QPLIST_E_DUPLICATE, iLine ) );
  666. CLock lock(_mtxList);
  667. unsigned iHash = HashFun( ppentryNew->GetName() ) % cPropHash;
  668. ppentryNew->SetNext( _aEntries[ iHash ] );
  669. _aEntries[ iHash ] = ppentryNew;
  670. InterlockedIncrement((LONG *)&_ulCount);
  671. }
  672. //+---------------------------------------------------------------------------
  673. //
  674. // Member: CPropertyList::ClearList, public
  675. //
  676. // Synopsis: Frees the memory used by the list. Used in the destructor
  677. // and if the friendly name file is to be reparsed.
  678. //
  679. // History: 17-May-94 t-jeffc Created.
  680. //
  681. //----------------------------------------------------------------------------
  682. void CPropertyList::ClearList()
  683. {
  684. CLock lock(_mtxList);
  685. for ( unsigned i = 0; i < cPropHash; i++ )
  686. {
  687. CPropEntry * ppentryNext;
  688. for( CPropEntry *ppentryCurr = _aEntries[i];
  689. 0 != ppentryCurr;
  690. ppentryCurr = ppentryNext )
  691. {
  692. ppentryNext = ppentryCurr->Next();
  693. delete ppentryCurr;
  694. InterlockedDecrement((LONG *)&_ulCount);
  695. }
  696. }
  697. RtlZeroMemory( _aEntries, sizeof _aEntries );
  698. Win4Assert(0 == _ulCount);
  699. }
  700. //+---------------------------------------------------------------------------
  701. //
  702. // Member: CPropertyList::Next, public
  703. //
  704. // Synopsis: Gets the next property during an enumeration
  705. //
  706. // Returns: The next property entry or 0 for end of enumeration
  707. //
  708. // History: 29-Aug-97 KrishnaN Created
  709. //
  710. //----------------------------------------------------------------------------
  711. CPropEntry const * CPropertyList::Next()
  712. {
  713. ULONG cLimit = cPropHash;
  714. if ( _icur < cLimit )
  715. {
  716. if ( 0 == _pcur )
  717. {
  718. do
  719. {
  720. _icur++;
  721. if ( _icur == cLimit )
  722. break;
  723. _pcur = _aEntries[ _icur ];
  724. } while ( 0 == _pcur );
  725. }
  726. if ( 0 != _pcur )
  727. {
  728. CPropEntry const *p = _pcur;
  729. _pcur = _pcur->Next();
  730. return p;
  731. }
  732. }
  733. return 0;
  734. } //Next
  735. //+---------------------------------------------------------------------------
  736. //
  737. // Member: CPropertyList::InitIterator, public
  738. //
  739. // Synopsis: Initialize the iterator
  740. //
  741. // History: 29-Aug-97 KrishnaN Created
  742. //
  743. //----------------------------------------------------------------------------
  744. void CPropertyList::InitIterator()
  745. {
  746. _icur = 0;
  747. _pcur = _aEntries[0];
  748. }
  749. //+---------------------------------------------------------------------------
  750. //
  751. // Member: CPropertyList::ParseOneLine, public
  752. //
  753. // Synopsis: Parses one line of the friendly name file, creating a
  754. // CPropEntry node if necessary
  755. //
  756. // Arguments: scan -- scanner initialized with the current line
  757. // line -- The line to scan
  758. // pentry -- The cpropentry ptr.
  759. //
  760. // Returns: A pointer to the created prop entry. It could return 0 if no
  761. // property was created.
  762. //
  763. // History: 17-May-94 t-jeffc Created.
  764. //
  765. //----------------------------------------------------------------------------
  766. void CPropertyList::ParseOneLine( CQueryScanner & scan, int iLine, XPtr<CPropEntry> & pentry )
  767. {
  768. Win4Assert(0 == pentry.GetPointer());
  769. Token token = scan.LookAhead();
  770. // 1) is this a comment line (does it start with #)
  771. // or an empty line?
  772. if( token == PROP_REGEX_TOKEN
  773. || token == EOS_TOKEN )
  774. return;
  775. // 2) get friendly property name & stuff it in smart pointer
  776. XPtrST<WCHAR> wcsName( scan.AcqColumn() );
  777. if( wcsName.GetPointer() == 0 )
  778. THROW( CPListException( QPLIST_E_EXPECTING_NAME, iLine ) );
  779. unsigned ccName = wcslen( wcsName.GetPointer() ) + 1;
  780. WCHAR *pwcDisplayName = new WCHAR[ ccName ];
  781. RtlCopyMemory( pwcDisplayName, wcsName.GetPointer(), ccName * sizeof WCHAR );
  782. XPtrST<WCHAR> wcsDisplayName( pwcDisplayName );
  783. // initialize a new CPropEntry
  784. // (name is _not_ copied, so we must relinquish the smart pointer)
  785. _wcsupr( wcsName.GetPointer() );
  786. pentry.Set( new CPropEntry( wcsDisplayName, wcsName ) );
  787. scan.AcceptColumn();
  788. token = scan.LookAhead();
  789. // 3) check for type & width spec
  790. if( token == OPEN_TOKEN )
  791. {
  792. scan.Accept();
  793. if( scan.LookAhead() == TEXT_TOKEN )
  794. {
  795. unsigned long ulWidth;
  796. BOOL fAtEnd;
  797. if( !scan.GetNumber( ulWidth, fAtEnd ) )
  798. {
  799. // 4) if it's not a number, try to recognize it as
  800. // a type specifier
  801. //
  802. // Scan for DB_TYPE | DB_TYPE | DBTYPE combinations
  803. //
  804. while ( scan.LookAhead() == TEXT_TOKEN )
  805. {
  806. XPtrST<WCHAR> wcsType( scan.AcqWord() );
  807. if( wcsType.GetPointer() == 0 )
  808. THROW( CPListException( QPLIST_E_EXPECTING_TYPE, iLine ) );
  809. _wcsupr( wcsType.GetPointer() );
  810. unsigned cType = FindPropType( wcsType.GetPointer() );
  811. if( cType >= GetPropTypeCount() )
  812. THROW( CPListException( QPLIST_E_UNRECOGNIZED_TYPE, iLine ) );
  813. scan.AcceptWord();
  814. pentry->SetPropType( pentry->GetPropType() |
  815. parseTypes[cType].dbType );
  816. if ( OR_TOKEN == scan.LookAhead() )
  817. {
  818. scan.Accept();
  819. }
  820. }
  821. //
  822. // Verfy that we have some DBTYPE specified in addition
  823. // to DBTYPE_VECTOR & DBTYPE_BYREF
  824. //
  825. DBTYPE dbBase = pentry->GetPropType() & ~(DBTYPE_VECTOR|DBTYPE_BYREF);
  826. if ( 0 == dbBase )
  827. {
  828. THROW( CPListException( QPLIST_E_VECTORBYREF_USED_ALONE, iLine ) );
  829. }
  830. //
  831. // In NT 5, you can't mix and match types from VARIANT
  832. // and PROPVARIANT in VT_ARRAY and VT_VECTOR. Certain
  833. // permutations like this one aren't supported
  834. //
  835. if ( pentry->GetPropType() == (DBTYPE_DECIMAL|DBTYPE_VECTOR) )
  836. THROW( CPListException( QPLIST_E_UNRECOGNIZED_TYPE, iLine ) );
  837. //
  838. // If they specified a DBTYPE_BYREF, it must be with a pointer
  839. // type: WSTR or STR or UI1.
  840. //
  841. if ( (( pentry->GetPropType() & DBTYPE_BYREF ) != 0) &&
  842. ( DBTYPE_WSTR != dbBase &&
  843. DBTYPE_STR != dbBase &&
  844. DBTYPE_UI1 != dbBase &&
  845. DBTYPE_GUID != dbBase) )
  846. {
  847. THROW( CPListException( QPLIST_E_BYREF_USED_WITHOUT_PTRTYPE, iLine ) );
  848. }
  849. if( scan.LookAhead() == COMMA_TOKEN )
  850. {
  851. // 5) get the comma and width specifier
  852. scan.Accept();
  853. BOOL fAtEnd;
  854. if( !scan.GetNumber( ulWidth, fAtEnd ) )
  855. THROW( CPListException( QPLIST_E_EXPECTING_INTEGER, iLine ) );
  856. scan.Accept();
  857. pentry->SetWidth( ulWidth );
  858. }
  859. }
  860. else
  861. {
  862. scan.Accept();
  863. pentry->SetWidth( ulWidth );
  864. }
  865. }
  866. // 6) get the closing parenthesis
  867. if( scan.LookAhead() != CLOSE_TOKEN )
  868. THROW( CPListException( QPLIST_E_EXPECTING_CLOSE_PAREN, iLine ) );
  869. scan.Accept();
  870. token = scan.LookAhead();
  871. }
  872. //
  873. // If a type was not specified, assume it is a WIDE string, BYREF
  874. //
  875. if ( pentry->GetPropType() == 0 )
  876. {
  877. pentry->SetPropType( DBTYPE_WSTR | DBTYPE_BYREF );
  878. }
  879. // 7) check for =
  880. if( token == EQUAL_TOKEN )
  881. {
  882. scan.Accept();
  883. }
  884. // 7.1) assign a default width if one wasn't specified
  885. if( pentry->GetWidth() == 0 )
  886. {
  887. pentry->SetWidth( PLIST_DEFAULT_WIDTH );
  888. pentry->SetDisplayed( FALSE );
  889. }
  890. // 8) get property set guid & stuff in smart pointer
  891. XPtrST<WCHAR> wcsUgly( scan.AcqWord() );
  892. if( wcsUgly.GetPointer() == 0 )
  893. THROW( CPListException( QPLIST_E_EXPECTING_GUID, iLine ) );
  894. GUID guid;
  895. WCHAR *pUgly = wcsUgly.GetPointer();
  896. if ( !ParseGuid( pUgly, guid ) )
  897. THROW( CPListException( QPLIST_E_BAD_GUID, iLine ) );
  898. pentry->PropSpec().SetPropSet( guid );
  899. scan.AcceptWord();
  900. token = scan.LookAhead();
  901. ULONG ulDispId;
  902. // 9) get property name or dispid
  903. BOOL fAtEnd;
  904. if( !scan.GetNumber( ulDispId, fAtEnd ) )
  905. {
  906. XPtrST<WCHAR> wcsPropName;
  907. if ( QUOTES_TOKEN == token )
  908. {
  909. scan.Accept();
  910. wcsPropName.Set( scan.AcqPhraseInQuotes() );
  911. }
  912. else
  913. {
  914. wcsPropName.Set( scan.AcqPhrase() );
  915. }
  916. if( wcsPropName.GetPointer() == 0 )
  917. THROW( CPListException( QPLIST_E_EXPECTING_PROP_SPEC, iLine ) );
  918. if( !pentry->PropSpec().SetProperty( wcsPropName.GetPointer() ) )
  919. THROW( CPListException( QPLIST_E_CANT_SET_PROPERTY, iLine ) );
  920. scan.Accept();
  921. }
  922. else
  923. {
  924. pentry->PropSpec().SetProperty( ulDispId );
  925. scan.Accept();
  926. }
  927. } //ParseOneLine
  928. //+---------------------------------------------------------------------------
  929. //
  930. // Member: CPropertyList::GetAllEntries, public
  931. //
  932. // Synopsis: Returns cardinality of list.
  933. //
  934. // History: 11-Sep-97 KrishnaN Created.
  935. //
  936. //----------------------------------------------------------------------------
  937. SCODE CPropertyList::GetAllEntries(CPropEntry **ppPropEntries,
  938. ULONG ulMaxCount)
  939. {
  940. if (0 == ppPropEntries)
  941. {
  942. return E_INVALIDARG;
  943. }
  944. CLock lock(_mtxList);
  945. ULONG ulSize = min (ulMaxCount, GetCount());
  946. ULONG u = 0;
  947. for ( unsigned i = 0; i < cPropHash && u < ulSize; i++ )
  948. {
  949. CPropEntry * ppentryNext;
  950. for( CPropEntry *ppentryCurr = _aEntries[i];
  951. 0 != ppentryCurr && u < ulSize;
  952. ppentryCurr = ppentryNext )
  953. {
  954. ppentryNext = ppentryCurr->Next();
  955. ppPropEntries[u++] = ppentryCurr;
  956. }
  957. }
  958. return S_OK;
  959. }
  960. //+---------------------------------------------------------------------------
  961. //
  962. // Note: all of the following names MUST BE IN UPPERCASE
  963. //
  964. //----------------------------------------------------------------------------
  965. const SPropEntry aStaticList[] =
  966. {
  967. // Storage Propset
  968. { 0, L"DIRECTORY", L"Directory", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)2 }, 50, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  969. { 0, L"CLASSID", L"ClassId", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)3 }, 36, TRUE, TRUE, DBTYPE_GUID },
  970. { 0, L"FILEINDEX", L"FileIndex", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)8 }, 8, TRUE, TRUE, DBTYPE_UI8 },
  971. { 0, L"USN", L"USN", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)9 }, 8, TRUE, TRUE, DBTYPE_I8 },
  972. { 0, L"FILENAME", L"Filename", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)10 }, 15, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  973. { 0, L"PATH", L"Path", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)11 }, 50, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  974. { 0, L"SIZE", L"Size", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)12 }, 12, TRUE, TRUE, DBTYPE_I8 },
  975. { 0, L"ATTRIB", L"Attrib", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)13 }, 7, TRUE, TRUE, DBTYPE_UI4 },
  976. { 0, L"WRITE", L"Write", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)14 }, 19, TRUE, TRUE, VT_FILETIME },
  977. { 0, L"CREATE", L"Create", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)15 }, 19, TRUE, TRUE, VT_FILETIME },
  978. { 0, L"ACCESS", L"Access", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)16 }, 19, TRUE, TRUE, VT_FILETIME },
  979. { 0, L"ALLOCSIZE", L"AllocSize", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)18 }, 11, TRUE, TRUE, DBTYPE_I8 },
  980. { 0, L"CONTENTS", L"Contents", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)19 }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  981. { 0, L"SHORTFILENAME", L"ShortFilename", {StorageGuid, DBKIND_GUID_PROPID, (LPWSTR)20 }, 12, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  982. // Query Propset
  983. { 0, L"RANKVECTOR", L"RankVector", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)2 }, 20, TRUE, TRUE, DBTYPE_UI4|DBTYPE_VECTOR },
  984. { 0, L"RANK", L"Rank", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)3 }, 7, TRUE, TRUE, DBTYPE_I4 },
  985. { 0, L"HITCOUNT", L"HitCount", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)4 }, 10, TRUE, TRUE, DBTYPE_I4 },
  986. { 0, L"WORKID", L"WorkId", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)5 }, 10, TRUE, TRUE, DBTYPE_I4 },
  987. { 0, L"ALL", L"All", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)6 }, 0, FALSE,TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  988. // Don't export! { L"UNFILTERED", L"Unfiltered", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)7 }, 1, TRUE, TRUE, DBTYPE_BOOL },
  989. { 0, L"VPATH", L"VPath", {QueryGuid, DBKIND_GUID_PROPID, (LPWSTR)9 }, 50, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  990. // Property Sets for Documents
  991. { 0, L"DOCTITLE", L"DocTitle", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_TITLE }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  992. { 0, L"DOCSUBJECT", L"DocSubject", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_SUBJECT }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  993. { 0, L"DOCAUTHOR", L"DocAuthor", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_AUTHOR }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  994. { 0, L"DOCKEYWORDS", L"DocKeywords", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_KEYWORDS }, 25, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  995. { 0, L"DOCCOMMENTS", L"DocComments", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_COMMENTS }, 25, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  996. { 0, L"DOCTEMPLATE", L"DocTemplate", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_TEMPLATE }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  997. { 0, L"DOCLASTAUTHOR", L"DocLastAuthor", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_LASTAUTHOR }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  998. { 0, L"DOCREVNUMBER", L"DocRevNumber", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_REVNUMBER }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  999. { 0, L"DOCEDITTIME", L"DocEditTime", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_EDITTIME }, 10, TRUE, TRUE, VT_FILETIME },
  1000. { 0, L"DOCLASTPRINTED", L"DocLastPrinted", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_LASTPRINTED }, 10, TRUE, TRUE, VT_FILETIME },
  1001. { 0, L"DOCCREATEDTM", L"DocCreatedTm", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_CREATE_DTM }, 10, TRUE, TRUE, VT_FILETIME },
  1002. { 0, L"DOCLASTSAVEDTM", L"DocLastSavedTm", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_LASTSAVE_DTM}, 10, TRUE, TRUE, VT_FILETIME },
  1003. { 0, L"DOCPAGECOUNT", L"DocPageCount", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_PAGECOUNT }, 10, TRUE, TRUE, DBTYPE_I4 },
  1004. { 0, L"DOCWORDCOUNT", L"DocWordCount", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_WORDCOUNT }, 10, TRUE, TRUE, DBTYPE_I4 },
  1005. { 0, L"DOCCHARCOUNT", L"DocCharCount", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_CHARCOUNT }, 10, TRUE, TRUE, DBTYPE_I4 },
  1006. { 0, L"DOCTHUMBNAIL", L"DocThumbnail", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_THUMBNAIL }, 10, TRUE, TRUE, VT_CF },
  1007. { 0, L"DOCAPPNAME", L"DocAppName", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_APPNAME }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1008. { 0, L"DOCSECURITY", L"DocSecurity", {DocPropSetGuid, DBKIND_GUID_PROPID, (LPWSTR)PIDSI_DOC_SECURITY }, 10, TRUE, TRUE, DBTYPE_I4 },
  1009. { 0, L"DOCCATEGORY", L"DocCategory", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)2 }, 10, TRUE, TRUE, DBTYPE_STR|DBTYPE_BYREF },
  1010. { 0, L"DOCPRESENTATIONTARGET", L"DocPresentationTarget", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)3 }, 10, TRUE, TRUE, DBTYPE_STR|DBTYPE_BYREF },
  1011. { 0, L"DOCBYTECOUNT", L"DocByteCount", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)4 }, 10, TRUE, TRUE, DBTYPE_I4 },
  1012. { 0, L"DOCLINECOUNT", L"DocLineCount", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)5 }, 10, TRUE, TRUE, DBTYPE_I4 },
  1013. { 0, L"DOCPARACOUNT", L"DocParaCount", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)6 }, 10, TRUE, TRUE, DBTYPE_I4 },
  1014. { 0, L"DOCSLIDECOUNT", L"DocSlideCount", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)7 }, 10, TRUE, TRUE, DBTYPE_I4 },
  1015. { 0, L"DOCNOTECOUNT", L"DocNoteCount", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)8 }, 10, TRUE, TRUE, DBTYPE_I4 },
  1016. { 0, L"DOCHIDDENCOUNT", L"DocHiddenCount", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)9 }, 10, TRUE, TRUE, DBTYPE_I4 },
  1017. { 0, L"DOCPARTTITLES", L"DocPartTitles", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)13 }, 10, TRUE, TRUE, DBTYPE_STR|DBTYPE_VECTOR },
  1018. { 0, L"DOCMANAGER", L"DocManager", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)14 }, 10, TRUE, TRUE, DBTYPE_STR|DBTYPE_BYREF },
  1019. { 0, L"DOCCOMPANY", L"DocCompany", {DocPropSetGuid2, DBKIND_GUID_PROPID, (LPWSTR)15 }, 10, TRUE, TRUE, DBTYPE_STR|DBTYPE_BYREF },
  1020. // HTML properities
  1021. { 0, L"HTMLHREF", L"HtmlHref", {HTMLUrl, DBKIND_GUID_NAME, L"A.HREF" }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1022. { 0, L"A_HREF", L"A_Href", {HTMLUrl, DBKIND_GUID_NAME, L"A.HREF" }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1023. { 0, L"IMG_ALT", L"Img_Alt", {HTMLGuid, DBKIND_GUID_NAME, L"IMG.ALT" }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1024. { 0, L"HTMLHEADING1", L"HtmlHeading1", {HTMLGuid, DBKIND_GUID_PROPID, (LPWSTR)0x3 }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1025. { 0, L"HTMLHEADING2", L"HtmlHeading2", {HTMLGuid, DBKIND_GUID_PROPID, (LPWSTR)0x4 }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1026. { 0, L"HTMLHEADING3", L"HtmlHeading3", {HTMLGuid, DBKIND_GUID_PROPID, (LPWSTR)0x5 }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1027. { 0, L"HTMLHEADING4", L"HtmlHeading4", {HTMLGuid, DBKIND_GUID_PROPID, (LPWSTR)0x6 }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1028. { 0, L"HTMLHEADING5", L"HtmlHeading5", {HTMLGuid, DBKIND_GUID_PROPID, (LPWSTR)0x7 }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1029. { 0, L"HTMLHEADING6", L"HtmlHeading6", {HTMLGuid, DBKIND_GUID_PROPID, (LPWSTR)0x8 }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1030. // Document characterization
  1031. { 0, L"CHARACTERIZATION",L"Characterization", {DocCharacterGuid, DBKIND_GUID_PROPID, (LPWSTR)2}, 20, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1032. // NNTP Properties (obsolete now)
  1033. { 0, L"NEWSGROUP", L"NewsGroup", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsGroup) }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1034. { 0, L"NEWSGROUPS", L"NewsGroups", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsGroups) }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1035. { 0, L"NEWSREFERENCES", L"NewsReferences", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsReferences) }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1036. { 0, L"NEWSSUBJECT", L"NewsSubject", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsSubject) }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1037. { 0, L"NEWSFROM", L"NewsFrom", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsFrom) }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1038. { 0, L"NEWSMSGID", L"NewsMsgId", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsMsgid) }, 0, FALSE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1039. { 0, L"NEWSDATE", L"NewsDate", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsDate) }, 0, FALSE, TRUE, VT_FILETIME },
  1040. { 0, L"NEWSRECEIVEDDATE",L"NewsReceivedDate", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsReceivedDate) }, 0, FALSE, TRUE, VT_FILETIME },
  1041. { 0, L"NEWSARTICLEID", L"NewsArticleId", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsArticleid) }, 0, FALSE, TRUE, DBTYPE_UI4 },
  1042. // Mime properties (duplicates of NNTP properties).
  1043. { 0, L"MSGNEWSGROUP", L"MsgNewsgroup", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsGroup) }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1044. { 0, L"MSGNEWSGROUPS", L"MsgNewsgroups", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsGroups) }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1045. { 0, L"MSGREFERENCES", L"MsgReferences", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsReferences) }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1046. { 0, L"MSGSUBJECT", L"MsgSubject", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsSubject) }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1047. { 0, L"MSGFROM", L"MsgFrom", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsFrom) }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1048. { 0, L"MSGMESSAGEID", L"MsgMessageID", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsMsgid) }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1049. { 0, L"MSGDATE", L"MsgDate", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsDate) }, 10, TRUE, TRUE, VT_FILETIME },
  1050. { 0, L"MSGRECEIVEDDATE",L"MsgReceivedDate", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsReceivedDate) }, 10, TRUE, TRUE, VT_FILETIME },
  1051. { 0, L"MSGARTICLEID", L"MsgArticleID", {NNTPGuid, DBKIND_GUID_PROPID, (LPWSTR)((ULONG_PTR)propidNewsArticleid) }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1052. // Media Summary Information property set
  1053. { 0, L"MEDIAEDITOR", L"MediaEditor", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_EDITOR }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1054. { 0, L"MEDIASUPPLIER", L"MediaSupplier", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_SUPPLIER }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1055. { 0, L"MEDIASOURCE", L"MediaSource", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_SOURCE }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1056. { 0, L"MEDIASEQUENCE_NO", L"MediaSequence_No", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_SEQUENCE_NO }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1057. { 0, L"MEDIAPROJECT", L"MediaProject", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_PROJECT }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1058. { 0, L"MEDIASTATUS", L"MediaStatus", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_STATUS }, 6, TRUE, TRUE, DBTYPE_UI4 },
  1059. { 0, L"MEDIAOWNER", L"MediaOwner", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_OWNER }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1060. { 0, L"MEDIARATING", L"MediaRating", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_RATING }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1061. { 0, L"MEDIAPRODUCTION", L"MediaProduction", {MediaSummaryInfo, DBKIND_GUID_PROPID, (LPWSTR)PIDMSI_PRODUCTION }, 19, TRUE, TRUE, VT_FILETIME },
  1062. // Music property set
  1063. { 0, L"MUSICARTIST", L"MusicArtist", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_ARTIST }, 20, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1064. { 0, L"MUSICSONGTITLE", L"MusicSongTitle", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_SONGTITLE }, 20, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1065. { 0, L"MUSICALBUM", L"MusicAlbum", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_ALBUM }, 20, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1066. { 0, L"MUSICYEAR", L"MusicYear", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_YEAR }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1067. { 0, L"MUSICCOMMENT", L"MusicComment", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_COMMENT }, 10, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1068. { 0, L"MUSICTRACK", L"MusicTrack", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_TRACK }, 15, TRUE, TRUE, DBTYPE_UI4 },
  1069. { 0, L"MUSICGENRE", L"MusicGenre", {PSGUID_MUSIC, DBKIND_GUID_PROPID, (LPWSTR) PIDSI_GENRE }, 20, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1070. // Digital Rights Management
  1071. { 0, L"DRMLICENSE", L"DrmLicense", {PSGUID_DRM, DBKIND_GUID_PROPID, (LPWSTR) PIDDRSI_PROTECTED }, 20, TRUE, TRUE, DBTYPE_BOOL },
  1072. { 0, L"DRMDESCRIPTION", L"DrmDescription", {PSGUID_DRM, DBKIND_GUID_PROPID, (LPWSTR) PIDDRSI_DESCRIPTION }, 20, TRUE, TRUE, DBTYPE_WSTR|DBTYPE_BYREF },
  1073. { 0, L"DRMPLAYCOUNT", L"DrmPlayCount", {PSGUID_DRM, DBKIND_GUID_PROPID, (LPWSTR) PIDDRSI_PLAYCOUNT }, 20, TRUE, TRUE, DBTYPE_UI4 },
  1074. { 0, L"DRMPLAYSTARTS", L"DrmPlayStarts", {PSGUID_DRM, DBKIND_GUID_PROPID, (LPWSTR) PIDDRSI_PLAYSTARTS }, 20, TRUE, TRUE, VT_FILETIME },
  1075. { 0, L"DRMPLAYEXPIRES", L"DrmPlayExpires", {PSGUID_DRM, DBKIND_GUID_PROPID, (LPWSTR) PIDDRSI_PLAYEXPIRES }, 20, TRUE, TRUE, VT_FILETIME },
  1076. // Image property set
  1077. { 0, L"IMAGEFILETYPE", L"ImageFileType", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_FILETYPE }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1078. { 0, L"IMAGECX", L"ImageCx", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_CX }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1079. { 0, L"IMAGECY", L"ImageCy", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_CY }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1080. { 0, L"IMAGERESOLUTIONX", L"ImageResolutionX", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_RESOLUTIONX }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1081. { 0, L"IMAGERESOLUTIONY", L"ImageResolutionY", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_RESOLUTIONY }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1082. { 0, L"IMAGEBITDEPTH", L"ImageBitDepth", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_BITDEPTH }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1083. { 0, L"IMAGECOLORSPACE", L"ImageColorSpace", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_COLORSPACE }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1084. { 0, L"IMAGECOMPRESSION", L"ImageCompression", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_COMPRESSION }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1085. { 0, L"IMAGETRANSPARENCY", L"ImageTransparency", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_TRANSPARENCY }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1086. { 0, L"IMAGEGAMMAVALUE", L"ImageGammaValue", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_GAMMAVALUE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1087. { 0, L"IMAGEFRAMECOUNT", L"ImageFrameCount", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_FRAMECOUNT }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1088. { 0, L"IMAGEDIMENSIONS", L"ImageDimensions", {PSGUID_IMAGESUMMARYINFORMATION, DBKIND_GUID_PROPID, (LPWSTR) PIDISI_DIMENSIONS }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1089. // Audio property set
  1090. { 0, L"AUDIOFORMAT", L"AudioFormat", {PSGUID_AUDIO, DBKIND_GUID_PROPID, (LPWSTR) PIDASI_FORMAT }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1091. { 0, L"AUDIOTIMELENGTH", L"AudioTimeLength", {PSGUID_AUDIO, DBKIND_GUID_PROPID, (LPWSTR) PIDASI_TIMELENGTH }, 10, TRUE, TRUE, DBTYPE_UI8 },
  1092. { 0, L"AUDIOAVGDATARATE", L"AudioAvgDataRate", {PSGUID_AUDIO, DBKIND_GUID_PROPID, (LPWSTR) PIDASI_AVG_DATA_RATE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1093. { 0, L"AUDIOSAMPLERATE", L"AudioSampleRate", {PSGUID_AUDIO, DBKIND_GUID_PROPID, (LPWSTR) PIDASI_SAMPLE_RATE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1094. { 0, L"AUDIOSAMPLESIZE", L"AudioSampleSize", {PSGUID_AUDIO, DBKIND_GUID_PROPID, (LPWSTR) PIDASI_SAMPLE_SIZE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1095. { 0, L"AUDIOCHANNELCOUNT", L"AudioChannelCount", {PSGUID_AUDIO, DBKIND_GUID_PROPID, (LPWSTR) PIDASI_CHANNEL_COUNT }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1096. // Video property set
  1097. { 0, L"VIDEOSTREAMNAME", L"VideoStreamName", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_STREAM_NAME }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1098. { 0, L"VIDEOFRAMEWIDTH", L"VideoFrameWidth", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_FRAME_WIDTH }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1099. { 0, L"VIDEOFRAMEHEIGHT", L"VideoFrameHeight", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_FRAME_HEIGHT }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1100. { 0, L"VIDEOTIMELENGTH", L"VideoTimeLength", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_TIMELENGTH }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1101. { 0, L"VIDEOFRAMECOUNT", L"VideoFrameCount", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_FRAME_COUNT }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1102. { 0, L"VIDEOFRAMERATE", L"VideoFrameRate", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_FRAME_RATE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1103. { 0, L"VIDEODATARATE", L"VideoDataRate", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_DATA_RATE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1104. { 0, L"VIDEOSAMPLESIZE", L"VideoSampleSize", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_SAMPLE_SIZE }, 10, TRUE, TRUE, DBTYPE_UI4 },
  1105. { 0, L"VIDEOCOMPRESSION", L"VideoCompression", {PSGUID_VIDEO, DBKIND_GUID_PROPID, (LPWSTR) PIDVSI_COMPRESSION }, 10, TRUE, TRUE, DBTYPE_WSTR | DBTYPE_BYREF },
  1106. };
  1107. const unsigned cCiGlobalTypes = sizeof(aStaticList) /
  1108. sizeof(aStaticList[0]);
  1109. const unsigned CStaticPropertyList::cStaticPropEntries = cCiGlobalTypes;
  1110. //+---------------------------------------------------------------------------
  1111. //
  1112. // Member: CStaticPropertyList::GetAllEntries, public
  1113. //
  1114. // Synopsis: Returns cardinality of list.
  1115. //
  1116. // History: 11-Sep-97 KrishnaN Created.
  1117. //
  1118. //----------------------------------------------------------------------------
  1119. SCODE CStaticPropertyList::GetAllEntries(CPropEntry **ppPropEntries,
  1120. ULONG ulMaxCount)
  1121. {
  1122. if (0 == ppPropEntries)
  1123. return E_INVALIDARG;
  1124. ULONG ulSize = min (ulMaxCount, GetCount());
  1125. for ( unsigned i = 0; i < ulSize; i++ )
  1126. ppPropEntries[i] = (CPropEntry *) & aStaticList[i];
  1127. return S_OK;
  1128. } //GetAllEntries
  1129. //
  1130. // NOTE: Use tplist.cxx (build tplist) to generate the table below,
  1131. // and be sure to update cStaticPropHash and the hash function
  1132. // (if it changed)
  1133. //
  1134. const CPropEntry * CStaticPropertyList::_aStaticEntries[] =
  1135. {
  1136. 0, // 0
  1137. 0, // 1
  1138. 0, // 2
  1139. 0, // 3
  1140. 0, // 4
  1141. 0, // 5
  1142. 0, // 6
  1143. 0, // 7
  1144. 0, // 8
  1145. 0, // 9
  1146. 0, // 10
  1147. 0, // 11
  1148. 0, // 12
  1149. 0, // 13
  1150. 0, // 14
  1151. 0, // 15
  1152. 0, // 16
  1153. 0, // 17
  1154. 0, // 18
  1155. 0, // 19
  1156. 0, // 20
  1157. 0, // 21
  1158. 0, // 22
  1159. 0, // 23
  1160. 0, // 24
  1161. 0, // 25
  1162. 0, // 26
  1163. 0, // 27
  1164. (CPropEntry *) &aStaticList[72], // 28 'MSGFROM'
  1165. 0, // 29
  1166. 0, // 30
  1167. 0, // 31
  1168. 0, // 32
  1169. 0, // 33
  1170. 0, // 34
  1171. 0, // 35
  1172. 0, // 36
  1173. 0, // 37
  1174. 0, // 38
  1175. 0, // 39
  1176. 0, // 40
  1177. 0, // 41
  1178. 0, // 42
  1179. 0, // 43
  1180. 0, // 44
  1181. 0, // 45
  1182. 0, // 46
  1183. 0, // 47
  1184. 0, // 48
  1185. 0, // 49
  1186. 0, // 50
  1187. 0, // 51
  1188. 0, // 52
  1189. 0, // 53
  1190. 0, // 54
  1191. 0, // 55
  1192. 0, // 56
  1193. 0, // 57
  1194. 0, // 58
  1195. 0, // 59
  1196. 0, // 60
  1197. 0, // 61
  1198. 0, // 62
  1199. 0, // 63
  1200. 0, // 64
  1201. 0, // 65
  1202. 0, // 66
  1203. (CPropEntry *) &aStaticList[123], // 67 'VIDEOSAMPLESIZE'
  1204. 0, // 68
  1205. 0, // 69
  1206. 0, // 70
  1207. 0, // 71
  1208. 0, // 72
  1209. 0, // 73
  1210. (CPropEntry *) &aStaticList[38], // 74 'DOCCATEGORY'
  1211. 0, // 75
  1212. 0, // 76
  1213. 0, // 77
  1214. (CPropEntry *) &aStaticList[20], // 78 'DOCTITLE'
  1215. 0, // 79
  1216. 0, // 80
  1217. 0, // 81
  1218. 0, // 82
  1219. 0, // 83
  1220. 0, // 84
  1221. 0, // 85
  1222. 0, // 86
  1223. (CPropEntry *) &aStaticList[75], // 87 'MSGRECEIVEDDATE'
  1224. 0, // 88
  1225. 0, // 89
  1226. 0, // 90
  1227. 0, // 91
  1228. 0, // 92
  1229. 0, // 93
  1230. 0, // 94
  1231. 0, // 95
  1232. 0, // 96
  1233. 0, // 97
  1234. 0, // 98
  1235. 0, // 99
  1236. 0, // 100
  1237. (CPropEntry *) &aStaticList[7], // 101 'ATTRIB'
  1238. 0, // 102
  1239. 0, // 103
  1240. 0, // 104
  1241. 0, // 105
  1242. 0, // 106
  1243. (CPropEntry *) &aStaticList[48], // 107 'DOCCOMPANY'
  1244. 0, // 108
  1245. 0, // 109
  1246. 0, // 110
  1247. 0, // 111
  1248. 0, // 112
  1249. (CPropEntry *) &aStaticList[59], // 113 'NEWSGROUP'
  1250. (CPropEntry *) &aStaticList[81], // 114 'MEDIAPROJECT'
  1251. 0, // 115
  1252. 0, // 116
  1253. 0, // 117
  1254. 0, // 118
  1255. 0, // 119
  1256. 0, // 120
  1257. 0, // 121
  1258. 0, // 122
  1259. 0, // 123
  1260. 0, // 124
  1261. 0, // 125
  1262. 0, // 126
  1263. 0, // 127
  1264. 0, // 128
  1265. 0, // 129
  1266. 0, // 130
  1267. 0, // 131
  1268. 0, // 132
  1269. 0, // 133
  1270. 0, // 134
  1271. 0, // 135
  1272. 0, // 136
  1273. (CPropEntry *) &aStaticList[99], // 137 'IMAGECX'
  1274. 0, // 138
  1275. (CPropEntry *) &aStaticList[100], // 139 'IMAGECY'
  1276. 0, // 140
  1277. 0, // 141
  1278. 0, // 142
  1279. 0, // 143
  1280. 0, // 144
  1281. 0, // 145
  1282. 0, // 146
  1283. 0, // 147
  1284. 0, // 148
  1285. 0, // 149
  1286. 0, // 150
  1287. 0, // 151
  1288. 0, // 152
  1289. 0, // 153
  1290. 0, // 154
  1291. 0, // 155
  1292. 0, // 156
  1293. 0, // 157
  1294. 0, // 158
  1295. 0, // 159
  1296. 0, // 160
  1297. 0, // 161
  1298. (CPropEntry *) &aStaticList[31], // 162 'DOCLASTSAVEDTM'
  1299. 0, // 163
  1300. 0, // 164
  1301. 0, // 165
  1302. 0, // 166
  1303. 0, // 167
  1304. 0, // 168
  1305. 0, // 169
  1306. 0, // 170
  1307. 0, // 171
  1308. 0, // 172
  1309. 0, // 173
  1310. 0, // 174
  1311. 0, // 175
  1312. 0, // 176
  1313. 0, // 177
  1314. 0, // 178
  1315. 0, // 179
  1316. 0, // 180
  1317. 0, // 181
  1318. 0, // 182
  1319. 0, // 183
  1320. 0, // 184
  1321. (CPropEntry *) &aStaticList[64], // 185 'NEWSMSGID'
  1322. (CPropEntry *) &aStaticList[82], // 186 'MEDIASTATUS'
  1323. 0, // 187
  1324. 0, // 188
  1325. 0, // 189
  1326. 0, // 190
  1327. (CPropEntry *) &aStaticList[77], // 191 'MEDIAEDITOR'
  1328. 0, // 192
  1329. (CPropEntry *) &aStaticList[104], // 193 'IMAGECOLORSPACE'
  1330. 0, // 194
  1331. 0, // 195
  1332. 0, // 196
  1333. (CPropEntry *) &aStaticList[44], // 197 'DOCNOTECOUNT'
  1334. 0, // 198
  1335. 0, // 199
  1336. 0, // 200
  1337. (CPropEntry *) &aStaticList[103], // 201 'IMAGEBITDEPTH'
  1338. 0, // 202
  1339. 0, // 203
  1340. 0, // 204
  1341. 0, // 205
  1342. 0, // 206
  1343. 0, // 207
  1344. 0, // 208
  1345. 0, // 209
  1346. 0, // 210
  1347. 0, // 211
  1348. 0, // 212
  1349. 0, // 213
  1350. (CPropEntry *) &aStaticList[45], // 214 'DOCHIDDENCOUNT'
  1351. 0, // 215
  1352. 0, // 216
  1353. 0, // 217
  1354. 0, // 218
  1355. 0, // 219
  1356. 0, // 220
  1357. 0, // 221
  1358. 0, // 222
  1359. 0, // 223
  1360. (CPropEntry *) &aStaticList[112], // 224 'AUDIOAVGDATARATE'
  1361. 0, // 225
  1362. (CPropEntry *) &aStaticList[76], // 226 'MSGARTICLEID'
  1363. 0, // 227
  1364. 0, // 228
  1365. 0, // 229
  1366. (CPropEntry *) &aStaticList[79], // 230 'MEDIASOURCE'
  1367. 0, // 231
  1368. 0, // 232
  1369. (CPropEntry *) &aStaticList[70], // 233 'MSGREFERENCES'
  1370. 0, // 234
  1371. 0, // 235
  1372. 0, // 236
  1373. 0, // 237
  1374. 0, // 238
  1375. 0, // 239
  1376. 0, // 240
  1377. 0, // 241
  1378. 0, // 242
  1379. 0, // 243
  1380. 0, // 244
  1381. 0, // 245
  1382. 0, // 246
  1383. 0, // 247
  1384. 0, // 248
  1385. 0, // 249
  1386. 0, // 250
  1387. 0, // 251
  1388. 0, // 252
  1389. (CPropEntry *) &aStaticList[50], // 253 'A_HREF'
  1390. 0, // 254
  1391. 0, // 255
  1392. 0, // 256
  1393. (CPropEntry *) &aStaticList[67], // 257 'NEWSARTICLEID'
  1394. 0, // 258
  1395. 0, // 259
  1396. 0, // 260
  1397. 0, // 261
  1398. 0, // 262
  1399. (CPropEntry *) &aStaticList[46], // 263 'DOCPARTTITLES'
  1400. 0, // 264
  1401. 0, // 265
  1402. 0, // 266
  1403. 0, // 267
  1404. 0, // 268
  1405. 0, // 269
  1406. 0, // 270
  1407. 0, // 271
  1408. 0, // 272
  1409. 0, // 273
  1410. 0, // 274
  1411. 0, // 275
  1412. 0, // 276
  1413. 0, // 277
  1414. 0, // 278
  1415. 0, // 279
  1416. 0, // 280
  1417. (CPropEntry *) &aStaticList[47], // 281 'DOCMANAGER'
  1418. 0, // 282
  1419. 0, // 283
  1420. 0, // 284
  1421. 0, // 285
  1422. 0, // 286
  1423. 0, // 287
  1424. 0, // 288
  1425. 0, // 289
  1426. 0, // 290
  1427. 0, // 291
  1428. 0, // 292
  1429. 0, // 293
  1430. (CPropEntry *) &aStaticList[61], // 294 'NEWSREFERENCES'
  1431. 0, // 295
  1432. 0, // 296
  1433. 0, // 297
  1434. 0, // 298
  1435. 0, // 299
  1436. 0, // 300
  1437. 0, // 301
  1438. 0, // 302
  1439. 0, // 303
  1440. 0, // 304
  1441. 0, // 305
  1442. 0, // 306
  1443. 0, // 307
  1444. 0, // 308
  1445. (CPropEntry *) &aStaticList[37], // 309 'DOCSECURITY'
  1446. 0, // 310
  1447. 0, // 311
  1448. 0, // 312
  1449. 0, // 313
  1450. 0, // 314
  1451. 0, // 315
  1452. 0, // 316
  1453. 0, // 317
  1454. 0, // 318
  1455. (CPropEntry *) &aStaticList[24], // 319 'DOCCOMMENTS'
  1456. 0, // 320
  1457. 0, // 321
  1458. 0, // 322
  1459. (CPropEntry *) &aStaticList[88], // 323 'MUSICALBUM'
  1460. 0, // 324
  1461. 0, // 325
  1462. 0, // 326
  1463. 0, // 327
  1464. (CPropEntry *) &aStaticList[66], // 328 'NEWSRECEIVEDDATE'
  1465. 0, // 329
  1466. 0, // 330
  1467. 0, // 331
  1468. 0, // 332
  1469. 0, // 333
  1470. 0, // 334
  1471. 0, // 335
  1472. 0, // 336
  1473. 0, // 337
  1474. 0, // 338
  1475. 0, // 339
  1476. 0, // 340
  1477. 0, // 341
  1478. 0, // 342
  1479. 0, // 343
  1480. 0, // 344
  1481. 0, // 345
  1482. 0, // 346
  1483. 0, // 347
  1484. 0, // 348
  1485. 0, // 349
  1486. (CPropEntry *) &aStaticList[34], // 350 'DOCCHARCOUNT'
  1487. 0, // 351
  1488. 0, // 352
  1489. 0, // 353
  1490. 0, // 354
  1491. 0, // 355
  1492. 0, // 356
  1493. 0, // 357
  1494. 0, // 358
  1495. 0, // 359
  1496. 0, // 360
  1497. 0, // 361
  1498. 0, // 362
  1499. 0, // 363
  1500. 0, // 364
  1501. 0, // 365
  1502. 0, // 366
  1503. 0, // 367
  1504. 0, // 368
  1505. 0, // 369
  1506. 0, // 370
  1507. 0, // 371
  1508. 0, // 372
  1509. 0, // 373
  1510. 0, // 374
  1511. 0, // 375
  1512. 0, // 376
  1513. 0, // 377
  1514. 0, // 378
  1515. 0, // 379
  1516. 0, // 380
  1517. 0, // 381
  1518. 0, // 382
  1519. 0, // 383
  1520. (CPropEntry *) &aStaticList[60], // 384 'NEWSGROUPS'
  1521. 0, // 385
  1522. 0, // 386
  1523. (CPropEntry *) &aStaticList[52], // 387 'HTMLHEADING1'
  1524. 0, // 388
  1525. (CPropEntry *) &aStaticList[53], // 389 'HTMLHEADING2'
  1526. 0, // 390
  1527. (CPropEntry *) &aStaticList[54], // 391 'HTMLHEADING3'
  1528. 0, // 392
  1529. (CPropEntry *) &aStaticList[55], // 393 'HTMLHEADING4'
  1530. 0, // 394
  1531. (CPropEntry *) &aStaticList[56], // 395 'HTMLHEADING5'
  1532. 0, // 396
  1533. (CPropEntry *) &aStaticList[57], // 397 'HTMLHEADING6'
  1534. 0, // 398
  1535. 0, // 399
  1536. 0, // 400
  1537. 0, // 401
  1538. 0, // 402
  1539. 0, // 403
  1540. 0, // 404
  1541. 0, // 405
  1542. 0, // 406
  1543. 0, // 407
  1544. 0, // 408
  1545. 0, // 409
  1546. 0, // 410
  1547. 0, // 411
  1548. 0, // 412
  1549. 0, // 413
  1550. 0, // 414
  1551. 0, // 415
  1552. 0, // 416
  1553. 0, // 417
  1554. 0, // 418
  1555. 0, // 419
  1556. 0, // 420
  1557. 0, // 421
  1558. 0, // 422
  1559. 0, // 423
  1560. 0, // 424
  1561. 0, // 425
  1562. 0, // 426
  1563. 0, // 427
  1564. 0, // 428
  1565. 0, // 429
  1566. 0, // 430
  1567. 0, // 431
  1568. 0, // 432
  1569. 0, // 433
  1570. 0, // 434
  1571. 0, // 435
  1572. 0, // 436
  1573. 0, // 437
  1574. 0, // 438
  1575. 0, // 439
  1576. 0, // 440
  1577. 0, // 441
  1578. 0, // 442
  1579. 0, // 443
  1580. 0, // 444
  1581. 0, // 445
  1582. 0, // 446
  1583. 0, // 447
  1584. 0, // 448
  1585. 0, // 449
  1586. 0, // 450
  1587. 0, // 451
  1588. 0, // 452
  1589. 0, // 453
  1590. 0, // 454
  1591. 0, // 455
  1592. 0, // 456
  1593. 0, // 457
  1594. 0, // 458
  1595. 0, // 459
  1596. 0, // 460
  1597. 0, // 461
  1598. 0, // 462
  1599. 0, // 463
  1600. 0, // 464
  1601. 0, // 465
  1602. 0, // 466
  1603. 0, // 467
  1604. 0, // 468
  1605. 0, // 469
  1606. 0, // 470
  1607. (CPropEntry *) &aStaticList[92], // 471 'MUSICGENRE'
  1608. 0, // 472
  1609. 0, // 473
  1610. (CPropEntry *) &aStaticList[12], // 474 'CONTENTS'
  1611. 0, // 475
  1612. 0, // 476
  1613. 0, // 477
  1614. 0, // 478
  1615. 0, // 479
  1616. 0, // 480
  1617. 0, // 481
  1618. 0, // 482
  1619. 0, // 483
  1620. 0, // 484
  1621. 0, // 485
  1622. 0, // 486
  1623. 0, // 487
  1624. 0, // 488
  1625. (CPropEntry *) &aStaticList[111], // 489 'AUDIOTIMELENGTH'
  1626. 0, // 490
  1627. 0, // 491
  1628. 0, // 492
  1629. 0, // 493
  1630. 0, // 494
  1631. 0, // 495
  1632. (CPropEntry *) &aStaticList[106], // 496 'IMAGETRANSPARENCY'
  1633. 0, // 497
  1634. 0, // 498
  1635. 0, // 499
  1636. 0, // 500
  1637. 0, // 501
  1638. 0, // 502
  1639. 0, // 503
  1640. 0, // 504
  1641. 0, // 505
  1642. 0, // 506
  1643. 0, // 507
  1644. 0, // 508
  1645. 0, // 509
  1646. 0, // 510
  1647. 0, // 511
  1648. 0, // 512
  1649. 0, // 513
  1650. 0, // 514
  1651. 0, // 515
  1652. 0, // 516
  1653. 0, // 517
  1654. 0, // 518
  1655. 0, // 519
  1656. 0, // 520
  1657. 0, // 521
  1658. 0, // 522
  1659. 0, // 523
  1660. 0, // 524
  1661. 0, // 525
  1662. 0, // 526
  1663. 0, // 527
  1664. 0, // 528
  1665. 0, // 529
  1666. 0, // 530
  1667. 0, // 531
  1668. 0, // 532
  1669. 0, // 533
  1670. 0, // 534
  1671. 0, // 535
  1672. 0, // 536
  1673. 0, // 537
  1674. 0, // 538
  1675. 0, // 539
  1676. 0, // 540
  1677. 0, // 541
  1678. 0, // 542
  1679. 0, // 543
  1680. 0, // 544
  1681. 0, // 545
  1682. (CPropEntry *) &aStaticList[40], // 546 'DOCBYTECOUNT'
  1683. 0, // 547
  1684. 0, // 548
  1685. 0, // 549
  1686. 0, // 550
  1687. 0, // 551
  1688. (CPropEntry *) &aStaticList[33], // 552 'DOCWORDCOUNT'
  1689. 0, // 553
  1690. 0, // 554
  1691. 0, // 555
  1692. 0, // 556
  1693. 0, // 557
  1694. 0, // 558
  1695. 0, // 559
  1696. 0, // 560
  1697. 0, // 561
  1698. (CPropEntry *) &aStaticList[35], // 562 'DOCTHUMBNAIL'
  1699. 0, // 563
  1700. 0, // 564
  1701. 0, // 565
  1702. (CPropEntry *) &aStaticList[10], // 566 'ACCESS'
  1703. 0, // 567
  1704. 0, // 568
  1705. 0, // 569
  1706. 0, // 570
  1707. 0, // 571
  1708. 0, // 572
  1709. 0, // 573
  1710. 0, // 574
  1711. 0, // 575
  1712. 0, // 576
  1713. 0, // 577
  1714. (CPropEntry *) &aStaticList[78], // 578 'MEDIASUPPLIER'
  1715. 0, // 579
  1716. 0, // 580
  1717. 0, // 581
  1718. 0, // 582
  1719. 0, // 583
  1720. 0, // 584
  1721. 0, // 585
  1722. 0, // 586
  1723. 0, // 587
  1724. 0, // 588
  1725. 0, // 589
  1726. 0, // 590
  1727. 0, // 591
  1728. 0, // 592
  1729. 0, // 593
  1730. 0, // 594
  1731. 0, // 595
  1732. 0, // 596
  1733. 0, // 597
  1734. 0, // 598
  1735. 0, // 599
  1736. (CPropEntry *) &aStaticList[62], // 600 'NEWSSUBJECT'
  1737. 0, // 601
  1738. 0, // 602
  1739. (CPropEntry *) &aStaticList[108], // 603 'IMAGEFRAMECOUNT'
  1740. 0, // 604
  1741. 0, // 605
  1742. 0, // 606
  1743. 0, // 607
  1744. 0, // 608
  1745. 0, // 609
  1746. 0, // 610
  1747. 0, // 611
  1748. 0, // 612
  1749. 0, // 613
  1750. 0, // 614
  1751. 0, // 615
  1752. 0, // 616
  1753. 0, // 617
  1754. 0, // 618
  1755. 0, // 619
  1756. 0, // 620
  1757. 0, // 621
  1758. 0, // 622
  1759. 0, // 623
  1760. 0, // 624
  1761. 0, // 625
  1762. (CPropEntry *) &aStaticList[93], // 626 'DRMLICENSE'
  1763. 0, // 627
  1764. (CPropEntry *) &aStaticList[83], // 628 'MEDIAOWNER'
  1765. 0, // 629
  1766. 0, // 630
  1767. 0, // 631
  1768. 0, // 632
  1769. 0, // 633
  1770. 0, // 634
  1771. 0, // 635
  1772. 0, // 636
  1773. 0, // 637
  1774. 0, // 638
  1775. 0, // 639
  1776. 0, // 640
  1777. 0, // 641
  1778. 0, // 642
  1779. 0, // 643
  1780. (CPropEntry *) &aStaticList[29], // 644 'DOCLASTPRINTED'
  1781. 0, // 645
  1782. 0, // 646
  1783. 0, // 647
  1784. 0, // 648
  1785. 0, // 649
  1786. 0, // 650
  1787. 0, // 651
  1788. 0, // 652
  1789. 0, // 653
  1790. 0, // 654
  1791. 0, // 655
  1792. 0, // 656
  1793. 0, // 657
  1794. 0, // 658
  1795. 0, // 659
  1796. 0, // 660
  1797. 0, // 661
  1798. (CPropEntry *) &aStaticList[115], // 662 'AUDIOCHANNELCOUNT'
  1799. 0, // 663
  1800. 0, // 664
  1801. 0, // 665
  1802. 0, // 666
  1803. 0, // 667
  1804. 0, // 668
  1805. 0, // 669
  1806. 0, // 670
  1807. 0, // 671
  1808. 0, // 672
  1809. 0, // 673
  1810. 0, // 674
  1811. 0, // 675
  1812. 0, // 676
  1813. 0, // 677
  1814. (CPropEntry *) &aStaticList[122], // 678 'VIDEODATARATE'
  1815. 0, // 679
  1816. 0, // 680
  1817. 0, // 681
  1818. (CPropEntry *) &aStaticList[120], // 682 'VIDEOFRAMECOUNT'
  1819. 0, // 683
  1820. 0, // 684
  1821. 0, // 685
  1822. 0, // 686
  1823. 0, // 687
  1824. 0, // 688
  1825. 0, // 689
  1826. 0, // 690
  1827. (CPropEntry *) &aStaticList[39], // 691 'DOCPRESENTATIONTARGET'
  1828. 0, // 692
  1829. 0, // 693
  1830. 0, // 694
  1831. 0, // 695
  1832. 0, // 696
  1833. 0, // 697
  1834. 0, // 698
  1835. 0, // 699
  1836. 0, // 700
  1837. 0, // 701
  1838. 0, // 702
  1839. 0, // 703
  1840. 0, // 704
  1841. 0, // 705
  1842. 0, // 706
  1843. 0, // 707
  1844. 0, // 708
  1845. (CPropEntry *) &aStaticList[51], // 709 'IMG_ALT'
  1846. 0, // 710
  1847. 0, // 711
  1848. 0, // 712
  1849. 0, // 713
  1850. 0, // 714
  1851. 0, // 715
  1852. 0, // 716
  1853. 0, // 717
  1854. 0, // 718
  1855. 0, // 719
  1856. (CPropEntry *) &aStaticList[113], // 720 'AUDIOSAMPLERATE'
  1857. 0, // 721
  1858. 0, // 722
  1859. 0, // 723
  1860. 0, // 724
  1861. 0, // 725
  1862. 0, // 726
  1863. 0, // 727
  1864. 0, // 728
  1865. 0, // 729
  1866. 0, // 730
  1867. 0, // 731
  1868. 0, // 732
  1869. 0, // 733
  1870. 0, // 734
  1871. 0, // 735
  1872. 0, // 736
  1873. 0, // 737
  1874. 0, // 738
  1875. 0, // 739
  1876. 0, // 740
  1877. 0, // 741
  1878. 0, // 742
  1879. 0, // 743
  1880. 0, // 744
  1881. 0, // 745
  1882. 0, // 746
  1883. 0, // 747
  1884. 0, // 748
  1885. 0, // 749
  1886. 0, // 750
  1887. 0, // 751
  1888. 0, // 752
  1889. (CPropEntry *) &aStaticList[14], // 753 'RANKVECTOR'
  1890. 0, // 754
  1891. 0, // 755
  1892. 0, // 756
  1893. (CPropEntry *) &aStaticList[49], // 757 'HTMLHREF'
  1894. (CPropEntry *) &aStaticList[21], // 758 'DOCSUBJECT'
  1895. 0, // 759
  1896. 0, // 760
  1897. 0, // 761
  1898. (CPropEntry *) &aStaticList[101], // 762 'IMAGERESOLUTIONX'
  1899. 0, // 763
  1900. (CPropEntry *) &aStaticList[102], // 764 'IMAGERESOLUTIONY'
  1901. 0, // 765
  1902. 0, // 766
  1903. 0, // 767
  1904. 0, // 768
  1905. 0, // 769
  1906. 0, // 770
  1907. 0, // 771
  1908. 0, // 772
  1909. 0, // 773
  1910. 0, // 774
  1911. 0, // 775
  1912. 0, // 776
  1913. 0, // 777
  1914. 0, // 778
  1915. 0, // 779
  1916. 0, // 780
  1917. 0, // 781
  1918. 0, // 782
  1919. 0, // 783
  1920. 0, // 784
  1921. 0, // 785
  1922. 0, // 786
  1923. 0, // 787
  1924. (CPropEntry *) &aStaticList[73], // 788 'MSGMESSAGEID'
  1925. 0, // 789
  1926. 0, // 790
  1927. 0, // 791
  1928. 0, // 792
  1929. 0, // 793
  1930. 0, // 794
  1931. 0, // 795
  1932. (CPropEntry *) &aStaticList[97], // 796 'DRMPLAYEXPIRES'
  1933. 0, // 797
  1934. (CPropEntry *) &aStaticList[110], // 798 'AUDIOFORMAT'
  1935. 0, // 799
  1936. (CPropEntry *) &aStaticList[22], // 800 'DOCAUTHOR'
  1937. 0, // 801
  1938. (CPropEntry *) &aStaticList[41], // 802 'DOCLINECOUNT'
  1939. 0, // 803
  1940. 0, // 804
  1941. 0, // 805
  1942. 0, // 806
  1943. 0, // 807
  1944. 0, // 808
  1945. 0, // 809
  1946. 0, // 810
  1947. 0, // 811
  1948. 0, // 812
  1949. 0, // 813
  1950. (CPropEntry *) &aStaticList[80], // 814 'MEDIASEQUENCE_NO'
  1951. 0, // 815
  1952. 0, // 816
  1953. 0, // 817
  1954. 0, // 818
  1955. 0, // 819
  1956. 0, // 820
  1957. 0, // 821
  1958. 0, // 822
  1959. 0, // 823
  1960. (CPropEntry *) &aStaticList[114], // 824 'AUDIOSAMPLESIZE'
  1961. 0, // 825
  1962. 0, // 826
  1963. 0, // 827
  1964. 0, // 828
  1965. 0, // 829
  1966. 0, // 830
  1967. 0, // 831
  1968. (CPropEntry *) &aStaticList[85], // 832 'MEDIAPRODUCTION'
  1969. 0, // 833
  1970. 0, // 834
  1971. 0, // 835
  1972. 0, // 836
  1973. 0, // 837
  1974. 0, // 838
  1975. 0, // 839
  1976. 0, // 840
  1977. (CPropEntry *) &aStaticList[26], // 841 'DOCLASTAUTHOR'
  1978. 0, // 842
  1979. 0, // 843
  1980. 0, // 844
  1981. (CPropEntry *) &aStaticList[25], // 845 'DOCTEMPLATE'
  1982. (CPropEntry *) &aStaticList[28], // 846 'DOCEDITTIME'
  1983. 0, // 847
  1984. 0, // 848
  1985. 0, // 849
  1986. 0, // 850
  1987. 0, // 851
  1988. 0, // 852
  1989. 0, // 853
  1990. 0, // 854
  1991. 0, // 855
  1992. 0, // 856
  1993. 0, // 857
  1994. 0, // 858
  1995. 0, // 859
  1996. 0, // 860
  1997. 0, // 861
  1998. 0, // 862
  1999. 0, // 863
  2000. 0, // 864
  2001. 0, // 865
  2002. 0, // 866
  2003. 0, // 867
  2004. 0, // 868
  2005. (CPropEntry *) &aStaticList[27], // 869 'DOCREVNUMBER'
  2006. (CPropEntry *) &aStaticList[109], // 870 'IMAGEDIMENSIONS'
  2007. (CPropEntry *) &aStaticList[43], // 871 'DOCSLIDECOUNT'
  2008. (CPropEntry *) &aStaticList[105], // 872 'IMAGECOMPRESSION'
  2009. 0, // 873
  2010. 0, // 874
  2011. 0, // 875
  2012. 0, // 876
  2013. 0, // 877
  2014. 0, // 878
  2015. 0, // 879
  2016. 0, // 880
  2017. 0, // 881
  2018. 0, // 882
  2019. 0, // 883
  2020. 0, // 884
  2021. 0, // 885
  2022. (CPropEntry *) &aStaticList[69], // 886 'MSGNEWSGROUPS'
  2023. 0, // 887
  2024. 0, // 888
  2025. 0, // 889
  2026. 0, // 890
  2027. 0, // 891
  2028. 0, // 892
  2029. 0, // 893
  2030. 0, // 894
  2031. 0, // 895
  2032. 0, // 896
  2033. 0, // 897
  2034. 0, // 898
  2035. 0, // 899
  2036. 0, // 900
  2037. 0, // 901
  2038. 0, // 902
  2039. 0, // 903
  2040. (CPropEntry *) &aStaticList[1], // 904 'CLASSID'
  2041. 0, // 905
  2042. 0, // 906
  2043. 0, // 907
  2044. 0, // 908
  2045. 0, // 909
  2046. 0, // 910
  2047. 0, // 911
  2048. 0, // 912
  2049. 0, // 913
  2050. 0, // 914
  2051. 0, // 915
  2052. 0, // 916
  2053. 0, // 917
  2054. 0, // 918
  2055. 0, // 919
  2056. 0, // 920
  2057. 0, // 921
  2058. 0, // 922
  2059. 0, // 923
  2060. 0, // 924
  2061. 0, // 925
  2062. 0, // 926
  2063. 0, // 927
  2064. 0, // 928
  2065. 0, // 929
  2066. 0, // 930
  2067. 0, // 931
  2068. 0, // 932
  2069. 0, // 933
  2070. 0, // 934
  2071. 0, // 935
  2072. 0, // 936
  2073. 0, // 937
  2074. 0, // 938
  2075. 0, // 939
  2076. 0, // 940
  2077. 0, // 941
  2078. 0, // 942
  2079. (CPropEntry *) &aStaticList[91], // 943 'MUSICTRACK'
  2080. 0, // 944
  2081. 0, // 945
  2082. (CPropEntry *) &aStaticList[0], // 946 'DIRECTORY'
  2083. 0, // 947
  2084. 0, // 948
  2085. 0, // 949
  2086. 0, // 950
  2087. 0, // 951
  2088. 0, // 952
  2089. 0, // 953
  2090. 0, // 954
  2091. 0, // 955
  2092. 0, // 956
  2093. (CPropEntry *) &aStaticList[96], // 957 'DRMPLAYSTARTS'
  2094. 0, // 958
  2095. 0, // 959
  2096. 0, // 960
  2097. 0, // 961
  2098. 0, // 962
  2099. 0, // 963
  2100. 0, // 964
  2101. 0, // 965
  2102. 0, // 966
  2103. 0, // 967
  2104. 0, // 968
  2105. 0, // 969
  2106. 0, // 970
  2107. 0, // 971
  2108. 0, // 972
  2109. (CPropEntry *) &aStaticList[5], // 973 'PATH'
  2110. 0, // 974
  2111. 0, // 975
  2112. 0, // 976
  2113. 0, // 977
  2114. (CPropEntry *) &aStaticList[13], // 978 'SHORTFILENAME'
  2115. (CPropEntry *) &aStaticList[18], // 979 'ALL'
  2116. 0, // 980
  2117. 0, // 981
  2118. 0, // 982
  2119. 0, // 983
  2120. 0, // 984
  2121. 0, // 985
  2122. 0, // 986
  2123. (CPropEntry *) &aStaticList[15], // 987 'RANK'
  2124. 0, // 988
  2125. (CPropEntry *) &aStaticList[84], // 989 'MEDIARATING'
  2126. 0, // 990
  2127. 0, // 991
  2128. (CPropEntry *) &aStaticList[23], // 992 'DOCKEYWORDS'
  2129. 0, // 993
  2130. 0, // 994
  2131. 0, // 995
  2132. 0, // 996
  2133. 0, // 997
  2134. 0, // 998
  2135. 0, // 999
  2136. 0, // 1000
  2137. 0, // 1001
  2138. 0, // 1002
  2139. 0, // 1003
  2140. 0, // 1004
  2141. (CPropEntry *) &aStaticList[94], // 1005 'DRMDESCRIPTION'
  2142. 0, // 1006
  2143. 0, // 1007
  2144. 0, // 1008
  2145. 0, // 1009
  2146. 0, // 1010
  2147. 0, // 1011
  2148. 0, // 1012
  2149. 0, // 1013
  2150. 0, // 1014
  2151. 0, // 1015
  2152. 0, // 1016
  2153. 0, // 1017
  2154. 0, // 1018
  2155. 0, // 1019
  2156. (CPropEntry *) &aStaticList[16], // 1020 'HITCOUNT'
  2157. (CPropEntry *) &aStaticList[68], // 1021 'MSGNEWSGROUP'
  2158. 0, // 1022
  2159. 0, // 1023
  2160. 0, // 1024
  2161. (CPropEntry *) &aStaticList[121], // 1025 'VIDEOFRAMERATE'
  2162. 0, // 1026
  2163. 0, // 1027
  2164. 0, // 1028
  2165. 0, // 1029
  2166. (CPropEntry *) &aStaticList[124], // 1030 'VIDEOCOMPRESSION'
  2167. 0, // 1031
  2168. 0, // 1032
  2169. 0, // 1033
  2170. 0, // 1034
  2171. (CPropEntry *) &aStaticList[98], // 1035 'IMAGEFILETYPE'
  2172. 0, // 1036
  2173. 0, // 1037
  2174. 0, // 1038
  2175. 0, // 1039
  2176. 0, // 1040
  2177. (CPropEntry *) &aStaticList[90], // 1041 'MUSICCOMMENT'
  2178. 0, // 1042
  2179. (CPropEntry *) &aStaticList[119], // 1043 'VIDEOTIMELENGTH'
  2180. 0, // 1044
  2181. 0, // 1045
  2182. 0, // 1046
  2183. 0, // 1047
  2184. 0, // 1048
  2185. 0, // 1049
  2186. 0, // 1050
  2187. 0, // 1051
  2188. 0, // 1052
  2189. 0, // 1053
  2190. 0, // 1054
  2191. 0, // 1055
  2192. 0, // 1056
  2193. 0, // 1057
  2194. (CPropEntry *) &aStaticList[42], // 1058 'DOCPARACOUNT'
  2195. 0, // 1059
  2196. 0, // 1060
  2197. 0, // 1061
  2198. (CPropEntry *) &aStaticList[89], // 1062 'MUSICYEAR'
  2199. 0, // 1063
  2200. 0, // 1064
  2201. 0, // 1065
  2202. 0, // 1066
  2203. 0, // 1067
  2204. 0, // 1068
  2205. 0, // 1069
  2206. 0, // 1070
  2207. 0, // 1071
  2208. 0, // 1072
  2209. 0, // 1073
  2210. 0, // 1074
  2211. 0, // 1075
  2212. 0, // 1076
  2213. 0, // 1077
  2214. 0, // 1078
  2215. 0, // 1079
  2216. 0, // 1080
  2217. 0, // 1081
  2218. 0, // 1082
  2219. 0, // 1083
  2220. 0, // 1084
  2221. 0, // 1085
  2222. 0, // 1086
  2223. 0, // 1087
  2224. 0, // 1088
  2225. 0, // 1089
  2226. (CPropEntry *) &aStaticList[117], // 1090 'VIDEOFRAMEWIDTH'
  2227. 0, // 1091
  2228. 0, // 1092
  2229. 0, // 1093
  2230. 0, // 1094
  2231. (CPropEntry *) &aStaticList[65], // 1095 'NEWSDATE'
  2232. 0, // 1096
  2233. 0, // 1097
  2234. 0, // 1098
  2235. 0, // 1099
  2236. 0, // 1100
  2237. 0, // 1101
  2238. 0, // 1102
  2239. (CPropEntry *) &aStaticList[6], // 1103 'SIZE'
  2240. (CPropEntry *) &aStaticList[19], // 1104 'VPATH'
  2241. 0, // 1105
  2242. 0, // 1106
  2243. 0, // 1107
  2244. 0, // 1108
  2245. (CPropEntry *) &aStaticList[87], // 1109 'MUSICSONGTITLE'
  2246. 0, // 1110
  2247. 0, // 1111
  2248. 0, // 1112
  2249. 0, // 1113
  2250. 0, // 1114
  2251. 0, // 1115
  2252. 0, // 1116
  2253. 0, // 1117
  2254. 0, // 1118
  2255. 0, // 1119
  2256. 0, // 1120
  2257. 0, // 1121
  2258. 0, // 1122
  2259. 0, // 1123
  2260. 0, // 1124
  2261. 0, // 1125
  2262. 0, // 1126
  2263. 0, // 1127
  2264. 0, // 1128
  2265. 0, // 1129
  2266. 0, // 1130
  2267. 0, // 1131
  2268. 0, // 1132
  2269. 0, // 1133
  2270. 0, // 1134
  2271. 0, // 1135
  2272. 0, // 1136
  2273. 0, // 1137
  2274. 0, // 1138
  2275. 0, // 1139
  2276. 0, // 1140
  2277. 0, // 1141
  2278. 0, // 1142
  2279. 0, // 1143
  2280. 0, // 1144
  2281. 0, // 1145
  2282. 0, // 1146
  2283. 0, // 1147
  2284. 0, // 1148
  2285. 0, // 1149
  2286. (CPropEntry *) &aStaticList[9], // 1150 'CREATE'
  2287. 0, // 1151
  2288. 0, // 1152
  2289. 0, // 1153
  2290. 0, // 1154
  2291. 0, // 1155
  2292. (CPropEntry *) &aStaticList[2], // 1156 'FILEINDEX'
  2293. (CPropEntry *) &aStaticList[116], // 1157 'VIDEOSTREAMNAME'
  2294. 0, // 1158
  2295. 0, // 1159
  2296. (CPropEntry *) &aStaticList[58], // 1160 'CHARACTERIZATION'
  2297. (CPropEntry *) &aStaticList[4], // 1161 'FILENAME'
  2298. 0, // 1162
  2299. 0, // 1163
  2300. 0, // 1164
  2301. 0, // 1165
  2302. 0, // 1166
  2303. 0, // 1167
  2304. 0, // 1168
  2305. 0, // 1169
  2306. 0, // 1170
  2307. (CPropEntry *) &aStaticList[3], // 1171 'USN'
  2308. 0, // 1172
  2309. 0, // 1173
  2310. 0, // 1174
  2311. (CPropEntry *) &aStaticList[74], // 1175 'MSGDATE'
  2312. 0, // 1176
  2313. 0, // 1177
  2314. 0, // 1178
  2315. 0, // 1179
  2316. 0, // 1180
  2317. 0, // 1181
  2318. 0, // 1182
  2319. 0, // 1183
  2320. 0, // 1184
  2321. 0, // 1185
  2322. 0, // 1186
  2323. 0, // 1187
  2324. 0, // 1188
  2325. 0, // 1189
  2326. 0, // 1190
  2327. 0, // 1191
  2328. 0, // 1192
  2329. 0, // 1193
  2330. 0, // 1194
  2331. 0, // 1195
  2332. 0, // 1196
  2333. 0, // 1197
  2334. 0, // 1198
  2335. 0, // 1199
  2336. 0, // 1200
  2337. 0, // 1201
  2338. 0, // 1202
  2339. 0, // 1203
  2340. 0, // 1204
  2341. 0, // 1205
  2342. 0, // 1206
  2343. 0, // 1207
  2344. 0, // 1208
  2345. 0, // 1209
  2346. 0, // 1210
  2347. 0, // 1211
  2348. 0, // 1212
  2349. (CPropEntry *) &aStaticList[86], // 1213 'MUSICARTIST'
  2350. 0, // 1214
  2351. 0, // 1215
  2352. 0, // 1216
  2353. (CPropEntry *) &aStaticList[32], // 1217 'DOCPAGECOUNT'
  2354. 0, // 1218
  2355. 0, // 1219
  2356. 0, // 1220
  2357. 0, // 1221
  2358. (CPropEntry *) &aStaticList[118], // 1222 'VIDEOFRAMEHEIGHT'
  2359. 0, // 1223
  2360. 0, // 1224
  2361. 0, // 1225
  2362. (CPropEntry *) &aStaticList[8], // 1226 'WRITE'
  2363. 0, // 1227
  2364. 0, // 1228
  2365. 0, // 1229
  2366. 0, // 1230
  2367. 0, // 1231
  2368. 0, // 1232
  2369. 0, // 1233
  2370. 0, // 1234
  2371. 0, // 1235
  2372. 0, // 1236
  2373. 0, // 1237
  2374. 0, // 1238
  2375. 0, // 1239
  2376. 0, // 1240
  2377. 0, // 1241
  2378. 0, // 1242
  2379. 0, // 1243
  2380. 0, // 1244
  2381. 0, // 1245
  2382. (CPropEntry *) &aStaticList[36], // 1246 'DOCAPPNAME'
  2383. (CPropEntry *) &aStaticList[71], // 1247 'MSGSUBJECT'
  2384. 0, // 1248
  2385. 0, // 1249
  2386. 0, // 1250
  2387. 0, // 1251
  2388. 0, // 1252
  2389. 0, // 1253
  2390. 0, // 1254
  2391. 0, // 1255
  2392. 0, // 1256
  2393. 0, // 1257
  2394. 0, // 1258
  2395. (CPropEntry *) &aStaticList[63], // 1259 'NEWSFROM'
  2396. 0, // 1260
  2397. 0, // 1261
  2398. 0, // 1262
  2399. 0, // 1263
  2400. (CPropEntry *) &aStaticList[95], // 1264 'DRMPLAYCOUNT'
  2401. (CPropEntry *) &aStaticList[17], // 1265 'WORKID'
  2402. 0, // 1266
  2403. 0, // 1267
  2404. 0, // 1268
  2405. 0, // 1269
  2406. 0, // 1270
  2407. 0, // 1271
  2408. 0, // 1272
  2409. 0, // 1273
  2410. 0, // 1274
  2411. 0, // 1275
  2412. 0, // 1276
  2413. 0, // 1277
  2414. 0, // 1278
  2415. 0, // 1279
  2416. 0, // 1280
  2417. (CPropEntry *) &aStaticList[30], // 1281 'DOCCREATEDTM'
  2418. 0, // 1282
  2419. 0, // 1283
  2420. 0, // 1284
  2421. 0, // 1285
  2422. 0, // 1286
  2423. 0, // 1287
  2424. 0, // 1288
  2425. (CPropEntry *) &aStaticList[11], // 1289 'ALLOCSIZE'
  2426. 0, // 1290
  2427. 0, // 1291
  2428. 0, // 1292
  2429. (CPropEntry *) &aStaticList[107], // 1293 'IMAGEGAMMAVALUE'
  2430. 0, // 1294
  2431. 0, // 1295
  2432. 0, // 1296
  2433. 0, // 1297
  2434. 0, // 1298
  2435. 0, // 1299
  2436. 0, // 1300
  2437. 0, // 1301
  2438. 0, // 1302
  2439. 0, // 1303
  2440. 0, // 1304
  2441. 0, // 1305
  2442. 0, // 1306
  2443. 0, // 1307
  2444. 0, // 1308
  2445. 0, // 1309
  2446. 0, // 1310
  2447. };
  2448. BOOL ParseGuid( WCHAR * pUgly, GUID & guid )
  2449. {
  2450. //
  2451. // Convert classid string to guid. Don't use wsscanf. We're scanning
  2452. // into *bytes*, but wsscanf assumes result locations are *dwords*.
  2453. // Thus a write to the last few bytes of the guid writes over other
  2454. // memory!
  2455. //
  2456. //
  2457. // A GUID MUST be of the form:
  2458. // XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  2459. //
  2460. // The guid MUST be 36 characters in length
  2461. // There MUST be a '-' in the 8th, 13th, & 18th position.
  2462. // The 1st number MUST be 8 digits long
  2463. // The 2nd, 3rd & 4th numbers MUST be 4 digits long
  2464. // The 5th number must be 12 digits long
  2465. if ( (36 != wcslen(pUgly) ) ||
  2466. (L'-' != pUgly[8]) ||
  2467. (L'-' != pUgly[13]) ||
  2468. (L'-' != pUgly[18]) )
  2469. {
  2470. return FALSE;
  2471. }
  2472. WCHAR wc = pUgly[8];
  2473. pUgly[8] = 0;
  2474. WCHAR * pwcStart = &pUgly[0];
  2475. WCHAR * pwcEnd;
  2476. guid.Data1 = wcstoul( pwcStart, &pwcEnd, 16 );
  2477. pUgly[8] = wc;
  2478. if ( (pwcEnd-pwcStart) != 8 ) // The 1st number MUST be 8 digits long
  2479. return FALSE;
  2480. wc = pUgly[13];
  2481. pUgly[13] = 0;
  2482. pwcStart = &pUgly[9];
  2483. guid.Data2 = (USHORT)wcstoul( pwcStart, &pwcEnd, 16 );
  2484. pUgly[13] = wc;
  2485. if ( (pwcEnd-pwcStart) != 4 ) // The 2nd number MUST be 4 digits long
  2486. return FALSE;
  2487. wc = pUgly[18];
  2488. pUgly[18] = 0;
  2489. pwcStart = &pUgly[14];
  2490. guid.Data3 = (USHORT)wcstoul( pwcStart, &pwcEnd, 16 );
  2491. pUgly[18] = wc;
  2492. if ( (pwcEnd-pwcStart) != 4 ) // The 3rd number MUST be 4 digits long
  2493. return FALSE;
  2494. wc = pUgly[21];
  2495. pUgly[21] = 0;
  2496. pwcStart = &pUgly[19];
  2497. guid.Data4[0] = (unsigned char)wcstoul( pwcStart, &pwcEnd, 16 );
  2498. pUgly[21] = wc;
  2499. if ( (pwcEnd-pwcStart) != 2 ) // The 4th number MUST be 4 digits long
  2500. return FALSE;
  2501. wc = pUgly[23];
  2502. pUgly[23] = 0;
  2503. pwcStart = &pUgly[21];
  2504. guid.Data4[1] = (unsigned char)wcstoul( pwcStart, &pwcEnd, 16 );
  2505. pUgly[23] = wc;
  2506. if ( (pwcEnd-pwcStart) != 2 ) // The 4th number MUST be 4 digits long
  2507. return FALSE;
  2508. for ( unsigned i = 0; i < 6; i++ )
  2509. {
  2510. wc = pUgly[26+i*2];
  2511. pUgly[26+i*2] = 0;
  2512. pwcStart = &pUgly[24+i*2];
  2513. guid.Data4[2+i] = (unsigned char)wcstoul( pwcStart, &pwcEnd, 16 );
  2514. pUgly[26+i*2] = wc;
  2515. if ( pwcStart == pwcEnd )
  2516. return FALSE;
  2517. }
  2518. return TRUE;
  2519. } //ParseGuid