2 static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
3 static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
21 #include "prototypes.h"
31 HINSTANCE hSysRes
, hInstMain
;
32 unsigned short WIN_StackSize
;
33 unsigned short WIN_HeapSize
;
35 /**********************************************************************
39 myerror(const char *s
)
44 fprintf(stderr
, "wine: %s\n", s
);
50 /**********************************************************************
53 int _WinMain(int argc
, char **argv
)
55 char *p
, filename
[256];
66 if (strchr(Argv
[0], '\\') || strchr(Argv
[0],'/')) {
67 for (p
= Argv
[0] + strlen(Argv
[0]); *p
!= '\\' && *p
!='/'; p
--)
70 strncpy(filename
, Argv
[0], p
- Argv
[0]);
71 filename
[p
- Argv
[0]] = '\0';
72 strcat(WindowsPath
, ";");
73 if (strchr(filename
, '/'))
74 strcat(WindowsPath
, DOS_GetDosFileName(filename
));
76 strcat(WindowsPath
, filename
);
79 if ((hInstMain
= LoadImage(Argv
[0], EXE
, 1)) < 32) {
80 fprintf(stderr
, "wine: can't load %s!.\n", Argv
[0]);
83 hTaskMain
= CreateNewTask(hInstMain
, 0);
84 dprintf_dll(stddeb
,"_WinMain // hTaskMain=%04X hInstMain=%04X !\n",
85 hTaskMain
, hInstMain
);
87 GetPrivateProfileString("wine", "SystemResources", "sysres.dll",
88 filename
, sizeof(filename
), WINE_INI
);
90 hSysRes
= LoadImage(filename
, DLL
, 0);
92 fprintf(stderr
, "wine: can't load %s!.\n", filename
);
95 dprintf_dll(stddeb
,"System Resources Loaded // hSysRes='%04X'\n",
100 cp
= strrchr(argv
[0], '/');
101 if(!cp
) cp
= argv
[0];
103 if(strcmp(cp
,"winestat") == 0) {
110 * Initialize signal handling.
114 wpnt
= GetFileInfo(hInstMain
);
119 return(NE_StartProgram(wpnt
));
121 return(PE_StartProgram(wpnt
));
124 #endif /* #ifndef WINELIB */