mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Do WSAStartup() in the DLL entry routine instead of at context creation.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@837 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									26870176ba
								
							
						
					
					
						commit
						6d2a9367ba
					
				
					 2 changed files with 13 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -142,13 +142,6 @@ pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name) {
 | 
			
		|||
#endif
 | 
			
		||||
    pa_client_conf_env(c->conf);
 | 
			
		||||
 | 
			
		||||
#ifdef OS_IS_WIN32
 | 
			
		||||
    {
 | 
			
		||||
        WSADATA data;
 | 
			
		||||
        WSAStartup(MAKEWORD(2, 0), &data);
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
    
 | 
			
		||||
    return c;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -187,10 +180,6 @@ static void context_free(pa_context *c) {
 | 
			
		|||
    pa_xfree(c->name);
 | 
			
		||||
    pa_xfree(c->server);
 | 
			
		||||
    pa_xfree(c);
 | 
			
		||||
 | 
			
		||||
#ifdef OS_IS_WIN32
 | 
			
		||||
    WSACleanup();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pa_context* pa_context_ref(pa_context *c) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,12 +34,21 @@
 | 
			
		|||
extern pa_set_root(HANDLE handle);
 | 
			
		||||
 | 
			
		||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
 | 
			
		||||
    if (fdwReason != DLL_PROCESS_ATTACH)
 | 
			
		||||
        return TRUE;
 | 
			
		||||
    WSADATA data;
 | 
			
		||||
 | 
			
		||||
    if (!pa_set_root(hinstDLL))
 | 
			
		||||
        return FALSE;
 | 
			
		||||
    switch (fdwReason) {
 | 
			
		||||
 | 
			
		||||
    case DLL_PROCESS_ATTACH:
 | 
			
		||||
        if (!pa_set_root(hinstDLL))
 | 
			
		||||
            return FALSE;
 | 
			
		||||
        WSAStartup(MAKEWORD(2, 0), &data);
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
    case DLL_PROCESS_DETACH:
 | 
			
		||||
        WSACleanup();
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue