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.

915 lines
24 KiB

  1. /*****************************************************************************
  2. *
  3. * DIGenX.c
  4. *
  5. * Copyright (c) 1996 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Generic IDirectInputDevice callback for uninitialized devices.
  10. *
  11. * Contents:
  12. *
  13. * CNil_CreateInstance
  14. *
  15. *****************************************************************************/
  16. #include "dinputpr.h"
  17. /*****************************************************************************
  18. *
  19. * The sqiffle for this file.
  20. *
  21. *****************************************************************************/
  22. #define sqfl sqflNil
  23. /*****************************************************************************
  24. *
  25. * Note! This is not a normal refcounted interface. It is
  26. * a static object whose sole purpose is to keep the seat warm
  27. * until the IDirectInputDevice gets Initialize()d.
  28. *
  29. *****************************************************************************/
  30. /*****************************************************************************
  31. *
  32. * @doc INTERNAL
  33. *
  34. * @method HRESULT | CNil | QueryInterface |
  35. *
  36. * Gives a client access to other interfaces on an object.
  37. *
  38. * We're not a real object, so we don't have any interfaces.
  39. *
  40. *
  41. * @parm IN REFIID | riid |
  42. *
  43. * The requested interface's IID.
  44. *
  45. * @parm OUT LPVOID * | ppvObj |
  46. *
  47. * Receives a pointer to the obtained interface.
  48. *
  49. * @returns
  50. *
  51. * Returns a COM error code.
  52. *
  53. * @xref OLE documentation for <mf IUnknown::QueryInterface>.
  54. *
  55. *****************************************************************************/
  56. STDMETHODIMP
  57. CNil_QueryInterface(PDICB pdcb, REFIID riid, PPV ppvObj)
  58. {
  59. return E_NOTIMPL;
  60. }
  61. /*****************************************************************************
  62. *
  63. * @doc INTERNAL
  64. *
  65. * @method HRESULT | CNil | AddRef |
  66. *
  67. * Increments the reference count for the interface.
  68. *
  69. * We are always here, so the refcount is meaningless.
  70. *
  71. *****************************************************************************
  72. *
  73. * @doc INTERNAL
  74. *
  75. * @method HRESULT | CNil | Release |
  76. *
  77. * Increments the reference count for the interface.
  78. *
  79. * We are always here, so the refcount is meaningless.
  80. *
  81. *****************************************************************************/
  82. STDMETHODIMP_(ULONG)
  83. CNil_AddRefRelease(PDICB pdcb)
  84. {
  85. return 0;
  86. }
  87. #define CNil_AddRef CNil_AddRefRelease
  88. #define CNil_Release CNil_AddRefRelease
  89. /*****************************************************************************
  90. *
  91. * You might think we could just write a bunch of stubs,
  92. * <f CNil_NotInit0>,
  93. * <f CNil_NotInit4>,
  94. * <f CNil_NotInit8>, and so on, one for each arity, and
  95. * point all of the methods at the appropriate stub.
  96. *
  97. * However, you would be wrong. Some processors (especially
  98. * the 68k series) have weird calling conventions which depend
  99. * on things other than just the number of bytes of parameters.
  100. *
  101. *****************************************************************************/
  102. /*****************************************************************************
  103. *
  104. * @doc INTERNAL
  105. *
  106. * @method HRESULT | CNil | GetInstance |
  107. *
  108. * Called by DirectInput to obtain the DirectInput instance
  109. * handle that was created by the DirectInput device driver.
  110. *
  111. * @parm LPVOID * | ppvInst |
  112. *
  113. * Receives the DirectInput instance handle created by the
  114. * DirectInput device driver. This instance handle is returned
  115. * to the device-specific driver, which in turn is given to
  116. * the device callback via a private mechanism.
  117. *
  118. * If the device callback does not use a device driver, then
  119. * 0 is returned in this variable.
  120. *
  121. * @returns
  122. *
  123. * <c DIERR_NOTINITIALIZED> because we are the canonical
  124. * uninitialized device.
  125. *
  126. *****************************************************************************/
  127. STDMETHODIMP
  128. CNil_GetInstance(PDICB pdcb, LPVOID *ppvInst)
  129. {
  130. /*
  131. * This should never happen; we don't get called until we're sure
  132. * it's okay.
  133. */
  134. AssertF(0);
  135. RPF("ERROR: IDirectInputDevice: Not initialized");
  136. return DIERR_NOTINITIALIZED;
  137. }
  138. /****************************************************************************
  139. *
  140. * @doc INTERNAL
  141. *
  142. * @method HRESULT | CNil | GetDataFormat |
  143. *
  144. * Called by DirectInput to obtain the device's preferred
  145. * data format.
  146. *
  147. * @parm OUT LPDIDATAFORMAT * | ppdidf |
  148. *
  149. * <t LPDIDEVICEFORMAT> to receive pointer to device format.
  150. *
  151. * @returns
  152. *
  153. * <c DIERR_NOTINITIALIZED> because we are the canonical
  154. * uninitialized device.
  155. *
  156. ****************************************************************************/
  157. STDMETHODIMP
  158. CNil_GetDataFormat(PDICB pdcb, LPDIDATAFORMAT *ppdidf)
  159. {
  160. /*
  161. * This should never happen; we don't get called until we're sure
  162. * it's okay.
  163. */
  164. AssertF(0);
  165. RPF("ERROR: IDirectInputDevice: Not initialized");
  166. return DIERR_NOTINITIALIZED;
  167. }
  168. /****************************************************************************
  169. *
  170. * @doc INTERNAL
  171. *
  172. * @method HRESULT | CNil | GetObjectInfo |
  173. *
  174. * Obtain the friendly name of an object, passwed by index
  175. * into the preferred data format.
  176. *
  177. * @parm IN LPCDIPROPINFO | ppropi |
  178. *
  179. * Information describing the object being accessed.
  180. *
  181. * @parm IN OUT LPDIDEVICEOBJECTINSTANCEW | pdidioiW |
  182. *
  183. * Structure to receive information. The
  184. * <e DIDEVICEOBJECTINSTANCE.guidType>,
  185. * <e DIDEVICEOBJECTINSTANCE.dwOfs>,
  186. * and
  187. * <e DIDEVICEOBJECTINSTANCE.dwType>
  188. * fields have already been filled in.
  189. *
  190. * @returns
  191. *
  192. * <c DIERR_NOTINITIALIZED> because we are the canonical
  193. * uninitialized device.
  194. *
  195. ****************************************************************************/
  196. STDMETHODIMP
  197. CNil_GetObjectInfo(PDICB pdcb, LPCDIPROPINFO ppropi,
  198. LPDIDEVICEOBJECTINSTANCEW pdidioiW)
  199. {
  200. /*
  201. * This should never happen; didev.c validates the device
  202. * before calling us.
  203. */
  204. AssertF(0);
  205. RPF("ERROR: IDirectInputDevice: Not initialized");
  206. return DIERR_NOTINITIALIZED;
  207. }
  208. /****************************************************************************
  209. *
  210. * @doc INTERNAL
  211. *
  212. * @method HRESULT | CNil | GetCapabilities |
  213. *
  214. * Obtain device capabilities.
  215. *
  216. * @parm LPDIDEVCAPS | pdidc |
  217. *
  218. * Device capabilities structure to receive result.
  219. *
  220. * @returns
  221. *
  222. * <c DIERR_NOTINITIALIZED> because we are the canonical
  223. * uninitialized device.
  224. *
  225. ****************************************************************************/
  226. STDMETHODIMP
  227. CNil_GetCapabilities(PDICB pdcb, LPDIDEVCAPS pdidc)
  228. {
  229. /*
  230. * This may legitimately be called, because it comes from
  231. * a client calling IDirectInputDevice::GetCapabilities.
  232. */
  233. RPF("ERROR: IDirectInputDevice: Not initialized");
  234. return DIERR_NOTINITIALIZED;
  235. }
  236. /****************************************************************************
  237. *
  238. * @doc INTERNAL
  239. *
  240. * @method HRESULT | CNil | Acquire |
  241. *
  242. * Begin data acquisition.
  243. *
  244. * It is the caller's responsibility to have set the
  245. * data format before obtaining acquisition.
  246. *
  247. * @returns
  248. *
  249. * <c DIERR_NOTINITIALIZED> because we are the canonical
  250. * uninitialized device.
  251. *
  252. ****************************************************************************/
  253. STDMETHODIMP
  254. CNil_Acquire(PDICB pdcb)
  255. {
  256. /*
  257. * This should never happen; we don't get called until
  258. * after the data format is set.
  259. */
  260. AssertF(0);
  261. RPF("ERROR: IDirectInputDevice: Not initialized");
  262. return DIERR_NOTINITIALIZED;
  263. }
  264. /****************************************************************************
  265. *
  266. * @doc INTERNAL
  267. *
  268. * @method HRESULT | CNil | Unacquire |
  269. *
  270. * End data acquisition.
  271. *
  272. * It is the caller's responsibility to have set the
  273. * data format before obtaining acquisition.
  274. *
  275. * @returns
  276. *
  277. * <c DIERR_NOTINITIALIZED> because we are the canonical
  278. * uninitialized device.
  279. *
  280. ***************************************************************************/
  281. STDMETHODIMP
  282. CNil_Unacquire(PDICB pdcb)
  283. {
  284. /*
  285. * This should never happen; we don't get called until
  286. * we've acquired, which never works.
  287. */
  288. AssertF(0);
  289. RPF("ERROR: IDirectInputDevice: Not initialized");
  290. return DIERR_NOTINITIALIZED;
  291. }
  292. /****************************************************************************
  293. *
  294. * @doc INTERNAL
  295. *
  296. * @method HRESULT | CNil | GetDeviceState |
  297. *
  298. * Obtain instantaneous device state.
  299. *
  300. * @parm OUT LPVOID | lpvBuf |
  301. *
  302. * Buffer to receive device state.
  303. *
  304. * @returns
  305. *
  306. * <c DIERR_NOTINITIALIZED> because we are the canonical
  307. * uninitialized device.
  308. *
  309. ***************************************************************************/
  310. STDMETHODIMP
  311. CNil_GetDeviceState(PDICB pdcb, LPVOID lpvBuf)
  312. {
  313. /*
  314. * This may legitimately be called, because it happens only
  315. * when the device is already acquired, which never happens.
  316. */
  317. AssertF(0);
  318. RPF("ERROR: IDirectInputDevice: Not initialized");
  319. return DIERR_NOTINITIALIZED;
  320. }
  321. /****************************************************************************
  322. *
  323. * @doc INTERNAL
  324. *
  325. * @method HRESULT | CNil | GetDeviceInfo |
  326. *
  327. * Obtain the product id.
  328. *
  329. * @parm LPDIDEVICEINSTANCEW | lpdidiW |
  330. *
  331. * (out) <t DEVICEINSTANCE> to be filled in. The
  332. * <e DEVICEINSTANCE.dwSize> and <e DEVICEINSTANCE.guidInstance>
  333. * have already been filled in.
  334. *
  335. * @returns
  336. *
  337. * <c DIERR_NOTINITIALIZED> because we are the canonical
  338. * uninitialized device.
  339. *
  340. ***************************************************************************/
  341. STDMETHODIMP
  342. CNil_GetDeviceInfo(PDICB pdcb, LPDIDEVICEINSTANCEW lpdidiW)
  343. {
  344. /*
  345. * This may legitimately be called, because it comes from
  346. * a client calling IDirectInputDevice::GetDeviceInfo.
  347. */
  348. RPF("ERROR: IDirectInputDevice: Not initialized");
  349. return DIERR_NOTINITIALIZED;
  350. }
  351. /****************************************************************************
  352. *
  353. * @doc INTERNAL
  354. *
  355. * @method HRESULT | CNil | GetProperty |
  356. *
  357. * Retrieve a device property.
  358. *
  359. * @parm IN LPCDIPROPINFO | ppropi |
  360. *
  361. * Information describing the property being retrieved.
  362. *
  363. * @parm OUT LPDIPROPHEADER | pdiph |
  364. *
  365. * Where to put the property value.
  366. *
  367. * @returns
  368. *
  369. * <c DIERR_NOTINITIALIZED> because we are the canonical
  370. * uninitialized device.
  371. *
  372. *****************************************************************************/
  373. STDMETHODIMP
  374. CNil_GetProperty(PDICB pdcb, LPCDIPROPINFO ppropi, LPDIPROPHEADER lpdiph)
  375. {
  376. /*
  377. * This may legitimately be called, because it comes from
  378. * a client calling IDirectInputDevice::GetProperty.
  379. */
  380. RPF("ERROR: IDirectInputDevice: Not initialized");
  381. return DIERR_NOTINITIALIZED;
  382. }
  383. /****************************************************************************
  384. *
  385. * @doc INTERNAL
  386. *
  387. * @method HRESULT | CNil | SetProperty |
  388. *
  389. * Set a device property.
  390. *
  391. * @parm IN LPCDIPROPINFO | ppropi |
  392. *
  393. * Information describing the property being retrieved.
  394. *
  395. * @parm IN LPCDIPROPHEADER | pdiph |
  396. *
  397. * Value of property.
  398. *
  399. * @returns
  400. *
  401. * <c DIERR_NOTINITIALIZED> because we are the canonical
  402. * uninitialized device.
  403. *
  404. ***************************************************************************/
  405. STDMETHODIMP
  406. CNil_SetProperty(PDICB pdcb, LPCDIPROPINFO ppropi, LPCDIPROPHEADER lpdiph)
  407. {
  408. /*
  409. * This should never happen; didev.c validates the device
  410. * before calling us.
  411. */
  412. AssertF(0);
  413. RPF("ERROR: IDirectInputDevice: Not initialized");
  414. return DIERR_NOTINITIALIZED;
  415. }
  416. /****************************************************************************
  417. *
  418. * @doc INTERNAL
  419. *
  420. * @method HRESULT | CNil | SetEventNotification |
  421. *
  422. * Set the handle associated with the device.
  423. *
  424. * @parm HANDLE | h |
  425. *
  426. * Handle to be signalled when new data arrives.
  427. *
  428. * @returns
  429. *
  430. * <c DIERR_NOTINITIALIZED> because we are the canonical
  431. * uninitialized device.
  432. *
  433. *****************************************************************************/
  434. STDMETHODIMP
  435. CNil_SetEventNotification(PDICB pdcb, HANDLE h)
  436. {
  437. /*
  438. * This may legitimately be called, because it comes from
  439. * a client calling IDirectInputDevice::SetEventNotification.
  440. */
  441. RPF("ERROR: IDirectInputDevice: Not initialized");
  442. return DIERR_NOTINITIALIZED;
  443. }
  444. /****************************************************************************
  445. *
  446. * @doc INTERNAL
  447. *
  448. * @method HRESULT | CNil | SetCooperativeLevel |
  449. *
  450. * Set the device cooperativity level. Device callbacks
  451. * typically need only respond to the <c DISCL_EXCLUSIVE> bit.
  452. *
  453. * @parm IN HWND | hwnd |
  454. *
  455. * The window handle.
  456. *
  457. * @parm IN DWORD | dwFlags |
  458. *
  459. * The cooperativity level.
  460. *
  461. * @returns
  462. *
  463. * <c DIERR_NOTINITIALIZED> because we are the canonical
  464. * uninitialized device.
  465. *
  466. *****************************************************************************/
  467. STDMETHODIMP
  468. CNil_SetCooperativeLevel(PDICB pdcb, HWND hwnd, DWORD dwFlags)
  469. {
  470. /*
  471. * This may legitimately be called, because it comes from
  472. * a client calling IDirectInputDevice::SetCooperativeLevel.
  473. */
  474. RPF("ERROR: IDirectInputDevice: Not initialized");
  475. return DIERR_NOTINITIALIZED;
  476. }
  477. /****************************************************************************
  478. *
  479. * @doc INTERNAL
  480. *
  481. * @method HRESULT | CNil | RunControlPanel |
  482. *
  483. * Run the control panel for the device.
  484. *
  485. * @parm HWND | hwndOwner |
  486. *
  487. * Owner window (if modal).
  488. *
  489. * @parm DWORD | fl |
  490. *
  491. * Flags.
  492. *
  493. * @returns
  494. *
  495. * <c DIERR_NOTINITIALIZED> because we are the canonical
  496. * uninitialized device.
  497. *
  498. ***************************************************************************/
  499. STDMETHODIMP
  500. CNil_RunControlPanel(PDICB pdcb, HWND hwndOwner, DWORD fl)
  501. {
  502. /*
  503. * This may legitimately be called, because it comes from
  504. * a client calling IDirectInputDevice::RunControlPanel.
  505. */
  506. RPF("ERROR: IDirectInputDevice: Not initialized");
  507. return DIERR_NOTINITIALIZED;
  508. }
  509. /****************************************************************************
  510. *
  511. * @doc INTERNAL
  512. *
  513. * @method HRESULT | CNil | CookDeviceData |
  514. *
  515. * Cook a piece of device data that was obtained from the
  516. * data buffer. This data does not pass through the device
  517. * callback, so it needs to be cooked externally. In
  518. * comparison, device state information is obtained via
  519. * DIDM_GETDEVICESTATE, which the callback can cook before
  520. * returning.
  521. *
  522. * If the callback returns E_NOTIMPL, then the caller is
  523. * permitted to cache the result <y for the entire device>
  524. * (not merely for the device object) until the next DIDM_ACQUIRE.
  525. *
  526. * @parm DWORD | cdod |
  527. *
  528. * Number of objects to cook. This can be zero, in which case
  529. * the caller is checking whether the device requires cooking.
  530. *
  531. * @parm LPDIDEVICEOBJECTDATA | rgdod |
  532. *
  533. * Array of object data to cook.
  534. *
  535. * Note, however, that the <e DIDEVICEOBJETCDATA.dwOfs> fields
  536. * are not what you think. The low word contains the application
  537. * data offset (which is not important to the callback); the
  538. * high word contains the object ID (traditionally called the
  539. * "device type" code).
  540. *
  541. * @returns
  542. *
  543. * <c DIERR_NOTINITIALIZED> because we are the canonical
  544. * uninitialized device.
  545. *
  546. ***************************************************************************/
  547. STDMETHODIMP
  548. CNil_CookDeviceData(PDICB pdcb, DWORD cdod, LPDIDEVICEOBJECTDATA rgdod)
  549. {
  550. /*
  551. * This should never happen; we don't get called until we're sure
  552. * it's okay.
  553. */
  554. AssertF(0);
  555. RPF("ERROR: IDirectInputDevice: Not initialized");
  556. return DIERR_NOTINITIALIZED;
  557. }
  558. /****************************************************************************
  559. *
  560. * @doc INTERNAL
  561. *
  562. * @method HRESULT | CNil | CreateEffect |
  563. *
  564. * Create an <i IDirectInputEffectDriver> callback.
  565. *
  566. * @parm LPDIRECTINPUTEFFECTSHEPHERD * | ppes |
  567. *
  568. * Receives the shepherd for the effect driver.
  569. *
  570. * @returns
  571. *
  572. * <c DIERR_NOTINITIALIZED> because we are the canonical
  573. * uninitialized device.
  574. *
  575. ***************************************************************************/
  576. STDMETHODIMP
  577. CNil_CreateEffect(PDICB pdcb, LPDIRECTINPUTEFFECTSHEPHERD *ppes)
  578. {
  579. /*
  580. * This may legitimately be called, because it comes from
  581. * a client calling a force feedback method.
  582. */
  583. *ppes = 0;
  584. RPF("ERROR: IDirectInputDevice: Not initialized");
  585. return DIERR_NOTINITIALIZED;
  586. }
  587. /****************************************************************************
  588. *
  589. * @doc INTERNAL
  590. *
  591. * @method HRESULT | CNil | GetFFConfigKey |
  592. *
  593. * Returns a handle to the registry key which contains
  594. * force feedback configuration information.
  595. *
  596. * @parm DWORD | sam |
  597. *
  598. * Security access mask.
  599. *
  600. * @parm PHKEY | phk |
  601. *
  602. * Receives key handle on success.
  603. *
  604. * @returns
  605. *
  606. * <c DIERR_NOTINITIALIZED> because we are the canonical
  607. * uninitialized device.
  608. *
  609. ***************************************************************************/
  610. STDMETHODIMP
  611. CNil_GetFFConfigKey(PDICB pdcb, DWORD sam, PHKEY phk)
  612. {
  613. /*
  614. * This should never happen; we don't get called until we're sure
  615. * it's okay.
  616. */
  617. AssertF(0);
  618. RPF("ERROR: IDirectInputDevice: Not initialized");
  619. return DIERR_NOTINITIALIZED;
  620. }
  621. /*****************************************************************************
  622. *
  623. * @doc INTERNAL
  624. *
  625. * @method HRESULT | CNil | SendDeviceData |
  626. *
  627. * Spew some data to the device.
  628. *
  629. * @parm DWORD | cbdod |
  630. *
  631. * Size of each object.
  632. *
  633. * @parm IN LPCDIDEVICEOBJECTDATA | rgdod |
  634. *
  635. * Array of <t DIDEVICEOBJECTDATA> structures.
  636. *
  637. * @parm INOUT LPDWORD | pdwInOut |
  638. *
  639. * Number of items actually sent.
  640. *
  641. * @parm DWORD | fl |
  642. *
  643. * Flags.
  644. *
  645. * @returns
  646. *
  647. * <c DIERR_NOTINITIALIZED> because we are the canonical
  648. * uninitialized device.
  649. *
  650. *****************************************************************************/
  651. STDMETHODIMP
  652. CNil_SendDeviceData(PDICB pdcb, DWORD cbdod, LPCDIDEVICEOBJECTDATA rgdod,
  653. LPDWORD pdwInOut, DWORD fl)
  654. {
  655. /*
  656. * This should never happen; we don't get called until we're sure
  657. * it's okay.
  658. */
  659. AssertF(0);
  660. RPF("ERROR: IDirectInputDevice: Not initialized");
  661. return DIERR_NOTINITIALIZED;
  662. }
  663. /****************************************************************************
  664. *
  665. * @doc INTERNAL
  666. *
  667. * @method HRESULT | CNil | Poll |
  668. *
  669. * Poll the device as necessary.
  670. *
  671. * @returns
  672. *
  673. * <c DIERR_NOTINITIALIZED> because we are the canonical
  674. * uninitialized device.
  675. *
  676. ***************************************************************************/
  677. STDMETHODIMP
  678. CNil_Poll(PDICB pdcb)
  679. {
  680. /*
  681. * This should never happen; we don't get called until we're sure
  682. * it's okay.
  683. */
  684. AssertF(0);
  685. RPF("ERROR: IDirectInputDevice: Not initialized");
  686. return DIERR_NOTINITIALIZED;
  687. }
  688. /****************************************************************************
  689. *
  690. * @doc INTERNAL
  691. *
  692. * @method HRESULT | CNil | MapUsage |
  693. *
  694. * Given a usage and usage page (munged into a single
  695. * <t DWORD>), find a device object that matches it.
  696. *
  697. * @returns
  698. *
  699. * <c DIERR_NOTINITIALIZED> because we are the canonical
  700. * uninitialized device.
  701. *
  702. ***************************************************************************/
  703. STDMETHODIMP
  704. CNil_MapUsage(PDICB pdcb, DWORD dwUsage, PINT piOut)
  705. {
  706. /*
  707. * This should never happen; we don't get called until we're sure
  708. * it's okay.
  709. */
  710. AssertF(0);
  711. RPF("ERROR: IDirectInputDevice: Not initialized");
  712. return DIERR_NOTINITIALIZED;
  713. }
  714. /****************************************************************************
  715. *
  716. * @doc INTERNAL
  717. *
  718. * @method DWORD | CNil | GetUsage |
  719. *
  720. * Given an object index, return the usage and usage page,
  721. * packed into a single <t DWORD>.
  722. *
  723. * @parm int | iobj |
  724. *
  725. * Object index to be converted.
  726. *
  727. * @returns
  728. *
  729. * Zero because we are the canonical
  730. * uninitialized device.
  731. *
  732. ***************************************************************************/
  733. STDMETHODIMP_(DWORD)
  734. CNil_GetUsage(PDICB pdcb, int iobj)
  735. {
  736. /*
  737. * This should never happen; we don't get called until we're sure
  738. * it's okay.
  739. */
  740. AssertF(0);
  741. RPF("ERROR: IDirectInputDevice: Not initialized");
  742. return 0;
  743. }
  744. /****************************************************************************
  745. *
  746. * @doc INTERNAL
  747. *
  748. * @method DWORD | CNil | SetDIData |
  749. *
  750. * Set DirectInput version from CDIDev *.
  751. *
  752. * @parm DWORD | dwVer |
  753. *
  754. * DirectInput version
  755. *
  756. * @parm LPVOID | lpdihacks |
  757. *
  758. * AppHack data
  759. *
  760. * @returns
  761. *
  762. * Zero because we are the canonical
  763. * uninitialized device.
  764. *
  765. ***************************************************************************/
  766. STDMETHODIMP
  767. CNil_SetDIData(PDICB pdcb, DWORD dwVer, LPVOID lpdihacks)
  768. {
  769. /*
  770. * This should never happen; we don't get called until we're sure
  771. * it's okay.
  772. */
  773. AssertF(0);
  774. RPF("ERROR: IDirectInputDevice: Not initialized");
  775. return 0;
  776. }
  777. /*****************************************************************************
  778. *
  779. * @doc INTERNAL
  780. *
  781. * @method HRESULT | CNil | BuildDefaultActionMap |
  782. *
  783. * Validate the passed action map, blanking out invalid ones.
  784. *
  785. * @parm LPDIACTIONFORMATW | pActionFormat |
  786. *
  787. * Actions to map.
  788. *
  789. * @parm DWORD | dwFlags |
  790. *
  791. * Flags used to indicate mapping preferences.
  792. *
  793. * @parm REFGUID | guidInst |
  794. *
  795. * Device instance GUID.
  796. *
  797. * @returns
  798. *
  799. * <c E_NOTIMPL>
  800. *
  801. *****************************************************************************/
  802. STDMETHODIMP
  803. CNil_BuildDefaultActionMap
  804. (
  805. PDICB pdcb,
  806. LPDIACTIONFORMATW paf,
  807. DWORD dwFlags,
  808. REFGUID guidInst
  809. )
  810. {
  811. /*
  812. * This should never happen; we don't get called until we're sure
  813. * it's okay.
  814. */
  815. AssertF(0);
  816. RPF("ERROR: IDirectInputDevice: Not initialized");
  817. return DIERR_NOTINITIALIZED;
  818. }
  819. /****************************************************************************
  820. *
  821. * Our VTBL for our static object
  822. *
  823. ***************************************************************************/
  824. #pragma BEGIN_CONST_DATA
  825. IDirectInputDeviceCallbackVtbl c_vtblNil = {
  826. CNil_QueryInterface,
  827. CNil_AddRef,
  828. CNil_Release,
  829. CNil_GetInstance,
  830. CDefDcb_GetVersions,
  831. CNil_GetDataFormat,
  832. CNil_GetObjectInfo,
  833. CNil_GetCapabilities,
  834. CNil_Acquire,
  835. CNil_Unacquire,
  836. CNil_GetDeviceState,
  837. CNil_GetDeviceInfo,
  838. CNil_GetProperty,
  839. CNil_SetProperty,
  840. CNil_SetEventNotification,
  841. CNil_SetCooperativeLevel,
  842. CNil_RunControlPanel,
  843. CNil_CookDeviceData,
  844. CNil_CreateEffect,
  845. CNil_GetFFConfigKey,
  846. CNil_SendDeviceData,
  847. CNil_Poll,
  848. CNil_GetUsage,
  849. CNil_MapUsage,
  850. CNil_SetDIData,
  851. CNil_BuildDefaultActionMap,
  852. };
  853. IDirectInputDeviceCallback c_dcbNil = {
  854. &c_vtblNil,
  855. };