[PATCH 1/3] devenum: Always scan for devices in CreateClassEnumerator().
Zebediah Figura
z.figura12 at gmail.com
Thu Mar 8 12:37:36 CST 2018
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/devenum/createdevenum.c | 22 ----------------------
dlls/devenum/tests/devenum.c | 2 --
2 files changed, 24 deletions(-)
diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c
index 7cfdbff..7c03852 100644
--- a/dlls/devenum/createdevenum.c
+++ b/dlls/devenum/createdevenum.c
@@ -547,12 +547,6 @@ static void register_vfw_codecs(void)
RegCloseKey(basekey);
}
-static HANDLE DEVENUM_populate_handle;
-static const WCHAR DEVENUM_populate_handle_nameW[] =
- {'_','_','W','I','N','E','_',
- 'D','e','v','e','n','u','m','_',
- 'P','o','p','u','l','a','t','e',0};
-
static HRESULT register_codecs(void)
{
HRESULT res;
@@ -566,21 +560,6 @@ static HRESULT register_codecs(void)
REGFILTERPINS2 rfp2;
HKEY basekey;
- if (DEVENUM_populate_handle)
- return S_OK;
- DEVENUM_populate_handle = CreateEventW(NULL, TRUE, FALSE, DEVENUM_populate_handle_nameW);
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- /* Webcams can take some time to scan if the driver is badly written and it enables them,
- * so have a 10 s timeout here
- */
- if (WaitForSingleObject(DEVENUM_populate_handle, 10000) == WAIT_TIMEOUT)
- WARN("Waiting for object timed out\n");
- TRACE("No need to rescan\n");
- return S_OK;
- }
- TRACE("Scanning for devices\n");
-
/* Since devices can change between session, for example because you just plugged in a webcam
* or switched from pulseaudio to alsa, delete all old devices first
*/
@@ -878,6 +857,5 @@ static HRESULT register_codecs(void)
register_vfw_codecs();
- SetEvent(DEVENUM_populate_handle);
return res;
}
diff --git a/dlls/devenum/tests/devenum.c b/dlls/devenum/tests/devenum.c
index 7e3270f..a08dece 100644
--- a/dlls/devenum/tests/devenum.c
+++ b/dlls/devenum/tests/devenum.c
@@ -445,11 +445,9 @@ static void test_codec(void)
/* unlike DirectShow filters, these are automatically generated, so
* enumerating them will destroy the key */
-todo_wine
ok(!find_moniker(&CLSID_AudioRendererCategory, mon), "codec should not be registered\n");
hr = IPropertyBag_Read(prop_bag, friendly_name, &var, NULL);
-todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got %#x\n", hr);
IPropertyBag_Release(prop_bag);
--
2.7.4
More information about the wine-devel
mailing list