Release 0.0.3

WHAT'S NEW with version 0.0.3:
    - Fixed bug with sector sizes.
    - Registers at program startup are now set correctly.
    - Segment fixups for relocatable-segment internal entry points.
    - Fixed bug in DOS PSP structure.
    - Some resource loading is done.
    - Added "return" ordinal type to build program.
    - Added comment capability to build program.
This commit is contained in:
Alexandre Julliard 1993-07-01 10:58:21 +00:00
parent 2c25c3e944
commit 066d1e09a4
37 changed files with 1648 additions and 270 deletions

View File

@ -1,4 +1,4 @@
CFLAGS=-g CFLAGS=-g -DDEBUG_RESOURCE
###################################################################### ######################################################################
# FILES: # FILES:
@ -11,12 +11,15 @@ CFLAGS=-g
DLL_LENGTH=256 DLL_LENGTH=256
BUILDOBJS=dll_kernel.o dll_user.o dll_gdi.o dll_unixlib.o \ BUILDOBJS=dll_kernel.o dll_user.o dll_gdi.o dll_unixlib.o \
dll_kernel_tab.o dll_user_tab.o dll_gdi_tab.o dll_unixlib_tab.o dll_win87em.o dll_shell.o \
dll_kernel_tab.o dll_user_tab.o dll_gdi_tab.o dll_unixlib_tab.o \
dll_win87em_tab.o dll_shell_tab.o
MUST_BE_LINKED_FIRST=if1632.o $(BUILDOBJS) MUST_BE_LINKED_FIRST=if1632.o $(BUILDOBJS)
OBJS=$(MUST_BE_LINKED_FIRST) \ OBJS=$(MUST_BE_LINKED_FIRST) \
dump.o heap.o ldt.o kernel.o relay.o selector.o user.o wine.o dump.o heap.o ldt.o kernel.o relay.o resource.o \
selector.o user.o wine.o
TARGET=wine TARGET=wine
LIBS=-lldt LIBS=-lldt
@ -47,3 +50,9 @@ dll_gdi.S dll_gdi_tab.c: build gdi.spec
dll_unixlib.S dll_unixlib_tab.c: build unixlib.spec dll_unixlib.S dll_unixlib_tab.c: build unixlib.spec
build unixlib.spec build unixlib.spec
dll_win87em.S dll_win87em_tab.c: build win87em.spec
build win87em.spec
dll_shell.S dll_shell_tab.c: build shell.spec
build shell.spec

24
README
View File

@ -2,9 +2,19 @@ Copyright Robert J. Amstadt, 1993. All code is provided without
warranty. It is my intent to cover this code with the Gnu Public warranty. It is my intent to cover this code with the Gnu Public
License. License.
So here goes release 0.0.2 of the Windows loader. It will do some So here goes release 0.0.3 of the Windows loader. It will do some
relocations and then run the program. The program test.exe is a relocations and then run the program. I have successfully loaded
Windows executable. Try the command "wine test.exe". the Windows solitaire game. Try it. It currently stops a call to
GetObject().
WHAT'S NEW with version 0.0.3:
- Fixed bug with sector sizes.
- Registers at program startup are now set correctly.
- Segment fixups for relocatable-segment internal entry points.
- Fixed bug in DOS PSP structure.
- Some resource loading is done.
- Added "return" ordinal type to build program.
- Added comment capability to build program.
WHAT'S NEW with version 0.0.2: WHAT'S NEW with version 0.0.2:
@ -34,10 +44,12 @@ TODO:
- Make changes to the kernel to allow more than 32 LDT entries. - Make changes to the kernel to allow more than 32 LDT entries.
- Trap and handle DOS and DPMI calls. - Trap and handle DOS and DPMI calls.
- Windows emulation library (connect to Peter MacDonald's library). - Windows emulation library (connect to Peter MacDonald's library).
- Set registers correctly when starting Windows program.
- Allowing loading of 16-bit DLLs for use with program. - Allowing loading of 16-bit DLLs for use with program.
- global memory allocation - global memory allocation.
- complete and improve local heap allocation - complete and improve local heap allocation.
- Handle self-loading applications.
- Deal with callback functions.
- Resource loading
INSTALLATION: INSTALLATION:

BIN
build

Binary file not shown.

View File

@ -8,12 +8,18 @@ ORDINAL FUNCTYPE EXPORTNAME([ARGTYPE [ARGTYPE [...]]])
HANDLERNAME([ARGNUM [ARGNUM [...]]]) HANDLERNAME([ARGNUM [ARGNUM [...]]])
ORDINAL equate EXPORTNAME DATA ORDINAL equate EXPORTNAME DATA
ORDINAL return EXPORTNAME ARGLENGTH RETVALUE
# COMMENT_TEXT
-------------------- --------------------
General: General:
"name", "id" and "length" fields are mandatory. Specific ordinal "name", "id" and "length" fields are mandatory. Specific ordinal
declarations are optional, but the default handler will print an declarations are optional, but the default handler will print an
error message. error message. Lines whose first character is a '#' will be ignored
as comments.
Variable ordinals: Variable ordinals:

91
build.c
View File

@ -1,6 +1,6 @@
/* static char RCSId[] = "$Id: build.c,v 1.2 1993/06/30 14:24:33 root Exp root $";
* Copyright Robert J. Amstadt, 1993 static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -17,6 +17,7 @@
#define FUNCTYPE_REG 19 #define FUNCTYPE_REG 19
#define EQUATETYPE_ABS 18 #define EQUATETYPE_ABS 18
#define TYPE_RETURN 20
#define MAX_ORDINALS 1024 #define MAX_ORDINALS 1024
@ -45,6 +46,12 @@ typedef struct ordinal_function_definition_s
int arg_indices_32[16]; int arg_indices_32[16];
} ORDFUNCDEF; } ORDFUNCDEF;
typedef struct ordinal_return_definition_s
{
int arg_size;
int ret_value;
} ORDRETDEF;
ORDDEF OrdinalDefinitions[MAX_ORDINALS]; ORDDEF OrdinalDefinitions[MAX_ORDINALS];
char LowerDLLName[80]; char LowerDLLName[80];
@ -146,16 +153,26 @@ GetToken(void)
ParseBuffer = malloc(512); ParseBuffer = malloc(512);
ParseNext = ParseBuffer; ParseNext = ParseBuffer;
Line++; Line++;
if (fgets(ParseBuffer, 511, SpecFp) == NULL) while (1)
return NULL; {
if (fgets(ParseBuffer, 511, SpecFp) == NULL)
return NULL;
if (ParseBuffer[0] != '#')
break;
}
} }
while ((token = GetTokenInLine()) == NULL) while ((token = GetTokenInLine()) == NULL)
{ {
ParseNext = ParseBuffer; ParseNext = ParseBuffer;
Line++; Line++;
if (fgets(ParseBuffer, 511, SpecFp) == NULL) while (1)
return NULL; {
if (fgets(ParseBuffer, 511, SpecFp) == NULL)
return NULL;
if (ParseBuffer[0] != '#')
break;
}
} }
return token; return token;
@ -387,6 +404,50 @@ ParseEquate(int ordinal)
return 0; return 0;
} }
int
ParseReturn(int ordinal)
{
ORDDEF *odp;
ORDRETDEF *rdp;
char *token;
char *endptr;
int value;
if (ordinal >= MAX_ORDINALS)
{
fprintf(stderr, "%d: Ordinal number too large\n", Line);
exit(1);
}
rdp = malloc(sizeof(*rdp));
odp = &OrdinalDefinitions[ordinal];
strcpy(odp->export_name, GetToken());
odp->valid = 1;
odp->type = TYPE_RETURN;
odp->additional_data = rdp;
token = GetToken();
rdp->arg_size = strtol(token, &endptr, 0);
if (endptr == NULL || *endptr != '\0')
{
fprintf(stderr, "%d: Expected number value, got '%s'\n", Line,
token);
exit(1);
}
token = GetToken();
rdp->ret_value = strtol(token, &endptr, 0);
if (endptr == NULL || *endptr != '\0')
{
fprintf(stderr, "%d: Expected number value, got '%s'\n", Line,
token);
exit(1);
}
return 0;
}
int int
ParseOrdinal(int ordinal) ParseOrdinal(int ordinal)
{ {
@ -415,6 +476,8 @@ ParseOrdinal(int ordinal)
return ParseExportFunction(ordinal, FUNCTYPE_REG); return ParseExportFunction(ordinal, FUNCTYPE_REG);
else if (stricmp(token, "equate") == 0) else if (stricmp(token, "equate") == 0)
return ParseEquate(ordinal); return ParseEquate(ordinal);
else if (stricmp(token, "return") == 0)
return ParseReturn(ordinal);
else else
{ {
fprintf(stderr, fprintf(stderr,
@ -509,6 +572,7 @@ main(int argc, char **argv)
{ {
ORDDEF *odp; ORDDEF *odp;
ORDFUNCDEF *fdp; ORDFUNCDEF *fdp;
ORDRETDEF *rdp;
FILE *fp; FILE *fp;
char filename[80]; char filename[80];
char buffer[80]; char buffer[80];
@ -553,6 +617,7 @@ main(int argc, char **argv)
else else
{ {
fdp = odp->additional_data; fdp = odp->additional_data;
rdp = odp->additional_data;
switch (odp->type) switch (odp->type)
{ {
@ -573,6 +638,18 @@ main(int argc, char **argv)
OutputVariableCode(fp, ".long", odp); OutputVariableCode(fp, ".long", odp);
break; break;
case TYPE_RETURN:
fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i);
fprintf(fp, "\tmovw\t$%d,%%ax\n", rdp->ret_value & 0xffff);
fprintf(fp, "\tmovw\t$%d,%%dx\n",
(rdp->ret_value >> 16) & 0xffff);
fprintf(fp, "\t.byte\t0x66\n");
if (rdp->arg_size != 0)
fprintf(fp, "\tlret\t$%d\n", rdp->arg_size);
else
fprintf(fp, "\tlret\n");
break;
case FUNCTYPE_REG: case FUNCTYPE_REG:
fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i); fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i);
fprintf(fp, "\tpushw\t%%ax\n"); fprintf(fp, "\tpushw\t%%ax\n");

4
dlls.h
View File

@ -1,4 +1,4 @@
/* $Id$ /* $Id: dlls.h,v 1.1 1993/06/29 15:55:18 root Exp $
*/ */
/* /*
* Copyright Robert J. Amstadt, 1993 * Copyright Robert J. Amstadt, 1993
@ -52,5 +52,7 @@ extern struct dll_table_entry_s KERNEL_table[];
extern struct dll_table_entry_s USER_table[]; extern struct dll_table_entry_s USER_table[];
extern struct dll_table_entry_s GDI_table[]; extern struct dll_table_entry_s GDI_table[];
extern struct dll_table_entry_s UNIXLIB_table[]; extern struct dll_table_entry_s UNIXLIB_table[];
extern struct dll_table_entry_s WIN87EM_table[];
extern struct dll_table_entry_s SHELL_table[];
#endif /* DLLS_H */ #endif /* DLLS_H */

7
dump.c
View File

