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.

129 lines
3.6 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Scheduling Agent Service
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  7. //
  8. // File: tasks.hxx
  9. //
  10. // Contents: definitions for Sage compatability.
  11. //
  12. // History: 25-Jun-96 EricB created
  13. //
  14. //-----------------------------------------------------------------------------
  15. #define MAXPATH 267
  16. #define MAXSETTINGS 256
  17. #define MAXCOMMANDLINE (MAXPATH+MAXSETTINGS)
  18. #define MAXCOMMENT 256
  19. #define CB_RESERVED 32
  20. //
  21. // The following are reserved for 16 bit apps to send messages to control sage.
  22. //
  23. #define SAGE_RESTART WM_USER + 4
  24. //#define SAGE_NOIDLE WM_USER + 5 defined in svc_core.hxx
  25. #define SAGE_ENABLE WM_USER + 6
  26. #define SAGE_DISABLE WM_USER + 7
  27. #define SAGE_GETSTATUS WM_USER + 8
  28. #define SAGE_ADDTASK WM_USER + 9
  29. #define SAGE_REMOVETASK WM_USER + 10
  30. #define SAGE_GETTASK WM_USER + 11
  31. typedef struct TaskInfo
  32. {
  33. unsigned long StructureSize;
  34. unsigned long Task_Identifier;
  35. unsigned long Sub_Task_Identifier;
  36. unsigned long Status;
  37. unsigned long Result;
  38. unsigned long Time_Granularity;
  39. unsigned long StopAfterTime;
  40. unsigned long TimeTillAlarm;
  41. unsigned long User_Idle;
  42. unsigned long Powered;
  43. unsigned long CreatorId;
  44. SYSTEMTIME BeginTime; //indefinite period start time
  45. SYSTEMTIME EndTime; //indefinite peroid end time
  46. SYSTEMTIME LastRunStart; //actual start time
  47. SYSTEMTIME LastRunEndScheduled; //planned termination time
  48. SYSTEMTIME LastTerminationTime; //actual termination time
  49. SYSTEMTIME DontRunUntil; //specific date to not start before
  50. SYSTEMTIME LastAlarmTime;
  51. SYSTEMTIME RESERVED1;
  52. SYSTEMTIME RESERVED2;
  53. STARTUPINFO StartupInfo;
  54. DWORD dwProcessId;
  55. DWORD dwThreadId;
  56. DWORD LockingProcess;
  57. unsigned long LockTime;
  58. DWORD fdwCreate;
  59. DWORD taskflags;
  60. char SystemTask;
  61. char TerminateAtRangeEnd;
  62. char StartupTask;
  63. char AlarmEnabled;
  64. char RunNow;
  65. char TerminateNoIdle;
  66. char Disabled;
  67. char TerminateNow;
  68. char RestartNoIdle;
  69. char CommandLine[MAXCOMMANDLINE];
  70. char Comment[MAXCOMMENT];
  71. char WorkingDirectory[MAXPATH];
  72. DWORD hProcess; //declare as dword so 16 bit apps get right size
  73. DWORD hThread;
  74. DWORD hTerminateThread;
  75. char ExcludeDaysVector;
  76. char Reserved[CB_RESERVED-12];
  77. } TaskInfo;
  78. typedef struct SystemInfo
  79. {
  80. SYSTEMTIME CurrentTime;
  81. unsigned long MouseTime;
  82. BOOL Asleep;
  83. unsigned long TickCount;
  84. HANDLE AgentSemaphore;
  85. HANDLE SleepSemaphore;
  86. }SystemInfo;
  87. #define SAGE_SUSPEND WM_USER + 1
  88. #define SAGE_TERMINATE WM_USER + 2
  89. #define SAGE_RESUME WM_USER + 3
  90. #if 0
  91. typedef struct ADD_TASK
  92. {
  93. unsigned long result_code;
  94. TaskInfo new_task;
  95. char reserved[256];
  96. } ADD_TASK;
  97. typedef struct REMOVE_TASK
  98. {
  99. unsigned long result_code;
  100. unsigned long task_id;
  101. unsigned long subtask_id;
  102. char reserved[256];
  103. } REMOVE_TASK;
  104. typedef struct TASK_ENUMERATION_HEADER
  105. {
  106. unsigned long result_code;
  107. unsigned long packet_size;
  108. unsigned long total_tasks;
  109. unsigned long count_tasks;
  110. } TASK_ENUMERATION_HEADER;
  111. #endif