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.

645 lines
12 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) Microsoft Corporation. All rights reserved.
  9. //
  10. //==========================================================================;
  11. #if !defined(_BDATYPES_)
  12. #error BDATYPES.H must be included before BDATOPGY.H
  13. #endif // !defined(_BDATYPES_)
  14. #if !defined(_BDATOPGY_)
  15. #define _BDATOPGY_
  16. #if defined(__cplusplus)
  17. extern "C" {
  18. #endif // defined(__cplusplus)
  19. //---------------------------------------------------------------------------
  20. // Common typedefs
  21. //---------------------------------------------------------------------------
  22. #define STDMETHODCALLTYPE __stdcall
  23. typedef GUID * PGUID;
  24. //===========================================================================
  25. //
  26. // BDA KS Topology Structures
  27. //
  28. //===========================================================================
  29. typedef struct _KSM_PIN_PAIR
  30. {
  31. KSMETHOD Method;
  32. ULONG InputPinId;
  33. ULONG OutputPinId;
  34. ULONG Reserved;
  35. } KSM_PIN_PAIR, * PKSM_PIN_PAIR;
  36. typedef struct _KSM_PIN
  37. {
  38. KSMETHOD Method;
  39. union
  40. {
  41. ULONG PinId;
  42. ULONG PinType;
  43. };
  44. ULONG Reserved;
  45. } KSM_PIN, * PKSM_PIN;
  46. typedef ULONG BDA_TOPOLOGY_JOINT, * PBDA_TOPOLOGY_JOINT;
  47. typedef struct _BDA_PIN_PAIRING
  48. {
  49. ULONG ulInputPin;
  50. ULONG ulOutputPin;
  51. ULONG ulcMaxInputsPerOutput;
  52. ULONG ulcMinInputsPerOutput;
  53. ULONG ulcMaxOutputsPerInput;
  54. ULONG ulcMinOutputsPerInput;
  55. ULONG ulcTopologyJoints;
  56. const ULONG * pTopologyJoints;
  57. } BDA_PIN_PAIRING, * PBDA_PIN_PAIRING;
  58. // BDA Topology Template Structures
  59. //
  60. typedef struct _BDA_FILTER_TEMPLATE
  61. {
  62. const KSFILTER_DESCRIPTOR * pFilterDescriptor;
  63. ULONG ulcPinPairs;
  64. const BDA_PIN_PAIRING * pPinPairs;
  65. } BDA_FILTER_TEMPLATE, *PBDA_FILTER_TEMPLATE;
  66. //===========================================================================
  67. //
  68. // BDA Utility Functions
  69. //
  70. //===========================================================================
  71. /*
  72. ** BdaCreateFilterFactory()
  73. **
  74. ** Creates a Filter Factory according to pFilterDescriptor. Keeps a
  75. ** reference to pBdaFilterTemplate so that Pin Factories can be dynamically
  76. ** created on a Filter created from this Filter Factory.
  77. **
  78. ** Arguments:
  79. **
  80. **
  81. ** Returns:
  82. **
  83. **
  84. **
  85. ** Side Effects: none
  86. */
  87. STDMETHODIMP_(NTSTATUS)
  88. BdaCreateFilterFactory(
  89. PKSDEVICE pKSDevice,
  90. const KSFILTER_DESCRIPTOR * pFilterDescriptor,
  91. const BDA_FILTER_TEMPLATE * pBdaFilterTemplate
  92. );
  93. /*
  94. ** BdaCreateFilterFactoryEx()
  95. **
  96. ** Creates a Filter Factory according to pFilterDescriptor. Keeps a
  97. ** reference to pBdaFilterTemplate so that Pin Factories can be dynamically
  98. ** created on a Filter created from this Filter Factory.
  99. **
  100. ** Arguments:
  101. **
  102. **
  103. ** Returns:
  104. **
  105. **
  106. **
  107. ** Side Effects: none
  108. */
  109. STDMETHODIMP_(NTSTATUS)
  110. BdaCreateFilterFactoryEx(
  111. PKSDEVICE pKSDevice,
  112. const KSFILTER_DESCRIPTOR * pFilterDescriptor,
  113. const BDA_FILTER_TEMPLATE * pBdaFilterTemplate,
  114. PKSFILTERFACTORY * ppKSFilterFactory
  115. );
  116. /*
  117. ** BdaInitFilter()
  118. **
  119. ** Initializes a BDA filter context for this KS Filter instance. Creates
  120. ** a linkage to the BDA Filter Template associated with the factory from
  121. ** which this KS Filter instance was created.
  122. **
  123. ** Arguments:
  124. **
  125. **
  126. ** Returns:
  127. **
  128. **
  129. **
  130. ** Side Effects: none
  131. */
  132. STDMETHODIMP_(NTSTATUS)
  133. BdaInitFilter(
  134. PKSFILTER pKSFilter,
  135. const BDA_FILTER_TEMPLATE * pBdaFilterTemplate
  136. );
  137. /*
  138. ** BdaUninitFilter()
  139. **
  140. ** Unitializes and frees resources from the BDA filter context associated
  141. ** with this KS filter instance.
  142. **
  143. ** Arguments:
  144. **
  145. **
  146. ** Returns:
  147. **
  148. **
  149. **
  150. ** Side Effects: none
  151. */
  152. STDMETHODIMP_(NTSTATUS)
  153. BdaUninitFilter(
  154. PKSFILTER pKSFilter
  155. );
  156. /*
  157. ** BdaFilterFactoryUpdateCacheData()
  158. **
  159. ** Updates the pin data cache for the given filter factory.
  160. ** The function will update the cached information for all pin factories
  161. ** exposed by the given filter factory.
  162. **
  163. ** If the option filter descriptor is given, the function will update
  164. ** the pin data cache for all pins listed in the given filter descriptor
  165. ** instead of those in the filter factory.
  166. **
  167. ** Drivers will call this to update the pin data cache for all
  168. ** pins that may be exposed by the filter factory. The driver will
  169. ** provide a filter descriptor listing pins that are not initially exposed
  170. ** by the filter factory (this is usually the same as the template filter
  171. ** descriptor).
  172. **
  173. ** Arguments:
  174. **
  175. **
  176. ** Returns:
  177. **
  178. **
  179. **
  180. ** Side Effects: none
  181. */
  182. STDMETHODIMP_(NTSTATUS)
  183. BdaFilterFactoryUpdateCacheData(
  184. IN PKSFILTERFACTORY pFilterFactory,
  185. IN const KSFILTER_DESCRIPTOR * pFilterDescriptor OPTIONAL
  186. );
  187. /*
  188. ** BdaCreatePin()
  189. **
  190. ** Utility function creates a new pin in the given filter instance.
  191. **
  192. **
  193. ** Arguments:
  194. **
  195. **
  196. ** Returns:
  197. **
  198. **
  199. ** Side Effects: none
  200. */
  201. STDMETHODIMP_(NTSTATUS)
  202. BdaCreatePin(
  203. PKSFILTER pKSFilter,
  204. ULONG ulPinType,
  205. PULONG pulPinId
  206. );
  207. /*
  208. ** BdaDeletePin()
  209. **
  210. ** Utility function deletes a pin from the given filter instance.
  211. **
  212. **
  213. ** Arguments:
  214. **
  215. **
  216. ** Returns:
  217. **
  218. **
  219. ** Side Effects: none
  220. */
  221. STDMETHODIMP_(NTSTATUS)
  222. BdaDeletePin(
  223. PKSFILTER pKSFilter,
  224. PULONG pulPinId
  225. );
  226. /*
  227. ** BdaCreateTopology()
  228. **
  229. ** Utility function creates the topology between two pins.
  230. **
  231. **
  232. ** Arguments:
  233. **
  234. **
  235. ** Returns:
  236. **
  237. ** NULL If no valid pin pairing exists with the
  238. ** given input and output pins.
  239. **
  240. ** Side Effects: none
  241. */
  242. STDMETHODIMP_(NTSTATUS)
  243. BdaCreateTopology(
  244. PKSFILTER pKSFilter,
  245. ULONG InputPinId,
  246. ULONG OutputPinId
  247. );
  248. //===========================================================================
  249. //
  250. // BDA Property and Method Functions
  251. //
  252. //===========================================================================
  253. /*
  254. ** BdaPropertyNodeTypes ()
  255. **
  256. ** Returns a list of ULONGs.
  257. **
  258. ** Arguments:
  259. **
  260. **
  261. ** Returns:
  262. **
  263. ** Side Effects: none
  264. */
  265. STDMETHODIMP_(NTSTATUS)
  266. BdaPropertyNodeTypes(
  267. IN PIRP pIrp,
  268. IN PKSPROPERTY pKSProperty,
  269. OUT ULONG * pulProperty
  270. );
  271. /*
  272. ** BdaPropertyPinTypes ()
  273. **
  274. ** Returns a list of GUIDS.
  275. **
  276. ** Arguments:
  277. **
  278. **
  279. ** Returns:
  280. **
  281. ** Side Effects: none
  282. */
  283. STDMETHODIMP_(NTSTATUS)
  284. BdaPropertyPinTypes(
  285. IN PIRP pIrp,
  286. IN PKSPROPERTY pKSProperty,
  287. OUT ULONG * pulProperty
  288. );
  289. /*
  290. ** BdaPropertyTemplateConnections ()
  291. **
  292. ** Returns a list of KSTOPOLOGY_CONNECTIONS. The list of connections
  293. ** describs how pin types and node types are connected in the template
  294. ** topology
  295. **
  296. ** Arguments:
  297. **
  298. **
  299. ** Returns:
  300. **
  301. ** Side Effects: none
  302. */
  303. STDMETHODIMP_(NTSTATUS)
  304. BdaPropertyTemplateConnections(
  305. IN PIRP pIrp,
  306. IN PKSPROPERTY pKSProperty,
  307. OUT PKSTOPOLOGY_CONNECTION pConnectionProperty
  308. );
  309. /*
  310. ** BdaPropertyNodeProperties ()
  311. **
  312. ** Returns a list of GUIDs.
  313. **
  314. ** Arguments:
  315. **
  316. **
  317. ** Returns:
  318. **
  319. ** Side Effects: none
  320. */
  321. STDMETHODIMP_(NTSTATUS)
  322. BdaPropertyNodeProperties(
  323. IN PIRP pIrp,
  324. IN PKSP_NODE pKSProperty,
  325. OUT GUID * pguidProperty
  326. );
  327. /*
  328. ** BdaPropertyNodeMethods ()
  329. **
  330. ** Returns a list of GUIDs.
  331. **
  332. ** Arguments:
  333. **
  334. **
  335. ** Returns:
  336. **
  337. ** Side Effects: none
  338. */
  339. STDMETHODIMP_(NTSTATUS)
  340. BdaPropertyNodeMethods(
  341. IN PIRP pIrp,
  342. IN PKSP_NODE pKSProperty,
  343. OUT GUID * pguidProperty
  344. );
  345. /*
  346. ** BdaPropertyNodeEvents ()
  347. **
  348. ** Returns a list of GUIDs.
  349. **
  350. ** Arguments:
  351. **
  352. **
  353. ** Returns:
  354. **
  355. ** Side Effects: none
  356. */
  357. STDMETHODIMP_(NTSTATUS)
  358. BdaPropertyNodeEvents(
  359. IN PIRP pIrp,
  360. IN PKSP_NODE pKSProperty,
  361. OUT GUID * pguidProperty
  362. );
  363. /*
  364. ** BdaPropertyNodeDescriptors ()
  365. **
  366. ** Returns a list of BDA Node Descriptors.
  367. **
  368. ** Arguments:
  369. **
  370. **
  371. ** Returns:
  372. **
  373. ** Side Effects: none
  374. */
  375. STDMETHODIMP_(NTSTATUS)
  376. BdaPropertyNodeDescriptors(
  377. IN PIRP pIrp,
  378. IN PKSPROPERTY pKSProperty,
  379. OUT BDANODE_DESCRIPTOR * pNodeDescriptorProperty
  380. );
  381. /*
  382. ** BdaPropertyGetControllingPinId ()
  383. **
  384. ** Gets the ID of the pin on which to submit node properties, methods
  385. ** and events.
  386. **
  387. ** Arguments:
  388. **
  389. **
  390. ** Returns:
  391. **
  392. ** Side Effects: none
  393. */
  394. STDMETHODIMP_(NTSTATUS)
  395. BdaPropertyGetControllingPinId(
  396. IN PIRP Irp,
  397. IN PKSP_BDA_NODE_PIN Property,
  398. OUT PULONG pulControllingPinId
  399. );
  400. /*
  401. ** BdaStartChanges ()
  402. **
  403. ** Starts a new set of BDA topology changes. All changes to BDA topology
  404. ** that have not been committed are ignored. Changes after this will be
  405. ** in effect only after BdaCommitChanges.
  406. **
  407. ** Arguments:
  408. **
  409. **
  410. ** Returns:
  411. **
  412. ** Side Effects: none
  413. */
  414. STDMETHODIMP_(NTSTATUS)
  415. BdaStartChanges(
  416. IN PIRP pIrp
  417. );
  418. /*
  419. ** BdaCheckChanges ()
  420. **
  421. ** Checks the changes to BDA topology that have occured since the
  422. ** last BdaStartChanges. Returns the result that would have occurred if
  423. ** CommitChanges had been called.
  424. **
  425. ** Arguments:
  426. **
  427. **
  428. ** Returns:
  429. **
  430. ** Side Effects: none
  431. */
  432. STDMETHODIMP_(NTSTATUS)
  433. BdaCheckChanges(
  434. IN PIRP pIrp
  435. );
  436. /*
  437. ** BdaCommitChanges ()
  438. **
  439. ** Commits the changes to BDA topology that have occured since the
  440. ** last BdaStartChanges.
  441. **
  442. ** Arguments:
  443. **
  444. **
  445. ** Returns:
  446. **
  447. ** Side Effects: none
  448. */
  449. STDMETHODIMP_(NTSTATUS)
  450. BdaCommitChanges(
  451. IN PIRP pIrp
  452. );
  453. /*
  454. ** BdaGetChangeState ()
  455. **
  456. ** Returns the current change state of the BDA topology.
  457. **
  458. ** Arguments:
  459. **
  460. **
  461. ** Returns:
  462. **
  463. ** Side Effects: none
  464. */
  465. STDMETHODIMP_(NTSTATUS)
  466. BdaGetChangeState(
  467. IN PIRP pIrp,
  468. PBDA_CHANGE_STATE pChangeState
  469. );
  470. /*
  471. ** BdaMethodCreatePin ()
  472. **
  473. ** Creates a new pin factory for the given pin type.
  474. **
  475. ** Arguments:
  476. **
  477. **
  478. ** Returns:
  479. **
  480. ** Side Effects: none
  481. */
  482. STDMETHODIMP_(NTSTATUS)
  483. BdaMethodCreatePin(
  484. IN PIRP pIrp,
  485. IN PKSMETHOD pKSMethod,
  486. OUT PULONG pulPinFactoryID
  487. );
  488. /*
  489. ** BdaMethodDeletePin ()
  490. **
  491. ** Deletes the given pin factory
  492. **
  493. ** Arguments:
  494. **
  495. **
  496. ** Returns:
  497. **
  498. ** Side Effects: none
  499. */
  500. STDMETHODIMP_(NTSTATUS)
  501. BdaMethodDeletePin(
  502. IN PIRP pIrp,
  503. IN PKSMETHOD pKSMethod,
  504. OPTIONAL PVOID pvIgnored
  505. );
  506. /*
  507. ** BdaMethodCreateTopology ()
  508. **
  509. ** Creates the topology between the two given pin factories.
  510. **
  511. ** Arguments:
  512. **
  513. **
  514. ** Returns:
  515. **
  516. ** Side Effects: none
  517. */
  518. STDMETHODIMP_(NTSTATUS)
  519. BdaMethodCreateTopology(
  520. IN PIRP pIrp,
  521. IN PKSMETHOD pKSMethod,
  522. OPTIONAL PVOID pvIgnored
  523. );
  524. /*
  525. ** BdaPropertyGetPinControl ()
  526. **
  527. ** Returns a the BDA ID or BDA Template Type of the Pin.
  528. **
  529. ** Arguments:
  530. **
  531. **
  532. ** Returns:
  533. **
  534. ** Side Effects: none
  535. */
  536. STDMETHODIMP_(NTSTATUS)
  537. BdaPropertyGetPinControl(
  538. IN PIRP Irp,
  539. IN PKSPROPERTY Property,
  540. OUT ULONG * pulProperty
  541. );
  542. /*
  543. ** BdaValidateNodeProperty ()
  544. **
  545. ** Validates that the node property belongs to the current pin.
  546. **
  547. ** Arguments:
  548. **
  549. **
  550. ** Returns:
  551. **
  552. ** Side Effects: none
  553. */
  554. STDMETHODIMP_(NTSTATUS)
  555. BdaValidateNodeProperty(
  556. IN PIRP pIrp,
  557. IN PKSPROPERTY pProperty
  558. );
  559. #if defined(__cplusplus)
  560. }
  561. #endif // defined(__cplusplus)
  562. #endif // !defined(_BDATOPGY_)