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.

139 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. wsmain.h
  5. Abstract:
  6. Private header file which defines the global data which is used for
  7. communication between the service control handler and the
  8. rest of the NT Workstation service.
  9. Author:
  10. Rita Wong (ritaw) 06-May-1991
  11. Revision History:
  12. terryk 10-18-1993 Remove WsErrorInitializeLogon
  13. --*/
  14. #ifndef _WSMAIN_INCLUDED_
  15. #define _WSMAIN_INCLUDED_
  16. #include <wsnames.h> // Service interface names
  17. #include <svcs.h> // SVCHOST_GLOBAL_DATA
  18. //
  19. // Time for the sender of a start or stop request to the Workstation
  20. // service to wait (in milliseconds) before checking on the
  21. // Workstation service again to see if it is done.
  22. //
  23. #define WS_WAIT_HINT_TIME 90000 // 90 seconds
  24. //
  25. // Defines to indicate how far we managed to initialize the Workstation
  26. // service before an error is encountered and the extent of clean up needed
  27. //
  28. #define WS_TERMINATE_EVENT_CREATED 0x00000001
  29. #define WS_DEVICES_INITIALIZED 0x00000002
  30. #define WS_MESSAGE_SEND_INITIALIZED 0x00000004
  31. #define WS_RPC_SERVER_STARTED 0x00000008
  32. #define WS_LOGON_INITIALIZED 0x00000010
  33. #define WS_LSA_INITIALIZED 0x00000020
  34. #define WS_DFS_THREAD_STARTED 0x00000040
  35. #define WS_SECURITY_OBJECTS_CREATED 0x10000000
  36. #define WS_USE_TABLE_CREATED 0x20000000
  37. #define WS_API_STRUCTURES_CREATED (WS_SECURITY_OBJECTS_CREATED | \
  38. WS_USE_TABLE_CREATED )
  39. //
  40. // This macro is called after the redirection of print or comm device
  41. // has been paused or continued. If either the print or comm device is
  42. // paused the service is considered paused.
  43. //
  44. #define WS_RESET_PAUSE_STATE(WsStatus) { \
  45. WsStatus &= ~(SERVICE_PAUSE_STATE); \
  46. WsStatus |= (WsStatus & SERVICE_REDIR_PAUSED) ? SERVICE_PAUSED : \
  47. SERVICE_ACTIVE; \
  48. }
  49. //
  50. // Call WsHandleError with the appropriate error condition
  51. //
  52. #define WS_HANDLE_ERROR(ErrorCondition) \
  53. WsHandleError( \
  54. ErrorCondition, \
  55. status, \
  56. *WsInitState \
  57. );
  58. //
  59. // Call WsShutdownWorkstation with the exit code
  60. //
  61. #define WS_SHUTDOWN_WORKSTATION(ErrorCode) \
  62. WsShutdownWorkstation( \
  63. ErrorCode, \
  64. WsInitState \
  65. );
  66. //-------------------------------------------------------------------//
  67. // //
  68. // Type definitions //
  69. // //
  70. //-------------------------------------------------------------------//
  71. typedef enum _WS_ERROR_CONDITION {
  72. WsErrorRegisterControlHandler = 0,
  73. WsErrorCreateTerminateEvent,
  74. WsErrorNotifyServiceController,
  75. WsErrorInitLsa,
  76. WsErrorStartRedirector,
  77. WsErrorBindTransport,
  78. WsErrorAddDomains,
  79. WsErrorStartRpcServer,
  80. WsErrorInitMessageSend,
  81. WsErrorCreateApiStructures
  82. } WS_ERROR_CONDITION, *PWS_ERROR_CONDITION;
  83. typedef struct _WS_GLOBAL_DATA {
  84. //
  85. // Workstation service status
  86. //
  87. SERVICE_STATUS Status;
  88. //
  89. // Service status handle
  90. //
  91. SERVICE_STATUS_HANDLE StatusHandle;
  92. //
  93. // When the control handler is asked to stop the Workstation service,
  94. // it signals this event to notify all threads of the Workstation
  95. // service to terminate.
  96. //
  97. HANDLE TerminateNowEvent;
  98. } WS_GLOBAL_DATA, *PWS_GLOBAL_DATA;
  99. extern WS_GLOBAL_DATA WsGlobalData;
  100. extern HANDLE WsDllRefHandle;
  101. extern PSVCHOST_GLOBAL_DATA WsLmsvcsGlobalData;
  102. extern BOOL WsLUIDDeviceMapsEnabled;
  103. #endif // ifndef _WSMAIN_INCLUDED_