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

amstream: Use wide character string literals.

parent d4bf8b2a
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(amstream); WINE_DEFAULT_DEBUG_CHANNEL(amstream);
static const WCHAR sink_id[] = {'I','{','A','3','5','F','F','5','6','B', static const WCHAR sink_id[] = L"I{A35FF56B-9FDA-11D0-8FDF-00C04FD9189D}";
'-','9','F','D','A','-','1','1','D','0','-','8','F','D','F',
'-','0','0','C','0','4','F','D','9','1','8','9','D','}',0};
typedef struct { typedef struct {
IAudioStreamSample IAudioStreamSample_iface; IAudioStreamSample IAudioStreamSample_iface;
...@@ -811,7 +809,7 @@ static HRESULT WINAPI audio_sink_QueryPinInfo(IPin *iface, PIN_INFO *info) ...@@ -811,7 +809,7 @@ static HRESULT WINAPI audio_sink_QueryPinInfo(IPin *iface, PIN_INFO *info)
IBaseFilter_AddRef(info->pFilter = (IBaseFilter *)stream->filter); IBaseFilter_AddRef(info->pFilter = (IBaseFilter *)stream->filter);
info->dir = PINDIR_INPUT; info->dir = PINDIR_INPUT;
lstrcpyW(info->achName, sink_id); wcscpy(info->achName, sink_id);
return S_OK; return S_OK;
} }
...@@ -830,7 +828,7 @@ static HRESULT WINAPI audio_sink_QueryId(IPin *iface, WCHAR **id) ...@@ -830,7 +828,7 @@ static HRESULT WINAPI audio_sink_QueryId(IPin *iface, WCHAR **id)
if (!(*id = CoTaskMemAlloc(sizeof(sink_id)))) if (!(*id = CoTaskMemAlloc(sizeof(sink_id))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
lstrcpyW(*id, sink_id); wcscpy(*id, sink_id);
return S_OK; return S_OK;
} }
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(amstream); WINE_DEFAULT_DEBUG_CHANNEL(amstream);
static const WCHAR sink_id[] = {'I','{','A','3','5','F','F','5','6','A', static const WCHAR sink_id[] = L"I{A35FF56A-9FDA-11D0-8FDF-00C04FD9189D}";
'-','9','F','D','A','-','1','1','D','0','-','8','F','D','F',
'-','0','0','C','0','4','F','D','9','1','8','9','D','}',0};
static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface, static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface,
const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample); const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample);
...@@ -744,7 +742,7 @@ static HRESULT WINAPI ddraw_sink_QueryPinInfo(IPin *iface, PIN_INFO *info) ...@@ -744,7 +742,7 @@ static HRESULT WINAPI ddraw_sink_QueryPinInfo(IPin *iface, PIN_INFO *info)
IBaseFilter_AddRef(info->pFilter = (IBaseFilter *)stream->filter); IBaseFilter_AddRef(info->pFilter = (IBaseFilter *)stream->filter);
info->dir = PINDIR_INPUT; info->dir = PINDIR_INPUT;
lstrcpyW(info->achName, sink_id); wcscpy(info->achName, sink_id);
return S_OK; return S_OK;
} }
...@@ -763,7 +761,7 @@ static HRESULT WINAPI ddraw_sink_QueryId(IPin *iface, WCHAR **id) ...@@ -763,7 +761,7 @@ static HRESULT WINAPI ddraw_sink_QueryId(IPin *iface, WCHAR **id)
if (!(*id = CoTaskMemAlloc(sizeof(sink_id)))) if (!(*id = CoTaskMemAlloc(sizeof(sink_id))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
lstrcpyW(*id, sink_id); wcscpy(*id, sink_id);
return S_OK; return S_OK;
} }
......
...@@ -364,7 +364,7 @@ static HRESULT WINAPI filter_FindPin(IMediaStreamFilter *iface, const WCHAR *id, ...@@ -364,7 +364,7 @@ static HRESULT WINAPI filter_FindPin(IMediaStreamFilter *iface, const WCHAR *id,
if (SUCCEEDED(IPin_QueryId(pin, &ret_id))) if (SUCCEEDED(IPin_QueryId(pin, &ret_id)))
{ {
if (!lstrcmpW(id, ret_id)) if (!wcscmp(id, ret_id))
{ {
CoTaskMemFree(ret_id); CoTaskMemFree(ret_id);
*out = pin; *out = pin;
...@@ -389,7 +389,7 @@ static HRESULT WINAPI filter_QueryFilterInfo(IMediaStreamFilter *iface, FILTER_I ...@@ -389,7 +389,7 @@ static HRESULT WINAPI filter_QueryFilterInfo(IMediaStreamFilter *iface, FILTER_I
EnterCriticalSection(&filter->cs); EnterCriticalSection(&filter->cs);
lstrcpyW(info->achName, filter->name); wcscpy(info->achName, filter->name);
if (filter->graph) if (filter->graph)
IFilterGraph_AddRef(filter->graph); IFilterGraph_AddRef(filter->graph);
info->pGraph = filter->graph; info->pGraph = filter->graph;
...@@ -409,7 +409,7 @@ static HRESULT WINAPI filter_JoinFilterGraph(IMediaStreamFilter *iface, ...@@ -409,7 +409,7 @@ static HRESULT WINAPI filter_JoinFilterGraph(IMediaStreamFilter *iface,
EnterCriticalSection(&filter->cs); EnterCriticalSection(&filter->cs);
if (name) if (name)
lstrcpynW(filter->name, name, ARRAY_SIZE(filter->name)); wcsncpy(filter->name, name, ARRAY_SIZE(filter->name));
else else
filter->name[0] = 0; filter->name[0] = 0;
filter->graph = graph; filter->graph = graph;
......
...@@ -198,7 +198,6 @@ static HRESULT WINAPI multimedia_stream_GetEndOfStream(IAMMultiMediaStream *ifac ...@@ -198,7 +198,6 @@ static HRESULT WINAPI multimedia_stream_GetEndOfStream(IAMMultiMediaStream *ifac
static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface, static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface,
STREAM_TYPE StreamType, DWORD dwFlags, IGraphBuilder *pFilterGraph) STREAM_TYPE StreamType, DWORD dwFlags, IGraphBuilder *pFilterGraph)
{ {
static const WCHAR filternameW[] = {'M','e','d','i','a','S','t','r','e','a','m','F','i','l','t','e','r',0};
struct multimedia_stream *This = impl_from_IAMMultiMediaStream(iface); struct multimedia_stream *This = impl_from_IAMMultiMediaStream(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
...@@ -221,7 +220,7 @@ static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface, ...@@ -221,7 +220,7 @@ static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface,
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control); hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = IGraphBuilder_AddFilter(This->pFilterGraph, (IBaseFilter*)This->filter, filternameW); hr = IGraphBuilder_AddFilter(This->pFilterGraph, (IBaseFilter*)This->filter, L"MediaStreamFilter");
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
IMediaEventEx* media_event = NULL; IMediaEventEx* media_event = NULL;
...@@ -342,7 +341,6 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac ...@@ -342,7 +341,6 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac
static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface, static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface,
const WCHAR *filename, DWORD flags) const WCHAR *filename, DWORD flags)
{ {
static const WCHAR sourceW[] = {'S','o','u','r','c','e',0};
struct multimedia_stream *This = impl_from_IAMMultiMediaStream(iface); struct multimedia_stream *This = impl_from_IAMMultiMediaStream(iface);
HRESULT ret = S_OK; HRESULT ret = S_OK;
IBaseFilter *BaseFilter = NULL; IBaseFilter *BaseFilter = NULL;
...@@ -360,7 +358,7 @@ static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface, ...@@ -360,7 +358,7 @@ static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface,
ret = IAMMultiMediaStream_Initialize(iface, STREAMTYPE_READ, 0, NULL); ret = IAMMultiMediaStream_Initialize(iface, STREAMTYPE_READ, 0, NULL);
if (SUCCEEDED(ret)) if (SUCCEEDED(ret))
ret = IGraphBuilder_AddSourceFilter(This->pFilterGraph, filename, sourceW, &BaseFilter); ret = IGraphBuilder_AddSourceFilter(This->pFilterGraph, filename, L"Source", &BaseFilter);
if (SUCCEEDED(ret)) if (SUCCEEDED(ret))
ret = IBaseFilter_EnumPins(BaseFilter, &EnumPins); ret = IBaseFilter_EnumPins(BaseFilter, &EnumPins);
......
...@@ -28,12 +28,8 @@ ...@@ -28,12 +28,8 @@
#include "initguid.h" #include "initguid.h"
#include "ksmedia.h" #include "ksmedia.h"
static const WCHAR primary_video_sink_id[] = {'I','{','A','3','5','F','F','5','6','A', static const WCHAR primary_video_sink_id[] = L"I{A35FF56A-9FDA-11D0-8FDF-00C04FD9189D}";
'-','9','F','D','A','-','1','1','D','0','-','8','F','D','F', static const WCHAR primary_audio_sink_id[] = L"I{A35FF56B-9FDA-11D0-8FDF-00C04FD9189D}";
'-','0','0','C','0','4','F','D','9','1','8','9','D','}',0};
static const WCHAR primary_audio_sink_id[] = {'I','{','A','3','5','F','F','5','6','B',
'-','9','F','D','A','-','1','1','D','0','-','8','F','D','F',
'-','0','0','C','0','4','F','D','9','1','8','9','D','}',0};
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
static void _expect_ref(IUnknown* obj, ULONG ref, int line) static void _expect_ref(IUnknown* obj, ULONG ref, int line)
...@@ -44,8 +40,6 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line) ...@@ -44,8 +40,6 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
} }
static const WCHAR filenameW[] = {'t','e','s','t','.','a','v','i',0};
static IDirectDraw7* pdd7; static IDirectDraw7* pdd7;
static IDirectDrawSurface7* pdds7; static IDirectDrawSurface7* pdds7;
...@@ -229,7 +223,7 @@ static void test_openfile(void) ...@@ -229,7 +223,7 @@ static void test_openfile(void)
if (pgraph) if (pgraph)
IGraphBuilder_Release(pgraph); IGraphBuilder_Release(pgraph);
hr = IAMMultiMediaStream_OpenFile(pams, filenameW, 0); hr = IAMMultiMediaStream_OpenFile(pams, L"test.avi", 0);
ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr); ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr);
hr = IAMMultiMediaStream_GetFilterGraph(pams, &pgraph); hr = IAMMultiMediaStream_GetFilterGraph(pams, &pgraph);
...@@ -269,7 +263,7 @@ static void test_renderfile(void) ...@@ -269,7 +263,7 @@ static void test_renderfile(void)
hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, AMMSF_ADDDEFAULTRENDERER, NULL); hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, AMMSF_ADDDEFAULTRENDERER, NULL);
ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr);
hr = IAMMultiMediaStream_OpenFile(pams, filenameW, 0); hr = IAMMultiMediaStream_OpenFile(pams, L"test.avi", 0);
ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr); ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr);
hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &pvidstream); hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &pvidstream);
...@@ -1256,7 +1250,7 @@ static void test_pin_info(void) ...@@ -1256,7 +1250,7 @@ static void test_pin_info(void)
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == (IBaseFilter *)filter, "Expected filter %p, got %p.\n", filter, info.pFilter); ok(info.pFilter == (IBaseFilter *)filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir); ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
ok(!lstrcmpW(info.achName, primary_video_sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName)); ok(!wcscmp(info.achName, primary_video_sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
IBaseFilter_Release(info.pFilter); IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir); hr = IPin_QueryDirection(pin, &dir);
...@@ -1265,7 +1259,7 @@ static void test_pin_info(void) ...@@ -1265,7 +1259,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id); hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!lstrcmpW(id, primary_video_sink_id), "Got id %s.\n", wine_dbgstr_w(id)); ok(!wcscmp(id, primary_video_sink_id), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id); CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, &count); hr = IPin_QueryInternalConnections(pin, NULL, &count);
...@@ -1283,7 +1277,7 @@ static void test_pin_info(void) ...@@ -1283,7 +1277,7 @@ static void test_pin_info(void)
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == (IBaseFilter *)filter, "Expected filter %p, got %p.\n", filter, info.pFilter); ok(info.pFilter == (IBaseFilter *)filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir); ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
ok(!lstrcmpW(info.achName, primary_audio_sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName)); ok(!wcscmp(info.achName, primary_audio_sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
IBaseFilter_Release(info.pFilter); IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir); hr = IPin_QueryDirection(pin, &dir);
...@@ -1292,7 +1286,7 @@ static void test_pin_info(void) ...@@ -1292,7 +1286,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id); hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!lstrcmpW(id, primary_audio_sink_id), "Got id %s.\n", wine_dbgstr_w(id)); ok(!wcscmp(id, primary_audio_sink_id), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id); CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, &count); hr = IPin_QueryInternalConnections(pin, NULL, &count);
...@@ -1487,8 +1481,6 @@ static const IFilterGraph2Vtbl graph_vtbl = ...@@ -1487,8 +1481,6 @@ static const IFilterGraph2Vtbl graph_vtbl =
static void test_initialize(void) static void test_initialize(void)
{ {
static const WCHAR expectW[] = {'M','e','d','i','a','S','t','r','e','a','m','F','i','l','t','e','r',0};
IAMMultiMediaStream *mmstream = create_ammultimediastream(); IAMMultiMediaStream *mmstream = create_ammultimediastream();
IFilterGraph2 graph = {&graph_vtbl}; IFilterGraph2 graph = {&graph_vtbl};
IMediaStreamFilter *filter; IMediaStreamFilter *filter;
...@@ -1634,7 +1626,7 @@ static void test_initialize(void) ...@@ -1634,7 +1626,7 @@ static void test_initialize(void)
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(got_add_filter == 1, "Got %d calls to IGraphBuilder::AddFilter().\n", got_add_filter); ok(got_add_filter == 1, "Got %d calls to IGraphBuilder::AddFilter().\n", got_add_filter);
ok(graph_filter == (IBaseFilter *)filter, "Got filter %p.\n", filter); ok(graph_filter == (IBaseFilter *)filter, "Got filter %p.\n", filter);
ok(!wcscmp(graph_filter_name, expectW), "Got unexpected name %s.\n", wine_dbgstr_w(graph_filter_name)); ok(!wcscmp(graph_filter_name, L"MediaStreamFilter"), "Got unexpected name %s.\n", wine_dbgstr_w(graph_filter_name));
hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph); hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
...@@ -2318,7 +2310,7 @@ START_TEST(amstream) ...@@ -2318,7 +2310,7 @@ START_TEST(amstream)
test_media_types(); test_media_types();
test_IDirectDrawStreamSample(); test_IDirectDrawStreamSample();
file = CreateFileW(filenameW, 0, 0, NULL, OPEN_EXISTING, 0, NULL); file = CreateFileW(L"test.avi", 0, 0, NULL, OPEN_EXISTING, 0, NULL);
if (file != INVALID_HANDLE_VALUE) if (file != INVALID_HANDLE_VALUE)
{ {
CloseHandle(file); CloseHandle(file);
......
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