From a098c82aac55231959428e8279699783d3e9e73a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 15 May 2003 23:25:49 +0000 Subject: [PATCH] Moved vxd support to winedos. --- dlls/Makefile.in | 4 ++-- dlls/kernel/.cvsignore | 1 - dlls/kernel/Makefile.in | 5 ++--- dlls/ntdll/Makefile.in | 1 - dlls/winedos/.cvsignore | 1 + dlls/winedos/Makefile.in | 4 ++++ {msdos => dlls/winedos}/vxd.c | 27 +++++++++++++++++++++------ dlls/{kernel => winedos}/wprocs.spec | 0 8 files changed, 30 insertions(+), 13 deletions(-) rename {msdos => dlls/winedos}/vxd.c (98%) rename dlls/{kernel => winedos}/wprocs.spec (100%) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 567531e512..07a31a66fc 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -429,7 +429,7 @@ joystick.drv$(DLLEXT): winmm/joystick/joystick.drv$(DLLEXT) kernel32.dll$(DLLEXT) comm.dll$(DLLEXT) krnl386.exe$(DLLEXT) \ stress.dll$(DLLEXT) system.dll$(DLLEXT) toolhelp.dll$(DLLEXT) \ - win87em.dll$(DLLEXT) windebug.dll$(DLLEXT) wprocs.dll$(DLLEXT): kernel/kernel32.dll$(DLLEXT) + win87em.dll$(DLLEXT) windebug.dll$(DLLEXT): kernel/kernel32.dll$(DLLEXT) $(RM) $@ && $(LN_S) kernel/kernel32.dll$(DLLEXT) $@ lz32.dll$(DLLEXT) lzexpand.dll$(DLLEXT): lzexpand/lz32.dll$(DLLEXT) @@ -606,7 +606,7 @@ winearts.drv$(DLLEXT): winmm/winearts/winearts.drv$(DLLEXT) wineaudioio.drv$(DLLEXT): winmm/wineaudioio/wineaudioio.drv$(DLLEXT) $(RM) $@ && $(LN_S) winmm/wineaudioio/wineaudioio.drv$(DLLEXT) $@ -winedos.dll$(DLLEXT): winedos/winedos.dll$(DLLEXT) +winedos.dll$(DLLEXT) wprocs.dll$(DLLEXT): winedos/winedos.dll$(DLLEXT) $(RM) $@ && $(LN_S) winedos/winedos.dll$(DLLEXT) $@ winejack.drv$(DLLEXT): winmm/winejack/winejack.drv$(DLLEXT) diff --git a/dlls/kernel/.cvsignore b/dlls/kernel/.cvsignore index cf6994bc55..c1d7f27b93 100644 --- a/dlls/kernel/.cvsignore +++ b/dlls/kernel/.cvsignore @@ -11,4 +11,3 @@ toolhelp.spec.c version16.res win87em.spec.c windebug.spec.c -wprocs.spec.c diff --git a/dlls/kernel/Makefile.in b/dlls/kernel/Makefile.in index 9c0a26280d..dab93d3aad 100644 --- a/dlls/kernel/Makefile.in +++ b/dlls/kernel/Makefile.in @@ -5,7 +5,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = kernel32.dll IMPORTS = ntdll -ALTNAMES = krnl386.exe comm.dll stress.dll system.dll toolhelp.dll windebug.dll win87em.dll wprocs.dll +ALTNAMES = krnl386.exe comm.dll stress.dll system.dll toolhelp.dll windebug.dll win87em.dll LDIMPORTS = ntdll.dll EXTRALIBS = $(LIBUNICODE) DLLMAIN = MAIN_KernelInit @@ -17,8 +17,7 @@ SPEC_SRCS16 = \ system.spec \ toolhelp.spec \ win87em.spec \ - windebug.spec \ - wprocs.spec + windebug.spec C_SRCS = \ $(TOPOBJDIR)/ole/ole2nls.c \ diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in index d3ddadcef5..286a87a231 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -46,7 +46,6 @@ C_SRCS = \ $(TOPOBJDIR)/msdos/int21.c \ $(TOPOBJDIR)/msdos/ioports.c \ $(TOPOBJDIR)/msdos/ppdev.c \ - $(TOPOBJDIR)/msdos/vxd.c \ $(TOPOBJDIR)/relay32/builtin32.c \ $(TOPOBJDIR)/relay32/relay386.c \ $(TOPOBJDIR)/relay32/snoop.c \ diff --git a/dlls/winedos/.cvsignore b/dlls/winedos/.cvsignore index f01abb627a..2a32b262e2 100644 --- a/dlls/winedos/.cvsignore +++ b/dlls/winedos/.cvsignore @@ -3,3 +3,4 @@ winedos.dll.dbg.c winedos.spec.c winedos.spec.def winedos16.spec.c +wprocs.spec.c diff --git a/dlls/winedos/Makefile.in b/dlls/winedos/Makefile.in index 9668723248..ecf0172da8 100644 --- a/dlls/winedos/Makefile.in +++ b/dlls/winedos/Makefile.in @@ -4,11 +4,14 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = winedos.dll IMPORTS = user32 advapi32 kernel32 ntdll +ALTNAMES = wprocs.dll EXTRALIBS = $(LIBUNICODE) LDDLLFLAGS = @LDDLLFLAGS@ SYMBOLFILE = $(MODULE).tmp.o +SPEC_SRCS16 = wprocs.spec + C_SRCS = \ devices.c \ dma.c \ @@ -46,6 +49,7 @@ C_SRCS = \ relay.c \ soundblaster.c \ vga.c \ + vxd.c \ xms.c @MAKE_DLL_RULES@ diff --git a/msdos/vxd.c b/dlls/winedos/vxd.c similarity index 98% rename from msdos/vxd.c rename to dlls/winedos/vxd.c index a1581fa79c..e4f91fca2b 100644 --- a/msdos/vxd.c +++ b/dlls/winedos/vxd.c @@ -395,14 +395,29 @@ void WINAPI VXD_Timer( CONTEXT86 *context ) } } + +/*********************************************************************** + * timer_thread + */ +static DWORD CALLBACK timer_thread( void *arg ) +{ + DWORD *system_time = arg; + + for (;;) + { + *system_time = GetTickCount(); + Sleep( 55 ); + } +} + + /*********************************************************************** * VXD_TimerAPI (WPROCS.1490) */ -static DWORD System_Time = 0; -static WORD System_Time_Selector = 0; -static void System_Time_Tick( WORD timer ) { System_Time += 55; } void WINAPI VXD_TimerAPI ( CONTEXT86 *context ) { + static WORD System_Time_Selector; + unsigned service = AX_reg(context); TRACE("[%04x] TimerAPI\n", (UINT16)service); @@ -417,10 +432,10 @@ void WINAPI VXD_TimerAPI ( CONTEXT86 *context ) case 0x0009: /* get system time selector */ if ( !System_Time_Selector ) { - System_Time_Selector = SELECTOR_AllocBlock( &System_Time, sizeof(DWORD), WINE_LDT_FLAGS_DATA ); - CreateSystemTimer( 55, System_Time_Tick ); + HANDLE16 handle = GlobalAlloc16( GMEM_FIXED, sizeof(DWORD) ); + System_Time_Selector = handle | 7; + CloseHandle( CreateThread( NULL, 0, timer_thread, GlobalLock16(handle), 0, NULL ) ); } - SET_AX( context, System_Time_Selector ); RESET_CFLAG(context); break; diff --git a/dlls/kernel/wprocs.spec b/dlls/winedos/wprocs.spec similarity index 100% rename from dlls/kernel/wprocs.spec rename to dlls/winedos/wprocs.spec