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.

72 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // File: sadat.hxx
  4. //
  5. // Contents: Routines which manipulate the SA.DAT file in the Tasks
  6. // folder. This file is used by both the service and the UI
  7. // to determine service state, OS info, etc.
  8. //
  9. // Classes: None.
  10. //
  11. // Functions: SADatGetData
  12. // SADatCreate
  13. // SADatSetData
  14. //
  15. // History: 08-Jul-96 MarkBl Created
  16. //
  17. //----------------------------------------------------------------------------
  18. #ifndef _SADAT_HXX_
  19. #define _SADAT_HXX_
  20. //
  21. // SA.DAT version 1.0 content consists of three bytes:
  22. //
  23. // ------------------------------------------------------
  24. // | Size (DWORD) | Platform (BYTE) | Service (BYTE) |
  25. // ------------------------------------------------------
  26. //
  27. // where:
  28. // Size specifies DAT data size & provides versioning.
  29. // Platform designates the current OS, either NT or Windows.
  30. // Service is a byte flag range. Currently, only the LSB is used to
  31. // indicate if the service is running.
  32. //
  33. #define SA_DAT_VERSION_ONE_SIZE (sizeof(DWORD) + (sizeof(BYTE) * 2))
  34. #define SA_DAT_SIZE_OFFSET (0)
  35. #define SA_DAT_PLATFORM_OFFSET (sizeof(DWORD))
  36. #define SA_DAT_SVCFLAGS_OFFSET (SA_DAT_PLATFORM_OFFSET + sizeof(BYTE))
  37. #define SA_DAT_SVCFLAG_SVC_RUNNING 0x01
  38. #define SA_DAT_SVCFLAG_RESUME_TIMERS 0x02
  39. HRESULT
  40. SADatGetData(
  41. LPCTSTR ptszFolderPath,
  42. DWORD * pdwVersion,
  43. BYTE * pbPlatform,
  44. BYTE * prgSvcFlags);
  45. HRESULT
  46. SADatGetData(
  47. LPCTSTR ptszFolderPath,
  48. DWORD cbData,
  49. BYTE rgbData[],
  50. HANDLE * phFile = NULL);
  51. HRESULT
  52. SADatCreate(
  53. LPCTSTR ptszFolderPath,
  54. BOOL fServiceStarted = TRUE);
  55. HRESULT
  56. SADatSetData(
  57. HANDLE hFile,
  58. DWORD cbData,
  59. const BYTE rgbData[]);
  60. BOOL
  61. ResumeTimersSupported();
  62. #endif // _SADAT_HXX_