@ -1,9 +1,6 @@
/* $Id$ static char RCSId[] = "$Id: dump.c,v 1.1 1993/06/29 15:55:18 root Exp $";
*/ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/*
* Copyright Robert J. Amstadt, 1993
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>

283
gdi-ordinals Normal file
View File

@ -0,0 +1,283 @@
1 1 4e0c SETBKCOLOR exported, shared data
2 1 4e22 SETBKMODE exported
3 1 4b46 SETMAPMODE exported, shared data
4 1 4e6b SETROP2 exported
5 1 5218 SETRELABS exported
6 1 4eb9 SETPOLYFILLMODE exported
7 1 4e92 SETSTRETCHBLTMODE exported
8 1 4a00 SETTEXTCHARACTEREXTRA exported, shared data
9 1 4df8 SETTEXTCOLOR exported, shared data
10 1 49ec SETTEXTJUSTIFICATION exported, shared data
11 1 4ee0 SETWINDOWORG exported, shared data
12 4 06c8 SETWINDOWEXT exported
13 1 4f14 SETVIEWPORTORG exported, shared data
14 4 06fc SETVIEWPORTEXT exported
15 1 4b12 OFFSETWINDOWORG exported
16 4 0764 SCALEWINDOWEXT exported
17 1 4ade OFFSETVIEWPORTORG exported
18 4 0730 SCALEVIEWPORTEXT exported
19 21 0e96 LINETO exported, shared data
20 21 0eaa MOVETO exported, shared data
21 1 4c50 EXCLUDECLIPRECT exported
22 1 4c84 INTERSECTCLIPRECT exported
23 9 1030 ARC exported, shared data
24 9 101c ELLIPSE exported, shared data
25 15 08fc FLOODFILL exported, shared data
26 9 1044 PIE exported, shared data
27 25 0000 RECTANGLE exported, shared data
28 9 106c ROUNDRECT exported, shared data
29 1 4c14 PATBLT exported, shared data
30 1 48cb SAVEDC exported, shared data
31 23 0383 SETPIXEL exported, shared data
32 1 4d3a OFFSETCLIPRGN exported, shared data
33 1 4f95 TEXTOUT exported, shared data
34 1 4bfa BITBLT exported, shared data
35 1 4be0 STRETCHBLT exported, shared data
36 24 0000 POLYGON exported, shared data
37 21 0ede POLYLINE exported, shared data
38 7 06d1 ESCAPE exported, shared data
39 1 48b7 RESTOREDC exported, shared data
40 26 0000 FILLRGN exported, shared data
41 26 003a FRAMERGN exported, shared data
42 1 4dbd INVERTRGN exported, shared data
43 26 0020 PAINTRGN exported, shared data
44 1 4c98 SELECTCLIPRGN exported, shared data
45 1 4dd7 SELECTOBJECT exported, shared data
46 1 79f4 __GP exported, shared data
47 1 4d4e COMBINERGN exported, shared data
48 1 4929 CREATEBITMAP exported, shared data
49 1 4943 CREATEBITMAPINDIRECT exported, shared data
50 4 05d7 CREATEBRUSHINDIRECT exported, shared data
51 4 05f1 CREATECOMPATIBLEBITMAP exported
52 1 47c4 CREATECOMPATIBLEDC exported, shared data
53 1 480a CREATEDC exported
54 9 020e CREATEELLIPTICRGN exported, shared data
55 9 0f99 CREATEELLIPTICRGNINDIRECT exported, shared data
56 3 1589 CREATEFONT exported, shared data
57 3 15b1 CREATEFONTINDIRECT exported, shared data
58 4 05a7 CREATEHATCHBRUSH exported, shared data
59 1 1ec0 WEP exported, shared data
60 4 05c3 CREATEPATTERNBRUSH exported, shared data
61 1 48f3 CREATEPEN exported, shared data
62 1 490f CREATEPENINDIRECT exported, shared data
63 9 0fb3 CREATEPOLYGONRGN exported, shared data
64 1 59cd CREATERECTRGN exported, shared data
65 1 4cb2 CREATERECTRGNINDIRECT exported, shared data
66 4 017a CREATESOLIDBRUSH exported, shared data
67 1 4a14 DPTOLP exported
68 1 4897 DELETEDC exported, shared data
69 1 48df DELETEOBJECT exported, shared data
70 5 05a7 ENUMFONTS exported, shared data
71 4 0678 ENUMOBJECTS exported, shared data
72 1 4ccc EQUALRGN exported, shared data
73 1 16a5 EXCLUDEVISRECT exported
74 1 4a76 GETBITMAPBITS exported
75 1 515d GETBKCOLOR exported, shared data
76 1 5142 GETBKMODE exported
77 1 4c64 GETCLIPBOX exported, shared data
78 1 5157 GETCURRENTPOSITION exported
79 1 5154 GETDCORG exported
80 1 4a96 GETDEVICECAPS exported, shared data
81 1 513f GETMAPMODE exported
82 4 06a8 GETOBJECT exported, shared data
83 23 036f GETPIXEL exported, shared data
84 1 5139 GETPOLYFILLMODE exported
85 1 5133 GETROP2 exported
86 1 5145 GETRELABS exported
87 1 4a5a GETSTOCKOBJECT exported, shared data
88 1 513c GETSTRETCHBLTMODE exported
89 16 0c63 GETTEXTCHARACTEREXTRA exported, shared data
90 1 5160 GETTEXTCOLOR exported, shared data
91 1 4b8d GETTEXTEXTENT exported, shared data
92 3 166a GETTEXTFACE exported, shared data
93 3 169a GETTEXTMETRICS exported, shared data
94 1 5151 GETVIEWPORTEXT exported
95 1 514b GETVIEWPORTORG exported
96 1 514e GETWINDOWEXT exported
97 1 5148 GETWINDOWORG exported
98 1 16a2 INTERSECTVISRECT exported
99 1 4a37 LPTODP exported
100 23 039b LINEDDA exported, shared data
101 1 4d26 OFFSETRGN exported, shared data
102 1 2929 OFFSETVISRGN exported, shared data
103 1 4da9 PTVISIBLE exported, shared data
104 1 4d06 RECTVISIBLE exported, shared data
105 1 1635 SELECTVISRGN exported, shared data
106 1 4aaa SETBITMAPBITS exported
117 1 1118 SETDCORG exported, shared data
119 2 0e25 ADDFONTRESOURCE exported, shared data
121 1 2067 DEATH exported, shared data
122 1 208e RESURRECTION exported, shared data
123 19 1603 PLAYMETAFILE exported, shared data
124 19 1624 GETMETAFILE exported, shared data
125 20 248b CREATEMETAFILE exported, shared data
126 20 24a5 CLOSEMETAFILE exported, shared data
127 19 15ef DELETEMETAFILE exported, shared data
128 1 41b0 MULDIV exported, shared data
129 1 076c SAVEVISRGN exported, shared data
130 1 07b2 RESTOREVISRGN exported, shared data
131 1 200a INQUIREVISRGN exported, shared data
132 7 073d SETENVIRONMENT exported, shared data
133 7 0707 GETENVIRONMENT exported, shared data
134 1 4b6d GETRGNBOX exported, shared data
135 15 087f SCANLR exported, shared data
136 6 0507 REMOVEFONTRESOURCE exported, shared data
148 1 4c28 SETBRUSHORG exported, shared data
149 1 515a GETBRUSHORG exported
150 1 4c3c UNREALIZEOBJECT exported, shared data
151 20 246b COPYMETAFILE exported, shared data
153 1 47d8 CREATEIC exported
154 1 4aca GETNEARESTCOLOR exported, shared data
155 7 052d QUERYABORT exported, shared data
156 4 0605 CREATEDISCARDABLEBITMAP exported
159 20 24b9 GETMETAFILEBITS exported, shared data
160 20 24cd SETMETAFILEBITS exported, shared data
161 1 4d95 PTINREGION exported, shared data
162 1 49b8 GETBITMAPDIMENSION exported, shared data
163 1 4984 SETBITMAPDIMENSION exported, shared data
169 1 4352 ISDCDIRTY exported, shared data
170 1 439b SETDCSTATUS exported, shared data
172 1 4d81 SETRECTRGN exported, shared data
173 1 5130 GETCLIPRGN exported, shared data
175 19 166a ENUMMETAFILE exported, shared data
176 19 163e PLAYMETAFILERECORD exported, shared data
179 1 0601 GETDCSTATE exported, shared data
180 1 0615 SETDCSTATE exported, shared data
181 1 4ce6 RECTINREGION exported, shared data
190 31 04ec SETDCHOOK exported, shared data
191 31 04b5 GETDCHOOK exported, shared data
192 1 76b0 SETHOOKFLAGS exported, shared data
193 31 0526 SETBOUNDSRECT exported, shared data
194 1 76e4 GETBOUNDSRECT exported, shared data
195 1 1ac6 SELECTBITMAP exported, shared data
196 20 24e1 SETMETAFILEBITSBETTER exported, shared data
201 13 014a DMBITBLT exported
202 13 014f DMCOLORINFO exported
206 13 0163 DMENUMDFONTS exported
207 13 0169 DMENUMOBJ exported
208 13 0159 DMOUTPUT exported
209 13 0154 DMPIXEL exported
210 13 015e DMREALIZEOBJECT exported
211 13 00df DMSTRBLT exported, shared data
212 13 016e DMSCANLR exported
213 13 0171 BRUTE exported, shared data
214 13 0000 DMEXTTEXTOUT exported, shared data
215 13 0130 DMGETCHARWIDTH exported, shared data
216 13 0136 DMSTRETCHBLT exported, shared data
217 13 013b DMDIBBITS exported, shared data
218 13 0140 DMSTRETCHDIBITS exported, shared data
219 13 0145 DMSETDIBTODEV exported, shared data
220 13 024d DMTRANSPOSE exported, shared data
230 27 0000 CREATEPQ exported
231 27 00fb MINPQ exported
232 27 00fe EXTRACTPQ exported
233 27 0045 INSERTPQ exported
234 27 01dc SIZEPQ exported
235 27 01cb DELETEPQ exported
240 28 01c3 OPENJOB exported, shared data
241 28 08eb WRITESPOOL exported, shared data
242 28 0e82 WRITEDIALOG exported, shared data
243 28 1292 CLOSEJOB exported, shared data
244 28 13e0 DELETEJOB exported, shared data
245 28 1802 GETSPOOLJOB exported, shared data
246 28 06a1 STARTSPOOLPAGE exported, shared data
247 28 1112 ENDSPOOLPAGE exported, shared data
248 28 18e4 QUERYJOB exported, shared data
250 28 0000 COPY exported, shared data
253 28 0ff3 DELETESPOOLPAGE exported, shared data
254 28 156f SPOOLFILE exported, shared data
300 5 093c ENGINEENUMERATEFONT exported, shared data
301 6 0560 ENGINEDELETEFONT exported, shared data
302 3 2b2d ENGINEREALIZEFONT exported, shared data
303 3 2c8a ENGINEGETCHARWIDTH exported, shared data
304 5 0993 ENGINESETFONTCONTEXT exported, shared data
305 7 09e9 ENGINEGETGLYPHBMP exported, shared data
306 7 1184 ENGINEMAKEFONTDIR exported, shared data
307 7 083d GETCHARABCWIDTHS exported, shared data
308 7 0876 GETOUTLINETEXTMETRICS exported, shared data
309 7 0795 GETGLYPHOUTLINE exported, shared data
310 7 0763 CREATESCALABLEFONTRESOURCE exported, shared data
311 7 07fc GETFONTDATA exported, shared data
312 7 0d8a CONVERTOUTLINEFONTFILE exported, shared data
313 7 0d36 GETRASTERIZERCAPS exported, shared data
314 1 669a ENGINEEXTTEXTOUT exported, shared data
330 5 05d7 ENUMFONTFAMILIES exported, shared data
332 7 0896 GETKERNINGPAIRS exported, shared data
345 1 5136 GETTEXTALIGN exported, shared data
346 1 4e49 SETTEXTALIGN exported, shared data
348 9 1058 CHORD exported, shared data
349 3 163f SETMAPPERFLAGS exported, shared data
350 3 15cb GETCHARWIDTH exported, shared data
351 1 4f48 EXTTEXTOUT exported, shared data
352 1 0a2e GETPHYSICALFONTHANDLE exported, shared data
353 3 160b GETASPECTRATIOFILTER exported, shared data
354 1 1fdf SHRINKGDIHEAP exported, shared data
355 48 02ef FTRAPPING0 exported, shared data
360 22 0023 CREATEPALETTE exported, shared data
361 22 0271 GDISELECTPALETTE exported, shared data
362 22 1088 GDIREALIZEPALETTE exported, shared data
363 22 0050 GETPALETTEENTRIES exported, shared data
364 22 00d2 SETPALETTEENTRIES exported, shared data
365 22 101d REALIZEDEFAULTPALETTE exported, shared data
366 22 0109 UPDATECOLORS exported, shared data
367 22 0000 ANIMATEPALETTE exported, shared data
368 22 00be RESIZEPALETTE exported, shared data
370 22 0073 GETNEARESTPALETTEINDEX exported, shared data
372 15 0910 EXTFLOODFILL exported, shared data
373 22 00f5 SETSYSTEMPALETTEUSE exported, shared data
374 22 00aa GETSYSTEMPALETTEUSE exported, shared data
375 22 0087 GETSYSTEMPALETTEENTRIES exported, shared data
376 31 009c RESETDC exported, shared data
377 31 0045 STARTDOC exported, shared data
378 31 002e ENDDOC exported, shared data
379 31 0068 STARTPAGE exported, shared data
380 31 0017 ENDPAGE exported, shared data
381 31 007c SETABORTPROC exported, shared data
382 31 0000 ABORTDOC exported, shared data
400 1 420e FASTWINDOWFRAME exported, shared data
401 2 0403 GDIMOVEBITMAP exported, shared data
403 2 042a GDIINIT2 exported, shared data
405 2 012e FINALGDIINIT exported, shared data
407 1 0ec1 CREATEUSERBITMAP exported
409 4 0200 CREATEUSERDISCARDABLEBITMAP exported
410 19 1490 ISVALIDMETAFILE exported, shared data
411 1 511a GETCURLOGFONT exported, shared data
412 22 0b0c ISDCCURRENTPALETTE exported, shared data
439 11 0202 STRETCHDIBITS exported, shared data
440 11 0000 SETDIBITS exported, shared data
441 11 0196 GETDIBITS exported, shared data
442 11 006c CREATEDIBITMAP exported, shared data
443 11 010a SETDIBITSTODEVICE exported, shared data
444 9 01be CREATEROUNDRECTRGN exported, shared data
445 4 0619 CREATEDIBPATTERNBRUSH exported, shared data
449 11 1015 DEVICECOLORMATCH exported, shared data
450 24 0023 POLYPOLYGON exported, shared data
451 9 0fe3 CREATEPOLYPOLYGONRGN exported, shared data
452 21 19a0 GDISEEGDIDO exported, shared data
460 1 7690 GDITASKTERMINATION exported, shared data
461 1 76a2 SETOBJECTOWNER exported, shared data
462 1 1ec6 ISGDIOBJECT exported, shared data
463 1 0e68 MAKEOBJECTPRIVATE exported, shared data
464 19 1862 FIXUPBOGUSPUBLISHERMETAFILE exported, shared data
465 1 29b7 RECTVISIBLE_EHH exported, shared data
466 1 2aab RECTINREGION_EHH exported, shared data
467 1 56a3 UNICODETOANSI exported, shared data
468 1 49cc GETBITMAPDIMENSIONEX exported, shared data
469 1 5eb5 GETBRUSHORGEX exported
470 1 5ed8 GETCURRENTPOSITIONEX exported
471 1 4bb4 GETTEXTEXTENTPOINT exported, shared data
472 1 5f27 GETVIEWPORTEXTEX exported
473 1 5f4a GETVIEWPORTORGEX exported
474 1 5f6d GETWINDOWEXTEX exported
475 1 5f90 GETWINDOWORGEX exported
476 1 4af2 OFFSETVIEWPORTORGEX exported
477 1 4b26 OFFSETWINDOWORGEX exported
478 1 4998 SETBITMAPDIMENSIONEX exported, shared data
479 4 0710 SETVIEWPORTEXTEX exported
480 1 4f28 SETVIEWPORTORGEX exported, shared data
481 4 06dc SETWINDOWEXTEX exported
482 1 4ef4 SETWINDOWORGEX exported, shared data
483 21 0ebe MOVETOEX exported, shared data
484 4 0744 SCALEVIEWPORTEXTEX exported
485 4 0778 SCALEWINDOWEXTEX exported
486 3 161f GETASPECTRATIOFILTEREX exported, shared data

View File

@ -1,3 +1,5 @@
# $Id: gdi.spec,v 1.2 1993/06/30 14:24:33 root Exp root $
#
name gdi name gdi
id 3 id 3
length 256 length 490

10
heap.c
View File

@ -1,4 +1,4 @@
static char RCSId[] = "$Id$"; static char RCSId[] = "$Id: heap.c,v 1.1 1993/06/29 15:55:18 root Exp $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h> #include <stdio.h>
@ -34,7 +34,7 @@ HEAP_LocalAlloc(int flags, int bytes)
MDESC *m, *m_new; MDESC *m, *m_new;
#ifdef HEAP_DEBUG #ifdef HEAP_DEBUG
fprintf(stderr, "LocalAlloc: flags %x, bytes %d, ", flags, bytes); printf("LocalAlloc: flags %x, bytes %d, ", flags, bytes);
#endif #endif
/* /*
@ -63,7 +63,7 @@ HEAP_LocalAlloc(int flags, int bytes)
m->length -= (m_new->length + sizeof(MDESC)); m->length -= (m_new->length + sizeof(MDESC));
#ifdef HEAP_DEBUG #ifdef HEAP_DEBUG
fprintf(stderr, "Returning %x\n", (int) (m + 1)); printf("Returning %x\n", (int) (m + 1));
#endif #endif
return (void *) (m + 1); return (void *) (m + 1);
} }
@ -80,13 +80,13 @@ HEAP_LocalAlloc(int flags, int bytes)
m->next->prev = m->prev; m->next->prev = m->prev;
#ifdef HEAP_DEBUG #ifdef HEAP_DEBUG
fprintf(stderr, "Returning %x\n", (int) (m + 1)); printf("Returning %x\n", (int) (m + 1));
#endif #endif
return (void *) (m + 1); return (void *) (m + 1);
} }
#ifdef HEAP_DEBUG #ifdef HEAP_DEBUG
fprintf(stderr, "Returning 0\n"); printf("Returning 0\n");
#endif #endif
return 0; return 0;
} }

View File

@ -36,7 +36,7 @@ offset:
.text .text
/********************************************************************** /**********************************************************************
* int CallTo16(unsigned long csip, unsigned long sssp, * int CallToInit16(unsigned long csip, unsigned long sssp,
* unsigned short ds) * unsigned short ds)
* *
* Stack: 0 ebp * Stack: 0 ebp
@ -48,8 +48,8 @@ offset:
* 16 target ds * 16 target ds
*/ */
.align 4 .align 4
.globl _CallTo16 .globl _CallToInit16
_CallTo16: _CallToInit16:
pushl %ebp pushl %ebp
movl %esp,%ebp movl %esp,%ebp
@ -76,13 +76,17 @@ _CallTo16:
movl %ebp,saved_ebp movl %ebp,saved_ebp
/* /*
* Load ds, es, sp, ss & bp * Load initial registers
*/ */
movl $0,%eax movw _WIN_StackSize,%bx
movw _WIN_HeapSize,%cx
movl $0,%esi
xorl %eax,%eax
movw _PSPSelector,%ax movw _PSPSelector,%ax
movw %ax,%es movw %ax,%es
movw 16(%ebp),%ax movw 16(%ebp),%ax
movw %ax,%ds movw %ax,%ds
movl %eax,%edi
xorl %eax,%eax xorl %eax,%eax
movw 12(%ebp),%ax movw 12(%ebp),%ax
movl %eax,%esp movl %eax,%esp
@ -257,6 +261,8 @@ _KERNEL_InitTask:
popl saved_16esp popl saved_16esp
popw %es popw %es
/* movw _PSPSelector,%ax
movw %ax,%es */
popw %ds popw %ds
.align 2,0x90 .align 2,0x90
@ -283,12 +289,11 @@ noargs_2:
/* /*
* Last, we need to load the return values. * Last, we need to load the return values.
*/ */
movl $0,%esi
movw $1,%ax movw $1,%ax
movw %gs:_WIN_StackSize,%cx movw %gs:_WIN_StackSize,%cx
movw $1,%dx movw $1,%dx
movw 0x80,%bx movw 0x80,%bx
movl $0,%esi
movl $1,%edi
.byte 0x66 .byte 0x66
lret lret

