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.

82 lines
2.5 KiB

  1. /****************************************************************************\
  2. *
  3. * Module Name : service.h
  4. *
  5. * Copyright (c) 1991-2000 Microsoft Corporation
  6. *
  7. \****************************************************************************/
  8. #ifndef _SERVICE_H
  9. #define _SERVICE_H
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. //////////////////////////////////////////////////////////////////////////////
  14. ////
  15. // internal name of the service
  16. #define SZSERVICENAME "AudioSrv"
  17. //////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19. //// todo: ServiceStart()must be defined by in your code.
  20. //// The service should use ReportStatusToSCMgr to indicate
  21. //// progress. This routine must also be used by StartService()
  22. //// to report to the SCM when the service is running.
  23. ////
  24. //// If a ServiceStop procedure is going to take longer than
  25. //// 3 seconds to execute, it should spawn a thread to
  26. //// execute the stop code, and return. Otherwise, the
  27. //// ServiceControlManager will believe that the service has
  28. //// stopped responding
  29. ////
  30. VOID ServiceStart(SERVICE_STATUS_HANDLE ssh, DWORD dwArgc, LPTSTR *lpszArgv);
  31. DWORD ServiceDeviceEvent(DWORD dwEventType, LPVOID lpEventData);
  32. DWORD ServiceSessionChange(DWORD dwEventType, LPVOID lpEventData);
  33. VOID ServiceStop();
  34. //////////////////////////////////////////////////////////////////////////////
  35. //////////////////////////////////////////////////////////////////////////////
  36. //// The following are procedures which
  37. //// may be useful to call within the above procedures,
  38. //// but require no implementation by the user.
  39. //// They are implemented in service.c
  40. //
  41. // FUNCTION: ReportStatusToSCMgr()
  42. //
  43. // PURPOSE: Sets the current status of the service and
  44. // reports it to the Service Control Manager
  45. //
  46. // PARAMETERS:
  47. // dwCurrentState - the state of the service
  48. // dwWin32ExitCode - error code to report
  49. // dwWaitHint - worst case estimate to next checkpoint
  50. //
  51. // RETURN VALUE:
  52. // TRUE - success
  53. // FALSE - failure
  54. //
  55. BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint);
  56. extern SERVICE_STATUS ssStatus; // current status of the service
  57. //////////////////////////////////////////////////////////////////////////////
  58. ////
  59. // Process heap, initialized in DllMain.
  60. EXTERN_C HANDLE hHeap;
  61. //////////////////////////////////////////////////////////////////////////////
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #endif