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.

154 lines
6.0 KiB

  1. /*++ BUILD Version: 0001
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WKMAN.H
  8. * WOW32 16-bit Kernel API support (manually-coded thunks)
  9. *
  10. * History:
  11. * Created 27-Jan-1991 by Jeff Parsons (jeffpar)
  12. * 30-Apr-91 mattfe added WK32CheckLoadModuleDrv
  13. * 26-Aug-91 mattfe added FileIO routines
  14. * 19-JAN-92 mattfe added getnextvdm routine
  15. * 4-MAR-92 mattfe added KillProcess
  16. * 12-mar-92 mattfe added w32notifythread
  17. * 5-may-92 mattfe added HungAppSupport
  18. --*/
  19. ULONG FASTCALL WK32DirectedYield(PVDMFRAME pFrame);
  20. ULONG FASTCALL WK32InitTask(PVDMFRAME pFrame);
  21. ULONG FASTCALL WK32WOWKernelTrace(PVDMFRAME pFrame);
  22. ULONG FASTCALL WK32ExitKernel(PVDMFRAME pFrame);
  23. ULONG FASTCALL WK32FatalExit(PVDMFRAME pFrame);
  24. ULONG FASTCALL WK32KillRemoteTask(PVDMFRAME pFrame);
  25. ULONG FASTCALL WK32WOWKillTask(PVDMFRAME pFrame);
  26. ULONG FASTCALL WK32WOWLoadModule32(PVDMFRAME pFrame);
  27. ULONG FASTCALL WK32RegisterShellWindowHandle(PVDMFRAME pFrame);
  28. ULONG FASTCALL WK32WOWInitTask(PVDMFRAME pFrame);
  29. ULONG FASTCALL WK32WOWNotifyWOW32(PVDMFRAME pFrame);
  30. ULONG FASTCALL WK32WOWOutputDebugString(PVDMFRAME pFrame);
  31. ULONG FASTCALL WK32WOWQueryPerformanceCounter(PVDMFRAME pFrame);
  32. ULONG FASTCALL WK32WaitEvent(PVDMFRAME pFrame);
  33. ULONG FASTCALL WK32WowCloseComPort(PVDMFRAME pFrame);
  34. DWORD FASTCALL WK32WowDelFile(PVDMFRAME pFrame);
  35. ULONG FASTCALL WK32WowFailedExec(PVDMFRAME pFrame);
  36. ULONG FASTCALL WK32WowFailedExec(PVDMFRAME pFrame);
  37. ULONG FASTCALL WK32WowGetNextVdmCommand (PVDMFRAME pFrame);
  38. ULONG FASTCALL WK32WowIsKnownDLL(PVDMFRAME pFrame);
  39. ULONG FASTCALL WK32WowSetIdleHook(PVDMFRAME pFrame);
  40. ULONG FASTCALL WK32Yield(PVDMFRAME pFrame);
  41. ULONG FASTCALL WK32OldYield(PVDMFRAME pFrame);
  42. ULONG FASTCALL WK32WowWaitForMsgAndEvent(PVDMFRAME pFrame);
  43. ULONG FASTCALL WK32WowMsgBox(PVDMFRAME pFrame);
  44. ULONG FASTCALL WK32DosWowInit(PVDMFRAME pFrame);
  45. ULONG FASTCALL WK32CheckUserGdi(PVDMFRAME pFrame);
  46. ULONG FASTCALL WK32WowPartyByNumber(PVDMFRAME pFrame);
  47. ULONG FASTCALL WK32WowGetModuleHandle(PVDMFRAME pFrame);
  48. ULONG FASTCALL WK32FindAndReleaseDib(PVDMFRAME pvf); /* in wdib.c */
  49. ULONG FASTCALL WK32WowReserveHtask(PVDMFRAME pFrame);
  50. ULONG FASTCALL WK32WOWLFNEntry(PVDMFRAME pFrame); /* in wkman.c */
  51. ULONG FASTCALL WK32WowShutdownTimer(PVDMFRAME pFrame);
  52. ULONG FASTCALL WK32WowTrimWorkingSet(PVDMFRAME pFrame);
  53. ULONG FASTCALL WK32SetAppCompatFlags(PVDMFRAME pFrame);
  54. ULONG FASTCALL WK32WowSyncTask(PVDMFRAME pFrame);
  55. BOOL WK32InitializeHungAppSupport(VOID);
  56. DWORD W32HungAppNotifyThread(UINT hKillUniqueID);
  57. DWORD W32RemoteThread(VOID);
  58. DWORD W32Thread(LPVOID vpInitialSSSP);
  59. VOID W32DestroyTask( PTD ptd);
  60. VOID W32EndTask(VOID);
  61. ULONG W32GetAppCompatFlags(HTASK16 hTask16);
  62. BOOL W32ReadWOWCompatFlags(HTASK16 htask16, PTD pTD);
  63. VOID W32Init9xSpecialPath();
  64. BOOL W32Map9xSpecialPath(PSZ lpPathName, PSZ lpMapPathName);
  65. #ifdef FE_SB
  66. ULONG W32ReadWOWCompatFlags2(HTASK16 htask16);
  67. #endif // FE_SB
  68. VOID WK32DeleteTask(PTD ptdDelete);
  69. VOID WK32InitWowIsKnownDLL(HANDLE hKeyWow);
  70. LRESULT CALLBACK WK32ForegroundIdleHook(int code, WPARAM wParam, LPARAM lParam);
  71. VOID W32RefreshCurrentDirectories (PCHAR lpszzEnv);
  72. BOOL FASTCALL WowGetProductNameVersion(PSZ pszExePath, PSZ pszProductName,
  73. DWORD cbProductName, PSZ pszProductVersion,
  74. DWORD cbProductVersion,
  75. PSZ pszParamName, PSZ pszParamValue,
  76. DWORD cbParamValue);
  77. BOOL FASTCALL WowDoNameVersionMatch(PSZ pszExePath, PSZ pszProductName,
  78. PSZ pszProductVersion);
  79. VOID W32InitWOWSetupNames(VOID);
  80. BOOL W32IsSetupProgram(PSZ pszModName, PSZ pszFilePath);
  81. // SoftPC Routines
  82. HANDLE RegisterWOWIdle(void);
  83. VOID BlockWOWIdle(BOOL Blocking);
  84. // User32 Routines
  85. VOID ShowStartGlass (DWORD GLASSTIME);
  86. typedef struct _HMODCACHE { /* hmodcache */
  87. HAND16 hInst16;
  88. HAND16 hMod16;
  89. } HMODCACHE, *PHMODCACHE;
  90. extern HMODCACHE ghModCache[];
  91. #define CHMODCACHE 4 // size of cache table
  92. VOID RemoveHmodFromCache(HAND16 hmod16);
  93. typedef struct _CMDSHOW { /* cmdshow */
  94. WORD nTwo;
  95. WORD nCmdShow;
  96. } CMDSHOW, *PCMDSHOW;
  97. typedef struct _LOAD_MODULE_PARAMS { /* loadmoduleparms32 */
  98. LPVOID lpEnvAddress;
  99. LPSTR lpCmdLine;
  100. PCMDSHOW lpCmdShow;
  101. DWORD dwReserved;
  102. } LOAD_MODULE_PARAMS, *PLOAD_MODULE_PARAMS;
  103. typedef struct _WINOLDAP_THREAD_PARAMS {
  104. HANDLE hProcess;
  105. HWND hwndWinOldAp;
  106. } WINOLDAP_THREAD_PARAMS, *PWINOLDAP_THREAD_PARAMS;
  107. DWORD W32WinOldApThread(PWINOLDAP_THREAD_PARAMS pParams);
  108. // Globals
  109. extern INT busycount; // Used to detect if WOW is hung
  110. extern HAND16 gKillTaskID; // 16 bit tdb of task to kill
  111. extern HAND16 ghShellTDB; // TDB of WOWEXEC
  112. extern HWND ghwndShell; // Needed for ExitWindowsExec
  113. #define CMS_WAITWOWEXECTIMEOUT 60*1000 // Wait for WOWEXEC to respond
  114. #define CMS_WAITTASKEXIT 5*1000 // Hung App Wait TimeOut
  115. #define CMS_FOREVER 0xffffffff // wait for ever
  116. #define ALL_TASKS 0xffffffff // for exitvdm
  117. // IRQ: Interrupt: ICA: Line: Description:
  118. // -------------------------------------------------------------------
  119. // IRQ1 0x09 0 1 Keyboard service required.
  120. #define KEYBOARD_LINE 1
  121. #define KEYBOARD_ICA 0
  122. extern HANDLE hSharedTaskMemory;
  123. extern DWORD dwSharedProcessOffset;
  124. extern VPVOID vpDebugWOW;
  125. extern VPVOID vptopPDB;
  126. VOID CleanseSharedList( VOID );
  127. VOID AddProcessSharedList( VOID );
  128. VOID RemoveProcessSharedList( VOID );
  129. WORD AddTaskSharedList( HTASK16, HAND16, PSZ, PSZ );
  130. VOID RemoveTaskSharedList( VOID );
  131. ULONG FASTCALL WK32WowPassEnvironment(PVDMFRAME);
  132. extern HANDLE ghTaskAppHelp; // hProcess from apphelp (see WK32SyncTask)
  133. extern BOOL gfTaskContinue; // indicates whether child thread should continue without waiting for apphelp
  134. extern const CHAR szSystem[]; // "\\system"