Leaked source code of windows server 2003
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.

1079 lines
25 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) - sizeof(szValue[0]);
  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. szValue[sizeof(szValue) / sizeof(szValue[0]) - 1] = '\0';
  487. }
  488. if (hKey)
  489. {
  490. RegCloseKey(hKey);
  491. hKey = NULL;
  492. }
  493. if (lResult == ERROR_SUCCESS)
  494. {
  495. m_strDShowDeviceId = szValue;
  496. }
  497. else
  498. {
  499. hr = E_FAIL;
  500. CHECK_S_OK2(hr, ("CVideoStiUsd::Initialize, failed to retrieve the "
  501. "DShow Device ID."));
  502. }
  503. }
  504. return hr;
  505. }
  506. /*****************************************************************************
  507. CVideoStiUsd::CloseDevice [IStillUsd]
  508. <Notes>
  509. *****************************************************************************/
  510. HRESULT
  511. CVideoStiUsd::CloseDevice()
  512. {
  513. DBG_FN("CVideoStiUsd::CloseDevice");
  514. m_bDeviceIsOpened = FALSE;
  515. return S_OK;
  516. }
  517. /*****************************************************************************
  518. CVideoStiUsd::OpenDevice [IStillUsd]
  519. <Notes>
  520. *****************************************************************************/
  521. HRESULT
  522. CVideoStiUsd::OpenDevice(LPCWSTR DeviceName)
  523. {
  524. DBG_FN("CVideoStiUsd::OpenDevice");
  525. //
  526. // Check for bad args
  527. //
  528. if (!DeviceName || (0 == *DeviceName))
  529. {
  530. return E_INVALIDARG;
  531. }
  532. m_bDeviceIsOpened = TRUE;
  533. return S_OK;
  534. }
  535. /*****************************************************************************
  536. CVideoStiUsd::GetCapabilities [IStillUsd]
  537. <Notes>
  538. *****************************************************************************/
  539. STDMETHODIMP
  540. CVideoStiUsd::GetCapabilities(PSTI_USD_CAPS pDevCaps)
  541. {
  542. DBG_FN("CVideoStiUsd::GetCapabilities");
  543. //
  544. // Check for bad args
  545. //
  546. if (!pDevCaps)
  547. {
  548. return E_INVALIDARG;
  549. }
  550. memset(pDevCaps, 0, sizeof(STI_USD_CAPS));
  551. pDevCaps->dwVersion = STI_VERSION;
  552. pDevCaps->dwGenericCaps = STI_USD_GENCAP_NATIVE_PUSHSUPPORT;
  553. return S_OK;
  554. }
  555. /*****************************************************************************
  556. CVideoStiUsd::GetStatus [IStillUsd]
  557. <Notes>
  558. *****************************************************************************/
  559. STDMETHODIMP
  560. CVideoStiUsd::GetStatus(PSTI_DEVICE_STATUS pDevStatus)
  561. {
  562. DBG_FN("CVideoStiUsd::GetStatus");
  563. if (!pDevStatus)
  564. {
  565. return E_INVALIDARG;
  566. }
  567. if (pDevStatus->StatusMask & STI_DEVSTATUS_ONLINE_STATE )
  568. {
  569. if (m_bDeviceIsOpened)
  570. {
  571. pDevStatus->dwOnlineState |= STI_ONLINESTATE_OPERATIONAL;
  572. }
  573. else
  574. {
  575. pDevStatus->dwOnlineState &= ~STI_ONLINESTATE_OPERATIONAL;
  576. }
  577. }
  578. return S_OK;
  579. }
  580. /*****************************************************************************
  581. CVideoStiUsd::DeviceReset [IStillUsd]
  582. <Notes>
  583. *****************************************************************************/
  584. STDMETHODIMP
  585. CVideoStiUsd::DeviceReset()
  586. {
  587. DBG_FN("CVideoStiUsd::DeviceReset");
  588. return S_OK;
  589. }
  590. /*****************************************************************************
  591. CVideoStiUsd::Diagnostic [IStillUsd]
  592. <Notes>
  593. *****************************************************************************/
  594. STDMETHODIMP
  595. CVideoStiUsd::Diagnostic(LPSTI_DIAG pStiDiag)
  596. {
  597. DBG_FN("CVideoStiUsd::Diagnostic");
  598. //
  599. // Check for bad args
  600. //
  601. if (!pStiDiag)
  602. {
  603. return E_INVALIDARG;
  604. }
  605. //
  606. // Return diag info
  607. //
  608. pStiDiag->dwStatusMask = 0;
  609. memset(&pStiDiag->sErrorInfo, 0, sizeof(pStiDiag->sErrorInfo));
  610. if (m_bDeviceIsOpened)
  611. {
  612. pStiDiag->sErrorInfo.dwGenericError = NOERROR;
  613. }
  614. else
  615. {
  616. pStiDiag->sErrorInfo.dwGenericError = STI_NOTCONNECTED;
  617. }
  618. pStiDiag->sErrorInfo.dwVendorError = 0;
  619. return S_OK;
  620. }
  621. /*****************************************************************************
  622. CVideoStiUsd::Escape [IStillUsd]
  623. <Notes>
  624. *****************************************************************************/
  625. STDMETHODIMP
  626. CVideoStiUsd::Escape(STI_RAW_CONTROL_CODE Function,
  627. LPVOID DataIn,
  628. DWORD DataInSize,
  629. LPVOID DataOut,
  630. DWORD DataOutSize,
  631. DWORD *pActualSize)
  632. {
  633. DBG_FN("CVideoStiUsd::Escape");
  634. return S_OK;
  635. }
  636. /*****************************************************************************
  637. CVideoStiUsd::GetLastError [IStillUsd]
  638. Not implemented yet.
  639. *****************************************************************************/
  640. STDMETHODIMP
  641. CVideoStiUsd::GetLastError(LPDWORD pLastError)
  642. {
  643. DBG_FN("CVideoStiUsd::GetLastError( NOT_IMPL )");
  644. return E_NOTIMPL;
  645. }
  646. /*****************************************************************************
  647. CVideoStiUsd::LockDevice [IStillUsd]
  648. No actual locking of the device has to happen, so just return success.
  649. *****************************************************************************/
  650. STDMETHODIMP
  651. CVideoStiUsd::LockDevice()
  652. {
  653. DBG_FN("CVideoStiUsd::LockDevice");
  654. return S_OK;
  655. }
  656. /*****************************************************************************
  657. CVideoStiUsd::UnLockDevice [IStillUsd]
  658. No actual locking/unlocking of the device has to happen, so just return
  659. success.
  660. *****************************************************************************/
  661. STDMETHODIMP
  662. CVideoStiUsd::UnLockDevice()
  663. {
  664. DBG_FN("CVideoStiUsd::UnlockDevice");
  665. return S_OK;
  666. }
  667. /*****************************************************************************
  668. CVideoStiUsd::RawReadData [IStillUsd]
  669. Not implemented yet.
  670. *****************************************************************************/
  671. STDMETHODIMP
  672. CVideoStiUsd::RawReadData(LPVOID Buffer,
  673. LPDWORD BufferSize,
  674. LPOVERLAPPED lpOverlapped)
  675. {
  676. DBG_FN("CVideoStiUsd::RawReadData( NOT_IMPL )");
  677. return E_NOTIMPL;
  678. }
  679. /*****************************************************************************
  680. CVideoStiUsd::RawWriteData [IStillUsd]
  681. Not implemented yet.
  682. *****************************************************************************/
  683. STDMETHODIMP
  684. CVideoStiUsd::RawWriteData(LPVOID Buffer,
  685. DWORD BufferSize,
  686. LPOVERLAPPED lpOverlapped)
  687. {
  688. DBG_FN("CVideoStiUsd::RawWriteData( NOT_IMPL )");
  689. return E_NOTIMPL;
  690. }
  691. /*****************************************************************************
  692. CVideoStiUsd::RawReadCommand [IStillUsd]
  693. Not implemented yet.
  694. *****************************************************************************/
  695. STDMETHODIMP
  696. CVideoStiUsd::RawReadCommand(LPVOID Buffer,
  697. LPDWORD BufferSize,
  698. LPOVERLAPPED lpOverlapped)
  699. {
  700. DBG_FN("CVideoStiUsd::RawReadCommand( NOT_IMPL )");
  701. return E_NOTIMPL;
  702. }
  703. /*****************************************************************************
  704. CVideoStiUsd::RawWriteCommand [IStillUsd]
  705. Not implemented yet.
  706. *****************************************************************************/
  707. STDMETHODIMP
  708. CVideoStiUsd::RawWriteCommand(LPVOID Buffer,
  709. DWORD BufferSize,
  710. LPOVERLAPPED lpOverlapped)
  711. {
  712. DBG_FN("CVideoStiUsd::RawWriteCommand( NOT_IMPL )");
  713. return E_NOTIMPL;
  714. }
  715. /*****************************************************************************
  716. CVideoStiUsd::SetNotificationHandle [IStillUsd]
  717. Sets the event notification handle.
  718. *****************************************************************************/
  719. STDMETHODIMP
  720. CVideoStiUsd::SetNotificationHandle(HANDLE hEvent)
  721. {
  722. DBG_FN("CVideoStiUsd::SetNotificationHandle");
  723. return S_OK;
  724. }
  725. /*****************************************************************************
  726. CVideoStiUsd::GetNotificationData [IStillUsd]
  727. Returns the current event notification handle.
  728. *****************************************************************************/
  729. STDMETHODIMP
  730. CVideoStiUsd::GetNotificationData(LPSTINOTIFY lpNotify)
  731. {
  732. DBG_FN("CVideoStiUsd::GetNotificationData");
  733. HRESULT hr = STIERR_NOEVENTS;
  734. DBG_ERR(("We were called, but no events are present -- why?"));
  735. CHECK_S_OK(hr);
  736. return hr;
  737. }
  738. /*****************************************************************************
  739. CVideoStiUsd::GetLastErrorInfo [IStillUsd]
  740. Not implemented yet.
  741. *****************************************************************************/
  742. STDMETHODIMP
  743. CVideoStiUsd::GetLastErrorInfo(STI_ERROR_INFO *pLastErrorInfo)
  744. {
  745. DBG_FN("CVideoStiUsd::GetLastErrorInfo( NOT_IMPL )");
  746. return E_NOTIMPL;
  747. }