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.

139 lines
4.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998 - 1998.
  5. //
  6. // File: bothchar.hxx
  7. //
  8. // Contents: Header file for doubly compiled functions
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 27-Sep-99 PhilipLa Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __BOTHCHAR_HXX__
  18. #define __BOTHCHAR_HXX__
  19. #include <tchar.h>
  20. //---------------------------------------------------------------
  21. // Typedefs.
  22. typedef enum
  23. {
  24. force_fa = 0x1,
  25. suppress_fa = 0x2,
  26. function_fa = 0x4,
  27. recursive_fa = 0x8,
  28. rename_leaf_fa = 0x10,
  29. rename_path_fa = 0x20,
  30. rename_value_fa = 0x40,
  31. file_fa = 0x80,
  32. delete_fa = 0x100
  33. } FILTER_ACTION;
  34. typedef struct HASH_HEAD
  35. {
  36. struct HASH_HEAD *phhNext;
  37. struct HASH_HEAD *phhPrev;
  38. } HASH_HEAD;
  39. typedef DWORD (*FUNCTION_FA) (DWORD *ptype, BYTE **pdata, DWORD *pdata_len);
  40. typedef struct HASH_NODE
  41. {
  42. struct HASH_NODE *phnNext;
  43. struct HASH_NODE *phnPrev;
  44. DWORD dwHash;
  45. TCHAR *ptsRoot;
  46. TCHAR *ptsKey;
  47. TCHAR *ptsValue;
  48. DWORD dwAction;
  49. TCHAR *ptsNewKey;
  50. TCHAR *ptsNewValue;
  51. TCHAR *ptsFunction;
  52. TCHAR *ptsFileDest;
  53. } HASH_NODE;
  54. typedef struct FUNCTION_FA_MAP
  55. {
  56. TCHAR *ptsName;
  57. FUNCTION_FA pfunction;
  58. } FUNCTION_FA_MAP;
  59. //---------------------------------------------------------------
  60. // Constants.
  61. const TCHAR SOURCE_SECTION[] = TEXT("Source Machine");
  62. const TCHAR VERSION[] = TEXT("version");
  63. const TCHAR LOCALE[] = TEXT("locale");
  64. const TCHAR INPUTLOCALE[] = TEXT("inputlocale");
  65. const TCHAR USERLOCALE[] = TEXT("userlocale");
  66. const TCHAR TIMEZONE[] = TEXT("timezone");
  67. const TCHAR FULLNAME[] = TEXT("fullname");
  68. const TCHAR ORGNAME[] = TEXT("orgname");
  69. const TCHAR BUILDKEY[] = TEXT("builduser");
  70. const TCHAR SCAN_USER[] = TEXT("ScanUser");
  71. const TCHAR USERS_SECTION[] = TEXT("Users");
  72. const TCHAR EXTENSION_SECTION[] = TEXT("Copy This State");
  73. const TCHAR EXECUTABLE_EXT_SECTION[] = TEXT("Run These Commands");
  74. const TCHAR EXECUTABLE_EXTOUT_SECTION[] = TEXT("Run These Commands Output");
  75. const TCHAR EXTENSION_STATE_SECTION[] = TEXT("Copied This State");
  76. const TCHAR EXTENSION_ADDREG_SECTION[] = TEXT("Copied AddReg Rules");
  77. const TCHAR EXTENSION_RENREG_SECTION[] = TEXT("Copied RenReg Rules");
  78. const TCHAR EXTENSION_REGFILE_SECTION[] = TEXT("Copied RegFile Rules");
  79. const TCHAR EXTENSION_DELREG_SECTION[] = TEXT("Copied DelReg Rules");
  80. const TCHAR COPYFILE_SECTION[] = TEXT("Copy These Files");
  81. const TCHAR SPECIALDIRS_SECTION[] = TEXT("SourceSpecialDirectories");
  82. const TCHAR DESTINATIONDIRS_SECTION[] = TEXT("DestinationDirs");
  83. const TCHAR DIRECTORYMAPPING_SECTION[] = TEXT("DirectoryMapping");
  84. const TCHAR ADDREG_LABEL[] = TEXT("addreg");
  85. const TCHAR RENREG_LABEL[] = TEXT("renreg");
  86. const TCHAR REGFILE_LABEL[] = TEXT("regfile");
  87. const TCHAR REGPATH_LABEL[] = TEXT("regpath");
  88. const TCHAR DELREG_LABEL[] = TEXT("delreg");
  89. const TCHAR COPYFILES_LABEL[] = TEXT("copyfiles");
  90. const TCHAR DELFILES_LABEL[] = TEXT("delfiles");
  91. const TCHAR SYSFILES_LABEL[] = TEXT("System Files");
  92. //---------------------------------------------------------------
  93. // Classes.
  94. class CStringList
  95. {
  96. public:
  97. void Add( CStringList * pslMore);
  98. CStringList *Next() { return _pslNext; }
  99. TCHAR *String() { return _ptsString; }
  100. CStringList( DWORD dwLen );
  101. ~CStringList();
  102. private:
  103. BOOL _fHead;
  104. TCHAR *_ptsString;
  105. CStringList *_pslNext;
  106. };
  107. //Global variables
  108. extern TCHAR *DomainName;
  109. extern TCHAR *UserPath;
  110. extern TCHAR *UserName;
  111. extern TCHAR *InfArgList;
  112. #endif // #ifndef __BOTHCHAR_HXX__
  113. // Utilities.
  114. void MakeCommandLine(CStringList* h, CStringList* command, TCHAR* commandLine);
  115. //---------------------------------------------------------------
  116. // Prototypes
  117. DWORD WriteKey ( HANDLE outfile, DWORD type, TCHAR *rootname, TCHAR *key, TCHAR *value_name,
  118. UCHAR *data, DWORD data_len );
  119. DWORD LogReadRule( HASH_NODE *phnNode );
  120. DWORD ParseParams( int argc, char *argv[], BOOL scan, TCHAR *logfile );