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.

123 lines
3.9 KiB

  1. /******************************************************************************
  2. Copyright(c) Microsoft Corporation
  3. Module Name:
  4. ScheduledTasks.h
  5. Abstract:
  6. This module contains the macros, user defined structures & function
  7. definitions needed by ScheduledTasks.cpp , create.cpp , delete.cpp ,
  8. query.cpp , createvalidations.cpp , change.cpp , run.cpp and end.cpp files.
  9. Author:
  10. G.Surender Reddy 10-sept-2000
  11. Revision History:
  12. G.Surender Reddy 10-sept-2000 : Created it
  13. G.Surender Reddy 25-sep-2000 : Modified it
  14. [ Added macro constants,Function
  15. definitions ]
  16. Venu Gopal Choudary 01-Mar-2001 : Modified it
  17. [ Added -change option]
  18. Venu Gopal Choudary 12-Mar-2001 : Modified it
  19. [ Added -run and -end options]
  20. ******************************************************************************/
  21. #ifndef __SCHEDULEDTASKS_H
  22. #define __SCHEDULEDTASKS_H
  23. #pragma once // include header file only once
  24. // constants / defines / enumerations
  25. // Options
  26. #define CMDOPTION_CREATE _T( "create" )
  27. #define CMDOPTION_DELETE _T( "delete" )
  28. #define CMDOPTION_QUERY _T( "query" )
  29. #define CMDOPTION_CHANGE _T( "change" )
  30. #define CMDOPTION_RUN _T( "run" )
  31. #define CMDOPTION_END _T( "end" )
  32. #define CMDOPTION_USAGE _T( "?|help|h" )
  33. #define CMDOTHEROPTIONS _T( "s|ru|rp|f|sc|mo|d|m|i|tn|tr|st|sd|ed|fo|v|nh|u|p")
  34. // Other switches or sub-options
  35. #define SWITCH_SERVER _T( "s" )
  36. #define SWITCH_RUNAS_USER _T( "ru" )
  37. #define SWITCH_RUNAS_PASSWORD _T( "rp" )
  38. #define SWITCH_USER _T( "u" )
  39. #define SWITCH_PASSWORD _T( "p" )
  40. #define SWITCH_FORMAT _T( "fo" )
  41. #define SWITCH_VERBOSE _T( "v")
  42. #define SWITCH_FORCE _T( "f" )
  43. #define SWITCH_SCHEDULETYPE _T( "sc" )
  44. #define SWITCH_MODIFIER _T( "mo" )
  45. #define SWITCH_DAY _T( "d" )
  46. #define SWITCH_MONTHS _T( "m" )
  47. #define SWITCH_IDLETIME _T( "i" )
  48. #define SWITCH_TASKNAME _T( "tn" )
  49. #define SWITCH_TASKRUN _T( "tr" )
  50. #define SWITCH_STARTTIME _T( "st" )
  51. #define SWITCH_STARTDATE _T( "sd" )
  52. #define SWITCH_ENDDATE _T( "ed" )
  53. #define SWITCH_NOHEADER _T( "nh" )
  54. // Other constants
  55. //To retrive 1 tasks at a time ,used in TaskScheduler API fns.
  56. #define TASKS_TO_RETRIEVE 1
  57. #define TRIM_SPACES TEXT(" \0")
  58. #define NTAUTHORITY_USER _T("NT AUTHORITY\\SYSTEM")
  59. #define SYSTEM_USER _T("SYSTEM")
  60. // Exit values
  61. #define EXIT_SUCCESS 0
  62. #define EXIT_FAILURE 1
  63. #define DOMAIN_U_STRING L"\\\\"
  64. #define NULL_U_STRING L""
  65. #define NULL_U_CHAR L'\0'
  66. #define BACK_SLASH_U L'\\'
  67. #define JOB _T(".job")
  68. #define MAX_MESSAGE_LEN 2056
  69. #define NULL_U_CHAR L'\0'
  70. #define MAX_PASSWORD_LEN 64
  71. #define COMMA_STRING _T(",")
  72. #define TEMP_LOG_FILE _T("StdIn.log")
  73. // Typedefs of standard string sizes
  74. //typedef TCHAR STRING32 [ 32 ];
  75. //typedef TCHAR STRING64 [ 64 ];
  76. typedef TCHAR STRING100 [ 100 ];
  77. typedef TCHAR STRING256 [ 256 ];
  78. // Main functions
  79. HRESULT CreateScheduledTask( DWORD argc , LPCTSTR argv[] );
  80. DWORD DeleteScheduledTask( DWORD argc , LPCTSTR argv[] );
  81. DWORD QueryScheduledTasks( DWORD argc , LPCTSTR argv[] );
  82. DWORD ChangeScheduledTaskParams( DWORD argc , LPCTSTR argv[] );
  83. DWORD RunScheduledTask( DWORD argc , LPCTSTR argv[] );
  84. DWORD TerminateScheduledTask( DWORD argc , LPCTSTR argv[] );
  85. VOID Cleanup( ITaskScheduler *pITaskScheduler);
  86. ITaskScheduler* GetTaskScheduler( LPCTSTR pszServerName );
  87. TARRAY ValidateAndGetTasks( ITaskScheduler * pITaskScheduler, LPCTSTR pszTaskName);
  88. DWORD ParseTaskName( LPTSTR lpszTaskName );
  89. void DisplayErrorMsg(HRESULT hr);
  90. DWORD DisplayUsage( ULONG StartingMessage, ULONG EndingMessage );
  91. #endif // __SCHEDULEDTASKS_H