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.

1051 lines
22 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsCElmt.cpp
  5. Abstract:
  6. Implementation of CRmsChangerElement
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #include "stdafx.h"
  12. #include "RmsCElmt.h"
  13. #include "RmsServr.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. //
  16. // CRmsChangerElement methods
  17. //
  18. CRmsChangerElement::CRmsChangerElement(
  19. void
  20. )
  21. /*++
  22. Routine Description:
  23. CRmsChangerElement constructor
  24. Arguments:
  25. None
  26. Return Value:
  27. None
  28. --*/
  29. {
  30. m_elementNo = 0;
  31. m_location.SetLocation(RmsElementUnknown, GUID_NULL, GUID_NULL,
  32. 0, 0, 0, 0, FALSE);
  33. m_mediaSupported = RmsMediaUnknown;
  34. m_isStorage = FALSE;
  35. m_isOccupied = FALSE;
  36. m_pCartridge = NULL;
  37. m_ownerClassId = CLSID_NULL;
  38. m_getCounter = 0;
  39. m_putCounter = 0;
  40. m_resetCounterTimestamp = 0;
  41. m_lastGetTimestamp = 0;
  42. m_lastPutTimestamp = 0;
  43. m_x1 = 0;
  44. m_x2 = 0;
  45. m_x3 = 0;
  46. }
  47. HRESULT
  48. CRmsChangerElement::CompareTo(
  49. IN IUnknown *pCollectable,
  50. OUT SHORT *pResult
  51. )
  52. /*++
  53. Implements:
  54. CRmsChangerElement::CompareTo
  55. --*/
  56. {
  57. HRESULT hr = E_FAIL;
  58. SHORT result = 1;
  59. WsbTraceIn( OLESTR("CRmsChangerElement::CompareTo"), OLESTR("") );
  60. try {
  61. // Validate arguments - Okay if pResult is NULL
  62. WsbAssertPointer( pCollectable );
  63. CComQIPtr<IRmsChangerElement, &IID_IRmsChangerElement> pElmt = pCollectable;
  64. WsbAssertPointer( pElmt );
  65. switch ( m_findBy ) {
  66. case RmsFindByElementNumber:
  67. {
  68. LONG elementNo;
  69. WsbAffirmHr( pElmt->GetElementNo( &elementNo ) );
  70. if( m_elementNo == elementNo ) {
  71. // Element numbers match
  72. hr = S_OK;
  73. result = 0;
  74. }
  75. else {
  76. hr = S_FALSE;
  77. result = 1;
  78. }
  79. }
  80. break;
  81. case RmsFindByMediaSupported:
  82. {
  83. RmsMedia mediaSupported;
  84. WsbAffirmHr( pElmt->GetMediaSupported( (LONG*) &mediaSupported ) );
  85. if( m_mediaSupported == mediaSupported ) {
  86. // media types supported match
  87. hr = S_OK;
  88. result = 0;
  89. }
  90. else {
  91. hr = S_FALSE;
  92. result = 1;
  93. }
  94. }
  95. break;
  96. default:
  97. // What default makes sense?
  98. WsbAssertHr( E_UNEXPECTED );
  99. break;
  100. }
  101. }
  102. WsbCatch( hr );
  103. if ( SUCCEEDED(hr) && (0 != pResult) ) {
  104. *pResult = result;
  105. }
  106. WsbTraceOut( OLESTR("CRmsChangerElement::CompareTo"),
  107. OLESTR("hr = <%ls>, result = <%ls>"),
  108. WsbHrAsString( hr ), WsbPtrToShortAsString( pResult ) );
  109. return hr;
  110. }
  111. HRESULT
  112. CRmsChangerElement::GetSizeMax(
  113. OUT ULARGE_INTEGER* /*pcbSize*/
  114. )
  115. /*++
  116. Implements:
  117. IPersistStream::GetSizeMax
  118. --*/
  119. {
  120. HRESULT hr = E_NOTIMPL;
  121. // ULARGE_INTEGER cartridgeLen;
  122. // ULARGE_INTEGER locationLen;
  123. // WsbTraceIn(OLESTR("CRmsChangerElement::GetSizeMax"), OLESTR(""));
  124. // try {
  125. // WsbAssert(0 != pcbSize, E_POINTER);
  126. // // We need the IRmsCartridge interface to get the value of the object.
  127. // CComQIPtr<IPersistStream, &IID_IPersistStream> pPersistCartridge = m_pCartridge;
  128. // WsbAssertPointer( pPersistCartridge );
  129. // pPersistCartridge->GetSizeMax(&cartridgeLen);
  130. // m_location.GetSizeMax(&locationLen);
  131. // // Get max size
  132. // pcbSize->QuadPart = WsbPersistSizeOf(LONG) + // m_elementNo
  133. // locationLen.QuadPart + // m_location
  134. // WsbPersistSizeOf(LONG) + // m_mediaSupported
  135. // WsbPersistSizeOf(BOOL) + // m_isStorage
  136. // WsbPersistSizeOf(BOOL) + // m_isOccupied
  137. // cartridgeLen.QuadPart + // m_pCartridge
  138. // WsbPersistSizeOf(CLSID) + // m_ownerClassId
  139. // WsbPersistSizeOf(LONG) + // m_getCounter
  140. // WsbPersistSizeOf(LONG) + // m_putCounter
  141. // sizeof(DATE) + // m_resetCounterTimestamp
  142. // sizeof(DATE) + // m_lastGetTimestamp
  143. // sizeof(DATE) + // m_lastPutTimestamp
  144. // WsbPersistSizeOf(LONG) + // m_x1
  145. // WsbPersistSizeOf(LONG) + // m_x2
  146. // WsbPersistSizeOf(LONG); // m_x3
  147. // } WsbCatch(hr);
  148. // WsbTraceOut(OLESTR("CRmsChangerElement::GetSizeMax"), OLESTR("hr = <%ls>, Size = <%ls>"), WsbHrAsString(hr), WsbPtrToUliAsString(pcbSize));
  149. return(hr);
  150. }
  151. HRESULT
  152. CRmsChangerElement::Load(
  153. IN IStream* pStream
  154. )
  155. /*++
  156. Implements:
  157. IPersistStream::Load
  158. --*/
  159. {
  160. HRESULT hr = S_OK;
  161. WsbTraceIn(OLESTR("CRmsChangerElement::Load"), OLESTR(""));
  162. try {
  163. CComQIPtr<IRmsServer, &IID_IRmsServer> pServer = g_pServer;
  164. ULONG temp;
  165. WsbAssert(0 != pStream, E_POINTER);
  166. WsbAssertPointer(pServer);
  167. WsbAffirmHr(CRmsComObject::Load(pStream));
  168. WsbAffirmHr(WsbLoadFromStream(pStream, &m_elementNo));
  169. WsbAffirmHr(m_location.Load(pStream));
  170. WsbAffirmHr(WsbLoadFromStream(pStream, &temp));
  171. m_mediaSupported = (RmsMedia)temp;
  172. WsbAffirmHr(WsbLoadFromStream(pStream, &m_isStorage));
  173. WsbAffirmHr(WsbLoadFromStream(pStream, &m_isOccupied));
  174. GUID cartId;
  175. WsbAffirmHr(WsbLoadFromStream(pStream, &cartId));
  176. if (0 != memcmp(&GUID_NULL, &cartId, sizeof(GUID))) {
  177. hr = pServer->FindCartridgeById(cartId, &m_pCartridge);
  178. if (S_OK == hr) {
  179. CComQIPtr<IRmsDrive, &IID_IRmsDrive> pDrive = (IRmsChangerElement*)this;
  180. if (pDrive) {
  181. WsbAffirmHr(m_pCartridge->SetDrive(pDrive));
  182. }
  183. } else if (RMS_E_NOT_FOUND == hr) {
  184. // TODO ???
  185. } else {
  186. WsbThrow(hr);
  187. }
  188. }
  189. WsbAffirmHr(WsbLoadFromStream(pStream, &m_ownerClassId));
  190. WsbAffirmHr(WsbLoadFromStream(pStream, &m_getCounter));
  191. WsbAffirmHr(WsbLoadFromStream(pStream, &m_putCounter));
  192. WsbAffirmHr(WsbLoadFromStream(pStream, &m_x1));
  193. WsbAffirmHr(WsbLoadFromStream(pStream, &m_x2));
  194. WsbAffirmHr(WsbLoadFromStream(pStream, &m_x3));
  195. } WsbCatch(hr);
  196. WsbTraceOut(OLESTR("CRmsChangerElement::Load"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  197. return(hr);
  198. }
  199. HRESULT
  200. CRmsChangerElement::Save(
  201. IN IStream* pStream,
  202. IN BOOL clearDirty
  203. )
  204. /*++
  205. Implements:
  206. IPersistStream::Save
  207. --*/
  208. {
  209. HRESULT hr = S_OK;
  210. WsbTraceIn(OLESTR("CRmsChangerElement::Save"), OLESTR("clearDirty = <%ls>"), WsbBoolAsString(clearDirty));
  211. try {
  212. WsbAssert(0 != pStream, E_POINTER);
  213. WsbAffirmHr(CRmsComObject::Save(pStream, clearDirty));
  214. WsbAffirmHr(WsbSaveToStream(pStream, m_elementNo));
  215. WsbAffirmHr(m_location.Save(pStream, clearDirty));
  216. WsbAffirmHr(WsbSaveToStream(pStream, (ULONG) m_mediaSupported));
  217. WsbAffirmHr(WsbSaveToStream(pStream, m_isStorage));
  218. WsbAffirmHr(WsbSaveToStream(pStream, m_isOccupied));
  219. // Save the ID (GUID) for the cartridge
  220. GUID cartId;
  221. if (!m_pCartridge) {
  222. cartId = GUID_NULL;
  223. } else {
  224. WsbAffirmHr(m_pCartridge->GetCartridgeId(&cartId));
  225. }
  226. WsbAffirmHr(WsbSaveToStream(pStream, cartId));
  227. WsbAffirmHr(WsbSaveToStream(pStream, m_ownerClassId));
  228. WsbAffirmHr(WsbSaveToStream(pStream, m_getCounter));
  229. WsbAffirmHr(WsbSaveToStream(pStream, m_putCounter));
  230. WsbAffirmHr(WsbSaveToStream(pStream, m_x1));
  231. WsbAffirmHr(WsbSaveToStream(pStream, m_x2));
  232. WsbAffirmHr(WsbSaveToStream(pStream, m_x3));
  233. } WsbCatch(hr);
  234. WsbTraceOut(OLESTR("CRmsChangerElement::Save"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  235. return(hr);
  236. }
  237. HRESULT
  238. CRmsChangerElement::Test(
  239. OUT USHORT *pPassed,
  240. OUT USHORT *pFailed
  241. )
  242. /*++
  243. Implements:
  244. IWsbTestable::Test
  245. --*/
  246. {
  247. HRESULT hr = S_OK;
  248. CComPtr<IRmsLibrary> pLibrary1;
  249. CComPtr<IRmsLibrary> pLibrary2;
  250. CComPtr<IPersistFile> pFile1;
  251. CComPtr<IPersistFile> pFile2;
  252. LONG i;
  253. LONG longVal1 = 11111111;
  254. LONG longWork1;
  255. LONG longVal2 = 22222222;
  256. LONG longWork2;
  257. LONG longVal3 = 33333333;
  258. LONG longWork3;
  259. // DATE dateVal1;
  260. // DATE dateWork1;
  261. CLSID clsidVal1 = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
  262. CLSID clsidWork1;
  263. // CRmsLocator Fields
  264. LONG locVal1 = 11111111;
  265. GUID locVal2 = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
  266. GUID locVal3 = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
  267. LONG locVal4 = 44444444;
  268. LONG locVal5 = 55555555;
  269. LONG locVal6 = 66666666;
  270. LONG locVal7 = 77777777;
  271. BOOL locVal8 = TRUE;
  272. LONG locWork1;
  273. GUID locWork2;
  274. GUID locWork3;
  275. LONG locWork4;
  276. LONG locWork5;
  277. LONG locWork6;
  278. LONG locWork7;
  279. BOOL locWork8;
  280. LONG mediaTable [RMSMAXMEDIATYPES] = { RmsMediaUnknown,
  281. RmsMedia8mm,
  282. RmsMedia4mm,
  283. RmsMediaDLT,
  284. RmsMediaOptical,
  285. RmsMediaMO35,
  286. RmsMediaWORM,
  287. RmsMediaCDR,
  288. RmsMediaDVD,
  289. RmsMediaDisk,
  290. RmsMediaFixed,
  291. RmsMediaTape };
  292. WsbTraceIn(OLESTR("CRmsChangerElement::Test"), OLESTR(""));
  293. try {
  294. // Get the Library interface.
  295. hr = S_OK;
  296. try {
  297. WsbAssertHr(((IUnknown*) (IRmsLibrary*) this)->QueryInterface(IID_IRmsLibrary, (void**) &pLibrary1));
  298. // Test GetElementNo
  299. m_elementNo = longVal1;
  300. GetElementNo(&longWork1);
  301. if(longVal1 == longWork1){
  302. (*pPassed)++;
  303. } else {
  304. (*pFailed)++;
  305. }
  306. // Test SetLocation & GetLocation
  307. SetLocation( locVal1, locVal2, locVal3, locVal4,
  308. locVal5, locVal6, locVal7, locVal8);
  309. GetLocation( &locWork1, &locWork2, &locWork3, &locWork4,
  310. &locWork5, &locWork6, &locWork7, &locWork8);
  311. if((locVal1 == locWork1) &&
  312. (locVal2 == locWork2) &&
  313. (locVal3 == locWork3) &&
  314. (locVal4 == locWork4) &&
  315. (locVal5 == locWork5) &&
  316. (locVal6 == locWork6) &&
  317. (locVal7 == locWork7) &&
  318. (locVal8 == locWork8)){
  319. (*pPassed)++;
  320. } else {
  321. (*pFailed)++;
  322. }
  323. // Test SetMediaSupported & GetMediaSupported
  324. for (i = 0; i < RMSMAXMEDIATYPES; i++){
  325. longWork1 = mediaTable[i];
  326. SetMediaSupported (longWork1);
  327. GetMediaSupported (&longWork2);
  328. if (longWork1 == longWork2){
  329. (*pPassed)++;
  330. } else {
  331. (*pFailed)++;
  332. }
  333. }
  334. // Test SetIsStorage & IsStorage to TRUE
  335. hr = S_OK;
  336. try{
  337. WsbAffirmHr(SetIsStorage (TRUE));
  338. WsbAffirmHr(IsStorage ());
  339. } WsbCatch (hr);
  340. if (hr == S_OK){
  341. (*pPassed)++;
  342. } else {
  343. (*pFailed)++;
  344. }
  345. // Test SetIsStorage & IsStorage to FALSE
  346. hr = S_OK;
  347. try{
  348. WsbAffirmHr(SetIsStorage (FALSE));
  349. WsbAffirmHr(IsStorage ());
  350. } WsbCatch (hr);
  351. if (hr == S_OK){
  352. (*pFailed)++;
  353. } else {
  354. (*pPassed)++;
  355. }
  356. // Test SetIsOccupied & IsOccupied to TRUE
  357. hr = S_OK;
  358. try{
  359. WsbAffirmHr(SetIsOccupied (TRUE));
  360. WsbAffirmHr(IsOccupied ());
  361. } WsbCatch (hr);
  362. if (hr == S_OK){
  363. (*pPassed)++;
  364. } else {
  365. (*pFailed)++;
  366. }
  367. // Test SetIsOccupied & IsOccupied to FALSE
  368. hr = S_OK;
  369. try{
  370. WsbAffirmHr(SetIsOccupied (FALSE));
  371. WsbAffirmHr(IsOccupied ());
  372. } WsbCatch (hr);
  373. if (hr == S_OK){
  374. (*pFailed)++;
  375. } else {
  376. (*pPassed)++;
  377. }
  378. // Test SetCartridge & GetCartridge
  379. // Test SetOwnerClassId & GetOwnerClassId
  380. SetOwnerClassId(clsidVal1);
  381. GetOwnerClassId(&clsidWork1);
  382. if(clsidVal1 == clsidWork1){
  383. (*pPassed)++;
  384. } else {
  385. (*pFailed)++;
  386. }
  387. // Test SetAccessCounters & GetAccessCounters & ResetAccessCounters
  388. m_getCounter = longVal1;
  389. m_putCounter = longVal2;
  390. GetAccessCounters(&longWork1, &longWork2);
  391. if((longVal1 == longWork1) &&
  392. (longVal2 == longWork2)){
  393. (*pPassed)++;
  394. } else {
  395. (*pFailed)++;
  396. }
  397. ResetAccessCounters();
  398. GetAccessCounters(&longWork1, &longWork2);
  399. if((0 == longWork1) &&
  400. (0 == longWork2)){
  401. (*pPassed)++;
  402. } else {
  403. (*pFailed)++;
  404. }
  405. // Test GetResetCounterTimestamp
  406. // Test GetLastGetTimestamp
  407. // Test GetLastPutTimestamp
  408. // Test SetCoordinates & GetCoordinates
  409. SetCoordinates(longVal1, longVal2, longVal3);
  410. GetCoordinates(&longWork1, &longWork2, &longWork3);
  411. if((longVal1 == longWork1) &&
  412. (longVal2 == longWork2) &&
  413. (longVal3 == longWork3)){
  414. (*pPassed)++;
  415. } else {
  416. (*pFailed)++;
  417. }
  418. } WsbCatch(hr);
  419. // Tally up the results
  420. hr = S_OK;
  421. if (*pFailed) {
  422. hr = S_FALSE;
  423. }
  424. } WsbCatch(hr);
  425. WsbTraceOut(OLESTR("CRmsChangerElement::Test"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  426. return(hr);
  427. }
  428. CRmsChangerElement::~CRmsChangerElement(
  429. void
  430. )
  431. /*++
  432. Routine Description:
  433. This is the destructor for the changer element class.
  434. Arguments:
  435. None.
  436. Return Value:
  437. None.
  438. --*/
  439. {
  440. m_pCartridge = NULL;
  441. }
  442. /////////////////////////////////////////////////////////////////////////////
  443. //
  444. // IRmsChangerElement implementation
  445. //
  446. STDMETHODIMP
  447. CRmsChangerElement::GetElementNo(
  448. LONG *pElementNo
  449. )
  450. /*++
  451. Implements:
  452. IRmsChangerElement::GetElementNo
  453. --*/
  454. {
  455. *pElementNo = m_elementNo;
  456. return S_OK;
  457. }
  458. STDMETHODIMP
  459. CRmsChangerElement::GetLocation(
  460. LONG *pType,
  461. GUID *pLibId,
  462. GUID *pMediaSetId,
  463. LONG *pPos,
  464. LONG *pAlt1,
  465. LONG *pAlt2,
  466. LONG *pAlt3,
  467. BOOL *pInvert)
  468. /*++
  469. Implements:
  470. IRmsChangerElement::GetLocation
  471. --*/
  472. {
  473. return m_location.GetLocation(pType, pLibId, pMediaSetId, pPos, pAlt1, pAlt2, pAlt3, pInvert);;
  474. }
  475. STDMETHODIMP
  476. CRmsChangerElement::SetLocation(
  477. LONG type,
  478. GUID libId,
  479. GUID mediaSetId,
  480. LONG pos,
  481. LONG alt1,
  482. LONG alt2,
  483. LONG alt3,
  484. BOOL invert)
  485. /*++
  486. Implements:
  487. IRmsChangerElement::SetLocation
  488. --*/
  489. {
  490. m_location.SetLocation( type, libId, mediaSetId, pos,
  491. alt1, alt2, alt3, invert );
  492. // TODO: clean this up: pos, or m_elementNo, not both.
  493. m_elementNo = pos;
  494. // m_isDirty = TRUE;
  495. return S_OK;
  496. }
  497. STDMETHODIMP
  498. CRmsChangerElement::GetMediaSupported(
  499. LONG *pType
  500. )
  501. /*++
  502. Implements:
  503. IRmsChangerElement::GetMediaSupported
  504. --*/
  505. {
  506. *pType = m_mediaSupported;
  507. return S_OK;
  508. }
  509. STDMETHODIMP
  510. CRmsChangerElement::SetMediaSupported(
  511. LONG type
  512. )
  513. /*++
  514. Implements:
  515. IRmsChangerElement::SetMediaSupported
  516. --*/
  517. {
  518. m_mediaSupported = (RmsMedia) type;
  519. // m_isDirty = TRUE;
  520. return S_OK;
  521. }
  522. STDMETHODIMP
  523. CRmsChangerElement::SetIsStorage(
  524. BOOL flag
  525. )
  526. /*++
  527. Implements:
  528. IRmsChangerElement::SetIsStorage
  529. --*/
  530. {
  531. m_isStorage = flag;
  532. // m_isDirty = TRUE;
  533. return S_OK;
  534. }
  535. STDMETHODIMP
  536. CRmsChangerElement::IsStorage(
  537. void
  538. )
  539. /*++
  540. Implements:
  541. IRmsChangerElement::IsStorage
  542. --*/
  543. {
  544. HRESULT hr = S_FALSE;
  545. if (m_isStorage){
  546. hr = S_OK;
  547. }
  548. return (hr);
  549. }
  550. STDMETHODIMP
  551. CRmsChangerElement::SetIsOccupied(
  552. BOOL flag
  553. )
  554. /*++
  555. Implements:
  556. IRmsChangerElement::SetIsOccupied
  557. --*/
  558. {
  559. m_isOccupied = flag;
  560. if ( FALSE == m_isOccupied ) {
  561. m_pCartridge = 0;
  562. }
  563. // m_isDirty = TRUE;
  564. return S_OK;
  565. }
  566. STDMETHODIMP
  567. CRmsChangerElement::IsOccupied(
  568. void
  569. )
  570. /*++
  571. Implements:
  572. IRmsChangerElement::IsOccupied
  573. --*/
  574. {
  575. HRESULT hr = S_FALSE;
  576. if (m_isOccupied){
  577. hr = S_OK;
  578. }
  579. return (hr);
  580. }
  581. STDMETHODIMP
  582. CRmsChangerElement::GetCartridge(
  583. IRmsCartridge **ptr)
  584. /*++
  585. Implements:
  586. IRmsChangerElement::GetCartridge
  587. --*/
  588. {
  589. HRESULT hr = S_OK;
  590. try {
  591. WsbAssertPointer(ptr);
  592. *ptr = m_pCartridge;
  593. m_pCartridge->AddRef();
  594. } WsbCatch(hr);
  595. return(hr);
  596. }
  597. STDMETHODIMP
  598. CRmsChangerElement::SetCartridge(
  599. IRmsCartridge *ptr)
  600. /*++
  601. Implements:
  602. IRmsChangerElement::SetCartridge
  603. --*/
  604. {
  605. HRESULT hr = S_OK;
  606. try {
  607. WsbAssertPointer(ptr);
  608. m_pCartridge = ptr;
  609. m_isOccupied = TRUE;
  610. } WsbCatch(hr);
  611. return(hr);
  612. }
  613. STDMETHODIMP
  614. CRmsChangerElement::GetOwnerClassId(
  615. CLSID *pClassId
  616. )
  617. /*++
  618. Implements:
  619. IRmsChangerElement::GetOwnerClassId
  620. --*/
  621. {
  622. *pClassId = m_ownerClassId;
  623. return S_OK;
  624. }
  625. STDMETHODIMP
  626. CRmsChangerElement::SetOwnerClassId(
  627. CLSID classId
  628. )
  629. /*++
  630. Implements:
  631. IRmsChangerElement::SetOwnerClassId
  632. --*/
  633. {
  634. m_ownerClassId = classId;
  635. // m_isDirty = TRUE;
  636. return S_OK;
  637. }
  638. STDMETHODIMP
  639. CRmsChangerElement::GetAccessCounters(
  640. LONG *pGets,
  641. LONG *pPuts
  642. )
  643. /*++
  644. Implements:
  645. IRmsChangerElement::GetAccessCounters
  646. --*/
  647. {
  648. *pGets = m_getCounter;
  649. *pPuts = m_putCounter;
  650. return S_OK;
  651. }
  652. STDMETHODIMP
  653. CRmsChangerElement::ResetAccessCounters(
  654. void
  655. )
  656. /*++
  657. Implements:
  658. IRmsChangerElement::ResetAccessCounters
  659. --*/
  660. {
  661. m_getCounter = 0;
  662. m_putCounter = 0;
  663. // m_resetCounterTimestamp = COleDatetime::GetCurrentTime();
  664. return S_OK;
  665. }
  666. STDMETHODIMP
  667. CRmsChangerElement::GetResetCounterTimestamp(
  668. DATE *pDate
  669. )
  670. /*++
  671. Implements:
  672. IRmsChangerElement::GetResetCounterTimestamp
  673. --*/
  674. {
  675. *pDate = m_resetCounterTimestamp;
  676. return S_OK;
  677. }
  678. STDMETHODIMP
  679. CRmsChangerElement::GetLastGetTimestamp(
  680. DATE *pDate
  681. )
  682. /*++
  683. Implements:
  684. IRmsChangerElement::GetLastGetTimestamp
  685. --*/
  686. {
  687. *pDate = m_lastGetTimestamp;
  688. return S_OK;
  689. }
  690. STDMETHODIMP
  691. CRmsChangerElement::GetLastPutTimestamp(
  692. DATE *pDate
  693. )
  694. /*++
  695. Implements:
  696. IRmsChangerElement::GetLastPutTimestamp
  697. --*/
  698. {
  699. *pDate = m_lastPutTimestamp;
  700. return S_OK;
  701. }
  702. STDMETHODIMP
  703. CRmsChangerElement::GetCoordinates(
  704. LONG *pX1,
  705. LONG *pX2,
  706. LONG *pX3
  707. )
  708. /*++
  709. Implements:
  710. IRmsChangerElement::GetCoordinates
  711. --*/
  712. {
  713. *pX1 = m_x1;
  714. *pX2 = m_x2;
  715. *pX3 = m_x3;
  716. return S_OK;
  717. }
  718. STDMETHODIMP
  719. CRmsChangerElement::SetCoordinates(
  720. LONG x1,
  721. LONG x2,
  722. LONG x3
  723. )
  724. /*++
  725. Implements:
  726. IRmsChangerElement::SetCoordinates
  727. --*/
  728. {
  729. m_x1 = x1;
  730. m_x2 = x2;
  731. m_x3 = x3;
  732. // m_isDirty = TRUE;
  733. return S_OK;
  734. }