home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / NTQUERY.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  8.8 KB  |  247 lines

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1996 - 1998 Microsoft Corporation-1997.
  5. //
  6. //  File:       NtQuery.h
  7. //
  8. //  Contents:   Main query header; Defines all exported query API
  9. //
  10. //----------------------------------------------------------------------------
  11.  
  12. #if !defined(__NTQUERY_H__)
  13. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  14. #define __NTQUERY_H__
  15.  
  16. #if defined(__cplusplus)
  17. extern "C"
  18. {
  19. #endif
  20.  
  21. //
  22. // Use this path for the null catalog, one that doesn't have an index.
  23. // Use it to search for properties of files that are not indexed.
  24. //
  25.  
  26. #define CINULLCATALOG L"::_noindex_::"
  27.  
  28. //
  29. // Minimal support for persistent handlers.
  30. //
  31.  
  32. STDAPI LoadIFilter( WCHAR const * pwcsPath,
  33.                     IUnknown *    pUnkOuter,
  34.                     void **       ppIUnk );
  35.  
  36. STDAPI BindIFilterFromStorage( IStorage * pStg,
  37.                                IUnknown * pUnkOuter,
  38.                                void **    ppIUnk );
  39.  
  40. STDAPI BindIFilterFromStream( IStream *  pStm,
  41.                               IUnknown * pUnkOuter,
  42.                               void **    ppIUnk );
  43.  
  44. STDAPI LocateCatalogsW( WCHAR const * pwszScope,
  45.                         ULONG         iBmk,
  46.                         WCHAR *       pwszMachine,
  47.                         ULONG *       pccMachine,
  48.                         WCHAR *       pwszCat,
  49.                         ULONG *       pccCat );
  50.  
  51. //
  52. // For calling from VB
  53. //
  54.  
  55. STDAPI LocateCatalogsA( char const * pwszScope,
  56.                         ULONG        iBmk,
  57.                         char  *      pwszMachine,
  58.                         ULONG *      pccMachine,
  59.                         char *       pwszCat,
  60.                         ULONG *      pccCat );
  61.  
  62. #ifdef UNICODE
  63. #define LocateCatalogs  LocateCatalogsW
  64. #else
  65. #define LocateCatalogs  LocateCatalogsA
  66. #endif // !UNICODE
  67.  
  68. // The Index Server Data Source Object CLSID
  69.  
  70. #define CLSID_INDEX_SERVER_DSO \
  71.     { 0xd7a2b01a, 0xa47d, 0x11d0, \
  72.       { 0x8c, 0x55, 0x0, 0xc0, 0x4f, 0xc2, 0xdb, 0x8d } }
  73.  
  74. // The storage property set
  75.  
  76. #define PSGUID_STORAGE \
  77.     { 0xb725f130, 0x47ef, 0x101a, \
  78.       { 0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac } }
  79.  
  80. //#define PID_STG_DICTIONARY            ((PROPID) 0x00000000) //reserved
  81. //#define PID_STG_CODEPAGE              ((PROPID) 0x00000001) //reserved
  82. #define PID_STG_DIRECTORY               ((PROPID) 0x00000002)
  83. #define PID_STG_CLASSID                 ((PROPID) 0x00000003)
  84. #define PID_STG_STORAGETYPE             ((PROPID) 0x00000004)
  85. #define PID_STG_VOLUME_ID               ((PROPID) 0x00000005)
  86. #define PID_STG_PARENT_WORKID           ((PROPID) 0x00000006)
  87. // unused #define PID_STG_              ((PROPID) 0x00000007)
  88. #define PID_STG_FILEINDEX               ((PROPID) 0x00000008)
  89. #define PID_STG_LASTCHANGEUSN           ((PROPID) 0x00000009)
  90. #define PID_STG_NAME                    ((PROPID) 0x0000000a)
  91. #define PID_STG_PATH                    ((PROPID) 0x0000000b)
  92. #define PID_STG_SIZE                    ((PROPID) 0x0000000c)
  93. #define PID_STG_ATTRIBUTES              ((PROPID) 0x0000000d)
  94. #define PID_STG_WRITETIME               ((PROPID) 0x0000000e)
  95. #define PID_STG_CREATETIME              ((PROPID) 0x0000000f)
  96. #define PID_STG_ACCESSTIME              ((PROPID) 0x00000010)
  97. // unused #define PID_STG_              ((PROPID) 0x00000011)
  98. #define PID_STG_ALLOCSIZE               ((PROPID) 0x00000012)
  99. #define PID_STG_CONTENTS                ((PROPID) 0x00000013)
  100. #define PID_STG_SHORTNAME               ((PROPID) 0x00000014)
  101. #define PID_STG_MAX                     PID_STG_SHORTNAME
  102. #define CSTORAGEPROPERTY                0x15
  103.  
  104. // File System Content Index Framework property set
  105.  
  106. #define DBPROPSET_FSCIFRMWRK_EXT \
  107.     { 0xA9BD1526, 0x6A80, 0x11D0, \
  108.       { 0x8C, 0x9D, 0x00, 0x20, 0xAF, 0x1D, 0x74, 0x0E } }
  109.  
  110. #define DBPROP_CI_CATALOG_NAME     2
  111. #define DBPROP_CI_INCLUDE_SCOPES   3
  112. #define DBPROP_CI_DEPTHS           4 // obsolete
  113. #define DBPROP_CI_SCOPE_FLAGS      4
  114. #define DBPROP_CI_EXCLUDE_SCOPES   5
  115. #define DBPROP_CI_SECURITY_ID      6
  116. #define DBPROP_CI_QUERY_TYPE       7
  117.  
  118. // Query Extension property set
  119.  
  120. #define DBPROPSET_QUERYEXT \
  121.     { 0xA7AC77ED, 0xF8D7, 0x11CE, \
  122.       { 0xA7, 0x98, 0x00, 0x20, 0xF8, 0x00, 0x80, 0x25 } }
  123.  
  124. #define DBPROP_USECONTENTINDEX           2
  125. #define DBPROP_DEFERNONINDEXEDTRIMMING   3
  126. #define DBPROP_USEEXTENDEDDBTYPES        4
  127.  
  128. // Content Index Framework Core property set
  129.  
  130. #define DBPROPSET_CIFRMWRKCORE_EXT \
  131.     { 0xafafaca5, 0xb5d1, 0x11d0, \
  132.       { 0x8c, 0x62, 0x00, 0xc0, 0x4f, 0xc2, 0xdb, 0x8d } }
  133.  
  134. #define DBPROP_MACHINE      2
  135. #define DBPROP_CLIENT_CLSID 3
  136.  
  137. // Scope flags
  138.  
  139. #define QUERY_SHALLOW        0
  140. #define QUERY_DEEP           1
  141. #define QUERY_PHYSICAL_PATH  0
  142. #define QUERY_VIRTUAL_PATH   2
  143.  
  144. // query property set (PSGUID_QUERY) properties not defined in oledb.h
  145.  
  146. #define PROPID_QUERY_WORKID        5
  147. #define PROPID_QUERY_UNFILTERED    7
  148. #define PROPID_QUERY_VIRTUALPATH   9
  149. #define PROPID_QUERY_LASTSEENTIME 10
  150.  
  151. #if defined __oledb_h__
  152.  
  153. typedef struct tagCIPROPERTYDEF
  154. {
  155.     LPWSTR wcsFriendlyName;
  156.     DWORD  dbType;
  157.     DBID   dbCol;
  158. } CIPROPERTYDEF;
  159.  
  160. //
  161. // Create an ICommand, specifying scopes, catalogs, and machines
  162. // (obsolete)
  163. //
  164. STDAPI CIMakeICommand( ICommand **           ppCommand,
  165.                        ULONG                 cScope,
  166.                        DWORD const *         aDepths,
  167.                        WCHAR const * const * awcsScope,
  168.                        WCHAR const * const * awcsCatalogs,
  169.                        WCHAR const * const * awcsMachine );
  170.  
  171. //
  172. // Create an ICommand, specifying a catalog and machine
  173. //
  174.  
  175. STDAPI CICreateCommand( IUnknown **   ppCommand,     // New object
  176.                         IUnknown *    pUnkOuter,     // Outer unknown
  177.                         REFIID        riid,          // IID of returned object.
  178.                                                      // Must be IID_IUnknown unless pUnkOuter == 0
  179.                         WCHAR const * pwcsCatalog,   // Catalog
  180.                         WCHAR const * pwcsMachine ); // Machine
  181.  
  182. //
  183. // Convert pwszRestriction in Triplish to a command tree.
  184. //
  185. STDAPI CITextToSelectTree( WCHAR const *     pwszRestriction,
  186.                            DBCOMMANDTREE * * ppTree,
  187.                            ULONG             cProperties,
  188.              /*optional*/  CIPROPERTYDEF *   pProperties,
  189.                            LCID              LocaleID );
  190.  
  191. //
  192. // Convert pwszRestriction in Triplish, project columns, sort columns
  193. // and grouping columns to a command tree.
  194. //
  195. STDAPI CITextToFullTree( WCHAR const *     pwszRestriction,
  196.                          WCHAR const *     pwszColumns,
  197.                          WCHAR const *     pwszSortColumns, // may be NULL
  198.                          WCHAR const *     pwszGroupings,   // may be NULL
  199.                          DBCOMMANDTREE * * ppTree,
  200.                          ULONG             cProperties,
  201.            /*optional*/  CIPROPERTYDEF *   pProperties,
  202.                          LCID              LocaleID );
  203. //
  204. // Build a simple restriction node.
  205. //
  206.  
  207. STDAPI CIBuildQueryNode( WCHAR const *wcsProperty,    // friendly property name
  208.                          DBCOMMANDOP dbOperator,    // enumerated constant
  209.                          PROPVARIANT const *pvarPropertyValue, // value of the property
  210.                          DBCOMMANDTREE ** ppTree, // ptr to tree returned here. should be non-null
  211.                          ULONG cProperties,
  212.                          CIPROPERTYDEF const * pProperty, // Can be 0.
  213.                          LCID LocaleID );  // locale id to interpret strings
  214.  
  215. //
  216. // Build a restriction tree from an existing tree (could be empty) and a newly added node/tree.
  217. //
  218.  
  219. STDAPI CIBuildQueryTree( DBCOMMANDTREE const *pExistingTree,  // existing tree. can be null.
  220.                          DBCOMMANDOP dbBoolOp,   // enumerator constant
  221.                          ULONG cSiblings, // number of siblings in the array
  222.                          DBCOMMANDTREE const * const *ppSibsToCombine,
  223.                          DBCOMMANDTREE ** ppTree);   // ptr to tree returned here. should be non-null
  224.  
  225. //
  226. // Convert restriction tree, project columns, sort columns
  227. // and grouping columns to a command tree.
  228. //
  229. STDAPI CIRestrictionToFullTree( DBCOMMANDTREE const *pTree,
  230.                          WCHAR const * pwszColumns,
  231.                          WCHAR const * pwszSortColumns, // may be NULL
  232.                          WCHAR const * pwszGroupings,   // may be NULL
  233.                          DBCOMMANDTREE * * ppTree,
  234.                          ULONG cProperties,
  235.            /*optional*/  CIPROPERTYDEF * pReserved,
  236.                          LCID LocaleID );
  237.  
  238. #endif  // __oledb_h__
  239.  
  240. #if defined(__cplusplus)
  241. }
  242. #endif
  243.  
  244. #pragma option pop /*P_O_Pop*/
  245. #endif // __NTQUERY_H__
  246.  
  247.