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.

111 lines
1.8 KiB

  1. title "Atl30 Stubs"
  2. ;++
  3. ;
  4. ; Copyright (c) 2001 Microsoft Corporation
  5. ;
  6. ; Module Name:
  7. ;
  8. ; atl30asm.asm
  9. ;
  10. ; Abstract:
  11. ;
  12. ; This module implements the atlcom.h call thunk helper and the atlbase.h
  13. ; query interface implementation thunks for the AMD64 platform.
  14. ;
  15. ; Author:
  16. ;
  17. ; David N. Cutler 18-Feb-2001
  18. ;
  19. ; Environment:
  20. ;
  21. ; Any mode.
  22. ;
  23. ;-
  24. include ksamd64.inc
  25. subttl "Call Thunk Helper"
  26. ;++
  27. ;
  28. ; VOID
  29. ; CComStdCallThunkHelper (
  30. ; PVOID pThunk
  31. ; ...
  32. ; )
  33. ;
  34. ; Routine Description:
  35. ;
  36. ; This function forwards a call through a com call thunk.
  37. ;
  38. ; Arguments:
  39. ;
  40. ; This (rcx) - Supplies a pointer to the thunk data.
  41. ;
  42. ; Return Value:
  43. ;
  44. ; None.
  45. ;
  46. ;--
  47. LEAF_ENTRY CComStdCallThunkHelper, _TEXT$00
  48. mov rax, rcx ; copy pThunk address
  49. mov rcx, 8[rax] ; get address of pThunk->pThis
  50. jmp qword ptr 16[rax] ; jump to pThunk->pfn
  51. LEAF_END CComStdCallThunkHelper, _TEXT$00
  52. subttl "Query Interface Thunk Functions"
  53. ;++
  54. ;
  55. ; VOID
  56. ; _QIThunk<nnn>(
  57. ; IN IUnknown *This,
  58. ; ...
  59. ; )
  60. ;
  61. ; Routine Description:
  62. ;
  63. ; This function forwards a call through a query interface thunk.
  64. ;
  65. ; Arguments:
  66. ;
  67. ; This (rcx) - Supplies a pointer to the interface.
  68. ;
  69. ; Return Value:
  70. ;
  71. ; None.
  72. ;
  73. ;--
  74. ;
  75. ; Define macro to generate forwarder functions.
  76. ;
  77. IMPL_THUNK macro Method
  78. LEAF_ENTRY _QIThunk_f&Method, _TEXT$00
  79. mov rcx, 8[rax] ; get object address
  80. mov rax, [rcx] ; get vtable address
  81. jmp qword ptr (&Method * 8)[rax] ; transfer to method
  82. LEAF_END _QIThunk_f&Method, _TEXT$00
  83. endm
  84. ;
  85. ; Generate forwarder functions.
  86. ;
  87. ;index = 3
  88. ; rept (1023 - 3 + 1)
  89. ; IMPL_THUNK %index
  90. ;index = index + 1
  91. ; endm
  92. end