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.

853 lines
21 KiB

  1. /*****************************************************************************
  2. *
  3. * DIEffV.c
  4. *
  5. * Copyright (c) 1996-1997 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Effect driver for VJOYD devices.
  10. *
  11. * Contents:
  12. *
  13. * CEffVxd_CreateInstance
  14. *
  15. *****************************************************************************/
  16. #include "dinputpr.h"
  17. #ifndef WINNT
  18. /*****************************************************************************
  19. *
  20. * The sqiffle for this file.
  21. *
  22. *****************************************************************************/
  23. #define sqfl sqflVxdEff
  24. /*****************************************************************************
  25. *
  26. * Declare the interfaces we will be providing.
  27. *
  28. * WARNING! If you add a secondary interface, you must also change
  29. * CEffVxd_New!
  30. *
  31. *****************************************************************************/
  32. Primary_Interface(CEffVxd, IDirectInputEffectDriver);
  33. Interface_Template_Begin(CEffVxd)
  34. Primary_Interface_Template(CEffVxd, IDirectInputEffectDriver)
  35. Interface_Template_End(CEffVxd)
  36. /*****************************************************************************
  37. *
  38. * @doc INTERNAL
  39. *
  40. * @struct CEffVxd |
  41. *
  42. * An <i IDirectInputEffectDriver> wrapper for VJOYD
  43. * joysticks.
  44. *
  45. * @field IDirectInputEffectDriver | didc |
  46. *
  47. * The object (containing vtbl).
  48. *
  49. *****************************************************************************/
  50. typedef struct CEffVxd {
  51. /* Supported interfaces */
  52. IDirectInputEffectDriver ded;
  53. } CEffVxd, DVE, *PDVE;
  54. typedef IDirectInputEffectDriver DED, *PDED;
  55. #define ThisClass CEffVxd
  56. #define ThisInterface IDirectInputEffectDriver
  57. #define riidExpected &IID_IDirectInputEffectDriver
  58. /*****************************************************************************
  59. *
  60. * CEffVxd::QueryInterface (from IUnknown)
  61. * CEffVxd::AddRef (from IUnknown)
  62. * CEffVxd::Release (from IUnknown)
  63. *
  64. *****************************************************************************/
  65. /*****************************************************************************
  66. *
  67. * @doc DDK
  68. *
  69. * @method HRESULT | IDirectInputEffectDriver | QueryInterface |
  70. *
  71. * Gives a client access to other interfaces on an object.
  72. *
  73. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  74. *
  75. * @parm IN REFIID | riid |
  76. *
  77. * The requested interface's IID.
  78. *
  79. * @parm OUT LPVOID * | ppvObj |
  80. *
  81. * Receives a pointer to the obtained interface.
  82. *
  83. * @returns
  84. *
  85. * Returns a COM error code.
  86. *
  87. * @xref OLE documentation for <mf IUnknown::QueryInterface>.
  88. *
  89. *****************************************************************************
  90. *
  91. * @doc DDK
  92. *
  93. * @method HRESULT | IDirectInputEffectDriver | AddRef |
  94. *
  95. * Increments the reference count for the interface.
  96. *
  97. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  98. *
  99. * @returns
  100. *
  101. * Returns the object reference count.
  102. *
  103. * @xref OLE documentation for <mf IUnknown::AddRef>.
  104. *
  105. *****************************************************************************
  106. *
  107. * @doc DDK
  108. *
  109. * @method HRESULT | IDirectInputEffectDriver | Release |
  110. *
  111. * Decrements the reference count for the interface.
  112. * If the reference count on the object falls to zero,
  113. * the object is freed from memory.
  114. *
  115. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  116. *
  117. * @returns
  118. *
  119. * Returns the object reference count.
  120. *
  121. * @xref OLE documentation for <mf IUnknown::Release>.
  122. *
  123. *****************************************************************************
  124. *
  125. * @doc INTERNAL
  126. *
  127. * @method HRESULT | CEffVxd | QIHelper |
  128. *
  129. * We don't have any dynamic interfaces and simply forward
  130. * to <f Common_QIHelper>.
  131. *
  132. * @parm IN REFIID | riid |
  133. *
  134. * The requested interface's IID.
  135. *
  136. * @parm OUT LPVOID * | ppvObj |
  137. *
  138. * Receives a pointer to the obtained interface.
  139. *
  140. *****************************************************************************
  141. *
  142. * @doc INTERNAL
  143. *
  144. * @method HRESULT | CEffVxd | AppFinalize |
  145. *
  146. * We don't have any weak pointers, so we can just
  147. * forward to <f Common_Finalize>.
  148. *
  149. * @parm PV | pvObj |
  150. *
  151. * Object being released from the application's perspective.
  152. *
  153. *****************************************************************************/
  154. /*
  155. * @doc INTERNAL
  156. *
  157. * @method HRESULT | CEffVxd | Finalize |
  158. *
  159. * We don't have any instance data, so we can just
  160. * forward to <f Common_Finalize>.
  161. *
  162. *****************************************************************************/
  163. #ifdef DEBUG
  164. Default_QueryInterface(CEffVxd)
  165. Default_AddRef(CEffVxd)
  166. Default_Release(CEffVxd)
  167. #else
  168. #define CEffVxd_QueryInterface Common_QueryInterface
  169. #define CEffVxd_AddRef Common_AddRef
  170. #define CEffVxd_Release Common_Release
  171. #endif
  172. #define CEffVxd_QIHelper Common_QIHelper
  173. #define CEffVxd_AppFinalize Common_AppFinalize
  174. #define CEffVxd_Finalize Common_Finalize
  175. /*****************************************************************************
  176. *
  177. * @doc INTERNAL
  178. *
  179. * @method HRESULT | CEffVxd | DeviceID |
  180. *
  181. * Inform the driver of the identity of the device.
  182. * See <mf IDirectInputEffectDriver::DeviceID>
  183. * for more information.
  184. *
  185. * Doesn't do anything because VJOYD will already
  186. * have told the driver its identity.
  187. *
  188. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  189. *
  190. * @parm DWORD | dwDirectInputVersion |
  191. *
  192. * The version of DirectInput that loaded the
  193. * effect driver.
  194. *
  195. * @parm DWORD | dwExternalID |
  196. *
  197. * The joystick ID number being used.
  198. * The Windows joystick subsystem allocates external IDs.
  199. *
  200. * @parm DWORD | fBegin |
  201. *
  202. * Nonzero if access to the device is beginning.
  203. * Zero if the access to the device is ending.
  204. *
  205. * @parm DWORD | dwInternalID |
  206. *
  207. * Internal joystick id. The device driver manages
  208. * internal IDs.
  209. *
  210. * @parm LPVOID | lpReserved |
  211. *
  212. * Reserved for future use (HID).
  213. *
  214. * @returns
  215. *
  216. * <c S_OK> if the operation completed successfully.
  217. *
  218. * An error code if something is wrong.
  219. *
  220. *****************************************************************************/
  221. STDMETHODIMP
  222. CEffVxd_DeviceID(PDED pded, DWORD dwDIVer, DWORD dwExternalID, DWORD fBegin,
  223. DWORD dwInternalID, LPVOID pvReserved)
  224. {
  225. PDVE this;
  226. HRESULT hres;
  227. EnterProcI(IDirectInputEffectDriver::VxD::DeviceID,
  228. (_ "pxuuu", pded, dwDIVer, dwExternalID, fBegin, dwInternalID));
  229. this = _thisPvNm(pded, ded);
  230. dwDIVer;
  231. dwExternalID;
  232. fBegin;
  233. dwInternalID;
  234. pvReserved;
  235. hres = S_OK;
  236. ExitOleProcR();
  237. return hres;
  238. }
  239. /*****************************************************************************
  240. *
  241. * @doc INTERNAL
  242. *
  243. * @func HRESULT | CEffVxd_Ioctl |
  244. *
  245. * Perform an IOCTL to VJOYD.
  246. *
  247. * @parm DWORD | dwIOCode |
  248. *
  249. * The function to perform.
  250. *
  251. * @parm PV | pvIn |
  252. *
  253. * Input arguments, the number of which depends on the
  254. * function code.
  255. *
  256. * @returns
  257. *
  258. * <c S_OK> if the operation completed successfully.
  259. *
  260. * An error code if something is wrong.
  261. *
  262. *****************************************************************************/
  263. STDMETHODIMP
  264. CEffVxd_Ioctl(DWORD dwIOCode, PV pvIn)
  265. {
  266. HRESULT hres;
  267. HRESULT hresFF;
  268. EnterProc(CEffVxD_Ioctl, (_ "u", dwIOCode));
  269. /*
  270. * Once again, we rely on the fact that STDCALL passes
  271. * parameters right to left, so our arguments are exactly
  272. * in the form of a VXDFFIO structure.
  273. */
  274. CAssertF(cbX(VXDFFIO) == cbX(dwIOCode) + cbX(pvIn));
  275. CAssertF(FIELD_OFFSET(VXDFFIO, dwIOCode) == 0);
  276. CAssertF(FIELD_OFFSET(VXDFFIO, pvArgs) == cbX(dwIOCode));
  277. AssertF(cbSubPvPv(&pvIn, &dwIOCode) == cbX(dwIOCode));
  278. hres = IoctlHw(IOCTL_JOY_FFIO, &dwIOCode, cbX(VXDFFIO),
  279. &hresFF, cbX(hresFF));
  280. if (SUCCEEDED(hres)) {
  281. hres = hresFF;
  282. }
  283. ExitOleProc();
  284. return hres;
  285. }
  286. /*****************************************************************************
  287. *
  288. * @doc INTERNAL
  289. *
  290. * @method HRESULT | CEffVxd | Escape |
  291. *
  292. * Escape to the driver.
  293. * See <mf IDirectInputEffectDriver::Escape>
  294. * for more information.
  295. *
  296. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  297. *
  298. * @parm DWORD | dwId |
  299. *
  300. * The joystick ID number being used.
  301. *
  302. * @parm DWORD | dwEffect |
  303. *
  304. * The effect at which the command is directed.
  305. *
  306. * @parm LPDIEFFESCAPE | pesc |
  307. *
  308. * Command block.
  309. *
  310. * @returns
  311. *
  312. * <c S_OK> if the operation completed successfully.
  313. *
  314. * An error code if something is wrong.
  315. *
  316. *****************************************************************************/
  317. STDMETHODIMP
  318. CEffVxd_Escape(PDED pded, DWORD dwId, DWORD dwEffect, LPDIEFFESCAPE pesc)
  319. {
  320. PDVE this;
  321. HRESULT hres;
  322. EnterProcI(IDirectInputEffectDriver::VxD::Escape,
  323. (_ "puxx", pded, dwId, dwEffect, pesc->dwCommand));
  324. this = _thisPvNm(pded, ded);
  325. dwId;
  326. dwEffect;
  327. pesc;
  328. hres = CEffVxd_Ioctl(FFIO_ESCAPE, &dwId);
  329. ExitOleProcR();
  330. return hres;
  331. }
  332. /*****************************************************************************
  333. *
  334. * @doc INTERNAL
  335. *
  336. * @method HRESULT | CEffVxd | SetGain |
  337. *
  338. * Set the overall device gain.
  339. * See <mf IDirectInputEffectDriver::SetGain>
  340. * for more information.
  341. *
  342. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  343. *
  344. * @parm DWORD | dwId |
  345. *
  346. * The joystick ID number being used.
  347. *
  348. * @parm DWORD | dwGain |
  349. *
  350. * The new gain value.
  351. *
  352. * @returns
  353. *
  354. * <c S_OK> if the operation completed successfully.
  355. *
  356. * An error code if something is wrong.
  357. *
  358. *****************************************************************************/
  359. STDMETHODIMP
  360. CEffVxd_SetGain(PDED pded, DWORD dwId, DWORD dwGain)
  361. {
  362. PDVE this;
  363. HRESULT hres;
  364. EnterProcI(IDirectInputEffectDriver::VxD::SetGain,
  365. (_ "puu", pded, dwId, dwGain));
  366. this = _thisPvNm(pded, ded);
  367. dwId;
  368. hres = CEffVxd_Ioctl(FFIO_SETGAIN, &dwId);
  369. ExitOleProcR();
  370. return hres;
  371. }
  372. /*****************************************************************************
  373. *
  374. * @doc INTERNAL
  375. *
  376. * @method HRESULT | CEffVxd | SetForceFeedbackState |
  377. *
  378. * Change the force feedback state for the device.
  379. * See <mf IDirectInputEffectDriver::SetForceFeedbackState>
  380. * for more information.
  381. *
  382. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  383. *
  384. * @parm DWORD | dwId |
  385. *
  386. * The external joystick number being addressed.
  387. *
  388. * @parm DWORD | dwState |
  389. *
  390. * New state, one of the <c DEV_*> values.
  391. *
  392. * @returns
  393. * <c S_OK> on success.
  394. *
  395. * @devnote
  396. *
  397. * Semantics unclear.
  398. *
  399. *****************************************************************************/
  400. STDMETHODIMP
  401. CEffVxd_SetForceFeedbackState(PDED pded, DWORD dwId, DWORD dwState)
  402. {
  403. PDVE this;
  404. HRESULT hres;
  405. EnterProcI(IDirectInputEffectDriver::VxD::SetForceFeedbackState,
  406. (_ "pux", pded, dwId, dwState));
  407. this = _thisPvNm(pded, ded);
  408. dwId;
  409. dwState;
  410. hres = CEffVxd_Ioctl(FFIO_SETFFSTATE, &dwId);
  411. ExitOleProcR();
  412. return hres;
  413. }
  414. /*****************************************************************************
  415. *
  416. * @doc INTERNAL
  417. *
  418. * @method HRESULT | CEffVxd | GetForceFeedbackState |
  419. *
  420. * Retrieve the force feedback state for the device.
  421. * See <mf IDirectInputEffectDriver::GetForceFeedbackState>
  422. * for more information.
  423. *
  424. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  425. *
  426. * @parm DWORD | dwId |
  427. *
  428. * The external joystick number being addressed.
  429. *
  430. * @parm LPDIDEVICESTATE | pds |
  431. *
  432. * Receives device state.
  433. *
  434. * @returns
  435. * <c S_OK> on success.
  436. *
  437. * @devnote
  438. *
  439. * Semantics unclear.
  440. *
  441. *****************************************************************************/
  442. STDMETHODIMP
  443. CEffVxd_GetForceFeedbackState(PDED pded, DWORD dwId, LPDIDEVICESTATE pds)
  444. {
  445. PDVE this;
  446. HRESULT hres;
  447. EnterProcI(IDirectInputEffectDriver::VxD::GetForceFeedbackState,
  448. (_ "pup", pded, dwId, pds));
  449. this = _thisPvNm(pded, ded);
  450. dwId;
  451. pds;
  452. hres = CEffVxd_Ioctl(FFIO_GETFFSTATE, &dwId);
  453. ExitOleProcR();
  454. return hres;
  455. }
  456. /*****************************************************************************
  457. *
  458. * @doc INTERNAL
  459. *
  460. * @method HRESULT | CEffVxd | DownloadEffect |
  461. *
  462. * Send an effect to the device.
  463. * See <mf IDirectInputEffectDriver::SetGain>
  464. * for more information.
  465. *
  466. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  467. *
  468. * @parm DWORD | dwId |
  469. *
  470. * The external joystick number being addressed.
  471. *
  472. * @parm DWORD | dwEffectId |
  473. *
  474. * Magic cookie dword that identifies the effect.
  475. *
  476. * @parm IN OUT LPDWORD | pdwEffect |
  477. *
  478. * The effect being modified.
  479. *
  480. * @parm LPCDIEFFECT | peff |
  481. *
  482. * The new parameters for the effect.
  483. *
  484. * @parm DWORD | dwFlags |
  485. *
  486. * Zero or more <c DIEP_*> flags.
  487. *
  488. * @returns
  489. * <c S_OK> on success.
  490. *
  491. *****************************************************************************/
  492. STDMETHODIMP
  493. CEffVxd_DownloadEffect(PDED pded, DWORD dwId, DWORD dwEffectId,
  494. LPDWORD pdwEffect, LPCDIEFFECT peff, DWORD fl)
  495. {
  496. PDVE this;
  497. HRESULT hres;
  498. EnterProcI(IDirectInputEffectDriver::VxD::DownloadEffect,
  499. (_ "puxxpx", pded, dwId, dwEffectId, *pdwEffect, peff, fl));
  500. this = _thisPvNm(pded, ded);
  501. dwEffectId;
  502. pdwEffect;
  503. peff;
  504. fl;
  505. hres = CEffVxd_Ioctl(FFIO_DOWNLOADEFFECT, &dwId);
  506. ExitOleProcPpv(pdwEffect);
  507. return hres;
  508. }
  509. /*****************************************************************************
  510. *
  511. * @doc INTERNAL
  512. *
  513. * @method HRESULT | CEffVxd | DestroyEffect |
  514. *
  515. * Remove an effect from the device.
  516. * See <mf IDirectInputEffectDriver::DestroyEffect>
  517. * for more information.
  518. *
  519. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  520. *
  521. * @parm DWORD | dwId |
  522. *
  523. * The external joystick number being addressed.
  524. *
  525. * @parm DWORD | dwEffect |
  526. *
  527. * The effect to be destroyed.
  528. *
  529. * @returns
  530. * <c S_OK> on success.
  531. *
  532. *****************************************************************************/
  533. STDMETHODIMP
  534. CEffVxd_DestroyEffect(PDED pded, DWORD dwId, DWORD dwEffect)
  535. {
  536. PDVE this;
  537. HRESULT hres;
  538. EnterProcI(IDirectInputEffectDriver::VxD::DestroyEffect,
  539. (_ "pux", pded, dwId, dwEffect));
  540. this = _thisPvNm(pded, ded);
  541. dwEffect;
  542. hres = CEffVxd_Ioctl(FFIO_DESTROYEFFECT, &dwId);
  543. ExitOleProcR();
  544. return hres;
  545. }
  546. /*****************************************************************************
  547. *
  548. * @doc INTERNAL
  549. *
  550. * @method HRESULT | CEffVxd | StartEffect |
  551. *
  552. * Begin playback of an effect.
  553. * See <mf IDirectInputEffectDriver::StartEffect>
  554. * for more information.
  555. *
  556. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  557. *
  558. * @parm DWORD | dwId |
  559. *
  560. * The external joystick number being addressed.
  561. *
  562. * @parm DWORD | dwEffect |
  563. *
  564. * The effect to be played.
  565. *
  566. * @parm DWORD | dwMode |
  567. *
  568. * How the effect is to affect other effects.
  569. *
  570. * @parm DWORD | dwCount |
  571. *
  572. * Number of times the effect is to be played.
  573. *
  574. * @returns
  575. * <c S_OK> on success.
  576. *
  577. *****************************************************************************/
  578. STDMETHODIMP
  579. CEffVxd_StartEffect(PDED pded, DWORD dwId, DWORD dwEffect,
  580. DWORD dwMode, DWORD dwCount)
  581. {
  582. PDVE this;
  583. HRESULT hres;
  584. EnterProcI(IDirectInputEffectDriver::VxD::StartEffect,
  585. (_ "puxxu", pded, dwId, dwEffect, dwMode, dwCount));
  586. this = _thisPvNm(pded, ded);
  587. dwEffect;
  588. dwMode;
  589. dwCount;
  590. hres = CEffVxd_Ioctl(FFIO_STARTEFFECT, &dwId);
  591. ExitOleProcR();
  592. return hres;
  593. }
  594. /*****************************************************************************
  595. *
  596. * @doc INTERNAL
  597. *
  598. * @method HRESULT | CEffVxd | StopEffect |
  599. *
  600. * Halt playback of an effect.
  601. * See <mf IDirectInputEffectDriver::StartEffect>
  602. * for more information.
  603. *
  604. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  605. *
  606. * @parm DWORD | dwId |
  607. *
  608. * The external joystick number being addressed.
  609. *
  610. * @parm DWORD | dwEffect |
  611. *
  612. * The effect to be stopped.
  613. *
  614. * @returns
  615. * <c S_OK> on success.
  616. *
  617. *****************************************************************************/
  618. STDMETHODIMP
  619. CEffVxd_StopEffect(PDED pded, DWORD dwId, DWORD dwEffect)
  620. {
  621. PDVE this;
  622. HRESULT hres;
  623. EnterProcI(IDirectInputEffectDriver::VxD::StopEffect,
  624. (_ "pux", pded, dwId, dwEffect));
  625. this = _thisPvNm(pded, ded);
  626. dwEffect;
  627. hres = CEffVxd_Ioctl(FFIO_STOPEFFECT, &dwId);
  628. ExitOleProcR();
  629. return hres;
  630. }
  631. /*****************************************************************************
  632. *
  633. * @doc INTERNAL
  634. *
  635. * @method HRESULT | CEffVxd | GetEffectStatus |
  636. *
  637. * Obtain information about an effect.
  638. * See <mf IDirectInputEffectDriver::StartEffect>
  639. * for more information.
  640. *
  641. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  642. *
  643. * @parm DWORD | dwId |
  644. *
  645. * The external joystick number being addressed.
  646. *
  647. * @parm DWORD | dwEffect |
  648. *
  649. * The effect to be queried.
  650. *
  651. * @parm LPDWORD | pdwStatus |
  652. *
  653. * Receives the effect status.
  654. *
  655. * @returns
  656. * <c S_OK> on success.
  657. *
  658. *****************************************************************************/
  659. STDMETHODIMP
  660. CEffVxd_GetEffectStatus(PDED pded, DWORD dwId, DWORD dwEffect,
  661. LPDWORD pdwStatus)
  662. {
  663. PDVE this;
  664. HRESULT hres;
  665. EnterProcI(IDirectInputEffectDriver::VxD::StopEffect,
  666. (_ "pux", pded, dwId, dwEffect));
  667. this = _thisPvNm(pded, ded);
  668. dwEffect;
  669. pdwStatus;
  670. hres = CEffVxd_Ioctl(FFIO_GETEFFECTSTATUS, &dwId);
  671. ExitOleProcR();
  672. return hres;
  673. }
  674. /*****************************************************************************
  675. *
  676. * @doc DDK
  677. *
  678. * @method HRESULT | CEffVxd | GetVersions |
  679. *
  680. * Obtain version information about the force feedback
  681. * hardware and driver.
  682. *
  683. * @cwrap LPDIRECTINPUTEFFECTDRIVER | lpEffectDriver
  684. *
  685. * @parm LPDIDRIVERVERSIONS | pvers |
  686. *
  687. * A structure which should be filled in with version information
  688. * describing the hardware, firmware, and driver.
  689. *
  690. * DirectInput will set the <e DIDRIVERVERSIONS.dwSize> field
  691. * to sizeof(DIDRIVERVERSIONS) before calling this method.
  692. *
  693. * @returns
  694. * <c S_OK> on success.
  695. *
  696. *****************************************************************************/
  697. STDMETHODIMP
  698. CEffVxd_GetVersions(PDED pded, LPDIDRIVERVERSIONS pvers)
  699. {
  700. PDVE this;
  701. HRESULT hres;
  702. EnterProcI(IDirectInputEffectDriver::VxD::GetVersions, (_ "pux", pded));
  703. this = _thisPvNm(pded, ded);
  704. /*
  705. * Returning E_NOTIMPL causes DirectInput to ask the VxD for the same
  706. * information.
  707. */
  708. hres = E_NOTIMPL;
  709. ExitOleProcR();
  710. return hres;
  711. }
  712. /*****************************************************************************
  713. *
  714. * CEffVxd_New (constructor)
  715. *
  716. *****************************************************************************/
  717. STDMETHODIMP
  718. CEffVxd_New(PUNK punkOuter, RIID riid, PPV ppvObj)
  719. {
  720. HRESULT hres;
  721. EnterProcI(IDirectInputEffectDriver::VxD::<constructor>,
  722. (_ "Gp", riid, ppvObj));
  723. hres = Common_NewRiid(CEffVxd, punkOuter, riid, ppvObj);
  724. if (SUCCEEDED(hres)) {
  725. PDVE this;
  726. if (Num_Interfaces(CEffVxd) == 1) {
  727. this = _thisPvNm(*ppvObj, ded);
  728. } else {
  729. this = _thisPv(*ppvObj);
  730. }
  731. /* No initialization needed */
  732. }
  733. ExitOleProcPpvR(ppvObj);
  734. return hres;
  735. }
  736. /*****************************************************************************
  737. *
  738. * The long-awaited vtbls and templates
  739. *
  740. *****************************************************************************/
  741. #pragma BEGIN_CONST_DATA
  742. #define CEffVxd_Signature 0x46454556 /* "VEFF" */
  743. Primary_Interface_Begin(CEffVxd, IDirectInputEffectDriver)
  744. CEffVxd_DeviceID,
  745. CEffVxd_GetVersions,
  746. CEffVxd_Escape,
  747. CEffVxd_SetGain,
  748. CEffVxd_SetForceFeedbackState,
  749. CEffVxd_GetForceFeedbackState,
  750. CEffVxd_DownloadEffect,
  751. CEffVxd_DestroyEffect,
  752. CEffVxd_StartEffect,
  753. CEffVxd_StopEffect,
  754. CEffVxd_GetEffectStatus,
  755. Primary_Interface_End(CEffVxd, IDirectInputEffectDriver)
  756. #endif /* ndef WINNT */