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.

996 lines
13 KiB

  1. #include "windowspch.h"
  2. #pragma hdrstop
  3. static
  4. BOOL
  5. WINAPI
  6. CharToOemBuffA(
  7. IN LPCSTR lpszSrc,
  8. OUT LPSTR lpszDst,
  9. IN DWORD cchDstLength
  10. )
  11. {
  12. return FALSE;
  13. }
  14. static
  15. LRESULT
  16. WINAPI
  17. DispatchMessageA(
  18. IN CONST MSG *lpMsg
  19. )
  20. {
  21. return 0;
  22. }
  23. static
  24. HWINSTA
  25. WINAPI
  26. GetProcessWindowStation(
  27. VOID
  28. )
  29. {
  30. SetLastError (ERROR_PROC_NOT_FOUND);
  31. return NULL;
  32. }
  33. static
  34. HDESK
  35. WINAPI
  36. GetThreadDesktop(
  37. IN DWORD dwThreadId
  38. )
  39. {
  40. SetLastError (ERROR_PROC_NOT_FOUND);
  41. return NULL;
  42. }
  43. static
  44. BOOL
  45. WINAPI
  46. IsWindow(
  47. IN HWND hWnd
  48. )
  49. {
  50. return FALSE;
  51. }
  52. static
  53. int
  54. WINAPI
  55. LoadStringA(
  56. IN HINSTANCE hInstance,
  57. IN UINT uID,
  58. OUT LPSTR lpBuffer,
  59. IN int nBufferMax
  60. )
  61. {
  62. SetLastError (ERROR_PROC_NOT_FOUND);
  63. return 0;
  64. }
  65. static
  66. int
  67. WINAPI
  68. LoadStringW(
  69. IN HINSTANCE hInstance,
  70. IN UINT uID,
  71. OUT LPWSTR lpBuffer,
  72. IN int nBufferMax
  73. )
  74. {
  75. SetLastError (ERROR_PROC_NOT_FOUND);
  76. return 0;
  77. }
  78. static
  79. BOOL
  80. WINAPI
  81. OemToCharBuffA(
  82. IN LPCSTR lpszSrc,
  83. OUT LPSTR lpszDst,
  84. IN DWORD cchDstLength
  85. )
  86. {
  87. return FALSE;
  88. }
  89. static
  90. HDESK
  91. WINAPI
  92. OpenDesktopA(
  93. IN LPCSTR lpszDesktop,
  94. IN DWORD dwFlags,
  95. IN BOOL fInherit,
  96. IN ACCESS_MASK dwDesiredAccess
  97. )
  98. {
  99. SetLastError (ERROR_PROC_NOT_FOUND);
  100. return NULL;
  101. }
  102. static
  103. BOOL
  104. WINAPI
  105. CloseDesktop(
  106. HDESK hDesktop
  107. )
  108. {
  109. SetLastError (ERROR_PROC_NOT_FOUND);
  110. return FALSE;
  111. }
  112. static
  113. HWINSTA
  114. WINAPI
  115. OpenWindowStationA(
  116. IN LPCSTR lpszWinSta,
  117. IN BOOL fInherit,
  118. IN ACCESS_MASK dwDesiredAccess
  119. )
  120. {
  121. SetLastError (ERROR_PROC_NOT_FOUND);
  122. return NULL;
  123. }
  124. static
  125. BOOL
  126. WINAPI
  127. CloseWindowStation(
  128. HWINSTA hWinSta
  129. )
  130. {
  131. SetLastError (ERROR_PROC_NOT_FOUND);
  132. return FALSE;
  133. }
  134. static
  135. BOOL
  136. WINAPI
  137. PeekMessageA(
  138. OUT LPMSG lpMsg,
  139. IN HWND hWnd,
  140. IN UINT wMsgFilterMin,
  141. IN UINT wMsgFilterMax,
  142. IN UINT wRemoveMsg
  143. )
  144. {
  145. SetLastError (ERROR_PROC_NOT_FOUND);
  146. return FALSE;
  147. }
  148. static
  149. BOOL
  150. WINAPI
  151. PostMessageA(
  152. IN HWND hWnd,
  153. IN UINT Msg,
  154. IN WPARAM wParam,
  155. IN LPARAM lParam
  156. )
  157. {
  158. SetLastError (ERROR_PROC_NOT_FOUND);
  159. return FALSE;
  160. }
  161. static
  162. BOOL
  163. WINAPI
  164. SetProcessWindowStation(
  165. IN HWINSTA hWinSta
  166. )
  167. {
  168. SetLastError (ERROR_PROC_NOT_FOUND);
  169. return FALSE;
  170. }
  171. static
  172. BOOL
  173. WINAPI
  174. SetThreadDesktop(
  175. IN HDESK hDesktop
  176. )
  177. {
  178. SetLastError (ERROR_PROC_NOT_FOUND);
  179. return FALSE;
  180. }
  181. static
  182. BOOL
  183. WINAPI
  184. TranslateMessage(
  185. IN CONST MSG *lpMsg
  186. )
  187. {
  188. SetLastError (ERROR_PROC_NOT_FOUND);
  189. return FALSE;
  190. }
  191. static
  192. int
  193. WINAPIV
  194. wsprintfA(
  195. OUT LPSTR str,
  196. IN LPCSTR fmt,
  197. ...
  198. )
  199. {
  200. return -1;
  201. }
  202. static
  203. int
  204. WINAPIV
  205. wsprintfW(
  206. OUT LPWSTR str,
  207. IN LPCWSTR fmt,
  208. ...
  209. )
  210. {
  211. return -1;
  212. }
  213. //
  214. // Stubs for shims
  215. //
  216. static
  217. LRESULT
  218. WINAPI
  219. DefWindowProcA(
  220. IN HWND hWnd,
  221. IN UINT Msg,
  222. IN WPARAM wParam,
  223. IN LPARAM lParam
  224. )
  225. {
  226. SetLastError (ERROR_PROC_NOT_FOUND);
  227. return 0;
  228. }
  229. static
  230. BOOL
  231. WINAPI
  232. IsWindowVisible(
  233. IN HWND hWnd
  234. )
  235. {
  236. SetLastError (ERROR_PROC_NOT_FOUND);
  237. return FALSE;
  238. }
  239. static
  240. BOOL
  241. WINAPI
  242. SetForegroundWindow(
  243. IN HWND hWnd
  244. )
  245. {
  246. SetLastError (ERROR_PROC_NOT_FOUND);
  247. return FALSE;
  248. }
  249. static
  250. BOOL
  251. WINAPI
  252. EnumDisplaySettingsA(
  253. IN LPCSTR lpszDeviceName,
  254. IN DWORD iModeNum,
  255. OUT LPDEVMODEA lpDevMode
  256. )
  257. {
  258. SetLastError (ERROR_PROC_NOT_FOUND);
  259. return FALSE;
  260. }
  261. static
  262. BOOL
  263. WINAPI
  264. EnumDisplaySettingsW(
  265. IN LPCWSTR lpszDeviceName,
  266. IN DWORD iModeNum,
  267. OUT LPDEVMODEW lpDevMode
  268. )
  269. {
  270. SetLastError (ERROR_PROC_NOT_FOUND);
  271. return FALSE;
  272. }
  273. static
  274. LPSTR
  275. WINAPI
  276. CharNextA(
  277. IN LPCSTR lpsz
  278. )
  279. {
  280. SetLastError (ERROR_PROC_NOT_FOUND);
  281. /* This function has no documented error mode, so delayloading
  282. it is just not a good idea..
  283. */
  284. return RTL_CONST_CAST(LPSTR)(lpsz);
  285. }
  286. static
  287. BOOL
  288. WINAPI
  289. IsCharAlphaA(
  290. IN CHAR ch
  291. )
  292. {
  293. SetLastError (ERROR_PROC_NOT_FOUND);
  294. return FALSE;
  295. }
  296. static
  297. int
  298. WINAPI
  299. GetWindowTextA(
  300. IN HWND hWnd,
  301. OUT LPSTR lpString,
  302. IN int nMaxCount
  303. )
  304. {
  305. SetLastError (ERROR_PROC_NOT_FOUND);
  306. return 0;
  307. }
  308. static
  309. BOOL
  310. WINAPI
  311. EnumDesktopWindows(
  312. IN HDESK hDesktop,
  313. IN WNDENUMPROC lpfn,
  314. IN LPARAM lParam
  315. )
  316. {
  317. SetLastError (ERROR_PROC_NOT_FOUND);
  318. return FALSE;
  319. }
  320. static
  321. BOOL
  322. WINAPI
  323. SystemParametersInfoW(
  324. IN UINT uiAction,
  325. IN UINT uiParam,
  326. IN OUT PVOID pvParam,
  327. IN UINT fWinIni
  328. )
  329. {
  330. SetLastError (ERROR_PROC_NOT_FOUND);
  331. return FALSE;
  332. }
  333. static
  334. LONG
  335. WINAPI
  336. ChangeDisplaySettingsA(
  337. IN LPDEVMODEA lpDevMode,
  338. IN DWORD dwFlags
  339. )
  340. {
  341. SetLastError (ERROR_PROC_NOT_FOUND);
  342. return 0;
  343. }
  344. static
  345. VOID
  346. WINAPI
  347. mouse_event(
  348. IN DWORD dwFlags,
  349. IN DWORD dx,
  350. IN DWORD dy,
  351. IN DWORD dwData,
  352. IN ULONG_PTR dwExtraInfo
  353. )
  354. {
  355. SetLastError (ERROR_PROC_NOT_FOUND);
  356. return;
  357. }
  358. static
  359. HWND
  360. WINAPI
  361. GetForegroundWindow(
  362. VOID
  363. )
  364. {
  365. SetLastError (ERROR_PROC_NOT_FOUND);
  366. return NULL;
  367. }
  368. static
  369. LRESULT
  370. WINAPI
  371. SendMessageW(
  372. IN HWND hWnd,
  373. IN UINT Msg,
  374. IN WPARAM wParam,
  375. IN LPARAM lParam
  376. )
  377. {
  378. SetLastError (ERROR_PROC_NOT_FOUND);
  379. return 0;
  380. }
  381. static
  382. int
  383. WINAPI
  384. GetSystemMetrics(
  385. IN int nIndex
  386. )
  387. {
  388. SetLastError (ERROR_PROC_NOT_FOUND);
  389. return 0;
  390. }
  391. static
  392. LONG
  393. WINAPI
  394. GetWindowLongA(
  395. IN HWND hWnd,
  396. IN int nIndex
  397. )
  398. {
  399. SetLastError (ERROR_PROC_NOT_FOUND);
  400. return 0;
  401. }
  402. static
  403. LONG
  404. WINAPI
  405. GetWindowLongW(
  406. IN HWND hWnd,
  407. IN int nIndex
  408. )
  409. {
  410. SetLastError (ERROR_PROC_NOT_FOUND);
  411. return 0;
  412. }
  413. static
  414. int
  415. WINAPI
  416. ReleaseDC(
  417. IN HWND hWnd,
  418. IN HDC hDC
  419. )
  420. {
  421. SetLastError (ERROR_PROC_NOT_FOUND);
  422. return 0;
  423. }
  424. static
  425. HDC
  426. WINAPI
  427. GetDC(
  428. IN HWND hWnd
  429. )
  430. {
  431. SetLastError (ERROR_PROC_NOT_FOUND);
  432. return NULL;
  433. }
  434. static
  435. LRESULT
  436. WINAPI
  437. CallNextHookEx(
  438. IN HHOOK hhk,
  439. IN int nCode,
  440. IN WPARAM wParam,
  441. IN LPARAM lParam
  442. )
  443. {
  444. SetLastError (ERROR_PROC_NOT_FOUND);
  445. return 0;
  446. }
  447. static
  448. HWND
  449. WINAPI
  450. GetActiveWindow(
  451. VOID
  452. )
  453. {
  454. SetLastError (ERROR_PROC_NOT_FOUND);
  455. return NULL;
  456. }
  457. static
  458. BOOL
  459. WINAPI
  460. DestroyCursor(
  461. IN HCURSOR hCursor
  462. )
  463. {
  464. SetLastError (ERROR_PROC_NOT_FOUND);
  465. return FALSE;
  466. }
  467. static
  468. HICON
  469. WINAPI
  470. CopyIcon(
  471. IN HICON hIcon
  472. )
  473. {
  474. SetLastError (ERROR_PROC_NOT_FOUND);
  475. return FALSE;
  476. }
  477. static
  478. HCURSOR
  479. WINAPI
  480. LoadCursorW(
  481. IN HINSTANCE hInstance,
  482. IN LPCWSTR lpCursorName
  483. )
  484. {
  485. SetLastError (ERROR_PROC_NOT_FOUND);
  486. return NULL;
  487. }
  488. static
  489. BOOL
  490. WINAPI
  491. SetSystemCursor(
  492. IN HCURSOR hcur,
  493. IN DWORD id
  494. )
  495. {
  496. SetLastError (ERROR_PROC_NOT_FOUND);
  497. return FALSE;
  498. }
  499. static
  500. BOOL
  501. WINAPI
  502. EqualRect(
  503. IN CONST RECT *lprc1,
  504. IN CONST RECT *lprc2
  505. )
  506. {
  507. SetLastError (ERROR_PROC_NOT_FOUND);
  508. return FALSE;
  509. }
  510. static
  511. BOOL
  512. WINAPI
  513. IntersectRect(
  514. OUT LPRECT lprcDst,
  515. IN CONST RECT *lprcSrc1,
  516. IN CONST RECT *lprcSrc2
  517. )
  518. {
  519. SetLastError (ERROR_PROC_NOT_FOUND);
  520. return FALSE;
  521. }
  522. static
  523. BOOL
  524. WINAPI
  525. SetRect(
  526. OUT LPRECT lprc,
  527. IN int xLeft,
  528. IN int yTop,
  529. IN int xRight,
  530. IN int yBottom
  531. )
  532. {
  533. SetLastError (ERROR_PROC_NOT_FOUND);
  534. return FALSE;
  535. }
  536. static
  537. LONG
  538. WINAPI
  539. ChangeDisplaySettingsExW(
  540. IN LPCWSTR lpszDeviceName,
  541. IN LPDEVMODEW lpDevMode,
  542. IN HWND hwnd,
  543. IN DWORD dwflags,
  544. IN LPVOID lParam
  545. )
  546. {
  547. SetLastError (ERROR_PROC_NOT_FOUND);
  548. return 0;
  549. }
  550. static
  551. BOOL
  552. WINAPI
  553. GetClientRect(
  554. IN HWND hWnd,
  555. OUT LPRECT lpRect
  556. )
  557. {
  558. SetLastError (ERROR_PROC_NOT_FOUND);
  559. return FALSE;
  560. }
  561. static
  562. HWND
  563. WINAPI
  564. WindowFromDC(
  565. IN HDC hDC
  566. )
  567. {
  568. SetLastError (ERROR_PROC_NOT_FOUND);
  569. return NULL;
  570. }
  571. static
  572. BOOL
  573. WINAPI
  574. GetClassInfoA(
  575. IN HINSTANCE hInstance,
  576. IN LPCSTR lpClassName,
  577. OUT LPWNDCLASSA lpWndClass
  578. )
  579. {
  580. SetLastError (ERROR_PROC_NOT_FOUND);
  581. return FALSE;
  582. }
  583. static
  584. BOOL
  585. WINAPI
  586. ShowWindow(
  587. IN HWND hWnd,
  588. IN int nCmdShow
  589. )
  590. {
  591. SetLastError (ERROR_PROC_NOT_FOUND);
  592. return FALSE;
  593. }
  594. static
  595. BOOL
  596. WINAPI
  597. InvalidateRect(
  598. IN HWND hWnd,
  599. IN CONST RECT *lpRect,
  600. IN BOOL bErase
  601. )
  602. {
  603. SetLastError (ERROR_PROC_NOT_FOUND);
  604. return FALSE;
  605. }
  606. static
  607. int
  608. WINAPI
  609. FillRect(
  610. IN HDC hDC,
  611. IN CONST RECT *lprc,
  612. IN HBRUSH hbr
  613. )
  614. {
  615. SetLastError (ERROR_PROC_NOT_FOUND);
  616. return 0;
  617. }
  618. static
  619. BOOL
  620. WINAPI
  621. GetWindowRect(
  622. IN HWND hWnd,
  623. OUT LPRECT lpRect
  624. )
  625. {
  626. SetLastError (ERROR_PROC_NOT_FOUND);
  627. return FALSE;
  628. }
  629. static
  630. BOOL
  631. WINAPI
  632. EndPaint(
  633. IN HWND hWnd,
  634. IN CONST PAINTSTRUCT *lpPaint
  635. )
  636. {
  637. SetLastError (ERROR_PROC_NOT_FOUND);
  638. return FALSE;
  639. }
  640. static
  641. HDC
  642. WINAPI
  643. BeginPaint(
  644. IN HWND hWnd,
  645. OUT LPPAINTSTRUCT lpPaint
  646. )
  647. {
  648. SetLastError (ERROR_PROC_NOT_FOUND);
  649. return NULL;
  650. }
  651. static
  652. BOOL
  653. WINAPI
  654. ValidateRect(
  655. IN HWND hWnd,
  656. IN CONST RECT *lpRect
  657. )
  658. {
  659. SetLastError (ERROR_PROC_NOT_FOUND);
  660. return FALSE;
  661. }
  662. static
  663. BOOL
  664. WINAPI
  665. GetUpdateRect(
  666. IN HWND hWnd,
  667. OUT LPRECT lpRect,
  668. IN BOOL bErase
  669. )
  670. {
  671. SetLastError (ERROR_PROC_NOT_FOUND);
  672. return FALSE;
  673. }
  674. static
  675. LRESULT
  676. WINAPI
  677. CallWindowProcA(
  678. IN WNDPROC lpPrevWndFunc,
  679. IN HWND hWnd,
  680. IN UINT Msg,
  681. IN WPARAM wParam,
  682. IN LPARAM lParam
  683. )
  684. {
  685. SetLastError (ERROR_PROC_NOT_FOUND);
  686. return 0;
  687. }
  688. static
  689. LONG
  690. WINAPI
  691. SetWindowLongA(
  692. IN HWND hWnd,
  693. IN int nIndex,
  694. IN LONG dwNewLong
  695. )
  696. {
  697. SetLastError (ERROR_PROC_NOT_FOUND);
  698. return 0;
  699. }
  700. static
  701. HWND
  702. WINAPI
  703. FindWindowA(
  704. IN LPCSTR lpClassName,
  705. IN LPCSTR lpWindowName
  706. )
  707. {
  708. SetLastError (ERROR_PROC_NOT_FOUND);
  709. return NULL;
  710. }
  711. static
  712. UINT
  713. WINAPI
  714. RegisterWindowMessageW(
  715. IN LPCWSTR lpString
  716. )
  717. {
  718. SetLastError (ERROR_PROC_NOT_FOUND);
  719. return 0;
  720. }
  721. static
  722. int
  723. WINAPI
  724. ShowCursor(
  725. IN BOOL bShow
  726. )
  727. {
  728. SetLastError (ERROR_PROC_NOT_FOUND);
  729. return 0;
  730. }
  731. static
  732. BOOL
  733. WINAPI
  734. DestroyWindow(
  735. IN HWND hWnd
  736. )
  737. {
  738. SetLastError (ERROR_PROC_NOT_FOUND);
  739. return FALSE;
  740. }
  741. static
  742. HWND
  743. WINAPI
  744. CreateWindowExA(
  745. IN DWORD dwExStyle,
  746. IN LPCSTR lpClassName,
  747. IN LPCSTR lpWindowName,
  748. IN DWORD dwStyle,
  749. IN int X,
  750. IN int Y,
  751. IN int nWidth,
  752. IN int nHeight,
  753. IN HWND hWndParent,
  754. IN HMENU hMenu,
  755. IN HINSTANCE hInstance,
  756. IN LPVOID lpParam
  757. )
  758. {
  759. SetLastError (ERROR_PROC_NOT_FOUND);
  760. return NULL;
  761. }
  762. static
  763. ATOM
  764. WINAPI
  765. RegisterClassA(
  766. IN CONST WNDCLASSA *lpWndClass
  767. )
  768. {
  769. SetLastError (ERROR_PROC_NOT_FOUND);
  770. return 0;
  771. }
  772. static
  773. LRESULT
  774. WINAPI
  775. DefWindowProcW(
  776. IN HWND hWnd,
  777. IN UINT Msg,
  778. IN WPARAM wParam,
  779. IN LPARAM lParam
  780. )
  781. {
  782. SetLastError (ERROR_PROC_NOT_FOUND);
  783. return 0;
  784. }
  785. //
  786. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  787. //
  788. DEFINE_PROCNAME_ENTRIES(user32)
  789. {
  790. DLPENTRY(BeginPaint)
  791. DLPENTRY(CallNextHookEx)
  792. DLPENTRY(CallWindowProcA)
  793. DLPENTRY(ChangeDisplaySettingsA)
  794. DLPENTRY(ChangeDisplaySettingsExW)
  795. DLPENTRY(CharNextA)
  796. DLPENTRY(CharToOemBuffA)
  797. DLPENTRY(CloseDesktop)
  798. DLPENTRY(CloseWindowStation)
  799. DLPENTRY(CopyIcon)
  800. DLPENTRY(CreateWindowExA)
  801. DLPENTRY(DefWindowProcA)
  802. DLPENTRY(DefWindowProcW)
  803. DLPENTRY(DestroyCursor)
  804. DLPENTRY(DestroyWindow)
  805. DLPENTRY(DispatchMessageA)
  806. DLPENTRY(EndPaint)
  807. DLPENTRY(EnumDesktopWindows)
  808. DLPENTRY(EnumDisplaySettingsA)
  809. DLPENTRY(EnumDisplaySettingsW)
  810. DLPENTRY(EqualRect)
  811. DLPENTRY(FillRect)
  812. DLPENTRY(FindWindowA)
  813. DLPENTRY(GetActiveWindow)
  814. DLPENTRY(GetClassInfoA)
  815. DLPENTRY(GetClientRect)
  816. DLPENTRY(GetDC)
  817. DLPENTRY(GetForegroundWindow)
  818. DLPENTRY(GetProcessWindowStation)
  819. DLPENTRY(GetSystemMetrics)
  820. DLPENTRY(GetThreadDesktop)
  821. DLPENTRY(GetUpdateRect)
  822. DLPENTRY(GetWindowLongA)
  823. DLPENTRY(GetWindowLongW)
  824. DLPENTRY(GetWindowRect)
  825. DLPENTRY(GetWindowTextA)
  826. DLPENTRY(IntersectRect)
  827. DLPENTRY(InvalidateRect)
  828. DLPENTRY(IsCharAlphaA)
  829. DLPENTRY(IsWindow)
  830. DLPENTRY(IsWindowVisible)
  831. DLPENTRY(LoadCursorW)
  832. DLPENTRY(LoadStringA)
  833. DLPENTRY(LoadStringW)
  834. DLPENTRY(OemToCharBuffA)
  835. DLPENTRY(OpenDesktopA)
  836. DLPENTRY(OpenWindowStationA)
  837. DLPENTRY(PeekMessageA)
  838. DLPENTRY(PostMessageA)
  839. DLPENTRY(RegisterClassA)
  840. DLPENTRY(RegisterWindowMessageW)
  841. DLPENTRY(ReleaseDC)
  842. DLPENTRY(SendMessageW)
  843. DLPENTRY(SetForegroundWindow)
  844. DLPENTRY(SetProcessWindowStation)
  845. DLPENTRY(SetRect)
  846. DLPENTRY(SetSystemCursor)
  847. DLPENTRY(SetThreadDesktop)
  848. DLPENTRY(SetWindowLongA)
  849. DLPENTRY(ShowCursor)
  850. DLPENTRY(ShowWindow)
  851. DLPENTRY(SystemParametersInfoW)
  852. DLPENTRY(TranslateMessage)
  853. DLPENTRY(ValidateRect)
  854. DLPENTRY(WindowFromDC)
  855. DLPENTRY(mouse_event)
  856. DLPENTRY(wsprintfA)
  857. DLPENTRY(wsprintfW)
  858. };
  859. DEFINE_PROCNAME_MAP(user32)