[EMAIL PROTECTED] wrote:

I tried the following change in acmDriverAddA() at
dlls/msacm/driver.c:

   if (!hinstModule) {
       return MMSYSERR_INVALHANDLE;
   } else {
#define WINE_DI_MAGIC   0x900F1B01
       unsigned int * d = (unsigned int *)hinstModule;
       if (HeapValidate(GetProcessHeap(), 0, d) && *d ==
WINE_DI_MAGIC) {
           *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL,
NULL, hinstModule);
       } else {
           return MMSYSERR_INVALHANDLE;
       }
   }
I saw a mail in wine-devel mentioning the approach of abandoning the dependency on DriverSendMessage(). I will try to implement it. Meanwhile, this patch prevents the game from crashing, although it does not add any functionality. However, it will try to report the unsupported configuration as a guide for later implementation.

Alex Villacís Lasso

--- wine-20050524/dlls/msacm/driver.c	2004-06-01 14:41:01.000000000 -0500
+++ wine-20050524-patch/dlls/msacm/driver.c	2005-06-11 14:35:47.000000000 -0500
@@ -76,7 +76,33 @@
      * LoadDriver on it, to be sure we can call SendDriverMessage on the
      * hDrvr handle.
      */
+    /*
     *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, NULL, hinstModule);
+     */
+    if (!hinstModule) {
+        FIXME("adding driver with hinstModule == NULL not supported\n");
+        return MMSYSERR_INVALHANDLE;
+    } else {
+#define WINE_DI_MAGIC   0x900F1B01
+        unsigned int * d = (unsigned int *)hinstModule;
+        if (HeapValidate(GetProcessHeap(), 0, d) && *d == WINE_DI_MAGIC) {
+            *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, NULL, hinstModule);
+        } else {
+            FIXME("semi-stub (the following unsupported request was made):\n");
+            if (fdwAdd & ACM_DRIVERADDF_GLOBAL) FIXME("\tACM_DRIVERADDF_GLOBAL\n");
+            if (fdwAdd & ACM_DRIVERADDF_LOCAL) FIXME("\tACM_DRIVERADDF_LOCAL\n");
+            if (fdwAdd & ACM_DRIVERADDF_FUNCTION)
+            {
+                FIXME("\tACM_DRIVERADDF_FUNCTION: acmDriverProc == 0x%p\n", (void *)lParam);
+            }
+            if (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)
+            {
+                FIXME("\tACM_DRIVERADDF_NOTIFYHWND: hWnd == 0x%p\n", (void *)lParam);
+            }
+            /* ACM_DRIVERADDF_NAME not covered, but is mentioned in MSDN */
+            return MMSYSERR_INVALPARAM;
+        }
+    }
 
     /* FIXME: lParam, dwPriority and fdwAdd ignored */
 

Reply via email to