mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 23:20:43 +00:00
winepulse: Use GetModuleFileName() instead of hardcoded module filename for registry key.
This commit is contained in:
parent
53baa44574
commit
576827d83a
|
@ -71,7 +71,7 @@ static GUID pulse_render_guid =
|
||||||
static GUID pulse_capture_guid =
|
static GUID pulse_capture_guid =
|
||||||
{ 0x25da76d0, 0x033c, 0x4235, { 0x90, 0x02, 0x19, 0xf4, 0x88, 0x94, 0xac, 0x6f } };
|
{ 0x25da76d0, 0x033c, 0x4235, { 0x90, 0x02, 0x19, 0xf4, 0x88, 0x94, 0xac, 0x6f } };
|
||||||
|
|
||||||
static const WCHAR *drv_key_devicesW = L"Software\\Wine\\Drivers\\winepulse.drv\\devices";
|
static WCHAR drv_key_devicesW[256];
|
||||||
|
|
||||||
static CRITICAL_SECTION session_cs;
|
static CRITICAL_SECTION session_cs;
|
||||||
static CRITICAL_SECTION_DEBUG session_cs_debug = {
|
static CRITICAL_SECTION_DEBUG session_cs_debug = {
|
||||||
|
@ -85,9 +85,20 @@ static CRITICAL_SECTION session_cs = { &session_cs_debug, -1, 0, 0, 0, 0 };
|
||||||
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
|
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
|
WCHAR buf[MAX_PATH];
|
||||||
|
WCHAR *filename;
|
||||||
|
|
||||||
DisableThreadLibraryCalls(dll);
|
DisableThreadLibraryCalls(dll);
|
||||||
if (__wine_init_unix_call())
|
if (__wine_init_unix_call())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
GetModuleFileNameW(dll, buf, ARRAY_SIZE(buf));
|
||||||
|
|
||||||
|
filename = wcsrchr(buf, '\\');
|
||||||
|
filename = filename ? filename + 1 : buf;
|
||||||
|
|
||||||
|
swprintf(drv_key_devicesW, ARRAY_SIZE(drv_key_devicesW),
|
||||||
|
L"Software\\Wine\\Drivers\\%s\\devices", filename);
|
||||||
} else if (reason == DLL_PROCESS_DETACH) {
|
} else if (reason == DLL_PROCESS_DETACH) {
|
||||||
struct device_cache *device, *device_next;
|
struct device_cache *device, *device_next;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue