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