Skip to content

Commit d56fe93

Browse files
committed
something
1 parent 1edd090 commit d56fe93

25 files changed

+1621
-48
lines changed

krnl386/dosexe.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ static void MZ_CreatePSP( LPVOID lpPSP, WORD env, WORD par )
133133
/* FIXME: more PSP stuff */
134134
}
135135

136+
extern char *DOSMEM_dosmem;
136137
static void MZ_FillPSP( LPVOID lpPSP, LPCSTR cmdtail, int length )
137138
{
138-
PDB16 *psp = lpPSP;
139+
PDB16 *psp = (PDB16*)((size_t)lpPSP + DOSMEM_dosmem);
139140

140141
if(length > 127)
141142
{
@@ -199,9 +200,10 @@ static BOOL MZ_InitMemory(void)
199200
{
200201
/* initialize the memory */
201202
TRACE("Initializing DOS memory structures\n");
202-
DOSMEM_MapDosLayout();
203-
DOSDEV_InstallDOSDevices();
204-
MSCDEX_InstallCDROM();
203+
ERR("MZ_InitMemory()\n");
204+
//DOSMEM_MapDosLayout();
205+
//DOSDEV_InstallDOSDevices();
206+
//MSCDEX_InstallCDROM();
205207

206208
return TRUE;
207209
}

krnl386/dosmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static MCB* DOSMEM_root_block;
113113
*/
114114

115115
/* DOS memory base (linear in process address space) */
116-
static char *DOSMEM_dosmem;
116+
/*static*/ char *DOSMEM_dosmem;
117117
static char *DOSMEM_sysmem;
118118
/* number of bytes protected from _dosmem. 0 when DOS memory is initialized,
119119
* 64k otherwise to trap NULL pointers deref */

krnl386/dosvm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ void DOSVM_QueueEvent( INT irq, INT priority, DOSRELAY relay, LPVOID data)
310310
TRACE("new event queued, signalling (time=%d)\n", GetTickCount());
311311

312312
/* Alert VM86 thread about the new event. */
313-
kill(dosvm_pid,SIGUSR2);
313+
ERR("kill(%d, %d)\n", dosvm_pid, 12);
314+
//kill(dosvm_pid,SIGUSR2);
314315

315316
/* Wake up DOSVM_Wait so that it can serve pending events. */
316317
SetEvent(event_notifier);
@@ -496,7 +497,8 @@ DWORD DOSVM_Loop( HANDLE hThread )
496497
DWORD waitret;
497498

498499
objs[count++] = hThread;
499-
if (GetConsoleMode( GetStdHandle(STD_INPUT_HANDLE), NULL ))
500+
DWORD ununsed;
501+
if (GetConsoleMode( GetStdHandle(STD_INPUT_HANDLE), &ununsed))
500502
objs[count++] = GetStdHandle(STD_INPUT_HANDLE);
501503

502504
for(;;) {

krnl386/file.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,19 +257,24 @@ static char *get_search_path(void)
257257
if (!(p = strrchr( module, '\\' ))) p = module;
258258
*p = 0;
259259
}
260+
char windir[MAX_PATH];
261+
char windir2[MAX_PATH];
262+
char *windir3;
263+
GetWindowsDirectoryA(windir, MAX_PATH);
264+
windir3 = RedirectSystemDir(windir, windir2, MAX_PATH);
260265

261266
len = (2 + /* search order: first current dir */
262267
GetSystemDirectory16( NULL, 0 ) + 1 + /* then system dir */
263-
GetWindowsDirectoryA( NULL, 0 ) + 1 + /* then windows dir */
268+
strlen(windir3) + 1 + /* then windows dir */
264269
strlen( module ) + 1 + /* then module path */
265-
GetEnvironmentVariableA( "PATH", NULL, 0 ) + 1); /* then look in PATH */
270+
GetEnvironmentVariableA( "PATH16", NULL, 0 ) + 1); /* then look in PATH */
266271
if (!(ret = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
267272
strcpy( ret, ".;" );
268273
p = ret + 2;
269274
GetSystemDirectory16( p, ret + len - p );
270275
p += strlen( p );
271276
*p++ = ';';
272-
GetWindowsDirectoryA( p, ret + len - p );
277+
strcpy(p, windir3);//GetWindowsDirectoryA( p, ret + len - p );
273278
p += strlen( p );
274279
*p++ = ';';
275280
if (module[0])
@@ -278,7 +283,7 @@ static char *get_search_path(void)
278283
p += strlen( p );
279284
*p++ = ';';
280285
}
281-
GetEnvironmentVariableA( "PATH", p, ret + len - p );
286+
GetEnvironmentVariableA( "PATH16", p, ret + len - p );
282287
return ret;
283288
}
284289

@@ -324,6 +329,8 @@ HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode )
324329
return 0;
325330
}
326331

