Mercurial > mplayer.hg
comparison mplayer_wine.spec.c @ 8012:a53966ed8afb
including source and precompiled .spec for libwine support
author | arpi |
---|---|
date | Thu, 31 Oct 2002 23:37:38 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
8011:d14d0530ddcd | 8012:a53966ed8afb |
---|---|
1 /* File generated automatically from mplayer_wine.spec; do not edit! */ | |
2 /* This file can be copied, modified and distributed without restriction. */ | |
3 | |
4 extern char pe_header[]; | |
5 asm(".section .text\n\t" | |
6 ".align 4096\n" | |
7 "pe_header:\t.fill 4096,1,0\n\t"); | |
8 static const char dllname[] = "mplayer_wine"; | |
9 | |
10 extern int __wine_spec_exports[]; | |
11 | |
12 #define __stdcall __attribute__((__stdcall__)) | |
13 | |
14 | |
15 static struct { | |
16 struct { | |
17 void *OriginalFirstThunk; | |
18 unsigned int TimeDateStamp; | |
19 unsigned int ForwarderChain; | |
20 const char *Name; | |
21 void *FirstThunk; | |
22 } imp[3]; | |
23 const char *data[8]; | |
24 } imports = { | |
25 { | |
26 { 0, 0, 0, "kernel32.dll", &imports.data[0] }, | |
27 { 0, 0, 0, "ntdll.dll", &imports.data[5] }, | |
28 { 0, 0, 0, 0, 0 }, | |
29 }, | |
30 { | |
31 /* kernel32.dll */ | |
32 "\0\0ExitProcess", | |
33 "\0\0FreeLibrary", | |
34 "\0\0GetProcAddress", | |
35 "\0\0LoadLibraryA", | |
36 0, | |
37 /* ntdll.dll */ | |
38 "\0\0RtlRaiseException", | |
39 "\0\0__wine_get_main_args", | |
40 0, | |
41 } | |
42 }; | |
43 | |
44 #ifndef __GNUC__ | |
45 static void __asm__dummy_import(void) { | |
46 #endif | |
47 | |
48 asm(".data\n\t.align 8\n" | |
49 "\t.type ExitProcess,@function\n" | |
50 "\t.globl ExitProcess\n" | |
51 "ExitProcess:\n\tjmp *(imports+60)\n\tmovl %esi,%esi\n" | |
52 "\t.type FreeLibrary,@function\n" | |
53 "\t.globl FreeLibrary\n" | |
54 "FreeLibrary:\n\tjmp *(imports+64)\n\tmovl %esi,%esi\n" | |
55 "\t.type GetProcAddress,@function\n" | |
56 "\t.globl GetProcAddress\n" | |
57 "GetProcAddress:\n\tjmp *(imports+68)\n\tmovl %esi,%esi\n" | |
58 "\t.type LoadLibraryA,@function\n" | |
59 "\t.globl LoadLibraryA\n" | |
60 "LoadLibraryA:\n\tjmp *(imports+72)\n\tmovl %esi,%esi\n" | |
61 "\t.type RtlRaiseException,@function\n" | |
62 "\t.globl RtlRaiseException\n" | |
63 "RtlRaiseException:\n\tjmp *(imports+80)\n\tmovl %esi,%esi\n" | |
64 "\t.type __wine_get_main_args,@function\n" | |
65 "\t.globl __wine_get_main_args\n" | |
66 "__wine_get_main_args:\n\tjmp *(imports+84)\n\tmovl %esi,%esi\n" | |
67 ".previous"); | |
68 #ifndef __GNUC__ | |
69 } | |
70 #endif | |
71 | |
72 | |
73 int _ARGC; | |
74 char **_ARGV; | |
75 extern void __stdcall ExitProcess(int); | |
76 static void __wine_exe_main(void) | |
77 { | |
78 extern int main( int argc, char *argv[] ); | |
79 extern int __wine_get_main_args( char ***argv ); | |
80 _ARGC = __wine_get_main_args( &_ARGV ); | |
81 ExitProcess( main( _ARGC, _ARGV ) ); | |
82 } | |
83 | |
84 static const struct image_nt_headers | |
85 { | |
86 int Signature; | |
87 struct file_header { | |
88 short Machine; | |
89 short NumberOfSections; | |
90 int TimeDateStamp; | |
91 void *PointerToSymbolTable; | |
92 int NumberOfSymbols; | |
93 short SizeOfOptionalHeader; | |
94 short Characteristics; | |
95 } FileHeader; | |
96 struct opt_header { | |
97 short Magic; | |
98 char MajorLinkerVersion, MinorLinkerVersion; | |
99 int SizeOfCode; | |
100 int SizeOfInitializedData; | |
101 int SizeOfUninitializedData; | |
102 void *AddressOfEntryPoint; | |
103 void *BaseOfCode; | |
104 void *BaseOfData; | |
105 void *ImageBase; | |
106 int SectionAlignment; | |
107 int FileAlignment; | |
108 short MajorOperatingSystemVersion; | |
109 short MinorOperatingSystemVersion; | |
110 short MajorImageVersion; | |
111 short MinorImageVersion; | |
112 short MajorSubsystemVersion; | |
113 short MinorSubsystemVersion; | |
114 int Win32VersionValue; | |
115 int SizeOfImage; | |
116 int SizeOfHeaders; | |
117 int CheckSum; | |
118 short Subsystem; | |
119 short DllCharacteristics; | |
120 int SizeOfStackReserve; | |
121 int SizeOfStackCommit; | |
122 int SizeOfHeapReserve; | |
123 int SizeOfHeapCommit; | |
124 int LoaderFlags; | |
125 int NumberOfRvaAndSizes; | |
126 struct { const void *VirtualAddress; int Size; } DataDirectory[16]; | |
127 } OptionalHeader; | |
128 } nt_header = { | |
129 0x4550, | |
130 { 0x014c, | |
131 0, 0, 0, 0, | |
132 sizeof(nt_header.OptionalHeader), | |
133 0x0000 }, | |
134 { 0x010b, | |
135 0, 0, | |
136 0, 0, 0, | |
137 __wine_exe_main, | |
138 0, 0, | |
139 pe_header, | |
140 4096, | |
141 4096, | |
142 1, 0, | |
143 0, 0, | |
144 4, 0, | |
145 0, | |
146 4096, | |
147 4096, | |
148 0, | |
149 0x0003, | |
150 0, | |
151 0, 0, | |
152 0, 0, | |
153 0, | |
154 16, | |
155 { | |
156 { 0, 0 }, | |
157 { &imports, sizeof(imports) }, | |
158 { 0, 0 }, | |
159 } | |
160 } | |
161 }; | |
162 | |
163 #ifndef __GNUC__ | |
164 static void __asm__dummy_dll_init(void) { | |
165 #endif /* defined(__GNUC__) */ | |
166 asm("\t.section .init ,\"ax\"\n" | |
167 "\tcall __wine_spec_mplayer_wine_init\n" | |
168 "\t.previous\n"); | |
169 #ifndef __GNUC__ | |
170 } | |
171 #endif /* defined(__GNUC__) */ | |
172 | |
173 void __wine_spec_mplayer_wine_init(void) | |
174 { | |
175 extern void __wine_dll_register( const struct image_nt_headers *, const char * ); | |
176 extern void *__wine_dbg_register( char * const *, int ); | |
177 __wine_dll_register( &nt_header, "mplayer_wine.exe" ); | |
178 } |