Commit b6f2e9b1 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

devenum: Use wide string literals.

parent 90a99806
......@@ -162,27 +162,17 @@ HRESULT WINAPI DllRegisterServer(void)
&IID_IFilterMapper2, &mapvptr);
if (SUCCEEDED(res))
{
static const WCHAR friendlyvidcap[] = {'V','i','d','e','o',' ','C','a','p','t','u','r','e',' ','S','o','u','r','c','e','s',0};
static const WCHAR friendlydshow[] = {'D','i','r','e','c','t','S','h','o','w',' ','F','i','l','t','e','r','s',0};
static const WCHAR friendlyvidcomp[] = {'V','i','d','e','o',' ','C','o','m','p','r','e','s','s','o','r','s',0};
static const WCHAR friendlyaudcap[] = {'A','u','d','i','o',' ','C','a','p','t','u','r','e',' ','S','o','u','r','c','e','s',0};
static const WCHAR friendlyaudcomp[] = {'A','u','d','i','o',' ','C','o','m','p','r','e','s','s','o','r','s',0};
static const WCHAR friendlyaudrend[] = {'A','u','d','i','o',' ','R','e','n','d','e','r','e','r','s',0};
static const WCHAR friendlymidirend[] = {'M','i','d','i',' ','R','e','n','d','e','r','e','r','s',0};
static const WCHAR friendlyextrend[] = {'E','x','t','e','r','n','a','l',' ','R','e','n','d','e','r','e','r','s',0};
static const WCHAR friendlydevctrl[] = {'D','e','v','i','c','e',' ','C','o','n','t','r','o','l',' ','F','i','l','t','e','r','s',0};
pMapper = mapvptr;
IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoInputDeviceCategory, MERIT_DO_NOT_USE, friendlyvidcap);
IFilterMapper2_CreateCategory(pMapper, &CLSID_LegacyAmFilterCategory, MERIT_NORMAL, friendlydshow);
IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoCompressorCategory, MERIT_DO_NOT_USE, friendlyvidcomp);
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioInputDeviceCategory, MERIT_DO_NOT_USE, friendlyaudcap);
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioCompressorCategory, MERIT_DO_NOT_USE, friendlyaudcomp);
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioRendererCategory, MERIT_NORMAL, friendlyaudrend);
IFilterMapper2_CreateCategory(pMapper, &CLSID_MidiRendererCategory, MERIT_NORMAL, friendlymidirend);
IFilterMapper2_CreateCategory(pMapper, &CLSID_TransmitCategory, MERIT_DO_NOT_USE, friendlyextrend);
IFilterMapper2_CreateCategory(pMapper, &CLSID_DeviceControlCategory, MERIT_DO_NOT_USE, friendlydevctrl);
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioCompressorCategory, MERIT_DO_NOT_USE, L"Audio Compressors");
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioInputDeviceCategory, MERIT_DO_NOT_USE, L"Audio Capture Sources");
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioRendererCategory, MERIT_NORMAL, L"Audio Renderers");
IFilterMapper2_CreateCategory(pMapper, &CLSID_DeviceControlCategory, MERIT_DO_NOT_USE, L"Device Control Filters");
IFilterMapper2_CreateCategory(pMapper, &CLSID_LegacyAmFilterCategory, MERIT_NORMAL, L"DirectShow Filters");
IFilterMapper2_CreateCategory(pMapper, &CLSID_MidiRendererCategory, MERIT_NORMAL, L"Midi Renderers");
IFilterMapper2_CreateCategory(pMapper, &CLSID_TransmitCategory, MERIT_DO_NOT_USE, L"External Renderers");
IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoInputDeviceCategory, MERIT_DO_NOT_USE, L"Video Capture Sources");
IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoCompressorCategory, MERIT_DO_NOT_USE, L"Video Compressors");
IFilterMapper2_Release(pMapper);
}
......
......@@ -61,19 +61,3 @@ HRESULT enum_moniker_create(REFCLSID class, IEnumMoniker **enum_mon) DECLSPEC_HI
extern ICreateDevEnum devenum_factory DECLSPEC_HIDDEN;
extern IParseDisplayName devenum_parser DECLSPEC_HIDDEN;
/**********************************************************************
* Global string constant declarations
*/
static const WCHAR backslashW[] = {'\\',0};
static const WCHAR clsidW[] = {'C','L','S','I','D',0};
static const WCHAR instanceW[] = {'\\','I','n','s','t','a','n','c','e',0};
static const WCHAR wszActiveMovieKey[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'A','c','t','i','v','e','M','o','v','i','e','\\',
'd','e','v','e','n','u','m','\\',0};
static const WCHAR deviceW[] = {'@','d','e','v','i','c','e',':',0};
static const WCHAR dmoW[] = {'d','m','o',':',0};
static const WCHAR swW[] = {'s','w',':',0};
static const WCHAR cmW[] = {'c','m',':',0};
......@@ -524,7 +524,7 @@ static HRESULT WINAPI moniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker
if (SUCCEEDED(IMoniker_GetDisplayName(iface, bind, NULL, &this_name)) &&
SUCCEEDED(IMoniker_GetDisplayName(pmkOtherMoniker, bind, NULL, &other_name)))
{
int result = lstrcmpiW(this_name, other_name);
int result = wcsicmp(this_name, other_name);
CoTaskMemFree(this_name);
CoTaskMemFree(other_name);
if (!result)
......@@ -603,33 +603,30 @@ static HRESULT WINAPI moniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc,
if (This->type == DEVICE_DMO)
{
buffer = CoTaskMemAlloc((lstrlenW(deviceW) + lstrlenW(dmoW)
+ 2 * CHARS_IN_GUID + 1) * sizeof(WCHAR));
buffer = CoTaskMemAlloc((12 + 2 * CHARS_IN_GUID + 1) * sizeof(WCHAR));
if (!buffer) return E_OUTOFMEMORY;
lstrcpyW(buffer, deviceW);
lstrcatW(buffer, dmoW);
StringFromGUID2(&This->clsid, buffer + lstrlenW(buffer), CHARS_IN_GUID);
StringFromGUID2(&This->class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
wcscpy(buffer, L"@device:dmo:");
StringFromGUID2(&This->clsid, buffer + wcslen(buffer), CHARS_IN_GUID);
StringFromGUID2(&This->class, buffer + wcslen(buffer), CHARS_IN_GUID);
}
else
{
buffer = CoTaskMemAlloc((lstrlenW(deviceW) + 3 + (This->has_class ? CHARS_IN_GUID : 0)
+ lstrlenW(This->name) + 1) * sizeof(WCHAR));
buffer = CoTaskMemAlloc((11 + (This->has_class ? CHARS_IN_GUID : 0)
+ wcslen(This->name) + 1) * sizeof(WCHAR));
if (!buffer) return E_OUTOFMEMORY;
lstrcpyW(buffer, deviceW);
if (This->type == DEVICE_FILTER)
lstrcatW(buffer, swW);
wcscpy(buffer, L"@device:sw:");
else if (This->type == DEVICE_CODEC)
lstrcatW(buffer, cmW);
wcscpy(buffer, L"@device:cm:");
if (This->has_class)
{
StringFromGUID2(&This->class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
lstrcatW(buffer, backslashW);
StringFromGUID2(&This->class, buffer + wcslen(buffer), CHARS_IN_GUID);
wcscat(buffer, L"\\");
}
lstrcatW(buffer, This->name);
wcscat(buffer, This->name);
}
*ppszDisplayName = buffer;
......@@ -958,15 +955,14 @@ HRESULT enum_moniker_create(REFCLSID class, IEnumMoniker **out)
object->ref = 1;
object->class = *class;
lstrcpyW(buffer, clsidW);
lstrcatW(buffer, backslashW);
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
lstrcatW(buffer, instanceW);
wcscpy(buffer, L"CLSID\\");
StringFromGUID2(class, buffer + wcslen(buffer), CHARS_IN_GUID);
wcscat(buffer, L"\\Instance");
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, buffer, 0, KEY_ENUMERATE_SUB_KEYS, &object->sw_key))
object->sw_key = NULL;
lstrcpyW(buffer, wszActiveMovieKey);
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
wcscpy(buffer, L"Software\\Microsoft\\ActiveMovie\\devenum\\");
StringFromGUID2(class, buffer + wcslen(buffer), CHARS_IN_GUID);
if (RegOpenKeyExW(HKEY_CURRENT_USER, buffer, 0, KEY_ENUMERATE_SUB_KEYS, &object->cm_key))
object->cm_key = NULL;
......
......@@ -77,21 +77,21 @@ static HRESULT WINAPI devenum_parser_ParseDisplayName(IParseDisplayName *iface,
*ret = NULL;
if (eaten)
*eaten = lstrlenW(name);
*eaten = wcslen(name);
name = wcschr(name, ':') + 1;
if (!wcsncmp(name, swW, 3))
if (!wcsncmp(name, L"sw:", 3))
{
type = DEVICE_FILTER;
name += 3;
}
else if (!wcsncmp(name, cmW, 3))
else if (!wcsncmp(name, L"cm:", 3))
{
type = DEVICE_CODEC;
name += 3;
}
else if (!wcsncmp(name, dmoW, 4))
else if (!wcsncmp(name, L"dmo:", 4))
{
type = DEVICE_DMO;
name += 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment