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.

101 lines
3.4 KiB

  1. /******************************************************************************
  2. //
  3. // Copyright(c) Microsoft Corporation
  4. //
  5. // Module Name:
  6. //
  7. // ScheduledTasks.h
  8. //
  9. // Abstract:
  10. //
  11. // This module contains the macros, user defined structures & function
  12. // definitions needed by ScheduledTasks.cpp , create.cpp , delete.cpp ,
  13. // query.cpp , createvalidations.cpp , change.cpp , run.cpp and end.cpp files.
  14. //
  15. // Author:
  16. //
  17. // G.Surender Reddy 10-sept-2000
  18. //
  19. // Revision History:
  20. //
  21. // G.Surender Reddy 10-sept-2000 : Created it
  22. // G.Surender Reddy 25-sep-2000 : Modified it
  23. // [ Added macro constants,Function
  24. // definitions ]
  25. // Venu Gopal Choudary 01-Mar-2001 : Modified it
  26. // [ Added -change option]
  27. //
  28. // Venu Gopal Choudary 12-Mar-2001 : Modified it
  29. // [ Added -run and -end options]
  30. //
  31. ******************************************************************************/
  32. #ifndef __SCHEDULEDTASKS_H
  33. #define __SCHEDULEDTASKS_H
  34. #pragma once // include header file only once
  35. // constants / defines / enumerations
  36. #define MAX_MAIN_COMMANDLINE_OPTIONS 8
  37. // Options
  38. #define OI_USAGE 0
  39. #define OI_CREATE 1
  40. #define OI_DELETE 2
  41. #define OI_QUERY 3
  42. #define OI_CHANGE 4
  43. #define OI_RUN 5
  44. #define OI_END 6
  45. #define OI_OTHERS 7
  46. // Other constants
  47. //To retrive 1 tasks at a time ,used in TaskScheduler API fns.
  48. #define TASKS_TO_RETRIEVE 1
  49. //#define TRIM_SPACES TEXT(" \0")
  50. #define NTAUTHORITY_USER _T("NT AUTHORITY\\SYSTEM")
  51. #define SYSTEM_USER _T("SYSTEM")
  52. // Exit values
  53. #define EXIT_SUCCESS 0
  54. #define EXIT_FAILURE 1
  55. #define DOMAIN_U_STRING L"\\\\"
  56. #define NULL_U_CHAR L'\0'
  57. #define BACK_SLASH_U L'\\'
  58. #define JOB _T(".job")
  59. #define COMMA_STRING _T(",")
  60. #define DASH L"-"
  61. #define SID_STRING L"S-1"
  62. #define AUTH_FORMAT_STR1 L"0x%02hx%02hx%02hx%02hx%02hx%02hx"
  63. #define AUTH_FORMAT_STR2 L"%lu"
  64. // Main functions
  65. HRESULT CreateScheduledTask( DWORD argc , LPCTSTR argv[] );
  66. DWORD DeleteScheduledTask( DWORD argc , LPCTSTR argv[] );
  67. DWORD QueryScheduledTasks( DWORD argc , LPCTSTR argv[] );
  68. DWORD ChangeScheduledTaskParams( DWORD argc , LPCTSTR argv[] );
  69. DWORD RunScheduledTask( DWORD argc , LPCTSTR argv[] );
  70. DWORD TerminateScheduledTask( DWORD argc , LPCTSTR argv[] );
  71. HRESULT Init( ITaskScheduler **pITaskScheduler );
  72. VOID displayMainUsage();
  73. BOOL PreProcessOptions( DWORD argc, LPCTSTR argv[], PBOOL pbUsage, PBOOL pbCreate,
  74. PBOOL pbQuery, PBOOL pbDelete, PBOOL pbChange, PBOOL pbRun, PBOOL pbEnd, PBOOL pbDefVal );
  75. VOID Cleanup( ITaskScheduler *pITaskScheduler);
  76. ITaskScheduler* GetTaskScheduler( LPCTSTR pszServerName );
  77. TARRAY ValidateAndGetTasks( ITaskScheduler * pITaskScheduler, LPCTSTR pszTaskName);
  78. DWORD ParseTaskName( LPWSTR lpszTaskName );
  79. DWORD DisplayUsage( ULONG StartingMessage, ULONG EndingMessage );
  80. BOOL GetGroupPolicy( LPWSTR szServer, LPWSTR szUserName, LPWSTR PolicyType, LPDWORD lpdwPolicy );
  81. BOOL GetPolicyValue( HKEY hKey, LPWSTR szPolicyType, LPDWORD lpdwPolicy );
  82. BOOL GetSidString ( IN PSID pSid, OUT LPWSTR wszSid );
  83. #endif // __SCHEDULEDTASKS_H