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.

1077 lines
24 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1999 - 2000
  4. *
  5. * TITLE: vstiusd.cpp
  6. *
  7. * VERSION: 1.1
  8. *
  9. * AUTHOR: WilliamH (created)
  10. * RickTu (ported to WIA)
  11. *
  12. * DATE: 9/7/99
  13. *
  14. * DESCRIPTION: This module implements the CVideoStiUsd object &
  15. * supported classes.
  16. *
  17. *****************************************************************************/
  18. #include <precomp.h>
  19. #pragma hdrstop
  20. DEFINE_GUID(CLSID_VIDEO_STIUSD,0x0527d1d0, 0x88c2, 0x11d2, 0x82, 0xc7, 0x00, 0xc0, 0x4f, 0x8e, 0xc1, 0x83);
  21. /*****************************************************************************
  22. CVideoUsdClassFactory constructor / desctructor
  23. <Notes>
  24. *****************************************************************************/
  25. ULONG g_cDllRef = 0;
  26. CVideoUsdClassFactory::CVideoUsdClassFactory()
  27. {
  28. }
  29. /*****************************************************************************
  30. CVideoUsdClassFactory::QueryInterface
  31. Add our info to the base class QI code.
  32. *****************************************************************************/
  33. STDMETHODIMP
  34. CVideoUsdClassFactory::QueryInterface( REFIID riid, void **ppvObject)
  35. {
  36. DBG_FN("CVideoUsdClassFactory::QueryInterface");
  37. *ppvObject = NULL;
  38. if (IsEqualIID(riid, IID_IUnknown) ||
  39. IsEqualIID(riid, IID_IClassFactory))
  40. {
  41. *ppvObject = (LPVOID)this;
  42. AddRef();
  43. return NOERROR;
  44. }
  45. return ResultFromScode(E_NOINTERFACE);
  46. }
  47. /*****************************************************************************
  48. CVideoUsdClassFactory::AddRef
  49. <Notes>
  50. *****************************************************************************/
  51. STDMETHODIMP_(ULONG) CVideoUsdClassFactory::AddRef(void)
  52. {
  53. DBG_FN("CVideoUsdClassFactory::AddRef");
  54. InterlockedIncrement((LONG *)&g_cDllRef);
  55. InterlockedIncrement((LONG *)&m_cRef);
  56. return m_cRef;
  57. }
  58. /*****************************************************************************
  59. CVideoUsdClassFactory::Release
  60. <Notes>
  61. *****************************************************************************/
  62. STDMETHODIMP_(ULONG)
  63. CVideoUsdClassFactory::Release(void)
  64. {
  65. DBG_FN("CVideoUsdClassFactory::Release");
  66. InterlockedDecrement((LONG *)&g_cDllRef);
  67. InterlockedDecrement((LONG *)&m_cRef);
  68. if (m_cRef == 0)
  69. {
  70. delete this;
  71. return 0;
  72. }
  73. return m_cRef;
  74. }
  75. /*****************************************************************************
  76. CVideoUsdClassFactory::CreateInstance
  77. Instantiate one of the objects we are responsible for.
  78. *****************************************************************************/
  79. STDMETHODIMP
  80. CVideoUsdClassFactory::CreateInstance(IUnknown *pOuterUnk,
  81. REFIID riid,
  82. void **ppv)
  83. {
  84. DBG_FN("CVideoUsdClassFactory::CreateInstance");
  85. //
  86. // Check for bad args
  87. //
  88. if (!ppv)
  89. {
  90. DBG_ERR(("ppv is NULL. returning E_INVALIDARG"));
  91. return E_INVALIDARG;
  92. }
  93. *ppv = NULL;
  94. //
  95. // If it's not an interface we support, bail early
  96. //
  97. if (!IsEqualIID(riid, IID_IStiUSD) &&
  98. !IsEqualIID(riid, IID_IWiaMiniDrv) &&
  99. !IsEqualIID(riid, IID_IUnknown))
  100. {
  101. return E_NOINTERFACE;
  102. }
  103. //
  104. // When created for aggregation, only IUnknown can be requested.
  105. //
  106. if (pOuterUnk &&
  107. !IsEqualIID(riid, IID_IUnknown))
  108. {
  109. return CLASS_E_NOAGGREGATION;
  110. }
  111. //
  112. // Create our Usd/Wia mini driver
  113. //
  114. CVideoStiUsd *pUsd = NULL;
  115. HRESULT hr;
  116. pUsd = new CVideoStiUsd(pOuterUnk);
  117. if (!pUsd)
  118. {
  119. DBG_ERR(("Couldn't create new CVideoStiUsd class, "
  120. "returning E_OUTOFMEMORY"));
  121. return E_OUTOFMEMORY;
  122. }
  123. hr = pUsd->PrivateInitialize();
  124. if (hr != S_OK)
  125. {
  126. CHECK_S_OK2( hr, ("pUsd->PrivateInitialize" ));
  127. delete pUsd;
  128. return hr;
  129. }
  130. // Move to the requested interface if we aren't aggregated.
  131. // Don't do this if aggregated, or we will lose the private
  132. // IUnknown and then the caller will be hosed.
  133. hr = pUsd->NonDelegatingQueryInterface(riid, ppv);
  134. CHECK_S_OK2( hr, ("pUsd->NonDelegatingQueryInterface" ));
  135. pUsd->NonDelegatingRelease();
  136. return hr;
  137. }
  138. /*****************************************************************************
  139. CVideoUsdClassFactory::LockServer
  140. <Notes>
  141. *****************************************************************************/
  142. STDMETHODIMP
  143. CVideoUsdClassFactory::LockServer(BOOL fLock)
  144. {
  145. DBG_FN("CVideoUsdClassFactory::LockServer");
  146. if (fLock)
  147. {
  148. InterlockedIncrement((LONG*)&g_cDllRef);
  149. }
  150. else
  151. {
  152. InterlockedDecrement((LONG*)&g_cDllRef);
  153. }
  154. return S_OK;
  155. }
  156. /*****************************************************************************
  157. CVideoUsdClassFactory::GetClassObject
  158. <Notes>
  159. *****************************************************************************/
  160. HRESULT
  161. CVideoUsdClassFactory::GetClassObject(REFCLSID rclsid,
  162. REFIID riid,
  163. void **ppv)
  164. {
  165. DBG_FN("CVideoUsdClassFactory::GetClassObject");
  166. if (!ppv)
  167. {
  168. return E_INVALIDARG;
  169. }
  170. if (rclsid == CLSID_VIDEO_STIUSD &&
  171. (riid == IID_IUnknown || riid == IID_IClassFactory))
  172. {
  173. CVideoUsdClassFactory *pFactory = NULL;
  174. pFactory = new CVideoUsdClassFactory();
  175. if (pFactory)
  176. {
  177. *ppv = pFactory;
  178. pFactory->AddRef();
  179. return S_OK;
  180. }
  181. else
  182. {
  183. *ppv = NULL;
  184. return E_OUTOFMEMORY;
  185. }
  186. }
  187. else
  188. {
  189. *ppv = NULL;
  190. return E_NOINTERFACE;
  191. }
  192. }
  193. /*****************************************************************************
  194. CVideoUsdClassFactory::CanUnloadNow
  195. Lets the outside world know if we can be unloaded.
  196. *****************************************************************************/
  197. HRESULT
  198. CVideoUsdClassFactory::CanUnloadNow()
  199. {
  200. DBG_FN("CVideoUsdClassFactory::CanUnloadNow");
  201. return (0 == g_cDllRef) ? S_OK : S_FALSE;
  202. }
  203. /*****************************************************************************
  204. CVideoStiUsd constructor/destructor
  205. <Notes>
  206. *****************************************************************************/
  207. CVideoStiUsd::CVideoStiUsd(IUnknown * pUnkOuter)
  208. : m_bDeviceIsOpened(FALSE),
  209. m_lPicsTaken(0),
  210. m_hTakePictureEvent(NULL),
  211. m_hPictureReadyEvent(NULL),
  212. m_pTakePictureOwner(NULL),
  213. m_pLastItemCreated(NULL),
  214. m_dwConnectedApps(0),
  215. m_cRef(1)
  216. {
  217. //
  218. // See if we are aggregated. If we are (almost always the case) save
  219. // pointer to the controlling Unknown , so subsequent calls will be
  220. // delegated. If not, set the same pointer to "this".
  221. //
  222. if (pUnkOuter)
  223. {
  224. m_pUnkOuter = pUnkOuter;
  225. }
  226. else
  227. {
  228. //
  229. // Cast below is needed in order to point to right virtual table
  230. //
  231. m_pUnkOuter = reinterpret_cast<IUnknown*>
  232. (static_cast<INonDelegatingUnknown*>
  233. (this));
  234. }
  235. }
  236. HRESULT CVideoStiUsd::PrivateInitialize()
  237. {
  238. HRESULT hr = S_OK;
  239. HANDLE hThread = NULL;
  240. DWORD dwId = 0;
  241. //
  242. // Set up some global info
  243. //
  244. m_wfi = (WIA_FORMAT_INFO*) CoTaskMemAlloc(sizeof(WIA_FORMAT_INFO) *
  245. NUM_WIA_FORMAT_INFO);
  246. if (m_wfi)
  247. {
  248. //
  249. // Set up the format/tymed pairs
  250. //
  251. m_wfi[0].guidFormatID = WiaImgFmt_JPEG;
  252. m_wfi[0].lTymed = TYMED_CALLBACK;
  253. m_wfi[1].guidFormatID = WiaImgFmt_JPEG;
  254. m_wfi[1].lTymed = TYMED_FILE;
  255. m_wfi[2].guidFormatID = WiaImgFmt_MEMORYBMP;
  256. m_wfi[2].lTymed = TYMED_CALLBACK;
  257. m_wfi[3].guidFormatID = WiaImgFmt_BMP;
  258. m_wfi[3].lTymed = TYMED_CALLBACK;
  259. m_wfi[4].guidFormatID = WiaImgFmt_BMP;
  260. m_wfi[4].lTymed = TYMED_FILE;
  261. }
  262. //
  263. // Initialize critical sections
  264. //
  265. __try
  266. {
  267. if (!InitializeCriticalSectionAndSpinCount(&m_csItemTree, MINLONG))
  268. {
  269. hr = HRESULT_FROM_WIN32(::GetLastError());
  270. DBG_ERR(("ERROR: Failed to initialize one of critsections "
  271. "(0x%08X)",
  272. hr));
  273. }
  274. }
  275. __except(EXCEPTION_EXECUTE_HANDLER)
  276. {
  277. hr = E_OUTOFMEMORY;
  278. }
  279. //
  280. // Initialize GDI+
  281. //
  282. Gdiplus::Status StatusResult = Gdiplus::Ok;
  283. Gdiplus::GdiplusStartupInput StartupInput;
  284. m_ulGdiPlusToken = NULL;
  285. if (hr == S_OK)
  286. {
  287. StatusResult = Gdiplus::GdiplusStartup(&m_ulGdiPlusToken,
  288. &StartupInput,
  289. NULL);
  290. if (StatusResult != Gdiplus::Ok)
  291. {
  292. DBG_ERR(("ERROR: Failed to start up GDI+, Status code returned "
  293. "by GDI+ = '%d'",
  294. StatusResult));
  295. hr = HRESULT_FROM_WIN32(StatusResult);
  296. }
  297. }
  298. return hr;
  299. }
  300. CVideoStiUsd::~CVideoStiUsd()
  301. {
  302. if (m_pRootItem)
  303. {
  304. HRESULT hr = S_OK;
  305. DBG_TRC(("CVideoStiUsd::~CVideoStiUsd, driver is being destroyed, "
  306. "and for some reason the tree still exists, deleting tree..."));
  307. hr = m_pRootItem->UnlinkItemTree(WiaItemTypeDisconnected);
  308. // Clear the root item
  309. m_pRootItem = NULL;
  310. }
  311. //
  312. // Disable Take Picture command.
  313. //
  314. DisableTakePicture(NULL, TRUE);
  315. //
  316. // Shutdown GDI+
  317. //
  318. Gdiplus::GdiplusShutdown(m_ulGdiPlusToken);
  319. CloseDevice();
  320. if (m_wfi)
  321. {
  322. CoTaskMemFree( (LPVOID)m_wfi );
  323. m_wfi = NULL;
  324. }
  325. DeleteCriticalSection(&m_csItemTree);
  326. }
  327. /*****************************************************************************
  328. CVideoStiUsd::NonDelegatingQueryInterface
  329. This is the inner object QI -- in other words, handle QI's for the
  330. interfaces our object supports.
  331. *****************************************************************************/
  332. STDMETHODIMP
  333. CVideoStiUsd::NonDelegatingQueryInterface(REFIID riid,
  334. LPVOID *ppvObj )
  335. {
  336. HRESULT hr = S_OK;
  337. DBG_FN("CVideoStiUsd::NonDelegatingQueryInterface");
  338. //
  339. // Check for invalid args
  340. //
  341. if (!ppvObj)
  342. {
  343. DBG_ERR(("ppvObj is NULL, returning E_INVALIDARG"));
  344. return E_INVALIDARG;
  345. }
  346. *ppvObj = NULL;
  347. if (IsEqualIID(riid, IID_IUnknown))
  348. {
  349. *ppvObj = static_cast<INonDelegatingUnknown*>(this);
  350. }
  351. else if (IsEqualIID(riid, IID_IStiUSD))
  352. {
  353. *ppvObj = static_cast<IStiUSD*>(this);
  354. }
  355. else if (IsEqualIID(riid, IID_IWiaMiniDrv))
  356. {
  357. *ppvObj = static_cast<IWiaMiniDrv*>(this);
  358. }
  359. else
  360. {
  361. hr = E_NOINTERFACE;
  362. DBG_ERR(("CVideoStiUsd::NonDelegatingQueryInterface requested "
  363. "interface we don't support, returning hr = 0x%08lx", hr));
  364. }
  365. if (SUCCEEDED(hr))
  366. {
  367. (reinterpret_cast<IUnknown*>(*ppvObj))->AddRef();
  368. }
  369. CHECK_S_OK(hr);
  370. return hr;
  371. }
  372. /*****************************************************************************
  373. CVideoStiUsd::NonDelegatingAddRef
  374. This is the inner object AddRef -- actually inc the ref count
  375. for our interfaces.
  376. *****************************************************************************/
  377. STDMETHODIMP_(ULONG)
  378. CVideoStiUsd::NonDelegatingAddRef(void)
  379. {
  380. DBG_FN("CVideoStiUsd::NonDelegatingAddRef");
  381. return InterlockedIncrement((LPLONG)&m_cRef);
  382. }
  383. /*****************************************************************************
  384. CVideoStiUsd::NonDelegatingRelease
  385. This is the inner object Release -- actually dec the ref count
  386. for our interfaces.
  387. *****************************************************************************/
  388. STDMETHODIMP_(ULONG)
  389. CVideoStiUsd::NonDelegatingRelease(void)
  390. {
  391. DBG_FN("CVideoStiUsd::NonDelegatingRelease");
  392. ULONG ulRef = 0;
  393. ulRef = InterlockedDecrement((LPLONG)&m_cRef);
  394. if (!ulRef)
  395. {
  396. delete this;
  397. }
  398. return ulRef;
  399. }
  400. /*****************************************************************************
  401. CVideoStiUsd::QueryInterface
  402. Outer QI -- used for aggregation
  403. *****************************************************************************/
  404. STDMETHODIMP
  405. CVideoStiUsd::QueryInterface(REFIID riid, LPVOID *ppvObj)
  406. {
  407. DBG_FN("CVideoStiUsd::QueryInterface");
  408. return m_pUnkOuter->QueryInterface( riid, ppvObj );
  409. }
  410. /*****************************************************************************
  411. CVideoStiUsd::AddRef
  412. Outer AddRef -- used for aggregation
  413. *****************************************************************************/
  414. STDMETHODIMP_(ULONG)
  415. CVideoStiUsd::AddRef(void)
  416. {
  417. DBG_FN("CVideoStiUsd::AddRef");
  418. return m_pUnkOuter->AddRef();
  419. }
  420. /*****************************************************************************
  421. CVideoStiUsd::Release
  422. Outer Release -- used for aggregation
  423. *****************************************************************************/
  424. STDMETHODIMP_(ULONG)
  425. CVideoStiUsd::Release(void)
  426. {
  427. DBG_FN("CVideoStiUsd::Release");
  428. return m_pUnkOuter->Release();
  429. }
  430. /*****************************************************************************
  431. CVideoStiUsd::Initialize [IStillUsd]
  432. <Notes>
  433. *****************************************************************************/
  434. STDMETHODIMP
  435. CVideoStiUsd::Initialize(PSTIDEVICECONTROL pDcb,
  436. DWORD dwStiVersion,
  437. HKEY hParameterKey)
  438. {
  439. DBG_FN("CVideoStiUsd::Initialize");
  440. HRESULT hr = S_OK;
  441. WCHAR DeviceName[MAX_PATH] = {0};
  442. if ((pDcb == NULL) || (hParameterKey == NULL))
  443. {
  444. hr = E_POINTER;
  445. CHECK_S_OK2(hr, ("CVideoStiUsd::Initialize, received a "
  446. "NULL pointer, either 'pDcb = 0x%08lx' is NULL "
  447. "or 'hParameterKey = 0x%08lx' is NULL",
  448. pDcb, hParameterKey));
  449. }
  450. if (hr == S_OK)
  451. {
  452. //
  453. // get the device symbolic name. We use the name to get an IMoniker to
  454. // the device filter proxy.
  455. //
  456. hr = pDcb->GetMyDevicePortName(DeviceName,
  457. sizeof(DeviceName)/sizeof(WCHAR));
  458. if (SUCCEEDED(hr))
  459. {
  460. hr = OpenDevice(DeviceName);
  461. }
  462. }
  463. if (hr == S_OK)
  464. {
  465. HKEY hKey = NULL;
  466. DWORD dwType = 0;
  467. LRESULT lResult = ERROR_SUCCESS;
  468. TCHAR szValue[MAX_PATH + 1] = {0};
  469. DWORD dwSize = sizeof(szValue);
  470. lResult = RegOpenKeyEx(hParameterKey,
  471. TEXT("DeviceData"),
  472. 0,
  473. KEY_READ,
  474. &hKey);
  475. if (lResult == ERROR_SUCCESS)
  476. {
  477. //
  478. // Read DShow device ID from DeviceData registry
  479. //
  480. lResult = RegQueryValueEx(hKey,
  481. TEXT("DShowDeviceId"),
  482. NULL,
  483. &dwType,
  484. (BYTE*) szValue,
  485. &dwSize);
  486. }
  487. if (hKey)
  488. {
  489. RegCloseKey(hKey);
  490. hKey = NULL;
  491. }
  492. if (lResult == ERROR_SUCCESS)
  493. {
  494. m_strDShowDeviceId = szValue;
  495. }
  496. else
  497. {
  498. hr = E_FAIL;
  499. CHECK_S_OK2(hr, ("CVideoStiUsd::Initialize, failed to retrieve the "
  500. "DShow Device ID."));
  501. }
  502. }
  503. return hr;
  504. }
  505. /*****************************************************************************
  506. CVideoStiUsd::CloseDevice [IStillUsd]
  507. <Notes>
  508. *****************************************************************************/
  509. HRESULT
  510. CVideoStiUsd::CloseDevice()
  511. {
  512. DBG_FN("CVideoStiUsd::CloseDevice");
  513. m_bDeviceIsOpened = FALSE;
  514. return S_OK;
  515. }
  516. /*****************************************************************************
  517. CVideoStiUsd::OpenDevice [IStillUsd]
  518. <Notes>
  519. *****************************************************************************/
  520. HRESULT
  521. CVideoStiUsd::OpenDevice(LPCWSTR DeviceName)
  522. {
  523. DBG_FN("CVideoStiUsd::OpenDevice");
  524. //
  525. // Check for bad args
  526. //
  527. if (!DeviceName || (0 == *DeviceName))
  528. {
  529. return E_INVALIDARG;
  530. }
  531. m_bDeviceIsOpened = TRUE;
  532. return S_OK;
  533. }
  534. /*****************************************************************************
  535. CVideoStiUsd::GetCapabilities [IStillUsd]
  536. <Notes>
  537. *****************************************************************************/
  538. STDMETHODIMP
  539. CVideoStiUsd::GetCapabilities(PSTI_USD_CAPS pDevCaps)
  540. {
  541. DBG_FN("CVideoStiUsd::GetCapabilities");
  542. //
  543. // Check for bad args
  544. //
  545. if (!pDevCaps)
  546. {
  547. return E_INVALIDARG;
  548. }
  549. memset(pDevCaps, 0, sizeof(STI_USD_CAPS));
  550. pDevCaps->dwVersion = STI_VERSION;
  551. pDevCaps->dwGenericCaps = STI_USD_GENCAP_NATIVE_PUSHSUPPORT;
  552. return S_OK;
  553. }
  554. /*****************************************************************************
  555. CVideoStiUsd::GetStatus [IStillUsd]
  556. <Notes>
  557. *****************************************************************************/
  558. STDMETHODIMP
  559. CVideoStiUsd::GetStatus(PSTI_DEVICE_STATUS pDevStatus)
  560. {
  561. DBG_FN("CVideoStiUsd::GetStatus");
  562. if (!pDevStatus)
  563. {
  564. return E_INVALIDARG;
  565. }
  566. if (pDevStatus->StatusMask & STI_DEVSTATUS_ONLINE_STATE )
  567. {
  568. if (m_bDeviceIsOpened)
  569. {
  570. pDevStatus->dwOnlineState |= STI_ONLINESTATE_OPERATIONAL;
  571. }
  572. else
  573. {
  574. pDevStatus->dwOnlineState &= ~STI_ONLINESTATE_OPERATIONAL;
  575. }
  576. }
  577. return S_OK;
  578. }
  579. /*****************************************************************************
  580. CVideoStiUsd::DeviceReset [IStillUsd]
  581. <Notes>
  582. *****************************************************************************/
  583. STDMETHODIMP
  584. CVideoStiUsd::DeviceReset()
  585. {
  586. DBG_FN("CVideoStiUsd::DeviceReset");
  587. return S_OK;
  588. }
  589. /*****************************************************************************
  590. CVideoStiUsd::Diagnostic [IStillUsd]
  591. <Notes>
  592. *****************************************************************************/
  593. STDMETHODIMP
  594. CVideoStiUsd::Diagnostic(LPSTI_DIAG pStiDiag)
  595. {
  596. DBG_FN("CVideoStiUsd::Diagnostic");
  597. //
  598. // Check for bad args
  599. //
  600. if (!pStiDiag)
  601. {
  602. return E_INVALIDARG;
  603. }
  604. //
  605. // Return diag info
  606. //
  607. pStiDiag->dwStatusMask = 0;
  608. memset(&pStiDiag->sErrorInfo, 0, sizeof(pStiDiag->sErrorInfo));
  609. if (m_bDeviceIsOpened)
  610. {
  611. pStiDiag->sErrorInfo.dwGenericError = NOERROR;
  612. }
  613. else
  614. {
  615. pStiDiag->sErrorInfo.dwGenericError = STI_NOTCONNECTED;
  616. }
  617. pStiDiag->sErrorInfo.dwVendorError = 0;
  618. return S_OK;
  619. }
  620. /*****************************************************************************
  621. CVideoStiUsd::Escape [IStillUsd]
  622. <Notes>
  623. *****************************************************************************/
  624. STDMETHODIMP
  625. CVideoStiUsd::Escape(STI_RAW_CONTROL_CODE Function,
  626. LPVOID DataIn,
  627. DWORD DataInSize,
  628. LPVOID DataOut,
  629. DWORD DataOutSize,
  630. DWORD *pActualSize)
  631. {
  632. DBG_FN("CVideoStiUsd::Escape");
  633. return S_OK;
  634. }
  635. /*****************************************************************************
  636. CVideoStiUsd::GetLastError [IStillUsd]
  637. Not implemented yet.
  638. *****************************************************************************/
  639. STDMETHODIMP
  640. CVideoStiUsd::GetLastError(LPDWORD pLastError)
  641. {
  642. DBG_FN("CVideoStiUsd::GetLastError( NOT_IMPL )");
  643. return E_NOTIMPL;
  644. }
  645. /*****************************************************************************
  646. CVideoStiUsd::LockDevice [IStillUsd]
  647. No actual locking of the device has to happen, so just return success.
  648. *****************************************************************************/
  649. STDMETHODIMP
  650. CVideoStiUsd::LockDevice()
  651. {
  652. DBG_FN("CVideoStiUsd::LockDevice");
  653. return S_OK;
  654. }
  655. /*****************************************************************************
  656. CVideoStiUsd::UnLockDevice [IStillUsd]
  657. No actual locking/unlocking of the device has to happen, so just return
  658. success.
  659. *****************************************************************************/
  660. STDMETHODIMP
  661. CVideoStiUsd::UnLockDevice()
  662. {
  663. DBG_FN("CVideoStiUsd::UnlockDevice");
  664. return S_OK;
  665. }
  666. /*****************************************************************************
  667. CVideoStiUsd::RawReadData [IStillUsd]
  668. Not implemented yet.
  669. *****************************************************************************/
  670. STDMETHODIMP
  671. CVideoStiUsd::RawReadData(LPVOID Buffer,
  672. LPDWORD BufferSize,
  673. LPOVERLAPPED lpOverlapped)
  674. {
  675. DBG_FN("CVideoStiUsd::RawReadData( NOT_IMPL )");
  676. return E_NOTIMPL;
  677. }
  678. /*****************************************************************************
  679. CVideoStiUsd::RawWriteData [IStillUsd]
  680. Not implemented yet.
  681. *****************************************************************************/
  682. STDMETHODIMP
  683. CVideoStiUsd::RawWriteData(LPVOID Buffer,
  684. DWORD BufferSize,
  685. LPOVERLAPPED lpOverlapped)
  686. {
  687. DBG_FN("CVideoStiUsd::RawWriteData( NOT_IMPL )");
  688. return E_NOTIMPL;
  689. }
  690. /*****************************************************************************
  691. CVideoStiUsd::RawReadCommand [IStillUsd]
  692. Not implemented yet.
  693. *****************************************************************************/
  694. STDMETHODIMP
  695. CVideoStiUsd::RawReadCommand(LPVOID Buffer,
  696. LPDWORD BufferSize,
  697. LPOVERLAPPED lpOverlapped)
  698. {
  699. DBG_FN("CVideoStiUsd::RawReadCommand( NOT_IMPL )");
  700. return E_NOTIMPL;
  701. }
  702. /*****************************************************************************
  703. CVideoStiUsd::RawWriteCommand [IStillUsd]
  704. Not implemented yet.
  705. *****************************************************************************/
  706. STDMETHODIMP
  707. CVideoStiUsd::RawWriteCommand(LPVOID Buffer,
  708. DWORD BufferSize,
  709. LPOVERLAPPED lpOverlapped)
  710. {
  711. DBG_FN("CVideoStiUsd::RawWriteCommand( NOT_IMPL )");
  712. return E_NOTIMPL;
  713. }
  714. /*****************************************************************************
  715. CVideoStiUsd::SetNotificationHandle [IStillUsd]
  716. Sets the event notification handle.
  717. *****************************************************************************/
  718. STDMETHODIMP
  719. CVideoStiUsd::SetNotificationHandle(HANDLE hEvent)
  720. {
  721. DBG_FN("CVideoStiUsd::SetNotificationHandle");
  722. return S_OK;
  723. }
  724. /*****************************************************************************
  725. CVideoStiUsd::GetNotificationData [IStillUsd]
  726. Returns the current event notification handle.
  727. *****************************************************************************/
  728. STDMETHODIMP
  729. CVideoStiUsd::GetNotificationData(LPSTINOTIFY lpNotify)
  730. {
  731. DBG_FN("CVideoStiUsd::GetNotificationData");
  732. HRESULT hr = STIERR_NOEVENTS;
  733. DBG_ERR(("We were called, but no events are present -- why?"));
  734. CHECK_S_OK(hr);
  735. return hr;
  736. }
  737. /*****************************************************************************
  738. CVideoStiUsd::GetLastErrorInfo [IStillUsd]
  739. Not implemented yet.
  740. *****************************************************************************/
  741. STDMETHODIMP
  742. CVideoStiUsd::GetLastErrorInfo(STI_ERROR_INFO *pLastErrorInfo)
  743. {
  744. DBG_FN("CVideoStiUsd::GetLastErrorInfo( NOT_IMPL )");
  745. return E_NOTIMPL;
  746. }