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";
22 #include "prototypes.h"
32 HINSTANCE hSysRes
, hInstMain
;
33 unsigned short WIN_StackSize
;
34 unsigned short WIN_HeapSize
;
36 /**********************************************************************
40 myerror(const char *s
)
45 fprintf(stderr
, "wine: %s\n", s
);
51 /**********************************************************************
54 int _WinMain(int argc
, char **argv
)
56 char *p
, filename
[256];
67 if (strchr(Argv
[0], '\\') || strchr(Argv
[0],'/')) {
68 for (p
= Argv
[0] + strlen(Argv
[0]); *p
!= '\\' && *p
!='/'; p
--)
71 strncpy(filename
, Argv
[0], p
- Argv
[0]);
72 filename
[p
- Argv
[0]] = '\0';
73 strcat(WindowsPath
, ";");
74 if (strchr(filename
, '/'))
75 strcat(WindowsPath
, DOS_GetDosFileName(filename
));
77 strcat(WindowsPath
, filename
);
80 if ((hInstMain
= LoadImage(Argv
[0], EXE
, 1)) < 32) {
81 fprintf(stderr
, "wine: can't load %s!.\n", Argv
[0]);
84 hTaskMain
= CreateNewTask(hInstMain
, 0);
85 dprintf_dll(stddeb
,"_WinMain // hTaskMain=%04X hInstMain=%04X !\n",
86 hTaskMain
, hInstMain
);
88 GetPrivateProfileString("wine", "SystemResources", "sysres.dll",
89 filename
, sizeof(filename
), WINE_INI
);
91 hSysRes
= LoadImage(filename
, DLL
, 0);
93 fprintf(stderr
, "wine: can't load %s!.\n", filename
);
96 dprintf_dll(stddeb
,"System Resources Loaded // hSysRes='%04X'\n",
101 cp
= strrchr(argv
[0], '/');
102 if(!cp
) cp
= argv
[0];
104 if(strcmp(cp
,"winestat") == 0) {
111 * Initialize signal handling.
115 wpnt
= GetFileInfo(hInstMain
);
120 return(NE_StartProgram(wpnt
));
122 return(PE_StartProgram(wpnt
));
125 #endif /* #ifndef WINELIB */