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
102 lines
6.5 KiB
#include <windows.h>
|
|
#include "resource.h"
|
|
#include "cmdline.rc"
|
|
#include "cmdlineres.h"
|
|
#include "EvcrtMsg.rc"
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// String Table
|
|
//
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_USAGE_SYNTAX1 "\nEVENTCREATE [/S system [/U username [/P [password]]]] /ID eventid\n"
|
|
IDS_USAGE_SYNTAX2 " [/L logname] [/SO srcname] /T type /D description\n"
|
|
IDS_USAGE_NEWLINE1 "\n"
|
|
IDS_USAGE_DESC1 "Description:\n"
|
|
IDS_USAGE_DESC2 " This command line tool enables an administrator to create\n"
|
|
IDS_USAGE_DESC3 " a custom event ID and message in a specified event log.\n"
|
|
IDS_USAGE_NEWLINE2 "\n"
|
|
IDS_USAGE_PARAMLIST "Parameter List:\n"
|
|
IDS_USAGE_PARAMLIST1 " /S system Specifies the remote system to connect to.\n\n"
|
|
IDS_USAGE_PARAMLIST2 " /U [domain\\]user Specifies the user context under which\n"
|
|
IDS_USAGE_PARAMLIST3 " the command should execute.\n\n"
|
|
IDS_USAGE_PARAMLIST4 " /P [password] Specifies the password for the given\n"
|
|
IDS_USAGE_PARAMLIST5 " user context. Prompts for input if omitted.\n\n"
|
|
IDS_USAGE_PARAMLIST6 " /L logname Specifies the event log to create\n"
|
|
IDS_USAGE_PARAMLIST7 " an event in.\n\n"
|
|
IDS_USAGE_PARAMLIST8 " /T type Specifies the type of event to create.\n"
|
|
IDS_USAGE_PARAMLIST9 " Valid types: SUCCESS, ERROR, WARNING, INFORMATION.\n\n"
|
|
IDS_USAGE_PARAMLIST10 " /SO source Specifies the source to use for the\n"
|
|
IDS_USAGE_PARAMLIST11 " event (if not specified, source will default\n"
|
|
IDS_USAGE_PARAMLIST12 " to 'eventcreate'). A valid source can be any\n"
|
|
IDS_USAGE_PARAMLIST13 " string and should represent the application\n"
|
|
IDS_USAGE_PARAMLIST14 " or component that is generating the event.\n\n"
|
|
IDS_USAGE_PARAMLIST15 " /ID id Specifies the event ID for the event. A\n"
|
|
IDS_USAGE_PARAMLIST16 " valid custom message ID is in the range\n"
|
|
IDS_USAGE_PARAMLIST17 " of 1 - 1000.\n\n"
|
|
IDS_USAGE_PARAMLIST18 " /D description Specifies the description text for the new event.\n\n"
|
|
IDS_USAGE_PARAMLIST19 ""
|
|
IDS_USAGE_PARAMLIST20 " /? Displays this help message.\n\n"
|
|
IDS_USAGE_NEWLINE3 "\n"
|
|
IDS_USAGE_EXAMPLES "Examples:\n"
|
|
IDS_USAGE_EXAMPLE11 " EVENTCREATE /T ERROR /ID 1000\n"
|
|
IDS_USAGE_EXAMPLE12 " /L APPLICATION /D ""My custom error event for the application log""\n\n"
|
|
IDS_USAGE_EXAMPLE21 ""
|
|
IDS_USAGE_EXAMPLE22 ""
|
|
IDS_USAGE_EXAMPLE31 " EVENTCREATE /T ERROR /ID 999 /L APPLICATION\n"
|
|
IDS_USAGE_EXAMPLE32 " /SO WinWord /D ""Winword event 999 happened due to low diskspace""\n\n"
|
|
IDS_USAGE_EXAMPLE41 " EVENTCREATE /S system /T ERROR /ID 100\n"
|
|
IDS_USAGE_EXAMPLE42 " /L APPLICATION /D ""Custom job failed to install""\n\n"
|
|
IDS_USAGE_EXAMPLE51 " EVENTCREATE /S system /U user /P password /ID 1 /T ERROR\n"
|
|
IDS_USAGE_EXAMPLE52 " /L APPLICATION /D ""User access failed due to invalid user credentials""\n"
|
|
IDS_USAGE_EXAMPLE61 ""
|
|
IDS_USAGE_EXAMPLE62 ""
|
|
IDS_USAGE_EXAMPLE71 ""
|
|
IDS_USAGE_EXAMPLE72 ""
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_LOGTYPE_ERROR "ERROR"
|
|
IDS_LOGTYPE_WARNING "WARNING"
|
|
IDS_LOGTYPE_INFORMATION "INFORMATION"
|
|
IDS_LOGTYPE_SUCCESS "SUCCESS"
|
|
IDS_OVALUES_LOGTYPE "success|error|information|warning"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_EVENTCREATE_SUCCESS_LOG "SUCCESS: An event of type '%s' was created with '%s' as the log.\n"
|
|
IDS_EVENTCREATE_SUCCESS_SOURCE "SUCCESS: An event of type '%s' was created with '%s' as the source.\n"
|
|
IDS_EVENTCREATE_SUCCESS_BOTH "SUCCESS: An event of type '%s' was created in the '%s' log with '%s' as the source.\n"
|
|
|
|
IDS_ERROR_USERNAME_BUT_NOMACHINE "Invalid syntax. /U can be specified only when /S is specified.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_USERNAME_EMPTY "Invalid syntax. User name cannot be empty.\n"
|
|
IDS_ERROR_PASSWORD_BUT_NOUSERNAME "Invalid syntax. /P can be specified only when /U is specified.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_INVALID_EVENT_ID "Invalid syntax. Event ID must be in the range of 1 - 1000.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_DESCRIPTION_IS_EMPTY "Invalid syntax. Description cannot be empty.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_LOGSOURCE_IS_EMPTY "Invalid syntax. Log/Source cannot be empty.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_LOG_SOURCE_BOTH_MISSING "Invalid syntax. Either /L or /SO or both should be specified.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_INVALID_USAGE_REQUEST "Invalid syntax.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_SYSTEM_EMPTY "Invalid syntax. System name cannot be empty.\n"
|
|
|
|
IDS_ERROR_LOG_NOTEXISTS "'%s' log does not exist. Cannot create the event.\n"
|
|
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"
|
|
IDS_ERROR_SOURCE_DUPLICATING "Source already exists in '%s' log. Source cannot be duplicated.\n"
|
|
IDS_ERROR_ID_OUTOFRANGE "EventID must be in the range of %d - %d.\nType ""EVENTCREATE /?"" for usage.\n"
|
|
IDS_ERROR_NONCUSTOM_SOURCE "Source parameter is used to identify custom applications/scripts only (not installed applications).\n"
|
|
IDS_ERROR_LOG_CANNOT_BE_SECURITY "Access is denied. Custom events cannot be created into security log.\n"
|
|
END
|
|
|
|
//
|
|
// Version resources
|
|
//
|
|
#include <ntverp.h>
|
|
#define VER_FILETYPE VFT_APP
|
|
#define VER_FILESUBTYPE VFT2_UNKNOWN
|
|
#define VER_FILEDESCRIPTION_STR "Event Create - Creates a custom event in an event log"
|
|
#define VER_INTERNALNAME_STR "eventcreate.exe"
|
|
#define VER_ORIGINALFILENAME_STR "evcreate.exe"
|
|
#include <common.ver>
|