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.

640 lines
13 KiB

  1. __foldwin32sstuff __foldwin32sstuff;
  2. foldstyleinitialization = true;
  3. /*
  4. * More USER flat-thunks. Created because usrfthk.thk was nearing
  5. * the 256 per-script limit.
  6. */
  7. enablemapdirect3216 = true;
  8. flatthunks = true;
  9. #include "types.thk"
  10. #include "usrtypes.thk"
  11. #include "usrftype.thk"
  12. INT ShowCursor(BOOL bShow) =
  13. INT ShowCursor(BOOL bShow)
  14. {
  15. faulterrorcode = 0;
  16. }
  17. BOOL SetDoubleClickTime(UINT uTime) =
  18. BOOL SetDoubleClickTime(UINT uTime)
  19. {
  20. faulterrorcode = 0;
  21. }
  22. /*
  23. * BOGUS
  24. * Implement natively in User32
  25. */
  26. LONG MapWindowPoints(HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT cpt) =
  27. LONG MapWindowPoints(HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT cpt)
  28. {
  29. lppt = inout;
  30. cpt = countof lppt;
  31. faulterrorcode = 0;
  32. }
  33. DWORD GetPriorityClipboardFormat(INT *lpList, UINT count) =
  34. DWORD GetPriorityClipboardFormat(INT *lpList, UINT count)
  35. {
  36. count = countof lpList;
  37. faulterrorcode = 0;
  38. }
  39. LONG TabbedTextOut(HDC, INT, INT, LPSTR, INT, UINT cTabs, LPINT lpTabs, INT) =
  40. LONG TabbedTextOutA(HDC, INT, INT, LPSTR, INT, UINT cTabs, LPINT lpTabs, INT)
  41. {
  42. cTabs = countof lpTabs;
  43. faulterrorcode = 0;
  44. }
  45. DWORD GetTabbedTextExtent(HDC, LPSTR, INT, UINT cTabs, LPINT lpTabs) =
  46. DWORD GetTabbedTextExtentA(HDC, LPSTR, INT, UINT cTabs, LPINT lpTabs)
  47. {
  48. cTabs = countof lpTabs;
  49. faulterrorcode = 0;
  50. }
  51. HICON CreateIconFromResourceEx(LPVOID lpIconBits, DWORD cbIconBits, BOOL, DWORD, UINT, UINT, UINT) =
  52. HICON CreateIconFromResourceEx(LPVOID lpIconBits, DWORD cbIconBits, BOOL, DWORD, UINT, UINT, UINT)
  53. {
  54. faulterrorcode = 0;
  55. }
  56. HICON CopyImage(HINSTANCE hInstOwner, HICON, UINT, INT, INT, UINT) =
  57. HICON RealCopyImage(HINSTANCE hInstOwner, HICON, UINT, INT, INT, UINT)
  58. {
  59. faulterrorcode = 0;
  60. }
  61. BOOL SetSysColors(UINT nChanges, LPINT lpSysColor, LONG *) =
  62. BOOL SetSysColors(UINT nChanges, LPINT lpSysColor, LONG *)
  63. {
  64. nChanges = countof lpSysColor;
  65. faulterrorcode = 0;
  66. }
  67. HANDLE SetSysColorsTemp(LONG *, LPINT lpSysBrushes, UINT wCnt) =
  68. HANDLE SetSysColorsTemp(LONG *, LPINT lpSysBrushes, UINT wCnt)
  69. {
  70. wCnt = countof lpSysBrushes;
  71. faulterrorcode = 0;
  72. }
  73. WORD CascadeWindows(HWND hwndParent, UINT wHow, LPRECT lpRect, UINT cKids, LPHWND lpKids) =
  74. WORD CascadeWindows(HWND hwndParent, UINT wHow, LPRECT lpRect, UINT cKids, LPHWND lpKids)
  75. {
  76. cKids = countof lpKids;
  77. faulterrorcode = 0;
  78. }
  79. WORD TileWindows(HWND hwndParent, UINT wHow, LPRECT lpRect, UINT cKids, LPHWND lpKids) =
  80. WORD TileWindows(HWND hwndParent, UINT wHow, LPRECT lpRect, UINT cKids, LPHWND lpKids)
  81. {
  82. cKids = countof lpKids;
  83. faulterrorcode = 0;
  84. }
  85. BOOL DragDetect(HWND, POINT) =
  86. BOOL DragDetect(HWND, POINT)
  87. {
  88. faulterrorcode = 0;
  89. }
  90. LONG DragObject(HWND, HWND, UINT, DWORD, HCURSOR) =
  91. LONG DragObject(HWND, HWND, UINT, DWORD, HCURSOR)
  92. {
  93. faulterrorcode = 0;
  94. }
  95. HWND GetNextQueueWindow(HWND hWnd, int nCmd)=
  96. HWND GetNextQueueWindow(HWND hWnd, int nCmd)
  97. {
  98. faulterrorcode = 0;
  99. }
  100. BOOL FakeSetWindowPlacement(HWND hwnd, LPWINDOWPLACEMENT lpwndpl) =
  101. BOOL SetWindowPlacement(HWND hwnd, LPWINDOWPLACEMENT lpwndpl)
  102. {
  103. faulterrorcode = 0;
  104. }
  105. BOOL FakeGetWindowPlacement(HWND hwnd, LPWINDOWPLACEMENT lpwndpl) =
  106. BOOL GetWindowPlacement(HWND hwnd, LPWINDOWPLACEMENT lpwndpl)
  107. {
  108. lpwndpl = inout;
  109. faulterrorcode = 0;
  110. }
  111. INT UnhookWindowsHookEx(DWORD hhk) =
  112. INT UnhookWindowsHookEx(DWORD hhk)
  113. {
  114. faulterrorcode = 0;
  115. }
  116. BOOL CloseClipboard( ) =
  117. BOOL CloseClipboard( )
  118. {
  119. faulterrorcode = 0;
  120. }
  121. BOOL OpenClipboard(HWND) =
  122. BOOL OpenClipboard(HWND)
  123. {
  124. faulterrorcode = 0;
  125. }
  126. HCURSOR FakeSetCursor(HCURSOR) =
  127. HCURSOR SetCursor(HCURSOR)
  128. {
  129. faulterrorcode = 0;
  130. }
  131. DWORD GetMenuState(HMENU, UINT, UINT) =
  132. DWORD GetMenuState(HMENU, UINT, UINT)
  133. {
  134. faulterrorcode = -1;
  135. }
  136. DWORD GetMenuItemID(HMENU, INT) =
  137. DWORD GetMenuItemID(HMENU, INT)
  138. {
  139. faulterrorcode = -1;
  140. }
  141. DWORD EnableMenuItem(HMENU, UINT, UINT) =
  142. DWORD EnableMenuItem(HMENU, UINT, UINT)
  143. {
  144. faulterrorcode = 0;
  145. }
  146. DWORD CheckMenuItem( HMENU hMenu, WORD wIDCheckItem, WORD wCheck) =
  147. DWORD CheckMenuItem( HMENU hMenu, UINT wIDCheckItem, UINT wCheck)
  148. {
  149. faulterrorcode = -1;
  150. }
  151. BOOL CheckMenuRadioItem( HMENU, UINT, UINT, UINT, UINT) =
  152. BOOL CheckMenuRadioItem( HMENU, UINT, UINT, UINT, UINT)
  153. {
  154. faulterrorcode = 0;
  155. }
  156. INT MessageBoxEx_R(HWND, LPSTR, LPSTR, DWORD, WORD, WORD, DWORD) =
  157. INT MessageBoxExA_R(HWND, LPSTR, LPSTR, DWORD, WORD, WORD, DWORD)
  158. {
  159. faulterrorcode = 0;
  160. }
  161. INT LookupIconIdFromDirectoryEx(LPSTR, BOOL, INT, INT, UINT) =
  162. INT LookupIconIdFromDirectoryEx(LPSTR, BOOL, INT, INT, UINT)
  163. {
  164. faulterrorcode = 0;
  165. }
  166. /* 16-bit one is in keyboard.drv, not user.exe */
  167. UINT GetKBCodePage() =
  168. UINT GetKBCodePage()
  169. {
  170. faulterrorcode = 0;
  171. }
  172. INT GetKeyboardType(INT)=
  173. INT GetKeyboardType(INT)
  174. {
  175. faulterrorcode = 0;
  176. }
  177. INT FakeMessageBoxIndirect(LPMSGBOXPARAMS, WORD, DWORD) =
  178. INT FakeMessageBoxIndirectA(LPMSGBOXPARAMS, WORD, DWORD)
  179. {
  180. /* Need to thunk callback on 16-bit side */
  181. faulterrorcode = 0;
  182. }
  183. WORD FakeRegisterClassEx(LPWNDCLASSEX) =
  184. DWORD RegisterClassExA(LPWNDCLASSEX)
  185. {
  186. /* Need to thunk callback on 16-bit side */
  187. faulterrorcode = 0;
  188. }
  189. HWND FakeCreateDialogParam(HINSTANCE, LPSTR, HWND, DWORD pfn, LONG) =
  190. HWND CreateDialogParamA(HINSTANCE, LPSTR, HWND, DWORD pfn, LONG)
  191. {
  192. /* Need to thunk pfn on 16-bit side */
  193. faulterrorcode = 0;
  194. }
  195. DWORD FakeDialogBoxParam(HINSTANCE, LPSTR, HWND, DWORD pfn, DWORD) =
  196. DWORD DialogBoxParamA(HINSTANCE, LPSTR, HWND, DWORD pfn, DWORD)
  197. {
  198. /* Need to thunk pfn on 16-bit side */
  199. faulterrorcode = -1;
  200. }
  201. BOOL FakeGrayString(HDC, HBRUSH, DWORD lpDrawProc, LPSTR, INT, INT, INT, INT,
  202. INT) =
  203. BOOL GrayStringA(HDC, HBRUSH, DWORD lpDrawProc, LPSTR, INT, INT, INT, INT,
  204. INT)
  205. {
  206. /* Need to thunk lpDrawProc on 16-bit side */
  207. faulterrorcode = 0;
  208. }
  209. BOOL FakeDrawState(HDC, HBRUSH, DWORD lpDrawProc, LPSTR, UINT, INT, INT,
  210. INT, INT, UINT) =
  211. BOOL DrawStateA(HDC, HBRUSH, DWORD lpDrawProc, LPSTR, UINT, INT, INT,
  212. INT, INT, UINT)
  213. {
  214. /* Need to thunk lpDrawProc on 16-bit side. */
  215. /* NOTE THAT DOING A MAPLS ON lpData IS COOL: */
  216. /* * If a string, then great */
  217. /* * If other known things, then HIWORD is 0, and mapping is a nop */
  218. /* * If complex, then in lpDrawProc MAPSL undoes mapping */
  219. faulterrorcode = 0;
  220. }
  221. DWORD FakeSetTimer(HWND, DWORD, DWORD, DWORD lpTimerFunc) =
  222. DWORD SetTimer(HWND, DWORD, DWORD, DWORD lpTimerFunc)
  223. {
  224. /* Need to thunk lpTimerFunc on 16-bit side */
  225. faulterrorcode = 0;
  226. }
  227. INT FakeEnumProps(HWND, DWORD lpEnumFunc) =
  228. INT EnumPropsA(HWND, DWORD lpEnumFunc)
  229. {
  230. /* Need to thunk lpEnumFunc on 16-bit side */
  231. /* Also passes 0L lParam & extra flags to EnumPropsEx() */
  232. faulterrorcode = -1;
  233. }
  234. INT FakeEnumPropsEx(HWND, DWORD lpEnumFunc, DWORD lParam) =
  235. INT EnumPropsExA(HWND, DWORD lpEnumFunc, DWORD lParam)
  236. {
  237. /* Need to thunk lpEnumFunc on 16-bit side */
  238. /* Also passes extra flags to EnumPropsEx() */
  239. faulterrorcode = -1;
  240. }
  241. /*
  242. * This takes care of
  243. * EnumThreadWindows
  244. * EnumTaskWindows (== EnumThreadWindows)
  245. * EnumWindows
  246. * EnumChildWindows
  247. */
  248. BOOL FakeEnumWindowsEx(DWORD, HWND, DWORD lpEnumFunc, DWORD) =
  249. BOOL EnumWindowsEx(DWORD, HWND, DWORD lpEnumFunc, DWORD)
  250. {
  251. /* Need to thunk lpEnumFunc on 16-bit side */
  252. faulterrorcode = 0;
  253. }
  254. UINT FakeDdeInitialize(LPDWORD, DWORD pfnCallback, DWORD, DWORD) =
  255. UINT DdeInitializeA(LPDWORD, DWORD pfnCallback, DWORD, DWORD)
  256. {
  257. /* Need to thunk pfnCallback on 16-bit side */
  258. faulterrorcode = 16390; //DMLERR_INVALIDPARAMETER
  259. }
  260. BOOL IsHungThread(DWORD dwThreadID) =
  261. BOOL IsHungThread(DWORD dwThreadID)
  262. {
  263. faulterrorcode = 0;
  264. }
  265. DWORD EndTask(HWND, DWORD, LPSTR, DWORD) =
  266. DWORD EndTask(HWND, DWORD, LPSTR, DWORD)
  267. {
  268. faulterrorcode = 0;
  269. }
  270. VOID RegisterNetworkCapabilities(DWORD, DWORD) =
  271. VOID RegisterNetworkCapabilities(DWORD, DWORD)
  272. {
  273. faulterrorcode = 0;
  274. }
  275. BOOL CascadeChildWindows(HWND, UINT) =
  276. BOOL CascadeChildWindows(HWND, UINT)
  277. {
  278. faulterrorcode = 0;
  279. }
  280. BOOL TileChildWindows(HWND, UINT) =
  281. BOOL TileChildWindows(HWND, UINT)
  282. {
  283. faulterrorcode = 0;
  284. }
  285. BOOL DrawCaptionTemp(HWND, HDC, LPRECT, HFONT, HICON, LPSTR, UINT) =
  286. BOOL DrawCaptionTempA(HWND, HDC, LPRECT, HFONT, HICON, LPSTR, UINT)
  287. {
  288. faulterrorcode = 0;
  289. }
  290. int DrawMenuBarTemp(HWND, HDC, LPRECT, HMENU, HFONT) =
  291. int DrawMenuBarTemp(HWND, HDC, LPRECT, HMENU, HFONT)
  292. {
  293. faulterrorcode = 0;
  294. }
  295. BOOL RegisterHotKey(HWND, DWORD, UINT, UINT) =
  296. BOOL RegisterHotKey(HWND, DWORD, UINT, UINT)
  297. {
  298. faulterrorcode = 0;
  299. }
  300. BOOL UnregisterHotKey(HWND, DWORD) =
  301. BOOL UnregisterHotKey(HWND, DWORD)
  302. {
  303. faulterrorcode = 0;
  304. }
  305. BOOL SetSystemCursor(HCURSOR, DWORD) =
  306. BOOL SetSystemCursor(HCURSOR, DWORD)
  307. {
  308. faulterrorcode = 0;
  309. }
  310. DWORD ChangeDisplaySettings(LPVOID, DWORD) =
  311. DWORD ChangeDisplaySettingsA(LPVOID, DWORD)
  312. {
  313. faulterrorcode = 0;
  314. }
  315. DWORD ChangeDisplaySettingsEx(LPSTR,LPVOID,HWND,DWORD,LPVOID) =
  316. DWORD ChangeDisplaySettingsExA(LPSTR,LPVOID,HWND,DWORD,LPVOID)
  317. {
  318. faulterrorcode = 0;
  319. }
  320. BOOL EnumDisplaySettings(LPSTR, DWORD, LPVOID) =
  321. BOOL EnumDisplaySettingsA(LPSTR, DWORD, LPVOID)
  322. {
  323. faulterrorcode = 0;
  324. }
  325. BOOL EnumDisplaySettingsEx(LPSTR, DWORD, LPVOID, DWORD) =
  326. BOOL EnumDisplaySettingsExA(LPSTR, DWORD, LPVOID, DWORD)
  327. {
  328. faulterrorcode = 0;
  329. }
  330. UINT InitThreadInput(WORD, UINT) =
  331. UINT InitThreadInput(DWORD, UINT)
  332. {
  333. faulterrorcode = 0;
  334. }
  335. //
  336. // Multiple Monitor Support
  337. //
  338. HMONITOR MonitorFromPoint(POINT, UINT) =
  339. HMONITOR MonitorFromPoint(POINT, UINT)
  340. {
  341. faulterrorcode = 0;
  342. }
  343. HMONITOR MonitorFromWindow(HWND, UINT) =
  344. HMONITOR MonitorFromWindow(HWND, UINT)
  345. {
  346. faulterrorcode = 0;
  347. }
  348. HMONITOR MonitorFromRect(LPRECT, UINT) =
  349. HMONITOR MonitorFromRect(LPRECT, UINT)
  350. {
  351. faulterrorcode = 0;
  352. }
  353. BOOL GetMonitorInfo(HMONITOR hMonitor, LPVOID lpMonitorInfo) =
  354. BOOL GetMonitorInfoA(HMONITOR hMonitor, LPVOID lpMonitorInfo)
  355. {
  356. faulterrorcode = 0;
  357. }
  358. BOOL EnumDisplayDevices(LPVOID Unused, DWORD iDevNum, LPVOID lpDisplayDevice, DWORD dwFlags) =
  359. BOOL EnumDisplayDevicesA(LPVOID Unused, DWORD iDevNum, LPVOID lpDisplayDevice, DWORD dwFlags)
  360. {
  361. faulterrorcode = 0;
  362. }
  363. BOOL FakeEnumDisplayMonitors(HDC, LPRECT, DWORD, DWORD) =
  364. BOOL EnumDisplayMonitors(HDC, LPRECT, DWORD, DWORD)
  365. {
  366. faulterrorcode = 0;
  367. }
  368. //
  369. // WINABLE
  370. // For ACTIVE ACCESSIBILITY
  371. //
  372. //
  373. // PUBLIC: NotifyWinEvent()
  374. //
  375. VOID SimpleNotifyWinEvent(DWORD, DWORD, DWORD, DWORD) =
  376. VOID FakeNotifyWinEvent(DWORD, DWORD, DWORD, DWORD)
  377. {
  378. }
  379. //
  380. // PUBLIC: SetWinEventHook() is NOT in USRTHK.THK like other callback goop.
  381. //
  382. DWORD SetWinEventHook(DWORD eventMin, DWORD eventMax, DWORD hModule,
  383. DWORD lpfnHook, DWORD idProcess, DWORD idThread, DWORD dwFlags) =
  384. DWORD FakeSetWinEventHook(DWORD eventMin, DWORD eventMax, DWORD hModule,
  385. DWORD lpfnHook, DWORD idProcess, DWORD idThread, DWORD dwFlags)
  386. {
  387. faulterrorcode = 0;
  388. }
  389. //
  390. // PUBLIC: UnhookWinEvent()
  391. //
  392. BOOL UnhookWinEvent(DWORD hEvent) =
  393. BOOL UnhookWinEvent(DWORD hEvent)
  394. {
  395. faulterrorcode = 0;
  396. }
  397. //
  398. // PUBLIC: GetWindowModuleFileName()
  399. //
  400. UINT GetWindowModuleFileName(HWND, LPSTR, UINT) =
  401. UINT GetWindowModuleFileNameA(HWND, LPSTR, UINT)
  402. {
  403. faulterrorcode = 0;
  404. }
  405. //
  406. // PUBLIC: GetGUIThreadInfo()
  407. //
  408. BOOL GetGUIThreadInfo(DWORD, LPGUITHREADINFO lpGuiInfo) =
  409. BOOL GetGUIThreadInfo(DWORD, LPGUITHREADINFO lpGuiInfo)
  410. {
  411. lpGuiInfo = inout;
  412. faulterrorcode = 0;
  413. }
  414. //
  415. // PUBLIC: GetCursorInfo()
  416. //
  417. BOOL GetCursorInfo(LPCURSORINFO lpCursorInfo) =
  418. BOOL GetCursorInfo(LPCURSORINFO lpCursorInfo)
  419. {
  420. lpCursorInfo = inout;
  421. faulterrorcode = 0;
  422. }
  423. //
  424. // PUBLIC: BlockInput()
  425. //
  426. BOOL BlockInput(BOOL fBlockIt) =
  427. BOOL BlockInput(BOOL fBlockIt)
  428. {
  429. faulterrorcode = 0;
  430. }
  431. //
  432. // PUBLIC: SendInput() The structure is a union but 32-bit and 16-bit one
  433. // are same size--so rather than complicated def use LPVOID
  434. //
  435. UINT SendInput(UINT cInputs, LPVOID rgInputs, int cbSize) =
  436. UINT SendInput(UINT cInputs, LPVOID rgInputs, int cbSize)
  437. {
  438. faulterrorcode = 0;
  439. }
  440. BOOL GetWindowInfo(HWND, LPWINDOWINFO lpwi) =
  441. BOOL GetWindowInfo(HWND, LPWINDOWINFO lpwi)
  442. {
  443. lpwi = inout;
  444. faulterrorcode = 0;
  445. }
  446. BOOL GetTitleBarInfo(HWND, LPTITLEBARINFO lpti) =
  447. BOOL GetTitleBarInfo(HWND, LPTITLEBARINFO lpti)
  448. {
  449. lpti = inout;
  450. faulterrorcode = 0;
  451. }
  452. BOOL GetScrollBarInfo(HWND, DWORD, LPSCROLLBARINFO lpsbi) =
  453. BOOL GetScrollBarInfo(HWND, DWORD, LPSCROLLBARINFO lpsbi)
  454. {
  455. lpsbi = inout;
  456. faulterrorcode = 0;
  457. }
  458. BOOL GetComboBoxInfo(HWND, LPCOMBOBOXINFO lpcbi) =
  459. BOOL GetComboBoxInfo(HWND, LPCOMBOBOXINFO lpcbi)
  460. {
  461. lpcbi = inout;
  462. faulterrorcode = 0;
  463. }
  464. HWND GetAncestor(HWND, UINT) =
  465. HWND GetAncestor(HWND, UINT)
  466. {
  467. faulterrorcode = 0;
  468. }
  469. HWND RealChildWindowFromPoint(HWND, POINT) =
  470. HWND RealChildWindowFromPoint(HWND, POINT)
  471. {
  472. faulterrorcode = 0;
  473. }
  474. UINT RealGetWindowClass(HWND, LPSTR, UINT) =
  475. UINT RealGetWindowClass(HWND, LPSTR, UINT)
  476. {
  477. faulterrorcode = 0;
  478. }
  479. BOOL GetAltTabInfo(HWND, int, LPALTTABINFO lpati, LPSTR, UINT) =
  480. BOOL GetAltTabInfo(HWND, int, LPALTTABINFO lpati, LPSTR, UINT)
  481. {
  482. lpati = inout;
  483. faulterrorcode = 0;
  484. }
  485. DWORD GetListBoxInfo(HWND) =
  486. DWORD GetListBoxInfo(HWND)
  487. {
  488. faulterrorcode = 0;
  489. }
  490. BOOL GetMenuBarInfo(HWND, long, long, LPMENUBARINFO lpmbi) =
  491. BOOL GetMenuBarInfo(HWND, long, long, LPMENUBARINFO lpmbi)
  492. {
  493. lpmbi = inout;
  494. faulterrorcode = 0;
  495. }