1 static char RCSId
[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
2 static char Copyright
[] = "Copyright Robert J. Amstadt, 1993";
14 #include "prototypes.h"
23 /* #define DEBUG_DLL */
24 /* #undef DEBUG_DLL */
28 char *GetDosFileName(char *unixfilename
);
29 extern char WindowsPath
[256];
34 unsigned short WIN_StackSize
;
35 unsigned short WIN_HeapSize
;
37 /**********************************************************************
41 myerror(const char *s
)
46 fprintf(stderr
, "wine: %s\n", s
);
52 /**********************************************************************
55 int _WinMain(int argc
, char **argv
)
57 char *p
, filename
[256];
68 if (strchr(Argv
[0], '\\') || strchr(Argv
[0],'/')) {
69 for (p
= Argv
[0] + strlen(Argv
[0]); *p
!= '\\' && *p
!='/'; p
--)
72 strncpy(filename
, Argv
[0], p
- Argv
[0]);
73 filename
[p
- Argv
[0]] = '\0';
74 strcat(WindowsPath
, ";");
75 if (strchr(filename
, '/'))
76 strcat(WindowsPath
, GetDosFileName(filename
));
78 strcat(WindowsPath
, filename
);
81 if ((hInstMain
= LoadImage(Argv
[0], EXE
, 1)) < 32) {
82 fprintf(stderr
, "wine: can't load %s!.\n", Argv
[0]);
85 hTaskMain
= CreateNewTask(hInstMain
, 0);
86 dprintf_dll(stddeb
,"_WinMain // hTaskMain=%04X hInstMain=%04X !\n",
87 hTaskMain
, hInstMain
);
89 GetPrivateProfileString("wine", "SystemResources", "sysres.dll",
90 filename
, sizeof(filename
), WINE_INI
);
92 hSysRes
= LoadImage(filename
, DLL
, 0);
94 fprintf(stderr
, "wine: can't load %s!.\n", filename
);
97 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 StartNEprogram(wpnt
);
122 StartPEprogram(wpnt
);
125 #endif /* #ifndef WINELIB */