home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / surpriz / MSRMesh-VirtualWIFI.MSI / Service.H < prev    next >
Encoding:
C/C++ Source or Header  |  2005-06-24  |  2.7 KB  |  95 lines

  1. /*
  2.  * Author   : Ranveer Chandra
  3.  * Directory: VirtualWiFi_Root\Service
  4.  * File Name: Service.H
  5.  * Purpose  : Defines the main structures and values used by the Service
  6.  */
  7.  
  8. #ifndef _SERVICE_H
  9. #define _SERVICE_H
  10.  
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16.  
  17. //////////////////////////////////////////////////////////////////////////////
  18. //// todo: change to desired strings
  19. ////
  20. // name of the executable
  21. #define SZAPPNAME            "VirtualWiFiSvc"
  22. // internal name of the service
  23. #define SZSERVICENAME        "VirtualWiFiService"
  24. // displayed name of the service
  25. #define SZSERVICEDISPLAYNAME "VirtualWiFi Client Service"
  26. // list of service dependencies - "dep1\0dep2\0\0"
  27. #define SZDEPENDENCIES       ""
  28. //////////////////////////////////////////////////////////////////////////////
  29.  
  30.  
  31.  
  32. //////////////////////////////////////////////////////////////////////////////
  33. //// todo: ServiceStart()must be defined by in your code.
  34. ////       The service should use ReportStatusToSCMgr to indicate
  35. ////       progress.  This routine must also be used by StartService()
  36. ////       to report to the SCM when the service is running.
  37. ////
  38. ////       If a ServiceStop procedure is going to take longer than
  39. ////       3 seconds to execute, it should spawn a thread to
  40. ////       execute the stop code, and return.  Otherwise, the
  41. ////       ServiceControlManager will believe that the service has
  42. ////       stopped responding
  43. ////
  44.    VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
  45.    VOID ServiceStop();
  46.  
  47. //////////////////////////////////////////////////////////////////////////////
  48.  
  49.  
  50.  
  51. //////////////////////////////////////////////////////////////////////////////
  52. //// The following are procedures which
  53. //// may be useful to call within the above procedures,
  54. //// but require no implementation by the user.
  55. //// They are implemented in service.c
  56.  
  57. //
  58. //  FUNCTION: ReportStatusToSCMgr()
  59. //
  60. //  PURPOSE: Sets the current status of the service and
  61. //           reports it to the Service Control Manager
  62. //
  63. //  PARAMETERS:
  64. //    dwCurrentState - the state of the service
  65. //    dwWin32ExitCode - error code to report
  66. //    dwWaitHint - worst case estimate to next checkpoint
  67. //
  68. //  RETURN VALUE:
  69. //    TRUE  - success
  70. //    FALSE - failure
  71. //
  72.    BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint);
  73.  
  74.  
  75. //
  76. //  FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
  77. //
  78. //  PURPOSE: Allows any thread to log an error message
  79. //
  80. //  PARAMETERS:
  81. //    lpszMsg - text for message
  82. //
  83. //  RETURN VALUE:
  84. //    none
  85. //
  86.    void AddToMessageLog(LPTSTR lpszMsg);
  87. //////////////////////////////////////////////////////////////////////////////
  88.  
  89.  
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93.  
  94. #endif
  95.