Restored managed mode config file option.
[wine] / dlls / kernel / flatthunk.h
1 /*
2  * Win95 Flat Thunk data structures
3  *
4  * Copyright 1998 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
21 #ifndef __WINE_FLATTHUNK_H
22 #define __WINE_FLATTHUNK_H
23
24 #include "windef.h"
25
26 struct ThunkDataCommon
27 {
28     char                   magic[4];         /* 00 */
29     DWORD                  checksum;         /* 04 */
30 };
31
32 struct ThunkDataLS16
33 {
34     struct ThunkDataCommon common;           /* 00 */
35     SEGPTR                 targetTable;      /* 08 */
36     DWORD                  firstTime;        /* 0C */
37 };
38
39 struct ThunkDataLS32
40 {
41     struct ThunkDataCommon common;           /* 00 */
42     DWORD *                targetTable;      /* 08 */
43     char                   lateBinding[4];   /* 0C */
44     DWORD                  flags;            /* 10 */
45     DWORD                  reserved1;        /* 14 */
46     DWORD                  reserved2;        /* 18 */
47     DWORD                  offsetQTThunk;    /* 1C */
48     DWORD                  offsetFTProlog;   /* 20 */
49 };
50
51 struct ThunkDataSL16
52 {
53     struct ThunkDataCommon common;            /* 00 */
54     DWORD                  flags1;            /* 08 */
55     DWORD                  reserved1;         /* 0C */
56     struct ThunkDataSL *   fpData;            /* 10 */
57     SEGPTR                 spData;            /* 14 */
58     DWORD                  reserved2;         /* 18 */
59     char                   lateBinding[4];    /* 1C */
60     DWORD                  flags2;            /* 20 */
61     DWORD                  reserved3;         /* 20 */
62     SEGPTR                 apiDatabase;       /* 28 */
63 };
64
65 struct ThunkDataSL32
66 {
67     struct ThunkDataCommon common;            /* 00 */
68     DWORD                  reserved1;         /* 08 */
69     struct ThunkDataSL *   data;              /* 0C */
70     char                   lateBinding[4];    /* 10 */
71     DWORD                  flags;             /* 14 */
72     DWORD                  reserved2;         /* 18 */
73     DWORD                  reserved3;         /* 1C */
74     DWORD                  offsetTargetTable; /* 20 */
75 };
76
77 struct ThunkDataSL
78 {
79 #if 0
80     This structure differs from the Win95 original,
81     but this should not matter since it is strictly internal to
82     the thunk handling routines in KRNL386 / KERNEL32.
83
84     For reference, here is the Win95 layout:
85
86     struct ThunkDataCommon common;            /* 00 */
87     DWORD                  flags1;            /* 08 */
88     SEGPTR                 apiDatabase;       /* 0C */
89     WORD                   exePtr;            /* 10 */
90     WORD                   segMBA;            /* 12 */
91     DWORD                  lenMBATotal;       /* 14 */
92     DWORD                  lenMBAUsed;        /* 18 */
93     DWORD                  flags2;            /* 1C */
94     char                   pszDll16[256];     /* 20 */
95     char                   pszDll32[256];     /*120 */
96
97     We do it differently since all our thunk handling is done
98     by 32-bit code. Therefore we do not need do provide
99     easy access to this data, especially the process target
100     table database, for 16-bit code.
101 #endif
102
103     struct ThunkDataCommon common;
104     DWORD                  flags1;
105     struct SLApiDB *       apiDB;
106     struct SLTargetDB *    targetDB;
107     DWORD                  flags2;
108     char                   pszDll16[256];
109     char                   pszDll32[256];
110 };
111
112 struct SLTargetDB
113 {
114      struct SLTargetDB *   next;
115      DWORD                 process;
116      DWORD *               targetTable;
117 };
118
119 struct SLApiDB
120 {
121     DWORD                  nrArgBytes;
122     DWORD                  errorReturnValue;
123 };
124
125
126 #endif /* __WINE_FLATTHUNK_H */
127