233
kernel-ordinals Normal file
View File

@ -0,0 +1,233 @@
1 1 93ce FATALEXIT exported, shared data
2 1 9d6f EXITKERNEL exported
3 3 07c6 GETVERSION exported
4 2 28b7 LOCALINIT exported
5 1 0543 LOCALALLOC exported
6 1 0587 LOCALREALLOC exported
7 1 055f LOCALFREE exported
8 1 0573 LOCALLOCK exported
9 1 05bd LOCALUNLOCK exported
10 1 05a9 LOCALSIZE exported
11 1 8d6a LOCALHANDLE exported
12 1 05d1 LOCALFLAGS exported
13 1 8d85 LOCALCOMPACT exported
14 2 0278 LOCALNOTIFY exported
15 1 022b GLOBALALLOC exported
16 1 028c GLOBALREALLOC exported
17 1 0247 GLOBALFREE exported
18 1 0278 GLOBALLOCK exported
19 1 02cb GLOBALUNLOCK exported
20 1 02b7 GLOBALSIZE exported
21 1 0264 GLOBALHANDLE exported
22 1 02e8 GLOBALFLAGS exported
23 1 03b3 LOCKSEGMENT exported
24 1 03c7 UNLOCKSEGMENT exported
25 1 1105 GLOBALCOMPACT exported
26 1 0e39 GLOBALFREEALL exported
28 1 1190 GLOBALMASTERHANDLE exported
29 1 7d21 YIELD exported
30 1 7ca8 WAITEVENT exported
31 1 7d92 POSTEVENT exported
32 1 7df0 SETPRIORITY exported
33 1 81e5 LOCKCURRENTTASK exported
34 1 7de3 SETTASKQUEUE exported
35 1 7d9d GETTASKQUEUE exported
36 1 842c GETCURRENTTASK exported
37 3 024e GETCURRENTPDB exported
38 1 7dc5 SETTASKSIGNALPROC exported
41 1 9c8e ENABLEDOS exported
42 1 9c8f DISABLEDOS exported
45 2 0244 LOADMODULE exported
46 2 0176 FREEMODULE exported
47 2 01bb GETMODULEHANDLE exported
48 2 01d2 GETMODULEUSAGE exported
49 2 01e6 GETMODULEFILENAME exported
50 2 019e GETPROCADDRESS exported
51 3 00a8 MAKEPROCINSTANCE exported
52 3 00c5 FREEPROCINSTANCE exported
53 1 4927 CALLPROCINSTANCE exported
54 2 0219 GETINSTANCEDATA exported
55 3 08ee CATCH exported
56 3 0928 THROW exported
57 1 0663 GETPROFILEINT exported, shared data
58 1 0689 GETPROFILESTRING exported, shared data
59 1 0763 WRITEPROFILESTRING exported, shared data
60 3 0008 FINDRESOURCE exported
61 1 0126 LOADRESOURCE exported
62 1 018b LOCKRESOURCE exported
63 1 0177 FREERESOURCE exported
64 1 0140 ACCESSRESOURCE exported
65 1 019f SIZEOFRESOURCE exported
66 1 015d ALLOCRESOURCE exported
67 3 002e SETRESOURCEHANDLER exported
68 3 041a INITATOMTABLE exported
69 1 4942 FINDATOM exported
70 1 493f ADDATOM exported
71 1 01b9 DELETEATOM exported
72 1 01cd GETATOMNAME exported
73 1 01fd GETATOMHANDLE exported
74 1 05e5 OPENFILE exported
75 3 04be OPENPATHNAME exported
76 3 04b6 DELETEPATHNAME exported
77 1 83cd RESERVED1 exported
78 1 83ca RESERVED2 exported
79 1 83c4 RESERVED3 exported
80 1 83c7 RESERVED4 exported
81 1 046e _LCLOSE exported
82 1 04e6 _LREAD exported
83 1 048d _LCREAT exported
84 1 04b8 _LLSEEK exported
85 1 0443 _LOPEN exported
86 1 0516 _LWRITE exported
87 1 838e RESERVED5 exported
88 1 836f LSTRCPY exported
89 1 837f LSTRCAT exported
90 1 82f6 LSTRLEN exported
91 2 268d INITTASK exported
92 3 0508 GETTEMPDRIVE exported
93 1 48fa GETCODEHANDLE exported
94 3 03ce DEFINEHANDLETABLE exported
95 2 022d LOADLIBRARY exported
96 2 018a FREELIBRARY exported
97 3 00dc GETTEMPFILENAME exported
98 1 5c17 GETLASTDISKCHANGE exported
99 1 0bc5 GETLPERRMODE exported
100 2 2ab7 VALIDATECODESEGMENTS exported
101 1 1d92 NOHOOKDOSCALL exported
102 1 1d98 DOS3CALL exported
103 1 9e19 NETBIOSCALL exported
104 1 03db GETCODEINFO exported
105 3 07d9 GETEXEVERSION exported
106 1 2ede SETSWAPAREASIZE exported
107 3 0132 SETERRORMODE exported
108 1 11c6 SWITCHSTACKTO exported
109 1 123c SWITCHSTACKBACK exported
110 1 7bac PATCHCODEHANDLE exported
111 1 02fc GLOBALWIRE exported
112 1 0310 GLOBALUNWIRE exported
113 254 0003 __AHSHIFT exported
114 254 0008 __AHINCR exported
115 1 999b OUTPUTDEBUGSTRING exported
116 2 2797 INITLIB exported
117 1 7d3e OLDYIELD exported
118 1 7da7 GETTASKQUEUEDS exported
119 1 7db5 GETTASKQUEUEES exported
120 1 72d4 UNDEFDYNLINK exported
121 1 8db0 LOCALSHRINK exported
122 1 81ff ISTASKLOCKED exported
123 1 4638 KBDRST exported
124 1 9c90 ENABLEKERNEL exported
125 1 9c91 DISABLEKERNEL exported
126 1 2ea7 MEMORYFREED exported
127 1 06d7 GETPRIVATEPROFILEINT exported, shared data
128 1 0709 GETPRIVATEPROFILESTRING exported, shared data
129 1 0795 WRITEPRIVATEPROFILESTRING exported, shared data
130 3 0888 FILECDR exported
131 3 08ce GETDOSENVIRONMENT exported
132 3 07ab GETWINFLAGS exported
133 1 4e78 GETEXEPTR exported
134 3 0054 GETWINDOWSDIRECTORY exported
135 3 007e GETSYSTEMDIRECTORY exported
136 3 0675 GETDRIVETYPE exported
137 1 0211 FATALAPPEXIT exported
138 2 1e4d GETHEAPSPACES exported
139 1 612c DOSIGNAL exported
140 3 068c SETSIGHANDLER exported
141 1 8014 INITTASK1 exported
150 1 7cff DIRECTEDYIELD exported
151 3 07e6 WINOLDAPCALL exported
152 3 08e2 GETNUMTASKS exported
154 1 034c GLOBALNOTIFY exported
155 1 119f GETTASKDS exported
156 1 4632 LIMITEMSPAGES exported
157 1 4639 GETCURPID exported
158 1 7e3e ISWINOLDAPTASK exported
159 1 0ec5 GLOBALHANDLENORIP exported
160 1 a940 EMSCOPY exported
161 2 29c9 LOCALCOUNTFREE exported
162 2 2a01 LOCALHEAPSIZE exported
163 1 0338 GLOBALLRUOLDEST exported
164 1 0324 GLOBALLRUNEWEST exported
165 1 9e0c A20PROC exported
166 2 028f WINEXEC exported
167 1 4f02 GETEXPWINVER exported
168 1 84b8 DIRECTRESALLOC exported
169 1 0404 GETFREESPACE exported
170 1 00d0 ALLOCCSTODSALIAS exported
171 1 00e4 ALLOCDSTOCSALIAS exported
172 1 21fb ALLOCALIAS exported
173 254 f000 __ROMBIOS exported
174 254 a000 __A000H exported
175 1 1d9e ALLOCSELECTOR exported
176 1 00f8 FREESELECTOR exported
177 1 010c PRESTOCHANGOSELECTOR exported
178 254 0001 __WINFLAGS exported
179 254 d000 __D000H exported
180 1 26b9 LONGPTRADD exported
181 254 b000 __B000H exported
182 254 b800 __B800H exported
183 254 0000 __0000H exported
184 1 139a GLOBALDOSALLOC exported
185 1 13d4 GLOBALDOSFREE exported
186 1 2252 GETSELECTORBASE exported
187 1 2725 SETSELECTORBASE exported
188 1 2755 GETSELECTORLIMIT exported
189 1 276d SETSELECTORLIMIT exported
190 254 e000 __E000H exported
191 1 0363 GLOBALPAGELOCK exported
192 1 0377 GLOBALPAGEUNLOCK exported
193 254 0040 __0040H exported
194 254 f000 __F000H exported
195 254 c000 __C000H exported
196 1 279b SELECTORACCESSRIGHTS exported
197 1 038b GLOBALFIX exported
198 1 039f GLOBALUNFIX exported
199 1 0647 SETHANDLECOUNT exported
200 1 3e4e VALIDATEFREESPACES exported
201 1 9ada REPLACEINST exported
202 3 081d REGISTERPTRACE exported
203 1 946e DEBUGBREAK exported
204 3 014e SWAPRECORDING exported
205 1 97e0 CVWBREAK exported
206 1 1df5 ALLOCSELECTORARRAY exported
207 1 8425 ISDBCSLEADBYTE exported
310 2 2a0c LOCALHANDLEDELTA exported
311 1 9eaf GETSETKERNELDOSPROC exported
314 1 9835 DEBUGDEFINESEGMENT exported
315 1 708b WRITEOUTPROFILES exported, shared data
316 1 127e GETFREEMEMINFO exported
318 1 9ecf FATALEXITHOOK exported
319 1 52fc FLUSHCACHEDFILEHANDLE exported
320 1 7e50 ISTASK exported
323 2 1e9b ISROMMODULE exported
324 1 94cf LOGERROR exported, shared data
325 1 94f2 LOGPARAMERROR exported, shared data
326 2 1ea0 ISROMFILE exported
327 1 949b K327 exported
328 1 94ce _DEBUGOUTPUT exported
329 1 94c5 K329 exported
332 4 0218 THHOOK exported
334 1 4b62 ISBADREADPTR exported
335 1 4b83 ISBADWRITEPTR exported
336 1 4c28 ISBADCODEPTR exported
337 1 4c4e ISBADSTRINGPTR exported
338 1 4c72 HASGPHANDLER exported
339 1 a70e DIAGQUERY exported
340 1 a71d DIAGOUTPUT exported
341 3 084c TOOLHELPHOOK exported
342 1 a820 __GP exported, shared data
343 2 0689 REGISTERWINOLDAPHOOK exported
344 2 06f3 GETWINOLDAPHOOKS exported
345 1 4d39 ISSHAREDSELECTOR exported
346 1 4ba5 ISBADHUGEREADPTR exported
347 1 4be5 ISBADHUGEWRITEPTR exported
348 1 4d5c HMEMCPY exported
349 1 4dec _HREAD exported
350 1 4df1 _HWRITE exported
351 1 5e92 BUNNY_351 exported
353 1 831f LSTRCPYN exported
354 1 9eeb GETAPPCOMPATFLAGS exported
355 1 9f2a GETWINDEBUGINFO exported, shared data
356 1 9f36 SETWINDEBUGINFO exported, shared data
403 1 29f1 K403 exported
404 1 29ae K404 exported

