Leaked source code of windows server 2003
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.

199 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. GLOBALS.H
  5. Abstract:
  6. Global defines and data.
  7. Variables and string , located in global scope are defined here
  8. and memory for them will be allocated in no more than one source
  9. module, containing definition of DEFINE_GLOBAL_VARIABLES before
  10. including this file
  11. Author:
  12. Vlad Sadovsky (vlads) 12-20-98
  13. Revision History:
  14. --*/
  15. #ifndef WINVER
  16. #define WINVER 0x0500 /* version 5.0 */
  17. #else
  18. #endif /* !WINVER */
  19. #pragma once
  20. #include <windows.h>
  21. #include <winuser.h>
  22. #include <sti.h>
  23. #include <stiapi.h>
  24. //
  25. // Global variables are defined in one module, which has definition of
  26. // DEFINE_GLOBAL_VARIABLES before including this header file.
  27. //
  28. #ifdef DEFINE_GLOBAL_VARIABLES
  29. #undef ASSIGN
  30. #define ASSIGN(value) =value
  31. #undef EXTERN
  32. #define EXTERN
  33. #else
  34. #define ASSIGN(value)
  35. #if !defined(EXTERN)
  36. #define EXTERN extern
  37. #endif
  38. #endif
  39. //
  40. // General char values
  41. //
  42. #define COLON_CHAR TEXT(':') // Native syntax delimiter
  43. #define DOT_CHAR TEXT('.')
  44. #define SLASH_CHAR TEXT('/')
  45. #define BACKSLASH_CHAR TEXT('\\')
  46. #define STAR_CHAR TEXT('*')
  47. #define EQUAL_CHAR TEXT('=')
  48. #define COMMA_CHAR TEXT(',')
  49. #define WHITESPACE_CHAR TEXT(' ')
  50. #define DOUBLEQUOTE_CHAR TEXT('"')
  51. #define SINGLEQUOTE_CHAR TEXT('\'')
  52. #define TAB_CHAR TEXT('\t')
  53. #define DEADSPACE(x) (((x)==WHITESPACE_CHAR) || ((x)==DOUBLEQUOTE_CHAR) )
  54. #define IS_EMPTY_STRING(pch) (!(pch) || !(*(pch)))
  55. //
  56. // Macros
  57. //
  58. #define TEXTCONST(name,text) extern const TCHAR name[] ASSIGN(text)
  59. #define EXT_STRING(name) extern const TCHAR name[]
  60. //
  61. // Trace strings should not appear in retail builds, thus define following macro
  62. //
  63. #ifdef DEBUG
  64. #define DEBUG_STRING(s) (s)
  65. #else
  66. #define DEBUG_STRING(s) (NULL)
  67. #endif
  68. //
  69. // Various defines
  70. //
  71. //
  72. //
  73. // STI Device specific values
  74. //
  75. #ifdef DEBUG
  76. #define STIMON_AD_DEFAULT_POLL_INTERVAL 10000 // 10s
  77. #else
  78. #define STIMON_AD_DEFAULT_POLL_INTERVAL 1000 // 1s
  79. #endif
  80. #define STIMON_AD_DEFAULT_WAIT_LOCK 100 // 100ms
  81. #define STIMON_AD_DEFAULT_WAIT_LAUNCH 5000 // 5s
  82. //
  83. // External references to GLOBAL DATA
  84. //
  85. //
  86. // Server process instance
  87. //
  88. EXTERN HINSTANCE g_hProcessInstance ASSIGN(NULL);
  89. //
  90. // Server library instance
  91. //
  92. EXTERN HINSTANCE g_hImagingSvcDll ASSIGN(NULL);
  93. //
  94. // Handle of main window
  95. //
  96. EXTERN HWND g_hMainWindow ASSIGN(NULL); ;
  97. //
  98. // Default timeout for pollable devices
  99. //
  100. EXTERN UINT g_uiDefaultPollTimeout ASSIGN(STIMON_AD_DEFAULT_POLL_INTERVAL);
  101. //
  102. // Flag indicating request to refresh device list state
  103. //
  104. EXTERN BOOL g_fRefreshDeviceList ASSIGN(FALSE);
  105. //
  106. // Platform type
  107. //
  108. EXTERN BOOL g_fIsWindows9x ASSIGN(FALSE);
  109. //
  110. // Reentrancy flag for timeout selection
  111. //
  112. EXTERN BOOL g_fTimeoutSelectionDialog ASSIGN(FALSE);
  113. //
  114. // Results of command line parsing
  115. //
  116. EXTERN BOOL g_fInstallingRequest ASSIGN(FALSE);
  117. EXTERN BOOL g_fRemovingRequest ASSIGN(FALSE);
  118. EXTERN BOOL g_fUIPermitted ASSIGN(FALSE);
  119. EXTERN BOOL g_fStoppingRequest ASSIGN(FALSE);
  120. //
  121. // Running as a service
  122. //
  123. EXTERN BOOL g_fRunningAsService ASSIGN(TRUE);
  124. EXTERN HANDLE g_hHeap ASSIGN(NULL);
  125. //
  126. // Function pointers to imaging services entry points
  127. //
  128. //
  129. // Strings
  130. //
  131. EXTERN TCHAR g_szImagingServiceDll[MAX_PATH] ASSIGN(TEXT(""));
  132. TEXTCONST(g_szBACK, TEXT("\\"));
  133. TEXTCONST(g_szTitle,TEXT("STI Monitor"));
  134. TEXTCONST(STIStartedEvent_name,TEXT("STIExeStartedEvent"));
  135. TEXTCONST(g_szServiceDll,TEXT("ServiceDll"));
  136. TEXTCONST(g_szServiceMain,TEXT("ServiceMain"));
  137. //
  138. // Class name for the services hidden window
  139. //
  140. TEXTCONST(g_szStiSvcClassName,STISVC_WINDOW_CLASS);
  141. TEXTCONST(g_szClass,STIMON_WINDOW_CLASS);
  142. // end