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.

2035 lines
64 KiB

  1. /****************************************************************************
  2. Copyright information : Copyright (c) 1998-1999 Microsoft Corporation
  3. File Name : GlobalSwitches.cpp
  4. Project Name : WMI Command Line
  5. Author Name : Ch. Sriramachandramurthy
  6. Date of Creation (dd/mm/yy) : 27th-September-2000
  7. Version Number : 1.0
  8. Brief Description : This class encapsulates the functionality needed
  9. for accessing and storing the global switches
  10. information, which will be used by Parsing,
  11. Execution and Format Engines depending upon the
  12. applicablity.
  13. Revision History :
  14. Last Modified by : Ch. Sriramachandramurthy
  15. Last Modified on : 11th-April-2001
  16. ****************************************************************************/
  17. // GlobalSwitches.cpp : implementation file
  18. //
  19. #include "precomp.h"
  20. #include "GlobalSwitches.h"
  21. /*------------------------------------------------------------------------
  22. Name :CGlobalSwitches
  23. Synopsis :This function initializes the member variables when
  24. an object of the class type is instantiated
  25. Type :Constructor
  26. Input parameters :None
  27. Output parameters :None
  28. Return Type :None
  29. Global Variables :None
  30. Calling Syntax :None
  31. Notes :None
  32. ------------------------------------------------------------------------*/
  33. CGlobalSwitches::CGlobalSwitches()
  34. {
  35. m_pszNameSpace = NULL;
  36. m_pszRole = NULL;
  37. m_pszNode = NULL;
  38. m_pszLocale = NULL;
  39. m_pszUser = NULL;
  40. m_pszPassword = NULL;
  41. m_pszAuthorityPrinciple = NULL; // Authority string
  42. m_pszRecordPath = NULL;
  43. m_bPrivileges = TRUE;
  44. m_uConnInfoFlag = 0;
  45. m_bRoleFlag = TRUE;
  46. m_bNSFlag = TRUE;
  47. m_bLocaleFlag = TRUE;
  48. m_bRPChange = FALSE;
  49. m_bAggregateFlag = TRUE;
  50. // default impersonation level is IMPERSONATE
  51. m_ImpLevel = IMPERSONATE;
  52. // default authentication level is DEFAULT
  53. m_AuthLevel = AUTHPKTPRIVACY;
  54. // Trace mode if OFF by default
  55. m_bTrace = FALSE;
  56. // Interactive mode is OFF by default
  57. m_bInteractive = FALSE;
  58. // Help flag is OFF by default
  59. m_bHelp = FALSE;
  60. // Default help option is BRIEF
  61. m_HelpOption = HELPBRIEF;
  62. m_bAskForPassFlag = FALSE;
  63. m_bFailFast = FALSE;
  64. m_opsOutputOpt = STDOUT;
  65. m_opsAppendOpt = STDOUT;
  66. m_eftFileType = ANSI_FILE;
  67. m_pszOutputFileName = NULL;
  68. m_fpOutFile = NULL;
  69. m_pszAppendFileName = NULL;
  70. m_fpAppendFile = NULL;
  71. m_nSeqNum = 0;
  72. m_pszLoggedOnUser = NULL;
  73. m_pszNodeName = NULL;
  74. m_pszStartTime = NULL;
  75. }
  76. /*------------------------------------------------------------------------
  77. Name :~CGlobalSwitches
  78. Synopsis :This function Uninitializes the member variables when
  79. an object of the class type is instantiated
  80. Type :Destructor
  81. Input parameters :None
  82. Output parameters :None
  83. Return Type :None
  84. Global Variables :None
  85. Calling Syntax :None
  86. Notes :None
  87. ------------------------------------------------------------------------*/
  88. CGlobalSwitches::~CGlobalSwitches()
  89. {
  90. Uninitialize();
  91. }
  92. /*------------------------------------------------------------------------
  93. Name :Initialize
  94. Synopsis :This function initializes the necessary member
  95. variables.
  96. Type :Member Function
  97. Input parameters :None
  98. Output parameters :None
  99. Return Type :None
  100. Global Variables :None
  101. Calling Syntax :Initialize()
  102. Notes :None
  103. ------------------------------------------------------------------------*/
  104. void CGlobalSwitches::Initialize() throw(WMICLIINT)
  105. {
  106. static BOOL bFirst = TRUE;
  107. try
  108. {
  109. if (bFirst)
  110. {
  111. // NAMESPACE
  112. // Set the default namespace to 'root\cimv2'
  113. m_pszNameSpace = new _TCHAR [BUFFER32];
  114. // Check for memory allocation failure.
  115. if (m_pszNameSpace == NULL)
  116. throw OUT_OF_MEMORY;
  117. lstrcpy(m_pszNameSpace, CLI_NAMESPACE_DEFAULT);
  118. // Set the default role as 'root\cli'
  119. m_pszRole = new _TCHAR [BUFFER32];
  120. // Check for memory allocation failure
  121. if (m_pszRole == NULL)
  122. throw OUT_OF_MEMORY;
  123. lstrcpy(m_pszRole, CLI_ROLE_DEFAULT);
  124. // Set the system default locale in the format ms_xxx
  125. m_pszLocale = new _TCHAR [BUFFER32];
  126. // Check for memory allocation failure
  127. if (m_pszLocale == NULL)
  128. throw OUT_OF_MEMORY;
  129. _stprintf(m_pszLocale, _T("ms_%x"), GetSystemDefaultUILanguage());
  130. m_pszNodeName = new _TCHAR [MAX_COMPUTERNAME_LENGTH + 1];
  131. if (m_pszNodeName == NULL)
  132. throw OUT_OF_MEMORY;
  133. DWORD dwCompNameBufferSize = MAX_COMPUTERNAME_LENGTH + 1;
  134. if (GetComputerName(m_pszNodeName, &dwCompNameBufferSize))
  135. {
  136. m_pszNodeName[MAX_COMPUTERNAME_LENGTH] = _T('\0');
  137. }
  138. else
  139. lstrcpy(m_pszNodeName, L"N/A");
  140. // current node is the default.
  141. m_pszNode = new _TCHAR [lstrlen(m_pszNodeName)+1];
  142. // Check for memory allocation failure
  143. if (m_pszNode == NULL)
  144. throw OUT_OF_MEMORY;
  145. lstrcpy(m_pszNode, m_pszNodeName);
  146. ULONG nSize = 0;
  147. if(!GetUserNameEx(NameSamCompatible, NULL, &nSize))
  148. {
  149. m_pszLoggedOnUser = new _TCHAR [nSize + 1];
  150. if (m_pszLoggedOnUser == NULL)
  151. throw OUT_OF_MEMORY;
  152. if (!GetUserNameEx(NameSamCompatible, m_pszLoggedOnUser, &nSize))
  153. lstrcpy(m_pszLoggedOnUser, L"N/A");
  154. }
  155. if (!AddToNodesList(m_pszNode))
  156. throw OUT_OF_MEMORY;
  157. // Populate the IMPLEVEL mappings
  158. m_cimImpLevel.insert(CHARINTMAP::value_type(_bstr_t(L"ANONYMOUS"), 1));
  159. m_cimImpLevel.insert(CHARINTMAP::value_type(_bstr_t(L"IDENTIFY"), 2));
  160. m_cimImpLevel.insert(CHARINTMAP::value_type(_bstr_t(L"IMPERSONATE"),3));
  161. m_cimImpLevel.insert(CHARINTMAP::value_type(_bstr_t(L"DELEGATE"), 4));
  162. // Populate the AUTHLEVEL mappings
  163. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"DEFAULT"), 0));
  164. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"NONE"), 1));
  165. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"CONNECT"), 2));
  166. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"CALL"), 3));
  167. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"PKT"), 4));
  168. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"PKTINTEGRITY"),5));
  169. m_cimAuthLevel.insert(CHARINTMAP::value_type(_bstr_t(L"PKTPRIVACY"), 6));
  170. bFirst = FALSE;
  171. }
  172. }
  173. catch(_com_error& e)
  174. {
  175. _com_issue_error(e.Error());
  176. }
  177. m_HelpOption = HELPBRIEF;
  178. }
  179. /*------------------------------------------------------------------------
  180. Name :Uninitialize
  181. Synopsis :This function uninitializes the member variables
  182. when the execution of a command string issued on the
  183. command line is completed.
  184. Type :Member Function
  185. Input parameters :None
  186. Output parameters :None
  187. Return Type :None
  188. Global Variables :None
  189. Calling Syntax :Uninitialize()
  190. Notes :None
  191. ------------------------------------------------------------------------*/
  192. void CGlobalSwitches::Uninitialize()
  193. {
  194. SAFEDELETE(m_pszNameSpace);
  195. SAFEDELETE(m_pszRole);
  196. SAFEDELETE(m_pszLocale);
  197. SAFEDELETE(m_pszNode);
  198. CleanUpCharVector(m_cvNodesList);
  199. SAFEDELETE(m_pszUser);
  200. SAFEDELETE(m_pszPassword);
  201. SAFEDELETE(m_pszAuthorityPrinciple);
  202. SAFEDELETE(m_pszRecordPath);
  203. SAFEDELETE(m_pszOutputFileName);
  204. SAFEDELETE(m_pszAppendFileName);
  205. if ( m_fpOutFile != NULL )
  206. {
  207. fclose(m_fpOutFile);
  208. m_fpOutFile = NULL;
  209. }
  210. if ( m_fpAppendFile != NULL )
  211. {
  212. fclose(m_fpAppendFile);
  213. m_fpAppendFile = NULL;
  214. }
  215. m_bHelp = FALSE;
  216. m_bTrace = FALSE;
  217. m_bInteractive = FALSE;
  218. m_HelpOption = HELPBRIEF;
  219. m_AuthLevel = AUTHPKT;
  220. m_ImpLevel = IMPERSONATE;
  221. m_uConnInfoFlag = 0;
  222. m_cimAuthLevel.clear();
  223. m_cimImpLevel.clear();
  224. m_nSeqNum = 0;
  225. SAFEDELETE(m_pszLoggedOnUser);
  226. SAFEDELETE(m_pszNodeName);
  227. SAFEDELETE(m_pszStartTime);
  228. }
  229. /*------------------------------------------------------------------------
  230. Name :SetNameSpace
  231. Synopsis :This function Sets the namespace passed in parameter
  232. to m_pszNameSpace.
  233. Type :Member Function
  234. Input parameters :
  235. pszNameSpace -String type,contains Namespace specified in the command
  236. AliasFlag -Boolean type,specifies whether alias flag is set or not
  237. Output parameters :None
  238. Return Type :BOOL
  239. Global Variables :None
  240. Calling Syntax :SetNameSpace(pszNameSpace)
  241. Notes :None
  242. ------------------------------------------------------------------------*/
  243. BOOL CGlobalSwitches::SetNameSpace(_TCHAR* pszNamespace)
  244. {
  245. BOOL bResult = TRUE;
  246. if(pszNamespace)
  247. {
  248. // If the value specified is not _T("")
  249. if( !CompareTokens(pszNamespace, CLI_TOKEN_NULL) )
  250. {
  251. // Check if the same value is specified for the /NAMESPACE.
  252. if (!CompareTokens(pszNamespace, m_pszNameSpace))
  253. {
  254. SAFEDELETE(m_pszNameSpace);
  255. m_pszNameSpace = new _TCHAR [lstrlen(pszNamespace)+1];
  256. if (m_pszNameSpace)
  257. {
  258. lstrcpy(m_pszNameSpace, pszNamespace);
  259. m_bNSFlag = TRUE;
  260. }
  261. else
  262. bResult = FALSE;
  263. }
  264. }
  265. // set back to default
  266. else
  267. {
  268. // If the current namespace is not the default namespace
  269. if (!CompareTokens(m_pszRole, CLI_NAMESPACE_DEFAULT))
  270. {
  271. SAFEDELETE(m_pszNameSpace)
  272. m_pszNameSpace = new _TCHAR [BUFFER255];
  273. if (m_pszNameSpace)
  274. {
  275. lstrcpy(m_pszNameSpace, CLI_NAMESPACE_DEFAULT);
  276. m_bNSFlag = TRUE;
  277. }
  278. else
  279. bResult = FALSE;
  280. }
  281. }
  282. }
  283. return bResult;
  284. }
  285. /*------------------------------------------------------------------------
  286. Name :SetRole
  287. Synopsis :This function Sets the role passed in parameter
  288. to m_pszRole.
  289. Type :Member Function
  290. Input parameters :
  291. pszRole -String type,contains Role specified in the command
  292. Output parameters :None
  293. Return Type :BOOL
  294. Global Variables :None
  295. Calling Syntax :SetRole(pszRole)
  296. Notes :None
  297. ------------------------------------------------------------------------*/
  298. BOOL CGlobalSwitches::SetRole(_TCHAR* pszRole)
  299. {
  300. BOOL bResult = TRUE;
  301. if(pszRole)
  302. {
  303. // If the value specified is not _T("")
  304. if( !CompareTokens(pszRole, CLI_TOKEN_NULL) )
  305. {
  306. // Check if the same value is specified for the /ROLE.
  307. if (!CompareTokens(pszRole, m_pszRole))
  308. {
  309. SAFEDELETE(m_pszRole);
  310. m_pszRole = new _TCHAR [lstrlen(pszRole)+1];
  311. if (m_pszRole)
  312. {
  313. lstrcpy(m_pszRole, pszRole);
  314. m_bRoleFlag = TRUE;
  315. m_bLocaleFlag = TRUE;
  316. }
  317. else
  318. bResult = FALSE;
  319. }
  320. }
  321. // set back to default
  322. else
  323. {
  324. // If the current role is not the default role
  325. if (!CompareTokens(m_pszRole, CLI_ROLE_DEFAULT))
  326. {
  327. SAFEDELETE(m_pszRole)
  328. m_pszRole = new _TCHAR [BUFFER255];
  329. if (m_pszRole)
  330. {
  331. lstrcpy(m_pszRole, CLI_ROLE_DEFAULT);
  332. m_bRoleFlag = TRUE;
  333. m_bLocaleFlag = TRUE;
  334. }
  335. else
  336. bResult = FALSE;
  337. }
  338. }
  339. }
  340. return bResult;
  341. }
  342. /*------------------------------------------------------------------------
  343. Name :SetLocale
  344. Synopsis :This function Assigns the locale passed in parameter
  345. to m_pszLocale.
  346. Type :Member Function
  347. Input parameters :
  348. pszLocale -String type,It contains Locale option specified in the
  349. command
  350. Output parameters :None
  351. Return Type :BOOL
  352. Global Variables :None
  353. Calling Syntax :SetLocale(pszLocale)
  354. Notes :None
  355. ------------------------------------------------------------------------*/
  356. BOOL CGlobalSwitches::SetLocale(_TCHAR* pszLocale)
  357. {
  358. BOOL bResult = TRUE;
  359. if(pszLocale)
  360. {
  361. // If the value specified is not _T("")
  362. if (!CompareTokens(pszLocale, CLI_TOKEN_NULL))
  363. {
  364. // Check if the same value is specified for the /LOCALE.
  365. if (!CompareTokens(m_pszLocale, pszLocale))
  366. {
  367. SAFEDELETE(m_pszLocale);
  368. m_pszLocale = new _TCHAR [lstrlen(pszLocale)+1];
  369. if (m_pszLocale)
  370. {
  371. lstrcpy(m_pszLocale, pszLocale);
  372. m_uConnInfoFlag |= LOCALE;
  373. m_bLocaleFlag = TRUE;
  374. m_bRoleFlag = TRUE;
  375. m_bNSFlag = TRUE;
  376. }
  377. else
  378. bResult = FALSE;
  379. }
  380. }
  381. // If the value specified is _T("") - set to default system locale.
  382. else
  383. {
  384. _TCHAR szLocale[BUFFER32] = NULL_STRING;
  385. _stprintf(szLocale, _T("ms_%x"), GetSystemDefaultUILanguage());
  386. // If the current role is not the default role
  387. if (!CompareTokens(m_pszLocale, szLocale))
  388. {
  389. SAFEDELETE(m_pszLocale);
  390. m_pszLocale = new _TCHAR [BUFFER32];
  391. if (m_pszLocale)
  392. {
  393. m_uConnInfoFlag &= ~LOCALE;
  394. lstrcpy(m_pszLocale, szLocale);
  395. m_bLocaleFlag = TRUE;
  396. m_bRoleFlag = TRUE;
  397. m_bNSFlag = TRUE;
  398. }
  399. else
  400. bResult = FALSE;
  401. }
  402. }
  403. }
  404. return bResult;
  405. }
  406. /*------------------------------------------------------------------------
  407. Name :AddToNodesList
  408. Synopsis :This function adds the node passed in parameter
  409. to m_cvNodesList
  410. Type :Member Function
  411. Input parameters :
  412. pszNode - String type,contains Node option specified in the
  413. command
  414. Output parameters :None
  415. Return Type :void
  416. Global Variables :BOOL
  417. Calling Syntax :AddToNodesList(pszNode)
  418. Notes :None
  419. ------------------------------------------------------------------------*/
  420. BOOL CGlobalSwitches::AddToNodesList(_TCHAR* pszNode)
  421. {
  422. _TCHAR* pszTempNode = NULL;
  423. BOOL bRet = TRUE;
  424. if (!CompareTokens(pszNode, CLI_TOKEN_NULL) &&
  425. !CompareTokens(pszNode, CLI_TOKEN_DOT) &&
  426. !CompareTokens(pszNode, CLI_TOKEN_LOCALHOST) &&
  427. !CompareTokens(pszNode, m_pszNodeName))
  428. {
  429. pszTempNode = new _TCHAR [ lstrlen ( pszNode ) + 1 ];
  430. if (pszTempNode)
  431. lstrcpy(pszTempNode, pszNode);
  432. else
  433. bRet = FALSE;
  434. }
  435. else
  436. {
  437. // "." specifies current node
  438. SAFEDELETE(m_pszNode);
  439. m_pszNode = new _TCHAR [ lstrlen (m_pszNodeName) + 1 ];
  440. if (m_pszNodeName)
  441. {
  442. lstrcpy(m_pszNode, m_pszNodeName);
  443. pszTempNode = new _TCHAR [ lstrlen (m_pszNodeName) + 1 ];
  444. if (pszTempNode)
  445. lstrcpy(pszTempNode, m_pszNodeName);
  446. else
  447. bRet = FALSE;
  448. }
  449. else
  450. bRet = FALSE;
  451. }
  452. if (bRet)
  453. {
  454. CHARVECTOR::iterator tempIterator;
  455. if ( !Find(m_cvNodesList, pszTempNode, tempIterator) )
  456. m_cvNodesList.push_back(pszTempNode);
  457. else if ( CompareTokens(pszTempNode, m_pszNodeName) == TRUE )
  458. {
  459. BOOL bFound = FALSE;
  460. tempIterator = m_cvNodesList.begin();
  461. while ( tempIterator != m_cvNodesList.end() )
  462. {
  463. if ( tempIterator != m_cvNodesList.begin() )
  464. {
  465. if(CompareTokens(*tempIterator, m_pszNodeName) == TRUE)
  466. {
  467. bFound = TRUE;
  468. break;
  469. }
  470. }
  471. tempIterator++;
  472. }
  473. if(bFound == FALSE)
  474. m_cvNodesList.push_back(pszTempNode);
  475. else
  476. SAFEDELETE(pszTempNode);
  477. }
  478. else
  479. SAFEDELETE(pszTempNode);
  480. }
  481. return bRet;
  482. }
  483. /*------------------------------------------------------------------------
  484. Name :SetUser
  485. Synopsis :This function Assigns the user passed in parameter
  486. to m_pszUser
  487. Type :Member Function
  488. Input parameters :
  489. pszUser -String type,contains User option specified in the
  490. command.
  491. Output parameters :None
  492. Return Type :BOOL
  493. Global Variables :None
  494. Calling Syntax :SetUser(pszUser)
  495. Notes :None
  496. ------------------------------------------------------------------------*/
  497. BOOL CGlobalSwitches::SetUser(_TCHAR* pszUser)
  498. {
  499. BOOL bResult = TRUE;
  500. SAFEDELETE(m_pszUser);
  501. if(pszUser)
  502. {
  503. if (!CompareTokens(pszUser, CLI_TOKEN_NULL))
  504. {
  505. m_pszUser = new _TCHAR [lstrlen(pszUser)+1];
  506. if (m_pszUser)
  507. {
  508. lstrcpy(m_pszUser, pszUser);
  509. m_uConnInfoFlag |= USER;
  510. }
  511. else
  512. bResult = FALSE;
  513. }
  514. else
  515. m_uConnInfoFlag &= ~USER;
  516. }
  517. return bResult;
  518. }
  519. /*------------------------------------------------------------------------
  520. Name :SetPassword
  521. Synopsis :This function Assigns the password passed in parameter
  522. to m_pszPassword
  523. Type :Member Function
  524. Input parameters :
  525. pszPassword -Assigns the password passed in parameter to
  526. m_pszPassword
  527. Output parameters :None
  528. Return Type :BOOL
  529. Global Variables :None
  530. Calling Syntax :SetPassword(pszPassword)
  531. Notes :None
  532. ------------------------------------------------------------------------*/
  533. BOOL CGlobalSwitches::SetPassword(_TCHAR* pszPassword)
  534. {
  535. BOOL bResult = TRUE;
  536. SAFEDELETE(m_pszPassword)
  537. if (!CompareTokens(pszPassword, CLI_TOKEN_NULL))
  538. {
  539. m_pszPassword = new _TCHAR [lstrlen(pszPassword)+1];
  540. if (m_pszPassword)
  541. {
  542. lstrcpy(m_pszPassword, pszPassword);
  543. m_uConnInfoFlag |= PASSWORD;
  544. }
  545. else
  546. bResult = FALSE;
  547. }
  548. else
  549. m_uConnInfoFlag &= ~PASSWORD;
  550. return bResult;
  551. }
  552. /*------------------------------------------------------------------------
  553. Name :SetAuthorityPrinciple
  554. Synopsis :This function Assigns the <authority principle> passed
  555. in parameter to m_pszAuthorityPrinciple
  556. Type :Member Function
  557. Input parameters :
  558. pszPassword -Assigns the authority string passed in parameter to
  559. m_pszAuthorityPrinciple
  560. Output parameters :None
  561. Return Type :BOOL
  562. Global Variables :None
  563. Calling Syntax :SetAuthorityPrinciple(pszAuthorityPrinciple)
  564. Notes :None
  565. ------------------------------------------------------------------------*/
  566. BOOL CGlobalSwitches::SetAuthorityPrinciple(_TCHAR* pszAuthorityPrinciple)
  567. {
  568. BOOL bResult = TRUE;
  569. SAFEDELETE(m_pszAuthorityPrinciple)
  570. if (!CompareTokens(pszAuthorityPrinciple, CLI_TOKEN_NULL))
  571. {
  572. m_pszAuthorityPrinciple = new _TCHAR [lstrlen(pszAuthorityPrinciple)+1];
  573. if (m_pszAuthorityPrinciple)
  574. {
  575. lstrcpy(m_pszAuthorityPrinciple, pszAuthorityPrinciple);
  576. m_uConnInfoFlag |= AUTHORITY;
  577. }
  578. else
  579. bResult = FALSE;
  580. }
  581. else
  582. m_uConnInfoFlag &= ~AUTHORITY;
  583. return bResult;
  584. }
  585. /*------------------------------------------------------------------------
  586. Name :SetRecordPath(pszRecordPath)
  587. Synopsis :This function Assigns the record file passed in
  588. parameter to m_pszRecordPath
  589. Type :Member Function
  590. Input parameters :
  591. pszRecordPath -String type,contains Record path specified in the
  592. command.
  593. Output parameters :None
  594. Return Type :BOOL
  595. Global Variables :None
  596. Calling Syntax :SetRecordPath(pszRecordPath)
  597. Notes :None
  598. ------------------------------------------------------------------------*/
  599. BOOL CGlobalSwitches::SetRecordPath(_TCHAR* pszRecordPath)
  600. {
  601. BOOL bResult = TRUE;
  602. if (pszRecordPath)
  603. {
  604. // Check if the value specified is not _T("")
  605. if (!CompareTokens(pszRecordPath, CLI_TOKEN_NULL))
  606. {
  607. SAFEDELETE(m_pszRecordPath);
  608. m_pszRecordPath = new _TCHAR [lstrlen(pszRecordPath)+1];
  609. if (m_pszRecordPath)
  610. {
  611. lstrcpy(m_pszRecordPath, pszRecordPath);
  612. m_bRPChange = TRUE;
  613. }
  614. else
  615. bResult = FALSE;
  616. }
  617. // if the value specified is _T("") set the recordpath to NULL
  618. else
  619. {
  620. SAFEDELETE(m_pszRecordPath);
  621. m_bRPChange = TRUE;
  622. }
  623. }
  624. else
  625. {
  626. SAFEDELETE(m_pszRecordPath);
  627. m_bRPChange = TRUE;
  628. }
  629. return bResult;
  630. }
  631. /*------------------------------------------------------------------------
  632. Name :SetPrivileges(bEnable)
  633. Synopsis :This function sets bEnable flag to TRUE if Privileges
  634. :option is specified in the command
  635. Type :Member Function
  636. Input parameters :
  637. pszPrivileges -Boolean tye,Specifies whether the flag should be
  638. enabled or disabled
  639. Output parameters :None
  640. Return Type :None
  641. Global Variables :None
  642. Calling Syntax :SetPrivileges(pszPrivileges)
  643. Notes :None
  644. ------------------------------------------------------------------------*/
  645. void CGlobalSwitches::SetPrivileges(BOOL bEnable)
  646. {
  647. m_bPrivileges = bEnable;
  648. }
  649. /*------------------------------------------------------------------------
  650. Name :SetImpersonationLevel(_TCHAR* const pszImpLevel)
  651. Synopsis :This function checks whether the specified pszImpLevel
  652. is valid and assigns the mapped value to m_ImpLevel.
  653. Type :Member Function
  654. Input parameters :
  655. pszImpLevel - IMPLEVEL input string
  656. Output parameters :None
  657. Return Type :BOOL
  658. Global Variables :None
  659. Calling Syntax :SetImpersonationLevel(pszImpLevel)
  660. Notes :None
  661. ------------------------------------------------------------------------*/
  662. BOOL CGlobalSwitches::SetImpersonationLevel(_TCHAR* const pszImpLevel)
  663. {
  664. BOOL bResult = TRUE;
  665. // Check whether the string exists in the list of available values.
  666. CHARINTMAP::iterator theIterator = NULL;
  667. theIterator = m_cimImpLevel.find(CharUpper(pszImpLevel));
  668. if (theIterator != m_cimImpLevel.end())
  669. {
  670. m_ImpLevel = (IMPLEVEL) (*theIterator).second;
  671. }
  672. else
  673. bResult = FALSE;
  674. return bResult;
  675. }
  676. /*------------------------------------------------------------------------
  677. Name :SetAuthenticationLevel(_TCHAR* const pszAuthLevel)
  678. Synopsis :This function checks whether the specified pszAuthLevel
  679. is valid and assigns the mapped value to m_AuthLevel.
  680. Type :Member Function
  681. Input parameters :
  682. pszAuthLevel - AUTHLEVEL input string
  683. Output parameters :None
  684. Return Type :BOOL
  685. Global Variables :None
  686. Calling Syntax :SetAuthenticationLevel(pszAuthLevel)
  687. Notes :None
  688. ------------------------------------------------------------------------*/
  689. BOOL CGlobalSwitches::SetAuthenticationLevel(_TCHAR* const pszAuthLevel)
  690. {
  691. BOOL bResult = TRUE;
  692. // Check whether the string exists in the list of available values.
  693. CHARINTMAP::iterator theIterator = NULL;
  694. theIterator = m_cimAuthLevel.find(CharUpper(pszAuthLevel));
  695. if (theIterator != m_cimAuthLevel.end())
  696. {
  697. m_AuthLevel = (AUTHLEVEL) (*theIterator).second;
  698. }
  699. else
  700. bResult = FALSE;
  701. return bResult;
  702. }
  703. /*------------------------------------------------------------------------
  704. Name :SetTraceMode(BOOL bTrace)
  705. Synopsis :This function sets the m_bTrace to TRUE,If Trace mode
  706. is specified in the command
  707. Type :Member Function
  708. Input parameter :
  709. Trace -Boolean type,Specifies whether the trace mode
  710. has been set or not
  711. Output parameters :None
  712. Return Type :None
  713. Global Variables :None
  714. Calling Syntax :SetTraceMode(bTrace)
  715. Notes :None
  716. ------------------------------------------------------------------------*/
  717. void CGlobalSwitches::SetTraceMode(BOOL bTrace)
  718. {
  719. m_bTrace = bTrace;
  720. }
  721. /*------------------------------------------------------------------------
  722. Name :SetInteractiveMode
  723. Synopsis :This function sets the m_bInteractive to TRUE,If
  724. interactive mode is specified in the command
  725. Type :Member Function
  726. Input parameter :
  727. bInteractive -Boolean type,Specifies whether the interactive mode
  728. has been set or not
  729. Output parameters :None
  730. Return Type :void
  731. Global Variables :None
  732. Calling Syntax :SetInteractiveMode(bInteractive)
  733. Notes :None
  734. ------------------------------------------------------------------------*/
  735. void CGlobalSwitches::SetInteractiveMode(BOOL bInteractive)
  736. {
  737. m_bInteractive = bInteractive;
  738. }
  739. /*------------------------------------------------------------------------
  740. Name :SetHelpFlag
  741. Synopsis :sets the m_bHelp to TRUE, If /? is specified in the
  742. command
  743. Type :Member Function
  744. Input parameters :
  745. bHelp -BOOL type Specifies whether the helpflag has been
  746. set or not
  747. Output parameters :None
  748. Return Type :void
  749. Global Variables :None
  750. Calling Syntax :SetHelpFlag(bHelp)
  751. Notes :None
  752. ------------------------------------------------------------------------*/
  753. void CGlobalSwitches::SetHelpFlag(BOOL bHelp)
  754. {
  755. m_bHelp = bHelp;
  756. }
  757. /*------------------------------------------------------------------------
  758. Name :SetHelpOption
  759. Synopsis :This function specifies whether the help should
  760. be brief or full
  761. Type :Member Function
  762. Input parameters :
  763. helpOption -Specifies whether the help should be brief or full
  764. Output parameters :None
  765. Return Type :void
  766. Global Variables :None
  767. Calling Syntax :SetHelpOption(helpOption)
  768. Notes :None
  769. ------------------------------------------------------------------------*/
  770. void CGlobalSwitches::SetHelpOption(HELPOPTION helpOption)
  771. {
  772. m_HelpOption = helpOption;
  773. }
  774. /*------------------------------------------------------------------------
  775. Name :SetConnInfoFlag
  776. Synopsis :This function sets the Connection Info flag
  777. Type :Member Function
  778. Input parameter :
  779. uFlag - Unsigned int type
  780. Output parameters :None
  781. Return Type :void
  782. Global Variables :None
  783. Calling Syntax :SetConnInfoFlag(uFlag)
  784. Notes :None
  785. ------------------------------------------------------------------------*/
  786. void CGlobalSwitches::SetConnInfoFlag(UINT uFlag)
  787. {
  788. m_uConnInfoFlag = uFlag;
  789. }
  790. /*------------------------------------------------------------------------
  791. Name :GetConnInfoFlag
  792. Synopsis :This function returns the Connection Info flag
  793. Type :Member Function
  794. Input parameter :None
  795. Output parameters :None
  796. Return Type :UINT
  797. Global Variables :None
  798. Calling Syntax :GetConnInfoFlag()
  799. Notes :None
  800. ------------------------------------------------------------------------*/
  801. UINT CGlobalSwitches::GetConnInfoFlag()
  802. {
  803. return m_uConnInfoFlag;
  804. }
  805. /*------------------------------------------------------------------------
  806. Name :GetNameSpace
  807. Synopsis :This function Returns the string held in m_pszNameSpace
  808. Type :Member Function
  809. Input parameters :None
  810. Output parameters :None
  811. Return Type :_TCHAR*
  812. Global Variables :None
  813. Calling Syntax :GetNameSpace()
  814. Notes :None
  815. ------------------------------------------------------------------------*/
  816. _TCHAR* CGlobalSwitches::GetNameSpace()
  817. {
  818. return m_pszNameSpace;
  819. }
  820. /*------------------------------------------------------------------------
  821. Name :GetRole
  822. Synopsis :This function Returns the string held in m_pszRole
  823. Type :Member Function
  824. Input parameters :None
  825. Output parameters :None
  826. Return Type :_TCHAR*
  827. Global Variables :None
  828. Calling Syntax :GetRole()
  829. Notes :None
  830. ------------------------------------------------------------------------*/
  831. _TCHAR* CGlobalSwitches::GetRole()
  832. {
  833. return m_pszRole;
  834. }
  835. /*------------------------------------------------------------------------
  836. Name :GetLocale
  837. Synopsis :This function Returns the string held in m_pszLocale .
  838. Type :Member Function
  839. Input parameters :None
  840. Output parameters :None
  841. Return Type :_TCHR*
  842. Global Variables :None
  843. Calling Syntax :GetLocale()
  844. Notes :None
  845. ------------------------------------------------------------------------*/
  846. _TCHAR* CGlobalSwitches::GetLocale()
  847. {
  848. return m_pszLocale;
  849. }
  850. /*------------------------------------------------------------------------
  851. Name :GetNodesList
  852. Synopsis :This function Returns the vector held in m_cvNodesList
  853. Type :Member Function
  854. Input parameter :None
  855. Output parameters :None
  856. Return Type :CHARVECTOR&
  857. Global Variables :None
  858. Calling Syntax :GetNodesList()
  859. Notes :None
  860. ------------------------------------------------------------------------*/
  861. CHARVECTOR& CGlobalSwitches::GetNodesList()
  862. {
  863. return m_cvNodesList;
  864. }
  865. /*------------------------------------------------------------------------
  866. Name :GetUser
  867. Synopsis :This function Returns the string held in m_pszUser.
  868. Type :Member Function
  869. Input parameter :None
  870. Output parameters :None
  871. Return Type :_TCHAR*
  872. Global Variables :None
  873. Calling Syntax :GetUser()
  874. Notes :None
  875. ------------------------------------------------------------------------*/
  876. _TCHAR* CGlobalSwitches::GetUser()
  877. {
  878. return m_pszUser;
  879. }
  880. /*------------------------------------------------------------------------
  881. Name :GetPassword
  882. Synopsis :This function Returns the string held in m_pszPassword
  883. Type :Member Function
  884. Input parameters :None
  885. Output parameters :None
  886. Return Type :_TCHAR*
  887. Global Variables :None
  888. Calling Syntax :GetPassword()
  889. Notes :None
  890. ------------------------------------------------------------------------*/
  891. _TCHAR* CGlobalSwitches::GetPassword()
  892. {
  893. return m_pszPassword;
  894. }
  895. /*------------------------------------------------------------------------
  896. Name :GetAuthorityPrinciple
  897. Synopsis :This function Returns the string held in
  898. m_pszAuthorityPrinciple
  899. Type :Member Function
  900. Input parameters :None
  901. Output parameters :None
  902. Return Type :_TCHAR*
  903. Global Variables :None
  904. Calling Syntax :GetAuthorityPrinciple()
  905. Notes :None
  906. ------------------------------------------------------------------------*/
  907. _TCHAR* CGlobalSwitches::GetAuthorityPrinciple()
  908. {
  909. return m_pszAuthorityPrinciple;
  910. }
  911. /*------------------------------------------------------------------------
  912. Name :GetRecordPath
  913. Synopsis :This function Returns the string held in m_pszRecordPath
  914. Type :Member Function
  915. Input parameter :None
  916. Output parameters :None
  917. Return Type :_TCHAR*
  918. Global Variables :None
  919. Calling Syntax :GetRecordPath()
  920. Notes :None
  921. ------------------------------------------------------------------------*/
  922. _TCHAR* CGlobalSwitches::GetRecordPath()
  923. {
  924. return m_pszRecordPath;
  925. }
  926. /*------------------------------------------------------------------------
  927. Name :GetPrivileges
  928. Synopsis :This function Returns BOOL value held in m_bPrivileges
  929. Type :Member Function
  930. Input parameter :None
  931. Output parameters :None
  932. Return Type :BOOL
  933. Global Variables :None
  934. Calling Syntax :GetPrivileges()
  935. Notes :None
  936. ------------------------------------------------------------------------*/
  937. BOOL CGlobalSwitches::GetPrivileges()
  938. {
  939. return m_bPrivileges;
  940. }
  941. /*------------------------------------------------------------------------
  942. Name :GetImpersonationLevel
  943. Synopsis :This function Returns impersonation level held
  944. in m_ImpLevel
  945. Type :Member Function
  946. Input parameter :None
  947. Output parameters :None
  948. Return Type :LONG
  949. Global Variables :None
  950. Calling Syntax :GetImpersonationLevel()
  951. Notes :None
  952. ------------------------------------------------------------------------*/
  953. LONG CGlobalSwitches::GetImpersonationLevel()
  954. {
  955. return m_ImpLevel;
  956. }
  957. /*------------------------------------------------------------------------
  958. Name :GetAuthenticationLevel
  959. Synopsis :This function Returns authentication level held in
  960. m_AuthLevel
  961. Type :Member Function
  962. Input parameter :None
  963. Output parameters :None
  964. Return Type :LONG
  965. Global Variables :None
  966. Calling Syntax :GetAuthenticationLevel()
  967. Notes :None
  968. ------------------------------------------------------------------------*/
  969. LONG CGlobalSwitches::GetAuthenticationLevel()
  970. {
  971. return m_AuthLevel;
  972. }
  973. /*------------------------------------------------------------------------
  974. Name :GetTraceStatus
  975. Synopsis :This function Returns trace status held in m_bTrace
  976. Type :Member Function
  977. Input parameter :None
  978. Output parameters :None
  979. Return Type :BOOL
  980. Global Variables :None
  981. Calling Syntax :GetTraceStatus()
  982. Notes :None
  983. ------------------------------------------------------------------------*/
  984. BOOL CGlobalSwitches::GetTraceStatus()
  985. {
  986. return m_bTrace;
  987. }
  988. /*------------------------------------------------------------------------
  989. Name :GetInteractiveStatus
  990. Synopsis :This function Returns interactive status held
  991. in m_bInteractive
  992. Type :Member Function
  993. Input parameter :None
  994. Output parameters :None
  995. Return Type :BOOL
  996. Global Variables :None
  997. Calling Syntax :GetInteractiveStatus()
  998. Notes :None
  999. ------------------------------------------------------------------------*/
  1000. BOOL CGlobalSwitches::GetInteractiveStatus()
  1001. {
  1002. return m_bInteractive;
  1003. }
  1004. /*------------------------------------------------------------------------
  1005. Name :GetHelpFlag
  1006. Synopsis :This function Returns help flag held in m_bHelp
  1007. Type :Member Function
  1008. Input parameter :None
  1009. Output parameters :None
  1010. Return Type :BOOL
  1011. Global Variables :None
  1012. Calling Syntax :GetHelpFlag()
  1013. Notes :None
  1014. ------------------------------------------------------------------------*/
  1015. BOOL CGlobalSwitches::GetHelpFlag()
  1016. {
  1017. return m_bHelp;
  1018. }
  1019. /*------------------------------------------------------------------------
  1020. Name :GetHelpOption
  1021. Synopsis :This function Returns help option held in m_bHelpOption
  1022. Type :Member Function
  1023. Input parameter :None
  1024. Output parameters :None
  1025. Return Type :HELPOPTION
  1026. Global Variables :None
  1027. Calling Syntax :GetHelpOption()
  1028. Notes :None
  1029. ------------------------------------------------------------------------*/
  1030. HELPOPTION CGlobalSwitches::GetHelpOption()
  1031. {
  1032. return m_HelpOption;
  1033. }
  1034. /*------------------------------------------------------------------------
  1035. Name :GetRoleFlag
  1036. Synopsis :This function returns the role flag value
  1037. Type :Member Function
  1038. Input parameter :None
  1039. Output parameters :None
  1040. Return Type :BOOL
  1041. True - /role changed recently.
  1042. False - no change in role till last command
  1043. Global Variables :None
  1044. Calling Syntax :GetRoleFlag()
  1045. Notes :None
  1046. ------------------------------------------------------------------------*/
  1047. BOOL CGlobalSwitches::GetRoleFlag()
  1048. {
  1049. return m_bRoleFlag;
  1050. }
  1051. /*-------------------------------------------------------------------------
  1052. Name :SetNameSpaceFlag
  1053. Synopsis :This function sets the NameSpace flag value
  1054. Type :Member Function
  1055. Input parameter :BOOL bNSFlag
  1056. Output parameters :None
  1057. Return Type :None
  1058. Global Variables :None
  1059. Calling Syntax :SetNameSpaceFlag(bNSFlag)
  1060. Notes :None
  1061. -------------------------------------------------------------------------*/
  1062. void CGlobalSwitches::SetNameSpaceFlag(BOOL bNSFlag)
  1063. {
  1064. m_bNSFlag = bNSFlag;
  1065. }
  1066. /*-------------------------------------------------------------------------
  1067. Name :SetRoleFlag
  1068. Synopsis :This function sets the Role flag value
  1069. Type :Member Function
  1070. Input parameter :BOOL bRoleFlag
  1071. Output parameters :None
  1072. Return Type :None
  1073. Global Variables :None
  1074. Calling Syntax :SetRoleFlag(bRoleFlag)
  1075. Notes :None
  1076. -------------------------------------------------------------------------*/
  1077. void CGlobalSwitches::SetRoleFlag(BOOL bRoleFlag)
  1078. {
  1079. m_bRoleFlag = bRoleFlag;
  1080. }
  1081. /*-------------------------------------------------------------------------
  1082. Name :SetLocaleFlag
  1083. Synopsis :This function sets the Locale flag value
  1084. Type :Member Function
  1085. Input parameter :BOOL bLocaleFlag
  1086. Output parameters :None
  1087. Return Type :None
  1088. Global Variables :None
  1089. Calling Syntax :SetLocaleFlag(bLocaleFlag)
  1090. Notes :None
  1091. -------------------------------------------------------------------------*/
  1092. void CGlobalSwitches::SetLocaleFlag(BOOL bLocaleFlag)
  1093. {
  1094. m_bLocaleFlag = bLocaleFlag;
  1095. }
  1096. /*------------------------------------------------------------------------
  1097. Name :GetNamespaceFlag
  1098. Synopsis :This function returns the namespace flag value
  1099. Type :Member Function
  1100. Input parameter :None
  1101. Output parameters :None
  1102. Return Type :BOOL
  1103. True - /namespace changed recently.
  1104. False - no change in namespace till last command
  1105. Global Variables :None
  1106. Calling Syntax :GetRoleFlag()
  1107. Notes :None
  1108. ------------------------------------------------------------------------*/
  1109. BOOL CGlobalSwitches::GetNameSpaceFlag()
  1110. {
  1111. return m_bNSFlag;
  1112. }
  1113. /*------------------------------------------------------------------------
  1114. Name :GetRPChangeStatus
  1115. Synopsis :This function returns the recordpath flag value
  1116. Type :Member Function
  1117. Input parameter :None
  1118. Output parameters :None
  1119. Return Type :BOOL
  1120. True - recordpath changed recently.
  1121. False - no change in recordpath till last command
  1122. Global Variables :None
  1123. Calling Syntax :GetRPChangeStatus()
  1124. Notes :None
  1125. ------------------------------------------------------------------------*/
  1126. BOOL CGlobalSwitches::GetRPChangeStatus()
  1127. {
  1128. return m_bRPChange;
  1129. }
  1130. /*-------------------------------------------------------------------------
  1131. Name :SetRPChangeStatus
  1132. Synopsis :This function sets the recordpath flag value
  1133. Type :Member Function
  1134. Input parameter :BOOL bStatus
  1135. Output parameters :None
  1136. Return Type :None
  1137. Global Variables :None
  1138. Calling Syntax :SetRPChangeStatus(bStatus)
  1139. Notes :None
  1140. -------------------------------------------------------------------------*/
  1141. void CGlobalSwitches::SetRPChangeStatus(BOOL bStatus)
  1142. {
  1143. m_bRPChange = bStatus;
  1144. }
  1145. /*------------------------------------------------------------------------
  1146. Name :GetLocaleFlag
  1147. Synopsis :This function returns the Locale flag value
  1148. Type :Member Function
  1149. Input parameter :None
  1150. Output parameters :None
  1151. Return Type :BOOL
  1152. True - /Locale changed recently.
  1153. False - no change in Locale till last command
  1154. Global Variables :None
  1155. Calling Syntax :GetLocaleFlag()
  1156. Notes :None
  1157. ------------------------------------------------------------------------*/
  1158. BOOL CGlobalSwitches::GetLocaleFlag()
  1159. {
  1160. return m_bLocaleFlag;
  1161. }
  1162. /*------------------------------------------------------------------------
  1163. Name :SetNode
  1164. Synopsis :This function Assigns the node passed in parameter
  1165. to m_pszNode
  1166. Type :Member Function
  1167. Input parameters :
  1168. pszNode -String type,contains Node option specified in the
  1169. command
  1170. Output parameters :None
  1171. Return Type :BOOL
  1172. Global Variables :None
  1173. Calling Syntax :SetNode(pszNode)
  1174. Notes :None
  1175. ------------------------------------------------------------------------*/
  1176. BOOL CGlobalSwitches::SetNode(_TCHAR* pszNode)
  1177. {
  1178. BOOL bResult = TRUE;
  1179. SAFEDELETE(m_pszNode);
  1180. if(pszNode)
  1181. {
  1182. if (!CompareTokens(pszNode, CLI_TOKEN_NULL))
  1183. {
  1184. m_pszNode = new _TCHAR [lstrlen(pszNode)+1];
  1185. if (m_pszNode)
  1186. {
  1187. lstrcpy(m_pszNode, pszNode);
  1188. m_uConnInfoFlag |= NODE;
  1189. }
  1190. else
  1191. bResult = FALSE;
  1192. }
  1193. else
  1194. // "." specifies current node
  1195. {
  1196. m_pszNode = new _TCHAR [lstrlen(m_pszNodeName)+1];
  1197. if (m_pszNode)
  1198. {
  1199. lstrcpy(m_pszNode, m_pszNodeName);
  1200. m_uConnInfoFlag &= ~NODE;
  1201. }
  1202. else
  1203. bResult = FALSE;
  1204. }
  1205. }
  1206. return bResult;
  1207. }
  1208. /*------------------------------------------------------------------------
  1209. Name :GetNode
  1210. Synopsis :This function Returns the string held in m_pszNode
  1211. Type :Member Function
  1212. Input parameter :None
  1213. Output parameters :None
  1214. Return Type :_TCHAR*
  1215. Global Variables :None
  1216. Calling Syntax :GetNode()
  1217. Notes :None
  1218. ------------------------------------------------------------------------*/
  1219. _TCHAR* CGlobalSwitches::GetNode()
  1220. {
  1221. return m_pszNode;
  1222. }
  1223. /*------------------------------------------------------------------------
  1224. Name :ClearNodesList
  1225. Synopsis :Clears the nodes list
  1226. Type :Member Function
  1227. Input parameter :None
  1228. Output parameters :None
  1229. Return Type :BOOL
  1230. Global Variables :None
  1231. Calling Syntax :ClearNodesList()
  1232. Notes :None
  1233. ------------------------------------------------------------------------*/
  1234. BOOL CGlobalSwitches::ClearNodesList()
  1235. {
  1236. BOOL bRet = TRUE;
  1237. CleanUpCharVector(m_cvNodesList);
  1238. if (!AddToNodesList(CLI_TOKEN_NULL))
  1239. bRet = FALSE;
  1240. return bRet;
  1241. }
  1242. /*------------------------------------------------------------------------
  1243. Name :SetAskForPassFlag
  1244. Synopsis :This function sets the askforpassword flag
  1245. Type :Member Function
  1246. Input parameter :bFlag
  1247. Output parameters :None
  1248. Return Type :BOOL
  1249. Global Variables :None
  1250. Calling Syntax :SetAskForPassFlag(bFlag)
  1251. Notes :None
  1252. ------------------------------------------------------------------------*/
  1253. void CGlobalSwitches::SetAskForPassFlag(BOOL bFlag)
  1254. {
  1255. m_bAskForPassFlag = bFlag;
  1256. }
  1257. /*------------------------------------------------------------------------
  1258. Name :GetAskForPassFlag
  1259. Synopsis :This function checks and returns TRUE if the user
  1260. has to be prompted for the password
  1261. Type :Member Function
  1262. Input parameter :None
  1263. Output parameters :None
  1264. Return Type :BOOL
  1265. Global Variables :None
  1266. Calling Syntax :GetAskForPassFlag()
  1267. Notes :None
  1268. ------------------------------------------------------------------------*/
  1269. BOOL CGlobalSwitches::GetAskForPassFlag()
  1270. {
  1271. return m_bAskForPassFlag;
  1272. }
  1273. /*------------------------------------------------------------------------
  1274. Name :GetGetPrivilegesTextDesc
  1275. Synopsis :This function checks and Returns the string
  1276. equivalent of the boolean value contained in
  1277. m_bPrivilges flag
  1278. Type :Member Function
  1279. Input parameter :None
  1280. Output parameters :
  1281. bstrPriv - privileges status string
  1282. Return Type :None
  1283. Global Variables :None
  1284. Calling Syntax :GetPrivilegesTextDesc()
  1285. Notes :None
  1286. ------------------------------------------------------------------------*/
  1287. void CGlobalSwitches::GetPrivilegesTextDesc(_bstr_t& bstrPriv)
  1288. {
  1289. try
  1290. {
  1291. if (m_bPrivileges)
  1292. bstrPriv = _bstr_t(CLI_TOKEN_ENABLE);
  1293. else
  1294. bstrPriv = _bstr_t(CLI_TOKEN_DISABLE);
  1295. }
  1296. catch(_com_error& e)
  1297. {
  1298. _com_issue_error(e.Error());
  1299. }
  1300. }
  1301. /*------------------------------------------------------------------------
  1302. Name :GetTraceTextDesc
  1303. Synopsis :This function checks and Returns the string
  1304. equivalent of the boolean value contained in
  1305. m_bTrace flag
  1306. Type :Member Function
  1307. Input parameter :None
  1308. Output parameters :
  1309. bstrTrace - trace status string
  1310. Return Type :None
  1311. Global Variables :None
  1312. Calling Syntax :GetTraceTextDesc(bstrTrace)
  1313. Notes :None
  1314. ------------------------------------------------------------------------*/
  1315. void CGlobalSwitches::GetTraceTextDesc(_bstr_t& bstrTrace)
  1316. {
  1317. try
  1318. {
  1319. if (m_bTrace)
  1320. bstrTrace = CLI_TOKEN_ON;
  1321. else
  1322. bstrTrace = CLI_TOKEN_OFF;
  1323. }
  1324. catch(_com_error& e)
  1325. {
  1326. _com_issue_error(e.Error());
  1327. }
  1328. }
  1329. /*------------------------------------------------------------------------
  1330. Name :GetInteractiveTextDesc
  1331. Synopsis :This function checks and Returns the string
  1332. equivalent of the boolean value contained in
  1333. m_bInteractive flag
  1334. Type :Member Function
  1335. Input parameter :None
  1336. Output parameters :
  1337. bstrInteractive - interactive status string
  1338. Return Type :void
  1339. Global Variables :None
  1340. Calling Syntax :GetInteractiveTextDesc(bstrInteractive)
  1341. Notes :None
  1342. ------------------------------------------------------------------------*/
  1343. void CGlobalSwitches::GetInteractiveTextDesc(_bstr_t& bstrInteractive)
  1344. {
  1345. try
  1346. {
  1347. if (m_bInteractive)
  1348. bstrInteractive = CLI_TOKEN_ON;
  1349. else
  1350. bstrInteractive = CLI_TOKEN_OFF;
  1351. }
  1352. catch(_com_error& e)
  1353. {
  1354. _com_issue_error(e.Error());
  1355. }
  1356. }
  1357. /*------------------------------------------------------------------------
  1358. Name :GetFailFastTextDesc
  1359. Synopsis :Return the string equivalent of the boolean value
  1360. contained in m_bFailFast flag.
  1361. Type :Member Function
  1362. Input parameter :None
  1363. Output parameters :
  1364. bstrFailFast - FailFast status string
  1365. Return Type :void
  1366. Global Variables :None
  1367. Calling Syntax :GetFailFastTextDesc(bstrFailFast)
  1368. Notes :None
  1369. ------------------------------------------------------------------------*/
  1370. void CGlobalSwitches::GetFailFastTextDesc(_bstr_t& bstrFailFast)
  1371. {
  1372. try
  1373. {
  1374. if (m_bFailFast)
  1375. bstrFailFast = CLI_TOKEN_ON;
  1376. else
  1377. bstrFailFast = CLI_TOKEN_OFF;
  1378. }
  1379. catch(_com_error& e)
  1380. {
  1381. _com_issue_error(e.Error());
  1382. }
  1383. }
  1384. /*------------------------------------------------------------------------
  1385. Name :GetImpLevelTextDesc
  1386. Synopsis :This function checks and Returns the string
  1387. equivalent of the boolean value contained in
  1388. m_ImpLevel flag
  1389. Type :Member Function
  1390. Input parameter :None
  1391. Output parameters :
  1392. bstrImpLevel - impersonation level description
  1393. Return Type :None
  1394. Global Variables :None
  1395. Calling Syntax :GetImpLevelTextDesc(bstrImpLevel)
  1396. Notes :None
  1397. ------------------------------------------------------------------------*/
  1398. void CGlobalSwitches::GetImpLevelTextDesc(_bstr_t& bstrImpLevel)
  1399. {
  1400. try
  1401. {
  1402. switch(m_ImpLevel)
  1403. {
  1404. case 1:
  1405. bstrImpLevel = L"ANONYMOUS";
  1406. break;
  1407. case 2:
  1408. bstrImpLevel = L"IDENTIFY";
  1409. break;
  1410. case 3:
  1411. bstrImpLevel = L"IMPERSONATE";
  1412. break;
  1413. case 4:
  1414. bstrImpLevel = L"DELEGATE";
  1415. break;
  1416. default:
  1417. bstrImpLevel = TOKEN_NA;
  1418. break;
  1419. }
  1420. }
  1421. catch(_com_error& e)
  1422. {
  1423. _com_issue_error(e.Error());
  1424. }
  1425. }
  1426. /*------------------------------------------------------------------------
  1427. Name :GetAuthLevelTextDesc
  1428. Synopsis :This function checks and Returns the string
  1429. equivalent of the boolean value contained in
  1430. m_AuthLevel flag
  1431. Type :Member Function
  1432. Input parameter :None
  1433. Output parameters :
  1434. bstrAuthLevel - authentication level description
  1435. Return Type :None
  1436. Global Variables :None
  1437. Calling Syntax :GetAuthLevelTextDesc(bstrAuthLevel)
  1438. Notes :None
  1439. ------------------------------------------------------------------------*/
  1440. void CGlobalSwitches::GetAuthLevelTextDesc(_bstr_t& bstrAuthLevel)
  1441. {
  1442. try
  1443. {
  1444. switch(m_AuthLevel)
  1445. {
  1446. case 0:
  1447. bstrAuthLevel = L"DEFAULT";
  1448. break;
  1449. case 1:
  1450. bstrAuthLevel = L"NONE";
  1451. break;
  1452. case 2:
  1453. bstrAuthLevel = L"CONNECT";
  1454. break;
  1455. case 3:
  1456. bstrAuthLevel = L"CALL";
  1457. break;
  1458. case 4:
  1459. bstrAuthLevel = L"PKT";
  1460. break;
  1461. case 5:
  1462. bstrAuthLevel = L"PKTINTEGRITY";
  1463. break;
  1464. case 6:
  1465. bstrAuthLevel = L"PKTPRIVACY";
  1466. break;
  1467. default:
  1468. bstrAuthLevel = TOKEN_NA;
  1469. break;
  1470. }
  1471. }
  1472. catch(_com_error& e)
  1473. {
  1474. _com_issue_error(e.Error());
  1475. }
  1476. }
  1477. /*------------------------------------------------------------------------
  1478. Name :GetNodeString
  1479. Synopsis :This function Returns the ',' separated node
  1480. string of the available nodes
  1481. Type :Member Function
  1482. Input parameter :None
  1483. Output parameters :
  1484. bstrNString - node string (comma separated)
  1485. Return Type :void
  1486. Global Variables :None
  1487. Calling Syntax :GetNodeString(bstrNSString)
  1488. Notes :None
  1489. ------------------------------------------------------------------------*/
  1490. void CGlobalSwitches::GetNodeString(_bstr_t& bstrNString)
  1491. {
  1492. try
  1493. {
  1494. CHARVECTOR::iterator theIterator;
  1495. if (m_cvNodesList.size() > 1)
  1496. {
  1497. theIterator = m_cvNodesList.begin();
  1498. // Move to next node
  1499. theIterator++;
  1500. while (theIterator != m_cvNodesList.end())
  1501. {
  1502. bstrNString += *theIterator;
  1503. theIterator++;
  1504. if (theIterator != m_cvNodesList.end())
  1505. bstrNString += L", ";
  1506. }
  1507. }
  1508. else
  1509. {
  1510. bstrNString = m_pszNode;
  1511. }
  1512. }
  1513. catch(_com_error& e)
  1514. {
  1515. _com_issue_error(e.Error());
  1516. }
  1517. }
  1518. /*------------------------------------------------------------------------
  1519. Name :GetRecordPathDesc
  1520. Synopsis :This function checks and Returns the string
  1521. equivalent of the boolean value contained in
  1522. m_pszRecordPath flag
  1523. Type :Member Function
  1524. Input parameter :None
  1525. Output parameters :
  1526. bstrRPDesc - record path description
  1527. Return Type :void
  1528. Global Variables :None
  1529. Calling Syntax :GetRecordPathDesc(bstrRPDesc)
  1530. Notes :None
  1531. ------------------------------------------------------------------------*/
  1532. void CGlobalSwitches::GetRecordPathDesc(_bstr_t& bstrRPDesc)
  1533. {
  1534. try
  1535. {
  1536. if (m_pszRecordPath)
  1537. {
  1538. bstrRPDesc = m_pszRecordPath;
  1539. }
  1540. else
  1541. bstrRPDesc = TOKEN_NA;
  1542. }
  1543. catch(_com_error& e)
  1544. {
  1545. _com_issue_error(e.Error());
  1546. }
  1547. }
  1548. /*------------------------------------------------------------------------
  1549. Name :SetFailFast
  1550. Synopsis :This function sets the m_bFailFast flag.
  1551. Type :Member Function
  1552. Input parameter :
  1553. bFlag - Boolean variable to set flag.
  1554. Output parameters :None
  1555. Return Type :void
  1556. Global Variables :None
  1557. Calling Syntax :SetFailFast(bFlag)
  1558. Notes :None
  1559. ------------------------------------------------------------------------*/
  1560. void CGlobalSwitches::SetFailFast(BOOL bFlag)
  1561. {
  1562. m_bFailFast = bFlag;
  1563. }
  1564. /*------------------------------------------------------------------------
  1565. Name :GetFailFast
  1566. Synopsis :This function returns the m_bFailFast flag.
  1567. Type :Member Function
  1568. Input parameter :None
  1569. Output parameters :None
  1570. Return Type :BOOL
  1571. Global Variables :None
  1572. Calling Syntax :GetFailFast()
  1573. Notes :None
  1574. ------------------------------------------------------------------------*/
  1575. BOOL CGlobalSwitches::GetFailFast()
  1576. {
  1577. return m_bFailFast;
  1578. }
  1579. /*------------------------------------------------------------------------
  1580. Name :SetFileType
  1581. Synopsis :This function sets the type of file it appends to
  1582. Type :Member Function
  1583. Input parameter :aftOpt - type
  1584. Output parameters :None
  1585. Return Type :void
  1586. Global Variables :None
  1587. Calling Syntax :SetAppendFileType(aftOpt)
  1588. Notes :None
  1589. ------------------------------------------------------------------------*/
  1590. void CGlobalSwitches::SetFileType ( FILETYPE eftOpt )
  1591. {
  1592. m_eftFileType = eftOpt ;
  1593. }
  1594. /*------------------------------------------------------------------------
  1595. Name :GetFileType
  1596. Synopsis :This function returns the append option.
  1597. Type :Member Function
  1598. Input parameter :None
  1599. Output parameters :None
  1600. Return Type :FILETYPE
  1601. Global Variables :None
  1602. Calling Syntax :GetAppendFileType()
  1603. Notes :None
  1604. ------------------------------------------------------------------------*/
  1605. FILETYPE CGlobalSwitches::GetFileType ( )
  1606. {
  1607. return m_eftFileType ;
  1608. }
  1609. /*------------------------------------------------------------------------
  1610. Name :SetOutputOption
  1611. Synopsis :This function sets the ouput option.
  1612. Type :Member Function
  1613. Input parameter :opoOutputOpt - Specifies the ouput option.
  1614. Output parameters :None
  1615. Return Type :void
  1616. Global Variables :None
  1617. Calling Syntax :SetOutputOption(opoOutputOpt)
  1618. Notes :None
  1619. ------------------------------------------------------------------------*/
  1620. void CGlobalSwitches::SetOutputOrAppendOption(OUTPUTSPEC opsOpt,
  1621. BOOL bIsOutput)
  1622. {
  1623. if ( bIsOutput == TRUE )
  1624. m_opsOutputOpt = opsOpt;
  1625. else
  1626. m_opsAppendOpt = opsOpt;
  1627. }
  1628. /*------------------------------------------------------------------------
  1629. Name :GetOutputOption
  1630. Synopsis :This function returns the ouput option.
  1631. Type :Member Function
  1632. Input parameter :None
  1633. Output parameters :None
  1634. Return Type :OUTPUTOPT
  1635. Global Variables :None
  1636. Calling Syntax :GetOutputOption()
  1637. Notes :None
  1638. ------------------------------------------------------------------------*/
  1639. OUTPUTSPEC CGlobalSwitches::GetOutputOrAppendOption(BOOL bIsOutput)
  1640. {
  1641. OUTPUTSPEC opsOpt;
  1642. if ( bIsOutput == TRUE )
  1643. opsOpt = m_opsOutputOpt;
  1644. else
  1645. opsOpt = m_opsAppendOpt;
  1646. return opsOpt;
  1647. }
  1648. /*------------------------------------------------------------------------
  1649. Name :SetOutputOrAppendFileName
  1650. Synopsis :This function Set Output or Append File Name,
  1651. bOutput = TRUE for Output FALSE for Append.
  1652. Type :Member Function
  1653. Input parameter :pszFileName - output or append file name
  1654. bOutput - output option
  1655. Output parameters :None
  1656. Return Type :BOOL
  1657. Global Variables :None
  1658. Calling Syntax :SetOutputOrAppendFileName(pszFileName,bOutput)
  1659. Notes :None
  1660. ------------------------------------------------------------------------*/
  1661. BOOL CGlobalSwitches::SetOutputOrAppendFileName(const _TCHAR* pszFileName,
  1662. BOOL bOutput)
  1663. {
  1664. BOOL bResult = TRUE;
  1665. if ( bOutput == TRUE )
  1666. {
  1667. SAFEDELETE(m_pszOutputFileName)
  1668. }
  1669. else
  1670. {
  1671. SAFEDELETE(m_pszAppendFileName)
  1672. }
  1673. if ( pszFileName != NULL )
  1674. {
  1675. _TCHAR* pszTempFileName;
  1676. pszTempFileName = new _TCHAR [lstrlen(pszFileName)+1];
  1677. if ( pszTempFileName == NULL )
  1678. bResult = FALSE;
  1679. else
  1680. {
  1681. if ( bOutput == TRUE )
  1682. {
  1683. m_pszOutputFileName = pszTempFileName;
  1684. lstrcpy(m_pszOutputFileName, pszFileName);
  1685. }
  1686. else
  1687. {
  1688. m_pszAppendFileName = pszTempFileName;
  1689. lstrcpy(m_pszAppendFileName, pszFileName);
  1690. }
  1691. }
  1692. }
  1693. return bResult;
  1694. }
  1695. /*------------------------------------------------------------------------
  1696. Name :GetOutputOrAppendFileName
  1697. Synopsis :This function returns the output or append file name
  1698. depending upon the output option - bOutput.
  1699. Input parameter :bOutput - output option
  1700. Output parameters :None
  1701. Return Type :_TCHAR
  1702. Global Variables :None
  1703. Calling Syntax :GetOutputOrAppendFileName(BOOL bOutput)
  1704. Notes :None
  1705. ------------------------------------------------------------------------*/
  1706. _TCHAR* CGlobalSwitches::GetOutputOrAppendFileName(BOOL bOutput)
  1707. {
  1708. _TCHAR* pszTempFile;
  1709. if ( bOutput == TRUE )
  1710. pszTempFile = m_pszOutputFileName;
  1711. else
  1712. pszTempFile = m_pszAppendFileName;
  1713. return pszTempFile;
  1714. }
  1715. /*------------------------------------------------------------------------
  1716. Name :GetOutputOptTextDesc
  1717. Synopsis :This function returns the string equivalent of the
  1718. OUTPUTOPT value contained in m_opoOutputOpt member.
  1719. Input parameter :None
  1720. Output parameters :bstrOutputOpt - string equivalent of the
  1721. OUTPUTOPT value
  1722. Return Type :void
  1723. Global Variables :None
  1724. Calling Syntax :GetOutputOptTextDesc(bstrOutputOpt)
  1725. Notes :None
  1726. ------------------------------------------------------------------------*/
  1727. void CGlobalSwitches::GetOutputOrAppendTextDesc(_bstr_t& bstrOutputOpt,
  1728. BOOL bIsOutput)
  1729. {
  1730. try
  1731. {
  1732. if ( bIsOutput == TRUE )
  1733. {
  1734. if ( m_opsOutputOpt == STDOUT )
  1735. bstrOutputOpt = CLI_TOKEN_STDOUT;
  1736. else if ( m_opsOutputOpt == CLIPBOARD )
  1737. bstrOutputOpt = CLI_TOKEN_CLIPBOARD;
  1738. else
  1739. bstrOutputOpt = _bstr_t(m_pszOutputFileName);
  1740. }
  1741. else
  1742. {
  1743. if ( m_opsAppendOpt == STDOUT )
  1744. bstrOutputOpt = CLI_TOKEN_STDOUT;
  1745. else if ( m_opsAppendOpt == CLIPBOARD )
  1746. bstrOutputOpt = CLI_TOKEN_CLIPBOARD;
  1747. else
  1748. bstrOutputOpt = _bstr_t(m_pszAppendFileName);
  1749. }
  1750. }
  1751. catch(_com_error& e)
  1752. {
  1753. _com_issue_error(e.Error());
  1754. }
  1755. }
  1756. /*------------------------------------------------------------------------
  1757. Name :SetOutputOrAppendFilePointer
  1758. Synopsis :This function Sets output or append file pointer,
  1759. bOutput == TRUE for Output
  1760. bOutput == FALSE or Append.
  1761. Input parameter :fpFile - pointer to output or append
  1762. bOutput - ouput option
  1763. Output parameters :None
  1764. Return Type :void
  1765. Global Variables :None
  1766. Calling Syntax :SetOutputOrAppendFilePointer(fpFile, bOutput)
  1767. Notes :None
  1768. ------------------------------------------------------------------------*/
  1769. void CGlobalSwitches::SetOutputOrAppendFilePointer(FILE* fpFile, BOOL bOutput)
  1770. {
  1771. if ( bOutput == TRUE )
  1772. m_fpOutFile = fpFile;
  1773. else
  1774. m_fpAppendFile = fpFile;
  1775. }
  1776. /*------------------------------------------------------------------------
  1777. Name :GetOutputOrAppendFilePointer
  1778. Synopsis :This function returns the ouput or append file pointer.
  1779. bOutput == TRUE for Output
  1780. bOutput == FALSE or Append.
  1781. Input parameter :bOutput - ouput option
  1782. Output parameters :None
  1783. Return Type :FILE*
  1784. Global Variables :None
  1785. Calling Syntax :GetOutputOrAppendFilePointer(bOutput)
  1786. Notes :None
  1787. ------------------------------------------------------------------------*/
  1788. FILE* CGlobalSwitches::GetOutputOrAppendFilePointer(BOOL bOutput)
  1789. {
  1790. FILE* fpTemp;
  1791. if ( bOutput == TRUE )
  1792. fpTemp = m_fpOutFile;
  1793. else
  1794. fpTemp = m_fpAppendFile;
  1795. return fpTemp;
  1796. }
  1797. /*------------------------------------------------------------------------
  1798. Name :GetSequenceNumber
  1799. Synopsis :This function returns the sequence number of the command
  1800. logged .
  1801. Input parameter :None
  1802. Output parameters :None
  1803. Return Type :WMICLIINT
  1804. Global Variables :None
  1805. Calling Syntax :GetSequenceNumber()
  1806. Notes :None
  1807. ------------------------------------------------------------------------*/
  1808. WMICLIINT CGlobalSwitches::GetSequenceNumber()
  1809. {
  1810. return m_nSeqNum;
  1811. }
  1812. /*------------------------------------------------------------------------
  1813. Name :GetLoggedonUser
  1814. Synopsis :This function returns the current logged on user.
  1815. Input parameter :None
  1816. Output parameters :None
  1817. Return Type :_TCHAR*
  1818. Global Variables :None
  1819. Calling Syntax :GetLoggedonUser()
  1820. Notes :None
  1821. ------------------------------------------------------------------------*/
  1822. _TCHAR* CGlobalSwitches::GetLoggedonUser()
  1823. {
  1824. return m_pszLoggedOnUser;
  1825. }
  1826. /*------------------------------------------------------------------------
  1827. Name :GetMgmtStationName
  1828. Synopsis :This function returns the management station that
  1829. issued the command.
  1830. Input parameter :None
  1831. Output parameters :None
  1832. Return Type :_TCHAR*
  1833. Global Variables :None
  1834. Calling Syntax :GetMgmtStationName()
  1835. Notes :None
  1836. ------------------------------------------------------------------------*/
  1837. _TCHAR* CGlobalSwitches::GetMgmtStationName()
  1838. {
  1839. return m_pszNodeName;
  1840. }
  1841. /*------------------------------------------------------------------------
  1842. Name :GetStartTime
  1843. Synopsis :This function returns the time at which the command
  1844. execution started.
  1845. Input parameter :None
  1846. Output parameters :None
  1847. Return Type :_TCHAR*
  1848. Global Variables :None
  1849. Calling Syntax :GetStartTime()
  1850. Notes :None
  1851. ------------------------------------------------------------------------*/
  1852. _TCHAR* CGlobalSwitches::GetStartTime()
  1853. {
  1854. return m_pszStartTime;
  1855. }
  1856. /*------------------------------------------------------------------------
  1857. Name :SetStartTime
  1858. Synopsis :This function sets the time at which the command
  1859. execution started.
  1860. Input parameter :None
  1861. Output parameters :None
  1862. Return Type :BOOL
  1863. Global Variables :None
  1864. Calling Syntax :SetStartTime()
  1865. Notes :None
  1866. ------------------------------------------------------------------------*/
  1867. BOOL CGlobalSwitches::SetStartTime()
  1868. {
  1869. BOOL bResult = TRUE;
  1870. if (m_pszStartTime == NULL)
  1871. {
  1872. m_pszStartTime = new _TCHAR[BUFFER64];
  1873. }
  1874. if (m_pszStartTime)
  1875. {
  1876. SYSTEMTIME stSysTime;
  1877. GetLocalTime(&stSysTime);
  1878. _stprintf(m_pszStartTime, L"%.2d-%.2d-%.4dT%.2d:%.2d:%.2d",
  1879. stSysTime.wMonth, stSysTime.wDay, stSysTime.wYear,
  1880. stSysTime.wHour, stSysTime.wMinute, stSysTime.wSecond);
  1881. // Increment the command counter.
  1882. m_nSeqNum++;
  1883. }
  1884. else
  1885. bResult = FALSE;
  1886. return bResult;
  1887. }
  1888. /*------------------------------------------------------------------------
  1889. Name :SetAggregateFlag
  1890. Synopsis :This function sets the Aggregation flag
  1891. Type :Member Function
  1892. Input parameter :None
  1893. Output parameters :None
  1894. Return Type :void
  1895. Global Variables :None
  1896. Calling Syntax :SetAggregateFlag(BOOL)
  1897. Notes :None
  1898. ------------------------------------------------------------------------*/
  1899. void CGlobalSwitches::SetAggregateFlag(BOOL bAggregateFlag)
  1900. {
  1901. m_bAggregateFlag = bAggregateFlag;
  1902. }
  1903. /*------------------------------------------------------------------------
  1904. Name :GetAggreagateFlag
  1905. Synopsis :This function gets the Aggregation flag
  1906. Type :Member Function
  1907. Input parameter :None
  1908. Output parameters :None
  1909. Return Type :BOOL
  1910. Global Variables :None
  1911. Calling Syntax :GetAggregateFlag()
  1912. Notes :None
  1913. ------------------------------------------------------------------------*/
  1914. BOOL CGlobalSwitches::GetAggregateFlag()
  1915. {
  1916. return m_bAggregateFlag;
  1917. }
  1918. /*------------------------------------------------------------------------
  1919. Name :GetAggregateTextDesc
  1920. Synopsis :This function checks and Returns the string
  1921. equivalent of the boolean value contained in
  1922. m_bAggregateFlag flag
  1923. Type :Member Function
  1924. Input parameter :None
  1925. Output parameters :
  1926. bstrAggregate - aggreaget status string
  1927. Return Type :None
  1928. Global Variables :None
  1929. Calling Syntax :GetAggregateTextDesc(bstrAggregate)
  1930. Notes :None
  1931. ------------------------------------------------------------------------*/
  1932. void CGlobalSwitches::GetAggregateTextDesc(_bstr_t& bstrAggregate)
  1933. {
  1934. try
  1935. {
  1936. if (m_bAggregateFlag)
  1937. bstrAggregate = CLI_TOKEN_ON;
  1938. else
  1939. bstrAggregate = CLI_TOKEN_OFF;
  1940. }
  1941. catch(_com_error& e)
  1942. {
  1943. _com_issue_error(e.Error());
  1944. }
  1945. }