[DEVENUM] Sync with Wine Staging 3.3. CORE-14434

This commit is contained in:
Amine Khaldi 2018-03-08 13:30:52 +01:00
parent 1bb40cffc0
commit dbcbc1cda1
11 changed files with 141 additions and 44 deletions

View file

@ -12,7 +12,7 @@ list(APPEND SOURCE
factory.c
mediacatenum.c
parsedisplayname.c
devenum_private.h)
precomp.h)
add_library(devenum SHARED
${SOURCE}
@ -24,5 +24,5 @@ set_module_type(devenum win32dll UNICODE)
target_link_libraries(devenum strmiids uuid wine)
add_delay_importlibs(devenum msvfw32)
add_importlibs(devenum advapi32 advapi32_vista ole32 oleaut32 winmm user32 avicap32 msacm32 msvcrt kernel32 ntdll)
add_pch(devenum devenum_private.h SOURCE)
add_pch(devenum precomp.h SOURCE)
add_cd_file(TARGET devenum DESTINATION reactos/system32 FOR all)

View file

@ -23,13 +23,18 @@
* - Also creates the special registry keys created at run-time
*/
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include "devenum_private.h"
#include "vfw.h"
#include "aviriff.h"
#include <vfw.h>
#include <aviriff.h>
#include <shlwapi.h>
#include "wine/debug.h"
#include "wine/unicode.h"
#include "mmddk.h"
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
extern HINSTANCE DEVENUM_hInstance;
@ -109,6 +114,7 @@ static BOOL IsSpecialCategory(const CLSID *clsid)
IsEqualGUID(clsid, &CLSID_AudioInputDeviceCategory) ||
IsEqualGUID(clsid, &CLSID_VideoInputDeviceCategory) ||
IsEqualGUID(clsid, &CLSID_VideoCompressorCategory) ||
IsEqualGUID(clsid, &CLSID_AudioCompressorCategory) ||
IsEqualGUID(clsid, &CLSID_MidiRendererCategory);
}
@ -633,6 +639,72 @@ static void register_vfw_codecs(void)
RegCloseKey(basekey);
}
static BOOL WINAPI acm_driver_callback(HACMDRIVERID hadid, DWORD_PTR user, DWORD support)
{
static const WCHAR CLSIDW[] = {'C','L','S','I','D',0};
static const WCHAR AcmIdW[] = {'A','c','m','I','d',0};
static const WCHAR FriendlyNameW[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
static const WCHAR fmtW[] = {'%','u','%','s',0};
WCHAR acmwrapper_clsid_str[CHARS_IN_GUID], buffer[MAX_PATH];
HKEY key, basekey = (HKEY) user;
ACMFORMATTAGDETAILSW format;
ACMDRIVERDETAILSW driver;
HACMDRIVER had;
DWORD i, res;
StringFromGUID2(&CLSID_ACMWrapper, acmwrapper_clsid_str, sizeof(acmwrapper_clsid_str)/sizeof(WCHAR));
driver.cbStruct = sizeof(driver);
if (acmDriverDetailsW(hadid, &driver, 0) != MMSYSERR_NOERROR)
return TRUE;
if (acmDriverOpen(&had, hadid, 0) != MMSYSERR_NOERROR)
return TRUE;
for (i = 0; i < driver.cFormatTags; i++)
{
memset(&format, 0, sizeof(format));
format.cbStruct = sizeof(format);
format.dwFormatTagIndex = i;
if (acmFormatTagDetailsW(had, &format, ACM_FORMATTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
continue;
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), fmtW, format.dwFormatTag, format.szFormatTag);
res = RegCreateKeyW(basekey, buffer, &key);
if (res != ERROR_SUCCESS) continue;
RegSetValueExW(key, CLSIDW, 0, REG_SZ, (BYTE*)acmwrapper_clsid_str, sizeof(acmwrapper_clsid_str));
RegSetValueExW(key, AcmIdW, 0, REG_DWORD, (BYTE*)&format.dwFormatTag, sizeof(DWORD));
RegSetValueExW(key, FriendlyNameW, 0, REG_SZ, (BYTE*)format.szFormatTag, (strlenW(format.szFormatTag)+1)*sizeof(WCHAR));
/* FIXME: Set FilterData values */
RegCloseKey(key);
}
acmDriverClose(had, 0);
return TRUE;
}
static void register_acm_codecs(void)
{
HKEY basekey;
basekey = open_special_category_key(&CLSID_AudioCompressorCategory, TRUE);
if (!basekey)
{
ERR("Could not create key\n");
return;
}
acmDriverEnum(acm_driver_callback, (DWORD_PTR)basekey, 0);
RegCloseKey(basekey);
}
static HANDLE DEVENUM_populate_handle;
static const WCHAR DEVENUM_populate_handle_nameW[] =
{'_','_','W','I','N','E','_',
@ -685,6 +757,8 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
RegDeleteTreeW(basekey, path);
if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_VideoCompressorCategory, &basekey, path, MAX_PATH)))
RegDeleteTreeW(basekey, path);
if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_AudioCompressorCategory, &basekey, path, MAX_PATH)))
RegDeleteTreeW(basekey, path);
rf2.dwVersion = 2;
rf2.dwMerit = MERIT_PREFERRED;
@ -966,6 +1040,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
IFilterMapper2_Release(pMapper);
register_vfw_codecs();
register_acm_codecs();
SetEvent(DEVENUM_populate_handle);
return res;