View File

@ -1,4 +1,4 @@
static char RCSId[] = "$Id$"; static char RCSId[] = "$Id: kernel.c,v 1.1 1993/06/29 15:55:18 root Exp $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h> #include <stdio.h>
@ -28,7 +28,7 @@ KERNEL_LockSegment(int segment)
segment = *(Stack16Frame + 6); segment = *(Stack16Frame + 6);
#ifdef RELAY_DEBUG #ifdef RELAY_DEBUG
fprintf(stderr, "LockSegment: segment %x\n", segment); printf("LockSegment: segment %x\n", segment);
#endif #endif
return segment; return segment;
@ -44,7 +44,7 @@ KERNEL_UnlockSegment(int segment)
segment = *(Stack16Frame + 6); segment = *(Stack16Frame + 6);
#ifdef RELAY_DEBUG #ifdef RELAY_DEBUG
fprintf(stderr, "UnlockSegment: segment %x\n", segment); printf("UnlockSegment: segment %x\n", segment);
#endif #endif
return segment; return segment;
@ -57,7 +57,7 @@ int
KERNEL_WaitEvent(int task) KERNEL_WaitEvent(int task)
{ {
#ifdef RELAY_DEBUG #ifdef RELAY_DEBUG
fprintf(stderr, "WaitEvent: task %d\n", task); printf("WaitEvent: task %d\n", task);
#endif #endif
return 0; return 0;
} }
@ -68,7 +68,7 @@ int
KERNEL_GetModuleFileName(int module, char *filename, int bytes) KERNEL_GetModuleFileName(int module, char *filename, int bytes)
{ {
#ifdef RELAY_DEBUG #ifdef RELAY_DEBUG
fprintf(stderr, "GetModuleFileName: module %d, filename %x, bytes %d\n", printf("GetModuleFileName: module %d, filename %x, bytes %d\n",
module, filename, bytes); module, filename, bytes);
#endif #endif

View File

@ -1,8 +1,10 @@
# $Id: kernel.spec,v 1.2 1993/06/30 14:24:33 root Exp root $
#
name kernel name kernel
id 1 id 1
length 256 length 410
3 pascal GetVersion() KERNEL_GetVersion() 3 return GetVersion 0 0x301
5 pascal LocalAlloc(word word) HEAP_LocalAlloc(1 2) 5 pascal LocalAlloc(word word) HEAP_LocalAlloc(1 2)
23 pascal LockSegment(s_word) KERNEL_LockSegment(1) 23 pascal LockSegment(s_word) KERNEL_LockSegment(1)
24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1) 24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1)

8
ldt.c
View File

@ -1,8 +1,6 @@
/* $Id$ static char RCSId[] = "$Id: ldt.c,v 1.1 1993/06/29 15:55:18 root Exp $";
*/ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/*
* Copyright Robert J. Amstadt, 1993
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>

View File

@ -1,8 +1,6 @@
/* $Id$ static char RCSId[] = "$Id: ldtlib.c,v 1.1 1993/06/29 15:55:18 root Exp $";
*/ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/*
* Copyright Robert J. Amstadt, 1993
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>

67
neexe.h
View File

@ -1,4 +1,4 @@
/* $Id: neexe.h,v 1.1 1993/06/09 03:28:10 root Exp root $ /* $Id: neexe.h,v 1.3 1993/06/30 14:24:33 root Exp root $
*/ */
/* /*
* Copyright Robert J. Amstadt, 1993 * Copyright Robert J. Amstadt, 1993
@ -143,9 +143,9 @@ struct dos_psp_s
unsigned short pspNextParagraph; unsigned short pspNextParagraph;
unsigned char pspReserved1; unsigned char pspReserved1;
unsigned char pspDispatcher[5]; unsigned char pspDispatcher[5];
unsigned long pspTerminateVector; unsigned short pspTerminateVector[2];
unsigned long pspControlCVector; unsigned short pspControlCVector[2];
unsigned long pspCritErrorVector; unsigned short pspCritErrorVector[2];
unsigned short pspReserved2[11]; unsigned short pspReserved2[11];
unsigned short pspEnvironment; unsigned short pspEnvironment;
unsigned short pspReserved3[23]; unsigned short pspReserved3[23];
@ -155,4 +155,63 @@ struct dos_psp_s
unsigned char pspCommandTail[128]; unsigned char pspCommandTail[128];
}; };
/*
* Entry table structures.
*/
struct entry_tab_header_s
{
unsigned char n_entries;
unsigned char seg_number;
};
struct entry_tab_movable_s
{
unsigned char flags;
unsigned char int3f[2];
unsigned char seg_number;
unsigned short offset;
};
struct entry_tab_fixed_s
{
unsigned char flags;
unsigned char offset[2];
};
/*
* Resource table structures.
*/
struct resource_nameinfo_s
{
unsigned short offset;
unsigned short length;
unsigned short flags;
unsigned short id;
unsigned short handle;
unsigned short usage;
};
struct resource_typeinfo_s
{
unsigned short type_id; /* Type identifier */
unsigned short count; /* Number of resources of this type */
unsigned long reserved;
/*
* Name info array.
*/
};
#define NE_RSCTYPE_ACCELERATOR 0x8009
#define NE_RSCTYPE_BITMAP 0x8002
#define NE_RSCTYPE_CURSOR 0x8001
#define NE_RSCTYPE_DIALOG 0x8005
#define NE_RSCTYPE_FONT 0x8008
#define NE_RSCTYPE_FONTDIR 0x8007
#define NE_RSCTYPE_GROUP_CURSOR 0x800c
#define NE_RSCTYPE_GROUP_ICON 0x800e
#define NE_RSCTYPE_ICON 0x8003
#define NE_RSCTYPE_MENU 0x8004
#define NE_RSCTYPE_RCDATA 0x800a
#define NE_RSCTYPE_STRING 0x8006
#endif /* NEEXE_H */ #endif /* NEEXE_H */

View File

@ -1,4 +1,4 @@
/* $Id$ /* $Id: prototypes.h,v 1.1 1993/06/29 15:55:18 root Exp $
*/ */
/* /*
* Copyright Robert J. Amstadt, 1993 * Copyright Robert J. Amstadt, 1993
@ -26,7 +26,14 @@ extern int FixupSegment(int fd, struct mz_header_s * mz_header,
struct segment_descriptor_s *selecetor_table, struct segment_descriptor_s *selecetor_table,
int segment_num); int segment_num);
extern struct dll_table_entry_s *FindDLLTable(char *dll_name); extern struct dll_table_entry_s *FindDLLTable(char *dll_name);
extern unsigned int GetEntryPointFromOrdinal(int fd,
struct mz_header_s *mz_header,
struct ne_header_s *ne_header,
int ordinal);
extern char WIN_CommandLine[]; extern char WIN_CommandLine[];
extern struct mz_header_s *CurrentMZHeader;
extern struct ne_header_s *CurrentNEHeader;
extern int CurrentNEFile;
#endif /* PROTOTYPES_H */ #endif /* PROTOTYPES_H */

27
relay.c
View File

