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.

1171 lines
20 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. fsapost.cpp
  5. Abstract:
  6. This class contains represents a post it - a unit of work
  7. that is exchanged between the FSA and the HSM engine.
  8. Author:
  9. Cat Brant [cbrant] 1-Apr-1997
  10. Revision History:
  11. --*/
  12. #include "stdafx.h"
  13. #undef WSB_TRACE_IS
  14. #define WSB_TRACE_IS WSB_TRACE_BIT_FSA
  15. #include "wsb.h"
  16. #include "fsa.h"
  17. #include "fsapost.h"
  18. // Module data
  19. static USHORT iCount = 0; // Count of existing objects
  20. HRESULT
  21. CFsaPostIt::CompareTo(
  22. IN IUnknown* pUnknown,
  23. OUT SHORT* pResult
  24. )
  25. /*++
  26. Implements:
  27. IWsbCollectable::CompareTo().
  28. --*/
  29. {
  30. HRESULT hr = S_OK;
  31. CComPtr<IFsaPostIt> pPostIt;
  32. WsbTraceIn(OLESTR("CFsaPostIt::CompareTo"), OLESTR(""));
  33. try {
  34. // Did they give us a valid item to compare to?
  35. WsbAssert(0 != pUnknown, E_POINTER);
  36. // We need the IFsaPostIt interface to get the value of the object.
  37. WsbAffirmHr(pUnknown->QueryInterface(IID_IFsaPostIt, (void**) &pPostIt));
  38. // Compare the rules.
  39. hr = CompareToIPostIt(pPostIt, pResult);
  40. } WsbCatch(hr);
  41. WsbTraceOut(OLESTR("CHsmPostIt::CompareTo"), OLESTR("hr = <%ls>, result = <%ls>"), WsbHrAsString(hr), WsbPtrToShortAsString(pResult));
  42. return(hr);
  43. }
  44. HRESULT
  45. CFsaPostIt::CompareToIPostIt(
  46. IN IFsaPostIt* pPostIt,
  47. OUT SHORT* pResult
  48. )
  49. /*++
  50. Implements:
  51. IFsaPostIt::CompareToIPostIt().
  52. --*/
  53. {
  54. HRESULT hr = S_OK;
  55. CWsbStringPtr path;
  56. CWsbStringPtr name;
  57. WsbTraceIn(OLESTR("CFsaPostIt::CompareToIPostIt"), OLESTR(""));
  58. try {
  59. // Did they give us a valid item to compare to?
  60. WsbAssert(0 != pPostIt, E_POINTER);
  61. //
  62. // Not used - not implemented
  63. //
  64. hr = E_NOTIMPL;
  65. // Compare the PostIt
  66. } WsbCatch(hr);
  67. WsbTraceOut(OLESTR("CFsaPostIt::CompareToIPostIt"), OLESTR("hr = <%ls>, result = <%ls>"), WsbHrAsString(hr), WsbPtrToShortAsString(pResult));
  68. return(hr);
  69. }
  70. HRESULT
  71. CFsaPostIt::FinalConstruct(
  72. void
  73. )
  74. /*++
  75. Implements:
  76. CComObjectRoot::FinalConstruct().
  77. --*/
  78. {
  79. HRESULT hr = S_OK;
  80. WsbTraceIn(OLESTR("CFsaPostIt::FinalConstruct"), OLESTR(""));
  81. try {
  82. WsbAffirmHr(CWsbObject::FinalConstruct());
  83. m_pSession = 0;
  84. m_storagePoolId = GUID_NULL;
  85. m_mode = 0;
  86. m_requestAction = FSA_REQUEST_ACTION_NONE;
  87. m_resultAction = FSA_RESULT_ACTION_NONE;
  88. m_fileVersionId = 0;
  89. m_requestOffset = 0;
  90. memset (&m_placeholder, 0, sizeof(FSA_PLACEHOLDER));
  91. m_path = OLESTR("");
  92. m_usn = 0;
  93. m_hr = S_OK;
  94. } WsbCatch(hr);
  95. iCount++;
  96. WsbTraceOut(OLESTR("CFsaPostIt::FinalConstruct"),OLESTR("hr = <%ls>, Count is <%d>"),
  97. WsbHrAsString(hr), iCount);
  98. return(hr);
  99. }
  100. void
  101. CFsaPostIt::FinalRelease(
  102. void
  103. )
  104. /*++
  105. Implements:
  106. CComObjectRoot::FinalRelease().
  107. --*/
  108. {
  109. WsbTraceIn(OLESTR("CFsaPostIt::FinalRelease"),OLESTR(""));
  110. // Let the parent class do his thing.
  111. CWsbObject::FinalRelease();
  112. iCount--;
  113. WsbTraceOut(OLESTR("CFsaPostIt::FinalRelease"),OLESTR("Count is <%d>"), iCount);
  114. }
  115. HRESULT
  116. CFsaPostIt::GetFileVersionId(
  117. OUT LONGLONG *pFileVersionId
  118. )
  119. /*++
  120. Implements:
  121. IFsaPostIt::GetFileVersionId().
  122. --*/
  123. {
  124. HRESULT hr = S_OK;
  125. WsbTraceIn(OLESTR("CFsaPostIt::GetFileVersionId"), OLESTR(""));
  126. try {
  127. // Did they give us a valid item to compare to?
  128. WsbAssert(0 != pFileVersionId, E_POINTER);
  129. *pFileVersionId = m_fileVersionId;
  130. } WsbCatch(hr);
  131. WsbTraceOut(OLESTR("CFsaPostIt::GetFileVersionId"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  132. return(hr);
  133. }
  134. HRESULT
  135. CFsaPostIt::GetFilterRecall(
  136. IFsaFilterRecall** ppRecall
  137. )
  138. /*++
  139. Implements:
  140. IFsaPostIt::GetFilterRecall().
  141. --*/
  142. {
  143. HRESULT hr = S_OK;
  144. WsbTraceIn(OLESTR("CFsaPostIt::GetFilterRecall"), OLESTR(""));
  145. try {
  146. // Did they give us a valid item.
  147. WsbAssert(0 != ppRecall, E_POINTER);
  148. *ppRecall = m_pFilterRecall;
  149. m_pFilterRecall.p->AddRef();
  150. } WsbCatch(hr);
  151. WsbTraceOut(OLESTR("CFsaPostIt::GetFilterRecall"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  152. return(hr);
  153. }
  154. HRESULT
  155. CFsaPostIt::GetMode(
  156. OUT ULONG *pMode
  157. )
  158. /*++
  159. Implements:
  160. IFsaPostIt::GetMode().
  161. --*/
  162. {
  163. HRESULT hr = S_OK;
  164. WsbTraceIn(OLESTR("CFsaPostIt::GetMode"), OLESTR(""));
  165. try {
  166. // Did they give us a valid item to compare to?
  167. WsbAssert(0 != pMode, E_POINTER);
  168. *pMode = m_mode;
  169. } WsbCatch(hr);
  170. WsbTraceOut(OLESTR("CFsaPostIt::GetMode"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  171. return(hr);
  172. }
  173. HRESULT
  174. CFsaPostIt::GetPath(
  175. OLECHAR **pPath,
  176. IN ULONG bufferSize
  177. )
  178. /*++
  179. Implements:
  180. IFsaPostIt::GetPath().
  181. --*/
  182. {
  183. HRESULT hr = S_OK;
  184. CWsbStringPtr path;
  185. WsbTraceIn(OLESTR("CFsaPostIt::GetPath"), OLESTR(""));
  186. try {
  187. // Did they give us a valid item to compare to?
  188. WsbAssert(0 != pPath, E_POINTER);
  189. WsbAffirmHr(m_path.CopyTo(pPath, bufferSize));
  190. } WsbCatch(hr);
  191. WsbTraceOut(OLESTR("CFsaPostIt::GetPath"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  192. return(hr);
  193. }
  194. HRESULT
  195. CFsaPostIt::GetPlaceholder(
  196. FSA_PLACEHOLDER *pPlaceholder
  197. )
  198. /*++
  199. Implements:
  200. IFsaPostIt::GetPlaceholder().
  201. --*/
  202. {
  203. HRESULT hr = S_OK;
  204. WsbTraceIn(OLESTR("CFsaPostIt::GetPlaceholder"), OLESTR(""));
  205. try {
  206. // Did they give us a valid item to compare to?
  207. WsbAssert(0 != pPlaceholder, E_POINTER);
  208. memcpy(pPlaceholder, &m_placeholder, sizeof(FSA_PLACEHOLDER));
  209. } WsbCatch(hr);
  210. WsbTraceOut(OLESTR("CFsaPostIt::GetPlaceholder"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  211. return(hr);
  212. }
  213. HRESULT
  214. CFsaPostIt::GetRequestAction(
  215. FSA_REQUEST_ACTION *pRequestAction
  216. )
  217. /*++
  218. Implements:
  219. IFsaPostIt::GetRequestAction().
  220. --*/
  221. {
  222. HRESULT hr = S_OK;
  223. WsbTraceIn(OLESTR("CFsaPostIt::GetRequestAction"), OLESTR(""));
  224. try {
  225. // Did they give us a valid item to compare to?
  226. WsbAssert(0 != pRequestAction, E_POINTER);
  227. *pRequestAction = m_requestAction;
  228. } WsbCatch(hr);
  229. WsbTraceOut(OLESTR("CFsaPostIt::GetRequestAction"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  230. return(hr);
  231. }
  232. HRESULT
  233. CFsaPostIt::GetRequestOffset(
  234. LONGLONG *pRequestOffset
  235. )
  236. /*++
  237. Implements:
  238. IFsaPostIt::GetRequestOffset().
  239. --*/
  240. {
  241. HRESULT hr = S_OK;
  242. CWsbStringPtr path;
  243. CWsbStringPtr name;
  244. WsbTraceIn(OLESTR("CFsaPostIt::GetRequestOffset"), OLESTR(""));
  245. try {
  246. // Did they give us a valid item to compare to?
  247. WsbAssert(0 != pRequestOffset, E_POINTER);
  248. *pRequestOffset = m_requestOffset;
  249. } WsbCatch(hr);
  250. WsbTraceOut(OLESTR("CFsaPostIt::GetRequestOffset"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  251. return(hr);
  252. }
  253. HRESULT
  254. CFsaPostIt::GetRequestSize(
  255. LONGLONG *pRequestSize
  256. )
  257. /*++
  258. Implements:
  259. IFsaPostIt::GetRequestSize().
  260. --*/
  261. {
  262. HRESULT hr = S_OK;
  263. CWsbStringPtr path;
  264. CWsbStringPtr name;
  265. WsbTraceIn(OLESTR("CFsaPostIt::GetRequestSize"), OLESTR(""));
  266. try {
  267. // Did they give us a valid item to compare to?
  268. WsbAssert(0 != pRequestSize, E_POINTER);
  269. *pRequestSize = m_requestSize;
  270. } WsbCatch(hr);
  271. WsbTraceOut(OLESTR("CFsaPostIt::GetRequestSize"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  272. return(hr);
  273. }
  274. HRESULT
  275. CFsaPostIt::GetResult(
  276. HRESULT *pHr
  277. )
  278. /*++
  279. Implements:
  280. IFsaPostIt::GetResult().
  281. --*/
  282. {
  283. HRESULT hr = S_OK;
  284. CWsbStringPtr path;
  285. CWsbStringPtr name;
  286. WsbTraceIn(OLESTR("CFsaPostIt::GetResult"), OLESTR(""));
  287. try {
  288. // Did they give us a valid item to compare to?
  289. WsbAssert(0 != pHr, E_POINTER);
  290. *pHr = m_hr;
  291. } WsbCatch(hr);
  292. WsbTraceOut(OLESTR("CFsaPostIt::GetResultAction"), OLESTR("hr = <%ls>, result = <%ls>"),
  293. WsbHrAsString(hr), WsbHrAsString(*pHr));
  294. return(hr);
  295. }
  296. HRESULT
  297. CFsaPostIt::GetResultAction(
  298. FSA_RESULT_ACTION *pResultAction
  299. )
  300. /*++
  301. Implements:
  302. IFsaPostIt::GetResultAction().
  303. --*/
  304. {
  305. HRESULT hr = S_OK;
  306. CWsbStringPtr path;
  307. CWsbStringPtr name;
  308. WsbTraceIn(OLESTR("CFsaPostIt::GetResultAction"), OLESTR(""));
  309. try {
  310. // Did they give us a valid item to compare to?
  311. WsbAssert(0 != pResultAction, E_POINTER);
  312. *pResultAction = m_resultAction;
  313. } WsbCatch(hr);
  314. WsbTraceOut(OLESTR("CFsaPostIt::GetResultAction"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  315. return(hr);
  316. }
  317. HRESULT
  318. CFsaPostIt::GetSession(
  319. IHsmSession **ppSession
  320. )
  321. /*++
  322. Implements:
  323. IFsaPostIt::GetSession().
  324. --*/
  325. {
  326. HRESULT hr = S_OK;
  327. CWsbStringPtr path;
  328. CWsbStringPtr name;
  329. WsbTraceIn(OLESTR("CFsaPostIt::GetSession"), OLESTR(""));
  330. try {
  331. // Did they give us a valid item to compare to?
  332. WsbAssert(0 != ppSession, E_POINTER);
  333. *ppSession = m_pSession;
  334. m_pSession.p->AddRef();
  335. } WsbCatch(hr);
  336. WsbTraceOut(OLESTR("CFsaPostIt::GetSession"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  337. return(hr);
  338. }
  339. HRESULT
  340. CFsaPostIt::GetStoragePoolId(
  341. GUID *pStoragePoolId
  342. )
  343. /*++
  344. Implements:
  345. IFsaPostIt::GetStoragePoolId().
  346. --*/
  347. {
  348. HRESULT hr = S_OK;
  349. CWsbStringPtr path;
  350. CWsbStringPtr name;
  351. WsbTraceIn(OLESTR("CFsaPostIt::GetStoragePoolId"), OLESTR(""));
  352. try {
  353. // Did they give us a valid item to compare to?
  354. WsbAssert(0 != pStoragePoolId, E_POINTER);
  355. memcpy(pStoragePoolId, &m_storagePoolId, sizeof(GUID));
  356. } WsbCatch(hr);
  357. WsbTraceOut(OLESTR("CFsaPostIt::GetStoragePoolId"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  358. return(hr);
  359. }
  360. HRESULT
  361. CFsaPostIt::GetUSN(
  362. LONGLONG *pUsn
  363. )
  364. /*++
  365. Implements:
  366. IFsaPostIt::GetUSN().
  367. --*/
  368. {
  369. HRESULT hr = S_OK;
  370. CWsbStringPtr path;
  371. CWsbStringPtr name;
  372. WsbTraceIn(OLESTR("CFsaPostIt::GetUSN"), OLESTR(""));
  373. try {
  374. // Did they give us a valid item to compare to?
  375. WsbAssert(0 != pUsn, E_POINTER);
  376. *pUsn = m_usn;
  377. } WsbCatch(hr);
  378. WsbTraceOut(OLESTR("CFsaPostIt::GetUSN"), OLESTR("hr = <%ls>, USN = <%ls>"),
  379. WsbHrAsString(hr), WsbPtrToLonglongAsString(pUsn));
  380. return(hr);
  381. }
  382. HRESULT
  383. CFsaPostIt::GetThreadId(
  384. DWORD *pThreadId
  385. )
  386. /*++
  387. Implements:
  388. IFsaPostIt::GetThreadId().
  389. --*/
  390. {
  391. HRESULT hr = S_OK;
  392. WsbTraceIn(OLESTR("CFsaPostIt::GetThreadId"), OLESTR(""));
  393. try {
  394. // Did they give us a valid item to compare to?
  395. WsbAssert(0 != pThreadId, E_POINTER);
  396. *pThreadId = m_threadId;
  397. } WsbCatch(hr);
  398. WsbTraceOut(OLESTR("CFsaPostIt::GetThreadId"), OLESTR("hr = <%ls>, threadId = <%ls>"),
  399. WsbHrAsString(hr), WsbPtrToLongAsString((PLONG)pThreadId));
  400. return(hr);
  401. }
  402. HRESULT
  403. CFsaPostIt::SetFileVersionId(
  404. LONGLONG fileVersionId
  405. )
  406. /*++
  407. Implements:
  408. IFsaPostIt::SetFileVersionId().
  409. --*/
  410. {
  411. HRESULT hr = S_OK;
  412. WsbTraceIn(OLESTR("CFsaPostIt::SetFileVersionId"), OLESTR(""));
  413. m_fileVersionId = fileVersionId;
  414. WsbTraceOut(OLESTR("CFsaPostIt::SetFileVersionId"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  415. return(hr);
  416. }
  417. HRESULT
  418. CFsaPostIt::SetFilterRecall(
  419. IN IFsaFilterRecall* pRecall
  420. )
  421. /*++
  422. Implements:
  423. IFsaPostIt::SetFilterRecall().
  424. --*/
  425. {
  426. HRESULT hr = S_OK;
  427. WsbTraceIn(OLESTR("CFsaPostIt::SetFilterRecall"), OLESTR(""));
  428. m_pFilterRecall = pRecall;
  429. WsbTraceOut(OLESTR("CFsaPostIt::SetFilterRecall"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  430. return(hr);
  431. }
  432. HRESULT
  433. CFsaPostIt::SetMode(
  434. ULONG mode
  435. )
  436. /*++
  437. Implements:
  438. IFsaPostIt::SetMode().
  439. --*/
  440. {
  441. HRESULT hr = S_OK;
  442. WsbTraceIn(OLESTR("CFsaPostIt::SetMode"), OLESTR(""));
  443. m_mode = mode;
  444. WsbTraceOut(OLESTR("CFsaPostIt::SetMode"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  445. return(hr);
  446. }
  447. HRESULT
  448. CFsaPostIt::SetPath(
  449. OLECHAR *path
  450. )
  451. /*++
  452. Implements:
  453. IFsaPostIt::SetPath().
  454. --*/
  455. {
  456. HRESULT hr = S_OK;
  457. WsbTraceIn(OLESTR("CFsaPostIt::SetPath"), OLESTR(""));
  458. m_path = path;
  459. WsbTraceOut(OLESTR("CFsaPostIt::SetPath"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  460. return(hr);
  461. }
  462. HRESULT
  463. CFsaPostIt::SetPlaceholder(
  464. FSA_PLACEHOLDER *pPlaceholder
  465. )
  466. /*++
  467. Implements:
  468. IFsaPostIt::SetPlaceholder().
  469. --*/
  470. {
  471. HRESULT hr = S_OK;
  472. WsbTraceIn(OLESTR("CFsaPostIt::SetPlaceholder"), OLESTR(""));
  473. try {
  474. // Did they give us a valid item to compare to?
  475. memcpy(&m_placeholder, pPlaceholder, sizeof(FSA_PLACEHOLDER));
  476. } WsbCatch(hr);
  477. WsbTraceOut(OLESTR("CFsaPostIt::SetPlaceholder"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  478. return(hr);
  479. }
  480. HRESULT
  481. CFsaPostIt::SetRequestAction(
  482. FSA_REQUEST_ACTION requestAction
  483. )
  484. /*++
  485. Implements:
  486. IFsaPostIt::SetRequestAction().
  487. --*/
  488. {
  489. HRESULT hr = S_OK;
  490. WsbTraceIn(OLESTR("CFsaPostIt::SetRequestAction"), OLESTR(""));
  491. m_requestAction = requestAction;
  492. WsbTraceOut(OLESTR("CFsaPostIt::SetRequestAction"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  493. return(hr);
  494. }
  495. HRESULT
  496. CFsaPostIt::SetRequestOffset(
  497. LONGLONG requestOffset
  498. )
  499. /*++
  500. Implements:
  501. IFsaPostIt::SetRequestOffset().
  502. --*/
  503. {
  504. HRESULT hr = S_OK;
  505. WsbTraceIn(OLESTR("CFsaPostIt::SetRequestOffset"), OLESTR(""));
  506. m_requestOffset = requestOffset;
  507. WsbTraceOut(OLESTR("CFsaPostIt::SetRequestOffset"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  508. return(hr);
  509. }
  510. HRESULT
  511. CFsaPostIt::SetRequestSize(
  512. LONGLONG requestSize
  513. )
  514. /*++
  515. Implements:
  516. IFsaPostIt::SetRequestSize().
  517. --*/
  518. {
  519. HRESULT hr = S_OK;
  520. WsbTraceIn(OLESTR("CFsaPostIt::SetRequestSize"), OLESTR(""));
  521. m_requestSize = requestSize;
  522. WsbTraceOut(OLESTR("CFsaPostIt::SetRequestSize"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  523. return(hr);
  524. }
  525. HRESULT
  526. CFsaPostIt::SetResult(
  527. HRESULT result
  528. )
  529. /*++
  530. Implements:
  531. IFsaPostIt::SetResult().
  532. --*/
  533. {
  534. HRESULT hr = S_OK;
  535. WsbTraceIn(OLESTR("CFsaPostIt::SetResult"), OLESTR("result = <%ls>"), WsbHrAsString(result));
  536. m_hr = result;
  537. WsbTraceOut(OLESTR("CFsaPostIt::SetResult"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  538. return(hr);
  539. }
  540. HRESULT
  541. CFsaPostIt::SetResultAction(
  542. FSA_RESULT_ACTION resultAction
  543. )
  544. /*++
  545. Implements:
  546. IFsaPostIt::SetResultAction().
  547. --*/
  548. {
  549. HRESULT hr = S_OK;
  550. WsbTraceIn(OLESTR("CFsaPostIt::SetResultAction"), OLESTR(""));
  551. m_resultAction = resultAction;
  552. WsbTraceOut(OLESTR("CFsaPostIt::SetResultAction"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  553. return(hr);
  554. }
  555. HRESULT
  556. CFsaPostIt::SetSession(
  557. IHsmSession *pSession
  558. )
  559. /*++
  560. Implements:
  561. IFsaPostIt::SetSession().
  562. --*/
  563. {
  564. HRESULT hr = S_OK;
  565. WsbTraceIn(OLESTR("CFsaPostIt::SetSession"), OLESTR(""));
  566. if (m_pSession != 0) {
  567. m_pSession = 0;
  568. }
  569. m_pSession = pSession;
  570. WsbTraceOut(OLESTR("CFsaPostIt::SetSession"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  571. return(hr);
  572. }
  573. HRESULT
  574. CFsaPostIt::SetStoragePoolId(
  575. GUID StoragePoolId
  576. )
  577. /*++
  578. Implements:
  579. IFsaPostIt::SetStoragePoolId().
  580. --*/
  581. {
  582. HRESULT hr = S_OK;
  583. WsbTraceIn(OLESTR("CFsaPostIt::SetStoragePoolId"), OLESTR(""));
  584. try {
  585. // Did they give us a valid item to compare to?
  586. memcpy(&m_storagePoolId, &StoragePoolId, sizeof(GUID));
  587. } WsbCatch(hr);
  588. WsbTraceOut(OLESTR("CFsaPostIt::SetStoragePoolId"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  589. return(hr);
  590. }
  591. HRESULT
  592. CFsaPostIt::SetUSN(
  593. LONGLONG usn
  594. )
  595. /*++
  596. Implements:
  597. IFsaPostIt::SetUSN().
  598. --*/
  599. {
  600. HRESULT hr = S_OK;
  601. WsbTraceIn(OLESTR("CFsaPostIt::SetUSN"), OLESTR("USN = <%ls>"), WsbLonglongAsString(usn));
  602. m_usn = usn;
  603. WsbTraceOut(OLESTR("CFsaPostIt::SetUSN"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  604. return(hr);
  605. }
  606. HRESULT
  607. CFsaPostIt::SetThreadId(
  608. DWORD threadId
  609. )
  610. /*++
  611. Implements:
  612. IFsaPostIt::SetThreadId().
  613. --*/
  614. {
  615. HRESULT hr = S_OK;
  616. WsbTraceIn(OLESTR("CFsaPostIt::SetThreadId"), OLESTR("ThreadId = <%ls>"), WsbLongAsString(threadId));
  617. m_threadId = threadId;
  618. WsbTraceOut(OLESTR("CFsaPostIt::SetThreadId"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  619. return(hr);
  620. }
  621. HRESULT
  622. CFsaPostIt::Test(
  623. USHORT* passed,
  624. USHORT* failed
  625. )
  626. /*++
  627. Implements:
  628. IWsbTestable::Test().
  629. --*/
  630. {
  631. HRESULT hr = S_OK;
  632. try {
  633. WsbAssert(0 != passed, E_POINTER);
  634. WsbAssert(0 != failed, E_POINTER);
  635. *passed = 0;
  636. *failed = 0;
  637. } WsbCatch(hr);
  638. return(hr);
  639. }
  640. HRESULT CFsaPostIt::GetClassID
  641. (
  642. OUT LPCLSID pclsid
  643. )
  644. /*++
  645. Routine Description:
  646. See IPerist::GetClassID()
  647. Arguments:
  648. See IPerist::GetClassID()
  649. Return Value:
  650. See IPerist::GetClassID()
  651. --*/
  652. {
  653. HRESULT hr = S_OK;
  654. WsbTraceIn(OLESTR("CFsaPostIt::GetClassID"), OLESTR(""));
  655. try {
  656. WsbAssert(0 != pclsid, E_POINTER);
  657. *pclsid = CLSID_CFsaPostIt;
  658. } WsbCatch(hr);
  659. WsbTraceOut(OLESTR("CFsaPostIt::GetClassID"), OLESTR("hr = <%ls>, CLSID = <%ls>"), WsbHrAsString(hr), WsbGuidAsString(*pclsid));
  660. return(hr);
  661. }
  662. HRESULT CFsaPostIt::GetSizeMax
  663. (
  664. OUT ULARGE_INTEGER* pcbSize
  665. )
  666. /*++
  667. Routine Description:
  668. See IPersistStream::GetSizeMax().
  669. Arguments:
  670. See IPersistStream::GetSizeMax().
  671. Return Value:
  672. See IPersistStream::GetSizeMax().
  673. --*/
  674. {
  675. HRESULT hr = S_OK;
  676. WsbTraceIn(OLESTR("CFsaPostIt::GetSizeMax"), OLESTR(""));
  677. try {
  678. WsbAssert(0 != pcbSize, E_POINTER);
  679. pcbSize->QuadPart = 0;
  680. hr = E_NOTIMPL;
  681. } WsbCatch(hr);
  682. WsbTraceOut(OLESTR("CFsaPostIt::GetSizeMax"),
  683. OLESTR("hr = <%ls>, Size = <%ls>"), WsbHrAsString(hr),
  684. WsbPtrToUliAsString(pcbSize));
  685. return(hr);
  686. }
  687. HRESULT CFsaPostIt::Load
  688. (
  689. IN IStream* /*pStream*/
  690. )
  691. /*++
  692. Routine Description:
  693. See IPersistStream::Load().
  694. Arguments:
  695. See IPersistStream::Load().
  696. Return Value:
  697. See IPersistStream::Load().
  698. --*/
  699. {
  700. HRESULT hr = S_OK;
  701. WsbTraceIn(OLESTR("CFsaPostIt::Load"), OLESTR(""));
  702. try {
  703. hr = E_NOTIMPL;
  704. } WsbCatch(hr);
  705. WsbTraceOut(OLESTR("CFsaPostIt::Load"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  706. return(hr);
  707. }
  708. HRESULT CFsaPostIt::Save
  709. (
  710. IN IStream* pStream,
  711. IN BOOL clearDirty
  712. )
  713. /*++
  714. Routine Description:
  715. See IPersistStream::Save().
  716. Arguments:
  717. See IPersistStream::Save().
  718. Return Value:
  719. See IPersistStream::Save().
  720. --*/
  721. {
  722. HRESULT hr = S_OK;
  723. WsbTraceIn(OLESTR("CFsaPostIt::Save"), OLESTR("clearDirty = <%ls>"), WsbBoolAsString(clearDirty));
  724. try {
  725. WsbAssert(0 != pStream, E_POINTER);
  726. hr = E_NOTIMPL;
  727. // If we got it saved and we were asked to clear the dirty bit, then
  728. // do so now.
  729. if (clearDirty) {
  730. m_isDirty = FALSE;
  731. }
  732. } WsbCatch(hr);
  733. WsbTraceOut(OLESTR("CFsaPostIt::Save"), OLESTR("hr = <%ls>"), WsbHrAsString(hr));
  734. return(hr);
  735. }