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.

318 lines
7.6 KiB

  1. //
  2. // OS Isolation (BOGUS!)
  3. //
  4. #ifndef _H_OSI
  5. #define _H_OSI
  6. //
  7. // Control for shared code
  8. //
  9. //
  10. // Maximum number of entries in a palette.
  11. //
  12. #define OSI_MAX_PALETTE 256
  13. // Structure: OSI_ESCAPE_HEADER
  14. //
  15. // Description: Structure common to all display driver requests. These
  16. // fields are checked before the Display Driver will attempt to process the
  17. // request.
  18. //
  19. typedef struct tagOSI_ESCAPE_HEADER
  20. {
  21. DWORD padding; // For faulty drivers
  22. DWORD identifier; // Unique identifier for all our requests.
  23. DWORD escapeFn; // Function to be processed. In the case
  24. // of ESC_QUERYSUPPORT, this is the ID
  25. // of the function to be queried.
  26. DWORD version; // Version #
  27. }
  28. OSI_ESCAPE_HEADER;
  29. typedef OSI_ESCAPE_HEADER FAR * LPOSI_ESCAPE_HEADER;
  30. //
  31. // Unique identifier for all our requests
  32. //
  33. #define OSI_ESCAPE_IDENTIFIER 0xED3B12DC
  34. //
  35. // Unique escape code for all our specific requests.
  36. //
  37. #define OSI_ESC_CODE 31170
  38. //
  39. // Internal Windows NT Escape Function WNDOBJ_SETUP. This is the Escape
  40. // code that must be called in order for the Display Driver to be allowed
  41. // to call EngCreateWindow. Unfortunately, it is defined in winddi.h,
  42. // which can't be included in User-mode compilations.
  43. //
  44. // I define it here: if it changes in winddi.h, this line will fail to
  45. // compile in a Display Driver compilation.
  46. //
  47. #define WNDOBJ_SETUP 4354 // for live video ExtEscape
  48. //
  49. // Allowed ranges of escape functions
  50. //
  51. #define OSI_ESC_FIRST 0
  52. #define OSI_ESC_LAST 0xFF
  53. #define OSI_OE_ESC_FIRST 0x100
  54. #define OSI_OE_ESC_LAST 0x1FF
  55. #define OSI_HET_ESC_FIRST 0x200
  56. #define OSI_HET_ESC_LAST 0x2FF
  57. #define OSI_SBC_ESC_FIRST 0x400
  58. #define OSI_SBC_ESC_LAST 0x4FF
  59. #define OSI_HET_WO_ESC_FIRST 0x500
  60. #define OSI_HET_WO_ESC_LAST 0x5FF
  61. #define OSI_SSI_ESC_FIRST 0x600
  62. #define OSI_SSI_ESC_LAST 0x6FF
  63. #define OSI_CM_ESC_FIRST 0x700
  64. #define OSI_CM_ESC_LAST 0x7FF
  65. #define OSI_OA_ESC_FIRST 0x800
  66. #define OSI_OA_ESC_LAST 0x8FF
  67. #define OSI_BA_ESC_FIRST 0x900
  68. #define OSI_BA_ESC_LAST 0x9FF
  69. //
  70. // Specific values for OSI escape codes
  71. //
  72. #define OSI_ESC(code) (OSI_ESC_FIRST + code)
  73. #define OSI_ESC_INIT OSI_ESC(0)
  74. #define OSI_ESC_TERM OSI_ESC(1)
  75. #define OSI_ESC_SYNC_NOW OSI_ESC(2)
  76. //
  77. // Used to determine if our driver is around, hosting is possible, and to
  78. // returned mapped shared memory if so after initializing.
  79. //
  80. #define SHM_SIZE_USED (sizeof(SHM_SHARED_MEMORY) + 2*sizeof(OA_SHARED_DATA))
  81. #define SHM_MEDIUM_TILE_INDEX 0
  82. #define SHM_LARGE_TILE_INDEX 1
  83. #define SHM_NUM_TILE_SIZES 2
  84. typedef struct tagOSI_INIT_REQUEST
  85. {
  86. OSI_ESCAPE_HEADER header;
  87. DWORD result;
  88. LPVOID pSharedMemory;
  89. LPVOID poaData[2];
  90. DWORD sbcEnabled;
  91. LPVOID psbcTileData[SHM_NUM_TILE_SIZES];
  92. DWORD aBitmasks[3];
  93. } OSI_INIT_REQUEST;
  94. typedef OSI_INIT_REQUEST FAR* LPOSI_INIT_REQUEST;
  95. //
  96. // Used when shutting down to cleanup any allocated objects and memory
  97. //
  98. typedef struct tagOSI_TERM_REQUEST
  99. {
  100. OSI_ESCAPE_HEADER header;
  101. } OSI_TERM_REQUEST;
  102. typedef OSI_TERM_REQUEST FAR* LPOSI_TERM_REQUEST;
  103. #ifdef DLL_DISP
  104. #ifndef IS_16
  105. //
  106. // We have a circular structure dependency, so prototype the necessary data
  107. // here.
  108. //
  109. typedef struct tagOSI_DSURF OSI_DSURF;
  110. //
  111. // Tag used to identify all memory allocated by the display driver.
  112. //
  113. #define OSI_ALLOC_TAG 'DDCD'
  114. // Structure: OSI_PDEV
  115. //
  116. // Description:
  117. //
  118. // Contents of our private data pointer; GDI always passes this to us on
  119. // each call to the display driver. This structure is initialized in
  120. // DrvEnablePDEV handling.
  121. //
  122. typedef struct tagOSI_PDEV
  123. {
  124. //
  125. // Rendering extensions colour information.
  126. //
  127. HANDLE hDriver; // Handle to \Device\Screen
  128. HDEV hdevEng; // Engine's handle to PDEV
  129. HSURF hsurfScreen; // Engine's handle to screen
  130. OSI_DSURF* pdsurfScreen; // Our private DSURF for the screen
  131. LONG cxScreen; // Visible screen width
  132. LONG cyScreen; // Visible screen height
  133. LONG cBitsPerPel; // Bits per pel (8,15,16,24,32,etc)
  134. // This is only 8 or 24 on NT 5.0!
  135. //
  136. // Color/pixel format
  137. //
  138. ULONG iBitmapFormat; // Current colour depth as defined
  139. FLONG flRed; // Red mask for bitmask modes
  140. FLONG flGreen; // Green mask for bitmask modes
  141. FLONG flBlue; // Blue mask for bitmask modes // by the BMF_xBPP flags.
  142. //
  143. // Palette stuff
  144. //
  145. HPALETTE hpalCreated; // For NT 5.0 we have to return a palette
  146. PALETTEENTRY* pPal; // The palette if palette managed
  147. BOOL paletteChanged; // Set whenever the palette is
  148. // changed.
  149. }
  150. OSI_PDEV;
  151. typedef OSI_PDEV FAR * LPOSI_PDEV;
  152. // Structure: OSI_DSURF
  153. //
  154. // Description:
  155. //
  156. // Surface specific information. We need this structure to pass on to
  157. // EngCreateSurface() during initializtion. We ignore it subsequently.
  158. //
  159. typedef struct tagOSI_DSURF
  160. {
  161. SIZEL sizl; // Size of the original bitmap
  162. LPOSI_PDEV ppdev; // Pointer to the assocaited PDEV
  163. }
  164. OSI_DSURF;
  165. typedef OSI_DSURF FAR * LPOSI_DSURF;
  166. void OSI_DDInit(LPOSI_PDEV, LPOSI_INIT_REQUEST);
  167. void OSI_DDTerm(LPOSI_PDEV);
  168. #else
  169. void OSI_DDTerm(void);
  170. #endif // !IS_16
  171. #else
  172. //
  173. // Used for other desktops thread.
  174. //
  175. enum
  176. {
  177. OSI_WM_SETGUIEFFECTS = WM_USER,
  178. OSI_WM_DESKTOPREPAINT,
  179. OSI_WM_DESKTOPSWITCH,
  180. OSI_WM_MOUSEINJECT,
  181. OSI_WM_KEYBDINJECT,
  182. OSI_WM_INJECTSAS
  183. };
  184. #endif // DLL_DISP
  185. //
  186. // OSI_Load()
  187. // Called when nmas.dll is first loaded.
  188. //
  189. void OSI_Load(void);
  190. //
  191. // OSI_Unload()
  192. // Called when nmas.dll is unloaded.
  193. //
  194. void OSI_Unload(void);
  195. //
  196. // OSI_Init()
  197. // Called when app sharing initializes in its service thread. We determine
  198. // if we can host, and get hold of buffers, data structures, etc. needed
  199. // for hosting if so.
  200. //
  201. // Returns FALSE on severe failure. The display driver on NT not being
  202. // present isn't failure. The graphic patches on Win95 not being safe isn't
  203. // failure either. In those two cases, AS will simply mark itself as
  204. // unable to host, but can view fine.
  205. //
  206. void OSI_Init(void);
  207. //
  208. // OSI_Term()
  209. // Called when app sharing deinitializes in its service thread.
  210. //
  211. void OSI_Term(void);
  212. //
  213. // OSI_FunctionRequest()
  214. // Used to communicate with the display driver piece, the part which tracks
  215. // graphical output in shared apps on the screen.
  216. //
  217. BOOL OSI_FunctionRequest(DWORD functionId, LPOSI_ESCAPE_HEADER pRequest, DWORD requestLen);
  218. // NT only!
  219. void OSI_InitDriver50(BOOL fInit);
  220. // NT only!
  221. void OSI_RepaintDesktop(void);
  222. // NT only!
  223. void OSI_SetGUIEffects(BOOL fOff);
  224. // NT only!
  225. void WINAPI OSI_SetDriverName(LPCSTR szDriverName);
  226. #ifdef DLL_DISP
  227. #ifdef IS_16
  228. BOOL OSI_DDProcessRequest(UINT fnEscape, LPOSI_ESCAPE_HEADER pResult,
  229. DWORD cbResult);
  230. #else
  231. ULONG OSI_DDProcessRequest(SURFOBJ* pso, UINT cjIn, void* pvIn, UINT cjOut, void* pvOut);
  232. BOOL OSIInitializeMode(const GDIINFO* pGdiRequested, const DEVMODEW* pdmRequested,
  233. LPOSI_PDEV ppdev, GDIINFO* pgdiReturn, DEVINFO* pdiReturn);
  234. #endif // !IS_16
  235. #endif // DLL_DISP
  236. #endif // _H_OSI