Source code of Windows XP (NT5)
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.

629 lines
27 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // BVTCOM.CPP
  4. //
  5. //
  6. // Copyright (c)2000 Microsoft Corporation, All Rights Reserved
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. #include "bvt.h"
  10. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  11. // Common functional units used among tests
  12. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  13. int OpenNamespaceAndKeepOpen( IWbemServices ** ppNamespace, WCHAR * wcsNamespace, BOOL fCreateIfDoesntExist)
  14. {
  15. //==========================================================================
  16. // Open CIMV2 namespace
  17. //==========================================================================
  18. int nRc = FATAL_ERROR;
  19. IWbemLocator * pLocator = NULL;
  20. // =====================================================================
  21. // Get the locator
  22. // =====================================================================
  23. nRc = CoCreateInstanceAndLogErrors(CLSID_WbemLocator,IID_IWbemLocator,(void**)&pLocator,NO_ERRORS_EXPECTED);
  24. if( SUCCESS == nRc )
  25. {
  26. // =================================================================
  27. // Connect to the desired namespace
  28. // =================================================================
  29. nRc = ConnectServerAndLogErrors(pLocator,ppNamespace,wcsNamespace,NO_ERRORS_EXPECTED);
  30. if( (SUCCESS != nRc ) && ( fCreateIfDoesntExist ))
  31. {
  32. nRc = CreateNewTestNamespace();
  33. if( nRc == S_OK )
  34. {
  35. nRc = ConnectServerAndLogErrors(pLocator,ppNamespace,wcsNamespace,NO_ERRORS_EXPECTED);
  36. }
  37. }
  38. }
  39. // =====================================================================
  40. // Release the pointers
  41. // =====================================================================
  42. SAFE_RELEASE_PTR(pLocator);
  43. return nRc;
  44. }
  45. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  46. int WritePropertiesAndQualifiers( IWbemServices * pNamespace, IWbemClassObject * pClass, CPropertyList & Props,
  47. const WCHAR * wcsClass, DWORD dwFlags,
  48. WCHAR * wcsNamespace, BOOL fExpectedFailure, const char * csFile , const ULONG Line )
  49. {
  50. int nRc = FATAL_ERROR;
  51. if( Props.Size() == 0 )
  52. {
  53. nRc = SUCCESS;
  54. }
  55. for( int i = 0; i < Props.Size(); i++ )
  56. {
  57. //======================================================
  58. // Get the property info
  59. //======================================================
  60. PropertyInfo *p = Props.GetAt(i);
  61. if( !p )
  62. {
  63. break;
  64. }
  65. if( !p->QualifierName )
  66. {
  67. //======================================================
  68. // Write out the property
  69. //======================================================
  70. nRc = PutPropertyAndLogErrors( pClass, p->Property, p->Type, p->Var, wcsClass, 0,wcsNamespace, fExpectedFailure, csFile , Line );
  71. }
  72. else
  73. {
  74. //======================================================
  75. // If it is a qualifier, write the qualifier
  76. //======================================================
  77. nRc = PutQualifierOnPropertyAndLogErrors( pClass, p->Property, p->QualifierName ,p->Var, wcsClass, dwFlags, wcsNamespace, fExpectedFailure, csFile , Line );
  78. }
  79. if( nRc != SUCCESS )
  80. {
  81. break;
  82. }
  83. }
  84. return nRc;
  85. }
  86. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  87. int CreateClassAndLogErrors( IWbemServices * pNamespace, const WCHAR * wcsClass, WCHAR * wcsClassDefinition,
  88. WCHAR * wcsNamespace, BOOL fExpectedFailure, const char * csFile , const ULONG Line )
  89. {
  90. int nRc = FATAL_ERROR;
  91. IWbemClassObject *pClass = NULL;
  92. const WCHAR * wcsParentClass = NULL; // nothing is allocated, so don't release
  93. CPropertyList Properties; // destructor will release
  94. //===========================================================
  95. // Get the class definition
  96. //===========================================================
  97. nRc = CrackClass(wcsClassDefinition,wcsParentClass, Properties, fExpectedFailure, csFile, Line );
  98. if( nRc == SUCCESS )
  99. {
  100. if( wcsParentClass )
  101. {
  102. // =================================================================
  103. // Spawn a class from the parent
  104. // =================================================================
  105. IWbemClassObject * pParentClass = NULL;
  106. nRc = GetClassObjectAndLogErrors(pNamespace, wcsParentClass, &pParentClass, wcsNamespace, fExpectedFailure, csFile , Line );
  107. if( nRc == SUCCESS )
  108. {
  109. nRc = SpawnDerivedClassAndLogErrors(pParentClass, wcsParentClass, &pClass,wcsNamespace, fExpectedFailure, csFile , Line );
  110. }
  111. }
  112. else
  113. {
  114. // =================================================================
  115. // Get an empty class object to work with
  116. // =================================================================
  117. nRc = GetClassObjectAndLogErrors(pNamespace, NULL, &pClass, wcsNamespace, fExpectedFailure, csFile , Line );
  118. }
  119. if( nRc == SUCCESS )
  120. {
  121. //==============================================================
  122. // Now, set the properties of the class
  123. // start with the name of the class
  124. //==============================================================
  125. CVARIANT var;
  126. var.SetStr((WCHAR*)wcsClass);
  127. nRc = PutPropertyAndLogErrors( pClass, L"__CLASS", CIM_STRING, var, wcsClass, 0,wcsNamespace, fExpectedFailure, csFile , Line );
  128. if( SUCCESS == nRc )
  129. {
  130. //==========================================================
  131. // Set the rest of the properties
  132. //==========================================================
  133. DWORD dwFlags = 0;
  134. nRc = WritePropertiesAndQualifiers(pNamespace, pClass, Properties,wcsClass,dwFlags,wcsNamespace,NO_ERRORS_EXPECTED);
  135. //==============================================================
  136. // Now, create the class
  137. //==============================================================
  138. if( SUCCESS == nRc )
  139. {
  140. nRc = PutClassAndLogErrors(pNamespace, pClass,wcsClass,wcsNamespace, TRUE, csFile , Line );
  141. }
  142. }
  143. }
  144. }
  145. SAFE_RELEASE_PTR(pClass);
  146. return nRc;
  147. }
  148. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  149. int DeleteClasses(CAutoDeleteString & sDeleteClasses,IWbemServices * pNamespace, WCHAR * wcsNamespace)
  150. {
  151. int nRc = FATAL_ERROR;
  152. ClassList MasterList;
  153. //=======================================================
  154. // Get the list of the classes to be deleted
  155. //=======================================================
  156. if( InitMasterListOfClasses(sDeleteClasses.GetPtr(),MasterList))
  157. {
  158. for( int i = 0; i < MasterList.Size(); i++ )
  159. {
  160. ClassInfo * pClass = MasterList.GetAt(i);
  161. nRc = DeleteClassAndLogErrors(pNamespace, pClass->Class, wcsNamespace,NO_ERRORS_EXPECTED);
  162. if( nRc != SUCCESS )
  163. {
  164. break;
  165. }
  166. }
  167. }
  168. return nRc;
  169. }
  170. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  171. int EnumerateInstancesAndCompare( IWbemServices * pNamespace, CAutoDeleteString & sInstanceList,
  172. CAutoDeleteString & sInstanceCompareList, WCHAR * wcsNamespace )
  173. {
  174. int nRc = FATAL_ERROR;
  175. //=======================================================
  176. // Get the list of the classes to get instances for
  177. //=======================================================
  178. ClassList InstanceList;
  179. if( InitMasterListOfClasses(sInstanceList.GetPtr(),InstanceList))
  180. {
  181. for( int i=0; i < InstanceList.Size(); i++ )
  182. {
  183. ClassInfo * p = InstanceList.GetAt(i);
  184. IEnumWbemClassObject * pEnum = NULL;
  185. //===========================================================
  186. // Begin enumerating all of the requested instances
  187. //===========================================================
  188. nRc = EnumerateInstancesAndLogErrors(pNamespace,&pEnum,p->Class,wcsNamespace,NO_ERRORS_EXPECTED);
  189. if( nRc == S_OK )
  190. {
  191. //=======================================================
  192. // Compare instances, if we were asked to do so
  193. //=======================================================
  194. if( sInstanceCompareList.GetPtr() )
  195. {
  196. ClassList MasterList;
  197. //===================================================
  198. // Get the list of the classes to compare with what
  199. // is in the namespace
  200. //===================================================
  201. if( InitMasterListOfClasses(sInstanceCompareList.GetPtr(),MasterList))
  202. {
  203. //===================================================
  204. // while we get the instances
  205. //===================================================
  206. while( TRUE )
  207. {
  208. IWbemClassObject * pClass = NULL;
  209. nRc = NextClassAndLogErrors(pEnum, &pClass,wcsNamespace,NO_ERRORS_EXPECTED);
  210. if( nRc == NO_MORE_DATA )
  211. {
  212. nRc = SUCCESS;
  213. break;
  214. }
  215. if( nRc != SUCCESS )
  216. {
  217. break;
  218. }
  219. CVARIANT vProperty;
  220. CIMTYPE pType = 0;
  221. LONG lFlavor = 0;
  222. //===================================================
  223. // Get the name of the class
  224. //===================================================
  225. nRc = GetPropertyAndLogErrors( pClass, L"__CLASS", &vProperty, &pType, &lFlavor, NULL,wcsNamespace, NO_ERRORS_EXPECTED);
  226. if( nRc == S_OK )
  227. {
  228. //===============================================
  229. // Compare the class name with what we expect
  230. // and make sure we haven't already compared it
  231. // before, if it isn't in the list, then error
  232. // out, we have a big problem
  233. //===============================================
  234. if( !MasterList.ClassInListAndLogErrors(vProperty.GetStr(),wcsNamespace,NO_ERRORS_EXPECTED))
  235. {
  236. break;
  237. }
  238. }
  239. }
  240. if( nRc == SUCCESS )
  241. {
  242. //====================================================
  243. // Go through the master list and see if there are
  244. // any classes we expect to be there but we didn't
  245. // get during the enumeration
  246. //====================================================
  247. nRc = MasterList.ClassesCompareAsExpectedAndLogErrors(wcsNamespace,NO_ERRORS_EXPECTED);
  248. }
  249. }
  250. }
  251. }
  252. SAFE_RELEASE_PTR(pEnum);
  253. }
  254. }
  255. return nRc;
  256. }
  257. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  258. int EnumerateClassesAndCompare(CAutoDeleteString & sClassesAfterDelete, IWbemServices * pNamespace, WCHAR * wcsNamespace)
  259. {
  260. IEnumWbemClassObject * pEnum = NULL;
  261. int nRc = FATAL_ERROR;
  262. //===========================================================
  263. // Begin enumerating all of the classes in the namespace
  264. //===========================================================
  265. nRc = EnumerateClassesAndLogErrors(pNamespace,&pEnum, wcsNamespace,NO_ERRORS_EXPECTED);
  266. if( nRc == S_OK )
  267. {
  268. ClassList MasterList;
  269. //=======================================================
  270. // Get the list of the classes to compare with what is
  271. // in the namespace
  272. //=======================================================
  273. if( InitMasterListOfClasses(sClassesAfterDelete.GetPtr(),MasterList))
  274. {
  275. //===================================================
  276. // while we get the classes in the namespace
  277. //===================================================
  278. while( TRUE )
  279. {
  280. IWbemClassObject * pClass = NULL;
  281. nRc = NextClassAndLogErrors(pEnum, &pClass,wcsNamespace,NO_ERRORS_EXPECTED);
  282. if( nRc == NO_MORE_DATA )
  283. {
  284. nRc = SUCCESS;
  285. break;
  286. }
  287. if( nRc != SUCCESS )
  288. {
  289. break;
  290. }
  291. CVARIANT vProperty;
  292. CIMTYPE pType = 0;
  293. LONG lFlavor = 0;
  294. //===================================================
  295. // Get the name of the class
  296. //===================================================
  297. nRc = GetPropertyAndLogErrors( pClass, L"__CLASS", &vProperty, &pType, &lFlavor, NULL,wcsNamespace, NO_ERRORS_EXPECTED);
  298. if( nRc == S_OK )
  299. {
  300. //===============================================
  301. // filter out system classes
  302. //===============================================
  303. if( wcsncmp( vProperty.GetStr(), L"__", 2 ) != 0 )
  304. {
  305. //===============================================
  306. // Compare the class name with what we expect
  307. // and make sure we haven't already compared it
  308. // before, if it isn't in the list, then error
  309. // out, we have a big problem
  310. //===============================================
  311. nRc = MasterList.ClassInListAndLogErrors(vProperty.GetStr(),wcsNamespace,NO_ERRORS_EXPECTED);
  312. if( nRc != SUCCESS )
  313. {
  314. break;
  315. }
  316. }
  317. }
  318. }
  319. }
  320. if( nRc == SUCCESS )
  321. {
  322. //====================================================
  323. // Go through the master list and see if there are
  324. // any classes we expect to be there but we didn't
  325. // get during the enumeration
  326. //====================================================
  327. nRc = MasterList.ClassesCompareAsExpectedAndLogErrors(wcsNamespace,NO_ERRORS_EXPECTED);
  328. }
  329. }
  330. return nRc;
  331. }
  332. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  333. int AddClasses(CAutoDeleteString & sAddClasses, IWbemServices * pNamespace, WCHAR * wcsNamespace)
  334. {
  335. int nRc = FATAL_ERROR;
  336. ClassList MasterList;
  337. //=======================================================
  338. // Get the list of the classes to be deleted
  339. //=======================================================
  340. if( InitMasterListOfClasses(sAddClasses.GetPtr(),MasterList))
  341. {
  342. for( int i = 0; i < MasterList.Size(); i++ )
  343. {
  344. ClassInfo * pClass = MasterList.GetAt(i);
  345. CAutoDeleteString sClassDefinition;
  346. if( g_Options.GetSpecificOptionForAPITest( pClass->Class, sClassDefinition,APITEST5))
  347. {
  348. nRc = CreateClassAndLogErrors(pNamespace, pClass->Class, sClassDefinition.GetPtr(), wcsNamespace,NO_ERRORS_EXPECTED);
  349. if( nRc != SUCCESS )
  350. {
  351. break;
  352. }
  353. }
  354. }
  355. }
  356. return nRc;
  357. }
  358. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  359. int DeleteAndAddClasses(CAutoDeleteString & sDeleteAddClasses, IWbemServices * pNamespace, WCHAR * wcsNamespace)
  360. {
  361. int nRc = FATAL_ERROR;
  362. ClassList MasterList;
  363. //=======================================================
  364. // Get the list of the classes to be added & deleted
  365. //=======================================================
  366. if( InitMasterListOfAddDeleteClasses(sDeleteAddClasses.GetPtr(),MasterList))
  367. {
  368. for( int i = 0; i < MasterList.Size(); i++ )
  369. {
  370. ClassInfo * pClass = MasterList.GetAt(i);
  371. if( pClass->fAction == DELETE_CLASS )
  372. {
  373. nRc = DeleteClassAndLogErrors(pNamespace, pClass->Class, wcsNamespace,NO_ERRORS_EXPECTED);
  374. if( nRc != SUCCESS )
  375. {
  376. break;
  377. }
  378. }
  379. else
  380. {
  381. ClassInfo * pClass = MasterList.GetAt(i);
  382. CAutoDeleteString sClassDefinition;
  383. if( g_Options.GetSpecificOptionForAPITest( pClass->Class, sClassDefinition, APITEST5))
  384. {
  385. nRc = CreateClassAndLogErrors(pNamespace, pClass->Class, sClassDefinition.GetPtr(), wcsNamespace,NO_ERRORS_EXPECTED);
  386. if( nRc != SUCCESS )
  387. {
  388. break;
  389. }
  390. }
  391. }
  392. }
  393. }
  394. return nRc;
  395. }
  396. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  397. int GetSpecificObjects(CAutoDeleteString & sObjects, IWbemServices * pNamespace, WCHAR * wcsNamespace)
  398. {
  399. int nRc = FATAL_ERROR;
  400. ClassList MasterList;
  401. //=======================================================
  402. // Get the list of the classes to be deleted
  403. //=======================================================
  404. if( InitMasterListOfClasses(sObjects.GetPtr(),MasterList))
  405. {
  406. for( int i = 0; i < MasterList.Size(); i++ )
  407. {
  408. ClassInfo * pClassInfo = MasterList.GetAt(i);
  409. IWbemClassObject * pClass = NULL;
  410. nRc = GetClassObjectAndLogErrors(pNamespace, pClassInfo->Class, &pClass, wcsNamespace,NO_ERRORS_EXPECTED);
  411. if( nRc != SUCCESS )
  412. {
  413. break;
  414. }
  415. SAFE_RELEASE_PTR(pClass);
  416. }
  417. }
  418. return nRc;
  419. }
  420. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  421. int CreateInstances(IWbemServices * pNamespace, CAutoDeleteString & sInstances, WCHAR * wcsNamespace, int nClassDefinitionSection )
  422. {
  423. int nRc = FATAL_ERROR;
  424. ClassList MasterList;
  425. //=======================================================
  426. // Get the list of the instances to be created
  427. //=======================================================
  428. if( InitMasterListOfClasses(sInstances.GetPtr(),MasterList))
  429. {
  430. IWbemClassObject * pClass = NULL;
  431. IWbemClassObject *pInst = NULL;
  432. for( int i = 0; i < MasterList.Size(); i++ )
  433. {
  434. CAutoDeleteString sClassInformation;
  435. ClassInfo * pClassInfo = MasterList.GetAt(i);
  436. if( g_Options.GetSpecificOptionForAPITest(pClassInfo->Class,sClassInformation,nClassDefinitionSection) )
  437. {
  438. const WCHAR * wcsTmpParentClass = NULL; // nothing is allocated, so don't release
  439. CPropertyList Properties; // destructor will release
  440. //===========================================================
  441. // Get the class definition
  442. //===========================================================
  443. nRc = CrackClass(sClassInformation.GetPtr(),wcsTmpParentClass, Properties, NO_ERRORS_EXPECTED);
  444. if( SUCCESS == nRc )
  445. {
  446. //==============================================================
  447. // Get the class definition
  448. //==============================================================
  449. nRc = GetClassObjectAndLogErrors(pNamespace,pClassInfo->Class,&pClass,wcsNamespace, NO_ERRORS_EXPECTED);
  450. if( SUCCESS != nRc )
  451. {
  452. break;
  453. }
  454. //==============================================================
  455. // Spawn a new instance of this class.
  456. //==============================================================
  457. nRc = SpawnInstanceAndLogErrors(pClass,pClassInfo->Class,&pInst,wcsNamespace,NO_ERRORS_EXPECTED);
  458. if( SUCCESS != nRc )
  459. {
  460. break;
  461. }
  462. //==========================================================
  463. // Set the Properties
  464. //==========================================================
  465. DWORD dwFlags = 0;
  466. nRc = WritePropertiesAndQualifiers(pNamespace, pClass, Properties,pClassInfo->Class,dwFlags,wcsNamespace,NO_ERRORS_EXPECTED);
  467. if( SUCCESS != nRc )
  468. {
  469. break;
  470. }
  471. //==========================================================
  472. // Create the new instance
  473. //==========================================================
  474. nRc = PutInstanceAndLogErrors(pNamespace, pInst,pClassInfo->Class,wcsNamespace,NO_ERRORS_EXPECTED);
  475. if( SUCCESS != nRc )
  476. {
  477. break;
  478. }
  479. SAFE_RELEASE_PTR(pInst);
  480. SAFE_RELEASE_PTR(pClass);
  481. }
  482. }
  483. }
  484. SAFE_RELEASE_PTR(pInst);
  485. SAFE_RELEASE_PTR(pClass);
  486. }
  487. return nRc;
  488. }
  489. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  490. int DeleteInstances(CAutoDeleteString & sDeleteInstances,IWbemServices * pNamespace, WCHAR * wcsNamespace)
  491. {
  492. int nRc = FATAL_ERROR;
  493. ClassList MasterList;
  494. //=======================================================
  495. // Get the list of the instances to be deleted
  496. //=======================================================
  497. if( InitMasterListOfClasses(sDeleteInstances.GetPtr(),MasterList))
  498. {
  499. for( int i = 0; i < MasterList.Size(); i++ )
  500. {
  501. ClassInfo * pClass = MasterList.GetAt(i);
  502. nRc = DeleteInstanceAndLogErrors(pNamespace, pClass->Class, wcsNamespace,NO_ERRORS_EXPECTED);
  503. if( nRc != SUCCESS )
  504. {
  505. break;
  506. }
  507. }
  508. }
  509. return nRc;
  510. }
  511. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  512. int CreateAssociationAndLogErrors( IWbemServices * pNamespace, const WCHAR * wcsClass, WCHAR * wcsClassDefinition,
  513. WCHAR * wcsNamespace )
  514. {
  515. IWbemClassObject *pClass = NULL;
  516. const WCHAR * wcsClass1 = NULL; // nothing is allocated, so don't release
  517. const WCHAR * wcsClass2 = NULL; // nothing is allocated, so don't release
  518. //===========================================================
  519. // Get the association definition
  520. //===========================================================
  521. CPropertyList Props;
  522. int nRc = CrackAssociation( wcsClassDefinition, Props, NO_ERRORS_EXPECTED);
  523. if( nRc == SUCCESS )
  524. {
  525. // =================================================================
  526. // Get an empty class object to work with
  527. // =================================================================
  528. nRc = GetClassObjectAndLogErrors(pNamespace, NULL, &pClass, wcsNamespace, NO_ERRORS_EXPECTED);
  529. if( nRc == SUCCESS )
  530. {
  531. //==============================================================
  532. // Write out the name of the association
  533. //==============================================================
  534. DWORD dwFlags = WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE | WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS;
  535. CVARIANT v;
  536. v.SetStr((WCHAR*)wcsClass);
  537. nRc = PutPropertyAndLogErrors( pClass, L"__CLASS",CIM_STRING, v, wcsClass, dwFlags, wcsNamespace, NO_ERRORS_EXPECTED);
  538. if( nRc == SUCCESS )
  539. {
  540. //==========================================================
  541. // Make the class an association
  542. //==========================================================
  543. CVARIANT Var;
  544. Var.SetBool(TRUE);
  545. nRc = PutQualifierOnClassAndLogErrors( pClass, L"Association",&Var, wcsClass,dwFlags, wcsNamespace, NO_ERRORS_EXPECTED);
  546. if( nRc == SUCCESS )
  547. {
  548. //======================================================
  549. // Now, create the association endpoints
  550. //======================================================
  551. nRc = WritePropertiesAndQualifiers(pNamespace, pClass, Props,wcsClass,dwFlags,wcsNamespace,NO_ERRORS_EXPECTED);
  552. if( SUCCESS == nRc )
  553. {
  554. //==============================================================
  555. // Now, create the association class
  556. //==============================================================
  557. nRc = PutClassAndLogErrors(pNamespace, pClass,wcsClass,wcsNamespace, NO_ERRORS_EXPECTED);
  558. }
  559. }
  560. }
  561. }
  562. }
  563. SAFE_RELEASE_PTR(pClass);
  564. return nRc;
  565. }
  566. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  567. int QueryAndCompareResults( IWbemServices * pNamespace, WCHAR * wcsQuery, WCHAR * wcsNamespace )
  568. {
  569. IEnumWbemClassObject * pEnum = NULL;
  570. DWORD dwFlags = WBEM_FLAG_FORWARD_ONLY;
  571. int nRc = ExecQueryAndLogErrors( pNamespace,&pEnum, wcsQuery, dwFlags, wcsNamespace,NO_ERRORS_EXPECTED);
  572. SAFE_RELEASE_PTR(pEnum);
  573. return nRc;
  574. }