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.

319 lines
5.7 KiB

  1. /*++
  2. Copyright c 1994 Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. forward.c
  5. Abstract:
  6. This module implements the proxy forwarding functions.
  7. Author:
  8. ShannonC 26-Oct-94
  9. Environment:
  10. Any mode.
  11. Revision History:
  12. --*/
  13. #define STDMETHODCALLTYPE __stdcall
  14. /*++
  15. VOID
  16. NdrProxyForwardingFunction<nnn>(...)
  17. Routine Description:
  18. This function forwards a call to the proxy for the base interface.
  19. Arguments:
  20. This [esp+4] - Points to an interface proxy.
  21. Return Value:
  22. None.
  23. --*/
  24. // Here is what a forwarder looks like
  25. // we must:
  26. // change the "this" pointer in [esp+4] to point to the delegated object
  27. // fetch the correct entry from the vtable
  28. // call the function
  29. #define SUBCLASS_OFFSET 16
  30. #define VTABLE_ENTRY(n) n*4
  31. // Stop the C++ compiler from adding additional push instructions
  32. // as well as generating the return sequence for the forwarder
  33. // and so messing up our assembly stack when using -Od, etc.
  34. // by using the _declspec().
  35. #define DELEGATION_FORWARDER(method_num) \
  36. _declspec(naked) \
  37. void STDMETHODCALLTYPE NdrProxyForwardingFunction##method_num() \
  38. { \
  39. /*Get this->pBaseProxy */ \
  40. __asm{mov eax, [esp + 4]} \
  41. __asm{mov eax, [eax + SUBCLASS_OFFSET]} \
  42. __asm{mov [esp + 4], eax} \
  43. /*Get this->pBaseProxy->lpVtbl*/ \
  44. __asm{mov eax, [eax]} \
  45. /*Jump to interface member function*/ \
  46. __asm{mov eax, [eax + VTABLE_ENTRY(method_num)]} \
  47. __asm{jmp eax} \
  48. }
  49. DELEGATION_FORWARDER(3)
  50. DELEGATION_FORWARDER(4)
  51. DELEGATION_FORWARDER(5)
  52. DELEGATION_FORWARDER(6)
  53. DELEGATION_FORWARDER(7)
  54. DELEGATION_FORWARDER(8)
  55. DELEGATION_FORWARDER(9)
  56. DELEGATION_FORWARDER(10)
  57. DELEGATION_FORWARDER(11)
  58. DELEGATION_FORWARDER(12)
  59. DELEGATION_FORWARDER(13)
  60. DELEGATION_FORWARDER(14)
  61. DELEGATION_FORWARDER(15)
  62. DELEGATION_FORWARDER(16)
  63. DELEGATION_FORWARDER(17)
  64. DELEGATION_FORWARDER(18)
  65. DELEGATION_FORWARDER(19)
  66. DELEGATION_FORWARDER(20)
  67. DELEGATION_FORWARDER(21)
  68. DELEGATION_FORWARDER(22)
  69. DELEGATION_FORWARDER(23)
  70. DELEGATION_FORWARDER(24)
  71. DELEGATION_FORWARDER(25)
  72. DELEGATION_FORWARDER(26)
  73. DELEGATION_FORWARDER(27)
  74. DELEGATION_FORWARDER(28)
  75. DELEGATION_FORWARDER(29)
  76. DELEGATION_FORWARDER(30)
  77. DELEGATION_FORWARDER(31)
  78. DELEGATION_FORWARDER(32)
  79. DELEGATION_FORWARDER(33)
  80. DELEGATION_FORWARDER(34)
  81. DELEGATION_FORWARDER(35)
  82. DELEGATION_FORWARDER(36)
  83. DELEGATION_FORWARDER(37)
  84. DELEGATION_FORWARDER(38)
  85. DELEGATION_FORWARDER(39)
  86. DELEGATION_FORWARDER(40)
  87. DELEGATION_FORWARDER(41)
  88. DELEGATION_FORWARDER(42)
  89. DELEGATION_FORWARDER(43)
  90. DELEGATION_FORWARDER(44)
  91. DELEGATION_FORWARDER(45)
  92. DELEGATION_FORWARDER(46)
  93. DELEGATION_FORWARDER(47)
  94. DELEGATION_FORWARDER(48)
  95. DELEGATION_FORWARDER(49)
  96. DELEGATION_FORWARDER(50)
  97. DELEGATION_FORWARDER(51)
  98. DELEGATION_FORWARDER(52)
  99. DELEGATION_FORWARDER(53)
  100. DELEGATION_FORWARDER(54)
  101. DELEGATION_FORWARDER(55)
  102. DELEGATION_FORWARDER(56)
  103. DELEGATION_FORWARDER(57)
  104. DELEGATION_FORWARDER(58)
  105. DELEGATION_FORWARDER(59)
  106. DELEGATION_FORWARDER(60)
  107. DELEGATION_FORWARDER(61)
  108. DELEGATION_FORWARDER(62)
  109. DELEGATION_FORWARDER(63)
  110. DELEGATION_FORWARDER(64)
  111. DELEGATION_FORWARDER(65)
  112. DELEGATION_FORWARDER(66)
  113. DELEGATION_FORWARDER(67)
  114. DELEGATION_FORWARDER(68)
  115. DELEGATION_FORWARDER(69)
  116. DELEGATION_FORWARDER(70)
  117. DELEGATION_FORWARDER(71)
  118. DELEGATION_FORWARDER(72)
  119. DELEGATION_FORWARDER(73)
  120. DELEGATION_FORWARDER(74)
  121. DELEGATION_FORWARDER(75)
  122. DELEGATION_FORWARDER(76)
  123. DELEGATION_FORWARDER(77)
  124. DELEGATION_FORWARDER(78)
  125. DELEGATION_FORWARDER(79)
  126. DELEGATION_FORWARDER(80)
  127. DELEGATION_FORWARDER(81)
  128. DELEGATION_FORWARDER(82)
  129. DELEGATION_FORWARDER(83)
  130. DELEGATION_FORWARDER(84)
  131. DELEGATION_FORWARDER(85)
  132. DELEGATION_FORWARDER(86)
  133. DELEGATION_FORWARDER(87)
  134. DELEGATION_FORWARDER(88)
  135. DELEGATION_FORWARDER(89)
  136. DELEGATION_FORWARDER(90)
  137. DELEGATION_FORWARDER(91)
  138. DELEGATION_FORWARDER(92)
  139. DELEGATION_FORWARDER(93)
  140. DELEGATION_FORWARDER(94)
  141. DELEGATION_FORWARDER(95)
  142. DELEGATION_FORWARDER(96)
  143. DELEGATION_FORWARDER(97)
  144. DELEGATION_FORWARDER(98)
  145. DELEGATION_FORWARDER(99)
  146. DELEGATION_FORWARDER(100)
  147. DELEGATION_FORWARDER(101)
  148. DELEGATION_FORWARDER(102)
  149. DELEGATION_FORWARDER(103)
  150. DELEGATION_FORWARDER(104)
  151. DELEGATION_FORWARDER(105)
  152. DELEGATION_FORWARDER(106)
  153. DELEGATION_FORWARDER(107)
  154. DELEGATION_FORWARDER(108)
  155. DELEGATION_FORWARDER(109)
  156. DELEGATION_FORWARDER(110)
  157. DELEGATION_FORWARDER(111)
  158. DELEGATION_FORWARDER(112)
  159. DELEGATION_FORWARDER(113)
  160. DELEGATION_FORWARDER(114)
  161. DELEGATION_FORWARDER(115)
  162. DELEGATION_FORWARDER(116)
  163. DELEGATION_FORWARDER(117)
  164. DELEGATION_FORWARDER(118)
  165. DELEGATION_FORWARDER(119)
  166. DELEGATION_FORWARDER(120)
  167. DELEGATION_FORWARDER(121)
  168. DELEGATION_FORWARDER(122)
  169. DELEGATION_FORWARDER(123)
  170. DELEGATION_FORWARDER(124)
  171. DELEGATION_FORWARDER(125)
  172. DELEGATION_FORWARDER(126)
  173. DELEGATION_FORWARDER(127)
  174.