Top level windows with 0 width or height are created with a size of 1x1 in
[wine] / include / builtin16.h
1 /*
2  * Win16 built-in DLLs definitions
3  *
4  * Copyright 1999 Ulrich Weigand
5  */
6
7 #ifndef __WINE_BUILTIN16_H
8 #define __WINE_BUILTIN16_H
9
10 #include "windef.h"
11 #include "ldt.h"
12
13 struct _CONTEXT86;
14 struct _STACK16FRAME;
15
16 extern void RELAY_Unimplemented16(void);
17
18 extern WORD CallFrom16Word();
19 extern LONG CallFrom16Long();
20 extern void CallFrom16Register();
21 extern void CallFrom16Thunk();
22
23 extern WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs );
24 extern LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs );
25 extern LONG CALLBACK CallTo16RegisterShort( const struct _CONTEXT86 *context, INT nArgs );
26 extern LONG CALLBACK CallTo16RegisterLong ( const struct _CONTEXT86 *context, INT nArgs );
27
28 #include "pshpack1.h"
29
30 typedef struct
31 {
32     WORD   pushw_bp;               /* pushw %bp */
33     BYTE   pushl;                  /* pushl $target */
34     void (*target)();
35     WORD   call;                   /* call CALLFROM16 */
36     WORD   callfrom16;
37 } ENTRYPOINT16;
38
39 #define EP(target, offset) { 0x5566, 0x68, (target), 0xe866, (WORD) (offset) }
40
41 typedef struct
42 {
43     BYTE   pushl;                  /* pushl $relay */
44     DWORD  relay;
45     BYTE   lcall;                  /* lcall __FLATCS__:glue */
46     DWORD  glue;
47     WORD   flatcs;
48     BYTE   prefix;                 /* lret $nArgs */
49     BYTE   lret;
50     WORD   nArgs;
51     LPCSTR profile;                /* profile string */
52 } CALLFROM16;
53
54 #define CF16_WORD( relay, nArgs, profile ) \
55   { 0x68, (DWORD)(relay), \
56     0x9a, (DWORD)CallFrom16Word, __FLATCS__, \
57     0x66, (nArgs)? 0xca : 0xcb, (nArgs)? (nArgs) : 0x9090, \
58     (profile) }
59
60 #define CF16_LONG( relay, nArgs, profile ) \
61   { 0x68, (DWORD)(relay), \
62     0x9a, (DWORD)CallFrom16Long, __FLATCS__, \
63     0x66, (nArgs)? 0xca : 0xcb, (nArgs)? (nArgs) : 0x9090, \
64     (profile) }
65
66 #define CF16_REGS( relay, nArgs, profile ) \
67   { 0x68, (DWORD)(relay), \
68     0x9a, (DWORD)CallFrom16Register, __FLATCS__, \
69     0x66, (nArgs)? 0xca : 0xcb, (nArgs)? (nArgs) : 0x9090, \
70     (profile) }
71
72 #include "poppack.h"
73
74 typedef struct
75 {
76     const char *name;              /* DLL name */
77     void       *module_start;      /* 32-bit address of the module data */
78     int         module_size;       /* Size of the module data */
79     const BYTE *code_start;        /* 32-bit address of DLL code */
80     const BYTE *data_start;        /* 32-bit address of DLL data */
81     const char *owner;             /* 32-bit dll that contains this dll */
82     const void *rsrc;              /* resources data */
83 } BUILTIN16_DESCRIPTOR;
84
85 extern HMODULE16 BUILTIN_LoadModule( LPCSTR name );
86 extern LPCSTR BUILTIN_GetEntryPoint16( struct _STACK16FRAME *frame, LPSTR name, WORD *pOrd );
87 extern void BUILTIN_RegisterDLL( const BUILTIN16_DESCRIPTOR *descr );
88
89 #endif /* __WINE_BUILTIN16_H */