# HG changeset patch
# User alex
# Date 1097598640 0
# Node ID 8c6b747eeacf4b46a69988932a3ad857d8ab102d
# Parent  db051195ad6829619d77124d36a0ffba0744f48a
runtime patching vp31vfw.dll, so non-patched dlls can be used aswell. note: this does not breaks if the dll is already patched

diff -r db051195ad68 -r 8c6b747eeacf loader/module.c
--- a/loader/module.c	Tue Oct 12 16:13:38 2004 +0000
+++ b/loader/module.c	Tue Oct 12 16:30:40 2004 +0000
@@ -422,6 +422,17 @@
 	if (!wm)
 	    printf("Win32 LoadLibrary failed to load: %s\n", checked);
 
+	if (strstr(libname,"vp31vfw.dll") && wm)
+	{
+	    int i;
+
+	  // sse hack moved from patch dll into runtime patching
+          if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10001000) {
+	    fprintf(stderr, "VP3 DLL found\n");
+	    for (i=0;i<18;i++) ((char*)0x10004bd6)[i]=0x90;
+	  }
+	}
+
         // remove a few divs in the VP codecs that make trouble
         if (strstr(libname,"vp5vfw.dll") && wm)
         {