home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / cpm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  2.6 KB  |  53 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * CPM.h -  Critical Process Monitor                                           *
  4. *                                                                             *
  5. *               Version 1.00                                                  *
  6. *                                                                             *
  7. *               Copyright (c) 1997, Microsoft Corp.  All rights reserved      *
  8. *                                                                             *
  9. ******************************************************************************/
  10.  
  11. #include <windows.h>
  12.  
  13. #ifndef _CPM_H_
  14. #define _CPM_H_
  15.  
  16. // recover options
  17. #define CPM_RELAUNCH                    0x00000001            // wants to be relaunched if process is not responding
  18. #define CPM_SYS_REBOOT                  0x00000002            // wants the system reboot if process is not responding
  19. #define    CPM_SYS_REBOOT_DEFERRED            0x00000004            // wants the system to reboot with the next power cycle
  20.  
  21. // relaunch fail options, this must be used with CPM_RELAUNCH.
  22. #define CPM_RELAUNCH_FAIL_OK            0x00000000            // if relaunch fails, system takes no more action
  23. #define CPM_RELAUNCH_FAIL_SYSREBOOT        0x00000001            // if relaunch fails, system will reboot.
  24. #define CPM_RELAUNCH_FAIL_INCFAILCOUNT    0x00000002            // if relaunch fails, system will increment the count of failed processes
  25.  
  26. // callback command codes
  27. #define CPM_CLEANUP                        0x00000001            // before the system kills not responding process, if will try to callback
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. // callback function
  34. typedef void (*PCPMCallback)(DWORD dwCommand, DWORD dwCmdInfo);
  35.  
  36. // a process register with CPM to be a critical process
  37. BOOL CPMRegister(
  38.     IN DWORD dwProcessId,                         // process Id
  39.     IN DWORD dwNotifyInterval,                    // the time interval of two notifies to CPM, in unit of milliseconds
  40.     IN DWORD dwRecoverFlags,                      // recover option
  41.     IN WCHAR *pCommandLine,                       // NULL terminated string (unicode) to relaunch the app (required if relaunch wanted)
  42.     IN PCPMCallback pfnCPMCallBack,               // the call back function pointer(optional)
  43.     IN DWORD dwRecoverFailFlags);                 // how to handle relaunch failure
  44.  
  45. BOOL CPMUnRegister(IN DWORD dwProcessId);         // Unregister with CPM
  46. BOOL CPMNotify(IN DWORD dwProcessId);             // say hello to CPM
  47.  
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51.  
  52. #endif // _CPM_H_
  53.