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.

228 lines
8.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: stkswtch.h
  7. //
  8. // Contents: Stack Switching proto types and macros
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 12-10-94 JohannP (Johann Posch) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef _STKSWTCH_
  18. #define _STKSWTCH_
  19. #ifdef _CHICAGO_
  20. extern "C" DWORD NEAR _cdecl SSCall(DWORD cbParamBytes,
  21. DWORD flags,
  22. LPVOID lpfnProcAddress,
  23. DWORD param1,...);
  24. #define SSF_BigStack 1
  25. #define SSF_SmallStack 0
  26. extern "C" BOOL WINAPI SSOnBigStack(VOID);
  27. DECLARE_DEBUG(Stack)
  28. #define DEB_STCKSWTCH DEB_USER1
  29. #define SSOnSmallStack() (!SSOnBigStack())
  30. #if DBG==1
  31. extern BOOL fSSOn;
  32. #define SSONBIGSTACK() (fSSOn && IsWOWThread() && SSOnBigStack())
  33. #define SSONSMALLSTACK() (fSSOn && IsWOWThread() && !SSOnBigStack())
  34. #define StackAssert(x) ((fSSOn && IsWOWThread())? Win4Assert(x): TRUE)
  35. #define StackDebugOut(x) StackInlineDebugOut x
  36. #else
  37. #define SSONBIGSTACK() (IsWOWThread() && SSOnBigStack())
  38. #define SSONSMALLSTACK() (IsWOWThread() && !SSOnBigStack())
  39. #define StackAssert(x)
  40. #define StackDebugOut(x)
  41. #endif
  42. LRESULT WINAPI SSSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
  43. BOOL WINAPI SSReplyMessage(LRESULT lResult);
  44. LRESULT WINAPI SSCallWindowProc(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
  45. LRESULT WINAPI SSDefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
  46. BOOL WINAPI SSPeekMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax,UINT wRemoveMsg);
  47. BOOL WINAPI SSGetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
  48. LONG WINAPI SSDispatchMessage(CONST MSG *lpMsg);
  49. DWORD WINAPI SSMsgWaitForMultipleObjects(DWORD nCount, LPHANDLE pHandles, BOOL fWaitAll, DWORD dwMilliseconds, DWORD dwWakeMask);
  50. BOOL WINAPI SSWaitMessage(VOID);
  51. BOOL WINAPI SSDirectedYield(HTASK htask);
  52. int WINAPI SSDialogBoxParam(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
  53. int WINAPI SSDialogBoxIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATEA hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
  54. #define SSDialogBox(a,b,c,d) \
  55. SSDialogBoxParam(a,b,c,d, 0L)
  56. #define SSDialogBoxIndirect(a,b,c,d) \
  57. SSDialogBoxIndirectParam(a,b,c,d,e, 0L)
  58. HWND WINAPI SSCreateWindowExA(DWORD dwExStyle,
  59. LPCSTR lpClassName,LPCSTR lpWindowName,
  60. DWORD dwStyle,int X,int Y,int nWidth,int nHeight,
  61. HWND hWndParent ,HMENU hMenu,HINSTANCE hInstance,
  62. LPVOID lpParam);
  63. HWND WINAPI SSCreateWindowExW(DWORD dwExStyle,
  64. LPCWSTR lpClassName,LPCWSTR lpWindowName,
  65. DWORD dwStyle, int X, int Y, int nWidth,int nHeight,
  66. HWND hWndParent ,HMENU hMenu,HINSTANCE hInstance,
  67. LPVOID lpParam);
  68. BOOL WINAPI SSDestroyWindow(HWND hWnd);
  69. int WINAPI SSMessageBox(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption, UINT uType);
  70. BOOL WINAPI SSOpenClipboard(HWND hWndNewOwner);
  71. BOOL WINAPI SSCloseClipboard(VOID);
  72. HWND WINAPI SSGetClipboardOwner(VOID);
  73. HANDLE WINAPI SSSetClipboardData(UINT uFormat,HANDLE hMem);
  74. HANDLE WINAPI SSGetClipboardData(UINT uFormat);
  75. UINT WINAPI SSRegisterClipboardFormatA(LPCSTR lpszFormat);
  76. UINT WINAPI SSEnumClipboardFormats(UINT format);
  77. int WINAPI SSGetClipboardFormatNameA(UINT format,LPSTR lpszFormatName,int cchMaxCount);
  78. BOOL WINAPI SSEmptyClipboard(VOID);
  79. BOOL WINAPI SSIsClipboardFormatAvailable(UINT format);
  80. BOOL WINAPI SSCreateProcessA(
  81. LPCSTR lpApplicationName,
  82. LPSTR lpCommandLine,
  83. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  84. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  85. BOOL bInheritHandles,
  86. DWORD dwCreationFlags,
  87. LPVOID lpEnvironment,
  88. LPCSTR lpCurrentDirectory,
  89. LPSTARTUPINFOA lpStartupInfo,
  90. LPPROCESS_INFORMATION lpProcessInformation);
  91. BOOL WINAPI SSInSendMessage(VOID);
  92. DWORD WINAPI SSInSendMessageEx(LPVOID);
  93. #if 0
  94. #undef SendMessage
  95. #undef ReplyMessage
  96. #undef CallWindowProc
  97. #undef DefWindowProc
  98. #undef PeekMessage
  99. #undef GetMessage
  100. #undef DispatchMessage
  101. #undef WaitMessage
  102. #undef MsgWaitForMultipleObjects
  103. #undef DialogBoxParam
  104. #undef DialogBoxIndirectParam
  105. #undef CreateWindowExA
  106. #undef CreateWindowExW
  107. #undef DestroyWindow
  108. #undef MessageBox
  109. //
  110. #undef OpenClipboard
  111. #undef CloseClipboard
  112. #undef GetClipboardOwner
  113. #undef SetClipboardData
  114. #undef RegisterClipboardFormatA
  115. #undef EnumClipboardFormats
  116. #undef GetClipboardFormatNameA
  117. #undef EmptyClipboard
  118. #undef IsClipboardFormatAvailable
  119. #undef CreateProcessA
  120. #undef InSendMessage
  121. #undef InSendMessageEx
  122. // Define all user APIs to an undefined function to
  123. // force an compiling error.
  124. #define SS_STOP_STR USE_SS_API_INSTEAD /* error: Stack Switching: Please use SSxxx APIS! */
  125. #define SendMessage( hWnd, Msg, wParam, lParam) SS_STOP_STR
  126. #define ReplyMessage( lResult) SS_STOP_STR
  127. #define CallWindowProc( lpPrevWndFunc, hWnd, Msg, wParam, lParam) SS_STOP_STR
  128. #define DefWindowProc( hWnd, Msg, wParam, lParam) SS_STOP_STR
  129. #define PeekMessage( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg) SS_STOP_STR
  130. #define GetMessage( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax) SS_STOP_STR
  131. #define DispatchMessage( lpMsg) SS_STOP_STR
  132. #define WaitMessage() SS_STOP_STR
  133. #define MsgWaitForMultipleObjects(nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask) SS_STOP_STR
  134. #define DialogBoxParam( hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwInitParam) SS_STOP_STR
  135. #define DialogBoxIndirectParam( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam) SS_STOP_STR
  136. #define CreateWindowExA( dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent , hMenu, hInstance, lpParam) SS_STOP_STR
  137. #define CreateWindowExW( dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent , hMenu, hInstance, lpParam) SS_STOP_STR
  138. #define DestroyWindow( hWnd) SS_STOP_STR
  139. #define MessageBox( hWnd, lpText, lpCaption, uType) SS_STOP_STR
  140. //
  141. #define OpenClipboard( hWndNewOwner) SS_STOP_STR
  142. #define CloseClipboard() SS_STOP_STR
  143. #define GetClipboardOwner() SS_STOP_STR
  144. #define SetClipboardData( uFormat, hMem) SS_STOP_STR
  145. #define RegisterClipboardFormatA(lpszFormat) SS_STOP_STR
  146. #define EnumClipboardFormats( format) SS_STOP_STR
  147. #define GetClipboardFormatNameA( format, lpszFormatName, cchMaxCount) SS_STOP_STR
  148. #define EmptyClipboard() SS_STOP_STR
  149. #define IsClipboardFormatAvailable( format) SS_STOP_STR
  150. #define CreateProcessA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation) SS_STOP_STR
  151. #define InSendMessage() SS_STOP_STR
  152. #define InSendMessageEx(lpResvd) SS_STOP_STR
  153. #endif // 0
  154. #else // ! _CHICAGO
  155. // For non-chicago platrforms: define all SSxxx APIs
  156. // back to the original user api
  157. #define SSSendMessage SendMessage
  158. #define SSReplyMessage ReplyMessage
  159. #define SSCallWindowProc CallWindowProc
  160. #define SSDefWindowProc DefWindowProc
  161. #define SSPeekMessage PeekMessage
  162. #define SSGetMessage GetMessage
  163. #define SSDispatchMessage DispatchMessage
  164. #define SSWaitMessage WaitMessage
  165. #define SSMsgWaitForMultipleObjects MsgWaitForMultipleObjects
  166. #define SSDirectedYield DirectedYield
  167. #define SSDialogBoxParam DialogBoxParam
  168. #define SSDialogBoxIndirectParam DialogBoxIndirectParam
  169. #define SSCreateWindowExA CreateWindowExA
  170. #define SSCreateWindowExW CreateWindowExW
  171. #define SSDestroyWindow DestroyWindow
  172. #define SSMessageBox MessageBox
  173. #define SSOpenClipboard OpenClipboard
  174. #define SSCloseClipboard CloseClipboard
  175. #define SSGetClipboardOwner GetClipboardOwner
  176. #define SSSetClipboardData SetClipboardData
  177. #define SSGetClipboardData GetClipboardData
  178. #define SSRegisterClipboardFormatA RegisterClipboardFormatA
  179. #define SSEnumClipboardFormats EnumClipboardFormats
  180. #define SSGetClipboardFormatNameA GetClipboardFormatNameA
  181. #define SSEmptyClipboard EmptyClipboard
  182. #define SSIsClipboardFormatAvailable IsClipboardFormatAvailable
  183. #define SSCreateProcessA CreateProcessA
  184. #define SSInSendMessage InSendMessage
  185. #define SSInSendMessageEx InSendMessageEx
  186. #endif // _CHICAGO_
  187. #ifdef _CHICAGO_
  188. #define SSAPI(x) SS##x
  189. #else
  190. #define SSAPI(x) x
  191. #define StackDebugOut(x)
  192. #define StackAssert(x)
  193. #define SSOnSmallStack()
  194. #endif // _CHICAGO_
  195. #endif // _STKSWTCH_