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.

1672 lines
38 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CResourcePhysicalDisk.cpp
  7. //
  8. // Description:
  9. // CResourcePhysicalDisk implementation.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 02-AUG-2000
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. //////////////////////////////////////////////////////////////////////////////
  16. // Include Files
  17. //////////////////////////////////////////////////////////////////////////////
  18. #include "Pch.h"
  19. #include "CResourcePhysicalDisk.h"
  20. #include "CResourcePhysicalDiskPartition.h"
  21. //////////////////////////////////////////////////////////////////////////////
  22. // Constant Definitions
  23. //////////////////////////////////////////////////////////////////////////////
  24. DEFINE_THISCLASS("CResourcePhysicalDisk")
  25. //////////////////////////////////////////////////////////////////////////////
  26. //++
  27. //
  28. // CResourcePhysicalDiskPartition::S_HrCreateInstance
  29. //
  30. // Description:
  31. // Create a CResourcePhysicalDisk instance.
  32. //
  33. // Arguments:
  34. // ppunkOut
  35. //
  36. // Return Values:
  37. // S_OK
  38. // Success.
  39. //
  40. // E_POINTER
  41. // A passed in argument is NULL.
  42. //
  43. // E_OUTOFMEMORY
  44. // Out of memory.
  45. //
  46. // Other HRESULT error.
  47. //
  48. //--
  49. //////////////////////////////////////////////////////////////////////////////
  50. HRESULT
  51. CResourcePhysicalDisk::S_HrCreateInstance(
  52. IUnknown ** ppunkOut,
  53. IUnknown * punkOuterIn,
  54. HCLUSTER * phClusterIn,
  55. CLSID * pclsidMajorIn,
  56. LPCWSTR pcszNameIn
  57. )
  58. {
  59. TraceFunc( "" );
  60. HRESULT hr = S_OK;
  61. CResourcePhysicalDisk * prpd = NULL;
  62. Assert( ppunkOut != NULL );
  63. if ( ppunkOut == NULL )
  64. {
  65. hr = THR( E_POINTER );
  66. goto Cleanup;
  67. }
  68. prpd = new CResourcePhysicalDisk;
  69. if ( prpd == NULL )
  70. {
  71. hr = THR( E_OUTOFMEMORY );
  72. goto Cleanup;
  73. } // if:
  74. hr = STHR( prpd->HrInit( punkOuterIn, phClusterIn, pclsidMajorIn, pcszNameIn ) );
  75. if ( FAILED( hr ) )
  76. {
  77. goto Cleanup;
  78. }
  79. if ( hr == S_FALSE )
  80. {
  81. *ppunkOut = NULL;
  82. goto Cleanup;
  83. } // if:
  84. hr = THR( prpd->TypeSafeQI( IUnknown, ppunkOut ) );
  85. if ( FAILED( hr ) )
  86. {
  87. goto Cleanup;
  88. }
  89. Cleanup:
  90. if ( prpd != NULL )
  91. {
  92. prpd->Release();
  93. } // if:
  94. HRETURN( hr );
  95. } //*** CResourcePhysicalDisk::S_HrCreateInitializedInstance
  96. //////////////////////////////////////////////////////////////////////////////
  97. //++
  98. //
  99. // CResourcePhysicalDisk::CResourcePhysicalDisk
  100. //
  101. // Description:
  102. // Constructor of the CResourcePhysicalDisk class. This initializes
  103. // the m_cRef variable to 1 instead of 0 to account of possible
  104. // QueryInterface failure in DllGetClassObject.
  105. //
  106. // Arguments:
  107. // None.
  108. //
  109. // Return Value:
  110. // None.
  111. //
  112. // Remarks:
  113. // None.
  114. //
  115. //--
  116. //////////////////////////////////////////////////////////////////////////////
  117. CResourcePhysicalDisk::CResourcePhysicalDisk( void )
  118. : m_cRef( 1 )
  119. , m_fIsQuorumCapable( TRUE )
  120. {
  121. TraceFunc( "" );
  122. InterlockedIncrement( &g_cObjects );
  123. Assert( m_punkOuter == NULL );
  124. Assert( m_pcccb == NULL );
  125. Assert( m_phCluster == NULL );
  126. Assert( m_pclsidMajor == NULL );
  127. // Assert( m_cplResource );
  128. // Assert( m_cplResourceRO );
  129. // Assert( m_cpvlDiskInfo );
  130. Assert( m_dwFlags == 0 );
  131. Assert( m_cParitions == 0 );
  132. Assert( m_ppPartitions == NULL );
  133. Assert( m_ulCurrent == 0 );
  134. TraceFuncExit();
  135. } //*** CResourcePhysicalDisk::CResourcePhysicalDisk
  136. //////////////////////////////////////////////////////////////////////////////
  137. //++
  138. //
  139. // CResourcePhysicalDisk::CResourcePhysicalDisk
  140. //
  141. // Description:
  142. // Destructor of the CResourcePhysicalDisk class.
  143. //
  144. // Arguments:
  145. // None.
  146. //
  147. // Return Value:
  148. // None.
  149. //
  150. // Remarks:
  151. // None.
  152. //
  153. //--
  154. //////////////////////////////////////////////////////////////////////////////
  155. CResourcePhysicalDisk::~CResourcePhysicalDisk( void )
  156. {
  157. TraceFunc( "" );
  158. // m_cRef - noop
  159. if ( m_punkOuter != NULL )
  160. {
  161. m_punkOuter->Release();
  162. }
  163. if ( m_pcccb != NULL )
  164. {
  165. m_pcccb->Release();
  166. } // if:
  167. // m_phCluster - DO NOT CLOSE!
  168. // m_pclsidMajor - noop
  169. // m_cplResource - has its own dtor
  170. // m_cplResourceRO - has its own dtor
  171. // m_cpvlDiskInfo - has its own dtor
  172. // m_dwFlags - noop
  173. if ( m_ppPartitions != NULL )
  174. {
  175. while( m_cParitions != 0 )
  176. {
  177. m_cParitions --;
  178. if ( m_ppPartitions[ m_cParitions ] != NULL )
  179. {
  180. m_ppPartitions[ m_cParitions ]->Release();
  181. }
  182. }
  183. TraceFree( m_ppPartitions );
  184. }
  185. // m_ulCurrent
  186. InterlockedDecrement( &g_cObjects );
  187. TraceFuncExit();
  188. } //*** CResourcePhysicalDisk::~CResourcePhysicalDisk
  189. //////////////////////////////////////////////////////////////////////////////
  190. //++
  191. //
  192. // CResourcePhysicalDisk::HrInit
  193. //
  194. // Description:
  195. //
  196. // Arguments:
  197. //
  198. // Return Value:
  199. //
  200. // Remarks:
  201. // None.
  202. //
  203. //--
  204. //////////////////////////////////////////////////////////////////////////////
  205. HRESULT
  206. CResourcePhysicalDisk::HrInit(
  207. IUnknown * punkOuterIn,
  208. HCLUSTER * phClusterIn,
  209. CLSID * pclsidMajorIn,
  210. LPCWSTR pcszNameIn
  211. )
  212. {
  213. TraceFunc( "" );
  214. HRESULT hr;
  215. DWORD sc;
  216. DWORD cb;
  217. ULONG cPartition;
  218. HRESOURCE hResource = NULL;
  219. IUnknown * punk = NULL;
  220. // IUnknown
  221. Assert( m_cRef == 1 );
  222. //
  223. // Gather information from the input parameters.
  224. //
  225. if ( punkOuterIn != NULL )
  226. {
  227. m_punkOuter = punkOuterIn;
  228. m_punkOuter->AddRef();
  229. }
  230. if ( phClusterIn == NULL )
  231. {
  232. hr = THR( E_INVALIDARG );
  233. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_W2KProxy_PhysDisk_HrInit_InvalidArg, hr );
  234. goto Cleanup;
  235. }
  236. m_phCluster = phClusterIn;
  237. if ( pclsidMajorIn != NULL )
  238. {
  239. m_pclsidMajor = pclsidMajorIn;
  240. }
  241. else
  242. {
  243. m_pclsidMajor = (CLSID *) &TASKID_Major_Client_And_Server_Log;
  244. }
  245. if ( pcszNameIn == NULL )
  246. {
  247. hr = THR( E_INVALIDARG );
  248. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_W2KProxy_PhysDisk_HrInit_InvalidArg, hr );
  249. goto Cleanup;
  250. }
  251. //
  252. // See if we can callback.
  253. //
  254. hr = THR( m_punkOuter->TypeSafeQI( IClusCfgCallback, &m_pcccb ) );
  255. if ( FAILED( hr ) )
  256. {
  257. goto Cleanup;
  258. }
  259. //
  260. // Retrieve the properties.
  261. //
  262. hResource = OpenClusterResource( *m_phCluster, pcszNameIn );
  263. if ( hResource == NULL )
  264. {
  265. hr = HRESULT_FROM_WIN32( TW32( GetLastError() ) );
  266. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_OpenClusterResource_Failed, hr );
  267. goto Cleanup;
  268. }
  269. sc = TW32( m_cplResource.ScGetResourceProperties( hResource, CLUSCTL_RESOURCE_GET_COMMON_PROPERTIES ) );
  270. if ( sc != ERROR_SUCCESS )
  271. {
  272. hr = HRESULT_FROM_WIN32( sc );
  273. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_ScGetResourceProperties_Failed, hr );
  274. goto Cleanup;
  275. }
  276. //
  277. // We only handle Physical Disk resources.
  278. //
  279. sc = TW32( m_cplResource.ScMoveToPropertyByName( L"Type" ) );
  280. if ( sc != ERROR_SUCCESS )
  281. {
  282. hr = HRESULT_FROM_WIN32( sc );
  283. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_ScMoveToPropertyByName_Failed, hr );
  284. goto Cleanup;
  285. }
  286. Assert( m_cplResource.CbhCurrentValue().pSyntax->dw == CLUSPROP_SYNTAX_LIST_VALUE_SZ );
  287. if ( ClRtlStrNICmp(
  288. m_cplResource.CbhCurrentValue().pStringValue->sz,
  289. CLUS_RESTYPE_NAME_PHYS_DISK, // L"Physical Disk" - defined in clusudef.h
  290. ARRAYSIZE( CLUS_RESTYPE_NAME_PHYS_DISK )
  291. ) != 0 )
  292. {
  293. //
  294. // The resource isn't a physical disk.
  295. //
  296. hr = S_FALSE;
  297. goto Cleanup;
  298. }
  299. sc = TW32( m_cplResourceRO.ScGetResourceProperties( hResource, CLUSCTL_RESOURCE_GET_RO_COMMON_PROPERTIES ) );
  300. if ( sc != ERROR_SUCCESS )
  301. {
  302. hr = HRESULT_FROM_WIN32( sc );
  303. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_ScGetResourceProperties_Failed, hr );
  304. goto Cleanup;
  305. }
  306. sc = TW32( m_cpvlDiskInfo.ScGetResourceValueList( hResource, CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO ) );
  307. if ( sc != ERROR_SUCCESS )
  308. {
  309. hr = HRESULT_FROM_WIN32( sc );
  310. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_ScGetResourceValueList_Failed, hr );
  311. goto Cleanup;
  312. }
  313. sc = TW32( ClusterResourceControl( hResource, NULL, CLUSCTL_RESOURCE_GET_FLAGS, NULL, NULL, &m_dwFlags, sizeof(m_dwFlags), &cb ) );
  314. if ( sc != ERROR_SUCCESS )
  315. {
  316. hr = HRESULT_FROM_WIN32( sc );
  317. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_ClusterResourceControl_Failed, hr );
  318. goto Cleanup;
  319. }
  320. Assert( cb == sizeof(m_dwFlags) );
  321. //
  322. // Figure out how many partitions there are.
  323. //
  324. m_cParitions = 0;
  325. sc = TW32( m_cpvlDiskInfo.ScMoveToFirstValue() );
  326. if ( sc != ERROR_SUCCESS )
  327. {
  328. hr = HRESULT_FROM_WIN32( sc );
  329. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_HrInit_ScMoveToFirstValue_Failed, hr );
  330. goto Cleanup;
  331. } // if:
  332. do
  333. {
  334. if ( m_cpvlDiskInfo.CbhCurrentValue().pSyntax->dw == CLUSPROP_SYNTAX_PARTITION_INFO )
  335. {
  336. m_cParitions ++;
  337. }
  338. // Move to the next item.
  339. sc = m_cpvlDiskInfo.ScCheckIfAtLastValue();
  340. if ( sc == ERROR_NO_MORE_ITEMS )
  341. {
  342. break;
  343. } // if:
  344. sc = TW32( m_cpvlDiskInfo.ScMoveToNextValue() );
  345. if ( sc != ERROR_SUCCESS )
  346. {
  347. hr = HRESULT_FROM_WIN32( sc );
  348. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_HrInit_ScMoveToNextValue_Failed, hr );
  349. goto Cleanup;
  350. }
  351. } while( sc == ERROR_SUCCESS );
  352. //
  353. // Allocate the array to store pointers to the partition objects.
  354. //
  355. m_ppPartitions = (IClusCfgPartitionInfo **) TraceAlloc( 0, m_cParitions * sizeof(IClusCfgPartitionInfo *) );
  356. if ( m_ppPartitions == NULL )
  357. {
  358. hr = THR( E_OUTOFMEMORY );
  359. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_HrInit_OutOfMemory, hr );
  360. goto Cleanup;
  361. }
  362. //
  363. // Now loop again creating partition objects.
  364. //
  365. cPartition = 0;
  366. sc = TW32( m_cpvlDiskInfo.ScMoveToFirstValue() );
  367. if ( sc != ERROR_SUCCESS )
  368. {
  369. hr = HRESULT_FROM_WIN32( sc );
  370. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_HrInit_ScMoveToFirstValue_Failed, hr );
  371. goto Cleanup;
  372. } // if:
  373. do
  374. {
  375. if ( m_cpvlDiskInfo.CbhCurrentValue().pSyntax->dw == CLUSPROP_SYNTAX_PARTITION_INFO )
  376. {
  377. // Create the object
  378. hr = THR( CResourcePhysicalDiskPartition::S_HrCreateInstance( &punk ) );
  379. if ( FAILED( hr ) )
  380. {
  381. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_HrInit_Create_CResourcePhysicalDiskPartition_Failed, hr );
  382. goto Cleanup;
  383. }
  384. hr = THR( punk->TypeSafeQI( IClusCfgPartitionInfo, &m_ppPartitions[ cPartition ] ) );
  385. if ( FAILED( hr ) )
  386. {
  387. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_HrInit_QI_Failed, hr );
  388. goto Cleanup;
  389. }
  390. punk->Release();
  391. punk = NULL;
  392. cPartition ++;
  393. }
  394. // Move to the next item.
  395. sc = m_cpvlDiskInfo.ScCheckIfAtLastValue();
  396. if ( sc == ERROR_NO_MORE_ITEMS )
  397. {
  398. break;
  399. } // if:
  400. sc = TW32( m_cpvlDiskInfo.ScMoveToNextValue() );
  401. if ( sc != ERROR_SUCCESS )
  402. {
  403. hr = HRESULT_FROM_WIN32( sc );
  404. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_HrInit_ScMoveToNextValue2_Failed, hr );
  405. goto Cleanup;
  406. }
  407. } while( sc == ERROR_SUCCESS && cPartition < m_cParitions );
  408. hr = S_OK;
  409. Cleanup:
  410. if ( hResource != NULL )
  411. {
  412. BOOL bRet;
  413. bRet = CloseClusterResource( hResource );
  414. Assert( bRet );
  415. }
  416. if ( punk != NULL )
  417. {
  418. punk->Release();
  419. }
  420. HRETURN( hr );
  421. } //*** CResourcePhysicalDisk::HrInit
  422. //*************************************************************************//
  423. /////////////////////////////////////////////////////////////////////////////
  424. // CResourcePhysicalDisk -- IUknkown interface.
  425. /////////////////////////////////////////////////////////////////////////////
  426. //////////////////////////////////////////////////////////////////////////////
  427. //++
  428. //
  429. // CResourcePhysicalDisk::QueryInterface
  430. //
  431. // Description:
  432. // Query this object for the passed in interface.
  433. //
  434. // Arguments:
  435. // riidIn
  436. // Id of interface requested.
  437. //
  438. // ppvOut
  439. // Pointer to the requested interface.
  440. //
  441. // Return Value:
  442. // S_OK
  443. // If the interface is available on this object.
  444. //
  445. // E_NOINTERFACE
  446. // If the interface is not available.
  447. //
  448. // E_POINTER
  449. // ppvOut was NULL.
  450. //
  451. // Remarks:
  452. // None.
  453. //
  454. //--
  455. //////////////////////////////////////////////////////////////////////////////
  456. STDMETHODIMP
  457. CResourcePhysicalDisk::QueryInterface(
  458. REFIID riidIn
  459. , void ** ppvOut
  460. )
  461. {
  462. TraceQIFunc( riidIn, ppvOut );
  463. HRESULT hr = S_OK;
  464. //
  465. // Validate arguments.
  466. //
  467. Assert( ppvOut != NULL );
  468. if ( ppvOut == NULL )
  469. {
  470. hr = THR( E_POINTER );
  471. goto Cleanup;
  472. }
  473. //
  474. // Handle known interfaces.
  475. //
  476. if ( IsEqualIID( riidIn, IID_IUnknown ) )
  477. {
  478. *ppvOut = static_cast< IClusCfgManagedResourceInfo * >( this );
  479. } // if: IUnknown
  480. else if ( IsEqualIID( riidIn, IID_IClusCfgManagedResourceInfo ) )
  481. {
  482. *ppvOut = TraceInterface( __THISCLASS__, IClusCfgManagedResourceInfo, this, 0 );
  483. } // else if: IClusCfgManagedResourceInfo
  484. else if ( IsEqualIID( riidIn, IID_IEnumClusCfgPartitions ) )
  485. {
  486. *ppvOut = TraceInterface( __THISCLASS__, IEnumClusCfgPartitions, this, 0 );
  487. } // else if: IEnumClusCfgPartitions
  488. else if ( IsEqualIID( riidIn, IID_IClusCfgVerifyQuorum ) )
  489. {
  490. *ppvOut = TraceInterface( __THISCLASS__, IClusCfgVerifyQuorum, this, 0 );
  491. } // else if: IClusCfgVerifyQuorum
  492. else
  493. {
  494. *ppvOut = NULL;
  495. hr = E_NOINTERFACE;
  496. } // else
  497. //
  498. // Add a reference to the interface if successful.
  499. //
  500. if ( SUCCEEDED( hr ) )
  501. {
  502. ((IUnknown *) *ppvOut)->AddRef();
  503. } // if: success
  504. Cleanup:
  505. QIRETURN_IGNORESTDMARSHALLING1(
  506. hr
  507. , riidIn
  508. , IID_IClusCfgManagedResourceData
  509. );
  510. } //*** CConfigClusApi::QueryInterface
  511. //////////////////////////////////////////////////////////////////////////////
  512. //++
  513. //
  514. // CResourcePhysicalDisk::AddRef
  515. //
  516. // Description:
  517. // Increment the reference count of this object by one.
  518. //
  519. // Arguments:
  520. // None.
  521. //
  522. // Return Value:
  523. // The new reference count.
  524. //
  525. // Remarks:
  526. // None.
  527. //
  528. //--
  529. //////////////////////////////////////////////////////////////////////////////
  530. STDMETHODIMP_( ULONG )
  531. CResourcePhysicalDisk::AddRef( void )
  532. {
  533. TraceFunc( "[IUnknown]" );
  534. InterlockedIncrement( &m_cRef );
  535. CRETURN( m_cRef );
  536. } //*** CResourcePhysicalDisk::AddRef
  537. //////////////////////////////////////////////////////////////////////////////
  538. //++
  539. //
  540. // CResourcePhysicalDisk::Release
  541. //
  542. // Description:
  543. // Decrement the reference count of this object by one.
  544. //
  545. // Arguments:
  546. // None.
  547. //
  548. // Return Value:
  549. // The new reference count.
  550. //
  551. // Remarks:
  552. // None.
  553. //
  554. //--
  555. //////////////////////////////////////////////////////////////////////////////
  556. STDMETHODIMP_( ULONG )
  557. CResourcePhysicalDisk::Release( void )
  558. {
  559. TraceFunc( "[IUnknown]" );
  560. LONG cRef;
  561. cRef = InterlockedDecrement( &m_cRef );
  562. if ( cRef == 0 )
  563. {
  564. TraceDo( delete this );
  565. }
  566. CRETURN( cRef );
  567. } //*** CResourcePhysicalDisk::Release
  568. //*************************************************************************//
  569. /////////////////////////////////////////////////////////////////////////////
  570. // CResourcePhysicalDisk -- IClusCfgManagedResourceInfo interface.
  571. /////////////////////////////////////////////////////////////////////////////
  572. //////////////////////////////////////////////////////////////////////////////
  573. //++
  574. //
  575. // CResourcePhysicalDisk::GetName
  576. //
  577. // Description:
  578. //
  579. // Arguments:
  580. //
  581. // Return Value:
  582. //
  583. // Remarks:
  584. // None.
  585. //
  586. //--
  587. //////////////////////////////////////////////////////////////////////////////
  588. STDMETHODIMP
  589. CResourcePhysicalDisk::GetName(
  590. BSTR * pbstrNameOut
  591. )
  592. {
  593. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  594. HRESULT hr;
  595. DWORD sc;
  596. if ( pbstrNameOut == NULL )
  597. {
  598. hr = THR( E_INVALIDARG );
  599. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetName_InvalidPointer, hr );
  600. goto Cleanup;
  601. }
  602. //
  603. // "Major Version"
  604. //
  605. sc = TW32( m_cplResourceRO.ScMoveToPropertyByName( L"Name" ) );
  606. if ( sc != ERROR_SUCCESS )
  607. {
  608. hr = HRESULT_FROM_WIN32( sc );
  609. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetName_ScMoveToPropertyByName_MajorVersion_Failed, hr );
  610. goto Cleanup;
  611. } // if:
  612. Assert( m_cplResourceRO.CbhCurrentValue().pSyntax->dw == CLUSPROP_SYNTAX_LIST_VALUE_SZ );
  613. *pbstrNameOut = SysAllocString( m_cplResourceRO.CbhCurrentValue().pStringValue->sz );
  614. if ( *pbstrNameOut == NULL )
  615. {
  616. hr = THR( E_OUTOFMEMORY );
  617. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetName_OutOfMemory, hr );
  618. goto Cleanup;
  619. }
  620. hr = S_OK;
  621. Cleanup:
  622. HRETURN( hr );
  623. } //*** CResourcePhysicalDisk::GetName
  624. //////////////////////////////////////////////////////////////////////////////
  625. //++
  626. //
  627. // CResourcePhysicalDisk::GetUID
  628. //
  629. // Description:
  630. //
  631. // Arguments:
  632. //
  633. // Return Value:
  634. //
  635. // Remarks:
  636. // None.
  637. //
  638. //--
  639. //////////////////////////////////////////////////////////////////////////////
  640. STDMETHODIMP
  641. CResourcePhysicalDisk::GetUID(
  642. BSTR * pbstrUIDOut
  643. )
  644. {
  645. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  646. HRESULT hr;
  647. DWORD sc;
  648. UCHAR TargetId;
  649. UCHAR Lun;
  650. WCHAR sz[ 64 ];
  651. if ( pbstrUIDOut == NULL )
  652. {
  653. hr = THR( E_POINTER );
  654. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetUID_InvalidPointer, hr );
  655. goto Cleanup;
  656. }
  657. // loop through all the properties.
  658. sc = TW32( m_cpvlDiskInfo.ScMoveToFirstValue() );
  659. if ( sc != ERROR_SUCCESS )
  660. {
  661. hr = HRESULT_FROM_WIN32( sc );
  662. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetUID_ScMoveToFirstValue_Failed, hr );
  663. goto Cleanup;
  664. } // if:
  665. do
  666. {
  667. if ( m_cpvlDiskInfo.CbhCurrentValue().pSyntax->dw == CLUSPROP_SYNTAX_SCSI_ADDRESS )
  668. {
  669. break; // found it!
  670. }
  671. // Move to the next item.
  672. sc = m_cpvlDiskInfo.ScCheckIfAtLastValue();
  673. if ( sc == ERROR_NO_MORE_ITEMS )
  674. {
  675. break;
  676. } // if:
  677. sc = TW32( m_cpvlDiskInfo.ScMoveToNextValue() );
  678. if ( sc != ERROR_SUCCESS )
  679. {
  680. hr = HRESULT_FROM_WIN32( sc );
  681. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetUID_ScMoveToNextValue_Failed, hr );
  682. goto Cleanup;
  683. }
  684. } while( sc == ERROR_SUCCESS );
  685. TargetId = m_cpvlDiskInfo.CbhCurrentValue().pScsiAddressValue->TargetId;
  686. Lun = m_cpvlDiskInfo.CbhCurrentValue().pScsiAddressValue->Lun;
  687. // Print the UID identical to the others.
  688. hr = THR( StringCchPrintfW( sz, ARRAYSIZE( sz ), L"SCSI Tid %ld, SCSI Lun %ld", TargetId, Lun ) );
  689. if ( FAILED( hr ) )
  690. {
  691. goto Cleanup;
  692. } // if:
  693. *pbstrUIDOut = SysAllocString( sz );
  694. if ( *pbstrUIDOut == NULL )
  695. {
  696. hr = THR( E_OUTOFMEMORY );
  697. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_GetUID_OutOfMemory, hr );
  698. goto Cleanup;
  699. }
  700. hr = S_OK;
  701. Cleanup:
  702. HRETURN( hr );
  703. } //*** CResourcePhysicalDisk::GetUID
  704. //////////////////////////////////////////////////////////////////////////////
  705. //++
  706. //
  707. // CResourcePhysicalDisk::IsManaged
  708. //
  709. // Description:
  710. //
  711. // Arguments:
  712. //
  713. // Return Value:
  714. // S_OK
  715. // Is managed.
  716. //
  717. // S_FALSE
  718. // Is not managed.
  719. //
  720. // Remarks:
  721. // None.
  722. //
  723. //--
  724. //////////////////////////////////////////////////////////////////////////////
  725. STDMETHODIMP
  726. CResourcePhysicalDisk::IsManaged( void )
  727. {
  728. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  729. HRESULT hr = S_OK;
  730. HRETURN( hr );
  731. } //*** CResourcePhysicalDisk::IsManaged
  732. //////////////////////////////////////////////////////////////////////////////
  733. //++
  734. //
  735. // CResourcePhysicalDisk::IsQuorumResource
  736. //
  737. // Description:
  738. //
  739. // Arguments:
  740. //
  741. // Return Value:
  742. // S_OK
  743. // Is quorum device.
  744. //
  745. // S_FALSE
  746. // Is not quorum device.
  747. //
  748. // Remarks:
  749. // None.
  750. //
  751. //--
  752. //////////////////////////////////////////////////////////////////////////////
  753. STDMETHODIMP
  754. CResourcePhysicalDisk::IsQuorumResource( void )
  755. {
  756. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  757. HRESULT hr;
  758. if ( m_dwFlags & CLUS_FLAG_CORE )
  759. {
  760. hr = S_OK;
  761. } // if:
  762. else
  763. {
  764. hr = S_FALSE;
  765. } // else:
  766. HRETURN( hr );
  767. } //*** CResourcePhysicalDisk::IsQuorumResource
  768. //////////////////////////////////////////////////////////////////////////////
  769. //++
  770. //
  771. // CResourcePhysicalDisk::IsQuorumCapable
  772. //
  773. // Description:
  774. //
  775. // Arguments:
  776. //
  777. // Return Value:
  778. // S_OK
  779. // Is quorum capable device.
  780. //
  781. // S_FALSE
  782. // Is not quorum capable device.
  783. //
  784. // Remarks:
  785. // None.
  786. //
  787. //--
  788. //////////////////////////////////////////////////////////////////////////////
  789. STDMETHODIMP
  790. CResourcePhysicalDisk::IsQuorumCapable( void )
  791. {
  792. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  793. HRESULT hr = S_FALSE;
  794. if ( m_fIsQuorumCapable )
  795. {
  796. hr = S_OK;
  797. } // if:
  798. HRETURN( hr );
  799. } //*** CResourcePhysicalDisk::IsQuorumCapable
  800. //////////////////////////////////////////////////////////////////////////////
  801. //++
  802. //
  803. // CResourcePhysicalDisk::IsManagedByDefault
  804. //
  805. // Description:
  806. // Should this resource be managed by the cluster by default?
  807. //
  808. // Arguments:
  809. // None.
  810. //
  811. // Return Value:
  812. // S_OK
  813. // The device is always managed by default.
  814. //
  815. // Remarks:
  816. // None.
  817. //
  818. //--
  819. //////////////////////////////////////////////////////////////////////////////
  820. STDMETHODIMP
  821. CResourcePhysicalDisk::IsManagedByDefault( void )
  822. {
  823. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  824. HRESULT hr = S_OK;
  825. HRETURN( hr );
  826. } //*** CResourcePhysicalDisk::IsManagedByDefault
  827. //////////////////////////////////////////////////////////////////////////
  828. //
  829. // CResourcePhysicalDisk::SetQuorumCapable
  830. //
  831. // Description:
  832. // Call this to set whether the resource is capable to be the quorum
  833. // resource or not.
  834. //
  835. // Parameter:
  836. // fIsQuorumCapableIn - If TRUE, the resource will be marked as quorum capable.
  837. //
  838. // Return Values:
  839. // S_OK
  840. // Call succeeded.
  841. //
  842. //////////////////////////////////////////////////////////////////////////
  843. STDMETHODIMP
  844. CResourcePhysicalDisk::SetQuorumCapable(
  845. BOOL fIsQuorumCapableIn
  846. )
  847. {
  848. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  849. HRESULT hr = S_OK;
  850. m_fIsQuorumCapable = fIsQuorumCapableIn;
  851. HRETURN( hr );
  852. } //*** CResourcePhysicalDisk::SetQuorumCapable
  853. //////////////////////////////////////////////////////////////////////////////
  854. //++
  855. //
  856. // CResourcePhysicalDisk::GetDriveLetterMappings
  857. //
  858. // Description:
  859. //
  860. // Arguments:
  861. //
  862. // Return Value:
  863. //
  864. // Remarks:
  865. // None.
  866. //
  867. //--
  868. //////////////////////////////////////////////////////////////////////////////
  869. STDMETHODIMP
  870. CResourcePhysicalDisk::GetDriveLetterMappings(
  871. SDriveLetterMapping * pdlmDriveLetterMappingOut
  872. )
  873. {
  874. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  875. HRESULT hr = S_FALSE;
  876. if ( pdlmDriveLetterMappingOut == NULL )
  877. {
  878. hr = THR( E_POINTER );
  879. goto Cleanup;
  880. } // if:
  881. ZeroMemory( pdlmDriveLetterMappingOut, sizeof(*pdlmDriveLetterMappingOut) );
  882. Cleanup:
  883. HRETURN( hr );
  884. } //*** CResourcePhysicalDisk::GetDriveLetterMappings
  885. //
  886. // KB: Some of these methods are supported in a limited sense for compatability.
  887. // Those methods compare the request with the current data and succeed if they
  888. // match, and fail otherwise. All other methods assert and fail when called.
  889. // If they are used, appropriate handling should be done in the upper level,
  890. // And the THR removed from that section of code.
  891. //
  892. //////////////////////////////////////////////////////////////////////////////
  893. //++
  894. //
  895. // CResourcePhysicalDisk::SetDriveLetterMappings
  896. //
  897. // Description:
  898. //
  899. // Arguments:
  900. //
  901. // Return Value:
  902. //
  903. // Remarks:
  904. // None.
  905. //
  906. //--
  907. //////////////////////////////////////////////////////////////////////////////
  908. STDMETHODIMP
  909. CResourcePhysicalDisk::SetDriveLetterMappings(
  910. SDriveLetterMapping dlmDriveLetterMappingIn
  911. )
  912. {
  913. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  914. HRESULT hr = THR( E_NOTIMPL );
  915. HRETURN( hr );
  916. } //*** CResourcePhysicalDisk::SetDriveLetterMappings
  917. //////////////////////////////////////////////////////////////////////////////
  918. //++
  919. //
  920. // CResourcePhysicalDisk::SetName
  921. //
  922. // Description:
  923. //
  924. // Arguments:
  925. //
  926. // Return Value:
  927. //
  928. // Remarks:
  929. // None.
  930. //
  931. //--
  932. //////////////////////////////////////////////////////////////////////////////
  933. STDMETHODIMP
  934. CResourcePhysicalDisk::SetName(
  935. LPCWSTR pcszNameIn
  936. )
  937. {
  938. TraceFunc1( "[IClusCfgManagedResourceInfo] pcszNameIn = '%ls'", pcszNameIn == NULL ? L"<null>" : pcszNameIn );
  939. HRESULT hr = S_FALSE;
  940. HRETURN( hr );
  941. } //*** CResourcePhysicalDisk::SetName
  942. //////////////////////////////////////////////////////////////////////////////
  943. //++
  944. //
  945. // CResourcePhysicalDisk::SetManaged
  946. //
  947. // Description:
  948. //
  949. // Arguments:
  950. //
  951. // Return Value:
  952. //
  953. // Remarks:
  954. // None.
  955. //
  956. //--
  957. //////////////////////////////////////////////////////////////////////////////
  958. STDMETHODIMP
  959. CResourcePhysicalDisk::SetManaged(
  960. BOOL fIsManagedIn
  961. )
  962. {
  963. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  964. HRESULT hr = S_OK;
  965. Assert( fIsManagedIn );
  966. if ( !fIsManagedIn )
  967. {
  968. hr = THR( E_INVALIDARG );
  969. }
  970. HRETURN( hr );
  971. } //*** CResourcePhysicalDisk::SetManaged
  972. //////////////////////////////////////////////////////////////////////////////
  973. //++
  974. //
  975. // CResourcePhysicalDisk::SetQuorumResource
  976. //
  977. // Description:
  978. //
  979. // Arguments:
  980. //
  981. // Return Value:
  982. //
  983. // Remarks:
  984. // None.
  985. //
  986. //--
  987. //////////////////////////////////////////////////////////////////////////////
  988. STDMETHODIMP
  989. CResourcePhysicalDisk::SetQuorumResource(
  990. BOOL fIsQuorumResourceIn
  991. )
  992. {
  993. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  994. HRESULT hr;
  995. if ( m_dwFlags & CLUS_FLAG_CORE )
  996. {
  997. if ( fIsQuorumResourceIn )
  998. {
  999. hr = S_OK;
  1000. }
  1001. else
  1002. {
  1003. hr = THR( E_INVALIDARG );
  1004. }
  1005. } // if: core resource
  1006. else
  1007. {
  1008. if ( ! fIsQuorumResourceIn )
  1009. {
  1010. hr = S_OK;
  1011. }
  1012. else
  1013. {
  1014. hr = THR( E_INVALIDARG );
  1015. }
  1016. }
  1017. HRETURN( hr );
  1018. } //*** CResourcePhysicalDisk::SetQuorumResource
  1019. //////////////////////////////////////////////////////////////////////////////
  1020. //++
  1021. //
  1022. // CResourcePhysicalDisk::SetManagedByDefault
  1023. //
  1024. // Description:
  1025. //
  1026. // Arguments:
  1027. //
  1028. // Return Value:
  1029. //
  1030. // Remarks:
  1031. // None.
  1032. //
  1033. //--
  1034. //////////////////////////////////////////////////////////////////////////////
  1035. STDMETHODIMP
  1036. CResourcePhysicalDisk::SetManagedByDefault(
  1037. BOOL fIsManagedByDefaultIn
  1038. )
  1039. {
  1040. TraceFunc( "[IClusCfgManagedResourceInfo]" );
  1041. HRESULT hr = S_OK;
  1042. Assert( fIsManagedByDefaultIn );
  1043. if ( !fIsManagedByDefaultIn )
  1044. {
  1045. hr = THR( E_INVALIDARG );
  1046. } // if:
  1047. HRETURN( hr );
  1048. } //*** CResourcePhysicalDisk::SetManagedByDefault
  1049. //*************************************************************************//
  1050. /////////////////////////////////////////////////////////////////////////////
  1051. // CResourcePhysicalDisk -- IEnumClusCfgPartitions interface.
  1052. /////////////////////////////////////////////////////////////////////////////
  1053. //////////////////////////////////////////////////////////////////////////////
  1054. //++
  1055. //
  1056. // CResourcePhysicalDisk::Next
  1057. //
  1058. // Description:
  1059. //
  1060. // Arguments:
  1061. //
  1062. // Return Value:
  1063. //
  1064. // Remarks:
  1065. // None.
  1066. //
  1067. //--
  1068. //////////////////////////////////////////////////////////////////////////////
  1069. STDMETHODIMP
  1070. CResourcePhysicalDisk::Next(
  1071. ULONG cNumberRequestedIn,
  1072. IClusCfgPartitionInfo ** rgpPartitionInfoOut,
  1073. ULONG * pcNumberFetchedOut
  1074. )
  1075. {
  1076. TraceFunc( "[IEnumClusCfgPartitions]" );
  1077. HRESULT hr;
  1078. ULONG cFetched = min(cNumberRequestedIn, m_cParitions - m_ulCurrent);
  1079. if ( rgpPartitionInfoOut == NULL )
  1080. {
  1081. hr = THR( E_POINTER );
  1082. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_W2kProxy_PhysDisk_Next_InvalidPointer, hr );
  1083. goto Cleanup;
  1084. }
  1085. for ( ; cFetched < cNumberRequestedIn; cFetched++, m_ulCurrent++ )
  1086. {
  1087. hr = THR( (m_ppPartitions[ m_ulCurrent ])->TypeSafeQI( IClusCfgPartitionInfo,
  1088. &rgpPartitionInfoOut[ cFetched ]
  1089. ) );
  1090. if ( FAILED( hr ) )
  1091. {
  1092. SSR_W2KPROXY_STATUS( TASKID_Major_Client_And_Server_Log, TASKID_Minor_Next_QI_Failed, hr );
  1093. goto Cleanup;
  1094. }
  1095. }
  1096. if ( cFetched < cNumberRequestedIn )
  1097. {
  1098. hr = S_FALSE;
  1099. }
  1100. else
  1101. {
  1102. hr = S_OK;
  1103. }
  1104. Cleanup:
  1105. if ( FAILED( hr ) )
  1106. {
  1107. while ( cFetched != 0 );
  1108. {
  1109. cFetched --;
  1110. rgpPartitionInfoOut[ cFetched ]->Release();
  1111. }
  1112. }
  1113. if ( pcNumberFetchedOut != NULL )
  1114. {
  1115. *pcNumberFetchedOut = cFetched;
  1116. }
  1117. HRETURN( hr );
  1118. } //*** CResourcePhysicalDisk::Next
  1119. //////////////////////////////////////////////////////////////////////////////
  1120. //++
  1121. //
  1122. // CResourcePhysicalDisk::Reset
  1123. //
  1124. // Description:
  1125. //
  1126. // Arguments:
  1127. //
  1128. // Return Value:
  1129. //
  1130. // Remarks:
  1131. // None.
  1132. //
  1133. //--
  1134. //////////////////////////////////////////////////////////////////////////////
  1135. STDMETHODIMP
  1136. CResourcePhysicalDisk::Reset( void )
  1137. {
  1138. TraceFunc( "[IEnumClusCfgPartitions]" );
  1139. HRESULT hr = S_OK;
  1140. m_ulCurrent = 0;
  1141. HRETURN( hr );
  1142. } //*** CResourcePhysicalDisk::Reset
  1143. //////////////////////////////////////////////////////////////////////////////
  1144. //++
  1145. //
  1146. // CResourcePhysicalDisk::Skip
  1147. //
  1148. // Description:
  1149. //
  1150. // Arguments:
  1151. //
  1152. // Return Value:
  1153. //
  1154. // Remarks:
  1155. // None.
  1156. //
  1157. //--
  1158. //////////////////////////////////////////////////////////////////////////////
  1159. STDMETHODIMP
  1160. CResourcePhysicalDisk::Skip(
  1161. ULONG cNumberToSkipIn
  1162. )
  1163. {
  1164. TraceFunc( "[IEnumClusCfgPartitions]" );
  1165. HRESULT hr = S_OK;
  1166. m_ulCurrent += cNumberToSkipIn;
  1167. if ( m_ulCurrent >= m_cParitions )
  1168. {
  1169. hr = S_FALSE;
  1170. m_ulCurrent = m_cParitions;
  1171. }
  1172. else
  1173. {
  1174. hr = S_OK;
  1175. }
  1176. HRETURN( hr );
  1177. } //*** CResourcePhysicalDisk::Skip
  1178. //////////////////////////////////////////////////////////////////////////////
  1179. //++
  1180. //
  1181. // CResourcePhysicalDisk::Clone
  1182. //
  1183. // Description:
  1184. //
  1185. // Arguments:
  1186. //
  1187. // Return Value:
  1188. //
  1189. // Remarks:
  1190. // None.
  1191. //
  1192. //--
  1193. //////////////////////////////////////////////////////////////////////////////
  1194. STDMETHODIMP
  1195. CResourcePhysicalDisk::Clone( IEnumClusCfgPartitions ** ppEnumPartitions )
  1196. {
  1197. TraceFunc( "[IEnumClusCfgPartitions]" );
  1198. HRESULT hr = THR( E_NOTIMPL );
  1199. HRETURN( hr );
  1200. } //*** CResourcePhysicalDisk::Clone
  1201. //////////////////////////////////////////////////////////////////////////////
  1202. //++
  1203. //
  1204. // CResourcePhysicalDisk::Count
  1205. //
  1206. // Description:
  1207. //
  1208. // Arguments:
  1209. //
  1210. // Return Value:
  1211. //
  1212. // Remarks:
  1213. // None.
  1214. //
  1215. //--
  1216. //////////////////////////////////////////////////////////////////////////////
  1217. STDMETHODIMP
  1218. CResourcePhysicalDisk::Count( DWORD * pnCountOut )
  1219. {
  1220. TraceFunc( "[IEnumClusCfgPartitions]" );
  1221. HRESULT hr = THR( S_OK );
  1222. if ( pnCountOut == NULL )
  1223. {
  1224. hr = THR( E_POINTER );
  1225. goto Cleanup;
  1226. }
  1227. *pnCountOut = m_cParitions;
  1228. Cleanup:
  1229. HRETURN( hr );
  1230. } //*** CResourcePhysicalDisk::Count
  1231. //****************************************************************************
  1232. //
  1233. // IClusCfgCallback
  1234. //
  1235. //****************************************************************************
  1236. //////////////////////////////////////////////////////////////////////////////
  1237. //++
  1238. //
  1239. // CResourcePhysicalDisk::SendStatusReport
  1240. //
  1241. // Description:
  1242. //
  1243. // Arguments:
  1244. //
  1245. // Return Value:
  1246. //
  1247. // Remarks:
  1248. // None.
  1249. //
  1250. //--
  1251. //////////////////////////////////////////////////////////////////////////////
  1252. STDMETHODIMP
  1253. CResourcePhysicalDisk::SendStatusReport(
  1254. LPCWSTR pcszNodeNameIn
  1255. , CLSID clsidTaskMajorIn
  1256. , CLSID clsidTaskMinorIn
  1257. , ULONG ulMinIn
  1258. , ULONG ulMaxIn
  1259. , ULONG ulCurrentIn
  1260. , HRESULT hrStatusIn
  1261. , LPCWSTR pcszDescriptionIn
  1262. , FILETIME * pftTimeIn
  1263. , LPCWSTR pcszReferenceIn
  1264. )
  1265. {
  1266. TraceFunc( "[IClusCfgCallback]" );
  1267. HRESULT hr = S_OK;
  1268. if ( m_pcccb != NULL )
  1269. {
  1270. hr = THR( m_pcccb->SendStatusReport( pcszNodeNameIn,
  1271. clsidTaskMajorIn,
  1272. clsidTaskMinorIn,
  1273. ulMinIn,
  1274. ulMaxIn,
  1275. ulCurrentIn,
  1276. hrStatusIn,
  1277. pcszDescriptionIn,
  1278. pftTimeIn,
  1279. pcszReferenceIn
  1280. ) );
  1281. } // if:
  1282. HRETURN( hr );
  1283. } //*** CResourcePhysicalDisk::SendStatusReport
  1284. //////////////////////////////////////////////////////////////////////////////
  1285. //++
  1286. //
  1287. // CResourcePhysicalDisk::PrepareToHostQuorumResource
  1288. //
  1289. // Description:
  1290. // Do any configuration necessary in preparation for this node hosting
  1291. // the quorum.
  1292. //
  1293. // Arguments:
  1294. // None.
  1295. //
  1296. // Return Value:
  1297. // S_OK
  1298. // Success
  1299. //
  1300. // Win32 error as HRESULT when an error occurs.
  1301. //
  1302. //--
  1303. //////////////////////////////////////////////////////////////////////////////
  1304. STDMETHODIMP
  1305. CResourcePhysicalDisk::PrepareToHostQuorumResource( void )
  1306. {
  1307. TraceFunc( "[IClusCfgVerifyQuorum]" );
  1308. HRETURN( S_OK );
  1309. } //*** CResourcePhysicalDisk::PrepareToHostQuorumResource
  1310. //////////////////////////////////////////////////////////////////////////////
  1311. //++
  1312. //
  1313. // CResourcePhysicalDisk::Cleanup
  1314. //
  1315. // Description:
  1316. // Do any necessay cleanup from the PrepareToHostQuorumResource()
  1317. // method.
  1318. //
  1319. // If the cleanup method is anything other than successful completion
  1320. // then the anything created above in PrepareToHostQuorumResource()
  1321. // needs to be cleaned up.
  1322. //
  1323. // Arguments:
  1324. // cccrReasonIn
  1325. //
  1326. // Return Value:
  1327. // S_OK
  1328. // Success
  1329. //
  1330. // Win32 error as HRESULT when an error occurs.
  1331. //
  1332. //--
  1333. //////////////////////////////////////////////////////////////////////////////
  1334. STDMETHODIMP
  1335. CResourcePhysicalDisk::Cleanup(
  1336. EClusCfgCleanupReason cccrReasonIn
  1337. )
  1338. {
  1339. TraceFunc( "[IClusCfgVerifyQuorum]" );
  1340. HRETURN( S_OK );
  1341. } //*** CResourcePhysicalDisk::Cleanup
  1342. //////////////////////////////////////////////////////////////////////////////
  1343. //++
  1344. //
  1345. // CResourcePhysicalDisk::IsMultiNodeCapable
  1346. // Does this resource supports multi node clusters?
  1347. //
  1348. // Description:
  1349. //
  1350. // Arguments:
  1351. //
  1352. // Return Value:
  1353. // S_OK
  1354. // This resource supports multi node clusters.
  1355. //
  1356. // S_FALSE
  1357. // This resource does not support multi node clusters.
  1358. //
  1359. //--
  1360. //////////////////////////////////////////////////////////////////////////////
  1361. STDMETHODIMP
  1362. CResourcePhysicalDisk::IsMultiNodeCapable( void )
  1363. {
  1364. TraceFunc( "[IClusCfgVerifyQuorum]" );
  1365. HRETURN( S_OK );
  1366. } //*** CResourcePhysicalDisk::IsMultiNodeCapable
  1367. //////////////////////////////////////////////////////////////////////////////
  1368. //++
  1369. //
  1370. // CResourcePhysicalDisk::SetMultiNodeCapable
  1371. //
  1372. // Description:
  1373. //
  1374. // Arguments:
  1375. //
  1376. // Return Value:
  1377. // S_OK
  1378. // Success.
  1379. //
  1380. // Remarks:
  1381. // This function should never be called.
  1382. //
  1383. //--
  1384. //////////////////////////////////////////////////////////////////////////////
  1385. STDMETHODIMP
  1386. CResourcePhysicalDisk::SetMultiNodeCapable(
  1387. BOOL fMultiNodeCapableIn
  1388. )
  1389. {
  1390. TraceFunc( "[IClusCfgVerifyQuorum]" );
  1391. HRETURN( THR( E_NOTIMPL ) );
  1392. } //*** CResourcePhysicalDisk::SetMultiNodeCapable