332+
CHAR buf[OFS_MAXPATHNAME];
333+
name = RedirectSystemDir(name, buf, OFS_MAXPATHNAME);
327334
if (mode & OF_CREATE)
328335
{
329336
handle = (HANDLE)OpenFile( name, ofs, mode );
@@ -533,10 +540,10 @@ LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count )
533540
*/
534541
UINT WINAPI GetTempDrive( BYTE ignored )
535542
{
536-
WCHAR buffer[8];
543+
WCHAR buffer[MAX_PATH];
537544
BYTE ret;
538545

539-
if (GetTempPathW( 8, buffer )) ret = (BYTE)toupperW(buffer[0]);
546+
if (GetTempPathW(MAX_PATH, buffer )) ret = (BYTE)toupperW(buffer[0]);
540547
else ret = 'C';
541548
return MAKELONG( ret | (':' << 8), 1 );
542549
}
@@ -610,6 +617,7 @@ const char *GetRedirectWindowsDir()
610617
GetModuleFileNameA(GetModuleHandleA("krnl386.exe16"), windowsPath, MAX_PATH);
611618
PathRemoveFileSpecA(windowsPath);
612619
PathCombineA(windowsPath, windowsPath, "WINDOWS");
620+
GetShortPathNameA(windowsPath, windowsPath, sizeof(windowsPath));
613621
return windowsPath;
614622
}
615623

