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.

140 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. whwin32p.h
  5. Abstract:
  6. Private header for whwin32.
  7. Author:
  8. Revision History:
  9. --*/
  10. #define _WOW64DLLAPI_
  11. #include "nt32.h"
  12. #include "cgenhdr.h"
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <windef.h>
  16. #include "wow64thk.h"
  17. #include "cscall.h"
  18. // Make the compiler more strict.
  19. #pragma warning(1:4033) // function must return a value
  20. #pragma warning(1:4035) // no return value
  21. #pragma warning(1:4702) // Unreachable code
  22. #pragma warning(1:4705) // Statement has no effect
  23. typedef struct _NTUSERMESSAGECALL_PARMS {
  24. HWND hwnd;
  25. UINT msg;
  26. // WPARAM wParam;
  27. // LPARAM lParam;
  28. ULONG_PTR xParam;
  29. DWORD xpfnProc;
  30. BOOL bAnsi;
  31. } NTUSERMESSAGECALL_PARMS, *PNTUSERMESSAGECALL_PARMS;
  32. #define ALIGN4(X) (((X) + 3) & ~3)
  33. // Redefine WOW64_ISPTR to be the USER32 IS_PTR
  34. #undef WOW64_ISPTR
  35. #define WOW64_ISPTR IS_PTR
  36. typedef LONG_PTR (*PMSG_THUNKCB_FUNC)(WPARAM wParam, LPARAM lParam, PVOID pContext);
  37. typedef LONG_PTR (*PMSG_THUNK_FUNC)(PMSG_THUNKCB_FUNC wrapfunc, WPARAM wParam, LPARAM lParam, PVOID pContext);
  38. LONG_PTR Wow64DoMessageThunk(PMSG_THUNKCB_FUNC func, UINT msg, WPARAM wParam, LPARAM lParam, PVOID pContext);
  39. // WM_SYSTIMER messages have a kernel mode proc address
  40. // stuffed in the lParam. Forunately the address will
  41. // allways be in win32k.sys so the hi bits will be the same
  42. // for all kprocs. On the first WM_SYSTIMER message
  43. // we save the hi bits here, and restore them when we go
  44. // back to the kernel.
  45. extern DWORD gdwWM_SYSTIMERProcHiBits;
  46. #if DBG
  47. extern CHAR* apszSimpleCallNames[];
  48. #endif
  49. extern CONST ULONG ulMaxSimpleCall;
  50. #if defined(WOW64DOPROFILE)
  51. extern WOW64SERVICE_PROFILE_TABLE_ELEMENT SimpleCallProfileElements[];
  52. extern WOW64SERVICE_PROFILE_TABLE NtUserCallNoParamProfileTable;
  53. extern WOW64SERVICE_PROFILE_TABLE NtUserCallOneParamProfileTable;
  54. extern WOW64SERVICE_PROFILE_TABLE NtUserCallHwndProfileTable;
  55. extern WOW64SERVICE_PROFILE_TABLE NtUserCallHwndOptProfileTable;
  56. extern WOW64SERVICE_PROFILE_TABLE NtUserCallHwndParamProfileTable;
  57. extern WOW64SERVICE_PROFILE_TABLE NtUserCallHwndLockProfileTable;
  58. extern WOW64SERVICE_PROFILE_TABLE NtUserCallHwndParamLockProfileTable;
  59. extern WOW64SERVICE_PROFILE_TABLE NtUserCallTwoParamProfileTable;
  60. #endif
  61. PMSG Wow64ShallowThunkMSG32TO64(PMSG pMsg64, NT32MSG *pMsg32);
  62. NT32MSG *Wow64ShallowThunkMSG64TO32(NT32MSG *pMsg32, PMSG pMsg64);
  63. PEVENTMSG Wow64ShallowThunkEVENTMSG32TO64(PEVENTMSG pMsg64, NT32EVENTMSG *pMsg32);
  64. NT32EVENTMSG *Wow64ShallowThunkEVENTMSG64TO32(NT32EVENTMSG *pMsg32, PEVENTMSG pMsg64);
  65. LPHELPINFO Wow64ShallowAllocThunkHELPINFO32TO64(NT32HELPINFO *pHelp32);
  66. NT32HELPINFO *Wow64ShallowAllocThunkHELPINFO64TO32(LPHELPINFO pHelp64);
  67. LPHLP Wow64ShallowAllocThunkHLP32TO64(NT32HLP *pHlp32);
  68. NT32HLP *Wow64ShallowAllocThunkHLP64TO32(LPHLP pHlp64);
  69. PWND Wow64ValidateHwnd(HWND h);
  70. // prototypes for DX thunk helpers
  71. VOID Wow64GdiDdThunkSurfaceHandlesPreCall(
  72. IN OUT HANDLE **pSurface,
  73. IN NT32HANDLE *pSurfaceHost,
  74. IN DWORD dwCount
  75. );
  76. VOID Wow64GdiDdThunkSurfaceLocalPreCall(
  77. IN OUT PDD_SURFACE_LOCAL * pDdSurfaceLocal,
  78. IN struct NT32_DD_SURFACE_LOCAL * pDdSurfaceLocal32,
  79. IN DWORD dwCount
  80. );
  81. VOID Wow64GdiDdThunkSurfaceLocalPostCall(
  82. IN OUT PDD_SURFACE_LOCAL pDdSurfaceLocal,
  83. IN struct NT32_DD_SURFACE_LOCAL * pDdSurfaceLocal32,
  84. IN DWORD dwCount
  85. );
  86. VOID Wow64GdiDdThunkSurfaceGlobalPreCall(
  87. IN OUT PDD_SURFACE_GLOBAL * pDdSurfaceGlobal,
  88. IN struct NT32_DD_SURFACE_GLOBAL * pDdSurfaceGlobal32,
  89. IN DWORD dwCount
  90. );
  91. VOID Wow64GdiDdThunkSurfaceGlobalPostCall(
  92. IN PDD_SURFACE_GLOBAL pDdSurfaceGlobal,
  93. IN OUT struct NT32_DD_SURFACE_GLOBAL * pDdSurfaceGlobal32,
  94. IN DWORD dwCount
  95. );
  96. VOID Wow64GdiDdThunkSurfaceMorePreCall(
  97. IN OUT PDD_SURFACE_MORE * pDdSurfaceMore,
  98. IN struct NT32_DD_SURFACE_MORE * pDdSurfaceMore32,
  99. IN DWORD dwCount
  100. );
  101. VOID Wow64GdiDdThunkBltDataPreCall(
  102. IN OUT PDD_BLTDATA * pDdBltData,
  103. IN struct NT32_DD_BLTDATA * pDdBltData32
  104. );
  105. VOID Wow64GdiDdThunkSurfaceDescriptionPreCall(
  106. IN OUT DDSURFACEDESC ** pDdSurfaceDesc,
  107. IN struct NT32_DDSURFACEDESC * pDdSurfaceDesc32,
  108. IN DWORD bThunkAsSurfaceDesc2,
  109. IN DWORD dwCount
  110. );