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.

525 lines
11 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. FiltProp.cpp
  5. Abstract:
  6. Private Filter Property Sets
  7. --*/
  8. #include "PhilTune.h"
  9. /*
  10. ** SetVsbResetProperty ()
  11. **
  12. .
  13. **
  14. ** Arguments:
  15. **
  16. **
  17. ** Returns:
  18. **
  19. ** Side Effects: none
  20. */
  21. NTSTATUS
  22. CFilter::
  23. SetVsbResetProperty(
  24. IN PIRP pIrp,
  25. IN PKSPROPERTY pKSProperty,
  26. IN PKSPROPERTY_VSB_CTRL_S pProperty
  27. )
  28. {
  29. NTSTATUS Status = STATUS_SUCCESS;
  30. CFilter * pFilter;
  31. ASSERT( pIrp);
  32. ASSERT( pKSProperty);
  33. ASSERT( pProperty);
  34. // Obtain a "this" pointer for the method.
  35. //
  36. // Because this function is called directly from the property dispatch
  37. // table, we must get our own pointer to the underlying object.
  38. //
  39. pFilter = FilterFromIRP( pIrp);
  40. ASSERT( pFilter);
  41. if (!pFilter)
  42. {
  43. Status = STATUS_INVALID_PARAMETER;
  44. goto errExit;
  45. }
  46. // Set the property.
  47. //
  48. Status = (pFilter->GetDevice())->VsbReset(pProperty->Value);
  49. errExit:
  50. return Status;
  51. }
  52. /*
  53. ** GetVsbCapabilitiesProperty ()
  54. **
  55. ** Example of a get property handler for a filter global property set.
  56. ** Use this as a template for adding support for filter global
  57. ** properties.
  58. **
  59. ** Arguments:
  60. **
  61. **
  62. ** Returns:
  63. **
  64. ** Side Effects: none
  65. */
  66. NTSTATUS
  67. CFilter::
  68. GetVsbCapabilitiesProperty(
  69. IN PIRP pIrp,
  70. IN PKSPROPERTY pKSProperty,
  71. OUT PKSPROPERTY_VSB_CAP_S pProperty
  72. )
  73. {
  74. NTSTATUS Status = STATUS_SUCCESS;
  75. CFilter * pFilter;
  76. ASSERT( pIrp);
  77. ASSERT( pKSProperty);
  78. ASSERT( pProperty);
  79. // Obtain a "this" pointer for the method.
  80. //
  81. // Because this function is called directly from the property dispatch
  82. // table, we must get our own pointer to the underlying object.
  83. //
  84. pFilter = FilterFromIRP( pIrp);
  85. ASSERT( pFilter);
  86. if (!pFilter)
  87. {
  88. Status = STATUS_INVALID_PARAMETER;
  89. goto errExit;
  90. }
  91. // Return the property
  92. //
  93. Status = (pFilter->GetDevice())->GetVsbCapabilities(pProperty);
  94. errExit:
  95. return Status;
  96. }
  97. /*
  98. ** SetVsbCapabilitiesProperty ()
  99. **
  100. ** Example of a set property handler for a filter global property set.
  101. ** Use this as a template for adding support for filter global
  102. ** properties.
  103. **
  104. ** Arguments:
  105. **
  106. **
  107. ** Returns:
  108. **
  109. ** Side Effects: none
  110. */
  111. NTSTATUS
  112. CFilter::
  113. SetVsbCapabilitiesProperty(
  114. IN PIRP pIrp,
  115. IN PKSPROPERTY pKSProperty,
  116. IN PKSPROPERTY_VSB_CAP_S pProperty
  117. )
  118. {
  119. NTSTATUS Status = STATUS_SUCCESS;
  120. CFilter * pFilter;
  121. ASSERT( pIrp);
  122. ASSERT( pKSProperty);
  123. ASSERT( pProperty);
  124. // Obtain a "this" pointer for the method.
  125. //
  126. // Because this function is called directly from the property dispatch
  127. // table, we must get our own pointer to the underlying object.
  128. //
  129. pFilter = FilterFromIRP( pIrp);
  130. ASSERT( pFilter);
  131. if (!pFilter)
  132. {
  133. Status = STATUS_INVALID_PARAMETER;
  134. goto errExit;
  135. }
  136. // Set the property.
  137. //
  138. Status = (pFilter->GetDevice())->SetVsbCapabilities(pProperty);
  139. errExit:
  140. return Status;
  141. }
  142. /*
  143. ** GetVsbRegisterProperty ()
  144. **
  145. ** Example of a get property handler for a filter global property set.
  146. ** Use this as a template for adding support for filter global
  147. ** properties.
  148. **
  149. ** Arguments:
  150. **
  151. **
  152. ** Returns:
  153. **
  154. ** Side Effects: none
  155. */
  156. NTSTATUS
  157. CFilter::
  158. GetVsbRegisterProperty(
  159. IN PIRP pIrp,
  160. IN PKSPROPERTY pKSProperty,
  161. OUT PKSPROPERTY_VSB_REG_CTRL_S pProperty
  162. )
  163. {
  164. NTSTATUS Status = STATUS_SUCCESS;
  165. CFilter * pFilter;
  166. ASSERT( pIrp);
  167. ASSERT( pKSProperty);
  168. ASSERT( pProperty);
  169. // Obtain a "this" pointer for the method.
  170. //
  171. // Because this function is called directly from the property dispatch
  172. // table, we must get our own pointer to the underlying object.
  173. //
  174. pFilter = FilterFromIRP( pIrp);
  175. ASSERT( pFilter);
  176. if (!pFilter)
  177. {
  178. Status = STATUS_INVALID_PARAMETER;
  179. goto errExit;
  180. }
  181. // Return the property
  182. //
  183. Status = (pFilter->GetDevice())->AccessRegisterList(pProperty, READ_REGISTERS);
  184. errExit:
  185. return Status;
  186. }
  187. /*
  188. ** SetVsbRegisterProperty ()
  189. **
  190. ** Example of a set property handler for a filter global property set.
  191. ** Use this as a template for adding support for filter global
  192. ** properties.
  193. **
  194. ** Arguments:
  195. **
  196. **
  197. ** Returns:
  198. **
  199. ** Side Effects: none
  200. */
  201. NTSTATUS
  202. CFilter::
  203. SetVsbRegisterProperty(
  204. IN PIRP pIrp,
  205. IN PKSPROPERTY pKSProperty,
  206. IN PKSPROPERTY_VSB_REG_CTRL_S pProperty
  207. )
  208. {
  209. NTSTATUS Status = STATUS_SUCCESS;
  210. CFilter * pFilter;
  211. ASSERT( pIrp);
  212. ASSERT( pKSProperty);
  213. ASSERT( pProperty);
  214. // Obtain a "this" pointer for the method.
  215. //
  216. // Because this function is called directly from the property dispatch
  217. // table, we must get our own pointer to the underlying object.
  218. //
  219. pFilter = FilterFromIRP( pIrp);
  220. ASSERT( pFilter);
  221. if (!pFilter)
  222. {
  223. Status = STATUS_INVALID_PARAMETER;
  224. goto errExit;
  225. }
  226. // Set the property.
  227. //
  228. Status = (pFilter->GetDevice())->AccessRegisterList(pProperty, WRITE_REGISTERS);
  229. errExit:
  230. return Status;
  231. }
  232. /*
  233. ** GetVsbCoefficientProperty ()
  234. **
  235. ** Example of a get property handler for a filter global property set.
  236. ** Use this as a template for adding support for filter global
  237. ** properties.
  238. **
  239. ** Arguments:
  240. **
  241. **
  242. ** Returns:
  243. **
  244. ** Side Effects: none
  245. */
  246. NTSTATUS
  247. CFilter::
  248. GetVsbCoefficientProperty(
  249. IN PIRP pIrp,
  250. IN PKSPROPERTY pKSProperty,
  251. OUT PKSPROPERTY_VSB_COEFF_CTRL_S pProperty
  252. )
  253. {
  254. NTSTATUS Status = STATUS_SUCCESS;
  255. CFilter * pFilter;
  256. ASSERT( pIrp);
  257. ASSERT( pKSProperty);
  258. ASSERT( pProperty);
  259. // Obtain a "this" pointer for the method.
  260. //
  261. // Because this function is called directly from the property dispatch
  262. // table, we must get our own pointer to the underlying object.
  263. //
  264. pFilter = FilterFromIRP( pIrp);
  265. ASSERT( pFilter);
  266. if (!pFilter)
  267. {
  268. Status = STATUS_INVALID_PARAMETER;
  269. goto errExit;
  270. }
  271. // Return the property
  272. //
  273. Status = (pFilter->GetDevice())->AccessVsbCoeffList(pProperty, READ_REGISTERS);
  274. errExit:
  275. return Status;
  276. }
  277. /*
  278. ** SetVsbCoefficientProperty ()
  279. **
  280. ** Example of a set property handler for a filter global property set.
  281. ** Use this as a template for adding support for filter global
  282. ** properties.
  283. **
  284. ** Arguments:
  285. **
  286. **
  287. ** Returns:
  288. **
  289. ** Side Effects: none
  290. */
  291. NTSTATUS
  292. CFilter::
  293. SetVsbCoefficientProperty(
  294. IN PIRP pIrp,
  295. IN PKSPROPERTY pKSProperty,
  296. IN PKSPROPERTY_VSB_COEFF_CTRL_S pProperty
  297. )
  298. {
  299. NTSTATUS Status = STATUS_SUCCESS;
  300. CFilter * pFilter;
  301. ASSERT( pIrp);
  302. ASSERT( pKSProperty);
  303. ASSERT( pProperty);
  304. // Obtain a "this" pointer for the method.
  305. //
  306. // Because this function is called directly from the property dispatch
  307. // table, we must get our own pointer to the underlying object.
  308. //
  309. pFilter = FilterFromIRP( pIrp);
  310. ASSERT( pFilter);
  311. if (!pFilter)
  312. {
  313. Status = STATUS_INVALID_PARAMETER;
  314. goto errExit;
  315. }
  316. // Set the property.
  317. //
  318. Status = (pFilter->GetDevice())->AccessVsbCoeffList(pProperty, WRITE_REGISTERS);
  319. errExit:
  320. return Status;
  321. }
  322. /*
  323. ** GetVsbDiagControlProperty ()
  324. **
  325. ** Example of a get property handler for a filter global property set.
  326. ** Use this as a template for adding support for filter global
  327. ** properties.
  328. **
  329. ** Arguments:
  330. **
  331. **
  332. ** Returns:
  333. **
  334. ** Side Effects: none
  335. */
  336. NTSTATUS
  337. CFilter::
  338. GetVsbDiagControlProperty(
  339. IN PIRP pIrp,
  340. IN PKSPROPERTY pKSProperty,
  341. OUT PKSPROPERTY_VSB_DIAG_CTRL_S pProperty
  342. )
  343. {
  344. NTSTATUS Status = STATUS_SUCCESS;
  345. CFilter * pFilter;
  346. ASSERT( pIrp);
  347. ASSERT( pKSProperty);
  348. ASSERT( pProperty);
  349. // Obtain a "this" pointer for the method.
  350. //
  351. // Because this function is called directly from the property dispatch
  352. // table, we must get our own pointer to the underlying object.
  353. //
  354. pFilter = FilterFromIRP( pIrp);
  355. ASSERT( pFilter);
  356. if (!pFilter)
  357. {
  358. Status = STATUS_INVALID_PARAMETER;
  359. goto errExit;
  360. }
  361. // Return the property
  362. //
  363. Status = (pFilter->GetDevice())->GetVsbDiagMode(&pProperty->OperationMode,
  364. &pProperty->Type);
  365. errExit:
  366. return Status;
  367. }
  368. /*
  369. ** SetVsbDiagControlProperty ()
  370. **
  371. ** Example of a set property handler for a filter global property set.
  372. ** Use this as a template for adding support for filter global
  373. ** properties.
  374. **
  375. ** Arguments:
  376. **
  377. **
  378. ** Returns:
  379. **
  380. ** Side Effects: none
  381. */
  382. NTSTATUS
  383. CFilter::
  384. SetVsbDiagControlProperty(
  385. IN PIRP pIrp,
  386. IN PKSPROPERTY pKSProperty,
  387. IN PKSPROPERTY_VSB_DIAG_CTRL_S pProperty
  388. )
  389. {
  390. NTSTATUS Status = STATUS_SUCCESS;
  391. CFilter * pFilter;
  392. ASSERT( pIrp);
  393. ASSERT( pKSProperty);
  394. ASSERT( pProperty);
  395. // Obtain a "this" pointer for the method.
  396. //
  397. // Because this function is called directly from the property dispatch
  398. // table, we must get our own pointer to the underlying object.
  399. //
  400. pFilter = FilterFromIRP( pIrp);
  401. ASSERT( pFilter);
  402. if (!pFilter)
  403. {
  404. Status = STATUS_INVALID_PARAMETER;
  405. goto errExit;
  406. }
  407. // Set the property.
  408. //
  409. Status = (pFilter->GetDevice())->SetVsbDiagMode(pProperty->OperationMode,
  410. (VSBDIAGTYPE) (pProperty->Type));
  411. errExit:
  412. return Status;
  413. }
  414. /*
  415. ** SetVsbQualityControlProperty ()
  416. **
  417. ** Example of a set property handler for a filter global property set.
  418. ** Use this as a template for adding support for filter global
  419. ** properties.
  420. **
  421. ** Arguments:
  422. **
  423. **
  424. ** Returns:
  425. **
  426. ** Side Effects: none
  427. */
  428. NTSTATUS
  429. CFilter::
  430. SetVsbQualityControlProperty(
  431. IN PIRP pIrp,
  432. IN PKSPROPERTY pKSProperty,
  433. IN PKSPROPERTY_VSB_CTRL_S pProperty
  434. )
  435. {
  436. NTSTATUS Status = STATUS_SUCCESS;
  437. CFilter * pFilter;
  438. ASSERT( pIrp);
  439. ASSERT( pKSProperty);
  440. ASSERT( pProperty);
  441. // Obtain a "this" pointer for the method.
  442. //
  443. // Because this function is called directly from the property dispatch
  444. // table, we must get our own pointer to the underlying object.
  445. //
  446. pFilter = FilterFromIRP( pIrp);
  447. ASSERT( pFilter);
  448. if (!pFilter)
  449. {
  450. Status = STATUS_INVALID_PARAMETER;
  451. goto errExit;
  452. }
  453. // Set the property.
  454. //
  455. Status = (pFilter->GetDevice())->VsbQuality(pProperty->Value);
  456. errExit:
  457. return Status;
  458. }