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.

93 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1996, Microsoft Corporation.
  4. //
  5. // File: ida.hxx
  6. //
  7. // Contents: Parser for an IDA file
  8. //
  9. // History: 13-Apr-96 KyleP Created
  10. //
  11. //----------------------------------------------------------------------------
  12. #pragma once
  13. class CVariableSet;
  14. class COutputFormat;
  15. WCHAR const wcsOpGetState[] = L"GetState";
  16. WCHAR const wcsOpForceMerge[] = L"ForceMerge";
  17. WCHAR const wcsOpScanRoots[] = L"ScanRoots";
  18. WCHAR const wcsOpUpdateCache[] = L"UpdateCache";
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Class: CIDAFile
  22. //
  23. // Purpose: Scans and parses an IDA file.
  24. //
  25. // History: 96/Jan/23 DwightKr Created
  26. //
  27. //----------------------------------------------------------------------------
  28. class CIDAFile
  29. {
  30. public:
  31. CIDAFile( WCHAR const * wcsFileName, UINT codePage );
  32. ~CIDAFile();
  33. void ParseFile();
  34. WCHAR const * GetIDAFileName() const { return _wcsIDAFileName; }
  35. WCHAR const * GetCatalog() const { return _wcsCatalog; }
  36. WCHAR const * GetHTXFileName() const { return _wcsHTXFileName; }
  37. enum eOperation
  38. {
  39. CiState,
  40. ForceMerge,
  41. ScanRoots,
  42. UpdateCache
  43. };
  44. eOperation Operation() const { return _eOperation; }
  45. void LokAddRef() { InterlockedIncrement(&_refCount); }
  46. void Release()
  47. {
  48. InterlockedDecrement(&_refCount);
  49. Win4Assert( _refCount >= 0 );
  50. }
  51. LONG LokGetRefCount() { return _refCount; }
  52. WCHAR const * GetLocale() const { return _wcsLocale; }
  53. private:
  54. void ParseOneLine( CQueryScanner & scan, unsigned iLine );
  55. void GetStringValue( CQueryScanner & scan, unsigned iLine, WCHAR ** pwcsStringValue );
  56. eOperation _eOperation; // Type of admin activity
  57. WCHAR * _wcsCatalog; // Location of the catalog
  58. WCHAR * _wcsHTXFileName; // The name of the template file
  59. WCHAR * _wcsLocale; // Locale specified for IDA file
  60. ULONG _cReplaceableParameters; // # of replaceable parameters
  61. LONG _refCount; // Refcount for this file
  62. UINT _codePage; // codePage for this file
  63. WCHAR _wcsIDAFileName[MAX_PATH]; // The IDQ file name
  64. };
  65. //
  66. // Global functions.
  67. //
  68. void DoAdmin( WCHAR const * wcsIDAFile,
  69. CVariableSet & VarSet,
  70. COutputFormat & OutputFormat,
  71. CVirtualString & vsResults );
  72. void CheckAdminSecurity( WCHAR const * pwszMachine );