builtin16.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Win16 built-in DLLs definitions
  3. *
  4. * Copyright 1999 Ulrich Weigand
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef __WINE_BUILTIN16_H
  21. #define __WINE_BUILTIN16_H
  22. #include <windef.h>
  23. #include <wine/windef16.h>
  24. struct _CONTEXT86;
  25. struct _STACK16FRAME;
  26. #include <pshpack1.h>
  27. #ifdef __i386__
  28. typedef struct
  29. {
  30. WORD pushw_bp; /* pushw %bp */
  31. BYTE pushl; /* pushl $target */
  32. void (*target)();
  33. WORD call; /* call CALLFROM16 */
  34. short callfrom16;
  35. } ENTRYPOINT16;
  36. typedef struct
  37. {
  38. BYTE pushl; /* pushl $relay */
  39. void *relay;
  40. BYTE lcall; /* lcall __FLATCS__:glue */
  41. void *glue;
  42. WORD flatcs;
  43. WORD lret; /* lret $nArgs */
  44. WORD nArgs;
  45. DWORD arg_types[2]; /* type of each argument */
  46. } CALLFROM16;
  47. #else
  48. typedef struct
  49. {
  50. void (*target)();
  51. WORD call; /* call CALLFROM16 */
  52. short callfrom16;
  53. } ENTRYPOINT16;
  54. typedef struct
  55. {
  56. WORD lret; /* lret $nArgs */
  57. WORD nArgs;
  58. DWORD arg_types[2]; /* type of each argument */
  59. } CALLFROM16;
  60. #endif
  61. #include <poppack.h>
  62. /* argument type flags for relay debugging */
  63. enum arg_types
  64. {
  65. ARG_NONE = 0, /* indicates end of arg list */
  66. ARG_WORD, /* unsigned word */
  67. ARG_SWORD, /* signed word */
  68. ARG_LONG, /* long or segmented pointer */
  69. ARG_PTR, /* linear pointer */
  70. ARG_STR, /* linear pointer to null-terminated string */
  71. ARG_SEGSTR /* segmented pointer to null-terminated string */
  72. };
  73. /* flags added to arg_types[0] */
  74. #define ARG_RET16 0x80000000 /* function returns 16-bit value */
  75. #define ARG_REGISTER 0x40000000 /* function is register */
  76. extern WORD __wine_call_from_16_word();
  77. extern LONG __wine_call_from_16_long();
  78. extern void __wine_call_from_16_regs();
  79. #endif /* __WINE_BUILTIN16_H */