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.

972 lines
21 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. FaxJobStatus.cpp
  5. Abstract:
  6. Implementation of CFaxJobStatus Class.
  7. Author:
  8. Iv Garber (IvG) Jun, 2000
  9. Revision History:
  10. --*/
  11. #include "stdafx.h"
  12. #include "FaxComEx.h"
  13. #include "FaxJobStatus.h"
  14. //
  15. //====================== GET JOB TYPE ===============================
  16. //
  17. STDMETHODIMP
  18. CFaxJobStatus::get_JobType(
  19. FAX_JOB_TYPE_ENUM *pJobType
  20. )
  21. /*++
  22. Routine name : CFaxJobStatus::get_JobType
  23. Routine description:
  24. Return the Type of the Job
  25. Author:
  26. Iv Garber (IvG), Jul, 2000
  27. Arguments:
  28. pJobType [out] - Return Value of Job Type
  29. Return Value:
  30. Standard HRESULT code
  31. --*/
  32. {
  33. HRESULT hr = S_OK;
  34. DBG_ENTER (TEXT("CFaxJobStatus::get_JobType"), hr);
  35. //
  36. // Check that we can write to the given pointer
  37. //
  38. if (::IsBadWritePtr(pJobType, sizeof(FAX_JOB_TYPE_ENUM)))
  39. {
  40. //
  41. // Got Bad Return Pointer
  42. //
  43. hr = E_POINTER;
  44. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_INVALID_ARGUMENT, IID_IFaxJobStatus, hr);
  45. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr"), hr);
  46. return hr;
  47. }
  48. *pJobType = m_JobType;
  49. return hr;
  50. }
  51. //
  52. //====================== GET TRANSMISSION END ======================================
  53. //
  54. STDMETHODIMP
  55. CFaxJobStatus::get_TransmissionEnd(
  56. DATE *pdateTransmissionEnd
  57. )
  58. /*++
  59. Routine name : CFaxJobStatus::get_TransmissionEnd
  60. Routine description:
  61. Return Job's Transmission End
  62. Author:
  63. Iv Garber (IvG), May, 2000
  64. Arguments:
  65. pdateTransmissionEnd [out] - pointer to the place to put the value
  66. Return Value:
  67. Standard HRESULT code
  68. --*/
  69. {
  70. HRESULT hr = S_OK;
  71. DBG_ENTER (TEXT("CFaxJobStatus::get_TransmissionEnd"), hr);
  72. //
  73. // Check that we can write to the given pointer
  74. //
  75. if (::IsBadWritePtr(pdateTransmissionEnd, sizeof(DATE)))
  76. {
  77. //
  78. // Got Bad Ptr
  79. //
  80. hr = E_POINTER;
  81. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_INVALID_ARGUMENT, IID_IFaxJobStatus, hr);
  82. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr()"), hr);
  83. return hr;
  84. }
  85. if (m_dwValidityMask & FAX_JOB_FIELD_TRANSMISSION_END_TIME)
  86. {
  87. //
  88. // Transmission end time is available
  89. //
  90. hr = SystemTime2LocalDate(m_dtTransmissionEnd, pdateTransmissionEnd);
  91. if (FAILED(hr))
  92. {
  93. //
  94. // Failed to convert the system time to localized variant date
  95. //
  96. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  97. return hr;
  98. }
  99. }
  100. else
  101. {
  102. //
  103. // Transmission end time is not available yet
  104. //
  105. hr = HRESULT_FROM_WIN32 (ERROR_INVALID_DATA);
  106. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_NO_END_TIME, IID_IFaxJobStatus, hr);
  107. }
  108. return hr;
  109. }
  110. //
  111. //========================= GET TRANSMISSION START ===============================
  112. //
  113. STDMETHODIMP
  114. CFaxJobStatus::get_TransmissionStart(
  115. DATE *pdateTransmissionStart
  116. )
  117. /*++
  118. Routine name : CFaxJobStatus::get_TransmissionStart
  119. Routine description:
  120. Return Time the Job is started to transmit
  121. Author:
  122. Iv Garber (IvG), Jul, 2000
  123. Arguments:
  124. pdateTransmissionStart [out] - pointer to place to put the Transmission Start
  125. Return Value:
  126. Standard HRESULT code
  127. --*/
  128. {
  129. HRESULT hr = S_OK;
  130. DBG_ENTER (TEXT("CFaxJobStatus::get_TransmissionStart"), hr);
  131. //
  132. // Check that we can write to the given pointer
  133. //
  134. if (::IsBadWritePtr(pdateTransmissionStart, sizeof(DATE)))
  135. {
  136. //
  137. // Got Bad Ptr
  138. //
  139. hr = E_POINTER;
  140. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_INVALID_ARGUMENT, IID_IFaxJobStatus, hr);
  141. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr()"), hr);
  142. return hr;
  143. }
  144. hr = SystemTime2LocalDate(m_dtTransmissionStart, pdateTransmissionStart);
  145. if (FAILED(hr))
  146. {
  147. //
  148. // Failed to convert the system time to localized variant date
  149. //
  150. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  151. return hr;
  152. }
  153. return hr;
  154. }
  155. //
  156. //========================= GET SCHEDULED TIME ===============================
  157. //
  158. STDMETHODIMP
  159. CFaxJobStatus::get_ScheduledTime(
  160. DATE *pdateScheduledTime
  161. )
  162. /*++
  163. Routine name : CFaxJobStatus::get_ScheduledTime
  164. Routine description:
  165. Return Time the Job is scheduled
  166. Author:
  167. Iv Garber (IvG), Jul, 2000
  168. Arguments:
  169. pdateScheduledTime [out] - pointer to place to put Scheduled Time
  170. Return Value:
  171. Standard HRESULT code
  172. --*/
  173. {
  174. HRESULT hr = S_OK;
  175. DBG_ENTER (TEXT("CFaxJobStatus::get_ScheduledTime"), hr);
  176. //
  177. // Check that we can write to the given pointer
  178. //
  179. if (::IsBadWritePtr(pdateScheduledTime, sizeof(DATE)))
  180. {
  181. //
  182. // Got Bad Ptr
  183. //
  184. hr = E_POINTER;
  185. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_INVALID_ARGUMENT, IID_IFaxJobStatus, hr);
  186. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr()"), hr);
  187. return hr;
  188. }
  189. hr = SystemTime2LocalDate(m_dtScheduleTime, pdateScheduledTime);
  190. if (FAILED(hr))
  191. {
  192. //
  193. // Failed to convert the system time to localized variant date
  194. //
  195. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  196. return hr;
  197. }
  198. return hr;
  199. }
  200. //
  201. //====================== GET AVAILABLE OPERATIONS ==================================
  202. //
  203. STDMETHODIMP
  204. CFaxJobStatus::get_AvailableOperations(
  205. FAX_JOB_OPERATIONS_ENUM *pAvailableOperations
  206. )
  207. /*++
  208. Routine name : CFaxJobStatus::get_AvailableOperations
  209. Routine description:
  210. The operations available for the Fax Job
  211. Author:
  212. Iv Garber (IvG), Jul, 2000
  213. Arguments:
  214. pAvailableOperations [out] - Pointer to the place to put the Bit-Wise Combination
  215. of Available Operations on the current Fax Job
  216. Return Value:
  217. Standard HRESULT code
  218. --*/
  219. {
  220. HRESULT hr = S_OK;
  221. DBG_ENTER (TEXT("CFaxJobStatus::get_AvailableOperations"), hr);
  222. //
  223. // Check that we have got good Ptr
  224. //
  225. if (::IsBadWritePtr(pAvailableOperations, sizeof(FAX_JOB_OPERATIONS_ENUM)))
  226. {
  227. hr = E_POINTER;
  228. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr(pAvailableOperations, sizeof(FAX_JOB_OPERATIONS_ENUM))"), hr);
  229. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  230. return hr;
  231. }
  232. *pAvailableOperations = FAX_JOB_OPERATIONS_ENUM(m_dwAvailableOperations);
  233. return hr;
  234. }
  235. //
  236. //====================== GET PAGES ================================================
  237. //
  238. STDMETHODIMP
  239. CFaxJobStatus::get_Pages(
  240. long *plPages
  241. )
  242. /*++
  243. Routine name : CFaxJobStatus::get_Pages
  244. Routine description:
  245. Return total number of pages of the message
  246. Author:
  247. Iv Garber (IvG), Jul, 2000
  248. Arguments:
  249. plPages [out] - Pointer to the place to put the value
  250. Return Value:
  251. Standard HRESULT code
  252. --*/
  253. {
  254. HRESULT hr = S_OK;
  255. DBG_ENTER (TEXT("CFaxJobStatus::get_Pages"), hr);
  256. hr = GetLong(plPages, m_dwPageCount);
  257. if (FAILED(hr))
  258. {
  259. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  260. return hr;
  261. }
  262. return hr;
  263. }
  264. //
  265. //====================== GET CALLER ID ================================================
  266. //
  267. STDMETHODIMP
  268. CFaxJobStatus::get_CallerId(
  269. BSTR *pbstrCallerId
  270. )
  271. /*++
  272. Routine name : CFaxJobStatus::get_CallerId
  273. Routine description:
  274. Return the Caller Id of Job's Phone Call
  275. Author:
  276. Iv Garber (IvG), Jul, 2000
  277. Arguments:
  278. pbstrCallerId [out] - pointer to the place to put the Caller Id
  279. Return Value:
  280. Standard HRESULT code
  281. --*/
  282. {
  283. HRESULT hr = S_OK;
  284. DBG_ENTER (TEXT("CFaxJobStatus::get_CallerId"), hr);
  285. hr = GetBstr(pbstrCallerId, m_bstrCallerId);
  286. if (FAILED(hr))
  287. {
  288. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  289. return hr;
  290. }
  291. return hr;
  292. }
  293. //
  294. //====================== GET ROUTING INFORMATION ======================================
  295. //
  296. STDMETHODIMP
  297. CFaxJobStatus::get_RoutingInformation(
  298. BSTR *pbstrRoutingInformation
  299. )
  300. /*++
  301. Routine name : CFaxJobStatus::get_RoutingInformation
  302. Routine description:
  303. Return the Routing Information of the Job
  304. Author:
  305. Iv Garber (IvG), Jul, 2000
  306. Arguments:
  307. pbstrRoutingInformation [out] - pointer to place to put Routing Information
  308. Return Value:
  309. Standard HRESULT code
  310. --*/
  311. {
  312. HRESULT hr = S_OK;
  313. DBG_ENTER (TEXT("CFaxJobStatus::get_RoutingInformation"), hr);
  314. hr = GetBstr(pbstrRoutingInformation, m_bstrRoutingInfo);
  315. if (FAILED(hr))
  316. {
  317. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  318. return hr;
  319. }
  320. return hr;
  321. }
  322. //
  323. //====================== GET STATUS =============================================
  324. //
  325. HRESULT
  326. CFaxJobStatus::get_Status(
  327. FAX_JOB_STATUS_ENUM *pStatus
  328. )
  329. /*++
  330. Routine name : CFaxJobStatus::get_Status
  331. Routine description:
  332. The current Queue Status of the Fax Job
  333. Author:
  334. Iv Garber (IvG), Jul, 2000
  335. Arguments:
  336. pStatus [out] - Pointer to the place to put the Bit-Wise Combination of status
  337. Return Value:
  338. Standard HRESULT code
  339. --*/
  340. {
  341. HRESULT hr = S_OK;
  342. DBG_ENTER (TEXT("CFaxJobStatus::get_Status"), hr);
  343. //
  344. // Check that we have got good Ptr
  345. //
  346. if (::IsBadWritePtr(pStatus, sizeof(FAX_JOB_STATUS_ENUM)))
  347. {
  348. hr = E_POINTER;
  349. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr(pStatus, sizeof(FAX_JOB_STATUS_ENUM))"), hr);
  350. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  351. return hr;
  352. }
  353. *pStatus = FAX_JOB_STATUS_ENUM(m_dwQueueStatus);
  354. return hr;
  355. }
  356. //
  357. //====================== GET EXTENDED STATUS CODE ===============================
  358. //
  359. STDMETHODIMP
  360. CFaxJobStatus::get_ExtendedStatusCode(
  361. FAX_JOB_EXTENDED_STATUS_ENUM *pExtendedStatusCode
  362. )
  363. /*++
  364. Routine name : CFaxJobStatus::get_ExtendedStatusCode
  365. Routine description:
  366. The Code of the Extended Status of the Fax Job
  367. Author:
  368. Iv Garber (IvG), Jul, 2000
  369. Arguments:
  370. pExtendedStatusCode [out] - Pointer to the place to put the status code
  371. Return Value:
  372. Standard HRESULT code
  373. --*/
  374. {
  375. HRESULT hr = S_OK;
  376. DBG_ENTER (TEXT("CFaxJobStatus::get_ExtendedStatusCode"), hr);
  377. //
  378. // Check that we can write to the given pointer
  379. //
  380. if (::IsBadWritePtr(pExtendedStatusCode, sizeof(FAX_JOB_EXTENDED_STATUS_ENUM)))
  381. {
  382. //
  383. // Got Bad Return Pointer
  384. //
  385. hr = E_POINTER;
  386. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_INVALID_ARGUMENT, IID_IFaxJobStatus, hr);
  387. CALL_FAIL(GENERAL_ERR, _T("::IsBadWritePtr"), hr);
  388. return hr;
  389. }
  390. *pExtendedStatusCode = m_ExtendedStatusCode;
  391. return hr;
  392. }
  393. //
  394. //====================== GET RETRIES =============================================
  395. //
  396. STDMETHODIMP
  397. CFaxJobStatus::get_Retries(
  398. long *plRetries
  399. )
  400. /*++
  401. Routine name : CFaxJobStatus::get_Retries
  402. Routine description:
  403. The number of unsuccessful retries of the Fax Job
  404. Author:
  405. Iv Garber (IvG), Jul, 2000
  406. Arguments:
  407. plRetries [out] - Pointer to the place to put the number of Retries
  408. Return Value:
  409. Standard HRESULT code
  410. --*/
  411. {
  412. HRESULT hr = S_OK;
  413. DBG_ENTER (TEXT("CFaxJobStatus::get_Retries"), hr);
  414. hr = GetLong(plRetries, m_dwRetries);
  415. if (FAILED(hr))
  416. {
  417. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  418. return hr;
  419. }
  420. return hr;
  421. }
  422. //
  423. //====================== GET TSID ================================================
  424. //
  425. STDMETHODIMP
  426. CFaxJobStatus::get_TSID(
  427. BSTR *pbstrTSID
  428. )
  429. /*++
  430. Routine name : CFaxJobStatus::get_TSID
  431. Routine description:
  432. Return Transmitting Station ID of the Job
  433. Author:
  434. Iv Garber (IvG), May, 2000
  435. Arguments:
  436. pbstrTSID [out] - pointer to the place to put the TSID
  437. Return Value:
  438. Standard HRESULT code
  439. --*/
  440. {
  441. HRESULT hr = S_OK;
  442. DBG_ENTER (TEXT("CFaxJobStatus::get_TSID"), hr);
  443. hr = GetBstr(pbstrTSID, m_bstrTSID);
  444. if (FAILED(hr))
  445. {
  446. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  447. return hr;
  448. }
  449. return hr;
  450. }
  451. //
  452. //====================== GET CSID ================================================
  453. //
  454. STDMETHODIMP
  455. CFaxJobStatus::get_CSID(
  456. BSTR *pbstrCSID
  457. )
  458. /*++
  459. Routine name : CFaxJobStatus::get_CSID
  460. Routine description:
  461. Return Called Station ID of the Job
  462. Author:
  463. Iv Garber (IvG), May, 2000
  464. Arguments:
  465. pbstrCSID [out] - pointer to the place to put the CSID
  466. Return Value:
  467. Standard HRESULT code
  468. --*/
  469. {
  470. HRESULT hr = S_OK;
  471. DBG_ENTER (TEXT("CFaxJobStatus::get_CSID"), hr);
  472. hr = GetBstr(pbstrCSID, m_bstrCSID);
  473. if (FAILED(hr))
  474. {
  475. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  476. return hr;
  477. }
  478. return hr;
  479. }
  480. //
  481. //====================== GET EXTENDED STATUS =======================================
  482. //
  483. STDMETHODIMP
  484. CFaxJobStatus::get_ExtendedStatus(
  485. BSTR *pbstrExtendedStatus
  486. )
  487. /*++
  488. Routine name : CFaxJobStatus::get_ExtendedStatus
  489. Routine description:
  490. Return String Description of the Extended Status of the Job
  491. Author:
  492. Iv Garber (IvG), Jul, 2000
  493. Arguments:
  494. pbstrExtendedStatus [out] - pointer to the place to put the Extended Status
  495. Return Value:
  496. Standard HRESULT code
  497. --*/
  498. {
  499. HRESULT hr = S_OK;
  500. DBG_ENTER (TEXT("CFaxJobStatus::get_ExtendedStatus"), hr);
  501. hr = GetBstr(pbstrExtendedStatus, m_bstrExtendedStatus);
  502. if (FAILED(hr))
  503. {
  504. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  505. return hr;
  506. }
  507. return hr;
  508. }
  509. //
  510. //====================== GET CURRENT PAGE =============================================
  511. //
  512. STDMETHODIMP
  513. CFaxJobStatus::get_CurrentPage(
  514. long *plCurrentPage
  515. )
  516. /*++
  517. Routine name : CFaxJobStatus::get_CurrentPage
  518. Routine description:
  519. Current Page number being received / sent
  520. Author:
  521. Iv Garber (IvG), May, 2000
  522. Arguments:
  523. plCurrentPage [out] - Pointer to the place to put the Current Page Number
  524. Return Value:
  525. Standard HRESULT code
  526. --*/
  527. {
  528. HRESULT hr = S_OK;
  529. DBG_ENTER (TEXT("CFaxJobStatus::get_CurrentPage"), hr);
  530. hr = GetLong(plCurrentPage, m_dwCurrentPage);
  531. if (FAILED(hr))
  532. {
  533. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  534. return hr;
  535. }
  536. return hr;
  537. }
  538. //
  539. //====================== GET DEVICE ID =============================================
  540. //
  541. STDMETHODIMP
  542. CFaxJobStatus::get_DeviceId(
  543. long *plDeviceId
  544. )
  545. /*++
  546. Routine name : CFaxJobStatus::get_DeviceId
  547. Routine description:
  548. The Device Id by which the Job is being sent / received.
  549. Author:
  550. Iv Garber (IvG), May, 2000
  551. Arguments:
  552. plDeviceId [out] - Pointer to the place to put the Device Id
  553. Return Value:
  554. Standard HRESULT code
  555. --*/
  556. {
  557. HRESULT hr = S_OK;
  558. DBG_ENTER (TEXT("CFaxJobStatus::get_DeviceId"), hr);
  559. hr = GetLong(plDeviceId, m_dwDeviceId);
  560. if (FAILED(hr))
  561. {
  562. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  563. return hr;
  564. }
  565. return hr;
  566. }
  567. //
  568. //====================== GET SIZE ================================================
  569. //
  570. STDMETHODIMP
  571. CFaxJobStatus::get_Size(
  572. long *plSize
  573. )
  574. /*++
  575. Routine name : CFaxJobStatus::get_Size
  576. Routine description:
  577. Return Size ( in bytes ) of Fax Job's TIFF File
  578. Author:
  579. Iv Garber (IvG), Jul, 2000
  580. Arguments:
  581. plSize [out] - Pointer to the place to put Size
  582. Return Value:
  583. Standard HRESULT code
  584. --*/
  585. {
  586. HRESULT hr = S_OK;
  587. DBG_ENTER (TEXT("CFaxJobStatus::get_Size"), hr);
  588. hr = GetLong(plSize, m_dwSize);
  589. if (FAILED(hr))
  590. {
  591. AtlReportError(CLSID_FaxJobStatus, GetErrorMsgId(hr), IID_IFaxJobStatus, hr);
  592. return hr;
  593. }
  594. return hr;
  595. }
  596. //
  597. //==================== INIT ===================================================
  598. //
  599. HRESULT
  600. CFaxJobStatus::Init(
  601. FAX_JOB_STATUS *pJobStatus
  602. )
  603. /*++
  604. Routine name : CFaxJobStatus::Init
  605. Routine description:
  606. Initialize the Job Status Class with the data from FAX_JOB_STATUS struct
  607. Author:
  608. Iv Garber (IvG), May, 2000
  609. Arguments:
  610. pJobStatus [in] - Job Info
  611. Return Value:
  612. Standard HRESULT code
  613. --*/
  614. {
  615. HRESULT hr = S_OK;
  616. DBG_ENTER (TEXT("CFaxJobStatus::Init"), hr);
  617. ATLASSERT(pJobStatus);
  618. //
  619. // dwQueueStatus cannot contain JS_DELETING value
  620. //
  621. ATLASSERT(0 == (pJobStatus->dwQueueStatus & JS_DELETING));
  622. //
  623. // Set Job Type
  624. //
  625. switch(pJobStatus->dwJobType)
  626. {
  627. case JT_SEND:
  628. m_JobType = fjtSEND;
  629. break;
  630. case JT_RECEIVE:
  631. m_JobType = fjtRECEIVE;
  632. break;
  633. case JT_ROUTING:
  634. m_JobType = fjtROUTING;
  635. break;
  636. default:
  637. CALL_FAIL(GENERAL_ERR,
  638. _T("CFaxJobStatus::Init() got unknown/unsupported Job Type : %ld"),
  639. pJobStatus->dwJobType);
  640. //
  641. // This is assert false
  642. //
  643. ATLASSERT(pJobStatus->dwJobType == JT_RECEIVE);
  644. AtlReportError(CLSID_FaxJobStatus,
  645. IDS_ERROR_INVALID_ARGUMENT,
  646. IID_IFaxJobStatus,
  647. hr);
  648. hr = E_INVALIDARG;
  649. return hr;
  650. }
  651. m_dwSize = pJobStatus->dwSize;
  652. m_dwJobId = pJobStatus->dwJobID;
  653. m_dwRetries = pJobStatus->dwRetries;
  654. m_dwDeviceId = pJobStatus->dwDeviceID;
  655. m_dwPageCount = pJobStatus->dwPageCount;
  656. m_dwCurrentPage = pJobStatus->dwCurrentPage;
  657. m_dwQueueStatus = pJobStatus->dwQueueStatus;
  658. m_dwAvailableOperations = pJobStatus->dwAvailableJobOperations;
  659. m_ExtendedStatusCode = FAX_JOB_EXTENDED_STATUS_ENUM(pJobStatus->dwExtendedStatus);
  660. m_dtScheduleTime = pJobStatus->tmScheduleTime;
  661. m_dtTransmissionEnd = pJobStatus->tmTransmissionEndTime;
  662. m_dtTransmissionStart = pJobStatus->tmTransmissionStartTime;
  663. m_bstrTSID = pJobStatus->lpctstrTsid;
  664. m_bstrCSID = pJobStatus->lpctstrCsid;
  665. m_bstrExtendedStatus = pJobStatus->lpctstrExtendedStatus;
  666. m_bstrRoutingInfo = pJobStatus->lpctstrRoutingInfo;
  667. m_bstrCallerId = pJobStatus->lpctstrCallerID;
  668. m_dwValidityMask = pJobStatus->dwValidityMask;
  669. if ( ((pJobStatus->lpctstrTsid) && !m_bstrTSID) ||
  670. ((pJobStatus->lpctstrCsid) && !m_bstrCSID) ||
  671. ((pJobStatus->lpctstrRoutingInfo) && !m_bstrRoutingInfo) ||
  672. ((pJobStatus->lpctstrExtendedStatus) && !m_bstrExtendedStatus) ||
  673. ((pJobStatus->lpctstrCallerID) && !m_bstrCallerId) )
  674. {
  675. //
  676. // Not enough memory to copy the TSID into CComBSTR
  677. //
  678. hr = E_OUTOFMEMORY;
  679. AtlReportError(CLSID_FaxJobStatus, IDS_ERROR_OUTOFMEMORY, IID_IFaxJobStatus, hr);
  680. CALL_FAIL(MEM_ERR, _T("CComBSTR::operator=()"), hr);
  681. return hr;
  682. }
  683. return hr;
  684. }
  685. //
  686. //======================= SUPPORT ERROR INFO ==================================
  687. //
  688. STDMETHODIMP
  689. CFaxJobStatus::InterfaceSupportsErrorInfo(
  690. REFIID riid
  691. )
  692. /*++
  693. Routine name : CFaxJobStatus::InterfaceSupportsErrorInfo
  694. Routine description:
  695. ATL's implementation of Support Error Info.
  696. Author:
  697. Iv Garber (IvG), Jul, 2000
  698. Arguments:
  699. riid [in] - reference to the ifc to check.
  700. Return Value:
  701. Standard HRESULT code
  702. --*/
  703. {
  704. static const IID* arr[] =
  705. {
  706. &IID_IFaxJobStatus
  707. };
  708. for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
  709. {
  710. if (InlineIsEqualGUID(*arr[i],riid))
  711. return S_OK;
  712. }
  713. return S_FALSE;
  714. }