View file

@ -18,11 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <windef.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "devenum_private.h"
#include "resource.h"
#pragma code_page(65001)
#pragma makedep po
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
@ -43,6 +44,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#define WINE_PRODUCTVERSION 6,5,1,902
#define WINE_PRODUCTVERSION_STR "6.5"
#include <wine/wine_common_ver.rc>
#include "wine/wine_common_ver.rc"
1 WINE_REGISTRY devenum_classes.rgs

View file

@ -20,8 +20,10 @@
*/
#include "devenum_private.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include <rpcproxy.h>
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
DECLSPEC_HIDDEN LONG dll_refs;
DECLSPEC_HIDDEN HINSTANCE DEVENUM_hInstance;

View file

@ -22,35 +22,28 @@
* - Private file where devenum globals are declared
*/
#ifndef __WINE_DEVENUM_H
#define __WINE_DEVENUM_H
#pragma once
#ifndef RC_INVOKED
#include <stdarg.h>
#endif
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#define COBJMACROS
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winreg.h>
#include <objbase.h>
#include <oleidl.h>
#include <strmif.h>
#include <uuids.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
#include "ole2.h"
#include "strmif.h"
#include "olectl.h"
#include "uuids.h"
#ifndef RC_INVOKED
#include <wine/unicode.h>
#include "wine/unicode.h"
#endif
/**********************************************************************
@ -95,4 +88,12 @@ extern const WCHAR clsid_keyname[6] DECLSPEC_HIDDEN;
extern const WCHAR wszInstanceKeyName[] DECLSPEC_HIDDEN;
#define CLSID_STR_LEN (sizeof(clsid_keyname) / sizeof(WCHAR))
#endif /* __WINE_DEVENUM_H */
/**********************************************************************
* Resource IDs
*/
#define IDS_DEVENUM_DSDEFAULT 7
#define IDS_DEVENUM_DS 8
#define IDS_DEVENUM_WODEFAULT 9
#define IDS_DEVENUM_MIDEFAULT 10
#define IDS_DEVENUM_KSDEFAULT 11
#define IDS_DEVENUM_KS 12

View file

@ -21,6 +21,10 @@
#include "devenum_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
/**********************************************************************
* DEVENUM_IClassFactory_QueryInterface (also IUnknown)
*/

View file

@ -23,9 +23,12 @@
*/
#include "devenum_private.h"
#include "oleauto.h"
#include "ocidl.h"
#include <ocidl.h>
#include <oleauto.h>
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
typedef struct
{

View file

@ -21,9 +21,12 @@
* - Implements IParseDisplayName interface which creates a moniker
* from a string in a special format
*/
#include "devenum_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
static HRESULT WINAPI DEVENUM_IParseDisplayName_QueryInterface(IParseDisplayName *iface,
REFIID riid, void **ppv)
{

View file

@ -0,0 +1,16 @@
#ifndef _WINE_DEVENUM_PRECOMP_H
#define _WINE_DEVENUM_PRECOMP_H
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include "devenum_private.h"
#include <wine/debug.h>
#endif /* !_WINE_DEVENUM_PRECOMP_H */

View file

@ -1,8 +0,0 @@
#pragma once
#define IDS_DEVENUM_DSDEFAULT 7
#define IDS_DEVENUM_DS 8
#define IDS_DEVENUM_WODEFAULT 9
#define IDS_DEVENUM_MIDEFAULT 10
#define IDS_DEVENUM_KSDEFAULT 11
#define IDS_DEVENUM_KS 12

View file

@ -29,7 +29,7 @@ reactos/dll/directx/wine/d3drm # Synced to WineStaging-3.3
reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-3.3
reactos/dll/directx/wine/d3dxof # Synced to WineStaging-3.3
reactos/dll/directx/wine/ddraw # Synced to WineStaging-3.3
reactos/dll/directx/wine/devenum # Synced to Wine-3.0
reactos/dll/directx/wine/devenum # Synced to WineStaging-3.3
reactos/dll/directx/wine/dinput # Synced to Wine-3.0
reactos/dll/directx/wine/dinput8 # Synced to WineStaging-2.9
reactos/dll/directx/wine/dmusic # Synced to WineStaging-2.9