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.

827 lines
26 KiB

  1. /******************************************************************************
  2. *
  3. * (C) Copyright MICROSOFT Corp., 1988-1995
  4. *
  5. * Title: VMDAPRIV.H - Include file for VMDOSAPP/SHELL interaction
  6. *
  7. * Version: 2.00
  8. *
  9. * Date: 13-Aug-1994
  10. *
  11. * Author: rjc
  12. *
  13. *-----------------------------------------------------------------------------
  14. *
  15. * Change log:
  16. *
  17. * DATE REV DESCRIPTION
  18. * ----------- --- ----------------------------------------------------------
  19. * 05-May-1988 ARR Original
  20. * 15-Jul-1982 rjc Converted from vmda.inc to vmda.h
  21. * 13-Aug-1992 rjc Split private stuff into vmdapriv.h
  22. * 11-Nov-1994 rjc Moved inter-module msgsrv32 stuff here, too.
  23. *
  24. *****************************************************************************/
  25. /******************************************************************************
  26. ******************************************************************************
  27. *
  28. * MSGSRV32
  29. *
  30. ******************************************************************************
  31. *****************************************************************************/
  32. /******************************************************************************
  33. *
  34. * SZMESSAGESERVERCLASS is the class name for the message server.
  35. * There is no title.
  36. *
  37. * To locate the message server, just do a
  38. *
  39. * static char CODESEG szMessageServer[] = SZMESSAGESERVER;
  40. * hwnd = FindWindow(szMessageServer, 0);
  41. *
  42. *****************************************************************************/
  43. #define SZMESSAGESERVERCLASS "Windows 32-bit VxD Message Server"
  44. /******************************************************************************
  45. *
  46. * INH_DEVICEBROADCAST -- Broadcast a message to VxDs.
  47. *
  48. * wParam = not used
  49. * lParam = far pointer to INTERNALBROADCASTSYSMSG
  50. *
  51. *****************************************************************************/
  52. #if 0
  53. typedef WORD WPARAM;
  54. typedef LONG LPARAM;
  55. #endif
  56. /* H2INCSWITCHES -t */
  57. typedef struct INTERNALBROADCASTSYSMSG { /* bsm */
  58. WORD uiMessage;
  59. WPARAM wParam;
  60. LPARAM lParam;
  61. DWORD dwFlags;
  62. } INTERNALBROADCASTSYSMSG, FAR *LPINTERNALBROADCASTSYSMSG;
  63. /* H2INCSWITCHES -t- */
  64. /*ASM
  65. DBWF_LPARAMPOINTER = 8000h
  66. */
  67. #define INH_DEVICEBROADCAST 0x0500
  68. /******************************************************************************
  69. *
  70. * INH_LOGONTONET -- Posted from user to msgsrvr to log onto net and run
  71. * the shell. Also used to exec the shell if it faults.
  72. * wParam = if 0, logon to net. if 1, just exec the shell.
  73. * lParam = not used
  74. *
  75. *****************************************************************************/
  76. #define INH_LOGONTONET 0x0501
  77. /******************************************************************************
  78. *
  79. * INH_CHECKSYSTEMDLLS - Posted from user to msgsrvr to tell us to check
  80. * system dlls if they have been bogusly replaced
  81. * wParam = not used
  82. * lParam = not used
  83. *
  84. *****************************************************************************/
  85. #define INH_CHECKSYSTEMDLLS 0x0502
  86. /******************************************************************************
  87. *
  88. * INH_USEME503 -- Not used, please recycle
  89. * INH_USEME504 -- Not used, please recycle
  90. *
  91. *****************************************************************************/
  92. #define INH_USEME503 0x0503
  93. #define INH_USEME504 0x0504
  94. /******************************************************************************
  95. *
  96. * INH_APPYTIME -- It is now 'Appy-time
  97. *
  98. * wParam = not used
  99. * lParam = not used
  100. *
  101. *****************************************************************************/
  102. #define INH_APPYTIME 0x0505
  103. /******************************************************************************
  104. *
  105. * INH_FORWARDTOSHELL -- Forward a WM_SHELLNOTIFY to the current shell window
  106. *
  107. * wParam = forwarded to GetShellWindow()
  108. * lParam = forwarded to GetShellWindow()
  109. *
  110. *****************************************************************************/
  111. #define INH_FORWARDTOSHELL 0x0506
  112. /******************************************************************************
  113. *
  114. * INH_FREEDRIVERS - Message posted from user telling us to free installable
  115. * drivers for compatibility with Win3.1
  116. * wParam = id code we pass back to user's UnloadInstallableDrivers
  117. * function
  118. * lParam = not used
  119. *
  120. *****************************************************************************/
  121. #define INH_FREEDRIVERS 0x0507
  122. /******************************************************************************
  123. *
  124. * INH_PLAYEXITSOUND - Message posted from user telling us to play the exit
  125. * Windows sound.
  126. * wParam = not used
  127. * lParam = not used
  128. *
  129. *****************************************************************************/
  130. #define INH_PLAYEXITSOUND 0x0508
  131. /******************************************************************************
  132. *
  133. * INH_UNIDRVLOADED - Message posted from unidrv to us so that we can
  134. * cache the printer driver after it loads.
  135. *
  136. * wParam = INH_UNIDRVLOADED_WPARAM (signature)
  137. * lParam = INH_UNIDRVLOADED_LPARAM (signature)
  138. *
  139. *****************************************************************************/
  140. #define INH_UNIDRVLOADED 0x0509
  141. #define INH_UNIDRVLOADED_WPARAM 0
  142. #define INH_UNIDRVLOADED_LPARAM 0
  143. /******************************************************************************
  144. *
  145. * INH_UNIDRVUNLOAD - Message sent from print installer to us so that we can
  146. * forceably tell msgsrvr to uncache this.
  147. *
  148. * wParam = INH_UNIDRVUNLOAD_WPARAM (signature)
  149. * lParam = INH_UNIDRVUNLOAD_LPARAM (signature)
  150. *
  151. *****************************************************************************/
  152. #define INH_UNIDRVUNLOAD 0x050A
  153. #define INH_UNIDRVUNLOAD_WPARAM 0
  154. #define INH_UNIDRVUNLOAD_LPARAM 0
  155. /******************************************************************************
  156. ******************************************************************************
  157. *
  158. * VMDOSAPP / SHELL / USER
  159. *
  160. ******************************************************************************
  161. *****************************************************************************/
  162. /*
  163. * This file contains manifest constants for VMDOSAPP/SHELL interaction
  164. * which are private to DOS386 and should not be exposed in the DDK.
  165. */
  166. /*
  167. * EQUATES for VMDOSAPP device calls
  168. */
  169. #define SHELL_Call_Dev_VMD 0x0000C
  170. #define SHELL_Call_Dev_VKD 0x0000D
  171. #define SHELL_Call_Dev_SHELL 0x00017
  172. #define SHELL_Call_Dev_VCOND 0x00038
  173. #ifdef FE_VIME
  174. #define SHELL_Call_Dev_VIME 0x00064
  175. #endif
  176. /*
  177. * SHELL VMDA interface services
  178. */
  179. #define SHELL_Get_Ver 0
  180. #define SHELL_Get_Sys_VM_Info 1 /* Used by 3.1 control panel (stub) */
  181. #define SHELL_Set_Sys_VM_Info 2 /* Used by 3.1 control panel (stub) */
  182. #define SHELL_Create_VM 3 /* Stupid C7 uses this; go figure */
  183. /* Brown has rev-engineered it, too */
  184. #define SHELL_Destroy_VM 4
  185. #define SHELL_Set_Focus 5
  186. #define SHELL_Get_VM_State 6
  187. #define SHELL_Set_VM_State 7
  188. /* #define SHELL_Debug_Out 8 */ /* Defined in vmda.h */
  189. #define SHELL_VMDA_Init 9
  190. #define SHELL_VMDA_Exit 10
  191. #define SHELL_Get_Message_Text 11
  192. #define SHELL_Event_Complete 12
  193. #define SHELL_Get_Contention_Info 13
  194. #define SHELL_Get_Clip_Info 14
  195. #define SHELL_Set_Paste 15
  196. #define SHELL_Switcher_Assist 16
  197. #define SHELL_Do_Not_Use 17 /* Do not recycle */
  198. #define SHELL_Query_Destroy 18
  199. /*
  200. * WARNING: The following two entries are used by Windows KERNEL/USER.
  201. * Do not change them without also changing KERNEL/USER.
  202. */
  203. #define SHELL_SetFocus_Cur_VM 19
  204. #define SHELL_User_Busy 20 /* Old name (not used) */
  205. #define SHELL_Set_Hotkey_Info 20 /* New name */
  206. #define SHELL_Chng_Hot_Key 21 /* Old name (not used) */
  207. #define SHELL_Get_Hotkey_Info 21 /* New name */
  208. #define SHELL_Get_TermInfo 22
  209. #define SHELL_Check_Hotkey_Allowed 23 /* See if a focus change is ok */
  210. #define SHELL_UseMe24 24 /* Available for use */
  211. /*
  212. * These are used by the WShell server during system startup
  213. * for various reasons...
  214. */
  215. #define SHELL_AppyRegister 25 /* 'Appy-time status report */
  216. #define SHELL_Get_VM_Descriptor 26
  217. #define SHELL_DispatchAppyEvents 27 /* It is now 'Appy time */
  218. #define SHELL_DispatchBroadcastHooks 28 /* Goofy broadcast received */
  219. #define SHELL_GetServerHwnd 29 /* Called by USER! */
  220. #define SHELL_GetSet_VM_Title 30
  221. #define SHELL_Get_Close_Flags 31
  222. #define SHELL_Initiate_Close 32
  223. #define SHELL_Cancel_Close 33
  224. #define SHELL_Grab_Failed 34
  225. #define SHELL_Get_Protection_Info 35
  226. #define SHELL_Freeze_VM 36
  227. #define SHELL_Thaw_VM 37
  228. #define SHELL_Set_Focus_Sys_VM 38 /* Used by Win31.exe */
  229. #define SHELL_Final_VM_Cleanup 39
  230. /*
  231. * NOTE! When adding a new service code, add them here, *before* the
  232. * DOS7 ordinals. (Renumber the DOS7 ordinals accordingly.)
  233. */
  234. #ifdef DOS7
  235. #define SHELL_Get_New_VM_Handle ?? /* VM enumeration for inheriting */
  236. #define SHELL_Get_Next_VM_Handle ??
  237. #define SHELL_Get_Clipboard_Size ?? /* Clipboard importation */
  238. #define SHELL_Copy_Clipboard_Data ??
  239. #endif
  240. /******************************************************************************
  241. *
  242. * Window private bytes...
  243. *
  244. * WindowLong(GWL_TTY_PID) =
  245. * process ID for process currently running in DOS box
  246. *
  247. * WindowLong(GWL_TTY_TID) =
  248. * thread ID for process currently running in DOS box
  249. *
  250. * Valid only if window class is the top-level unowned window for WinOldAp
  251. * (classname = "tty").
  252. *
  253. *****************************************************************************/
  254. #define GWL_TTY_PID 0
  255. #define GWL_TTY_TID 4
  256. /******************************************************************************
  257. *
  258. * Message numbers
  259. *
  260. *****************************************************************************/
  261. #define WMX_USER 0x0400
  262. /******************************************************************************
  263. *
  264. * Messages WMX_USER+0 through WMX_USER+19 are reserved for
  265. * internal use by WinOldAp.
  266. *
  267. *****************************************************************************/
  268. /******************************************************************************
  269. *
  270. * Messages WMX_USER+20 through WMX_USER+255 are reserved for
  271. * WinOldAp / WShell interaction, with exceptions as noted below.
  272. *
  273. *****************************************************************************/
  274. /*
  275. * Messages WMX_USER+20 through WMX_USER+255 are reserved
  276. *
  277. * Be extra careful not to change the meanings of any of the
  278. * messages from WMX_USER+20 through WMX_USER+20+13, because
  279. * those messages were used by Windows 3.1 and were documented
  280. * in the DDK (What were we thinking!?!!?), so some hosebags
  281. * might actually send them.
  282. *
  283. * VDA_Terminated is sent by the 3DPC screen saver. What's more,
  284. * they send it incorrectly! So watch out when you process it...
  285. */
  286. #define VDA_First (WMX_USER+20+0)
  287. /******** BEGIN -- DO NOT CHANGE THESE -- BEGIN ********/
  288. #define VDA_Hot_Key (WMX_USER+20+0)
  289. #define VDA_Switch_Context (WMX_USER+20+1)
  290. #ifndef VDA_Type_Chng
  291. #define VDA_Type_Chng (WMX_USER+20+2) /* Defined in VDDGRB.INC */
  292. #endif
  293. #define VDA_ClipBrd_Event (WMX_USER+20+3)
  294. #define VDA_Terminated (WMX_USER+20+4)
  295. #define VDA_Display_Message (WMX_USER+20+5)
  296. #ifndef VDA_Display_Event
  297. #define VDA_Display_Event (WMX_USER+20+6) /* Defined in VDDGRB.INC */
  298. #endif
  299. #define VDA_Crash_Event (WMX_USER+20+7) /* OBSOLETE! DO NOT RECYCLE */
  300. #define VDA_Paste_Complete (WMX_USER+20+8)
  301. #define VDA_Contention (WMX_USER+20+9)
  302. #define VDA_Start_SwitchScn (WMX_USER+20+10)
  303. #define VDA_FileSysChange (WMX_USER+20+11) /* OBSOLETE! DO NOT RECYCLE */
  304. #define VDA_CheckFocus (WMX_USER+20+12)
  305. #define VDA_Switch_CntxtPanic (WMX_USER+20+13)
  306. /******** END -- DO NOT CHANGE THESE -- END ********/
  307. #define VDA_Simulate_Hotkey (WMX_USER+20+14)
  308. #define VDA_Set_VM_Title (WMX_USER+20+15)
  309. #define VDA_Cancel_Close (WMX_USER+20+16)
  310. #define VDA_Change_CodePage (WMX_USER+20+17) /* Used by JAPAN */
  311. #define VDA_VM_Started (WMX_USER+20+18)
  312. #define VDA_Protection_Event (WMX_USER+20+19)
  313. #define VDA_Close_Clipboard (WMX_USER+20+20)
  314. #define VDA_Flash_Icon (WMX_USER+20+21)
  315. #define VDA_Notify_Close_Change (WMX_USER+20+22)
  316. #define VDA_DynaWindow (WMX_USER+20+23)
  317. #define VDA_Screensave (WMX_USER+20+24)
  318. #define VDA_SystemSleep (WMX_USER+20+25)
  319. #define VDA_MonitorPower (WMX_USER+20+26)
  320. #ifdef DOS7
  321. #define VDA_Inherit_New_VM ?
  322. #endif
  323. #define VDA_Last VDA_MonitorPower
  324. /******************************************************************************
  325. *
  326. * Messages WMX_USER+256 through WMX_USER+511 are reserved for
  327. * WinOldAp / VConD interaction.
  328. *
  329. *****************************************************************************/
  330. #define VDA_Console_Spawn (WMX_USER+256)
  331. #define VDA_Console_Set_Title (WMX_USER+257)
  332. #define VDA_Console_State_Change (WMX_USER+258)
  333. #define VDA_Console_Update_Window (WMX_USER+259)
  334. /* flags for Update Console Window message sent by Console code to WinOldAp*/
  335. #define UCW_HSCROLL 0x0001
  336. #define UCW_VSCROLL 0x0002
  337. #define UCW_SIZE 0x0004
  338. /* messages for native grabber in WinOldAp */
  339. #define GRABMSG_NOMSG 0x0000 // Nothing to do
  340. #define GRABMSG_REPAINT 0x0001 // Repaint a rectangle
  341. #define GRABMSG_MOVERECT 0x0002 // Move a rectangle
  342. #define GRABMSG_SETSCREEN 0x0004 // Set virtual screen size
  343. #define GRABMSG_SETCURPOS 0x0008 // Set virtual screen position
  344. #define GRABMSG_SETCURINFO 0x0010 // Set cursor (caret) position/size
  345. #define GRABMSG_CURTRACK 0x0020 // Position cursor in window
  346. #define GRABMSG_TERMINATE 0x0040 // Screen buffer is terminating
  347. /* Display event codes for notification of VCOND by WOA.*/
  348. #define DE_ICONIZE 1 // iconized
  349. #define DE_SIZECHANGE 2 // user changed window size
  350. #define DE_WINDOW 3 // changed from fullscreen to window
  351. #define DE_FULLSCREEN 4 // changed from window to fullscreen
  352. #define DE_BEGINSELECT 5 // begin selection
  353. #define DE_ENDSELECT 6 // end selection
  354. #define DE_NATIVEMODE 7 // enter native mode
  355. #define DE_PHYSICALMODE 8 // enter physical mode
  356. #ifdef FE_VIME
  357. /******************************************************************************
  358. *
  359. * Messages WMX_USER+512 through WMX_USER+767 are reserved for
  360. * WinOldAp / VIME interaction.
  361. *
  362. *****************************************************************************/
  363. #define VDA_Process_Key_Event (WMX_USER+512)
  364. #define VDA_Control_IME (WMX_USER+513)
  365. #define VDA_Init_VIMEUI (WMX_USER+514)
  366. #define VDA_Get_Keyboard_Layout (WMX_USER+515)
  367. /* Functions for VDA_Control_IME */
  368. #define VIME_CIME_SetOpenStatus 1
  369. #define VIME_CIME_SetCandidatePageStart 2
  370. #define VIME_CIME_SetCandidatePageSize 3
  371. #define VIME_CIME_EnableIME 4
  372. /* Protect Mode API */
  373. #define VIME_CMD_GetOption 2
  374. #define VIME_CMD_Composition 3
  375. #define VIME_CMD_CandOpen 4
  376. #define VIME_CMD_CandClose 10
  377. #define VIME_CMD_Draw 5
  378. #define VIME_CMD_Return 6
  379. #define VIME_CMD_Char 7
  380. #define VIME_CMD_StartComp 8
  381. #define VIME_CMD_EndComp 9
  382. #define VIME_CMD_OpenStatus 11
  383. #define VIME_CMD_ConversionMode 12
  384. #define VIME_CMD_SentenceMode 13
  385. #define VIME_CMD_WindowState 14
  386. #define VIME_CMD_KeyDown 15
  387. #define VIME_CMD_CandChange 16
  388. #define VIME_CMD_Paste 17
  389. #define VIME_CMD_ReqChangeKL 18
  390. #define VIME_CMD_KeyboardLayout 19
  391. #define VIME_CMD_InstallVIME 20
  392. #define VIME_CMD_GetSync 21
  393. /* detail info for VIME_CMD_ChangeIME */
  394. #define VIME_CHG_NonIME 1
  395. #define VIME_CHG_OldIME 2
  396. #define VIME_CHG_NonNative 3
  397. #endif // FE_VIME
  398. /*
  399. * This is a special "VMDOSAPP message" which actually results in no
  400. * message being sent to VMDOSAPP. It is used internally by the SHELL
  401. * to give the SYS VM a Boost, just as it does for normal events, but
  402. * without sending VMDOSAPP a message.
  403. */
  404. #define VDA_Nul_Boost_Event 0x0FFFF
  405. /*
  406. * lParam is ALWAYS the "Event ID". This is used on the VMDOSAPP call backs
  407. * to the shell to identify the event which is being processed.
  408. */
  409. /*
  410. * On VDA_Hot_Key event wParam is the Key identifier (See following EQUs)
  411. * VMDOSAPP instance which gets the message is the "target" of the hot key
  412. */
  413. #define VDA_HK_ALTSPACE 0
  414. #define VDA_HK_ALTENTER 1
  415. #define VDA_HK_DIRVM 2
  416. /*
  417. * On VDA_Terminated event wParam is 0 if this is a normal termination. If it is
  418. * non-zero, use SHELL_Get_TermInfo to get error information.
  419. * VMDOSAPP instance which gets the message has terminated.
  420. */
  421. /*
  422. * NOTE that VDA_Crash_Event is very much like VDA_Terminated, the only
  423. * real difference being the reason for the termination.
  424. * Use SHELL_Get_TermInfo to get error information.
  425. * wParam is not used
  426. * VMDOSAPP instance which gets the message has crashed
  427. */
  428. /*
  429. * On VDA_ClipBrd_Event, wParam is the Client_AX identifying the call.
  430. * VMDOSAPP instance which gets the message had a clipboard event
  431. */
  432. /* This next one is documented in vmda.h */
  433. /*
  434. * On VDA_Display_Message event, wParam == 0 if normal message
  435. * != 0 if ASAP or SYSMODAL message
  436. * VMDOSAPP instance which gets the message is messaging VM
  437. */
  438. /*
  439. * On VDA_Paste_Complete event, wParam == 0 if normal completion
  440. * == 1 if paste canceled by user
  441. * == 2 if paste canceled for other reason
  442. * VMDOSAPP instance which gets the message has completed paste
  443. */
  444. /*
  445. * On VDA_Switch_Context event, wParam == 0 if context is switched to
  446. * VMDOSAPP instance which gets the message (that VM now has focus)
  447. * if wParam != 0, SYS VM now has the focus
  448. * VDA_Switch_CntxtPanic is an alternate form that should only occur with
  449. * wParam != 0 and indicates that the Windows activation should be moved
  450. * away from any VM (in other words, only a Windows app should be active
  451. * now).
  452. */
  453. /* This next one is documented in vmda.h */
  454. /*
  455. * On VDA_Type_Chng event, wParam is not used
  456. * VMDOSAPP instance which gets the message has had its type changed by
  457. * protected mode code
  458. */
  459. /*
  460. * On VDA_FileSysChange, SEE SHELLFSC.INC
  461. */
  462. /*
  463. * VDA_CheckFocus This is sent as part of the Contention handling to deal with
  464. * a case where the the Focus is manipulated and needs to get reset.
  465. * wParam is not used.
  466. */
  467. /* Reference data for VDA_Protection_Event
  468. */
  469. #ifndef _WINNT_
  470. typedef struct FAULTINFO {
  471. DWORD FI_VM;
  472. DWORD FI_CS;
  473. DWORD FI_EIP;
  474. DWORD FI_Addr;
  475. } FAULTINFO;
  476. typedef FAULTINFO *PFAULTINFO;
  477. #endif
  478. #ifdef _WSHIOCTL_H
  479. /*****************************************************************************
  480. *
  481. * SHELL_Create_VM
  482. *
  483. * ES:EDI -> struct VM_Descriptor (see shellvm.h)
  484. * DS:SI -> struct VM_AppWizInfo
  485. *
  486. * szProgram = program name, e.g., "C:\FOO.BAT" or "D:\BAR.EXE"
  487. * szParams = command tail
  488. * szDir = current directory at time of exec, e.g., C:\GAME
  489. * szPifFile = PIF file that controls this app
  490. * null string if PIF file belongs to command.com
  491. * space if app didn't have a custom PIF (need to create one)
  492. *
  493. */
  494. /* H2INCSWITCHES -t */
  495. typedef struct VMAPPWIZINFO { /* awi */
  496. char szProgram[MAXVMPROGSIZE];
  497. char szParams[MAXVMCMDSIZE];
  498. char szDir[MAXVMDIRSIZE];
  499. char szPifFile[MAXPIFPATHSIZE];
  500. BYTE aAppFlags[4]; /* 1 dword of flags */
  501. } VMAPPWIZINFO, *PVMAPPWIZINFO;
  502. /* H2INCSWITCHES -t- */
  503. #endif /* _WSHIOCTL_H */
  504. //
  505. // Flags for app hack bits
  506. //
  507. #define DAHF_SPECIALSETTINGS 0x00000001 // App requires separate VM
  508. #define DAHF_SPECIALSETTINGS_BIT 0 // (Winlie, SDAM, XMS cap...)
  509. #define DAHF_NOPAGELOCKS 0x00000002 // Ignore DPMI PageLocks
  510. #define DAHF_NOPAGELOCKS_BIT 1 // if not paging through DOS
  511. #define DAHF_NOMSDOSWARN 0x00000004 // Do not suggest SDAM
  512. #define DAHF_NOMSDOSWARN_BIT 2
  513. #define DAHF_VALIDATELOCKS 0x00000008 // Do not let DPMI app lock
  514. #define DAHF_VALIDATELOCKS_BIT 3 // memory it didn't allocate
  515. #define DAHF_TRACESEGLOAD 0x00000010 // Enable trace flag hack for
  516. #define DAHF_TRACESEGLOAD_BIT 4 // segment load faults
  517. #ifdef NEC_98
  518. #define DAHF_MAXENVSIZE 0x00000020 // Use maximize environment
  519. #define DAHF_MAXENVSIZE_BIT 5 // size(=0xffff) for apps like
  520. // Justsystem
  521. #endif //NEC_98
  522. /*****************************************************************************
  523. *
  524. * SHELL_Get_TermInfo
  525. *
  526. * Private structure used to get detailed information when a VM crashed.
  527. *
  528. * If the VM terminated because the initial EXEC failed, the termination
  529. * error code will have high word zero and low byte equal to the DOS error
  530. * code.
  531. */
  532. /* H2INCSWITCHES -t */
  533. typedef struct VMFaultInfo2 { /* VMFI2 */
  534. ULONG fl; /* Flags (this lives in the same place
  535. * as the TermVMHnd)
  536. */
  537. /* These fields form a TermStruc */
  538. ULONG TermErrCd; /* Error code for termination */
  539. ULONG TermErrCdRef; /* Reference data for termination */
  540. ULONG TermExitCode; /* Application exit code */
  541. /* These fields form a VMFaultInfo, meaningful only if we crashed. */
  542. ULONG EIP; /* faulting EIP */
  543. WORD CS; /* faulting CS */
  544. WORD Ints; /* interrupts in service, if any */
  545. /* These fields are valid only if the VM terminated by crashing */
  546. char szCrashText[80]; /* Location of crash (if in a VxD) */
  547. char VxdReported[9]; /* name of VxD who reported the crash */
  548. } VMFAULTINFO2;
  549. /*
  550. * Flags for vmfi2_fl.
  551. */
  552. #define VMFI2FL_BLANKSCREEN 1 /* Screen is blank */
  553. #define VMFI2FL_RING0CRASH 2 /* Crashed at ring 0 */
  554. /* Error codes.
  555. *
  556. * For VDAE_InsMemDev and VDAE_DevNuke the error ref data points to
  557. * the 8 character device name.
  558. */
  559. #define VDAE_PrivInst 0x00010001 /* Privledged instruction */
  560. #define VDAE_InvalInst 0x00010002 /* Invalid instruction */
  561. #define VDAE_InvalPgFlt 0x00010003 /* Invalid page fault */
  562. #define VDAE_InvalGpFlt 0x00010004 /* Invalid GP fault */
  563. #define VDAE_InvalFlt 0x00010005 /* Invalid fault, not any of abv */
  564. #define VDAE_UserNuke 0x00010006 /* User requested NUKE of running */
  565. /* VM */
  566. #define VDAE_DevNuke 0x00010007 /* Device specific problem */
  567. #define VDAE_DevNukeHdwr 0x00010008 /* Device specific prob, HW prgm */
  568. #define VDAE_NukeNoMsg 0x00010009 /* Supress WINOA message */
  569. #define VDAE_OkNukeMask 0x80000000 /* "Good" nuke bit */
  570. #define VDAE_InsMemGeneric 0x00020000 /* Unknown VxD failed create */
  571. #define VDAE_InsMemV86 0x00020001 /* base V86 mem - V86MMGR */
  572. #define VDAE_InsV86Space 0x00020002 /* Kb Req too large - V86MMGR */
  573. #define VDAE_InsMemXMS 0x00020003 /* XMS Kb Req - V86MMGR */
  574. #define VDAE_InsMemEMS 0x00020004 /* EMS Kb Req - V86MMGR */
  575. #define VDAE_InsMemV86Hi 0x00020005 /* Hi DOS V86 mem - DOSMGR */
  576. /* V86MMGR */
  577. #define VDAE_InsMemVid 0x00020006 /* Base Video mem - VDD */
  578. #define VDAE_InsMemVM 0x00020007 /* Base VM mem - VMM */
  579. /* CB, Inst Buffer */
  580. #define VDAE_InsMemDev 0x00020008 /* Couldn't alloc base VM */
  581. #define VDAE_CrtNoMsg 0x00020009 /* Supress WINOA message */
  582. /*****************************************************************************
  583. *
  584. * On SHELL_Set_Hotkey_Info, USER calls us with
  585. *
  586. * DS:AX -> array of HOTKEYSTRUCT structures
  587. * CX = number of entries in array (possibly zero)
  588. * DS:BX -> linked list of GLOBALHOTKEY structures
  589. *
  590. */
  591. /* HOTKEYSTRUCT - Hotkeys of type 1
  592. *
  593. * This structure is used with the WM_(SET/GET)HOTKEY messages
  594. * and the SC_HOTKEY syscommand.
  595. *
  596. * WARNING: Both USER and WinOlDAp use this structure
  597. */
  598. #define HKFL_SHIFT 1 /* Either shift key down */
  599. #define HKFL_CTRL 2 /* Either Ctrl key down */
  600. #define HKFL_ALT 4 /* Either Alt key down */
  601. #define HKFL_EXT 8 /* This is an extended key */
  602. #define HKFL_WIN 16 /* Either Nexus flappy-window down */
  603. /* XLATOFF */
  604. #ifdef HOTKEYF_SHIFT
  605. #if HKFL_SHIFT != HOTKEYF_SHIFT || \
  606. HKFL_CTRL != HOTKEYF_CONTROL || \
  607. HKFL_ALT != HOTKEYF_ALT || \
  608. HKFL_EXT != HOTKEYF_EXT
  609. #error "Hotkey state bits don't match!"
  610. #endif
  611. #endif
  612. /* XLATON */
  613. typedef struct HOTKEYSTRUCT { /* hk */
  614. #ifdef USER_IS_INCLUDING_VMDA
  615. HWND_16 hwnd16; /* window that owns the hotkey */
  616. #else
  617. WORD hwnd16; /* window that owns the hotkey */
  618. #endif
  619. WORD key; /* LOBYTE = Window virtual key */
  620. /* HIBYTE = Keystate modifieds (HKFL_*) */
  621. WORD scan; /* OEM scan code for key (used by Shell.VxD) */
  622. } HOTKEYSTRUCT;
  623. typedef HOTKEYSTRUCT NEAR *PHOTKEYSTRUCT;
  624. /* GLOBALHOTKEY - Hotkeys of type 2
  625. *
  626. * This structure is used with the (Un)RegisterHotkey functions
  627. * and the WM_HOTKEY message.
  628. *
  629. * WARNING: USER has its own definition for this structure.
  630. *
  631. * DOUBLE WARNING: The modifier states are *different* from those
  632. * for hotkeys of type 1! Aigh!
  633. */
  634. #define GHKFL_ALT 1 /* Either Alt key down */
  635. #define GHKFL_CTRL 2 /* Either Ctrl key down */
  636. #define GHKFL_SHIFT 4 /* Either shift key down */
  637. #define GHKFL_WIN 8 /* Either Nexus flappy-window down */
  638. /* XLATOFF */
  639. #ifdef MOD_WIN
  640. #if GHKFL_SHIFT != MOD_SHIFT || \
  641. GHKFL_CTRL != MOD_CONTROL || \
  642. GHKFL_ALT != MOD_ALT || \
  643. GHKFL_WIN != MOD_WIN
  644. #error "Global hotkey state bits don't match!"
  645. #endif
  646. #endif
  647. /* XLATON */
  648. typedef struct GLOBALHOTKEY { /* ghk */
  649. #ifdef USER_IS_INCLUDING_VMDA
  650. struct GLOBALHOTKEY NEAR *phkNext;
  651. #else
  652. WORD phkNext;
  653. #endif
  654. WORD hq;
  655. DWORD id;
  656. WORD hwnd16;
  657. WORD fsModifiers;
  658. WORD vk;
  659. WORD scan;
  660. } GLOBALHOTKEY, NEAR *PGLOBALHOTKEY;
  661. /*****************************************************************************/
  662. /* H2INCSWITCHES -t- */
  663. #ifdef VK_NUMPAD0
  664. #if (VK_NUMPAD0 != 0x60) || (VK_NUMPAD9 != 0x69)
  665. #error "VK_ codes don't match!"
  666. #endif
  667. #else
  668. #define VK_NUMPAD0 0x60
  669. #define VK_NUMPAD9 0x69
  670. #endif
  671. /*****************************************************************************
  672. *
  673. * Undocumented flag bits for SHELL_Event.
  674. *
  675. */
  676. #if 0 // Historical purposes
  677. #define SE_WP_SetFocusBoost 0x00010000 // Boost the SYS VM till a
  678. #define SE_WP_SetFocusBoostBit 16 // Set_Focus call
  679. //
  680. #define SE_WP_SwitcherBoost 0x00020000 // Leftover from 3.1
  681. #define SE_WP_SwitcherBoostBit 17 //
  682. //
  683. #define SE_WP_FilSysChgBoost 0x00040000 // Leftover from 3.1
  684. #define SE_WP_FilSysChgBoostBit 18 //
  685. //
  686. #define SE_WP_ClipAPIBoost 0x00080000 // Boost the SYS VM during clipbrd
  687. #define SE_WP_ClipAPIBoostBit 19 // API
  688. #else // There is only one type of
  689. // boost, so everybody shares.
  690. #define SE_WP_SetFocusBoost SE_WP_PrtScBoost
  691. #define SE_WP_SetFocusBoostBit SE_WP_PrtScBoostBit
  692. #define SE_WP_ClipAPIBoost SE_WP_PrtScBoost
  693. #define SE_WP_ClipAPIBoostBit SE_WP_PrtScBoostBit
  694. #define SE_WP_Zombie 0x80000000 // Dead event but must linger
  695. #define SE_WP_ZombieBit 31 // for buggy 3.1 VDDs
  696. #endif
  697. /* SE_WP_PrtScBoost is defined in shell.h */
  698. /* SE_WP_DispUpdBoost is defined in shell.h */