@ -1,8 +1,5 @@
/* $Id$ static char RCSId[] = "$Id: relay.c,v 1.1 1993/06/29 15:55:18 root Exp $";
*/ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/*
* Copyright Robert J. Amstadt, 1993
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -20,12 +17,16 @@
#include "prototypes.h" #include "prototypes.h"
#include "dlls.h" #include "dlls.h"
struct dll_name_table_entry_s dll_builtin_table[4] = #define N_BUILTINS 6
struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS] =
{ {
{ "KERNEL", KERNEL_table, 256, 1 }, { "KERNEL", KERNEL_table, 410, 1 },
{ "USER", USER_table, 256, 2 }, { "USER", USER_table, 540, 2 },
{ "GDI", GDI_table, 256, 3 }, { "GDI", GDI_table, 490, 3 },
{ "UNIXLIB", UNIXLIB_table, 256, 4 }, { "UNIXLIB", UNIXLIB_table, 10, 4 },
{ "WIN87EM", WIN87EM_table, 10, 5 },
{ "SHELL", SHELL_table, 256, 6 },
}; };
unsigned short *Stack16Frame; unsigned short *Stack16Frame;
@ -170,7 +171,7 @@ FindDLLTable(char *dll_name)
{ {
int i; int i;
for (i = 0; i < 4; i++) for (i = 0; i < N_BUILTINS; i++)
if (strcmp(dll_builtin_table[i].dll_name, dll_name) == 0) if (strcmp(dll_builtin_table[i].dll_name, dll_name) == 0)
return dll_builtin_table[i].dll_table; return dll_builtin_table[i].dll_table;
@ -185,11 +186,11 @@ FindOrdinalFromName(struct dll_table_entry_s *dll_table, char *func_name)
{ {
int i, limit; int i, limit;
for (i = 0; i < 4; i++) for (i = 0; i < N_BUILTINS; i++)
if (dll_table == dll_builtin_table[i].dll_table) if (dll_table == dll_builtin_table[i].dll_table)
break; break;
if (i == 4) if (i == N_BUILTINS)
return 0; return 0;
limit = dll_builtin_table[i].dll_table_length; limit = dll_builtin_table[i].dll_table_length;

242
resource.c Normal file
View File

@ -0,0 +1,242 @@
static char RCSId[] = "$Id: resource.c,v 1.3 1993/06/30 14:24:33 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h>
#include <stdlib.h>
#include "prototypes.h"
#include "neexe.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
typedef struct resource_data_s
{
int resource_type;
void *resource_data;
} RSCD;
RSCD *Resources;
int ResourceArraySize;
/**********************************************************************
* AddResource
*/
int
AddResource(int type, void *data)
{
RSCD *r;
int i;
int j;
/*
* Find free resource id.
*/
r = Resources;
for (i = 0; i < ResourceArraySize; i++, r++)
if (r->resource_type == 0)
break;
/*
* Do we need to add more resource slots?
*/
if (i == ResourceArraySize)
{
if (ResourceArraySize > 0)
r = realloc(Resources, (ResourceArraySize + 32) * sizeof(RSCD));
else
r = malloc(32 * sizeof(RSCD));
if (r == NULL)
return 0;
for (j = ResourceArraySize; j < ResourceArraySize + 32; j++)
r[j].resource_type = 0;
ResourceArraySize += 32;
Resources = r;
r = &Resources[i];
}
/*
* Add new resource to list.
*/
r->resource_type = type;
r->resource_data = data;
/*
* Return a unique handle.
*/
return i + 1;
}
/**********************************************************************
* FindResourceByNumber
*/
int
FindResourceByNumber(struct resource_nameinfo_s *result_p,
int type_id, int resource_id)
{
struct resource_typeinfo_s typeinfo;
struct resource_nameinfo_s nameinfo;
unsigned short size_shift;
int i;
/*
* Move to beginning of resource table.
*/
lseek(CurrentNEFile, (CurrentMZHeader->ne_offset +
CurrentNEHeader->resource_tab_offset), SEEK_SET);
/*
* Read block size.
*/
if (read(CurrentNEFile, &size_shift, sizeof(size_shift)) !=
sizeof(size_shift))
{
return -1;
}
/*
* Find resource.
*/
typeinfo.type_id = 0xffff;
while (typeinfo.type_id != 0)
{
if (read(CurrentNEFile, &typeinfo, sizeof(typeinfo)) !=
sizeof(typeinfo))
{
return -1;
}
if (typeinfo.type_id != 0)
{
for (i = 0; i < typeinfo.count; i++)
{
if (read(CurrentNEFile, &nameinfo, sizeof(nameinfo)) !=
sizeof(nameinfo))
{
return -1;
}
#if defined(DEBUG_RESOURCE) && defined(VERBOSE_DEBUG)
if (type_id == typeinfo.type_id)
{
printf("FindResource: type id = %d, resource id = %x\n",
type_id, nameinfo.id);
}
#endif
if ((type_id == -1 || typeinfo.type_id == type_id) &&
nameinfo.id == resource_id)
{
memcpy(result_p, &nameinfo, sizeof(nameinfo));
return size_shift;
}
}
}
}
return -1;
}
/**********************************************************************
* RSC_LoadString
*/
int
RSC_LoadString(int instance, int resource_id, char *buffer, int buflen)
{
struct resource_nameinfo_s nameinfo;
unsigned short target_id;
unsigned char string_length;
int size_shift;
int string_num;
int i;
#ifdef DEBUG_RESOURCE
printf("LoadString: instance = %04x, id = %d, "
"buffer = %08x, length = %d\n",
instance, resource_id, buffer, buflen);
#endif
/*
* Find string entry.
*/
target_id = (resource_id >> 4) + 0x8001;
string_num = resource_id & 0x000f;
size_shift = FindResourceByNumber(&nameinfo, NE_RSCTYPE_STRING, target_id);
if (size_shift == -1)
return 0;
lseek(CurrentNEFile, (int) nameinfo.offset << size_shift, SEEK_SET);
for (i = 0; i < string_num; i++)
{
read(CurrentNEFile, &string_length, 1);
lseek(CurrentNEFile, string_length, SEEK_CUR);
}
read(CurrentNEFile, &string_length, 1);
i = MIN(string_length, buflen - 1);
read(CurrentNEFile, buffer, i);
buffer[i] = '\0';
#ifdef DEBUG_RESOURCE
printf(" '%s'\n", buffer);
#endif
return i;
}
/**********************************************************************
* RSC_LoadBitmap
*/
int
RSC_LoadBitmap(int instance, char *bmp_name)
{
struct resource_nameinfo_s nameinfo;
void *image;
int image_size;
int size_shift;
#ifdef DEBUG_RESOURCE
printf("LoadBitmap: instance = %04x, name = %08x\n",
instance, bmp_name);
#endif
/*
* Built-in bitmaps
*/
if (instance == 0)
{
return 0;
}
/*
* Get bitmap by ordinal
*/
else if (((int) bmp_name & 0xffff0000) == 0)
{
size_shift = FindResourceByNumber(&nameinfo, NE_RSCTYPE_BITMAP,
(int) bmp_name | 0x8000);
}
/*
* Get bitmap by name
*/
else
{
size_shift = -1;
}
if (size_shift == -1)
return 0;
/*
* Read bitmap.
*/
lseek(CurrentNEFile, ((int) nameinfo.offset << size_shift), SEEK_SET);
image_size = nameinfo.length << size_shift;
image = malloc(image_size);
if (image == NULL || read(CurrentNEFile, image, image_size) != image_size)
{
free(image);
return 0;
}
/*
* Add to resource list.
*/
return AddResource(NE_RSCTYPE_BITMAP, image);
}

View File

