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.

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