Commit 70d6d09f authored by Alexandre Julliard's avatar Alexandre Julliard

devenum: Build with msvcrt.

parent e432e4c2
......@@ -2,6 +2,8 @@ MODULE = devenum.dll
IMPORTS = strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo
DELAYIMPORTS = msvfw32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
createdevenum.c \
devenum_main.c \
......
......@@ -32,7 +32,6 @@
#include "dsound.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/heap.h"
#include "mmddk.h"
......@@ -120,17 +119,17 @@ static HRESULT register_codec(const GUID *class, const WCHAR *name,
if (FAILED(hr))
return hr;
buffer = heap_alloc((strlenW(deviceW) + CHARS_IN_GUID + strlenW(name) + 1) * sizeof(WCHAR));
buffer = heap_alloc((lstrlenW(deviceW) + CHARS_IN_GUID + lstrlenW(name) + 1) * sizeof(WCHAR));
if (!buffer)
{
IParseDisplayName_Release(parser);
return E_OUTOFMEMORY;
}
strcpyW(buffer, deviceW);
StringFromGUID2(class, buffer + strlenW(buffer), CHARS_IN_GUID);
strcatW(buffer, backslashW);
strcatW(buffer, name);
lstrcpyW(buffer, deviceW);
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
lstrcatW(buffer, backslashW);
lstrcatW(buffer, name);
IParseDisplayName_ParseDisplayName(parser, NULL, buffer, &eaten, &mon);
IParseDisplayName_Release(parser);
......@@ -454,9 +453,9 @@ static void register_legacy_filters(void)
if (FAILED(hr))
continue;
strcpyW(wszRegKey, clsidW);
strcatW(wszRegKey, backslashW);
strcatW(wszRegKey, wszFilterSubkeyName);
lstrcpyW(wszRegKey, clsidW);
lstrcatW(wszRegKey, backslashW);
lstrcatW(wszRegKey, wszFilterSubkeyName);
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, wszRegKey, 0, KEY_READ, &classkey) != ERROR_SUCCESS)
continue;
......@@ -524,11 +523,11 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons
if (guid)
{
WCHAR *name = heap_alloc(sizeof(defaultW) + strlenW(desc) * sizeof(WCHAR));
WCHAR *name = heap_alloc(sizeof(defaultW) + lstrlenW(desc) * sizeof(WCHAR));
if (!name)
return FALSE;
strcpyW(name, directsoundW);
strcatW(name, desc);
lstrcpyW(name, directsoundW);
lstrcatW(name, desc);
hr = register_codec(&CLSID_AudioRendererCategory, name,
&CLSID_DSoundRender, name, &prop_bag);
......@@ -910,9 +909,9 @@ static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID * clsidCategory)
HRESULT res = S_OK;
HKEY hkeyDummy = NULL;
strcpyW(wszRegKey, wszActiveMovieKey);
lstrcpyW(wszRegKey, wszActiveMovieKey);
if (!StringFromGUID2(clsidCategory, wszRegKey + strlenW(wszRegKey), ARRAY_SIZE(wszRegKey) - strlenW(wszRegKey)))
if (!StringFromGUID2(clsidCategory, wszRegKey + lstrlenW(wszRegKey), ARRAY_SIZE(wszRegKey) - lstrlenW(wszRegKey)))
res = E_INVALIDARG;
if (SUCCEEDED(res))
......
......@@ -40,10 +40,6 @@
#include "olectl.h"
#include "uuids.h"
#ifndef RC_INVOKED
#include "wine/unicode.h"
#endif
/**********************************************************************
* Dll lifetime tracking declaration for devenum.dll
*/
......
......@@ -137,7 +137,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
if (This->type == DEVICE_DMO)
{
if (!strcmpW(pszPropName, FriendlyNameW))
if (!lstrcmpW(pszPropName, FriendlyNameW))
{
res = DMOGetName(&This->clsid, name);
if (SUCCEEDED(res))
......@@ -346,25 +346,25 @@ static HRESULT create_PropertyBag(MediaCatMoniker *mon, IPropertyBag **ppBag)
rpb->clsid = mon->clsid;
else if (rpb->type == DEVICE_FILTER)
{
strcpyW(rpb->path, clsidW);
strcatW(rpb->path, backslashW);
lstrcpyW(rpb->path, clsidW);
lstrcatW(rpb->path, backslashW);
if (mon->has_class)
{
StringFromGUID2(&mon->class, rpb->path + strlenW(rpb->path), CHARS_IN_GUID);
strcatW(rpb->path, instanceW);
strcatW(rpb->path, backslashW);
StringFromGUID2(&mon->class, rpb->path + lstrlenW(rpb->path), CHARS_IN_GUID);
lstrcatW(rpb->path, instanceW);
lstrcatW(rpb->path, backslashW);
}
strcatW(rpb->path, mon->name);
lstrcatW(rpb->path, mon->name);
}
else if (rpb->type == DEVICE_CODEC)
{
strcpyW(rpb->path, wszActiveMovieKey);
lstrcpyW(rpb->path, wszActiveMovieKey);
if (mon->has_class)
{
StringFromGUID2(&mon->class, rpb->path + strlenW(rpb->path), CHARS_IN_GUID);
strcatW(rpb->path, backslashW);
StringFromGUID2(&mon->class, rpb->path + lstrlenW(rpb->path), CHARS_IN_GUID);
lstrcatW(rpb->path, backslashW);
}
strcatW(rpb->path, mon->name);
lstrcatW(rpb->path, mon->name);
}
*ppBag = &rpb->IPropertyBag_iface;
......@@ -705,33 +705,33 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetDisplayName(IMoniker *iface, I
if (This->type == DEVICE_DMO)
{
buffer = CoTaskMemAlloc((strlenW(deviceW) + strlenW(dmoW)
buffer = CoTaskMemAlloc((lstrlenW(deviceW) + lstrlenW(dmoW)
+ 2 * CHARS_IN_GUID + 1) * sizeof(WCHAR));
if (!buffer) return E_OUTOFMEMORY;
strcpyW(buffer, deviceW);
strcatW(buffer, dmoW);
StringFromGUID2(&This->clsid, buffer + strlenW(buffer), CHARS_IN_GUID);
StringFromGUID2(&This->class, buffer + strlenW(buffer), CHARS_IN_GUID);
lstrcpyW(buffer, deviceW);
lstrcatW(buffer, dmoW);
StringFromGUID2(&This->clsid, buffer + lstrlenW(buffer), CHARS_IN_GUID);
StringFromGUID2(&This->class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
}
else
{
buffer = CoTaskMemAlloc((strlenW(deviceW) + 3 + (This->has_class ? CHARS_IN_GUID : 0)
+ strlenW(This->name) + 1) * sizeof(WCHAR));
buffer = CoTaskMemAlloc((lstrlenW(deviceW) + 3 + (This->has_class ? CHARS_IN_GUID : 0)
+ lstrlenW(This->name) + 1) * sizeof(WCHAR));
if (!buffer) return E_OUTOFMEMORY;
strcpyW(buffer, deviceW);
lstrcpyW(buffer, deviceW);
if (This->type == DEVICE_FILTER)
strcatW(buffer, swW);
lstrcatW(buffer, swW);
else if (This->type == DEVICE_CODEC)
strcatW(buffer, cmW);
lstrcatW(buffer, cmW);
if (This->has_class)
{
StringFromGUID2(&This->class, buffer + strlenW(buffer), CHARS_IN_GUID);
strcatW(buffer, backslashW);
StringFromGUID2(&This->class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
lstrcatW(buffer, backslashW);
}
strcatW(buffer, This->name);
lstrcatW(buffer, This->name);
}
*ppszDisplayName = buffer;
......@@ -899,12 +899,12 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt,
pMoniker->type = DEVICE_FILTER;
if (!(pMoniker->name = CoTaskMemAlloc((strlenW(buffer) + 1) * sizeof(WCHAR))))
if (!(pMoniker->name = CoTaskMemAlloc((lstrlenW(buffer) + 1) * sizeof(WCHAR))))
{
IMoniker_Release(&pMoniker->IMoniker_iface);
return E_OUTOFMEMORY;
}
strcpyW(pMoniker->name, buffer);
lstrcpyW(pMoniker->name, buffer);
}
/* then try codecs */
else if (!(res = RegEnumKeyW(This->cm_key, This->cm_index, buffer, ARRAY_SIZE(buffer))))
......@@ -919,12 +919,12 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt,
pMoniker->type = DEVICE_CODEC;
if (!(pMoniker->name = CoTaskMemAlloc((strlenW(buffer) + 1) * sizeof(WCHAR))))
if (!(pMoniker->name = CoTaskMemAlloc((lstrlenW(buffer) + 1) * sizeof(WCHAR))))
{
IMoniker_Release(&pMoniker->IMoniker_iface);
return E_OUTOFMEMORY;
}
strcpyW(pMoniker->name, buffer);
lstrcpyW(pMoniker->name, buffer);
}
else
break;
......@@ -1026,15 +1026,15 @@ HRESULT create_EnumMoniker(REFCLSID class, IEnumMoniker **ppEnumMoniker)
pEnumMoniker->cm_index = 0;
pEnumMoniker->class = *class;
strcpyW(buffer, clsidW);
strcatW(buffer, backslashW);
StringFromGUID2(class, buffer + strlenW(buffer), CHARS_IN_GUID);
strcatW(buffer, instanceW);
lstrcpyW(buffer, clsidW);
lstrcatW(buffer, backslashW);
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
lstrcatW(buffer, instanceW);
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, buffer, 0, KEY_ENUMERATE_SUB_KEYS, &pEnumMoniker->sw_key))
pEnumMoniker->sw_key = NULL;
strcpyW(buffer, wszActiveMovieKey);
StringFromGUID2(class, buffer + strlenW(buffer), CHARS_IN_GUID);
lstrcpyW(buffer, wszActiveMovieKey);
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
if (RegOpenKeyExW(HKEY_CURRENT_USER, buffer, 0, KEY_ENUMERATE_SUB_KEYS, &pEnumMoniker->cm_key))
pEnumMoniker->cm_key = NULL;
......
......@@ -87,21 +87,21 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(IParseDisplayNa
*ret = NULL;
if (eaten)
*eaten = strlenW(name);
*eaten = lstrlenW(name);
name = strchrW(name, ':') + 1;
name = wcschr(name, ':') + 1;
if (!strncmpW(name, swW, 3))
if (!wcsncmp(name, swW, 3))
{
type = DEVICE_FILTER;
name += 3;
}
else if (!strncmpW(name, cmW, 3))
else if (!wcsncmp(name, cmW, 3))
{
type = DEVICE_CODEC;
name += 3;
}
else if (!strncmpW(name, dmoW, 4))
else if (!wcsncmp(name, dmoW, 4))
{
type = DEVICE_DMO;
name += 4;
......@@ -141,12 +141,12 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(IParseDisplayNa
name += CHARS_IN_GUID;
}
if (!(mon->name = CoTaskMemAlloc((strlenW(name) + 1) * sizeof(WCHAR))))
if (!(mon->name = CoTaskMemAlloc((lstrlenW(name) + 1) * sizeof(WCHAR))))
{
IMoniker_Release(&mon->IMoniker_iface);
return E_OUTOFMEMORY;
}
strcpyW(mon->name, name);
lstrcpyW(mon->name, name);
}
mon->type = type;
......
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