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.

378 lines
8.8 KiB

  1. #include "windowspch.h"
  2. #pragma hdrstop
  3. #define DUSER_EXPORTS
  4. #define GADGET_ENABLE_TRANSITIONS
  5. #include <duser.h>
  6. #include <duserctrl.h>
  7. #include <duierror.h>
  8. extern "C"
  9. {
  10. static DUSER_API BOOL WINAPI
  11. SetGadgetStyle(HGADGET hgadChange, UINT nNewStyle, UINT nMask)
  12. {
  13. SetLastError((DWORD)E_FAIL);
  14. return FALSE;
  15. }
  16. static DUSER_API HRESULT WINAPI
  17. DUserSendEvent(
  18. IN EventMsg * pmsg, // Message to send
  19. IN UINT nFlags) // Optional flags to modifying sending
  20. {
  21. return E_FAIL;
  22. }
  23. static DUSER_API HRESULT WINAPI
  24. DUserPostEvent(
  25. IN EventMsg * pmsg, // Message to post
  26. IN UINT nFlags) // Optional flags modifiying posting
  27. {
  28. return E_FAIL;
  29. }
  30. static DUSER_API BOOL WINAPI
  31. GetGadgetRect(
  32. IN HGADGET hgad, // Handle of Gadget
  33. OUT RECT * prcPxl, // Rectangle in specified pixels
  34. IN UINT nFlags) // Rectangle to retrieve
  35. {
  36. SetLastError((DWORD)E_FAIL);
  37. return FALSE;
  38. }
  39. static DUSER_API BOOL WINAPI
  40. GetGadgetRgn(
  41. IN HGADGET hgad, // Gadget to get region of
  42. IN UINT nRgnType, // Type of region
  43. OUT HRGN hrgn, // Specified region
  44. IN UINT nFlags) // Modifying flags
  45. {
  46. SetLastError((DWORD)E_FAIL);
  47. return FALSE;
  48. }
  49. static DUSER_API BOOL WINAPI
  50. GetGadgetSize(
  51. IN HGADGET hgad, // Handle of Gadget
  52. OUT SIZE * psizeLogicalPxl) // Size in logical pixels
  53. {
  54. SetLastError((DWORD)E_FAIL);
  55. return FALSE;
  56. }
  57. static DUSER_API DWORD WINAPI
  58. GetGadgetTicket(HGADGET hgad)
  59. {
  60. SetLastError((DWORD)E_FAIL);
  61. return 0;
  62. }
  63. static DUSER_API BOOL WINAPI
  64. MapGadgetPoints(HGADGET hgadFrom, HGADGET hgadTo, POINT * rgptClientPxl, int cPts)
  65. {
  66. SetLastError((DWORD)E_FAIL);
  67. return FALSE;
  68. }
  69. static DUSER_API BOOL WINAPI
  70. BuildAnimation(UINT nAniID, int nVersion, GANI_DESC * pDesc, REFIID riid, void ** ppvUnk)
  71. {
  72. SetLastError((DWORD)E_FAIL);
  73. return FALSE;
  74. }
  75. static DUSER_API BOOL WINAPI
  76. BuildInterpolation(UINT nIPolID, int nVersion, REFIID riid, void ** ppvUnk)
  77. {
  78. SetLastError((DWORD)E_FAIL);
  79. return FALSE;
  80. }
  81. static DUSER_API BOOL WINAPI
  82. DeleteHandle(
  83. IN HANDLE h) // Handle to delete
  84. {
  85. SetLastError((DWORD)E_FAIL);
  86. return FALSE;
  87. }
  88. static DUSER_API BOOL WINAPI
  89. SetGadgetFillI(HGADGET hgadChange, HBRUSH hbrFill, BYTE bAlpha, int w, int h)
  90. {
  91. SetLastError((DWORD)E_FAIL);
  92. return FALSE;
  93. }
  94. static DUSER_API BOOL WINAPI
  95. SetGadgetMessageFilter(HGADGET hgadChange, void * pvCookie, UINT nNewFilter, UINT nMask)
  96. {
  97. SetLastError((DWORD)E_FAIL);
  98. return FALSE;
  99. }
  100. static DUSER_API HGADGET WINAPI
  101. CreateGadget(
  102. IN HANDLE hParent, // Handle to parent
  103. IN UINT nFlags, // Creation flags
  104. IN GADGETPROC pfnProc, // Pointer to the Gadget procedure
  105. IN void * pvGadgetData) // User data associated with this Gadget
  106. {
  107. SetLastError((DWORD)E_FAIL);
  108. return NULL;
  109. }
  110. static DUSER_API HGADGET WINAPI
  111. FindGadgetFromPoint(
  112. IN HGADGET hgadRoot, // Root Gadget to search from
  113. IN POINT ptContainerPxl, // Point to search from in container pixels
  114. IN UINT nFlags, // Search flags
  115. OUT POINT * pptClientPxl) // Optional translated point in client pixels.
  116. {
  117. SetLastError((DWORD)E_FAIL);
  118. return NULL;
  119. }
  120. static DUSER_API HGADGET WINAPI
  121. LookupGadgetTicket(
  122. IN DWORD dwTicket) // Ticket
  123. {
  124. SetLastError((DWORD)E_FAIL);
  125. return NULL;
  126. }
  127. static DUSER_API BOOL WINAPI
  128. SetGadgetRootInfo(
  129. IN HGADGET hgadRoot, // RootGadget to modify
  130. IN const ROOT_INFO * pri) // Information
  131. {
  132. SetLastError((DWORD)E_FAIL);
  133. return FALSE;
  134. }
  135. static DUSER_API BOOL WINAPI
  136. SetGadgetParent(
  137. IN HGADGET hgadMove, // Gadget to be moved
  138. IN HGADGET hgadParent, // New parent
  139. IN HGADGET hgadOther, // Gadget to moved relative to
  140. IN UINT nCmd) // Type of move
  141. {
  142. SetLastError((DWORD)E_FAIL);
  143. return FALSE;
  144. }
  145. static DUSER_API BOOL WINAPI
  146. SetGadgetFocus(
  147. IN HGADGET hgadFocus) // Gadget to receive focus.
  148. {
  149. SetLastError((DWORD)E_FAIL);
  150. return FALSE;
  151. }
  152. static DUSER_API HGADGET WINAPI
  153. GetGadgetFocus()
  154. {
  155. SetLastError((DWORD)E_FAIL);
  156. return NULL;
  157. }
  158. static DUSER_API BOOL WINAPI
  159. InvalidateGadget(
  160. IN HGADGET hgad) // Gadget to repaint
  161. {
  162. SetLastError((DWORD)E_FAIL);
  163. return FALSE;
  164. }
  165. static DUSER_API BOOL WINAPI
  166. SetGadgetRect(
  167. IN HGADGET hgadChange, // Gadget to change
  168. IN int x, // New horizontal position
  169. IN int y, // New vertical position
  170. IN int w, // New width
  171. IN int h, // New height
  172. IN UINT nFlags) // Flags specifying what to change
  173. {
  174. SetLastError((DWORD)E_FAIL);
  175. return FALSE;
  176. }
  177. static DUSER_API UINT WINAPI
  178. FindStdColor(LPCWSTR pszName)
  179. {
  180. SetLastError((DWORD)E_FAIL);
  181. return SC_Black;
  182. }
  183. static DUSER_API HBRUSH WINAPI
  184. GetStdColorBrushI(UINT c)
  185. {
  186. SetLastError((DWORD)E_FAIL);
  187. return NULL;
  188. }
  189. static DUSER_API COLORREF WINAPI
  190. GetStdColorI(UINT c)
  191. {
  192. SetLastError((DWORD)E_FAIL);
  193. return RGB(0, 0, 0);
  194. }
  195. static DUSER_API HDCONTEXT WINAPI
  196. InitGadgets(
  197. IN INITGADGET * pInit)
  198. {
  199. SetLastError((DWORD)E_FAIL);
  200. return NULL;
  201. }
  202. static DUSER_API BOOL WINAPI
  203. UtilDrawBlendRect(HDC hdcDest, const RECT * prcDest, HBRUSH hbrFill, BYTE bAlpha, int wBrush, int hBrush)
  204. {
  205. SetLastError((DWORD)E_FAIL);
  206. return FALSE;
  207. }
  208. static DUSER_API BOOL WINAPI
  209. ForwardGadgetMessage(HGADGET hgadRoot, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT * pr)
  210. {
  211. SetLastError((DWORD)E_FAIL);
  212. return FALSE;
  213. }
  214. static DUSER_API BOOL WINAPI
  215. AttachWndProcW(HWND hwnd, ATTACHWNDPROC pfn, void * pvThis)
  216. {
  217. SetLastError((DWORD)E_FAIL);
  218. return FALSE;
  219. }
  220. static DUSER_API BOOL WINAPI
  221. DetachWndProc(HWND hwnd, ATTACHWNDPROC pfn, void * pvThis)
  222. {
  223. SetLastError((DWORD)E_FAIL);
  224. return FALSE;
  225. }
  226. static DUSER_API HACTION WINAPI
  227. CreateAction(const GMA_ACTION * pma)
  228. {
  229. SetLastError((DWORD)E_FAIL);
  230. return NULL;
  231. }
  232. static DUSER_API BOOL WINAPI
  233. BuildDropTarget(HGADGET hgadRoot, HWND hwnd)
  234. {
  235. SetLastError((DWORD)E_FAIL);
  236. return FALSE;
  237. }
  238. static DUSER_API BOOL WINAPI
  239. SetGadgetBufferInfo(
  240. IN HGADGET hgadChange, // Gadget to change
  241. IN const BUFFER_INFO * pbi) // Buffer information
  242. {
  243. SetLastError((DWORD)E_FAIL);
  244. return FALSE;
  245. }
  246. static
  247. DUSER_API
  248. DirectUI::IDebug*
  249. WINAPI
  250. GetDebug()
  251. {
  252. return NULL;
  253. }
  254. static
  255. DUSER_API
  256. BOOL
  257. WINAPI
  258. GetMessageExW(
  259. IN LPMSG lpMsg,
  260. IN HWND hWnd,
  261. IN UINT wMsgFilterMin,
  262. IN UINT wMsgFilterMax)
  263. {
  264. SetLastError(ERROR_PROC_NOT_FOUND);
  265. return FALSE;
  266. }
  267. static
  268. DUSER_API
  269. void
  270. _cdecl
  271. AutoTrace(const char* pszFormat, ...)
  272. {
  273. return;
  274. }
  275. static
  276. DUSER_API
  277. BOOL
  278. GetGadgetAnimation(
  279. HGADGET hgad,
  280. UINT nAniID,
  281. REFIID riid,
  282. void** ppvUnk
  283. )
  284. {
  285. return FALSE;
  286. }
  287. //
  288. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  289. //
  290. DEFINE_PROCNAME_ENTRIES(duser)
  291. {
  292. DLPENTRY(AttachWndProcW)
  293. DLPENTRY(AutoTrace)
  294. DLPENTRY(BuildAnimation)
  295. DLPENTRY(BuildDropTarget)
  296. DLPENTRY(BuildInterpolation)
  297. DLPENTRY(CreateAction)
  298. DLPENTRY(CreateGadget)
  299. DLPENTRY(DUserPostEvent)
  300. DLPENTRY(DUserSendEvent)
  301. DLPENTRY(DeleteHandle)
  302. DLPENTRY(DetachWndProc)
  303. DLPENTRY(FindGadgetFromPoint)
  304. DLPENTRY(FindStdColor)
  305. DLPENTRY(ForwardGadgetMessage)
  306. DLPENTRY(GetDebug)
  307. DLPENTRY(GetGadgetAnimation)
  308. DLPENTRY(GetGadgetFocus)
  309. DLPENTRY(GetGadgetRect)
  310. DLPENTRY(GetGadgetRgn)
  311. DLPENTRY(GetGadgetSize)
  312. DLPENTRY(GetGadgetTicket)
  313. DLPENTRY(GetMessageExW)
  314. DLPENTRY(GetStdColorBrushI)
  315. DLPENTRY(GetStdColorI)
  316. DLPENTRY(InitGadgets)
  317. DLPENTRY(InvalidateGadget)
  318. DLPENTRY(LookupGadgetTicket)
  319. DLPENTRY(MapGadgetPoints)
  320. DLPENTRY(SetGadgetBufferInfo)
  321. DLPENTRY(SetGadgetFillI)
  322. DLPENTRY(SetGadgetFocus)
  323. DLPENTRY(SetGadgetMessageFilter)
  324. DLPENTRY(SetGadgetParent)
  325. DLPENTRY(SetGadgetRect)
  326. DLPENTRY(SetGadgetRootInfo)
  327. DLPENTRY(SetGadgetStyle)
  328. DLPENTRY(UtilDrawBlendRect)
  329. };
  330. // BUGBUG (reinerf) - we shouldn't need the EXTERN_C below since we are already in
  331. // an extern "C" {} block, but the compiler seems to get my goat,
  332. // so I murdered his goat in a bloody melee.
  333. EXTERN_C DEFINE_PROCNAME_MAP(duser)
  334. }; // extern "C"