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
6.5 KiB

  1. #include <windows.h>
  2. #include "resource.h"
  3. #include "cmdline.rc"
  4. #include "cmdlineres.h"
  5. #include "EvcrtMsg.rc"
  6. /////////////////////////////////////////////////////////////////////////////
  7. //
  8. // String Table
  9. //
  10. STRINGTABLE DISCARDABLE
  11. BEGIN
  12. IDS_USAGE_SYNTAX1 "\nEVENTCREATE [/S system [/U username [/P [password]]]] /ID eventid\n"
  13. IDS_USAGE_SYNTAX2 " [/L logname] [/SO srcname] /T type /D description\n"
  14. IDS_USAGE_NEWLINE1 "\n"
  15. IDS_USAGE_DESC1 "Description:\n"
  16. IDS_USAGE_DESC2 " This command line tool enables an administrator to create\n"
  17. IDS_USAGE_DESC3 " a custom event ID and message in a specified event log.\n"
  18. IDS_USAGE_NEWLINE2 "\n"
  19. IDS_USAGE_PARAMLIST "Parameter List:\n"
  20. IDS_USAGE_PARAMLIST1 " /S system Specifies the remote system to connect to.\n\n"
  21. IDS_USAGE_PARAMLIST2 " /U [domain\\]user Specifies the user context under which\n"
  22. IDS_USAGE_PARAMLIST3 " the command should execute.\n\n"
  23. IDS_USAGE_PARAMLIST4 " /P [password] Specifies the password for the given\n"
  24. IDS_USAGE_PARAMLIST5 " user context. Prompts for input if omitted.\n\n"
  25. IDS_USAGE_PARAMLIST6 " /L logname Specifies the event log to create\n"
  26. IDS_USAGE_PARAMLIST7 " an event in.\n\n"
  27. IDS_USAGE_PARAMLIST8 " /T type Specifies the type of event to create.\n"
  28. IDS_USAGE_PARAMLIST9 " Valid types: SUCCESS, ERROR, WARNING, INFORMATION.\n\n"
  29. IDS_USAGE_PARAMLIST10 " /SO source Specifies the source to use for the\n"
  30. IDS_USAGE_PARAMLIST11 " event (if not specified, source will default\n"
  31. IDS_USAGE_PARAMLIST12 " to 'eventcreate'). A valid source can be any\n"
  32. IDS_USAGE_PARAMLIST13 " string and should represent the application\n"
  33. IDS_USAGE_PARAMLIST14 " or component that is generating the event.\n\n"
  34. IDS_USAGE_PARAMLIST15 " /ID id Specifies the event ID for the event. A\n"
  35. IDS_USAGE_PARAMLIST16 " valid custom message ID is in the range\n"
  36. IDS_USAGE_PARAMLIST17 " of 1 - 1000.\n\n"
  37. IDS_USAGE_PARAMLIST18 " /D description Specifies the description text for the new event.\n\n"
  38. IDS_USAGE_PARAMLIST19 ""
  39. IDS_USAGE_PARAMLIST20 " /? Displays this help message.\n\n"
  40. IDS_USAGE_NEWLINE3 "\n"
  41. IDS_USAGE_EXAMPLES "Examples:\n"
  42. IDS_USAGE_EXAMPLE11 " EVENTCREATE /T ERROR /ID 1000\n"
  43. IDS_USAGE_EXAMPLE12 " /L APPLICATION /D ""My custom error event for the application log""\n\n"
  44. IDS_USAGE_EXAMPLE21 ""
  45. IDS_USAGE_EXAMPLE22 ""
  46. IDS_USAGE_EXAMPLE31 " EVENTCREATE /T ERROR /ID 999 /L APPLICATION\n"
  47. IDS_USAGE_EXAMPLE32 " /SO WinWord /D ""Winword event 999 happened due to low diskspace""\n\n"
  48. IDS_USAGE_EXAMPLE41 " EVENTCREATE /S system /T ERROR /ID 100\n"
  49. IDS_USAGE_EXAMPLE42 " /L APPLICATION /D ""Custom job failed to install""\n\n"
  50. IDS_USAGE_EXAMPLE51 " EVENTCREATE /S system /U user /P password /ID 1 /T ERROR\n"
  51. IDS_USAGE_EXAMPLE52 " /L APPLICATION /D ""User access failed due to invalid user credentials""\n"
  52. IDS_USAGE_EXAMPLE61 ""
  53. IDS_USAGE_EXAMPLE62 ""
  54. IDS_USAGE_EXAMPLE71 ""
  55. IDS_USAGE_EXAMPLE72 ""
  56. END
  57. STRINGTABLE DISCARDABLE
  58. BEGIN
  59. IDS_LOGTYPE_ERROR "ERROR"
  60. IDS_LOGTYPE_WARNING "WARNING"
  61. IDS_LOGTYPE_INFORMATION "INFORMATION"
  62. IDS_LOGTYPE_SUCCESS "SUCCESS"
  63. IDS_OVALUES_LOGTYPE "success|error|information|warning"
  64. END
  65. STRINGTABLE DISCARDABLE
  66. BEGIN
  67. IDS_EVENTCREATE_SUCCESS_LOG "SUCCESS: An event of type '%s' was created with '%s' as the log.\n"
  68. IDS_EVENTCREATE_SUCCESS_SOURCE "SUCCESS: An event of type '%s' was created with '%s' as the source.\n"
  69. IDS_EVENTCREATE_SUCCESS_BOTH "SUCCESS: An event of type '%s' was created in the '%s' log with '%s' as the source.\n"
  70. IDS_ERROR_USERNAME_BUT_NOMACHINE "Invalid syntax. /U can be specified only when /S is specified.\nType ""EVENTCREATE /?"" for usage.\n"
  71. IDS_ERROR_USERNAME_EMPTY "Invalid syntax. User name cannot be empty.\n"
  72. IDS_ERROR_PASSWORD_BUT_NOUSERNAME "Invalid syntax. /P can be specified only when /U is specified.\nType ""EVENTCREATE /?"" for usage.\n"
  73. IDS_ERROR_INVALID_EVENT_ID "Invalid syntax. Event ID must be in the range of 1 - 1000.\nType ""EVENTCREATE /?"" for usage.\n"
  74. IDS_ERROR_DESCRIPTION_IS_EMPTY "Invalid syntax. Description cannot be empty.\nType ""EVENTCREATE /?"" for usage.\n"
  75. IDS_ERROR_LOGSOURCE_IS_EMPTY "Invalid syntax. Log/Source cannot be empty.\nType ""EVENTCREATE /?"" for usage.\n"
  76. IDS_ERROR_LOG_SOURCE_BOTH_MISSING "Invalid syntax. Either /L or /SO or both should be specified.\nType ""EVENTCREATE /?"" for usage.\n"
  77. IDS_ERROR_INVALID_USAGE_REQUEST "Invalid syntax.\nType ""EVENTCREATE /?"" for usage.\n"
  78. IDS_ERROR_SYSTEM_EMPTY "Invalid syntax. System name cannot be empty.\n"
  79. IDS_ERROR_LOG_NOTEXISTS "'%s' log does not exist. Cannot create the event.\n"
  80. IDS_ERROR_NEED_LOG_ALSO "New source can be created only if log name is also specified.\nINFO: Use /L switch to specify the log name.\n"
  81. IDS_ERROR_SOURCE_DUPLICATING "Source already exists in '%s' log. Source cannot be duplicated.\n"
  82. IDS_ERROR_ID_OUTOFRANGE "EventID must be in the range of %d - %d.\nType ""EVENTCREATE /?"" for usage.\n"
  83. IDS_ERROR_NONCUSTOM_SOURCE "Source parameter is used to identify custom applications/scripts only (not installed applications).\n"
  84. IDS_ERROR_LOG_CANNOT_BE_SECURITY "Access is denied. Custom events cannot be created into security log.\n"
  85. END
  86. //
  87. // Version resources
  88. //
  89. #include <ntverp.h>
  90. #define VER_FILETYPE VFT_APP
  91. #define VER_FILESUBTYPE VFT2_UNKNOWN
  92. #define VER_FILEDESCRIPTION_STR "Event Create - Creates a custom event in an event log"
  93. #define VER_INTERNALNAME_STR "eventcreate.exe"
  94. #define VER_ORIGINALFILENAME_STR "evcreate.exe"
  95. #include <common.ver>