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.

156 lines
6.2 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. ULONG FASTCALL WK32WowDivideOverflowEx(PVDMFRAME pFrame);
  56. BOOL WK32InitializeHungAppSupport(VOID);
  57. DWORD W32HungAppNotifyThread(UINT hKillUniqueID);
  58. DWORD W32RemoteThread(VOID);
  59. DWORD W32Thread(LPVOID vpInitialSSSP);
  60. VOID W32DestroyTask( PTD ptd);
  61. VOID W32EndTask(VOID);
  62. ULONG W32GetAppCompatFlags(HTASK16 hTask16);
  63. BOOL W32ReadWOWCompatFlags(HTASK16 htask16, PTD pTD);
  64. VOID W32Init9xSpecialPath();
  65. BOOL W32Map9xSpecialPath(PSZ lpPathName, PSZ lpMapPathName, DWORD dwMapPathSize);
  66. #ifdef FE_SB
  67. ULONG W32ReadWOWCompatFlags2(HTASK16 htask16);
  68. #endif // FE_SB
  69. VOID WK32DeleteTask(PTD ptdDelete);
  70. VOID WK32InitWowIsKnownDLL(HANDLE hKeyWow);
  71. LRESULT CALLBACK WK32ForegroundIdleHook(int code, WPARAM wParam, LPARAM lParam);
  72. VOID W32RefreshCurrentDirectories (PCHAR lpszzEnv);
  73. BOOL FASTCALL WowGetProductNameVersion(PSZ pszExePath, PSZ pszProductName,
  74. DWORD cbProductName, PSZ pszProductVersion,
  75. DWORD cbProductVersion,
  76. PSZ pszParamName, PSZ pszParamValue,
  77. DWORD cbParamValue);
  78. BOOL FASTCALL WowDoNameVersionMatch(PSZ pszExePath, PSZ pszProductName,
  79. PSZ pszProductVersion);
  80. VOID W32InitWOWSetupNames(VOID);
  81. BOOL W32IsSetupProgram(PSZ pszModName, PSZ pszFilePath);
  82. // SoftPC Routines
  83. HANDLE RegisterWOWIdle(void);
  84. VOID BlockWOWIdle(BOOL Blocking);
  85. // User32 Routines
  86. VOID ShowStartGlass (DWORD GLASSTIME);
  87. typedef struct _HMODCACHE { /* hmodcache */
  88. HAND16 hInst16;
  89. HAND16 hMod16;
  90. } HMODCACHE, *PHMODCACHE;
  91. extern HMODCACHE ghModCache[];
  92. #define CHMODCACHE 4 // size of cache table
  93. VOID RemoveHmodFromCache(HAND16 hmod16);
  94. typedef struct _CMDSHOW { /* cmdshow */
  95. WORD nTwo;
  96. WORD nCmdShow;
  97. } CMDSHOW, *PCMDSHOW;
  98. typedef struct _LOAD_MODULE_PARAMS { /* loadmoduleparms32 */
  99. LPVOID lpEnvAddress;
  100. LPSTR lpCmdLine;
  101. PCMDSHOW lpCmdShow;
  102. DWORD dwReserved;
  103. } LOAD_MODULE_PARAMS, *PLOAD_MODULE_PARAMS;
  104. typedef struct _WINOLDAP_THREAD_PARAMS {
  105. HANDLE hProcess;
  106. HWND hwndWinOldAp;
  107. } WINOLDAP_THREAD_PARAMS, *PWINOLDAP_THREAD_PARAMS;
  108. DWORD W32WinOldApThread(PWINOLDAP_THREAD_PARAMS pParams);
  109. // Globals
  110. extern INT busycount; // Used to detect if WOW is hung
  111. extern HAND16 gKillTaskID; // 16 bit tdb of task to kill
  112. extern HAND16 ghShellTDB; // TDB of WOWEXEC
  113. extern HWND ghwndShell; // Needed for ExitWindowsExec
  114. #define CMS_WAITWOWEXECTIMEOUT 60*1000 // Wait for WOWEXEC to respond
  115. #define CMS_WAITTASKEXIT 5*1000 // Hung App Wait TimeOut
  116. #define CMS_FOREVER 0xffffffff // wait for ever
  117. #define ALL_TASKS 0xffffffff // for exitvdm
  118. // IRQ: Interrupt: ICA: Line: Description:
  119. // -------------------------------------------------------------------
  120. // IRQ1 0x09 0 1 Keyboard service required.
  121. #define KEYBOARD_LINE 1
  122. #define KEYBOARD_ICA 0
  123. extern HANDLE hSharedTaskMemory;
  124. extern DWORD dwSharedProcessOffset;
  125. extern VPVOID vpDebugWOW;
  126. extern VPVOID vptopPDB;
  127. VOID CleanseSharedList( VOID );
  128. VOID AddProcessSharedList( VOID );
  129. VOID RemoveProcessSharedList( VOID );
  130. WORD AddTaskSharedList( PTD, PSZ, PSZ);
  131. VOID RemoveTaskSharedList( VOID );
  132. ULONG FASTCALL WK32WowPassEnvironment(PVDMFRAME);
  133. extern HANDLE ghTaskAppHelp; // hProcess from apphelp (see WK32SyncTask)
  134. extern BOOL gfTaskContinue; // indicates whether child thread should continue without waiting for apphelp
  135. extern const CHAR szSystem[]; // "\\system"