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.

234 lines
6.3 KiB

  1. // Copyright (c) 1998-1999 Microsoft Corporation
  2. #ifdef SORTPP_PASS
  3. #define BUILD_WOW6432 1
  4. #endif
  5. #if !defined(LANGPACK)
  6. #define LANGPACK
  7. #endif
  8. // Avoid picking up the wrong prototypes for these functions from user.h.
  9. #define fnHkOPTINLPEVENTMSG fnHkOPTINLPEVENTMSGFake
  10. #define fnHkINLPRECT fnHkINLPRECTFake
  11. #define fnHkINLPMSG fnHkINLPMSGFake
  12. #define fnHkINLPMSLLHOOKSTRUCT fnHkINLPMSLLHOOKSTRUCTFake
  13. #define fnHkINLPKBDLLHOOKSTRUCT fnHkINLPKBDLLHOOKSTRUCTFake
  14. #define fnHkINLPMOUSEHOOKSTRUCTEX fnHkINLPMOUSEHOOKSTRUCTEXFake
  15. #define fnHkINLPDEBUGHOOKSTRUCT fnHkINLPDEBUGHOOKSTRUCTFake
  16. #define fnHkINLPCBTACTIVATESTRUCT fnHkINLPCBTACTIVATESTRUCTFake
  17. #define fnHkINDWORD fnHkINDWORDFake
  18. #include <stddef.h>
  19. #include <nt.h>
  20. #include <ntrtl.h>
  21. #include <nturtl.h>
  22. #include <windef.h>
  23. #include <winbase.h>
  24. #include <wincon.h>
  25. #include <windef.h>
  26. #include <winbase.h>
  27. #include <wingdi.h>
  28. #include <winuser.h>
  29. #include <winnls.h>
  30. #include <wincon.h>
  31. #include <condll.h>
  32. #include <w32gdip.h>
  33. #include <ddrawp.h>
  34. #include <ddrawi.h>
  35. // ddrawp.h leaves INTERFACE defined to IDirectDrawGammaControl, but
  36. // ntos\inc\io.h tries to define a new datatype called INTERFACE and ends
  37. // up defining it has IDirectDrawGammaControl, which errors out.
  38. #if defined(INTERFACE)
  39. #undef INTERFACE
  40. #endif
  41. #include <winddi.h>
  42. #include <ntgdistr.h>
  43. #include <w32err.h>
  44. #include <ddeml.h>
  45. #include <ddemlp.h>
  46. #include <winuserp.h>
  47. #include <dde.h>
  48. #include <ddetrack.h>
  49. #include <kbd.h>
  50. #include <wowuserp.h>
  51. #include <vkoem.h>
  52. #include <dbt.h>
  53. // Include the DX private structure thunks
  54. #include <wow64dx.h>
  55. #ifdef SORTPP_PASS
  56. //Restore IN, OUT
  57. #ifdef IN
  58. #undef IN
  59. #endif
  60. #ifdef OUT
  61. #undef OUT
  62. #endif
  63. #define IN __in_wow64
  64. #define OUT __out_wow64
  65. #endif
  66. #include <immstruc.h>
  67. #include <immuser.h>
  68. #include <user.h>
  69. // on free builds, user.h defines DbgPrint to garbage to ensure nobody calls it. Undo that now.
  70. #if defined(DbgPrint)
  71. #undef DbgPrint
  72. #endif
  73. // user.h makes unreferenced formal parameters into errors.
  74. // ntos\inc\ke.h and others in the kernel don't expect this, so put
  75. // things back now.
  76. #pragma warning(default:4100)
  77. #include <winspool.h>
  78. #include <ntgdispl.h>
  79. #include <ntgdi.h>
  80. #include <ntuser.h>
  81. #define NOEXTAPI
  82. #include <wdbgexts.h>
  83. #include <ntdbg.h>
  84. #include <ntwow64c.h>
  85. #undef fnHkOPTINLPEVENTMSG
  86. #undef fnHkINLPRECT
  87. #undef fnHkINLPMSG
  88. #undef fnHkINLPMSLLHOOKSTRUCT
  89. #undef fnHkINLPKBDLLHOOKSTRUCT
  90. #undef fnHkINLPMOUSEHOOKSTRUCTEX
  91. #undef fnHkINLPDEBUGHOOKSTRUCT
  92. #undef fnHkINLPCBTACTIVATESTRUCT
  93. #undef fnHkINDWORD
  94. VOID Wow64Teb32(TEB * Teb);
  95. VOID
  96. NtGdiFlushUserBatch(
  97. VOID
  98. );
  99. int
  100. NtUserGetMouseMovePoints(
  101. IN UINT cbSize,
  102. IN LPMOUSEMOVEPOINT lppt,
  103. IN LPMOUSEMOVEPOINT lpptBuf,
  104. IN int nBufPoints,
  105. IN DWORD resolution
  106. );
  107. #define CLIENTSIDE 1
  108. #ifdef SORTPP_PASS
  109. #define RECVSIDE 1
  110. //
  111. // For each RECVCALL macro in ntcb.h, make a function prototype with
  112. // a reasonable name and the right datatype for the parameter. Then
  113. // use __inline to force sortpp to ignore the body of the function as
  114. // we don't want them.
  115. //
  116. #define RECVCALL(lower, upper) \
  117. DWORD lower(IN upper *pmsg); \
  118. __inline __ ## lower(upper *pmsg)
  119. #define BEGINRECV(err, p, cb) \
  120. CALLBACKSTATUS CallbackStatus;
  121. #define FIXUPPOINTERS() \
  122. ;
  123. #define ENDRECV() \
  124. return 0;
  125. #define MSGERROR() \
  126. ;
  127. #define MSGERRORCODE(code) \
  128. ;
  129. #define MSGNTERRORCODE(code) \
  130. ;
  131. #define CALLDATA(x) (pmsg->x)
  132. #define PCALLDATA(x) (&(pmsg->x))
  133. #define PCALLDATAOPT(x) (pmsg->p ## x ? (PVOID)&(pmsg->x) : NULL)
  134. #define FIRSTFIXUP(x) (pmsg->x)
  135. #define FIXUPOPT(x) (pmsg->x)
  136. #define FIRSTFIXUPOPT(x) FIXUPOPT(x)
  137. #define FIXUP(x) (pmsg->x)
  138. #define FIXUPID(x) (pmsg->x)
  139. #define FIXUPIDOPT(x) (pmsg->x)
  140. #define FIXUPSTRING(x) (pmsg->x.Buffer)
  141. #define FIXUPSTRINGID(x) (pmsg->x.Buffer)
  142. #define FIXUPSTRINGIDOPT(x) (pmsg->x.Buffer)
  143. //
  144. // Work around a '?' character some API bodies. Sortpp can't handle
  145. // them. We don't care about these functions so declaring them inline
  146. // inline is OK, and sortpp silently consumes inline functions.
  147. //
  148. #define CallHookWithSEH x; __inline CallHookWithSEHHack
  149. #define GdiAddFontResourceW(x, y, z) 0
  150. //
  151. // Wherever there's a rule, there's an exception. These don't
  152. // use the RECVCALL macros:
  153. //
  154. DWORD ClientFontSweep(PVOID p);
  155. #define __ClientFontSweep x; __inline __ClientFontSweepHack
  156. DWORD ClientLoadLocalT1Fonts(PVOID p);
  157. #define __ClientLoadLocalT1Fonts x; __inline __ClientLoadLocalT1FontsHack
  158. #define __ClientPrinterThunk x; __inline __ClientPrinterThunkHack
  159. DWORD ClientNoMemoryPopup(PVOID p);
  160. #define __ClientNoMemoryPopup x; __inline __ClientNoMemoryPopupHack
  161. DWORD ClientThreadSetup(PVOID p);
  162. #define __ClientThreadSetup x; __inline __ClientThreadSetupHack
  163. DWORD ClientDeliverUserApc(PVOID p);
  164. #define __ClientDeliverUserApc x; __inline __ClientDeliverUserApcHack
  165. DWORD ClientLoadRemoteT1Fonts(PVOID p);
  166. #define __ClientLoadRemoteT1Fonts x; __inline __ClientLoadRemoteT1Fonts
  167. #endif //SORTPP_PASS
  168. // prevent multiple definitions of this function
  169. #define GetDebugHookLParamSize __x; __inline __GetDebugHookLParamSize
  170. #include <ntcb.h>
  171. #ifdef SORTPP_PASS
  172. #undef __ClientPrinterThunk
  173. DWORD ClientPrinterThunk(IN OUT CLIENTPRINTERTHUNKMSG *pMsg);
  174. DWORD ClientLoadOLE(PVOID p);
  175. DWORD ClientRegisterDragDrop(IN HWND *phwnd);
  176. DWORD ClientRevokeDragDrop(IN HWND *phwnd);
  177. // This is the same as fnGETTEXTLENGTHS... both entries in the dispatch
  178. // table point to the same function in user32.
  179. DWORD fnGETDBCSTEXTLENGTHS(IN OUT FNGETTEXTLENGTHSMSG *pmsg);
  180. // Include the fake protypes for the message thunks.
  181. #include "..\whwin32\msgpro.h"
  182. #endif //SORTPP_PASS
  183. #include <csrhlpr.h>
  184. // on free builds, user.h defines DbgPrint to garbage to ensure nobody calls it. Undo that now.
  185. #if defined(DbgPrint)
  186. #undef DbgPrint
  187. #endif
  188. // hack for a user API that doesn't have a prototype
  189. UINT NtUserBlockInput(IN BOOL fBlockIt);
  190. // crank down some warnings that don't apply to wow64 thunks
  191. #pragma warning(4:4312) // conversion to type of greater size