inetcall.cpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #ifdef _AFXDLL
  11. #include "stdafx.h"
  12. #endif
  13. #include <afxisapi.h>
  14. // Note: because of the nature of these functions, it is not possible
  15. // to create a 'C' or 'C++' version of them. These functions are used
  16. // for the lowest level of the OLE IDispatch implementation, and need
  17. // to be ported to each supported platform.
  18. extern "C" {
  19. /////////////////////////////////////////////////////////////////////////////
  20. // Intel 386 version
  21. #ifdef _X86_
  22. #ifdef AFX_INET_SEG
  23. #pragma code_seg(AFX_INET_SEG)
  24. #endif
  25. __declspec(naked) void AFXISAPI
  26. _AfxParseCall(AFX_PISAPICMD /*pfn*/, void* /*pArgs*/, UINT /*nSizeArgs*/)
  27. {
  28. _asm
  29. {
  30. pop edx // edx = return address
  31. pop eax // eax = pfn
  32. pop ecx // ecx = pArgs
  33. add ecx,[esp] // ecx += nSizeArgs (=scratch area)
  34. mov [ecx],edx // scratch[0] = return address
  35. sub ecx,[esp] // ecx = pArgs (again)
  36. mov esp,ecx // esp = pArgs (usually already correct)
  37. pop ecx // ecx = this pointer (the CCmdTarget*)
  38. call eax // call member function
  39. ret // esp[0] should = scratch[0] = return address
  40. }
  41. }
  42. #endif // _X86_
  43. /////////////////////////////////////////////////////////////////////////////
  44. // MIPS R4000 version
  45. #ifdef _MIPS_
  46. extern "C" void _asm(char *, ...);
  47. void AFXISAPI
  48. _AfxParseCall(AFX_PMSG /*pfn*/, void* /*pArgs*/, UINT /*nSizeArgs*/)
  49. {
  50. _asm("addiu %sp,%a1,0x0"); // sp = pArgs
  51. _asm("addiu %t6,%a0,0x0"); // t6 = pfn (save it)
  52. _asm("lw %a0,0x0(%sp)"); // a0 = param0
  53. _asm("lw %a1,0x4(%sp)"); // a1 = param1
  54. _asm("lw %a2,0x8(%sp)"); // a2 = param2
  55. _asm("lw %a3,0xc(%sp)"); // a3 = param3
  56. _asm("j %t6"); // ip = pfn (jump to target function)
  57. }
  58. #endif // _MIPS_
  59. /////////////////////////////////////////////////////////////////////////////
  60. // DEC Alpha AXP version
  61. #ifdef _ALPHA_
  62. // Note: ALPHA version is in src\alpha\inetcal_.s
  63. // The ALPHA compiler does not support inline assembly, so it
  64. // must be build separately with the ASAXP assembler.
  65. #endif // _ALPHA_
  66. } // end extern "C" block
  67. /////////////////////////////////////////////////////////////////////////////