@ -1,4 +1,4 @@
/* $Id$ /* $Id: segmem.h,v 1.1 1993/06/29 15:55:18 root Exp $
*/ */
/* /*
* Copyright Robert J. Amstadt, 1993 * Copyright Robert J. Amstadt, 1993

View File

@ -1,8 +1,5 @@
/* $Id: exedump.c,v 1.1 1993/06/09 03:28:10 root Exp root $ static char RCSId[] = "$Id: selector.c,v 1.1 1993/06/29 15:55:18 root Exp $";
*/ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/*
* Copyright Robert J. Amstadt, 1993
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -29,6 +26,78 @@ unsigned short PSPSelector;
extern void KERNEL_Ordinal_102(); extern void KERNEL_Ordinal_102();
extern void UNIXLIB_Ordinal_0(); extern void UNIXLIB_Ordinal_0();
/**********************************************************************
* GetEntryPointFromOrdinal
*/
unsigned int
GetEntryPointFromOrdinal(int fd, struct mz_header_s *mz_header,
struct ne_header_s *ne_header, int ordinal)
{
struct entry_tab_header_s eth;
struct entry_tab_movable_s etm;
struct entry_tab_fixed_s etf;
int current_ordinal;
int i;
/*
* Move to the beginning of the entry table.
*/
lseek(fd, mz_header->ne_offset + ne_header->entry_tab_offset, SEEK_SET);
/*
* Let's walk through the table until we get to our entry.
*/
current_ordinal = 1;
while (1)
{
/*
* Read header for this bundle.
*/
if (read(fd, &eth, sizeof(eth)) != sizeof(eth))
myerror("Error reading entry table");
if (eth.n_entries == 0)
return 0;
if (eth.seg_number == 0)
{
current_ordinal++;
continue;
}
/*
* Read each of the bundle entries.
*/
for (i = 0; i < eth.n_entries; i++, current_ordinal++)
{
if (eth.seg_number >= 0xfe)
{
if (read(fd, &etm, sizeof(etm)) != sizeof(etm))
myerror("Error reading entry table");
if (current_ordinal == ordinal)
{
return ((unsigned int)
(SelectorTable[etm.seg_number - 1].base_addr +
etm.offset));
}
}
else
{
if (read(fd, &etf, sizeof(etf)) != sizeof(etf))
myerror("Error reading entry table");
if (current_ordinal == ordinal)
{
return ((unsigned int)
(SelectorTable[eth.seg_number - 1].base_addr +
(int) etf.offset[0] +
((int) etf.offset[1] << 8)));
}
}
}
}
}
/********************************************************************** /**********************************************************************
* GetDOSEnvironment * GetDOSEnvironment
@ -113,9 +182,12 @@ CreatePSP(int sel_idx, struct segment_descriptor_s *s, FILE *zfile)
usp = (unsigned short *) &psp->pspDispatcher[1]; usp = (unsigned short *) &psp->pspDispatcher[1];
*usp = (unsigned short) KERNEL_Ordinal_102; *usp = (unsigned short) KERNEL_Ordinal_102;
*(usp + 1) = 0x23; *(usp + 1) = 0x23;
psp->pspTerminateVector = 0x00230000 | ((int) UNIXLIB_Ordinal_0 & 0xffff); psp->pspTerminateVector[0] = (unsigned short) UNIXLIB_Ordinal_0;
psp->pspControlCVector = 0x00230000 | ((int) UNIXLIB_Ordinal_0 & 0xffff); psp->pspTerminateVector[1] = 0x0023;
psp->pspCritErrorVector = 0x00230000 | ((int) UNIXLIB_Ordinal_0 & 0xffff); psp->pspControlCVector[0] = (unsigned short) UNIXLIB_Ordinal_0;
psp->pspControlCVector[1] = 0x0023;
psp->pspCritErrorVector[0] = (unsigned short) UNIXLIB_Ordinal_0;
psp->pspCritErrorVector[1] = 0x0023;
psp->pspEnvironment = SelectorTable[EnvironmentSelectorIdx].selector; psp->pspEnvironment = SelectorTable[EnvironmentSelectorIdx].selector;
psp->pspCommandTailCount = 1; psp->pspCommandTailCount = 1;
strcpy(psp->pspCommandTail, "\r"); strcpy(psp->pspCommandTail, "\r");
@ -161,6 +233,14 @@ CreateSelectors(int fd, struct ne_segment_table_entry_s *seg_table,
zfile = fopen("/dev/zero","r"); zfile = fopen("/dev/zero","r");
for (i = 0; i < ne_header->n_segment_tab; i++, s++) for (i = 0; i < ne_header->n_segment_tab; i++, s++)
{ {
#ifdef DEBUG_SEGMENT
printf(" %2d: OFFSET %04.4x, LENGTH %04.4x, ",
i + 1, seg_table[i].seg_data_offset,
seg_table[i].seg_data_length);
printf("FLAGS %04.4x, MIN ALLOC %04.4x\n",
seg_table[i].seg_flags, seg_table[i].min_alloc);
#endif
/* /*
* Store the flags in our table. * Store the flags in our table.
*/ */
@ -231,9 +311,10 @@ CreateSelectors(int fd, struct ne_segment_table_entry_s *seg_table,
/* /*
* Image in file. * Image in file.
*/ */
status = lseek(fd, seg_table[i].seg_data_offset * 512, SEEK_SET); status = lseek(fd, seg_table[i].seg_data_offset *
(1 << ne_header->align_shift_count), SEEK_SET);
if(read(fd, s->base_addr, old_length) != old_length) if(read(fd, s->base_addr, old_length) != old_length)
myerror("Unable to read segment from file"); myerror("Unable to read segment from file");
} }
/* /*
* Create entry in LDT for this segment. * Create entry in LDT for this segment.

5
shell.spec Normal file
View File

@ -0,0 +1,5 @@
# $Id: shell.spec,v 1.2 1993/06/30 14:24:33 root Exp root $
#
name shell
id 5
length 256

BIN
test.exe

Binary file not shown.

View File

@ -1,5 +1,7 @@
# $Id: unixlib.spec,v 1.2 1993/06/30 14:24:33 root Exp root $
#
name unixlib name unixlib
id 4 id 4
length 256 length 10
1 c _DebugPrintString(ptr) DebugPrintString(1) 1 c _DebugPrintString(ptr) DebugPrintString(1)

413
user-ordinals Normal file
View File

@ -0,0 +1,413 @@
1 1 ab5d MESSAGEBOX exported, shared data
2 3 0059 OLDEXITWINDOWS exported, shared data
3 5 0165 ENABLEOEMLAYER exported, shared data
4 5 01a2 DISABLEOEMLAYER exported, shared data
5 5 03a2 INITAPP exported, shared data
6 1 81d4 POSTQUITMESSAGE exported, shared data
7 5 0303 EXITWINDOWS exported, shared data
8 3 0232 WEP exported, shared data
10 1 a8e8 SETTIMER exported, shared data
11 1 744c BEAR11 exported, shared data
12 1 a905 KILLTIMER exported, shared data
13 1 729f GETTICKCOUNT exported, shared data
14 1 7439 GETTIMERRESOLUTION exported
15 1 729f GETCURRENTTIME exported, shared data
16 1 abc5 CLIPCURSOR exported, shared data
17 1 abab GETCURSORPOS exported, shared data
18 1 a8d4 SETCAPTURE exported, shared data
19 1 28bd RELEASECAPTURE exported, shared data
20 1 8161 SETDOUBLECLICKTIME exported, shared data
21 1 8171 GETDOUBLECLICKTIME exported, shared data
22 1 a875 SETFOCUS exported, shared data
23 1 8183 GETFOCUS exported, shared data
24 13 24e7 REMOVEPROP exported, shared data
25 1 1c95 GETPROP exported, shared data
26 13 24ca SETPROP exported, shared data
27 13 2504 ENUMPROPS exported, shared data
28 1 1874 CLIENTTOSCREEN exported, shared data
29 1 189e SCREENTOCLIENT exported, shared data
30 1 713c WINDOWFROMPOINT exported, shared data
31 1 192d ISICONIC exported, shared data
32 1 1825 GETWINDOWRECT exported, shared data
33 1 1828 GETCLIENTRECT exported, shared data
34 1 a919 ENABLEWINDOW exported, shared data
35 1 1912 ISWINDOWENABLED exported, shared data
36 1 ab25 GETWINDOWTEXT exported, shared data
37 1 ab05 SETWINDOWTEXT exported, shared data
38 1 ab49 GETWINDOWTEXTLENGTH exported, shared data
39 1 a971 BEGINPAINT exported, shared data
40 1 a991 ENDPAINT exported, shared data
41 8 0f1b CREATEWINDOW exported, shared data
42 14 103e SHOWWINDOW exported, shared data
43 14 1088 CLOSEWINDOW exported, shared data
44 14 1074 OPENICON exported, shared data
45 7 1836 BRINGWINDOWTOTOP exported, shared data
46 2 0dde GETPARENT exported, shared data
47 1 1802 ISWINDOW exported, shared data
48 1 1bd3 ISCHILD exported, shared data
49 1 1c28 ISWINDOWVISIBLE exported, shared data
50 6 1f72 FINDWINDOW exported, shared data
51 1 1a6c BEAR51 exported, shared data
52 14 03f0 ANYPOPUP exported, shared data
53 8 0faa DESTROYWINDOW exported, shared data
54 1 ad20 ENUMWINDOWS exported, shared data
55 1 ad03 ENUMCHILDWINDOWS exported, shared data
56 7 17a6 MOVEWINDOW exported, shared data
57 8 0e7c REGISTERCLASS exported, shared data
58 8 0eeb GETCLASSNAME exported, shared data
59 1 a949 SETACTIVEWINDOW exported, shared data
60 1 818d GETACTIVEWINDOW exported, shared data
61 13 23dd SCROLLWINDOW exported, shared data
62 18 1a00 SETSCROLLPOS exported, shared data
63 18 1a22 GETSCROLLPOS exported, shared data
64 18 1a44 SETSCROLLRANGE exported, shared data
65 18 1a66 GETSCROLLRANGE exported, shared data
66 1 a60b GETDC exported, shared data
67 1 a5f7 GETWINDOWDC exported, shared data
68 1 a61f RELEASEDC exported, shared data
69 1 ab97 SETCURSOR exported, shared data
70 1 822c SETCURSORPOS exported, shared data
71 1 150c SHOWCURSOR exported, shared data
72 1 1d3d SETRECT exported, shared data
73 1 1d64 SETRECTEMPTY exported, shared data
74 1 1d7d COPYRECT exported, shared data
75 1 1d9a ISRECTEMPTY exported, shared data
76 1 1dc0 PTINRECT exported, shared data
77 1 1df4 OFFSETRECT exported, shared data
78 1 1e19 INFLATERECT exported, shared data
79 1 1e3e INTERSECTRECT exported, shared data
80 1 1ea6 UNIONRECT exported, shared data
81 1 ac40 FILLRECT exported, shared data
82 1 acd0 INVERTRECT exported, shared data
83 1 ac88 FRAMERECT exported, shared data
84 13 239c DRAWICON exported, shared data
85 6 1e91 DRAWTEXT exported, shared data
86 13 0229 BEAR86 exported, shared data
87 25 263b DIALOGBOX exported, shared data
88 25 26e5 ENDDIALOG exported, shared data
89 24 09ce CREATEDIALOG exported, shared data
90 25 2804 ISDIALOGMESSAGE exported, shared data
91 25 26f9 GETDLGITEM exported, shared data
92 25 2741 SETDLGITEMTEXT exported, shared data
93 25 2761 GETDLGITEMTEXT exported, shared data
94 25 270d SETDLGITEMINT exported, shared data
95 25 2721 GETDLGITEMINT exported, shared data
96 25 2789 CHECKRADIOBUTTON exported, shared data
97 25 2775 CHECKDLGBUTTON exported, shared data
98 25 279d ISDLGBUTTONCHECKED exported, shared data
99 37 0fdf DLGDIRSELECT exported, shared data
100 37 0fb1 DLGDIRLIST exported, shared data
101 25 27b1 SENDDLGITEMMESSAGE exported, shared data
102 2 0cd2 ADJUSTWINDOWRECT exported, shared data
103 25 2853 MAPDIALOGRECT exported, shared data
104 1 1bab MESSAGEBEEP exported, shared data
105 6 1f5e FLASHWINDOW exported, shared data
106 1 4f46 GETKEYSTATE exported, shared data
107 1 a7fc DEFWINDOWPROC exported, shared data
108 1 a68f GETMESSAGE exported, shared data
109 1 a744 PEEKMESSAGE exported, shared data
110 1 a7b7 POSTMESSAGE exported, shared data
111 1 a786 SENDMESSAGE exported, shared data
112 1 3dc4 WAITMESSAGE exported, shared data
113 1 a6b2 TRANSLATEMESSAGE exported, shared data
114 1 a6fb DISPATCHMESSAGE exported, shared data
115 1 3c37 REPLYMESSAGE exported, shared data
116 1 a7e8 POSTAPPMESSAGE exported, shared data
118 1 8214 REGISTERWINDOWMESSAGE exported, shared data
119 1 81ae GETMESSAGEPOS exported, shared data
120 1 81a1 GETMESSAGETIME exported, shared data
121 1 ad68 SETWINDOWSHOOK exported, shared data
122 1 a827 CALLWINDOWPROC exported, shared data
123 1 a85b CALLMSGFILTER exported, shared data
124 1 a95d UPDATEWINDOW exported, shared data
125 1 aa27 INVALIDATERECT exported, shared data
126 1 aa67 INVALIDATERGN exported, shared data
127 1 aa47 VALIDATERECT exported, shared data
128 1 aa93 VALIDATERGN exported, shared data
129 2 0d8e GETCLASSWORD exported, shared data
130 2 0da2 SETCLASSWORD exported, shared data
131 2 0db6 GETCLASSLONG exported, shared data
132 2 0dca SETCLASSLONG exported, shared data
133 2 0d06 GETWINDOWWORD exported, shared data
134 2 0d1a SETWINDOWWORD exported, shared data
135 2 0d3a GETWINDOWLONG exported, shared data
136 2 0d4e SETWINDOWLONG exported, shared data
137 39 0710 OPENCLIPBOARD exported, shared data
138 39 0643 CLOSECLIPBOARD exported, shared data
139 39 0261 EMPTYCLIPBOARD exported, shared data
140 39 00ee GETCLIPBOARDOWNER exported, shared data
141 39 02f4 SETCLIPBOARDDATA exported, shared data
142 39 0425 GETCLIPBOARDDATA exported, shared data
143 39 0075 COUNTCLIPBOARDFORMATS exported, shared data
144 39 06bb ENUMCLIPBOARDFORMATS exported, shared data
145 1 8214 REGISTERCLIPBOARDFORMAT exported, shared data
146 39 0752 GETCLIPBOARDFORMATNAME exported, shared data
147 39 0724 SETCLIPBOARDVIEWER exported, shared data
148 39 00f9 GETCLIPBOARDVIEWER exported, shared data
149 39 0738 CHANGECLIPBOARDCHAIN exported, shared data
150 9 1076 LOADMENU exported, shared data
151 9 0806 CREATEMENU exported, shared data
152 9 118e DESTROYMENU exported, shared data
153 9 10db CHANGEMENU exported, shared data
154 9 11a2 CHECKMENUITEM exported, shared data
155 9 11c7 ENABLEMENUITEM exported, shared data
156 9 1160 GETSYSTEMMENU exported, shared data
157 9 10ad GETMENU exported, shared data
158 9 10c1 SETMENU exported, shared data
159 9 11ec GETSUBMENU exported, shared data
160 10 30c3 DRAWMENUBAR exported, shared data
161 9 10fd GETMENUSTRING exported, shared data
162 19 0b49 HILITEMENUITEM exported, shared data
163 13 2521 CREATECARET exported, shared data
164 13 0bfa DESTROYCARET exported, shared data
165 13 0db8 SETCARETPOS exported, shared data
166 13 254f HIDECARET exported, shared data
167 13 2563 SHOWCARET exported, shared data
168 3 24fd SETCARETBLINKTIME exported, shared data
169 13 0d8f GETCARETBLINKTIME exported, shared data
170 4 04c0 ARRANGEICONICWINDOWS exported, shared data
171 2 0e3c WINHELP exported, shared data
172 23 0ceb SWITCHTOTHISWINDOW exported, shared data
173 12 169b LOADCURSOR exported, shared data
174 12 1712 LOADICON exported, shared data
175 12 167e LOADBITMAP exported, shared data
176 12 17af LOADSTRING exported, shared data
177 12 1661 LOADACCELERATORS exported, shared data
178 19 0af4 TRANSLATEACCELERATOR exported, shared data
179 1 a92d GETSYSTEMMETRICS exported, shared data
180 1 8135 GETSYSCOLOR exported, shared data
181 41 186f SETSYSCOLORS exported, shared data
182 1 74f4 BEAR182 exported, shared data
183 13 0d9a GETCARETPOS exported, shared data
184 1 490e QUERYSENDMESSAGE exported, shared data
185 10 30d7 GRAYSTRING exported, shared data
186 1 1cee SWAPMOUSEBUTTON exported
187 9 00fe ENDMENU exported, shared data
188 1 a772 SETSYSMODALWINDOW exported, shared data
189 1 19d4 GETSYSMODALWINDOW exported, shared data
190 1 a9b1 GETUPDATERECT exported, shared data
191 1 abf9 CHILDWINDOWFROMPOINT exported, shared data
192 1 3dba INSENDMESSAGE exported, shared data
193 39 0030 ISCLIPBOARDFORMATAVAILABLE exported, shared data
194 37 104d DLGDIRSELECTCOMBOBOX exported, shared data
195 37 101f DLGDIRLISTCOMBOBOX exported, shared data
196 6 1f1d TABBEDTEXTOUT exported, shared data
197 6 1edc GETTABBEDTEXTEXTENT exported, shared data
198 15 0875 CASCADECHILDWINDOWS exported, shared data
199 15 0956 TILECHILDWINDOWS exported, shared data
200 40 09d9 OPENCOMM exported, shared data
201 40 09f6 SETCOMMSTATE exported, shared data
202 40 0a13 GETCOMMSTATE exported, shared data
203 40 0acd GETCOMMERROR exported, shared data
204 40 0a3d READCOMM exported, shared data
205 40 0a85 WRITECOMM exported, shared data
206 40 0b1d TRANSMITCOMMCHAR exported, shared data
207 40 0aaf CLOSECOMM exported, shared data
208 40 0b3b SETCOMMEVENTMASK exported, shared data
209 40 0b64 GETCOMMEVENTMASK exported, shared data
210 40 0b8d SETCOMMBREAK exported, shared data
211 40 0bab CLEARCOMMBREAK exported, shared data
212 40 0a67 UNGETCOMMCHAR exported, shared data
213 40 0af4 BUILDCOMMDCB exported, shared data
214 40 0be7 ESCAPECOMMFUNCTION exported, shared data
215 40 0bc9 FLUSHCOMM exported, shared data
216 41 181e USERSEEUSERDO exported, shared data
217 9 0163 LOOKUPMENUHANDLE exported, shared data
218 25 2667 DIALOGBOXINDIRECT exported, shared data
219 24 09fa CREATEDIALOGINDIRECT exported, shared data
220 9 1093 LOADMENUINDIRECT exported, shared data
221 13 2409 SCROLLDC exported, shared data
222 1 a889 GETKEYBOARDSTATE exported, shared data
223 1 a8a3 SETKEYBOARDSTATE exported, shared data
224 1 ad54 GETWINDOWTASK exported, shared data
225 1 ad37 ENUMTASKWINDOWS exported, shared data
226 1 4983 LOCKINPUT exported, shared data
227 19 0ac0 GETNEXTDLGGROUPITEM exported, shared data
228 19 0ada GETNEXTDLGTABITEM exported, shared data
229 2 0df2 GETTOPWINDOW exported, shared data
230 2 08f2 GETNEXTWINDOW exported, shared data
231 1 4afb GETSYSTEMDEBUGSTATE exported, shared data
232 7 17ba SETWINDOWPOS exported, shared data
233 14 109c SETPARENT exported, shared data
234 1 ad9a UNHOOKWINDOWSHOOK exported, shared data
235 1 adc4 DEFHOOKPROC exported, shared data
236 1 8197 GETCAPTURE exported, shared data
237 1 a9d1 GETUPDATERGN exported, shared data
238 1 a9fa EXCLUDEUPDATERGN exported, shared data
239 25 2690 DIALOGBOXPARAM exported, shared data
240 25 26bc DIALOGBOXINDIRECTPARAM exported, shared data
241 24 0a29 CREATEDIALOGPARAM exported, shared data
242 24 0a55 CREATEDIALOGINDIRECTPARAM exported, shared data
243 25 0aa3 GETDIALOGBASEUNITS exported, shared data
244 1 2094 EQUALRECT exported, shared data
245 40 0c06 ENABLECOMMNOTIFICATION exported, shared data
246 5 05de EXITWINDOWSEXEC exported, shared data
247 1 14ca GETCURSOR exported, shared data
248 39 0600 GETOPENCLIPBOARDWINDOW exported, shared data
249 1 4f59 GETASYNCKEYSTATE exported, shared data
250 9 113b GETMENUSTATE exported, shared data
251 2 0e5c SENDDRIVERMESSAGE exported, shared data
252 41 18cb OPENDRIVER exported, shared data
253 41 18f1 CLOSEDRIVER exported, shared data
254 41 1905 GETDRIVERMODULEHANDLE exported, shared data
255 2 0e70 DEFDRIVERPROC exported, shared data
256 2 0eaf GETDRIVERINFO exported, shared data
257 2 0e84 GETNEXTDRIVER exported, shared data
258 1 18c8 MAPWINDOWPOINTS exported, shared data
259 7 00b5 BEGINDEFERWINDOWPOS exported, shared data
260 7 17eb DEFERWINDOWPOS exported, shared data
261 7 1822 ENDDEFERWINDOWPOS exported, shared data
262 2 0e1a GETWINDOW exported, shared data
263 9 1217 GETMENUITEMCOUNT exported, shared data
264 9 1200 GETMENUITEMID exported, shared data
265 14 1060 SHOWOWNEDPOPUPS exported, shared data
266 1 56b0 SETMESSAGEQUEUE exported, shared data
267 18 1aa0 SHOWSCROLLBAR exported, shared data
268 1 21cd GLOBALADDATOM exported, shared data
269 1 2236 GLOBALDELETEATOM exported, shared data
270 1 2251 GLOBALFINDATOM exported, shared data
271 1 226f GLOBALGETATOMNAME exported, shared data
272 1 1930 ISZOOMED exported, shared data
273 41 1716 CONTROLPANELINFO exported, shared data
274 23 0d8e GETNEXTQUEUEWINDOW exported, shared data
275 1 77a7 REPAINTSCREEN exported, shared data
276 1 6eea LOCKMYTASK exported, shared data
277 25 27c5 GETDLGCTRLID exported, shared data
278 1 19ca GETDESKTOPHWND exported, shared data
279 41 0a51 OLDSETDESKPATTERN exported, shared data
280 9 1174 SETSYSTEMMENU exported, shared data
282 6 1f95 SELECTPALETTE exported, shared data
283 6 1fd1 REALIZEPALETTE exported, shared data
284 41 1740 GETFREESYSTEMRESOURCES exported, shared data
285 41 1736 BEAR285 exported, shared data
286 1 19ca GETDESKTOPWINDOW exported, shared data
287 2 0e06 GETLASTACTIVEPOPUP exported, shared data
288 1 81bb GETMESSAGEEXTRAINFO exported, shared data
289 1 4b59 KEYBD_EVENT exported, shared data
290 1 aabf REDRAWWINDOW exported, shared data
291 1 adde SETWINDOWSHOOKEX exported, shared data
292 1 ae14 UNHOOKWINDOWSHOOKEX exported, shared data
293 1 ae35 CALLNEXTHOOKEX exported, shared data
294 13 23c9 LOCKWINDOWUPDATE exported, shared data
299 1 507a MOUSE_EVENT exported, shared data
301 26 0000 BOZOSLIVEHERE exported, shared data
306 10 1587 BEAR306 exported, shared data
308 25 27d9 DEFDLGPROC exported, shared data
309 1 abdf GETCLIPCURSOR exported, shared data
314 1 09bc SIGNALPROC exported, shared data
319 13 246c SCROLLWINDOWEX exported, shared data
320 1 9325 SYSERRORBOX exported, shared data
321 1 a8bd SETEVENTHOOK exported, shared data
322 41 0e6e WINOLDAPPHACKOMATIC exported, shared data
323 1 244f GETMESSAGE2 exported, shared data
324 1 7766 FILLWINDOW exported, shared data
325 1 76eb PAINTRECT exported, shared data
326 6 02d2 GETCONTROLBRUSH exported, shared data
331 1 4f36 ENABLEHARDWAREINPUT exported
332 1 3df2 USERYIELD exported, shared data
333 1 334e ISUSERIDLE exported, shared data
334 1 4fed GETQUEUESTATUS exported, shared data
335 1 501c GETINPUTSTATE exported, shared data
336 12 0deb LOADCURSORICONHANDLER exported, shared data
337 1 530a GETMOUSEEVENTPROC exported, shared data
341 1 1798 _FFFE_FARFRAME exported, shared data
343 1 9c7c GETFILEPORTNAME exported, shared data
356 12 0ff1 LOADDIBCURSORHANDLER exported, shared data
357 12 100d LOADDIBICONHANDLER exported, shared data
358 9 0fa0 ISMENU exported, shared data
359 1 a64c GETDCEX exported, shared data
362 1 8a00 DCHOOK exported, shared data
368 12 176f COPYICON exported, shared data
369 12 16f8 COPYCURSOR exported, shared data
370 14 0fde GETWINDOWPLACEMENT exported, shared data
371 14 100e SETWINDOWPLACEMENT exported, shared data
372 12 1789 GETINTERNALICONHEADER exported, shared data
373 1 20b8 SUBTRACTRECT exported, shared data
400 3 2570 FINALUSERINIT exported, shared data
402 39 077c GETPRIORITYCLIPBOARDFORMAT exported, shared data
403 8 0ea5 UNREGISTERCLASS exported, shared data
404 8 0ec2 GETCLASSINFO exported, shared data
406 12 16b8 CREATECURSOR exported, shared data
407 12 172f CREATEICON exported, shared data
408 12 0000 CREATECURSORICONINDIRECT exported, shared data
410 9 122e INSERTMENU exported, shared data
411 9 1250 APPENDMENU exported, shared data
412 9 1294 REMOVEMENU exported, shared data
413 9 12b6 DELETEMENU exported, shared data
414 9 1272 MODIFYMENU exported, shared data
415 9 0813 CREATEPOPUPMENU exported, shared data
416 9 132a TRACKPOPUPMENU exported, shared data
417 9 07ab GETMENUCHECKMARKDIMENSIONS exported, shared data
418 9 12d8 SETMENUITEMBITMAPS exported, shared data
420 16 055a _WSPRINTF exported, shared data
421 16 0518 WVSPRINTF exported, shared data
422 37 0fff DLGDIRSELECTEX exported, shared data
423 37 106d DLGDIRSELECTCOMBOBOXEX exported, shared data
430 11 0359 LSTRCMP exported, shared data
431 11 0365 ANSIUPPER exported, shared data
432 11 0381 ANSILOWER exported, shared data
433 11 0203 ISCHARALPHA exported, shared data
434 11 0208 ISCHARALPHANUMERIC exported, shared data
435 11 020d ISCHARUPPER exported, shared data
436 11 0212 ISCHARLOWER exported, shared data
437 11 039d ANSIUPPERBUFF exported, shared data
438 11 03b7 ANSILOWERBUFF exported, shared data
445 15 1a6e DEFFRAMEPROC exported, shared data
447 15 1a82 DEFMDICHILDPROC exported, shared data
451 15 1aad TRANSLATEMDISYSACCEL exported, shared data
452 8 0f57 CREATEWINDOWEX exported, shared data
454 2 0cec ADJUSTWINDOWRECTEX exported, shared data
455 12 052b GETICONID exported, shared data
456 12 0328 LOADICONHANDLER exported, shared data
457 12 175b DESTROYICON exported, shared data
458 12 16e4 DESTROYCURSOR exported, shared data
459 12 01bb DUMPICON exported, shared data
460 14 0a85 GETINTERNALWINDOWPOS exported, shared data
461 14 0aef SETINTERNALWINDOWPOS exported, shared data
462 15 0276 CALCCHILDSCROLL exported, shared data
463 15 053f SCROLLCHILDREN exported, shared data
464 14 0fbe DRAGOBJECT exported, shared data
465 14 035e DRAGDETECT exported, shared data
466 1 ac0d DRAWFOCUSRECT exported, shared data
470 11 02e7 STRINGFUNC exported, shared data
471 11 035f LSTRCMPI exported, shared data
472 11 03d1 ANSINEXT exported, shared data
473 11 03eb ANSIPREV exported, shared data
480 1 1d38 GETUSERLOCALOBJTYPE exported, shared data
481 1 4d6c HARDWARE_EVENT exported, shared data
482 18 1ac2 ENABLESCROLLBAR exported, shared data
483 41 1895 SYSTEMPARAMETERSINFO exported, shared data
484 1 b664 __GP exported, shared data
499 22 005c WNETERRORTEXT exported, shared data
501 22 0a68 WNETOPENJOB exported, shared data
502 22 0a9d WNETCLOSEJOB exported, shared data
503 22 0b40 WNETABORTJOB exported, shared data
504 22 0acc WNETHOLDJOB exported, shared data
505 22 0ae9 WNETRELEASEJOB exported, shared data
506 22 0b06 WNETCANCELJOB exported, shared data
507 22 0b23 WNETSETJOBCOPIES exported, shared data
508 22 09ca WNETWATCHQUEUE exported, shared data
509 22 09f9 WNETUNWATCHQUEUE exported, shared data
510 22 0a16 WNETLOCKQUEUEDATA exported, shared data
511 22 0a4b WNETUNLOCKQUEUEDATA exported, shared data
512 22 0992 WNETGETCONNECTION exported, shared data
513 22 08a6 WNETGETCAPS exported, shared data
514 22 08c7 WNETDEVICEMODE exported, shared data
515 22 08de WNETBROWSEDIALOG exported, shared data
516 22 0914 WNETGETUSER exported, shared data
517 22 0940 WNETADDCONNECTION exported, shared data
518 22 0975 WNETCANCELCONNECTION exported, shared data
519 22 0b63 WNETGETERROR exported, shared data
520 22 0b80 WNETGETERRORTEXT exported, shared data
521 22 0847 WNETENABLE exported, shared data
522 22 084e WNETDISABLE exported, shared data
523 22 0478 WNETRESTORECONNECTION exported, shared data
524 22 0855 WNETWRITEJOB exported, shared data
525 22 085e WNETCONNECTDIALOG exported, shared data
526 22 0867 WNETDISCONNECTDIALOG exported, shared data
527 22 0870 WNETCONNECTIONDIALOG exported, shared data
528 22 0879 WNETVIEWQUEUEDIALOG exported, shared data
529 22 088b WNETPROPERTYDIALOG exported, shared data
530 22 0894 WNETGETDIRECTORYTYPE exported, shared data
531 22 089d WNETDIRECTORYNOTIFY exported, shared data
532 22 0882 WNETGETPROPERTYTEXT exported, shared data

2
user.c
View File

@ -1,4 +1,4 @@
static char RCSId[] = "$Id$"; static char RCSId[] = "$Id: user.c,v 1.1 1993/06/29 15:55:18 root Exp $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h> #include <stdio.h>

View File

@ -1,5 +1,9 @@
# $Id: user.spec,v 1.2 1993/06/30 14:24:33 root Exp root $
#
name user name user
id 2 id 2
length 256 length 540
5 pascal InitApp(word) USER_InitApp(1) 5 pascal InitApp(word) USER_InitApp(1)
175 pascal LoadBitmap(word ptr) RSC_LoadBitmap(1 2)
176 pascal LoadString(word word ptr s_word) RSC_LoadString(1 2 3 4)

5
win87em.spec Normal file
View File

@ -0,0 +1,5 @@
# $Id: win87em.spec,v 1.2 1993/06/30 14:24:33 root Exp root $
#
name win87em
id 5
length 10

27
windows.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef WINDOWS_H
#define WINDOWS_H
typedef struct tagRGBQUAD
{
unsigned char rgbBlue;
unsigned char rgbGreen;
unsigned char rgbRed;
unsigned char rgbReserved;
};
typedef struct tagBITMAPINFOHEADER
{
unsigned long biSize;
unsigned long biWidth;
unsigned long biHeight;
unsigned short biPlanes;
unsigned short biBitCount;
unsigned long biCompression;
unsigned long biSizeImage;
unsigned long biXPelsPerMeter;
unsigned long biYPelsPerMeter;
unsigned long biClrUsed;
unsigned long biClrImportant;
} BITMAPINFOHEADER;
#endif

BIN
wine

Binary file not shown.

102
wine.c
View File

@ -1,8 +1,5 @@
/* $Id: exedump.c,v 1.1 1993/06/09 03:28:10 root Exp root $ static char RCSId[] = "$Id: wine.c,v 1.1 1993/06/29 15:55:18 root Exp $";
*/ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/*
* Copyright Robert J. Amstadt, 1993
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -20,13 +17,18 @@
#include "prototypes.h" #include "prototypes.h"
#include "dlls.h" #include "dlls.h"
extern int CallTo16(unsigned long csip, unsigned long sssp, unsigned short ds); extern int CallToInit16(unsigned long csip, unsigned long sssp,
unsigned short ds);
extern void CallTo32(); extern void CallTo32();
unsigned short WIN_StackSize; unsigned short WIN_StackSize;
unsigned short WIN_HeapSize;
char **Argv; char **Argv;
int Argc; int Argc;
struct mz_header_s *CurrentMZHeader;
struct ne_header_s *CurrentNEHeader;
int CurrentNEFile;
/********************************************************************** /**********************************************************************
* DebugPrintString * DebugPrintString
@ -34,7 +36,7 @@ int Argc;
int int
DebugPrintString(char *str) DebugPrintString(char *str)
{ {
fprintf(stderr, "%s", str); printf("%s", str);
return 0; return 0;
} }
@ -119,8 +121,12 @@ main(int argc, char **argv)
if (ne_header->header_type[0] != 'N' || ne_header->header_type[1] != 'E') if (ne_header->header_type[0] != 'N' || ne_header->header_type[1] != 'E')
myerror("This is not a Windows program"); myerror("This is not a Windows program");
CurrentMZHeader = mz_header;
CurrentNEHeader = ne_header;
CurrentNEFile = fd;
WIN_StackSize = ne_header->stack_length; WIN_StackSize = ne_header->stack_length;
WIN_HeapSize = ne_header->local_heap_length;
/* /*
* Create segment selectors. * Create segment selectors.
@ -146,7 +152,6 @@ main(int argc, char **argv)
} }
} }
close(fd);
/* /*
* Fixup stack and jump to start. * Fixup stack and jump to start.
*/ */
@ -156,7 +161,7 @@ main(int argc, char **argv)
ss_reg = selector_table[ne_header->ss-1].selector; ss_reg = selector_table[ne_header->ss-1].selector;
sp_reg = ne_header->sp; sp_reg = ne_header->sp;
rv = CallTo16(cs_reg << 16 | ip_reg, ss_reg << 16 | sp_reg, ds_reg); rv = CallToInit16(cs_reg << 16 | ip_reg, ss_reg << 16 | sp_reg, ds_reg);
printf ("rv = %x\n", rv); printf ("rv = %x\n", rv);
} }
@ -244,7 +249,8 @@ FixupSegment(int fd, struct mz_header_s * mz_header,
if (i == 0) if (i == 0)
i = 0x10000; i = 0x10000;
status = lseek(fd, seg->seg_data_offset * 512 + i, SEEK_SET); status = lseek(fd, seg->seg_data_offset *
(1 << ne_header->align_shift_count) + i, SEEK_SET);
n_entries = 0; n_entries = 0;
read(fd, &n_entries, sizeof(short int)); read(fd, &n_entries, sizeof(short int));
rep = (struct relocation_entry_s *) rep = (struct relocation_entry_s *)
@ -273,6 +279,15 @@ FixupSegment(int fd, struct mz_header_s * mz_header,
} }
dll_table = FindDLLTable(dll_name); dll_table = FindDLLTable(dll_name);
if (dll_table == NULL)
{
char s[80];
sprintf(s, "Bad DLL name '%s'", dll_name);
myerror(s);
return -1;
}
ordinal = rep->target2; ordinal = rep->target2;
selector = dll_table[ordinal].selector; selector = dll_table[ordinal].selector;
address = (unsigned int) dll_table[ordinal].address; address = (unsigned int) dll_table[ordinal].address;
@ -289,6 +304,14 @@ FixupSegment(int fd, struct mz_header_s * mz_header,
return -1; return -1;
} }
dll_table = FindDLLTable(dll_name); dll_table = FindDLLTable(dll_name);
if (dll_table == NULL)
{
char s[80];
sprintf(s, "Bad DLL name '%s'", dll_name);
myerror(s);
return -1;
}
if (GetImportedName(fd, mz_header, ne_header, if (GetImportedName(fd, mz_header, ne_header,
rep->target2, func_name) == NULL) rep->target2, func_name) == NULL)
@ -305,7 +328,48 @@ FixupSegment(int fd, struct mz_header_s * mz_header,
break; break;
case NE_RELTYPE_INTERNAL: case NE_RELTYPE_INTERNAL:
if (rep->target1 == 0x00ff)
{
address = GetEntryPointFromOrdinal(fd, mz_header, ne_header,
rep->target2);
selector = (address >> 16) & 0xffff;
address &= 0xffff;
}
else
{
selector = selector_table[rep->target1-1].selector;
address = rep->target2;
}
#ifdef DEBUG_FIXUP
printf("%d: %04.4x:%04.4x\n", i + 1, selector, address);
#endif
break;
case 7:
/* Relocation type 7:
*
* These appear to be used as fixups for the Windows
* floating point emulator. Let's just ignore them and
* try to use the hardware floating point. Linux should
* successfully emulate the coprocessor if it doesn't
* exist.
*/
#ifdef DEBUG_FIXUP
printf("%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
printf("TARGET %04.4x %04.4x\n", rep->target1, rep->target2);
#endif
continue;
default: default:
#ifdef DEBUG_FIXUP
printf("%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
printf("TARGET %04.4x %04.4x\n", rep->target1, rep->target2);
#endif
free(rep1); free(rep1);
return -1; return -1;
} }
@ -337,7 +401,23 @@ FixupSegment(int fd, struct mz_header_s * mz_header,
break; break;
case NE_RADDR_SELECTOR:
do {
next_addr = *sp;
*sp = (unsigned short) selector;
sp = (unsigned short *) ((char *) sel->base_addr + next_addr);
}
while (next_addr != 0xffff);
break;
default: default:
#ifdef DEBUG_FIXUP
printf("%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
printf("TARGET %04.4x %04.4x\n", rep->target1, rep->target2);
#endif
free(rep1); free(rep1);
return -1; return -1;
} }

View File

@ -1,101 +0,0 @@
/* MAIN.C
*
* PURPOSE:
*
* FUNCTIONS:
* WinMain() - Initializes app, calls all other functions.
*/
#include <windows.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Globals
*/
char szAppName[] = "WineTest";
extern long FAR PASCAL WineTestWndProc(HWND hwnd, unsigned message,
WORD wParam, LONG lParam);
/* extern void FAR __cdecl DebugPrintString(const char FAR *str); */
/* WinMain
*/
int PASCAL
WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int cmdShow)
{
DebugPrintString("Hello\n");
return 0;
#if 0
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
if (hPrevInstance)
{
MessageBox(NULL, "This application is already running.", szAppName,
MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL);
return NULL;
}
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WineTestWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = "MainMenu";
wndclass.lpszClassName = szAppName;
RegisterClass(&wndclass);
hwnd = CreateWindow(szAppName, "Wine Tester",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hwnd, cmdShow);
UpdateWindow(hwnd);
while (GetMessage(&msg, NULL, NULL, NULL))
{
TranslateMessage((LPMSG) &msg);
DispatchMessage((LPMSG) &msg);
}
return msg.wParam;
#endif /* 0 */
}
/* WineTestWndProc
*/
long FAR PASCAL
WineTestWndProc(HWND hwnd, unsigned message, WORD wParam, LONG lParam)
{
static HANDLE hInstance;
FARPROC DlgProcInst;
LONG parm;
switch (message)
{
case WM_CREATE:
hInstance = ((LPCREATESTRUCT) lParam)->hInstance;
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}

View File

@ -1,47 +0,0 @@
####################################################################
#
# PPI standard windows makefile
#
####################################################################
####################################################################
#
# Compiler options
#
AFLAGS=/ML /LA
CFLAGS=-AM -Ozaxb2 -Gr -G2 -Zpei -W3 -DWINVER=0x0301
LFLAGS=/CO
####################################################################
#
# Object files and target
#
OBJS=main.obj
DIALOGS=
TARGET=winetest
####################################################################
#
# Standard rules
#
ROOTS=$(OBJS:.obj=)
all: $(TARGET).exe
version:
coall -r$(RELEASE)
$(MAKE) all
$(TARGET).res: $(TARGET).rc $(TARGET).h $(DIALOGS)
rc -r $(TARGET).rc
$(TARGET).exe: $(TARGET).res $(TARGET).def $(TARGET).h $(OBJS)
link @<<
$(ROOTS) /NOD $(LFLAGS)
$@
$(TARGET) /MAP:FULL
libw slibcewn oldnames
$(TARGET).def
<<
rc -30 $(TARGET).res

View File

@ -1,11 +0,0 @@
NAME WINETEST
DESCRIPTION 'Wine Tester'
EXETYPE WINDOWS
STUB 'WINSTUB.EXE'
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE SINGLE
HEAPSIZE 8192
STACKSIZE 8192
EXPORTS WineTestWndProc
IMPORTS UNIXLIB._DebugPrintString

View File

@ -1,2 +0,0 @@
/* $Id$
*/

View File

@ -1,11 +0,0 @@
#include <windows.h>
MainMenu MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", 100
MENUITEM SEPARATOR
MENUITEM "&About...", 101
END
END