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.

102 lines
2.8 KiB

  1. /******************************************************************************
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. ETCreate.h
  5. Abstract:
  6. This module contanins function definations required by ETCreate.cpp
  7. Author:
  8. Akhil Gokhale 03-Oct.-2000
  9. Revision History:
  10. ******************************************************************************/
  11. #ifndef _ETCREATE_H
  12. #define _ETCREATE_H
  13. #define ID_C_CREATE 0
  14. #define ID_C_SERVER 1
  15. #define ID_C_USERNAME 2
  16. #define ID_C_PASSWORD 3
  17. #define ID_C_TRIGGERNAME 4
  18. #define ID_C_LOGNAME 5
  19. #define ID_C_ID 6
  20. #define ID_C_TYPE 7
  21. #define ID_C_SOURCE 8
  22. #define ID_C_DESCRIPTION 9
  23. #define ID_C_TASK 10
  24. #define ID_C_RU 11
  25. #define ID_C_RP 12
  26. #define MAX_COMMANDLINE_C_OPTION 13 // Maximum Command Line List
  27. #define INVALID_TRIGGER_NAME_CHARACTERS L":|<>?*\\/"
  28. class CETCreate
  29. {
  30. public:
  31. CETCreate();
  32. CETCreate(LONG lMinMemoryReq,BOOL bNeedPassword);
  33. virtual ~CETCreate();
  34. public:
  35. BOOL ExecuteCreate();
  36. void ProcessOption( IN DWORD argc, IN LPCTSTR argv[]);
  37. void Initialize();
  38. private:
  39. TCHAR m_szWMIQueryString[(MAX_RES_STRING*2)+1];
  40. BOOL CheckLogName( IN PTCHAR pszLogName, IN IWbemServices *pNamespace);
  41. BOOL GetLogName( OUT PTCHAR pszLogName,
  42. IN IEnumWbemClassObject *pEnumWin32_NTEventLogFile);
  43. BOOL ConstructWMIQueryString();
  44. BOOL CreateXPResults( void );
  45. void AssignMinMemory(void);
  46. void CheckRpRu(void);
  47. void SetToLoggedOnUser(void);
  48. LPTSTR m_pszServerName;
  49. LPTSTR m_pszUserName;
  50. LPTSTR m_pszPassword;
  51. TCHAR m_szTriggerName[MAX_TRIGGER_NAME];
  52. TCHAR m_szDescription[MAX_STRING_LENGTH];
  53. TCHAR m_szType[MAX_STRING_LENGTH];
  54. TCHAR m_szSource[MAX_STRING_LENGTH];
  55. LPTSTR m_pszRunAsUserName;
  56. LPTSTR m_pszRunAsUserPassword;
  57. TARRAY m_arrLogNames;
  58. DWORD m_dwID;
  59. TCHAR m_szTaskName[MAX_TASK_NAME];
  60. BOOL m_bNeedPassword;
  61. BOOL m_bCreate;
  62. BOOL m_bLocalSystem;
  63. BOOL m_bIsCOMInitialize;
  64. BSTR bstrTemp;
  65. // WMI / COM interfaces
  66. IWbemLocator* m_pWbemLocator;
  67. IWbemServices* m_pWbemServices;
  68. IEnumWbemClassObject* m_pEnumObjects;
  69. IWbemClassObject* m_pClass;
  70. IWbemClassObject* m_pOutInst;
  71. IWbemClassObject* m_pInClass;
  72. IWbemClassObject* m_pInInst;
  73. IEnumWbemClassObject* m_pEnumWin32_NTEventLogFile;
  74. // WMI connectivity
  75. COAUTHIDENTITY* m_pAuthIdentity;
  76. void InitCOM();
  77. void PrepareCMDStruct();
  78. LONG m_lMinMemoryReq;
  79. // Array to store command line options
  80. TCMDPARSER2 cmdOptions[MAX_COMMANDLINE_C_OPTION];
  81. };
  82. #endif