Source code of Windows XP (NT5)
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.

181 lines
7.6 KiB

  1. //
  2. // Microsoft Windows
  3. // Copyright (C) Microsoft Corporation, 1992 - 2000
  4. //
  5. // File: querybld.h
  6. //
  7. // Contents: Contains declarations of functions to build query.
  8. //
  9. // History: 24-Sep-2000 Hiteshr Created
  10. //
  11. //
  12. //--------------------------------------------------------------------------
  13. //+--------------------------------------------------------------------------
  14. //
  15. // Function: CommonFilterFunc
  16. //
  17. // Synopsis: This function takes the input filter from the commandline
  18. // and converts it into ldapfilter.
  19. // For ex -user (ab* | bc*) is converted to |(cn=ab*)(cn=bc*)
  20. // The pEntry->pszName given the attribute name to use in
  21. // filter( cn in above example).
  22. //
  23. // Arguments: [pRecord - IN] : the command line argument structure used
  24. // to retrieve the filter entered by user
  25. // [pObjectEntry - IN] : pointer to the DSQUERY_ATTR_TABLE_ENTRY
  26. // which has info on attribute corresponding
  27. // switch in pRecord
  28. // [pVoid - IN] :Not used.
  29. // [strFilter - OUT] :Contains the output filter.
  30. // Returns: HRESULT : S_OK if everything succeeded
  31. // E_INVALIDARG if the object entry wasn't found
  32. // Anything else is a failure code from an ADSI call
  33. //
  34. // History: 25-Sep-2000 hiteshr Created
  35. //
  36. //---------------------------------------------------------------------------
  37. HRESULT CommonFilterFunc(IN DSQUERY_ATTR_TABLE_ENTRY *pEntry,
  38. IN ARG_RECORD* pRecord,
  39. IN PVOID pVoid,
  40. OUT CComBSTR& strFilter);
  41. //+--------------------------------------------------------------------------
  42. //
  43. // Function: StarFilterFunc
  44. //
  45. // Synopsis: Filter Function for dsquery *. It returns the value of
  46. // -filter flag.
  47. //
  48. // Arguments: [pRecord - IN] : the command line argument structure used
  49. // to retrieve the filter entered by user
  50. // [pObjectEntry - IN] : pointer to the DSQUERY_ATTR_TABLE_ENTRY
  51. // which has info on attribute corresponding
  52. // switch in pRecord
  53. // [pVoid - IN] :Not used.
  54. // [strFilter - OUT] :Contains the output filter.
  55. // Returns: HRESULT : S_OK if everything succeeded
  56. // E_INVALIDARG if the object entry wasn't found
  57. // Anything else is a failure code from an ADSI call
  58. //
  59. // History: 25-Sep-2000 hiteshr Created
  60. //
  61. //---------------------------------------------------------------------------
  62. HRESULT StarFilterFunc(IN DSQUERY_ATTR_TABLE_ENTRY *pEntry,
  63. IN ARG_RECORD* pRecord,
  64. IN PVOID pVoid,
  65. OUT CComBSTR& strFilter);
  66. //
  67. // Function: DisabledFilterFunc
  68. //
  69. // Synopsis: Filter Function for account disabled query.
  70. //
  71. // Arguments: [pRecord - IN] : Not Used
  72. // [pObjectEntry - IN] : Not Used
  73. // [pVoid - IN] :Not used.
  74. // [strFilter - OUT] :Contains the output filter.
  75. // Returns: HRESULT : S_OK if everything succeeded
  76. // E_INVALIDARG if the object entry wasn't found
  77. // Anything else is a failure code from an ADSI call
  78. //
  79. // History: 25-Sep-2000 hiteshr Created
  80. //
  81. //---------------------------------------------------------------------------
  82. HRESULT DisabledFilterFunc(IN DSQUERY_ATTR_TABLE_ENTRY *,
  83. IN ARG_RECORD* ,
  84. IN PVOID ,
  85. OUT CComBSTR& strFilter);
  86. //+--------------------------------------------------------------------------
  87. //
  88. // Function: InactiveFilterFunc
  89. //
  90. // Synopsis: Filter Function for account disabled query.
  91. //
  92. // Arguments: [pRecord - IN] : Not Used
  93. // [pObjectEntry - IN] : Not Used
  94. // [pVoid - IN] :Not used.
  95. // [strFilter - OUT] :Contains the output filter.
  96. // Returns: HRESULT : S_OK if everything succeeded
  97. // E_INVALIDARG if the object entry wasn't found
  98. // Anything else is a failure code from an ADSI call
  99. //
  100. // History: 25-Sep-2000 hiteshr Created
  101. //
  102. //---------------------------------------------------------------------------
  103. HRESULT InactiveFilterFunc(IN DSQUERY_ATTR_TABLE_ENTRY *pEntry,
  104. IN ARG_RECORD* pRecord,
  105. IN PVOID ,
  106. OUT CComBSTR& strFilter);
  107. //+--------------------------------------------------------------------------
  108. //
  109. // Function: StalepwdFilterFunc
  110. //
  111. // Synopsis: Filter Function for stale password query.
  112. //
  113. // Arguments: [pRecord - IN] : Not Used
  114. // [pObjectEntry - IN] : Not Used
  115. // [pVoid - IN] :Not used.
  116. // [strFilter - OUT] :Contains the output filter.
  117. // Returns: HRESULT : S_OK if everything succeeded
  118. // E_INVALIDARG if the object entry wasn't found
  119. // Anything else is a failure code from an ADSI call
  120. //
  121. // History: 25-Sep-2000 hiteshr Created
  122. //
  123. //---------------------------------------------------------------------------
  124. HRESULT StalepwdFilterFunc(IN DSQUERY_ATTR_TABLE_ENTRY *pEntry,
  125. IN ARG_RECORD* pRecord,
  126. IN PVOID ,
  127. OUT CComBSTR& strFilter);
  128. //+--------------------------------------------------------------------------
  129. //
  130. // Function: SubnetSiteFilterFunc
  131. //
  132. // Synopsis: Filter Function for -site switch in dsquery subnet.
  133. //
  134. // Arguments: [pEntry - IN] : Not Used
  135. // [pRecord - IN] : Command Line value supplied by user
  136. // [pVoid - IN] : suffix for the siteobject attribute.
  137. // [strFilter - OUT] :Contains the output filter.
  138. // Returns: HRESULT : S_OK if everything succeeded
  139. //
  140. // History: 24-April-2001 hiteshr Created
  141. //
  142. //---------------------------------------------------------------------------
  143. HRESULT SubnetSiteFilterFunc(IN DSQUERY_ATTR_TABLE_ENTRY *pEntry,
  144. IN ARG_RECORD* pRecord,
  145. IN PVOID pParam,
  146. OUT CComBSTR& strFilter);
  147. //+--------------------------------------------------------------------------
  148. //
  149. // Function: BuildQueryFilter
  150. //
  151. // Synopsis: This function builds the LDAP query filter for given object type.
  152. //
  153. // Arguments: [pCommandArgs - IN] :the command line argument structure used
  154. // to retrieve the values of switches
  155. // [pObjectEntry - IN] :Contains info about the object type
  156. // [pParam -IN] :This value is passed to filter function.
  157. // [strLDAPFilter - OUT] :Contains the output filter.
  158. // Returns: HRESULT : S_OK if everything succeeded
  159. // E_INVALIDARG if the object entry wasn't found
  160. // Anything else is a failure code from an ADSI call
  161. //
  162. // History: 25-Sep-2000 hiteshr Created
  163. //
  164. //---------------------------------------------------------------------------
  165. HRESULT BuildQueryFilter(PARG_RECORD pCommandArgs,
  166. PDSQueryObjectTableEntry pObjectEntry,
  167. PVOID pParam,
  168. CComBSTR& strLDAPFilter);