Andrew Eikum aeikum@codeweavers.com writes:
@@ -72,11 +73,19 @@ static BOOL load_driver(const WCHAR *name) }
#define LDFC(n) do { drvs.p##n = (void*)GetProcAddress(drvs.module, #n);\
if(!drvs.p##n) return FALSE; } while(0);
if(!drvs.p##n) { FreeLibrary(drvs.module); return FALSE; } } while(0);
- LDFC(InitializeDriver); LDFC(GetEndpointIDs); LDFC(GetAudioEndpoint);
#undef LDFC
- hr = drvs.pInitializeDriver();
- if(FAILED(hr)){
TRACE("Driver initialization failed: %08x\n", hr);
FreeLibrary(drvs.module);
return hr;
- }
If you are going to call it on load, you could just as well do the init in the driver on DLL_PROCESS_ATTACH and avoid the extra method.
On Monday 02 May 2011 01:32:59 pm Alexandre Julliard wrote:
Andrew Eikum aeikum@codeweavers.com writes:
@@ -72,11 +73,19 @@ static BOOL load_driver(const WCHAR *name) }
#define LDFC(n) do { drvs.p##n = (void*)GetProcAddress(drvs.module, #n);\ - if(!drvs.p##n) return FALSE; } while(0);
if(!drvs.p##n) { FreeLibrary(drvs.module); return FALSE; } }
while(0); + LDFC(InitializeDriver); LDFC(GetEndpointIDs); LDFC(GetAudioEndpoint); #undef LDFC
- hr = drvs.pInitializeDriver();
- if(FAILED(hr)){
TRACE("Driver initialization failed: %08x\n", hr);
FreeLibrary(drvs.module);
return hr;
- }
If you are going to call it on load, you could just as well do the init in the driver on DLL_PROCESS_ATTACH and avoid the extra method.
Wine is already plagued by deadlocks in the MM drivers initialization that interfere with the loader's lock. Explicit initialization after LoadLibrary returns should help getting rid of these.
Paul Chitescu paulc@voip.null.ro writes:
Wine is already plagued by deadlocks in the MM drivers initialization that interfere with the loader's lock. Explicit initialization after LoadLibrary returns should help getting rid of these.
Considering that the MM drivers don't implement DLL_PROCESS_ATTACH at all at the moment, I don't think avoiding it is going to fix anything...