[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH 1/1] winecoreaudio: Make sure Port_SendToMessageThread is
From:       Ken Thomases <ken () codeweavers ! com>
Date:       2008-01-29 0:05:51
Message-ID: DDC2F802-AC9D-4A51-85C5-8D6F4DD02A50 () codeweavers ! com
[Download RAW message or body]

On Jan 28, 2008, at 8:06 AM, Misha Koshelev wrote:

> I have started playing with wine on MacOS in VMWare.  
> wineprefixcreate page faults on my
> MacOS "system" and I tracked it to Port_SendToMessageThread staying  
> NULL because of:
> err:wave:CoreAudio_WaveInit AudioHardwareGetProperty:  
> CoreAudio_DefaultDevice.outputDeviceID == kAudioDeviceUnknown
> Clearly wineprefixcreate shouldn't be page faulting under any  
> condition.

It seems to me that the driver ought to just fail to load in this  
case.  If you back out your patch and apply the attached patch, does  
that fix the page fault?

-Ken


["coreaudio_detect_load_failure.patch" (coreaudio_detect_load_failure.patch)]

diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c
index 56a4fd3..0690afd 100644
--- a/dlls/winecoreaudio.drv/coreaudio.c
+++ b/dlls/winecoreaudio.drv/coreaudio.c
@@ -42,10 +42,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(coreaudio);
 static LRESULT CoreAudio_drvLoad(void)
 {
     TRACE("()\n");
-    CoreAudio_WaveInit();
-    CoreAudio_MIDIInit();
-    CoreAudio_MixerInit();
-    return 1;
+
+    if (CoreAudio_WaveInit() != DRV_SUCCESS ||
+        CoreAudio_MIDIInit() != DRV_SUCCESS ||
+        CoreAudio_MixerInit() != DRV_SUCCESS)
+        return DRV_FAILURE;
+
+    return DRV_SUCCESS;
 }
 
 /**************************************************************************
@@ -57,7 +60,7 @@ static LRESULT CoreAudio_drvFree(void)
     CoreAudio_WaveRelease();
     CoreAudio_MIDIRelease();
     CoreAudio_MixerRelease();
-    return 1;
+    return DRV_SUCCESS;
 }
 
 /**************************************************************************
diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c
index 01eb453..a052e05 100644
--- a/dlls/winecoreaudio.drv/midi.c
+++ b/dlls/winecoreaudio.drv/midi.c
@@ -109,7 +109,7 @@ LONG CoreAudio_MIDIInit(void)
     {
         CFRelease(name);
         ERR("can't create wineMIDIClient\n");
-        return 0;
+        return DRV_FAILURE;
     }
     CFRelease(name);
 
@@ -193,7 +193,7 @@ LONG CoreAudio_MIDIInit(void)
         destinations[i].caps.wVoices = 16;
         destinations[i].caps.wNotes = 16;
     }
-    return 1;
+    return DRV_SUCCESS;
 }
 
 LONG CoreAudio_MIDIRelease(void)
@@ -214,7 +214,7 @@ LONG CoreAudio_MIDIRelease(void)
 
     HeapFree(GetProcessHeap(), 0, sources);
     HeapFree(GetProcessHeap(), 0, destinations);
-    return 1;
+    return DRV_SUCCESS;
 }
 
 
diff --git a/dlls/winecoreaudio.drv/mixer.c b/dlls/winecoreaudio.drv/mixer.c
index 66db8cb..a41b29b 100644
--- a/dlls/winecoreaudio.drv/mixer.c
+++ b/dlls/winecoreaudio.drv/mixer.c
@@ -368,7 +368,7 @@ LONG CoreAudio_MixerInit(void)
             (char) (status >> 16),
             (char) (status >> 8),
             (char) status);
-        return 0;
+        return DRV_FAILURE;
     }
 
     numLines = propertySize / sizeof(AudioDeviceID);
@@ -495,7 +495,7 @@ LONG CoreAudio_MixerInit(void)
     MIX_FillControls();
 
     HeapFree(GetProcessHeap(), 0, deviceArray);
-    return 1;
+    return DRV_SUCCESS;
 
 error:
     if (mixer.lines)
@@ -510,7 +510,7 @@ error:
     HeapFree(GetProcessHeap(), 0, deviceArray);
     if (mixer.mixerCtrls)
         HeapFree(GetProcessHeap(), 0, mixer.mixerCtrls);
-    return 0;
+    return DRV_FAILURE;
 }
 
 /**************************************************************************






[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic