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.

832 lines
30 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusCfgDef.h
  7. //
  8. // Description:
  9. // This file contains constants,macros,etc needed by more than one ClusCfg Wizard
  10. // component.
  11. //
  12. // Maintained By:
  13. // Ozan Ozhan (OzanO) 09-JUL-2001
  14. // Galen Barbee (GalenB) 23-FEB-2001
  15. //
  16. //////////////////////////////////////////////////////////////////////////////
  17. #pragma once
  18. //////////////////////////////////////////////////////////////////////////////
  19. // Constants
  20. //////////////////////////////////////////////////////////////////////////////
  21. #define HR_S_RPC_S_SERVER_UNAVAILABLE MAKE_HRESULT( 0, FACILITY_WIN32, RPC_S_SERVER_UNAVAILABLE )
  22. #define HR_S_RPC_S_CLUSTER_NODE_DOWN MAKE_HRESULT( 0, FACILITY_WIN32, ERROR_CLUSTER_NODE_DOWN )
  23. #define HR_RPC_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER )
  24. //
  25. // Minimum storage size we allow on a quorum resource
  26. //
  27. #define MINIMUM_STORAGE_SIZE 50
  28. //
  29. // We'll select the smallest disk larger than the optimum storage size, if there's any, as the quorum resource
  30. //
  31. #define OPTIMUM_STORAGE_SIZE 500
  32. const HRESULT E_PROPTYPEMISMATCH = HRESULT_FROM_WIN32( ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH );
  33. const WCHAR g_szNameSpaceRoot[] = { L"\\\\?\\GLOBALROOT" };
  34. const WCHAR g_szUnknownQuorumUID[] = { L"Unknown Quorum" };
  35. const int STATUS_CONNECTED = 2;
  36. //
  37. // Time out and wait values...
  38. //
  39. //
  40. // Default timeout value for anything that doesn't use INFINITE wait within ClusCfg.
  41. //
  42. const DWORD CC_DEFAULT_TIMEOUT = 300000; // 5 minutes
  43. //
  44. // Limiting user name lengths according to "Naming Properties" and "Example Code for Creating a User"
  45. // topics under Active Directory in MSDN
  46. //
  47. #define MAX_USERNAME_LENGTH 20
  48. //////////////////////////////////////////////////////////////////////////////
  49. // Server Component Macros
  50. //////////////////////////////////////////////////////////////////////////////
  51. #define LOG_STATUS_REPORT( _psz_, _hr_ ) \
  52. THR( HrSendStatusReport( \
  53. m_picccCallback \
  54. , TASKID_Major_Server_Log \
  55. , IID_NULL \
  56. , 1 \
  57. , 1 \
  58. , 1 \
  59. , _hr_\
  60. , _psz_ \
  61. ) )
  62. #define LOG_STATUS_REPORT_STRING( _pszFormat_, _arg0_, _hr_ ) \
  63. { \
  64. BSTR _bstrMsg_ = NULL; \
  65. HRESULT _hrTemp_; \
  66. \
  67. _hrTemp_ = THR( HrFormatStringIntoBSTR( _pszFormat_, &_bstrMsg_, _arg0_ ) ); \
  68. _hrTemp_ = THR( HrSendStatusReport( \
  69. m_picccCallback \
  70. , TASKID_Major_Server_Log \
  71. , IID_NULL \
  72. , 1 \
  73. , 1 \
  74. , 1 \
  75. , _hr_ \
  76. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  77. ) ); \
  78. if ( FAILED( _hrTemp_ ) && SUCCEEDED( _hr_ ) ) \
  79. { \
  80. _hr_ = _hrTemp_; \
  81. } \
  82. \
  83. TraceSysFreeString( _bstrMsg_ ); \
  84. }
  85. #define LOG_STATUS_REPORT_STRING2( _pszFormat_, _arg0_, _arg1_, _hr_ ) \
  86. { \
  87. BSTR _bstrMsg_ = NULL; \
  88. HRESULT _hrTemp_; \
  89. \
  90. _hrTemp_ = THR( HrFormatStringIntoBSTR( _pszFormat_, &_bstrMsg_, _arg0_, _arg1_ ) ); \
  91. _hrTemp_ = THR( HrSendStatusReport( \
  92. m_picccCallback \
  93. , TASKID_Major_Server_Log \
  94. , IID_NULL \
  95. , 1 \
  96. , 1 \
  97. , 1 \
  98. , _hr_\
  99. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  100. ) ); \
  101. if ( FAILED( _hrTemp_ ) ) \
  102. { \
  103. _hr_ = _hrTemp_; \
  104. } \
  105. \
  106. TraceSysFreeString( _bstrMsg_ ); \
  107. }
  108. #define LOG_STATUS_REPORT_STRING3( _pszFormat_, _arg0_, _arg1_, _arg2_, _hr_ ) \
  109. { \
  110. BSTR _bstrMsg_ = NULL; \
  111. HRESULT _hrTemp_; \
  112. \
  113. _hrTemp_ = THR( HrFormatStringIntoBSTR( _pszFormat_, &_bstrMsg_, _arg0_, _arg1_, _arg2_ ) ); \
  114. _hrTemp_ = THR( HrSendStatusReport( \
  115. m_picccCallback \
  116. , TASKID_Major_Server_Log \
  117. , IID_NULL \
  118. , 1 \
  119. , 1 \
  120. , 1 \
  121. , _hr_\
  122. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  123. ) ); \
  124. if ( FAILED( _hrTemp_ ) ) \
  125. { \
  126. _hr_ = _hrTemp_; \
  127. } \
  128. \
  129. TraceSysFreeString( _bstrMsg_ ); \
  130. }
  131. #define LOG_STATUS_REPORT_MINOR( _minor_, _psz_, _hr_ ) \
  132. THR( HrSendStatusReport( \
  133. m_picccCallback \
  134. , TASKID_Major_Server_Log \
  135. , _minor_ \
  136. , 1 \
  137. , 1 \
  138. , 1 \
  139. , _hr_ \
  140. , _psz_ \
  141. ) )
  142. #define LOG_STATUS_REPORT_STRING_MINOR( _minor_, _pszFormat_, _arg0_, _hr_ ) \
  143. { \
  144. BSTR _bstrMsg_ = NULL; \
  145. HRESULT _hrTemp_; \
  146. \
  147. _hrTemp_ = THR( HrFormatStringIntoBSTR( _pszFormat_, &_bstrMsg_, _arg0_ ) ); \
  148. _hrTemp_ = THR( HrSendStatusReport( \
  149. m_picccCallback \
  150. , TASKID_Major_Server_Log \
  151. , _minor_ \
  152. , 1 \
  153. , 1 \
  154. , 1 \
  155. , _hr_ \
  156. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  157. ) ); \
  158. if ( FAILED( _hrTemp_ ) && SUCCEEDED( _hr_ ) ) \
  159. { \
  160. _hr_ = _hrTemp_; \
  161. } \
  162. \
  163. TraceSysFreeString( _bstrMsg_ ); \
  164. }
  165. #define LOG_STATUS_REPORT_STRING_MINOR2( _minor_, _pszFormat_, _arg0_, _arg1_, _hr_ ) \
  166. { \
  167. BSTR _bstrMsg_ = NULL; \
  168. HRESULT _hrTemp_; \
  169. \
  170. _hrTemp_ = THR( HrFormatStringIntoBSTR( _pszFormat_, &_bstrMsg_, _arg0_, _arg1_ ) ); \
  171. _hrTemp_ = THR( HrSendStatusReport( \
  172. m_picccCallback \
  173. , TASKID_Major_Server_Log \
  174. , _minor_ \
  175. , 1 \
  176. , 1 \
  177. , 1 \
  178. , _hr_ \
  179. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  180. ) ); \
  181. if ( FAILED( _hrTemp_ ) && SUCCEEDED( _hr_ ) ) \
  182. { \
  183. _hr_ = _hrTemp_; \
  184. } \
  185. \
  186. TraceSysFreeString( _bstrMsg_ ); \
  187. }
  188. #define LOG_STATUS_REPORT_STRING_MINOR3( _minor_, _pszFormat_, _arg0_, _arg1_, _arg2_, _hr_ ) \
  189. { \
  190. BSTR _bstrMsg_ = NULL; \
  191. HRESULT _hrTemp_; \
  192. \
  193. _hrTemp_ = THR( HrFormatStringIntoBSTR( _pszFormat_, &_bstrMsg_, _arg0_, _arg1_, _arg2_ ) ); \
  194. _hrTemp_ = THR( HrSendStatusReport( \
  195. m_picccCallback \
  196. , TASKID_Major_Server_Log \
  197. , _minor_ \
  198. , 1 \
  199. , 1 \
  200. , 1 \
  201. , _hr_ \
  202. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  203. ) ); \
  204. if ( FAILED( _hrTemp_ ) && SUCCEEDED( _hr_ ) ) \
  205. { \
  206. _hr_ = _hrTemp_; \
  207. } \
  208. \
  209. TraceSysFreeString( _bstrMsg_ ); \
  210. }
  211. #define STATUS_REPORT( _major_, _minor_, _uid_, _hr_ ) \
  212. THR( HrSendStatusReport( \
  213. m_picccCallback \
  214. , _major_ \
  215. , _minor_ \
  216. , 1 \
  217. , 1 \
  218. , 1 \
  219. , _hr_\
  220. , _uid_ \
  221. ) )
  222. #define STATUS_REPORT_STRING( _major_, _minor_, _idsFormat_, _arg0_, _hr_ ) \
  223. { \
  224. BSTR _bstrMsg_ = NULL; \
  225. HRESULT _hrTemp_; \
  226. \
  227. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_ ) ); \
  228. _hrTemp_ = THR( HrSendStatusReport( \
  229. m_picccCallback \
  230. , _major_ \
  231. , _minor_ \
  232. , 1 \
  233. , 1 \
  234. , 1 \
  235. , _hr_ \
  236. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  237. ) ); \
  238. if ( FAILED( _hrTemp_ ) ) \
  239. { \
  240. _hr_ = _hrTemp_; \
  241. } \
  242. \
  243. TraceSysFreeString( _bstrMsg_ ); \
  244. }
  245. #define STATUS_REPORT_STRING2( _major_, _minor_, _idsFormat_, _arg0_, _arg1_, _hr_ ) \
  246. { \
  247. BSTR _bstrMsg_ = NULL; \
  248. HRESULT _hrTemp_; \
  249. \
  250. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_, _arg1_ ) ); \
  251. _hrTemp_ = THR( HrSendStatusReport( \
  252. m_picccCallback \
  253. , _major_ \
  254. , _minor_ \
  255. , 1 \
  256. , 1 \
  257. , 1 \
  258. , _hr_ \
  259. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  260. ) ); \
  261. if ( FAILED( _hrTemp_ ) ) \
  262. { \
  263. _hr_ = _hrTemp_; \
  264. } \
  265. \
  266. TraceSysFreeString( _bstrMsg_ ); \
  267. }
  268. #define STATUS_REPORT_STRING3( _major_, _minor_, _idsFormat_, _arg0_, _arg1_, _arg2_, _hr_ ) \
  269. { \
  270. BSTR _bstrMsg_ = NULL; \
  271. HRESULT _hrTemp_; \
  272. \
  273. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_, _arg1_, _arg2_ ) ); \
  274. _hrTemp_ = THR( HrSendStatusReport( \
  275. m_picccCallback \
  276. , _major_ \
  277. , _minor_ \
  278. , 1 \
  279. , 1 \
  280. , 1 \
  281. , _hr_ \
  282. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  283. ) ); \
  284. if ( FAILED( _hrTemp_ ) ) \
  285. { \
  286. _hr_ = _hrTemp_; \
  287. } \
  288. \
  289. TraceSysFreeString( _bstrMsg_ ); \
  290. }
  291. #define STATUS_REPORT_NODESTRING( _node_, _major_, _minor_, _idsFormat_, _arg0_, _hr_ ) \
  292. { \
  293. BSTR _bstrMsg_ = NULL; \
  294. HRESULT _hrTemp_; \
  295. \
  296. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_ ) ); \
  297. _hrTemp_ = THR( HrSendStatusReport( \
  298. m_picccCallback \
  299. , _node_ \
  300. , _major_ \
  301. , _minor_ \
  302. , 1 \
  303. , 1 \
  304. , 1 \
  305. , _hr_ \
  306. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  307. ) ); \
  308. if ( FAILED( _hrTemp_ ) ) \
  309. { \
  310. _hr_ = _hrTemp_; \
  311. } \
  312. \
  313. TraceSysFreeString( _bstrMsg_ ); \
  314. }
  315. #define STATUS_REPORT_NODESTRING2( _node_, _major_, _minor_, _idsFormat_, _arg0_, _arg1_, _hr_ ) \
  316. { \
  317. BSTR _bstrMsg_ = NULL; \
  318. HRESULT _hrTemp_; \
  319. \
  320. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_, _arg1_ ) ); \
  321. _hrTemp_ = THR( HrSendStatusReport( \
  322. m_picccCallback \
  323. , _node_ \
  324. , _major_ \
  325. , _minor_ \
  326. , 1 \
  327. , 1 \
  328. , 1 \
  329. , _hr_ \
  330. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  331. ) ); \
  332. if ( FAILED( _hrTemp_ ) ) \
  333. { \
  334. _hr_ = _hrTemp_; \
  335. } \
  336. \
  337. TraceSysFreeString( _bstrMsg_ ); \
  338. }
  339. #define STATUS_REPORT_NODESTRING3( _node_, _major_, _minor_, _idsFormat_, _arg0_, _arg1_, _arg2_, _hr_ ) \
  340. { \
  341. BSTR _bstrMsg_ = NULL; \
  342. HRESULT _hrTemp_; \
  343. \
  344. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_, _arg1_, _arg2_ ) ); \
  345. _hrTemp_ = THR( HrSendStatusReport( \
  346. m_picccCallback \
  347. , _node_ \
  348. , _major_ \
  349. , _minor_ \
  350. , 1 \
  351. , 1 \
  352. , 1 \
  353. , _hr_ \
  354. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  355. ) ); \
  356. if ( FAILED( _hrTemp_ ) ) \
  357. { \
  358. _hr_ = _hrTemp_; \
  359. } \
  360. \
  361. TraceSysFreeString( _bstrMsg_ ); \
  362. }
  363. #define STATUS_REPORT_REF( _major_, _minor_, _idsMsg_, _idsRef_, _hr_ ) \
  364. THR( HrSendStatusReport( \
  365. m_picccCallback \
  366. , _major_ \
  367. , _minor_ \
  368. , 1 \
  369. , 1 \
  370. , 1 \
  371. , _hr_ \
  372. , (DWORD) _idsMsg_ \
  373. , (DWORD) _idsRef_ \
  374. ) )
  375. #define STATUS_REPORT_STRING_REF( _major_, _minor_, _idsFormat_, _arg0_, _idsRef_, _hr_ ) \
  376. { \
  377. BSTR _bstrMsg_ = NULL; \
  378. HRESULT _hrTemp_; \
  379. \
  380. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_ ) ); \
  381. _hrTemp_ = THR( HrSendStatusReport( \
  382. m_picccCallback \
  383. , _major_ \
  384. , _minor_ \
  385. , 1 \
  386. , 1 \
  387. , 1 \
  388. , _hr_ \
  389. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  390. , _idsRef_ \
  391. ) ); \
  392. if ( FAILED( _hrTemp_ ) ) \
  393. { \
  394. _hr_ = _hrTemp_; \
  395. } \
  396. \
  397. TraceSysFreeString( _bstrMsg_ ); \
  398. }
  399. #define STATUS_REPORT_STRING2_REF( _major_, _minor_, _idsFormat_, _arg0_, _arg1_, _idsRef_, _hr_ ) \
  400. { \
  401. BSTR _bstrMsg_ = NULL; \
  402. HRESULT _hrTemp_; \
  403. \
  404. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _idsFormat_, &_bstrMsg_, _arg0_, _arg1_ ) ); \
  405. _hrTemp_ = THR( HrSendStatusReport( \
  406. m_picccCallback \
  407. , _major_ \
  408. , _minor_ \
  409. , 1 \
  410. , 1 \
  411. , 1 \
  412. , _hr_ \
  413. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  414. , _idsRef_ \
  415. ) ); \
  416. if ( FAILED( _hrTemp_ ) ) \
  417. { \
  418. _hr_ = _hrTemp_; \
  419. } \
  420. \
  421. TraceSysFreeString( _bstrMsg_ ); \
  422. }
  423. //////////////////////////////////////////////////////////////////////////////
  424. // PostCfg Macros
  425. //////////////////////////////////////////////////////////////////////////////
  426. #define STATUS_REPORT_POSTCFG( _major_, _minor_, _uid_, _hr_ ) \
  427. { \
  428. BSTR _bstrMsg_ = NULL; \
  429. HRESULT _hrTemp_; \
  430. \
  431. _hrTemp_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_ ) );\
  432. _hrTemp_ = THR( SendStatusReport( \
  433. NULL \
  434. , _major_ \
  435. , _minor_ \
  436. , 1 \
  437. , 1 \
  438. , 1 \
  439. , _hr_ \
  440. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  441. , NULL \
  442. , NULL \
  443. ) ); \
  444. if ( FAILED( _hrTemp_ ) ) \
  445. { \
  446. _hr_ = _hrTemp_; \
  447. } \
  448. \
  449. TraceSysFreeString( _bstrMsg_ ); \
  450. }
  451. #define STATUS_REPORT_POSTCFG1( _major_, _minor_, _uid_, _hr_, _arg0_ ) \
  452. { \
  453. BSTR _bstrMsg_ = NULL; \
  454. HRESULT _hrTemp_; \
  455. \
  456. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_, _arg0_ ) );\
  457. _hrTemp_ = THR( SendStatusReport( \
  458. NULL \
  459. , _major_ \
  460. , _minor_ \
  461. , 1 \
  462. , 1 \
  463. , 1 \
  464. , _hr_ \
  465. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  466. , NULL \
  467. , NULL \
  468. ) ); \
  469. if ( FAILED( _hrTemp_ ) ) \
  470. { \
  471. _hr_ = _hrTemp_; \
  472. } \
  473. \
  474. TraceSysFreeString( _bstrMsg_ ); \
  475. }
  476. #define STATUS_REPORT_MINOR_POSTCFG( _major_, _uid_, _hr_ ) \
  477. { \
  478. BSTR _bstrMsg_ = NULL; \
  479. HRESULT _hrTemp_; \
  480. CLSID _clsidMinorId_; \
  481. \
  482. _hrTemp_ = THR( CoCreateGuid( &_clsidMinorId_ ) ); \
  483. if ( FAILED( _hrTemp_ ) ) \
  484. { \
  485. _clsidMinorId_ = IID_NULL; \
  486. } \
  487. \
  488. _hrTemp_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_ ) );\
  489. _hrTemp_ = THR( SendStatusReport( \
  490. NULL \
  491. , _major_ \
  492. , _clsidMinorId_ \
  493. , 1 \
  494. , 1 \
  495. , 1 \
  496. , _hr_ \
  497. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  498. , NULL \
  499. , NULL \
  500. ) ); \
  501. if ( FAILED( _hrTemp_ ) ) \
  502. { \
  503. _hr_ = _hrTemp_; \
  504. } \
  505. \
  506. TraceSysFreeString( _bstrMsg_ ); \
  507. }
  508. #define STATUS_REPORT_MINOR_POSTCFG1( _major_, _uid_, _hr_, _arg0_ ) \
  509. { \
  510. BSTR _bstrMsg_ = NULL; \
  511. HRESULT _hrTemp_; \
  512. CLSID _clsidMinorId_; \
  513. \
  514. _hrTemp_ = THR( CoCreateGuid( &_clsidMinorId_ ) ); \
  515. if ( FAILED( _hrTemp_ ) ) \
  516. { \
  517. _clsidMinorId_ = IID_NULL; \
  518. } \
  519. \
  520. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_, _arg0_ ) );\
  521. _hrTemp_ = THR( SendStatusReport( \
  522. NULL \
  523. , _major_ \
  524. , _clsidMinorId_ \
  525. , 1 \
  526. , 1 \
  527. , 1 \
  528. , _hr_ \
  529. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  530. , NULL \
  531. , NULL \
  532. ) ); \
  533. if ( FAILED( _hrTemp_ ) ) \
  534. { \
  535. _hr_ = _hrTemp_; \
  536. } \
  537. \
  538. TraceSysFreeString( _bstrMsg_ ); \
  539. }
  540. #define STATUS_REPORT_MINOR_POSTCFG2( _major_, _uid_, _hr_, _arg0_ , _arg1_) \
  541. { \
  542. BSTR _bstrMsg_ = NULL; \
  543. HRESULT _hrTemp_; \
  544. CLSID _clsidMinorId_; \
  545. \
  546. _hrTemp_ = THR( CoCreateGuid( &_clsidMinorId_ ) ); \
  547. if ( FAILED( _hrTemp_ ) ) \
  548. { \
  549. _clsidMinorId_ = IID_NULL; \
  550. } \
  551. \
  552. _hrTemp_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_, _arg0_, _arg1_ ) );\
  553. _hrTemp_ = THR( SendStatusReport( \
  554. NULL \
  555. , _major_ \
  556. , _clsidMinorId_ \
  557. , 1 \
  558. , 1 \
  559. , 1 \
  560. , _hr_ \
  561. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  562. , NULL \
  563. , NULL \
  564. ) ); \
  565. if ( FAILED( _hrTemp_ ) ) \
  566. { \
  567. _hr_ = _hrTemp_; \
  568. } \
  569. \
  570. TraceSysFreeString( _bstrMsg_ ); \
  571. }
  572. // REF version MACROS
  573. #define STATUS_REPORT_REF_POSTCFG( _major_, _minor_, _uid_, _uidref_, _hr_ ) \
  574. { \
  575. BSTR _bstrMsg_ = NULL; \
  576. BSTR _bstrRefMsg_ = NULL; \
  577. HRESULT _hrMsg_; \
  578. HRESULT _hrRef_; \
  579. HRESULT _hrTemp_; \
  580. \
  581. _hrMsg_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_ ) );\
  582. _hrRef_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uidref_, &_bstrRefMsg_ ) );\
  583. _hrTemp_ = THR( SendStatusReport( \
  584. NULL \
  585. , _major_ \
  586. , _minor_ \
  587. , 1 \
  588. , 1 \
  589. , 1 \
  590. , _hr_ \
  591. , _hrMsg_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  592. , NULL \
  593. , _hrRef_ == S_OK ? _bstrRefMsg_ : L"The reference for this entry could not be located." \
  594. ) ); \
  595. if ( FAILED( _hrTemp_ ) ) \
  596. { \
  597. _hr_ = _hrTemp_; \
  598. } \
  599. \
  600. TraceSysFreeString( _bstrMsg_ ); \
  601. TraceSysFreeString( _bstrRefMsg_ ); \
  602. }
  603. #define STATUS_REPORT_REF_POSTCFG1( _major_, _minor_, _uid_, _uidref_, _hr_, _arg0_ ) \
  604. { \
  605. BSTR _bstrMsg_ = NULL; \
  606. BSTR _bstrRefMsg_ = NULL; \
  607. HRESULT _hrTemp_; \
  608. HRESULT _hrMsg_; \
  609. HRESULT _hrRef_; \
  610. \
  611. _hrMsg_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_, _arg0_ ) );\
  612. _hrRef_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uidref_, &_bstrRefMsg_, _arg0_ ) );\
  613. _hrTemp_ = THR( SendStatusReport( \
  614. NULL \
  615. , _major_ \
  616. , _minor_ \
  617. , 1 \
  618. , 1 \
  619. , 1 \
  620. , _hr_ \
  621. , _hrMsg_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  622. , NULL \
  623. , _hrRef_ == S_OK ? _bstrRefMsg_ : L"The reference for this entry could not be located." \
  624. ) ); \
  625. if ( FAILED( _hrTemp_ ) ) \
  626. { \
  627. _hr_ = _hrTemp_; \
  628. } \
  629. \
  630. TraceSysFreeString( _bstrMsg_ ); \
  631. TraceSysFreeString( _bstrRefMsg_ ); \
  632. }
  633. #define STATUS_REPORT_MINOR_REF_POSTCFG( _major_, _uid_, _uidref_, _hr_ ) \
  634. { \
  635. BSTR _bstrMsg_ = NULL; \
  636. BSTR _bstrRefMsg_ = NULL; \
  637. HRESULT _hrTemp_; \
  638. CLSID _clsidMinorId_; \
  639. HRESULT _hrMsg_; \
  640. HRESULT _hrRef_; \
  641. \
  642. _hrTemp_ = THR( CoCreateGuid( &_clsidMinorId_ ) ); \
  643. if ( FAILED( _hrTemp_ ) ) \
  644. { \
  645. _clsidMinorId_ = IID_NULL; \
  646. } \
  647. \
  648. _hrMsg_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_ ) ); \
  649. _hrRef_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uidref_, &_bstrRefMsg_ ) ); \
  650. _hrTemp_ = THR( SendStatusReport( \
  651. NULL \
  652. , _major_ \
  653. , _clsidMinorId_ \
  654. , 1 \
  655. , 1 \
  656. , 1 \
  657. , _hr_ \
  658. , _hrMsg_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  659. , NULL \
  660. , _hrRef_ == S_OK ? _bstrRefMsg_ : L"The reference for this entry could not be located." \
  661. ) ); \
  662. if ( FAILED( _hrTemp_ ) ) \
  663. { \
  664. _hr_ = _hrTemp_; \
  665. } \
  666. \
  667. TraceSysFreeString( _bstrMsg_ ); \
  668. TraceSysFreeString( _bstrRefMsg_ ); \
  669. }
  670. #define STATUS_REPORT_MINOR_REF_POSTCFG1( _major_, _uid_, _uidref_, _hr_, _arg0_ ) \
  671. { \
  672. BSTR _bstrMsg_ = NULL; \
  673. BSTR _bstrRefMsg_ = NULL; \
  674. HRESULT _hrTemp_; \
  675. CLSID _clsidMinorId_; \
  676. HRESULT _hrMsg_; \
  677. HRESULT _hrRef_; \
  678. \
  679. _hrTemp_ = THR( CoCreateGuid( &_clsidMinorId_ ) ); \
  680. if ( FAILED( _hrTemp_ ) ) \
  681. { \
  682. _clsidMinorId_ = IID_NULL; \
  683. } \
  684. \
  685. _hrMsg_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_, _arg0_ ) );\
  686. _hrRef_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uidref_, &_bstrRefMsg_, _arg0_ ) );\
  687. _hrTemp_ = THR( SendStatusReport( \
  688. NULL \
  689. , _major_ \
  690. , _clsidMinorId_ \
  691. , 1 \
  692. , 1 \
  693. , 1 \
  694. , _hr_ \
  695. , _hrMsg_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  696. , NULL \
  697. , _hrRef_ == S_OK ? _bstrRefMsg_ : L"The reference for this entry could not be located." \
  698. ) ); \
  699. if ( FAILED( _hrTemp_ ) ) \
  700. { \
  701. _hr_ = _hrTemp_; \
  702. } \
  703. \
  704. TraceSysFreeString( _bstrMsg_ ); \
  705. TraceSysFreeString( _bstrRefMsg_ ); \
  706. }
  707. #define STATUS_REPORT_MINOR_REF_POSTCFG2( _major_, _uid_, _uidref_, _hr_, _arg0_ , _arg1_) \
  708. { \
  709. BSTR _bstrMsg_ = NULL; \
  710. BSTR _bstrRefMsg_ = NULL; \
  711. HRESULT _hrTemp_; \
  712. CLSID _clsidMinorId_; \
  713. HRESULT _hrMsg_; \
  714. HRESULT _hrRef_; \
  715. \
  716. _hrTemp_ = THR( CoCreateGuid( &_clsidMinorId_ ) ); \
  717. if ( FAILED( _hrTemp_ ) ) \
  718. { \
  719. _clsidMinorId_ = IID_NULL; \
  720. } \
  721. \
  722. _hrMsg_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_, _arg0_, _arg1_ ) );\
  723. _hrRef_ = THR( HrFormatStringIntoBSTR( g_hInstance, _uidref_, &_bstrRefMsg_, _arg0_, _arg1_ ) );\
  724. _hrTemp_ = THR( SendStatusReport( \
  725. NULL \
  726. , _major_ \
  727. , _clsidMinorId_ \
  728. , 1 \
  729. , 1 \
  730. , 1 \
  731. , _hr_ \
  732. , _hrMsg_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  733. , NULL \
  734. , _hrRef_ == S_OK ? _bstrRefMsg_ : L"The reference for this entry could not be located." \
  735. ) ); \
  736. if ( FAILED( _hrTemp_ ) ) \
  737. { \
  738. _hr_ = _hrTemp_; \
  739. } \
  740. \
  741. TraceSysFreeString( _bstrMsg_ ); \
  742. TraceSysFreeString( _bstrRefMsg_ ); \
  743. }
  744. #define STATUS_REPORT_PTR_POSTCFG( _pcpcmThis_, _major_, _minor_, _uid_, _hr_ ) \
  745. { \
  746. BSTR _bstrMsg_ = NULL; \
  747. HRESULT _hrTemp_; \
  748. \
  749. _hrTemp_ = THR( HrLoadStringIntoBSTR( g_hInstance, _uid_, &_bstrMsg_ ) );\
  750. _hrTemp_ = THR( _pcpcmThis_->SendStatusReport( \
  751. NULL \
  752. , _major_ \
  753. , _minor_ \
  754. , 1 \
  755. , 1 \
  756. , 1 \
  757. , _hr_ \
  758. , _hrTemp_ == S_OK ? _bstrMsg_ : L"The description for this entry could not be located." \
  759. , NULL \
  760. , NULL \
  761. ) ); \
  762. if ( FAILED( _hrTemp_ ) ) \
  763. { \
  764. _hr_ = _hrTemp_; \
  765. } \
  766. \
  767. TraceSysFreeString( _bstrMsg_ ); \
  768. }