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