@@ -728,7 +736,13 @@ BOOL16 WINAPI WritePrivateProfileString16( LPCSTR section, LPCSTR entry,
728736
*/
729737
UINT16 WINAPI GetWindowsDirectory16( LPSTR path, UINT16 count )
730738
{
731-
return GetWindowsDirectoryA( path, count );
739+
const char *w = GetRedirectWindowsDir();
740+
UINT16 len = strlen(w);
741+
if (len + 1 > count)
742+
return strlen(w) + 1;
743+
strcpy(path, w);
744+
return len;
745+
//return GetWindowsDirectoryA( path, count );
732746
}
733747

734748

krnl386/krnl386.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
</PrecompiledHeader>
8080
<WarningLevel>Level3</WarningLevel>
8181
<Optimization>Disabled</Optimization>
82-
<PreprocessorDefinitions>ENABLEREDIRECTSYSTEMDIR;WIN32;_DEBUG;_WINDOWS;_USRDLL;KRNL386_EXPORTS;_X86_;__WINESRC__;__i386__;USE_COMPILER_EXCEPTIONS;HAVE_STRNCASECMP;HAVE__STRNICMP;_WINTERNL_;NtCurrentTeb=NtCurrentTeb__;inline=__inline</PreprocessorDefinitions>
82+
<PreprocessorDefinitions>MZ_SUPPORTED;ENABLEREDIRECTSYSTEMDIR;WIN32;_DEBUG;_WINDOWS;_USRDLL;KRNL386_EXPORTS;_X86_;__WINESRC__;__i386__;USE_COMPILER_EXCEPTIONS;HAVE_STRNCASECMP;HAVE__STRNICMP;_WINTERNL_;NtCurrentTeb=NtCurrentTeb__;inline=__inline</PreprocessorDefinitions>
8383
</ClCompile>
8484
<Link>
8585
<SubSystem>Windows</SubSystem>

krnl386/stub.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ DWORD CALL32_CBClientEx(FARPROC proc, LPWORD args, WORD *stackLin, DWORD *esi, I
217217
}
218218
void __wine_enter_vm86(CONTEXT *context)
219219
{
220+
wine_call_to_16_regs_vm86(context, NULL, NULL, __wine_call_from_16_regs, __wine_call_from_16, relay_call_from_16, __wine_call_to_16_ret, TRACE_ON(disasm));
220221
DPRINTF("NOTIMPL:__wine_enter_vm86(%p)\n", context);
221222
}
222223
void __wine_spec_init_ctor()

krnl386/thunk.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,14 +2401,22 @@ DWORD WINAPI LoadLibraryEx32W16( LPCSTR lpszLibFile, DWORD hFile, DWORD dwFlags
24012401
{
24022402
if (OpenFile16( lpszLibFile, &ofs, OF_EXIST ) != HFILE_ERROR16)
24032403
lpszLibFile = ofs.szPathName;
2404+
else
2405+
{
2406+
return 0;
2407+
}
24042408
}
24052409
else
24062410
{
2407-
char buffer[MAX_PATH+4];
2408-
strcpy( buffer, lpszLibFile );
2409-
strcat( buffer, ".dll" );
2410-
if (OpenFile16( buffer, &ofs, OF_EXIST ) != HFILE_ERROR16)
2411+
char buffer[MAX_PATH + 4];
2412+
strcpy(buffer, lpszLibFile);
2413+
strcat(buffer, ".dll");
2414+
if (OpenFile16(buffer, &ofs, OF_EXIST) != HFILE_ERROR16)
24112415
lpszLibFile = ofs.szPathName;
2416+
else
2417+
{
2418+
return 0;
2419+
}
24122420
}
24132421

24142422
ReleaseThunkLock( &mutex_count );

olecli/stub.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void __wine_spec_init_ctor()
77
void __wine_spec_unimplemented_stub(const char *module, const char *function)
88
{
99
DPRINTF("NOTIMPL:__wine_spec_unimplemented_stub(%s, %s)\n", module, function);
10+
*(char*)NULL = 1;
1011
}
1112
void __wine_spec_dll_entry()
1213
{

otvdm.sln

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdmwrapperexe", "vdmwrapper
107107
EndProject
108108
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ddeml", "ddeml\ddeml.vcxproj", "{D4EED8A5-2B15-4299-9F65-D56383AC7848}"
109109
EndProject
110+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toolhelp", "toolhelp\toolhelp.vcxproj", "{96925A3C-9DD9-418E-A772-A112FFE93DC2}"
111+
EndProject
112+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ver", "ver\ver.vcxproj", "{7C04956D-FEBE-410F-ABB1-945695CDDFE5}"
113+
EndProject
110114
Global
111115
GlobalSection(SolutionConfigurationPlatforms) = preSolution
112116
Debug|Win32 = Debug|Win32
@@ -497,6 +501,32 @@ Global
497501
{D4EED8A5-2B15-4299-9F65-D56383AC7848}.Release|Win32.ActiveCfg = Release|Win32
498502
{D4EED8A5-2B15-4299-9F65-D56383AC7848}.Release|Win32.Build.0 = Release|Win32
499503
{D4EED8A5-2B15-4299-9F65-D56383AC7848}.Release|x64.ActiveCfg = Release|Win32
504+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug|Win32.ActiveCfg = Debug|Win32
505+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug|Win32.Build.0 = Debug|Win32
506+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug|x64.ActiveCfg = Debug|Win32
507+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug-USER.EXE|Win32.ActiveCfg = Debug|Win32
508+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug-USER.EXE|Win32.Build.0 = Debug|Win32
509+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug-USER.EXE|x64.ActiveCfg = Release|Win32
510+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Debug-USER.EXE|x64.Build.0 = Release|Win32
511+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.GenLibFileRelease|Win32.ActiveCfg = GenLibFileRelease|Win32
512+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.GenLibFileRelease|Win32.Build.0 = GenLibFileRelease|Win32
513+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.GenLibFileRelease|x64.ActiveCfg = GenLibFileRelease|Win32
514+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Release|Win32.ActiveCfg = Release|Win32
515+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Release|Win32.Build.0 = Release|Win32
516+
{96925A3C-9DD9-418E-A772-A112FFE93DC2}.Release|x64.ActiveCfg = Release|Win32
517+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug|Win32.ActiveCfg = Debug|Win32
518+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug|Win32.Build.0 = Debug|Win32
519+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug|x64.ActiveCfg = Debug|Win32
520+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug-USER.EXE|Win32.ActiveCfg = Debug|Win32
521+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug-USER.EXE|Win32.Build.0 = Debug|Win32
522+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug-USER.EXE|x64.ActiveCfg = Release|Win32
523+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Debug-USER.EXE|x64.Build.0 = Release|Win32
524+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.GenLibFileRelease|Win32.ActiveCfg = GenLibFileRelease|Win32
525+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.GenLibFileRelease|Win32.Build.0 = GenLibFileRelease|Win32
526+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.GenLibFileRelease|x64.ActiveCfg = GenLibFileRelease|Win32
527+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Release|Win32.ActiveCfg = Release|Win32
528+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Release|Win32.Build.0 = Release|Win32
529+
{7C04956D-FEBE-410F-ABB1-945695CDDFE5}.Release|x64.ActiveCfg = Release|Win32
500530
EndGlobalSection
501531
GlobalSection(SolutionProperties) = preSolution
502532
HideSolutionNode = FALSE

otvdm/winevdm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ int main( int argc, char *argv[] )
574574
/* loader expects arguments to be regular C strings */
575575
start_dos_exe( appname, cmdline + 1 );
576576
}
577+
#else
578+
__wine_load_dos_exe(appname, cmdline + 1);
577579
#endif
578580
/* if we get back here it failed */
579581
instance = GetLastError();

0 commit comments

Comments
 (0)