Wine-devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 5 participants
- 84522 discussions
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/qedit/Makefile.in | 1 -
dlls/qedit/mediadet.c | 40 ++++++++++++++--------------
dlls/qedit/samplegrabber.c | 14 ++++++----
dlls/qedit/timeline.c | 54 +++++++++++++++++++-------------------
4 files changed, 56 insertions(+), 53 deletions(-)
diff --git a/dlls/qedit/Makefile.in b/dlls/qedit/Makefile.in
index 7b0eea3c592..f9b6f5c3ed9 100644
--- a/dlls/qedit/Makefile.in
+++ b/dlls/qedit/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = qedit.dll
IMPORTS = strmiids strmbase uuid oleaut32 ole32 advapi32
diff --git a/dlls/qedit/mediadet.c b/dlls/qedit/mediadet.c
index cdf2ea8ee5b..5fbd931f3f8 100644
--- a/dlls/qedit/mediadet.c
+++ b/dlls/qedit/mediadet.c
@@ -79,7 +79,7 @@ static HRESULT get_filter_info(IMoniker *moniker, GUID *clsid, VARIANT *var)
if (FAILED(hr = IMoniker_BindToStorage(moniker, NULL, NULL, &IID_IPropertyBag, (void **)&prop_bag)))
{
- ERR("Failed to get property bag, hr %#x.\n", hr);
+ ERR("Failed to get property bag, hr %#lx.\n", hr);
return hr;
}
@@ -87,7 +87,7 @@ static HRESULT get_filter_info(IMoniker *moniker, GUID *clsid, VARIANT *var)
V_VT(var) = VT_BSTR;
if (FAILED(hr = IPropertyBag_Read(prop_bag, L"CLSID", var, NULL)))
{
- ERR("Failed to get CLSID, hr %#x.\n", hr);
+ ERR("Failed to get CLSID, hr %#lx.\n", hr);
IPropertyBag_Release(prop_bag);
return hr;
}
@@ -95,7 +95,7 @@ static HRESULT get_filter_info(IMoniker *moniker, GUID *clsid, VARIANT *var)
VariantClear(var);
if (FAILED(hr = IPropertyBag_Read(prop_bag, L"FriendlyName", var, NULL)))
- ERR("Failed to get name, hr %#x.\n", hr);
+ ERR("Failed to get name, hr %#lx.\n", hr);
IPropertyBag_Release(prop_bag);
return hr;
@@ -135,20 +135,20 @@ static HRESULT find_splitter(MediaDetImpl *detector)
if (FAILED(hr = IBaseFilter_EnumPins(detector->source, &enum_pins)))
{
- ERR("Failed to enumerate source pins, hr %#x.\n", hr);
+ ERR("Failed to enumerate source pins, hr %#lx.\n", hr);
return hr;
}
hr = IEnumPins_Next(enum_pins, 1, &source_pin, NULL);
IEnumPins_Release(enum_pins);
if (hr != S_OK)
{
- ERR("Failed to get source pin, hr %#x.\n", hr);
+ ERR("Failed to get source pin, hr %#lx.\n", hr);
return hr;
}
if (FAILED(hr = get_pin_media_type(source_pin, &mt)))
{
- ERR("Failed to get media type, hr %#x.\n", hr);
+ ERR("Failed to get media type, hr %#lx.\n", hr);
IPin_Release(source_pin);
return hr;
}
@@ -248,28 +248,28 @@ static HRESULT WINAPI MediaDet_inner_QueryInterface(IUnknown *iface, REFIID riid
static ULONG WINAPI MediaDet_inner_AddRef(IUnknown *iface)
{
- MediaDetImpl *This = impl_from_IUnknown(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
+ MediaDetImpl *detector = impl_from_IUnknown(iface);
+ ULONG refcount = InterlockedIncrement(&detector->ref);
- TRACE("(%p) new ref = %u\n", This, ref);
+ TRACE("%p increasing refcount to %lu.\n", detector, refcount);
- return ref;
+ return refcount;
}
static ULONG WINAPI MediaDet_inner_Release(IUnknown *iface)
{
- MediaDetImpl *This = impl_from_IUnknown(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
+ MediaDetImpl *detector = impl_from_IUnknown(iface);
+ ULONG refcount = InterlockedDecrement(&detector->ref);
- TRACE("(%p) new ref = %u\n", This, ref);
+ TRACE("%p decreasing refcount to %lu.\n", detector, refcount);
- if (ref == 0)
+ if (!refcount)
{
- MD_cleanup(This);
- CoTaskMemFree(This);
+ MD_cleanup(detector);
+ CoTaskMemFree(detector);
}
- return ref;
+ return refcount;
}
static const IUnknownVtbl mediadet_vtbl =
@@ -464,7 +464,7 @@ static HRESULT WINAPI MediaDet_put_CurrentStream(IMediaDet* iface, LONG newVal)
MediaDetImpl *This = impl_from_IMediaDet(iface);
HRESULT hr;
- TRACE("(%p)->(%d)\n", This, newVal);
+ TRACE("detector %p, index %ld.\n", This, newVal);
if (This->num_streams == -1)
{
@@ -623,7 +623,7 @@ static HRESULT WINAPI MediaDet_GetBitmapBits(IMediaDet* iface,
LONG Width, LONG Height)
{
MediaDetImpl *This = impl_from_IMediaDet(iface);
- FIXME("(%p)->(%f %p %p %d %d): not implemented!\n", This, StreamTime, pBufferSize, pBuffer,
+ FIXME("(%p)->(%.16e %p %p %ld %ld): not implemented!\n", This, StreamTime, pBufferSize, pBuffer,
Width, Height);
return E_NOTIMPL;
}
@@ -633,7 +633,7 @@ static HRESULT WINAPI MediaDet_WriteBitmapBits(IMediaDet* iface,
LONG Height, BSTR Filename)
{
MediaDetImpl *This = impl_from_IMediaDet(iface);
- FIXME("(%p)->(%f %d %d %p): not implemented!\n", This, StreamTime, Width, Height, Filename);
+ FIXME("(%p)->(%.16e %ld %ld %p): not implemented!\n", This, StreamTime, Width, Height, Filename);
return E_NOTIMPL;
}
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c
index d1b974d3d5d..a89229c4447 100644
--- a/dlls/qedit/samplegrabber.c
+++ b/dlls/qedit/samplegrabber.c
@@ -163,7 +163,7 @@ static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sa
ref = IMediaSample_Release(sample) + 1 - ref;
if (ref)
{
- ERR("(%p) Callback referenced sample %p by %u\n", This, sample, ref);
+ ERR("(%p) Callback referenced sample %p by %lu\n", This, sample, ref);
/* ugly as hell but some apps are sooo buggy */
while (ref--)
IMediaSample_Release(sample);
@@ -181,7 +181,7 @@ static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sa
case -1:
break;
default:
- FIXME("unsupported method %d\n", This->grabberMethod);
+ FIXME("Unknown method %ld.\n", This->grabberMethod);
/* do not bother us again */
This->grabberMethod = -1;
}
@@ -315,7 +315,9 @@ static HRESULT WINAPI
SampleGrabber_ISampleGrabber_SetCallback(ISampleGrabber *iface, ISampleGrabberCB *cb, LONG whichMethod)
{
struct sample_grabber *This = impl_from_ISampleGrabber(iface);
- TRACE("(%p)->(%p, %u)\n", This, cb, whichMethod);
+
+ TRACE("filter %p, callback %p, method %ld.\n", This, cb, whichMethod);
+
if (This->grabberIface)
ISampleGrabberCB_Release(This->grabberIface);
This->grabberIface = cb;
@@ -413,7 +415,9 @@ SampleGrabber_IMemInputPin_ReceiveMultiple(IMemInputPin *iface, IMediaSample **s
{
struct sample_grabber *This = impl_from_IMemInputPin(iface);
LONG idx;
- TRACE("(%p)->(%p, %u, %p) output = %p, grabber = %p\n", This, samples, nSamples, nProcessed, This->source.pMemInputPin, This->grabberIface);
+
+ TRACE("filter %p, samples %p, count %lu, ret_count %p.\n", This, samples, nSamples, nProcessed);
+
if (!samples || !nProcessed)
return E_POINTER;
if ((This->filter.state != State_Running) || (This->oneShot == OneShot_Past))
@@ -615,7 +619,7 @@ static HRESULT WINAPI sample_grabber_source_DecideAllocator(struct strmbase_sour
if (FAILED(hr = IFilterGraph_QueryInterface(filter->filter.graph,
&IID_IFilterGraph2, (void **)&graph)))
{
- ERR("Failed to get IFilterGraph2 interface, hr %#x.\n", hr);
+ ERR("Failed to get IFilterGraph2 interface, hr %#lx.\n", hr);
return hr;
}
diff --git a/dlls/qedit/timeline.c b/dlls/qedit/timeline.c
index 3a4ed5c017e..c084ecc6c2e 100644
--- a/dlls/qedit/timeline.c
+++ b/dlls/qedit/timeline.c
@@ -97,25 +97,25 @@ static HRESULT WINAPI Timeline_QueryInterface(IUnknown *iface, REFIID riid, void
static ULONG WINAPI Timeline_AddRef(IUnknown *iface)
{
- TimelineImpl *This = impl_from_IUnknown(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
+ TimelineImpl *timeline = impl_from_IUnknown(iface);
+ ULONG refcount = InterlockedIncrement(&timeline->ref);
- TRACE("(%p) new ref = %u\n", This, ref);
+ TRACE("%p increasing refcount to %lu.\n", timeline, refcount);
- return ref;
+ return refcount;
}
static ULONG WINAPI Timeline_Release(IUnknown *iface)
{
- TimelineImpl *This = impl_from_IUnknown(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
+ TimelineImpl *timeline = impl_from_IUnknown(iface);
+ ULONG refcount = InterlockedDecrement(&timeline->ref);
- TRACE("(%p) new ref = %u\n", This, ref);
+ TRACE("%p decreasing refcount to %lu.\n", timeline, refcount);
- if (ref == 0)
- CoTaskMemFree(This);
+ if (!refcount)
+ CoTaskMemFree(timeline);
- return ref;
+ return refcount;
}
static const IUnknownVtbl timeline_vtbl =
@@ -201,7 +201,7 @@ static HRESULT WINAPI Timeline_IAMTimeline_RemGroupFromList(IAMTimeline *iface,
static HRESULT WINAPI Timeline_IAMTimeline_GetGroup(IAMTimeline *iface, IAMTimelineObj **group, LONG index)
{
TimelineImpl *This = impl_from_IAMTimeline(iface);
- FIXME("(%p)->(%p,%d): not implemented!\n", This, group, index);
+ FIXME("(%p)->(%p,%ld): not implemented!\n", This, group, index);
return E_NOTIMPL;
}
@@ -229,7 +229,7 @@ static HRESULT WINAPI Timeline_IAMTimeline_GetInsertMode(IAMTimeline *iface, LON
static HRESULT WINAPI Timeline_IAMTimeline_SetInsertMode(IAMTimeline *iface, LONG mode)
{
TimelineImpl *This = impl_from_IAMTimeline(iface);
- FIXME("(%p)->(%d): not implemented!\n", This, mode);
+ FIXME("(%p)->(%ld): not implemented!\n", This, mode);
return E_NOTIMPL;
}
@@ -317,7 +317,7 @@ static HRESULT WINAPI Timeline_IAMTimeline_GetCountOfType(IAMTimeline *iface, LO
LONG *value_with_comps, TIMELINE_MAJOR_TYPE type)
{
TimelineImpl *This = impl_from_IAMTimeline(iface);
- FIXME("(%p)->(%d,%p,%p,%04x): not implemented!\n", This, group, value, value_with_comps, type);
+ FIXME("(%p)->(%ld,%p,%p,%#x): not implemented!\n", This, group, value, value_with_comps, type);
return E_NOTIMPL;
}
@@ -325,7 +325,7 @@ static HRESULT WINAPI Timeline_IAMTimeline_ValidateSourceNames(IAMTimeline *ifac
LONG_PTR notify_event)
{
TimelineImpl *This = impl_from_IAMTimeline(iface);
- FIXME("(%p)->(%d,%p,%lx): not implemented!\n", This, flags, override, notify_event);
+ FIXME("(%p)->(%ld,%p,%#Ix): not implemented!\n", This, flags, override, notify_event);
return E_NOTIMPL;
}
@@ -475,25 +475,25 @@ static HRESULT WINAPI TimelineObj_QueryInterface(IAMTimelineObj *iface, REFIID r
static ULONG WINAPI TimelineObj_AddRef(IAMTimelineObj *iface)
{
- TimelineObjImpl *This = impl_from_IAMTimelineObj(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
+ TimelineObjImpl *obj = impl_from_IAMTimelineObj(iface);
+ ULONG refcount = InterlockedIncrement(&obj->ref);
- TRACE("(%p) new ref = %u\n", This, ref);
+ TRACE("%p increasing refcount to %lu.\n", obj, refcount);
- return ref;
+ return refcount;
}
static ULONG WINAPI TimelineObj_Release(IAMTimelineObj *iface)
{
- TimelineObjImpl *This = impl_from_IAMTimelineObj(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
+ TimelineObjImpl *obj = impl_from_IAMTimelineObj(iface);
+ ULONG refcount = InterlockedDecrement(&obj->ref);
- TRACE("(%p) new ref = %u\n", This, ref);
+ TRACE("%p decreasing refcount to %lu.\n", obj, refcount);
- if (!ref)
- CoTaskMemFree(This);
+ if (!refcount)
+ CoTaskMemFree(obj);
- return ref;
+ return refcount;
}
static HRESULT WINAPI TimelineObj_GetStartStop(IAMTimelineObj *iface, REFERENCE_TIME *start, REFERENCE_TIME *stop)
@@ -629,7 +629,7 @@ static HRESULT WINAPI TimelineObj_GetUserID(IAMTimelineObj *iface, LONG *id)
static HRESULT WINAPI TimelineObj_SetUserID(IAMTimelineObj *iface, LONG id)
{
TimelineObjImpl *This = impl_from_IAMTimelineObj(iface);
- FIXME("(%p)->(%d): not implemented!\n", This, id);
+ FIXME("(%p)->(%ld): not implemented!\n", This, id);
return E_NOTIMPL;
}
@@ -664,7 +664,7 @@ static HRESULT WINAPI TimelineObj_GetUserData(IAMTimelineObj *iface, BYTE *data,
static HRESULT WINAPI TimelineObj_SetUserData(IAMTimelineObj *iface, BYTE *data, LONG size)
{
TimelineObjImpl *This = impl_from_IAMTimelineObj(iface);
- FIXME("(%p)->(%p,%d): not implemented!\n", This, data, size);
+ FIXME("(%p)->(%p,%ld): not implemented!\n", This, data, size);
return E_NOTIMPL;
}
@@ -912,7 +912,7 @@ static HRESULT WINAPI timelinegrp_GetPreviewMode(IAMTimelineGroup *iface, BOOL *
static HRESULT WINAPI timelinegrp_SetMediaTypeForVB(IAMTimelineGroup *iface, LONG type)
{
TimelineObjImpl *This = impl_from_IAMTimelineGroup(iface);
- FIXME("(%p)->(%d)\n", This, type);
+ FIXME("(%p)->(%ld)\n", This, type);
return E_NOTIMPL;
}
--
2.34.1
1
0
[PATCH 1/5] winepulse.drv: Expose audio devices to the application.
by Gabriel Ivăncescu 09 Feb '22
by Gabriel Ivăncescu 09 Feb '22
09 Feb '22
This exposes the actual devices (and virtual sinks/sources) as reported by
PulseAudio to an application, allowing it to select the devices itself and,
for example, record from (or render to) two devices at the same time. The
"PulseAudio" device (which is movable) is still the default, as before.
It keeps a list of the devices on the unixlib side, which then stores the
device type, pulse name and display (friendly) name into the registry,
for persistent settings of an app to identify the device by guid. The
keys are stored under HKLM\Software\Wine\Drivers\winepulse.drv\devices,
with the following format:
<type>,<pulse device name>
Where <type> is a single character, which is either 0 (for output/sinks)
or 1 (for input/sources), and <pulse device name> is the device name that
PulseAudio uses to identify the device. The "name" value is stored under
this key which is the display name of the device. When enumerating the
devices, the "name" is taken and a GUID is generated if it's missing or
invalid under the "guid" value of the same key; this preserves the GUID
for the same device unless the registry key is cleaned.
Based on a patch by Mark Harmstone <mark(a)harmstone.com>, with changes by
Sebastian Lackner <sebastian(a)fds-team.de>.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
This patchset has lived in wine-staging for a long time, but has been
recently rebased to deal with unixlib separation.
dlls/winepulse.drv/mmdevdrv.c | 184 ++++++++++++++++++++++++++++------
dlls/winepulse.drv/pulse.c | 176 ++++++++++++++++++++++++++++++--
dlls/winepulse.drv/unixlib.h | 1 +
3 files changed, 320 insertions(+), 41 deletions(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index 35a66e1..bf14324 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -134,6 +134,7 @@ struct ACImpl {
IUnknown *marshal;
IMMDevice *parent;
struct list entry;
+ char device[256];
float *vol;
LONG ref;
@@ -147,8 +148,6 @@ struct ACImpl {
AudioSessionWrapper *session_wrapper;
};
-static const WCHAR defaultW[] = L"PulseAudio";
-
static const IAudioClient3Vtbl AudioClient3_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
@@ -267,39 +266,96 @@ static void set_stream_volumes(ACImpl *This)
pulse_call(set_volumes, ¶ms);
}
-HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, const WCHAR ***ids, GUID **keys,
+HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **keys,
UINT *num, UINT *def_index)
{
- WCHAR *id;
+ WCHAR flow_char = (flow == eRender) ? '0' : '1';
+ DWORD i, k = 0, count = 0, maxlen, size, type;
+ WCHAR *id, *key_name = NULL;
+ HKEY dev_key, key = NULL;
+ LSTATUS status;
+ GUID guid;
TRACE("%d %p %p %p\n", flow, ids, num, def_index);
- *num = 1;
+ *num = 0;
*def_index = 0;
-
- *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(**ids));
+ *ids = NULL;
*keys = NULL;
- if (!*ids)
- return E_OUTOFMEMORY;
- (*ids)[0] = id = HeapAlloc(GetProcessHeap(), 0, sizeof(defaultW));
- *keys = HeapAlloc(GetProcessHeap(), 0, sizeof(**keys));
- if (!*keys || !id) {
- HeapFree(GetProcessHeap(), 0, id);
- HeapFree(GetProcessHeap(), 0, *keys);
- HeapFree(GetProcessHeap(), 0, *ids);
- *ids = NULL;
- *keys = NULL;
- return E_OUTOFMEMORY;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Wine\\Drivers\\winepulse.drv\\devices",
+ 0, KEY_READ | KEY_WOW64_64KEY, &key) == ERROR_SUCCESS) {
+ status = RegQueryInfoKeyW(key, NULL, NULL, NULL, &count, &maxlen, NULL, NULL, NULL, NULL, NULL, NULL);
+ if (status != ERROR_SUCCESS || maxlen < 3)
+ count = 0;
}
- memcpy(id, defaultW, sizeof(defaultW));
- if (flow == eRender)
- (*keys)[0] = pulse_render_guid;
- else
- (*keys)[0] = pulse_capture_guid;
+ if (count && !(key_name = malloc((maxlen + 1) * sizeof(WCHAR))))
+ goto err;
+
+ *ids = HeapAlloc(GetProcessHeap(), 0, (count + 1) * sizeof(**ids));
+ *keys = HeapAlloc(GetProcessHeap(), 0, (count + 1) * sizeof(**keys));
+ if (!*ids || !*keys)
+ goto err;
+
+ if (!(id = HeapAlloc(GetProcessHeap(), 0, sizeof(L"PulseAudio"))))
+ goto err;
+ wcscpy(id, L"PulseAudio");
+ (*ids)[k] = id;
+ (*keys)[k++] = (flow == eRender) ? pulse_render_guid : pulse_capture_guid;
+
+ for (i = 0; i < count; i++) {
+ DWORD key_name_size = maxlen + 1;
+
+ if (RegEnumKeyExW(key, i, key_name, &key_name_size, NULL, NULL, NULL, NULL) != ERROR_SUCCESS ||
+ key_name_size < 3 || key_name[0] != flow_char ||
+ RegOpenKeyExW(key, key_name, 0, KEY_READ | KEY_WRITE | KEY_WOW64_64KEY, &dev_key) != ERROR_SUCCESS)
+ continue;
+
+ status = RegQueryValueExW(dev_key, L"name", 0, &type, NULL, &size);
+ if (status == ERROR_SUCCESS && type == REG_SZ && size >= sizeof(WCHAR)) {
+ if (!(id = HeapAlloc(GetProcessHeap(), 0, size))) {
+ RegCloseKey(dev_key);
+ goto err;
+ }
+ status = RegQueryValueExW(dev_key, L"name", 0, &type, (BYTE*)id, &size);
+ if (status == ERROR_SUCCESS && type == REG_SZ && size >= sizeof(WCHAR)) {
+ id[size / sizeof(WCHAR) - 1] = 0;
+
+ size = sizeof(guid);
+ status = RegQueryValueExW(dev_key, L"guid", 0, &type, (BYTE*)&guid, &size);
+
+ if (status != ERROR_SUCCESS || type != REG_BINARY || size != sizeof(guid)) {
+ CoCreateGuid(&guid);
+ status = RegSetValueExW(dev_key, L"guid", 0, REG_BINARY, (BYTE*)&guid, sizeof(guid));
+ if (status != ERROR_SUCCESS)
+ ERR("Failed to store device GUID for %s to registry\n", debugstr_w(key_name + 2));
+ }
+ (*ids)[k] = id;
+ (*keys)[k++] = guid;
+ } else {
+ HeapFree(GetProcessHeap(), 0, id);
+ }
+ }
+ RegCloseKey(dev_key);
+ }
+ *num = k;
+ *ids = HeapReAlloc(GetProcessHeap(), 0, *ids, k * sizeof(**ids));
+ *keys = HeapReAlloc(GetProcessHeap(), 0, *keys, k * sizeof(**keys));
+ if (key) RegCloseKey(key);
+ free(key_name);
return S_OK;
+
+err:
+ if (key) RegCloseKey(key);
+ while (k--) HeapFree(GetProcessHeap(), 0, (*ids)[k]);
+ HeapFree(GetProcessHeap(), 0, *keys);
+ HeapFree(GetProcessHeap(), 0, *ids);
+ free(key_name);
+ *ids = NULL;
+ *keys = NULL;
+ return E_OUTOFMEMORY;
}
int WINAPI AUDDRV_GetPriority(void)
@@ -314,26 +370,89 @@ int WINAPI AUDDRV_GetPriority(void)
return SUCCEEDED(params.result) ? Priority_Preferred : Priority_Unavailable;
}
+static BOOL get_pulse_name_by_guid(const GUID *guid, char name[256], EDataFlow *flow)
+{
+ DWORD key_name_size;
+ WCHAR key_name[258];
+ DWORD index = 0;
+ HKEY key;
+
+ /* Return empty string for default PulseAudio device */
+ name[0] = 0;
+ if (IsEqualGUID(guid, &pulse_render_guid)) {
+ *flow = eRender;
+ return TRUE;
+ } else if (IsEqualGUID(guid, &pulse_capture_guid)) {
+ *flow = eCapture;
+ return TRUE;
+ }
+
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Wine\\Drivers\\winepulse.drv\\devices",
+ 0, KEY_READ | KEY_WOW64_64KEY, &key) != ERROR_SUCCESS) {
+ WARN("No devices found in registry\n");
+ return FALSE;
+ }
+
+ for (;;) {
+ DWORD size, type;
+ LSTATUS status;
+ GUID reg_guid;
+ HKEY dev_key;
+
+ key_name_size = ARRAY_SIZE(key_name);
+ if (RegEnumKeyExW(key, index++, key_name, &key_name_size, NULL,
+ NULL, NULL, NULL) != ERROR_SUCCESS)
+ break;
+
+ if (RegOpenKeyExW(key, key_name, 0, KEY_READ | KEY_WOW64_64KEY, &dev_key) != ERROR_SUCCESS) {
+ ERR("Couldn't open key: %s\n", wine_dbgstr_w(key_name));
+ continue;
+ }
+
+ size = sizeof(reg_guid);
+ status = RegQueryValueExW(dev_key, L"guid", 0, &type, (BYTE *)®_guid, &size);
+ RegCloseKey(dev_key);
+
+ if (status == ERROR_SUCCESS && type == REG_BINARY && size == sizeof(reg_guid) && IsEqualGUID(®_guid, guid)) {
+ RegCloseKey(key);
+
+ TRACE("Found matching device key: %s\n", wine_dbgstr_w(key_name));
+
+ if (key_name[0] == '0')
+ *flow = eRender;
+ else if (key_name[0] == '1')
+ *flow = eCapture;
+ else {
+ WARN("Unknown device type: %c\n", key_name[0]);
+ return FALSE;
+ }
+
+ return WideCharToMultiByte(CP_UNIXCP, 0, key_name + 2, -1, name, 256, NULL, NULL);
+ }
+ }
+
+ RegCloseKey(key);
+ WARN("No matching device in registry for GUID %s\n", debugstr_guid(guid));
+ return FALSE;
+}
+
HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out)
{
- ACImpl *This;
+ ACImpl *This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This));
EDataFlow dataflow;
HRESULT hr;
TRACE("%s %p %p\n", debugstr_guid(guid), dev, out);
- if (IsEqualGUID(guid, &pulse_render_guid))
- dataflow = eRender;
- else if (IsEqualGUID(guid, &pulse_capture_guid))
- dataflow = eCapture;
- else
- return E_UNEXPECTED;
*out = NULL;
-
- This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This));
if (!This)
return E_OUTOFMEMORY;
+ if (!get_pulse_name_by_guid(guid, This->device, &dataflow)) {
+ HeapFree(GetProcessHeap(), 0, This);
+ return AUDCLNT_E_DEVICE_INVALIDATED;
+ }
+
This->IAudioClient3_iface.lpVtbl = &AudioClient3_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
@@ -609,6 +728,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
}
params.name = name = get_application_name();
+ params.device = This->device;
params.dataflow = This->dataflow;
params.mode = mode;
params.flags = flags;
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index 3e65936..8934387 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -81,6 +81,11 @@ typedef struct _ACPacket
UINT32 discont;
} ACPacket;
+typedef struct _PhysDevice {
+ struct list entry;
+ char device[0];
+} PhysDevice;
+
static pa_context *pulse_ctx;
static pa_mainloop *pulse_ml;
@@ -89,6 +94,9 @@ static WAVEFORMATEXTENSIBLE pulse_fmt[2];
static REFERENCE_TIME pulse_min_period[2], pulse_def_period[2];
static UINT g_phys_speakers_mask = 0;
+static struct list g_phys_speakers = LIST_INIT(g_phys_speakers);
+static struct list g_phys_sources = LIST_INIT(g_phys_sources);
+static HKEY devices_key;
static const REFERENCE_TIME MinimumPeriod = 30000;
static const REFERENCE_TIME DefaultPeriod = 100000;
@@ -128,6 +136,16 @@ static void dump_attr(const pa_buffer_attr *attr)
TRACE("prebuf: %u\n", attr->prebuf);
}
+static void free_phys_device_lists(void)
+{
+ PhysDevice *dev, *dev_next;
+
+ LIST_FOR_EACH_ENTRY_SAFE(dev, dev_next, &g_phys_speakers, PhysDevice, entry)
+ free(dev);
+ LIST_FOR_EACH_ENTRY_SAFE(dev, dev_next, &g_phys_sources, PhysDevice, entry)
+ free(dev);
+}
+
/* copied from kernelbase */
static int muldiv(int a, int b, int c)
{
@@ -152,6 +170,61 @@ static int muldiv(int a, int b, int c)
return ret;
}
+/* wrapper for NtCreateKey that creates the key recursively if necessary */
+static HKEY reg_create_key(HKEY root, const WCHAR *name, ULONG name_len)
+{
+ UNICODE_STRING nameW = { name_len, name_len, (WCHAR *)name };
+ OBJECT_ATTRIBUTES attr;
+ NTSTATUS status;
+ HANDLE ret = 0;
+
+ attr.Length = sizeof(attr);
+ attr.RootDirectory = root;
+ attr.ObjectName = &nameW;
+ attr.Attributes = 0;
+ attr.SecurityDescriptor = NULL;
+ attr.SecurityQualityOfService = NULL;
+
+ status = NtCreateKey(&ret, KEY_QUERY_VALUE | KEY_WRITE | KEY_WOW64_64KEY, &attr, 0, NULL, 0, NULL);
+ if (status == STATUS_OBJECT_NAME_NOT_FOUND) {
+ DWORD pos = 0, i = 0, len = name_len / sizeof(WCHAR);
+
+ /* don't try to create registry root */
+ if (!root) i += 10;
+
+ while (i < len && name[i] != '\\') i++;
+ if (i == len) return 0;
+ for (;;) {
+ nameW.Buffer = (WCHAR *)name + pos;
+ nameW.Length = (i - pos) * sizeof(WCHAR);
+ status = NtCreateKey(&ret, KEY_QUERY_VALUE | KEY_WRITE | KEY_WOW64_64KEY, &attr, 0, NULL, 0, NULL);
+
+ if (attr.RootDirectory != root) NtClose(attr.RootDirectory);
+ if (!NT_SUCCESS(status)) return 0;
+ if (i == len) break;
+ attr.RootDirectory = ret;
+ while (i < len && name[i] == '\\') i++;
+ pos = i;
+ while (i < len && name[i] != '\\') i++;
+ }
+ }
+ return ret;
+}
+
+static HKEY open_devices_key(void)
+{
+ static const WCHAR drv_key_devicesW[] = {
+ '\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\',
+ 'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\','D','r','i','v','e','r','s','\\',
+ 'w','i','n','e','p','u','l','s','e','.','d','r','v','\\','d','e','v','i','c','e','s'
+ };
+ HANDLE ret;
+
+ if (!(ret = reg_create_key(NULL, drv_key_devicesW, sizeof(drv_key_devicesW))))
+ ERR("Failed to open devices registry key\n");
+ return ret;
+}
+
/* Following pulseaudio design here, mainloop has the lock taken whenever
* it is handling something for pulse, and the lock is required whenever
* doing any pa_* call that can affect the state in any way
@@ -190,6 +263,7 @@ static NTSTATUS pulse_process_attach(void *args)
static NTSTATUS pulse_process_detach(void *args)
{
+ free_phys_device_lists();
if (pulse_ctx)
{
pa_context_disconnect(pulse_ctx);
@@ -357,12 +431,73 @@ static DWORD pulse_channel_map_to_channel_mask(const pa_channel_map *map)
return mask;
}
-/* For default PulseAudio render device, OR together all of the
- * PKEY_AudioEndpoint_PhysicalSpeakers values of the sinks. */
+static void store_device_info(EDataFlow flow, const char *device, const char *name)
+{
+ static const WCHAR nameW[] = { 'n','a','m','e' };
+ UNICODE_STRING name_str = { sizeof(nameW), sizeof(nameW), (WCHAR*)nameW };
+ UINT name_len = strlen(name);
+ WCHAR key_name[258], *wname;
+ DWORD len, key_len;
+ HKEY key;
+
+ if (!devices_key || !(wname = malloc((name_len + 1) * sizeof(WCHAR))))
+ return;
+
+ key_name[0] = (flow == eCapture) ? '1' : '0';
+ key_name[1] = ',';
+
+ key_len = ntdll_umbstowcs(device, strlen(device), key_name + 2, ARRAY_SIZE(key_name) - 2);
+ if (!key_len || key_len >= ARRAY_SIZE(key_name) - 2)
+ goto done;
+ key_len += 2;
+
+ if (!(len = ntdll_umbstowcs(name, name_len, wname, name_len)))
+ goto done;
+ wname[len] = 0;
+
+ if (!(key = reg_create_key(devices_key, key_name, key_len * sizeof(WCHAR)))) {
+ ERR("Failed to open registry key for device %s\n", device);
+ goto done;
+ }
+
+ if (NtSetValueKey(key, &name_str, 0, REG_SZ, wname, (len + 1) * sizeof(WCHAR)))
+ ERR("Failed to store name for %s to registry\n", device);
+ NtClose(key);
+
+done:
+ free(wname);
+}
+
+static void pulse_add_device(struct list *list, const char *device)
+{
+ DWORD len = strlen(device);
+ PhysDevice *dev = malloc(FIELD_OFFSET(PhysDevice, device[len + 1]));
+
+ if (!dev)
+ return;
+ memcpy(dev->device, device, len + 1);
+
+ list_add_tail(list, &dev->entry);
+}
+
static void pulse_phys_speakers_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata)
{
- if (i)
+ if (i && i->name && i->name[0]) {
+ /* For default PulseAudio render device, OR together all of the
+ * PKEY_AudioEndpoint_PhysicalSpeakers values of the sinks. */
g_phys_speakers_mask |= pulse_channel_map_to_channel_mask(&i->channel_map);
+
+ store_device_info(eRender, i->name, i->description);
+ pulse_add_device(&g_phys_speakers, i->name);
+ }
+}
+
+static void pulse_phys_sources_cb(pa_context *c, const pa_source_info *i, int eol, void *userdata)
+{
+ if (i && i->name && i->name[0]) {
+ store_device_info(eCapture, i->name, i->description);
+ pulse_add_device(&g_phys_sources, i->name);
+ }
}
/* For most hardware on Windows, users must choose a configuration with an even
@@ -579,7 +714,15 @@ static NTSTATUS pulse_test_connect(void *args)
pulse_probe_settings(1, &pulse_fmt[0]);
pulse_probe_settings(0, &pulse_fmt[1]);
+ free_phys_device_lists();
+ list_init(&g_phys_speakers);
+ list_init(&g_phys_sources);
g_phys_speakers_mask = 0;
+
+ devices_key = open_devices_key();
+ pulse_add_device(&g_phys_speakers, "");
+ pulse_add_device(&g_phys_sources, "");
+
o = pa_context_get_sink_info_list(pulse_ctx, &pulse_phys_speakers_cb, NULL);
if (o) {
while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 &&
@@ -588,6 +731,15 @@ static NTSTATUS pulse_test_connect(void *args)
pa_operation_unref(o);
}
+ o = pa_context_get_source_info_list(pulse_ctx, &pulse_phys_sources_cb, NULL);
+ if (o) {
+ while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 &&
+ pa_operation_get_state(o) == PA_OPERATION_RUNNING)
+ {}
+ pa_operation_unref(o);
+ }
+ NtClose(devices_key);
+
pa_context_unref(pulse_ctx);
pulse_ctx = NULL;
pa_mainloop_free(pulse_ml);
@@ -771,8 +923,9 @@ static HRESULT pulse_spec_from_waveformat(struct pulse_stream *stream, const WAV
return S_OK;
}
-static HRESULT pulse_stream_connect(struct pulse_stream *stream, UINT32 period_bytes)
+static HRESULT pulse_stream_connect(struct pulse_stream *stream, const char *device, UINT32 period_bytes)
{
+ pa_stream_flags_t flags = PA_STREAM_START_CORKED | PA_STREAM_START_UNMUTED | PA_STREAM_ADJUST_LATENCY;
int ret;
char buffer[64];
static LONG number;
@@ -797,12 +950,17 @@ static HRESULT pulse_stream_connect(struct pulse_stream *stream, UINT32 period_b
attr.maxlength = stream->bufsize_frames * pa_frame_size(&stream->ss);
attr.prebuf = pa_frame_size(&stream->ss);
dump_attr(&attr);
+
+ /* If device name is given, use exactly the specified device */
+ if (device[0])
+ flags |= PA_STREAM_DONT_MOVE;
+ else
+ device = NULL; /* use default */
+
if (stream->dataflow == eRender)
- ret = pa_stream_connect_playback(stream->stream, NULL, &attr,
- PA_STREAM_START_CORKED|PA_STREAM_START_UNMUTED|PA_STREAM_ADJUST_LATENCY, NULL, NULL);
+ ret = pa_stream_connect_playback(stream->stream, device, &attr, flags, NULL, NULL);
else
- ret = pa_stream_connect_record(stream->stream, NULL, &attr,
- PA_STREAM_START_CORKED|PA_STREAM_START_UNMUTED|PA_STREAM_ADJUST_LATENCY);
+ ret = pa_stream_connect_record(stream->stream, device, &attr, flags);
if (ret < 0) {
WARN("Returns %i\n", ret);
return AUDCLNT_E_ENDPOINT_CREATE_FAILED;
@@ -864,7 +1022,7 @@ static NTSTATUS pulse_create_stream(void *args)
stream->share = params->mode;
stream->flags = params->flags;
- hr = pulse_stream_connect(stream, stream->period_bytes);
+ hr = pulse_stream_connect(stream, params->device, stream->period_bytes);
if (SUCCEEDED(hr)) {
UINT32 unalign;
const pa_buffer_attr *attr = pa_stream_get_buffer_attr(stream->stream);
diff --git a/dlls/winepulse.drv/unixlib.h b/dlls/winepulse.drv/unixlib.h
index d28a73c..5445a0f 100644
--- a/dlls/winepulse.drv/unixlib.h
+++ b/dlls/winepulse.drv/unixlib.h
@@ -40,6 +40,7 @@ struct main_loop_params
struct create_stream_params
{
const char *name;
+ const char *device;
EDataFlow dataflow;
AUDCLNT_SHAREMODE mode;
DWORD flags;
--
2.34.1
4
11
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
The old winsock implementation was printing warnings for any error status from socket
operation. That was handy for debugging. Without that pretty much any problem analysis
involving tracing network operations starts from adding such logs.
dlls/ws2_32/socket.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index fb2086b11e9..8a08dcd6667 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -814,6 +814,7 @@ static BOOL WINAPI WS2_AcceptEx( SOCKET listener, SOCKET acceptor, void *dest, D
if (ret_len) *ret_len = overlapped->InternalHigh;
WSASetLastError( NtStatusToWSAError(status) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return !status;
}
@@ -867,6 +868,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE file, DWORD file_len, DWOR
status = piosb->u.Status;
}
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return !status;
}
@@ -955,6 +957,7 @@ static int WS2_recv_base( SOCKET s, WSABUF *buffers, DWORD buffer_count, DWORD *
}
if (!status && ret_size) *ret_size = piosb->Information;
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -1021,6 +1024,7 @@ static int WS2_sendto( SOCKET s, WSABUF *buffers, DWORD buffer_count, DWORD *ret
}
if (!status && ret_size) *ret_size = piosb->Information;
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -1149,7 +1153,8 @@ int WINAPI bind( SOCKET s, const struct sockaddr *addr, int len )
status = io.u.Status;
}
- if (!status) TRACE( "successfully bound to address %s\n", debugstr_sockaddr( ret_addr ));
+ if (status) WARN( "failed, status %#lx.\n", status );
+ else TRACE( "successfully bound to address %s\n", debugstr_sockaddr( ret_addr ));
free( params );
free( ret_addr );
@@ -1218,6 +1223,7 @@ int WINAPI connect( SOCKET s, const struct sockaddr *addr, int len )
{
/* NtStatusToWSAError() has no mapping for WSAEALREADY */
SetLastError( status == STATUS_ADDRESS_ALREADY_ASSOCIATED ? WSAEALREADY : NtStatusToWSAError( status ) );
+ WARN( "failed, status %#lx.\n", status );
return -1;
}
return 0;
@@ -1273,6 +1279,7 @@ static BOOL WINAPI WS2_ConnectEx( SOCKET s, const struct sockaddr *name, int nam
free( params );
if (ret_len) *ret_len = overlapped->InternalHigh;
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return !status;
}
@@ -1303,6 +1310,7 @@ static BOOL WINAPI WS2_DisconnectEx( SOCKET s, OVERLAPPED *overlapped, DWORD fla
IOCTL_AFD_WINE_SHUTDOWN, &how, sizeof(how), NULL, 0 );
if (!status && overlapped) status = STATUS_PENDING;
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return !status;
}
@@ -1334,6 +1342,7 @@ int WINAPI getpeername( SOCKET s, struct sockaddr *addr, int *len )
if (!status)
*len = io.Information;
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -1358,6 +1367,7 @@ int WINAPI getsockname( SOCKET s, struct sockaddr *addr, int *len )
if (!status)
*len = io.Information;
WSASetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -1370,6 +1380,7 @@ static int server_getsockopt( SOCKET s, ULONG code, char *optval, int *optlen )
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, code, NULL, 0, optval, *optlen );
if (!status) *optlen = io.Information;
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -1960,6 +1971,7 @@ static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_s
else if (status == STATUS_SUCCESS)
*ret_size = piosb->Information;
+ if (status) WARN( "failed, status %#lx.\n", status );
return NtStatusToWSAError( status );
}
@@ -2322,6 +2334,7 @@ int WINAPI listen( SOCKET s, int backlog )
status = NtDeviceIoControlFile( SOCKET2HANDLE(s), NULL, NULL, NULL, &io,
IOCTL_AFD_LISTEN, ¶ms, sizeof(params), NULL, 0 );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -2517,6 +2530,7 @@ int WINAPI select( int count, fd_set *read_ptr, fd_set *write_ptr,
free( params );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : ret_count;
}
@@ -2661,6 +2675,7 @@ int WINAPI WSAPoll( WSAPOLLFD *fds, ULONG count, int timeout )
free( params );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : ret_count;
}
@@ -2744,6 +2759,7 @@ static int server_setsockopt( SOCKET s, ULONG code, const char *optval, int optl
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, code, (void *)optval, optlen, NULL, 0 );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -3055,6 +3071,7 @@ int WINAPI shutdown( SOCKET s, int how )
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io,
IOCTL_AFD_WINE_SHUTDOWN, &how, sizeof(how), NULL, 0 );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -3112,6 +3129,7 @@ int WINAPI WSAEnumNetworkEvents( SOCKET s, WSAEVENT event, WSANETWORKEVENTS *ret
}
}
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -3156,6 +3174,7 @@ int WINAPI WSAEventSelect( SOCKET s, WSAEVENT event, LONG mask )
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_EVENT_SELECT,
¶ms, sizeof(params), NULL, 0 );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -3201,6 +3220,7 @@ BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
*lpdwFlags = lpOverlapped->u.s.Offset;
SetLastError( NtStatusToWSAError(status) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return NT_SUCCESS( status );
}
@@ -3224,6 +3244,7 @@ int WINAPI WSAAsyncSelect( SOCKET s, HWND window, UINT message, LONG mask )
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_WINE_MESSAGE_SELECT,
¶ms, sizeof(params), NULL, 0 );
SetLastError( NtStatusToWSAError( status ) );
+ if (status) WARN( "failed, status %#lx.\n", status );
return status ? -1 : 0;
}
@@ -3579,6 +3600,7 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct sockaddr *addr, int *addrlen,
&server_handle, sizeof(server_handle), NULL, 0 );
closesocket( cs );
SetLastError( status ? RtlNtStatusToDosError( status ) : WSATRY_AGAIN );
+ if (status) WARN( "failed, status %#lx.\n", status );
return -1;
}
--
2.34.1
2
3
[PATCH] winegstreamer: Do not block forever if EOS races with command queue.
by Giovanni Mascellani 09 Feb '22
by Giovanni Mascellani 09 Feb '22
09 Feb '22
Currently, the winegstreamer media source checks for EOS when
RequestSample() is called, but doesn't handle the cases when EOS
is detected between the RequestSample() call and the moment when
the request is popped from the command queue and serviced. This
can result in the media source waiting forever for a sample and
get stuck.
This commit fixes the bug by adding a check for EOS in
wg_parser_stream_get_event().
This commit fixes Medieval Dynasty hanging on developer logos on
the Steam Deck.
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
dlls/winegstreamer/media_source.c | 13 ++++++++++---
dlls/winegstreamer/wg_parser.c | 15 ++++++++++++---
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 85ec31d2498..5393835b696 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -548,9 +548,16 @@ static void wait_on_sample(struct media_stream *stream, IUnknown *token)
return;
case WG_PARSER_EVENT_EOS:
- stream->eos = TRUE;
- IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEEndOfStream, &GUID_NULL, S_OK, &empty_var);
- dispatch_end_of_presentation(stream->parent_source);
+ if (stream->eos)
+ {
+ IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEError, &GUID_NULL, MF_E_END_OF_STREAM, &empty_var);
+ }
+ else
+ {
+ stream->eos = TRUE;
+ IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEEndOfStream, &GUID_NULL, S_OK, &empty_var);
+ dispatch_end_of_presentation(stream->parent_source);
+ }
return;
case WG_PARSER_EVENT_SEGMENT:
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 013566b25e9..beb4d92bf5b 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -106,7 +106,7 @@ struct wg_parser_stream
GstBuffer *buffer;
GstMapInfo map_info;
- bool flushing, eos, enabled, has_caps;
+ bool flushing, eos, processed_eos, enabled, has_caps;
uint64_t duration;
};
@@ -681,7 +681,7 @@ static NTSTATUS wg_parser_stream_get_event(void *args)
pthread_mutex_lock(&parser->mutex);
- while (!parser->flushing && stream->event.type == WG_PARSER_EVENT_NONE)
+ while (!parser->flushing && !stream->processed_eos && stream->event.type == WG_PARSER_EVENT_NONE)
pthread_cond_wait(&stream->event_cond, &parser->mutex);
if (parser->flushing)
@@ -691,7 +691,16 @@ static NTSTATUS wg_parser_stream_get_event(void *args)
return VFW_E_WRONG_STATE;
}
- *params->event = stream->event;
+ if (stream->processed_eos)
+ params->event->type = WG_PARSER_EVENT_EOS;
+ else
+ *params->event = stream->event;
+
+ if (stream->event.type == WG_PARSER_EVENT_EOS && !stream->processed_eos)
+ {
+ stream->processed_eos = true;
+ pthread_cond_signal(&stream->event_cond);
+ }
if (stream->event.type != WG_PARSER_EVENT_BUFFER)
{
--
2.34.1
3
8
[PATCH v2] kernelbase: Implement GetFileInformationByHandleEx(FileFullDirectoryInfo).
by Paul Gofman 09 Feb '22
by Paul Gofman 09 Feb '22
09 Feb '22
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
v2:
- fix test failures on Win7.
dlls/kernel32/tests/file.c | 75 ++++++++++++++++++++++++++++++++++----
dlls/kernelbase/file.c | 12 +++++-
include/winbase.h | 15 ++++++++
3 files changed, 93 insertions(+), 9 deletions(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index f8e49491a7d..1f905cd59f8 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -4181,11 +4181,13 @@ todo_wine_if (i == 1)
static void test_GetFileInformationByHandleEx(void)
{
int i;
- char tempPath[MAX_PATH], tempFileName[MAX_PATH], buffer[1024], *strPtr;
- BOOL ret;
+ char tempPath[MAX_PATH], tempFileName[MAX_PATH], buffer[1024], buffer2[1024], *strPtr;
+ BOOL first, ret;
DWORD ret2, written;
+ unsigned int count, count2, size;
HANDLE directory, file;
FILE_ID_BOTH_DIR_INFO *bothDirInfo;
+ FILE_FULL_DIR_INFO *full_dir_info;
FILE_BASIC_INFO *basicInfo;
FILE_STANDARD_INFO *standardInfo;
FILE_NAME_INFO *nameInfo;
@@ -4195,17 +4197,26 @@ static void test_GetFileInformationByHandleEx(void)
FILE_DISPOSITION_INFO dispinfo;
FILE_END_OF_FILE_INFO eofinfo;
FILE_RENAME_INFO renameinfo;
+ BOOL full_dir_info_supported;
- struct {
+ struct
+ {
FILE_INFO_BY_HANDLE_CLASS handleClass;
void *ptr;
DWORD size;
DWORD errorCode;
- } checks[] = {
+ BOOL not_always_supported;
+ }
+ checks[] =
+ {
{0xdeadbeef, NULL, 0, ERROR_INVALID_PARAMETER},
{FileIdBothDirectoryInfo, NULL, 0, ERROR_BAD_LENGTH},
{FileIdBothDirectoryInfo, NULL, sizeof(buffer), ERROR_NOACCESS},
- {FileIdBothDirectoryInfo, buffer, 0, ERROR_BAD_LENGTH}};
+ {FileIdBothDirectoryInfo, buffer, 0, ERROR_BAD_LENGTH},
+ {FileFullDirectoryInfo, NULL, 0, ERROR_BAD_LENGTH, TRUE},
+ {FileFullDirectoryInfo, NULL, sizeof(buffer), ERROR_NOACCESS},
+ {FileFullDirectoryInfo, buffer, 0, ERROR_BAD_LENGTH},
+ };
if (!pGetFileInformationByHandleEx)
{
@@ -4232,10 +4243,17 @@ static void test_GetFileInformationByHandleEx(void)
{
SetLastError(0xdeadbeef);
ret = pGetFileInformationByHandleEx(directory, checks[i].handleClass, checks[i].ptr, checks[i].size);
+ if (checks[i].not_always_supported && !ret && GetLastError() == ERROR_INVALID_PARAMETER)
+ {
+ win_skip("class %u is not supported, skipping the rest.\n", checks[i].handleClass);
+ break;
+ }
ok(!ret && GetLastError() == checks[i].errorCode, "GetFileInformationByHandleEx: expected error %u, "
"got %u.\n", checks[i].errorCode, GetLastError());
}
+ full_dir_info_supported = (i == ARRAY_SIZE(checks));
+ first = TRUE;
while (TRUE)
{
memset(buffer, 0xff, sizeof(buffer));
@@ -4243,8 +4261,51 @@ static void test_GetFileInformationByHandleEx(void)
if (!ret && GetLastError() == ERROR_NO_MORE_FILES)
break;
ok(ret, "GetFileInformationByHandleEx: failed to query for FileIdBothDirectoryInfo, got error %u.\n", GetLastError());
- if (!ret)
- break;
+
+ if (full_dir_info_supported && first)
+ {
+ count = 1;
+ bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer;
+ while (bothDirInfo->NextEntryOffset)
+ {
+ ++count;
+ size = offsetof(FILE_ID_BOTH_DIR_INFO, FileName[bothDirInfo->FileNameLength / 2]);
+ size = (size + 7) & ~7;
+ ok(bothDirInfo->NextEntryOffset == size,
+ "Got unexpected structure size, NextEntryOffset %u (%u).\n", bothDirInfo->NextEntryOffset,
+ size);
+ bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)(((char *)bothDirInfo) + bothDirInfo->NextEntryOffset);
+ }
+ size = offsetof(FILE_FULL_DIR_INFO, FileName[bothDirInfo->FileNameLength / 2]);
+ ret = pGetFileInformationByHandleEx(directory, FileFullDirectoryRestartInfo, buffer2, sizeof(buffer2));
+ ok(ret, "failed to query for FileFullDirectoryInfo, got error %u.\n", GetLastError());
+
+ count2 = 0;
+ bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer;
+ full_dir_info = (FILE_FULL_DIR_INFO *)buffer2;
+ while (1)
+ {
+ ++count2;
+ ok(bothDirInfo->FileNameLength == full_dir_info->FileNameLength,
+ "FileNameLength does not match, count2 %u.\n", count2);
+ ok(!memcmp(bothDirInfo->FileName, full_dir_info->FileName, full_dir_info->FileNameLength),
+ "FileName does not match, count %u.\n", count2);
+
+ if (!full_dir_info->NextEntryOffset || !bothDirInfo->NextEntryOffset)
+ break;
+
+ size = offsetof(FILE_FULL_DIR_INFO, FileName[full_dir_info->FileNameLength / 2]);
+ size = (size + 7) & ~7;
+ ok(full_dir_info->NextEntryOffset == size,
+ "Got unexpected structure size, NextEntryOffset %u (%u).\n", bothDirInfo->NextEntryOffset,
+ size);
+ full_dir_info = (FILE_FULL_DIR_INFO *)(((char *)full_dir_info) + full_dir_info->NextEntryOffset);
+ bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)(((char *)bothDirInfo) + bothDirInfo->NextEntryOffset);
+ }
+ ok(count2 == count, "Got unexpected count2 %u, count %u.\n", count2, count);
+ first = FALSE;
+ }
+
bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer;
while (TRUE)
{
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 576e03eb62b..c1d9401f5c2 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -2954,13 +2954,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetFileInformationByHandleEx( HANDLE handle, FILE_
NTSTATUS status;
IO_STATUS_BLOCK io;
+ TRACE( "%p, %u, %p, %u.\n", handle, class, info, size );
+
switch (class)
{
case FileStreamInfo:
case FileCompressionInfo:
case FileRemoteProtocolInfo:
- case FileFullDirectoryInfo:
- case FileFullDirectoryRestartInfo:
case FileStorageInfo:
case FileAlignmentInfo:
case FileIdExtdDirectoryInfo:
@@ -2969,6 +2969,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetFileInformationByHandleEx( HANDLE handle, FILE_
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
+ case FileFullDirectoryRestartInfo:
+ case FileFullDirectoryInfo:
+ status = NtQueryDirectoryFile( handle, NULL, NULL, NULL, &io, info, size,
+ FileFullDirectoryInformation, FALSE, NULL,
+ (class == FileFullDirectoryRestartInfo) );
+ break;
+
case FileAttributeTagInfo:
status = NtQueryInformationFile( handle, &io, info, size, FileAttributeTagInformation );
break;
@@ -3002,6 +3009,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetFileInformationByHandleEx( HANDLE handle, FILE_
case FileIoPriorityHintInfo:
case FileEndOfFileInfo:
default:
+ WARN( "class %u is not supported.\n", class );
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
diff --git a/include/winbase.h b/include/winbase.h
index 0a0bfde9d10..b2d5ca68d42 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -823,6 +823,21 @@ typedef struct _FILE_ID_BOTH_DIR_INFO {
WCHAR FileName[1];
} FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO;
+typedef struct _FILE_FULL_DIR_INFO {
+ ULONG NextEntryOffset;
+ ULONG FileIndex;
+ LARGE_INTEGER CreationTime;
+ LARGE_INTEGER LastAccessTime;
+ LARGE_INTEGER LastWriteTime;
+ LARGE_INTEGER ChangeTime;
+ LARGE_INTEGER EndOfFile;
+ LARGE_INTEGER AllocationSize;
+ ULONG FileAttributes;
+ ULONG FileNameLength;
+ ULONG EaSize;
+ WCHAR FileName[1];
+} FILE_FULL_DIR_INFO, *PFILE_FULL_DIR_INFO;
+
typedef struct _FILE_BASIC_INFO {
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
--
2.34.1
1
0
09 Feb '22
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/concrt140/Makefile.in | 1 -
dlls/crtdll/Makefile.in | 2 +-
dlls/msvcirt/Makefile.in | 2 +-
dlls/msvcirt/msvcirt.c | 30 +++++++++++++--------------
dlls/msvcp100/Makefile.in | 2 +-
dlls/msvcp110/Makefile.in | 2 +-
dlls/msvcp120/Makefile.in | 2 +-
dlls/msvcp140/Makefile.in | 2 +-
dlls/msvcp60/Makefile.in | 2 +-
dlls/msvcp60/main.c | 2 +-
dlls/msvcp70/Makefile.in | 2 +-
dlls/msvcp71/Makefile.in | 2 +-
dlls/msvcp80/Makefile.in | 2 +-
dlls/msvcp90/Makefile.in | 2 +-
dlls/msvcp90/locale.c | 20 +++++++++---------
dlls/msvcp90/misc.c | 18 ++++++++--------
dlls/msvcp90/msvcp_main.c | 2 +-
dlls/msvcr100/Makefile.in | 2 +-
dlls/msvcr110/Makefile.in | 2 +-
dlls/msvcr120/Makefile.in | 2 +-
dlls/msvcr70/Makefile.in | 2 +-
dlls/msvcr71/Makefile.in | 2 +-
dlls/msvcr80/Makefile.in | 2 +-
dlls/msvcr90/Makefile.in | 2 +-
dlls/msvcrt/Makefile.in | 2 +-
dlls/msvcrt/concurrency.c | 4 ++--
dlls/msvcrt/console.c | 2 +-
dlls/msvcrt/except.c | 2 +-
dlls/msvcrt/except_i386.c | 18 ++++++++--------
dlls/msvcrt/except_x86_64.c | 12 +++++------
dlls/msvcrt/file.c | 48 ++++++++++++++++++++++---------------------
dlls/msvcrt/locale.c | 14 ++++++-------
dlls/msvcrt/main.c | 2 +-
dlls/msvcrt/math.c | 2 +-
dlls/msvcrt/mbcs.c | 4 ++--
dlls/msvcrt/misc.c | 6 +++--
dlls/msvcrt/thread.c | 4 ++--
dlls/msvcrtd/Makefile.in | 2 +-
dlls/ucrtbase/Makefile.in | 2 +-
39 files changed, 116 insertions(+), 117 deletions(-)
diff --git a/dlls/concrt140/Makefile.in b/dlls/concrt140/Makefile.in
index 3b74c2e5b4b..aac1ed7b34a 100644
--- a/dlls/concrt140/Makefile.in
+++ b/dlls/concrt140/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = concrt140.dll
PARENTSRC = ../msvcrt
diff --git a/dlls/crtdll/Makefile.in b/dlls/crtdll/Makefile.in
index 619fd59c5c4..ffdbb2ab7a1 100644
--- a/dlls/crtdll/Makefile.in
+++ b/dlls/crtdll/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTDLL -D_CRTIMP=
+EXTRADEFS = -D_CRTDLL -D_CRTIMP=
MODULE = crtdll.dll
IMPORTS = ntdll
DELAYIMPORTS = advapi32 user32
diff --git a/dlls/msvcirt/Makefile.in b/dlls/msvcirt/Makefile.in
index 995d890493b..2e3e3edc9ea 100644
--- a/dlls/msvcirt/Makefile.in
+++ b/dlls/msvcirt/Makefile.in
@@ -1,5 +1,5 @@
MODULE = msvcirt.dll
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCIRT
+EXTRADEFS = -D_MSVCIRT
PARENTSRC = ../msvcp90
IMPORTS = msvcrt
diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index 1103ea309a0..35f532425d3 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -634,7 +634,7 @@ DEFINE_THISCALL_WRAPPER(streambuf_seekoff, 16)
#define call_streambuf_seekoff(this, off, dir, mode) CALL_VTBL_FUNC(this, 12, streampos, (streambuf*, streamoff, ios_seek_dir, int), (this, off, dir, mode))
streampos __thiscall streambuf_seekoff(streambuf *this, streamoff offset, ios_seek_dir dir, int mode)
{
- TRACE("(%p %d %d %d)\n", this, offset, dir, mode);
+ TRACE("(%p %ld %d %d)\n", this, offset, dir, mode);
return EOF;
}
@@ -643,7 +643,7 @@ streampos __thiscall streambuf_seekoff(streambuf *this, streamoff offset, ios_se
DEFINE_THISCALL_WRAPPER(streambuf_seekpos, 12)
streampos __thiscall streambuf_seekpos(streambuf *this, streampos pos, int mode)
{
- TRACE("(%p %d %d)\n", this, pos, mode);
+ TRACE("(%p %ld %d)\n", this, pos, mode);
return call_streambuf_seekoff(this, pos, SEEKDIR_beg, mode);
}
@@ -1181,7 +1181,7 @@ int __thiscall filebuf_overflow(filebuf *this, int c)
DEFINE_THISCALL_WRAPPER(filebuf_seekoff, 16)
streampos __thiscall filebuf_seekoff(filebuf *this, streamoff offset, ios_seek_dir dir, int mode)
{
- TRACE("(%p %d %d %d)\n", this, offset, dir, mode);
+ TRACE("(%p %ld %d %d)\n", this, offset, dir, mode);
if (call_streambuf_sync(&this->base) == EOF)
return EOF;
return _lseek(this->fd, offset, dir);
@@ -1520,7 +1520,7 @@ streampos __thiscall strstreambuf_seekoff(strstreambuf *this, streamoff offset,
{
char *base[3];
- TRACE("(%p %d %d %d)\n", this, offset, dir, mode);
+ TRACE("(%p %ld %d %d)\n", this, offset, dir, mode);
if ((unsigned int)dir > SEEKDIR_end || !(mode & (OPENMODE_in|OPENMODE_out)))
return EOF;
@@ -1720,7 +1720,7 @@ int __thiscall stdiobuf_pbackfail(stdiobuf *this, int c)
DEFINE_THISCALL_WRAPPER(stdiobuf_seekoff, 16)
streampos __thiscall stdiobuf_seekoff(stdiobuf *this, streamoff offset, ios_seek_dir dir, int mode)
{
- TRACE("(%p %d %d %d)\n", this, offset, dir, mode);
+ TRACE("(%p %ld %d %d)\n", this, offset, dir, mode);
call_streambuf_overflow(&this->base, EOF);
if (fseek(this->file, offset, dir))
return EOF;
@@ -2070,7 +2070,7 @@ LONG __thiscall ios_flags_set(ios *this, LONG flags)
{
LONG prev = this->flags;
- TRACE("(%p %x)\n", this, flags);
+ TRACE("(%p %lx)\n", this, flags);
this->flags = flags;
return prev;
@@ -2225,7 +2225,7 @@ LONG __thiscall ios_setf(ios *this, LONG flags)
{
LONG prev = this->flags;
- TRACE("(%p %x)\n", this, flags);
+ TRACE("(%p %lx)\n", this, flags);
ios_lock(this);
this->flags |= flags;
@@ -2240,7 +2240,7 @@ LONG __thiscall ios_setf_mask(ios *this, LONG flags, LONG mask)
{
LONG prev = this->flags;
- TRACE("(%p %x %x)\n", this, flags, mask);
+ TRACE("(%p %lx %lx)\n", this, flags, mask);
ios_lock(this);
this->flags = (this->flags & (~mask)) | (flags & mask);
@@ -2311,7 +2311,7 @@ LONG __thiscall ios_unsetf(ios *this, LONG flags)
{
LONG prev = this->flags;
- TRACE("(%p %x)\n", this, flags);
+ TRACE("(%p %lx)\n", this, flags);
ios_lock(this);
this->flags &= ~flags;
@@ -2607,7 +2607,7 @@ ostream* __thiscall ostream_seekp(ostream *this, streampos pos)
{
ios *base = ostream_get_ios(this);
- TRACE("(%p %d)\n", this, pos);
+ TRACE("(%p %ld)\n", this, pos);
ios_lockbuf(base);
if (streambuf_seekpos(base->sb, pos, OPENMODE_out) == EOF)
@@ -2623,7 +2623,7 @@ ostream* __thiscall ostream_seekp_offset(ostream *this, streamoff off, ios_seek_
{
ios *base = ostream_get_ios(this);
- TRACE("(%p %d %d)\n", this, off, dir);
+ TRACE("(%p %ld %d)\n", this, off, dir);
ios_lockbuf(base);
if (call_streambuf_seekoff(base->sb, off, dir, OPENMODE_out) == EOF)
@@ -3749,7 +3749,7 @@ istream* __thiscall istream_seekg(istream *this, streampos pos)
{
ios *base = istream_get_ios(this);
- TRACE("(%p %d)\n", this, pos);
+ TRACE("(%p %ld)\n", this, pos);
ios_lockbuf(base);
if (streambuf_seekpos(base->sb, pos, OPENMODE_in) == EOF)
@@ -3765,7 +3765,7 @@ istream* __thiscall istream_seekg_offset(istream *this, streamoff off, ios_seek_
{
ios *base = istream_get_ios(this);
- TRACE("(%p %d %d)\n", this, off, dir);
+ TRACE("(%p %ld %d)\n", this, off, dir);
ios_lockbuf(base);
if (call_streambuf_seekoff(base->sb, off, dir, OPENMODE_in) == EOF)
@@ -4010,7 +4010,7 @@ static LONG istream_internal_read_integer(istream *this, LONG min_value, LONG ma
int num_base;
LONG ret;
- TRACE("(%p %d %d %d)\n", this, min_value, max_value, set_flag);
+ TRACE("(%p %ld %ld %d)\n", this, min_value, max_value, set_flag);
num_base = istream_getint(this, buffer);
errno = 0;
@@ -4035,7 +4035,7 @@ static ULONG istream_internal_read_unsigned_integer(istream *this, LONG min_valu
int num_base;
ULONG ret;
- TRACE("(%p %d %u)\n", this, min_value, max_value);
+ TRACE("(%p %ld %lu)\n", this, min_value, max_value);
num_base = istream_getint(this, buffer);
errno = 0;
diff --git a/dlls/msvcp100/Makefile.in b/dlls/msvcp100/Makefile.in
index 35602aa4096..43416c92ad2 100644
--- a/dlls/msvcp100/Makefile.in
+++ b/dlls/msvcp100/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp100.dll
IMPORTS = msvcr100
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=100
+EXTRADEFS = -D_MSVCP_VER=100
PARENTSRC = ../msvcp90
C_SRCS = \
diff --git a/dlls/msvcp110/Makefile.in b/dlls/msvcp110/Makefile.in
index 8046916629d..b2814b35cc3 100644
--- a/dlls/msvcp110/Makefile.in
+++ b/dlls/msvcp110/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp110.dll
IMPORTS = msvcr110
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=110
+EXTRADEFS = -D_MSVCP_VER=110
PARENTSRC = ../msvcp90
C_SRCS = \
diff --git a/dlls/msvcp120/Makefile.in b/dlls/msvcp120/Makefile.in
index 896efa40f18..605dcfe4988 100644
--- a/dlls/msvcp120/Makefile.in
+++ b/dlls/msvcp120/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp120.dll
IMPORTS = msvcr120
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=120
+EXTRADEFS = -D_MSVCP_VER=120
PARENTSRC = ../msvcp90
C_SRCS = \
diff --git a/dlls/msvcp140/Makefile.in b/dlls/msvcp140/Makefile.in
index d26db254d76..eb0c8c3ef39 100644
--- a/dlls/msvcp140/Makefile.in
+++ b/dlls/msvcp140/Makefile.in
@@ -1,5 +1,5 @@
MODULE = msvcp140.dll
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=140
+EXTRADEFS = -D_MSVCP_VER=140
PARENTSRC = ../msvcp90
IMPORTLIB = msvcp140
diff --git a/dlls/msvcp60/Makefile.in b/dlls/msvcp60/Makefile.in
index 6c3626ee470..90dc3c03ff1 100644
--- a/dlls/msvcp60/Makefile.in
+++ b/dlls/msvcp60/Makefile.in
@@ -1,5 +1,5 @@
MODULE = msvcp60.dll
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=60
+EXTRADEFS = -D_MSVCP_VER=60
PARENTSRC = ../msvcp90
IMPORTS = msvcrt
diff --git a/dlls/msvcp60/main.c b/dlls/msvcp60/main.c
index cecea919bed..5d1894cb073 100644
--- a/dlls/msvcp60/main.c
+++ b/dlls/msvcp60/main.c
@@ -94,7 +94,7 @@ static void init_cxx_funcs(void)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+ TRACE("(0x%p, %ld, %p)\n", hinstDLL, fdwReason, lpvReserved);
switch (fdwReason)
{
diff --git a/dlls/msvcp70/Makefile.in b/dlls/msvcp70/Makefile.in
index 0f402323581..36ba70b761b 100644
--- a/dlls/msvcp70/Makefile.in
+++ b/dlls/msvcp70/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp70.dll
IMPORTS = msvcr70
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=70
+EXTRADEFS = -D_MSVCP_VER=70
PARENTSRC = ../msvcp90
C_SRCS = \
diff --git a/dlls/msvcp71/Makefile.in b/dlls/msvcp71/Makefile.in
index d84b2c1c24d..dfa0a2b23d5 100644
--- a/dlls/msvcp71/Makefile.in
+++ b/dlls/msvcp71/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp71.dll
IMPORTS = msvcr71
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=71
+EXTRADEFS = -D_MSVCP_VER=71
PARENTSRC = ../msvcp90
C_SRCS = \
diff --git a/dlls/msvcp80/Makefile.in b/dlls/msvcp80/Makefile.in
index 1cc21b853ab..c541c1b0d11 100644
--- a/dlls/msvcp80/Makefile.in
+++ b/dlls/msvcp80/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp80.dll
IMPORTS = msvcr80
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=80
+EXTRADEFS = -D_MSVCP_VER=80
PARENTSRC = ../msvcp90
C_SRCS = \
diff --git a/dlls/msvcp90/Makefile.in b/dlls/msvcp90/Makefile.in
index 0d06a710d29..5d812db58d9 100644
--- a/dlls/msvcp90/Makefile.in
+++ b/dlls/msvcp90/Makefile.in
@@ -1,6 +1,6 @@
MODULE = msvcp90.dll
IMPORTS = msvcr90
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_MSVCP_VER=90
+EXTRADEFS = -D_MSVCP_VER=90
C_SRCS = \
details.c \
diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index dd7fea203eb..6be2bad1a38 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -7476,7 +7476,7 @@ ostreambuf_iterator_char* __thiscall num_put_char_do_put_long(const num_put *thi
char tmp[48]; /* 22(8^22>2^64)*2(separators between every digit) + 3(strlen("+0x"))+1 */
char fmt[7]; /* strlen("%+#lld")+1 */
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return num_put_char__Iput(this, ret, dest, base, fill, tmp,
sprintf(tmp, num_put_char__Ifmt(this, fmt, "ld", base->fmtfl), v));
@@ -7492,7 +7492,7 @@ DEFINE_THISCALL_WRAPPER(num_put_char_put_long, 32)
ostreambuf_iterator_char* __thiscall num_put_char_put_long(const num_put *this, ostreambuf_iterator_char *ret,
ostreambuf_iterator_char dest, ios_base *base, char fill, LONG v)
{
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return call_num_put_char_do_put_long(this, ret, dest, base, fill, v);
}
@@ -7518,7 +7518,7 @@ ostreambuf_iterator_char* __thiscall num_put_char_do_put_ulong(const num_put *th
char tmp[48]; /* 22(8^22>2^64)*2(separators between every digit) + 3(strlen("+0x"))+1 */
char fmt[7]; /* strlen("%+#lld")+1 */
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return num_put_char__Iput(this, ret, dest, base, fill, tmp,
sprintf(tmp, num_put_char__Ifmt(this, fmt, "lu", base->fmtfl), v));
@@ -7534,7 +7534,7 @@ DEFINE_THISCALL_WRAPPER(num_put_char_put_ulong, 32)
ostreambuf_iterator_char* __thiscall num_put_char_put_ulong(const num_put *this, ostreambuf_iterator_char *ret,
ostreambuf_iterator_char dest, ios_base *base, char fill, ULONG v)
{
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v);
}
@@ -8375,7 +8375,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_long(const num_put *t
char tmp[48]; /* 22(8^22>2^64)*2(separators between every digit) + 3(strlen("+0x"))+1 */
char fmt[7]; /* strlen("%+#lld")+1 */
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "ld", base->fmtfl), v));
@@ -8394,7 +8394,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_long(const num_put *t
char tmp[48]; /* 22(8^22>2^64)*2(separators between every digit) + 3(strlen("+0x"))+1 */
char fmt[7]; /* strlen("%+#lld")+1 */
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return num_put_short__Iput(this, ret, dest, base, fill, tmp,
sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "ld", base->fmtfl), v));
@@ -8412,7 +8412,7 @@ DEFINE_THISCALL_WRAPPER(num_put_wchar_put_long, 32)
ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_long(const num_put *this, ostreambuf_iterator_wchar *ret,
ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, LONG v)
{
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return call_num_put_wchar_do_put_long(this, ret, dest, base, fill, v);
}
@@ -8438,7 +8438,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_ulong(const num_put *
char tmp[48]; /* 22(8^22>2^64)*2(separators between every digit) + 3(strlen("+0x"))+1 */
char fmt[7]; /* strlen("%+#lld")+1 */
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lu", base->fmtfl), v));
@@ -8457,7 +8457,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_ulong(const num_put *
char tmp[48]; /* 22(8^22>2^64)*2(separators between every digit) + 3(strlen("+0x"))+1 */
char fmt[7]; /* strlen("%+#lld")+1 */
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return num_put_short__Iput(this, ret, dest, base, fill, tmp,
sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lu", base->fmtfl), v));
@@ -8475,7 +8475,7 @@ DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ulong, 32)
ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ulong(const num_put *this, ostreambuf_iterator_wchar *ret,
ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, ULONG v)
{
- TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
+ TRACE("(%p %p %p %d %ld)\n", this, ret, base, fill, v);
return call_num_put_wchar_do_put_ulong(this, ret, dest, base, fill, v);
}
diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index 2d309911f10..c7856e0e33d 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -1224,13 +1224,13 @@ typedef int (__cdecl *_Thrd_start_t)(void*);
int __cdecl _Thrd_equal(_Thrd_t a, _Thrd_t b)
{
- TRACE("(%p %u %p %u)\n", a.hnd, a.id, b.hnd, b.id);
+ TRACE("(%p %lu %p %lu)\n", a.hnd, a.id, b.hnd, b.id);
return a.id == b.id;
}
int __cdecl _Thrd_lt(_Thrd_t a, _Thrd_t b)
{
- TRACE("(%p %u %p %u)\n", a.hnd, a.id, b.hnd, b.id);
+ TRACE("(%p %lu %p %lu)\n", a.hnd, a.id, b.hnd, b.id);
return a.id < b.id;
}
@@ -1258,7 +1258,7 @@ static _Thrd_t thread_current(void)
}
ret.id = GetCurrentThreadId();
- TRACE("(%p %u)\n", ret.hnd, ret.id);
+ TRACE("(%p %lu)\n", ret.hnd, ret.id);
return ret;
}
@@ -1284,7 +1284,7 @@ ULONGLONG __cdecl _Thrd_current(void)
int __cdecl _Thrd_join(_Thrd_t thr, int *code)
{
- TRACE("(%p %u %p)\n", thr.hnd, thr.id, code);
+ TRACE("(%p %lu %p)\n", thr.hnd, thr.id, code);
if (WaitForSingleObject(thr.hnd, INFINITE))
return _THRD_ERROR;
@@ -1469,7 +1469,7 @@ void __thiscall _Pad__Release(_Pad *this)
BOOL CDECL MSVCP__crtInitializeCriticalSectionEx(
CRITICAL_SECTION *cs, DWORD spin_count, DWORD flags)
{
- TRACE("(%p %x %x)\n", cs, spin_count, flags);
+ TRACE("(%p %lx %lx)\n", cs, spin_count, flags);
return InitializeCriticalSectionEx(cs, spin_count, flags);
}
@@ -1479,7 +1479,7 @@ BOOL CDECL MSVCP__crtInitializeCriticalSectionEx(
HANDLE CDECL MSVCP__crtCreateEventExW(
SECURITY_ATTRIBUTES *attribs, LPCWSTR name, DWORD flags, DWORD access)
{
- TRACE("(%p %s 0x%08x 0x%08x)\n", attribs, debugstr_w(name), flags, access);
+ TRACE("(%p %s 0x%08lx 0x%08lx)\n", attribs, debugstr_w(name), flags, access);
return CreateEventExW(attribs, name, flags, access);
}
@@ -1514,7 +1514,7 @@ HANDLE CDECL MSVCP__crtCreateSemaphoreExW(
SECURITY_ATTRIBUTES *attribs, LONG initial_count, LONG max_count, LPCWSTR name,
DWORD flags, DWORD access)
{
- TRACE("(%p %d %d %s 0x%08x 0x%08x)\n", attribs, initial_count, max_count, debugstr_w(name),
+ TRACE("(%p %ld %ld %s 0x%08lx 0x%08lx)\n", attribs, initial_count, max_count, debugstr_w(name),
flags, access);
return CreateSemaphoreExW(attribs, initial_count, max_count, name, flags, access);
}
@@ -1544,7 +1544,7 @@ VOID CDECL MSVCP__crtCloseThreadpoolTimer(TP_TIMER *timer)
VOID CDECL MSVCP__crtSetThreadpoolTimer(TP_TIMER *timer,
FILETIME *due_time, DWORD period, DWORD window_length)
{
- TRACE("(%p %p 0x%08x 0x%08x)\n", timer, due_time, period, window_length);
+ TRACE("(%p %p 0x%08lx 0x%08lx)\n", timer, due_time, period, window_length);
return SetThreadpoolTimer(timer, due_time, period, window_length);
}
@@ -1699,7 +1699,7 @@ const char* __cdecl _Syserror_map(int err)
/* ?_Winerror_message(a)std@@YAKKPEADK(a)Z */
ULONG __cdecl _Winerror_message(ULONG err, char *buf, ULONG size)
{
- TRACE("(%u %p %u)\n", err, buf, size);
+ TRACE("(%lu %p %lu)\n", err, buf, size);
return FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, 0, buf, size, NULL);
diff --git a/dlls/msvcp90/msvcp_main.c b/dlls/msvcp90/msvcp_main.c
index 7f61f59a078..cf37631da0e 100644
--- a/dlls/msvcp90/msvcp_main.c
+++ b/dlls/msvcp90/msvcp_main.c
@@ -189,7 +189,7 @@ static void init_cxx_funcs(void)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+ TRACE("(0x%p, %ld, %p)\n", hinstDLL, fdwReason, lpvReserved);
switch (fdwReason)
{
diff --git a/dlls/msvcr100/Makefile.in b/dlls/msvcr100/Makefile.in
index 94962b962f3..a48ae314257 100644
--- a/dlls/msvcr100/Makefile.in
+++ b/dlls/msvcr100/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr100.dll
IMPORTLIB = msvcr100
IMPORTS = ntdll
diff --git a/dlls/msvcr110/Makefile.in b/dlls/msvcr110/Makefile.in
index 7d5ec65444a..26db1d46f7a 100644
--- a/dlls/msvcr110/Makefile.in
+++ b/dlls/msvcr110/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr110.dll
IMPORTLIB = msvcr110
IMPORTS = ntdll
diff --git a/dlls/msvcr120/Makefile.in b/dlls/msvcr120/Makefile.in
index c4cbb9ab5c2..d2957c2f1d3 100644
--- a/dlls/msvcr120/Makefile.in
+++ b/dlls/msvcr120/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr120.dll
IMPORTLIB = msvcr120
IMPORTS = ntdll
diff --git a/dlls/msvcr70/Makefile.in b/dlls/msvcr70/Makefile.in
index ac08107c04e..4383c5ccb87 100644
--- a/dlls/msvcr70/Makefile.in
+++ b/dlls/msvcr70/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr70.dll
IMPORTLIB = msvcr70
IMPORTS = ntdll
diff --git a/dlls/msvcr71/Makefile.in b/dlls/msvcr71/Makefile.in
index d0d265ef344..5a83c81c547 100644
--- a/dlls/msvcr71/Makefile.in
+++ b/dlls/msvcr71/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr71.dll
IMPORTLIB = msvcr71
IMPORTS = ntdll
diff --git a/dlls/msvcr80/Makefile.in b/dlls/msvcr80/Makefile.in
index b9cb3fd88d8..2153949b41e 100644
--- a/dlls/msvcr80/Makefile.in
+++ b/dlls/msvcr80/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr80.dll
IMPORTLIB = msvcr80
IMPORTS = ntdll
diff --git a/dlls/msvcr90/Makefile.in b/dlls/msvcr90/Makefile.in
index 876553d6c02..96176a12553 100644
--- a/dlls/msvcr90/Makefile.in
+++ b/dlls/msvcr90/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcr90.dll
IMPORTLIB = msvcr90
IMPORTS = ntdll
diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in
index d6aa44dd7ce..e8a510d9937 100644
--- a/dlls/msvcrt/Makefile.in
+++ b/dlls/msvcrt/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcrt.dll
IMPORTLIB = msvcrt
IMPORTS = ntdll
diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c
index 6afe6e81489..e5a24f13855 100644
--- a/dlls/msvcrt/concurrency.c
+++ b/dlls/msvcrt/concurrency.c
@@ -527,7 +527,7 @@ DEFINE_THISCALL_WRAPPER(scheduler_resource_allocation_error_ctor_name, 12)
scheduler_resource_allocation_error* __thiscall scheduler_resource_allocation_error_ctor_name(
scheduler_resource_allocation_error *this, const char *name, HRESULT hr)
{
- TRACE("(%p %s %x)\n", this, wine_dbgstr_a(name), hr);
+ TRACE("(%p %s %lx)\n", this, wine_dbgstr_a(name), hr);
__exception_ctor(&this->e, name, &scheduler_resource_allocation_error_vtable);
this->hr = hr;
return this;
@@ -1101,7 +1101,7 @@ static void ThreadScheduler_dtor(ThreadScheduler *this)
{
int i;
- if(this->ref != 0) WARN("ref = %d\n", this->ref);
+ if(this->ref != 0) WARN("ref = %ld\n", this->ref);
SchedulerPolicy_dtor(&this->policy);
for(i=0; i<this->shutdown_count; i++)
diff --git a/dlls/msvcrt/console.c b/dlls/msvcrt/console.c
index 3e41887e88e..2c549c1e7a5 100644
--- a/dlls/msvcrt/console.c
+++ b/dlls/msvcrt/console.c
@@ -153,7 +153,7 @@ static BOOL handle_enhanced_keys(INPUT_RECORD *ir, unsigned char *ch1, unsigned
}
}
- WARN("Unmapped char keyState=%x vk=%x\n",
+ WARN("Unmapped char keyState=%lx vk=%x\n",
ir->Event.KeyEvent.dwControlKeyState, ir->Event.KeyEvent.wVirtualScanCode);
return FALSE;
}
diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c
index ac0bb50f0fb..a7140a9011f 100644
--- a/dlls/msvcrt/except.c
+++ b/dlls/msvcrt/except.c
@@ -272,7 +272,7 @@ int CDECL raise(int sig)
*/
int CDECL _XcptFilter(NTSTATUS ex, PEXCEPTION_POINTERS ptr)
{
- TRACE("(%08x,%p)\n", ex, ptr);
+ TRACE("(%08lx,%p)\n", ex, ptr);
/* I assume ptr->ExceptionRecord->ExceptionCode is the same as ex */
return msvcrt_exception_filter(ptr);
}
diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c
index 23a027368ba..eb41af36d7e 100644
--- a/dlls/msvcrt/except_i386.c
+++ b/dlls/msvcrt/except_i386.c
@@ -368,7 +368,7 @@ static DWORD catch_function_nested_handler( EXCEPTION_RECORD *rec, EXCEPTION_REG
*rec = *prev_rec;
rec->ExceptionFlags &= ~EH_UNWINDING;
if(TRACE_ON(seh)) {
- TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode);
+ TRACE("detect rethrow: exception code: %lx\n", rec->ExceptionCode);
if(rec->ExceptionCode == CXX_EXCEPTION)
TRACE("re-propagate: obj: %lx, type: %lx\n",
rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
@@ -538,7 +538,7 @@ static LONG CALLBACK se_translation_filter( EXCEPTION_POINTERS *ep, void *c )
if (rec->ExceptionCode != CXX_EXCEPTION)
{
- TRACE( "non-c++ exception thrown in SEH handler: %x\n", rec->ExceptionCode );
+ TRACE( "non-c++ exception thrown in SEH handler: %lx\n", rec->ExceptionCode );
terminate();
}
@@ -601,7 +601,7 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame
*rec = *msvcrt_get_thread_data()->exc_record;
rec->ExceptionFlags &= ~EH_UNWINDING;
if(TRACE_ON(seh)) {
- TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode);
+ TRACE("detect rethrow: exception code: %lx\n", rec->ExceptionCode);
if(rec->ExceptionCode == CXX_EXCEPTION)
TRACE("re-propagate: obj: %lx, type: %lx\n",
rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
@@ -633,7 +633,7 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame
thread_data_t *data = msvcrt_get_thread_data();
exc_type = NULL;
- TRACE("handling C exception code %x rec %p frame %p trylevel %d descr %p nested_frame %p\n",
+ TRACE("handling C exception code %lx rec %p frame %p trylevel %d descr %p nested_frame %p\n",
rec->ExceptionCode, rec, frame, frame->trylevel, descr, nested_frame );
if (data->se_translator) {
@@ -866,7 +866,7 @@ int CDECL _except_handler2(PEXCEPTION_RECORD rec,
PCONTEXT context,
EXCEPTION_REGISTRATION_RECORD** dispatcher)
{
- FIXME("exception %x flags=%x at %p handler=%p %p %p stub\n",
+ FIXME("exception %lx flags=%lx at %p handler=%p %p %p stub\n",
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
frame->Handler, context, dispatcher);
return ExceptionContinueSearch;
@@ -883,7 +883,7 @@ int CDECL _except_handler3(PEXCEPTION_RECORD rec,
EXCEPTION_POINTERS exceptPtrs;
PSCOPETABLE pScopeTable;
- TRACE("exception %x flags=%x at %p handler=%p %p %p semi-stub\n",
+ TRACE("exception %lx flags=%lx at %p handler=%p %p %p semi-stub\n",
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
frame->handler, context, dispatcher);
@@ -952,7 +952,7 @@ int CDECL _except_handler4_common( ULONG *cookie, void (*check_cookie)(void),
EXCEPTION_POINTERS exceptPtrs;
const SCOPETABLE_V4 *scope_table = get_scopetable_v4( frame, *cookie );
- TRACE( "exception %x flags=%x at %p handler=%p %p %p cookie=%x scope table=%p cookies=%d/%x,%d/%x\n",
+ TRACE( "exception %lx flags=%lx at %p handler=%p %p %p cookie=%lx scope table=%p cookies=%d/%lx,%d/%lx\n",
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
frame->handler, context, dispatcher, *cookie, scope_table,
scope_table->gs_cookie_offset, scope_table->gs_cookie_xor,
@@ -1187,7 +1187,7 @@ int __cdecl _fpieee_flt(__msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep,
rec.Cause.Underflow = rec.Enable.Underflow & rec.Status.Underflow;
rec.Cause.Inexact = rec.Enable.Inexact & rec.Status.Inexact;
- TRACE("opcode: %x\n", *(ULONG*)ep->ContextRecord->FloatSave.ErrorOffset);
+ TRACE("opcode: %lx\n", *(ULONG*)ep->ContextRecord->FloatSave.ErrorOffset);
if(*(WORD*)ctx->ErrorOffset == 0x35dc) { /* fdiv m64fp */
if(exception_code==STATUS_FLOAT_DIVIDE_BY_ZERO || exception_code==STATUS_FLOAT_INVALID_OPERATION) {
@@ -1213,7 +1213,7 @@ int __cdecl _fpieee_flt(__msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep,
return ret;
}
- FIXME("unsupported opcode: %x\n", *(ULONG*)ep->ContextRecord->FloatSave.ErrorOffset);
+ FIXME("unsupported opcode: %lx\n", *(ULONG*)ep->ContextRecord->FloatSave.ErrorOffset);
return EXCEPTION_CONTINUE_SEARCH;
}
diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c
index 7cbffc0d837..4ef143100d6 100644
--- a/dlls/msvcrt/except_x86_64.c
+++ b/dlls/msvcrt/except_x86_64.c
@@ -350,7 +350,7 @@ static void* WINAPI call_catch_block(EXCEPTION_RECORD *rec)
}
__EXCEPT_CTX(cxx_rethrow_filter, &ctx)
{
- TRACE("detect rethrow: exception code: %x\n", prev_rec->ExceptionCode);
+ TRACE("detect rethrow: exception code: %lx\n", prev_rec->ExceptionCode);
ctx.rethrow = TRUE;
if (untrans_rec)
@@ -486,7 +486,7 @@ static LONG CALLBACK se_translation_filter(EXCEPTION_POINTERS *ep, void *c)
if (rec->ExceptionCode != CXX_EXCEPTION)
{
- TRACE("non-c++ exception thrown in SEH handler: %x\n", rec->ExceptionCode);
+ TRACE("non-c++ exception thrown in SEH handler: %lx\n", rec->ExceptionCode);
terminate();
}
@@ -558,7 +558,7 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame,
TRACE("nested exception detected\n");
unwindlevel = tryblock->end_level;
orig_frame = *(ULONG64*)rva_to_ptr(catchblock->frame, frame);
- TRACE("setting orig_frame to %lx\n", orig_frame);
+ TRACE("setting orig_frame to %Ix\n", orig_frame);
}
}
}
@@ -591,7 +591,7 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame,
if (TRACE_ON(seh))
{
- TRACE("handling C++ exception rec %p frame %lx descr %p\n", rec, frame, descr);
+ TRACE("handling C++ exception rec %p frame %Ix descr %p\n", rec, frame, descr);
dump_exception_type(exc_type, rec->ExceptionInformation[3]);
dump_function_descr(descr, dispatch->ImageBase);
}
@@ -601,7 +601,7 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame,
thread_data_t *data = msvcrt_get_thread_data();
exc_type = NULL;
- TRACE("handling C exception code %x rec %p frame %lx descr %p\n",
+ TRACE("handling C exception code %lx rec %p frame %Ix descr %p\n",
rec->ExceptionCode, rec, frame, descr);
if (data->se_translator) {
@@ -647,7 +647,7 @@ int CDECL __CxxExceptionFilter( PEXCEPTION_POINTERS ptrs,
EXCEPTION_DISPOSITION CDECL __CxxFrameHandler( EXCEPTION_RECORD *rec, ULONG64 frame,
CONTEXT *context, DISPATCHER_CONTEXT *dispatch )
{
- TRACE( "%p %lx %p %p\n", rec, frame, context, dispatch );
+ TRACE( "%p %Ix %p %p\n", rec, frame, context, dispatch );
return cxx_frame_handler( rec, frame, context, dispatch,
rva_to_ptr(*(UINT*)dispatch->HandlerData, dispatch->ImageBase) );
}
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 2666492956c..6ae16cd496a 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -822,7 +822,7 @@ int CDECL _access(const char *filename, int mode)
{
DWORD attr = GetFileAttributesA(filename);
- TRACE("(%s,%d) %d\n",filename,mode,attr);
+ TRACE("(%s,%d) %ld\n",filename,mode,attr);
if (!filename || attr == INVALID_FILE_ATTRIBUTES)
{
@@ -857,7 +857,7 @@ int CDECL _waccess(const wchar_t *filename, int mode)
{
DWORD attr = GetFileAttributesW(filename);
- TRACE("(%s,%d) %d\n",debugstr_w(filename),mode,attr);
+ TRACE("(%s,%d) %ld\n",debugstr_w(filename),mode,attr);
if (!filename || attr == INVALID_FILE_ATTRIBUTES)
{
@@ -931,7 +931,7 @@ int CDECL _unlink(const char *path)
TRACE("%s\n",debugstr_a(path));
if(DeleteFileA(path))
return 0;
- TRACE("failed (%d)\n",GetLastError());
+ TRACE("failed (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
@@ -944,7 +944,7 @@ int CDECL _wunlink(const wchar_t *path)
TRACE("(%s)\n",debugstr_w(path));
if(DeleteFileW(path))
return 0;
- TRACE("failed (%d)\n",GetLastError());
+ TRACE("failed (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
@@ -972,7 +972,7 @@ int CDECL _commit(int fd)
}
else
{
- TRACE(":failed-last error (%d)\n",GetLastError());
+ TRACE(":failed-last error (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
ret = -1;
}
@@ -1083,7 +1083,7 @@ int CDECL _close(int fd)
ret = CloseHandle(info->handle) ? 0 : -1;
msvcrt_free_fd(fd);
if (ret) {
- WARN(":failed-last error (%d)\n",GetLastError());
+ WARN(":failed-last error (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
}
}
@@ -1309,7 +1309,7 @@ __int64 CDECL _lseeki64(int fd, __int64 offset, int whence)
return ofs.QuadPart;
}
release_ioinfo(info);
- TRACE(":error-last error (%d)\n",GetLastError());
+ TRACE(":error-last error (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
@@ -1369,7 +1369,7 @@ int CDECL _locking(int fd, int mode, __msvcrt_long nbytes)
return -1;
}
- TRACE(":fd (%d) by 0x%08Ix mode %s\n",
+ TRACE(":fd (%d) by 0x0%lx mode %s\n",
fd,nbytes,(mode==_LK_UNLCK)?"_LK_UNLCK":
(mode==_LK_LOCK)?"_LK_LOCK":
(mode==_LK_NBLCK)?"_LK_NBLCK":
@@ -1802,7 +1802,7 @@ int CDECL _fstat64(int fd, struct _stat64* buf)
if ((status = NtQueryInformationFile( info->handle, &io, &basic_info, sizeof(basic_info), FileBasicInformation )) ||
(status = NtQueryInformationFile( info->handle, &io, &std_info, sizeof(std_info), FileStandardInformation )))
{
- WARN(":failed-error %x\n",status);
+ WARN(":failed-error %lx\n",status);
msvcrt_set_errno(ERROR_INVALID_PARAMETER);
release_ioinfo(info);
return -1;
@@ -1816,7 +1816,7 @@ int CDECL _fstat64(int fd, struct _stat64* buf)
RtlTimeToSecondsSince1970((LARGE_INTEGER *)&basic_info.LastWriteTime, &dw);
buf->st_mtime = buf->st_ctime = dw;
buf->st_nlink = std_info.NumberOfLinks;
- TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",basic_info.FileAttributes, buf->st_mode);
+ TRACE(":dwFileAttributes = 0x%lx, mode set to 0x%x\n",basic_info.FileAttributes, buf->st_mode);
}
release_ioinfo(info);
return 0;
@@ -2303,7 +2303,7 @@ int CDECL _wsopen_dispatch( const wchar_t* path, int oflags, int shflags, int pm
hand = CreateFileW(path, access, sharing, &sa, creation, attrib, 0);
if (hand == INVALID_HANDLE_VALUE) {
- WARN(":failed-last error (%d)\n",GetLastError());
+ WARN(":failed-last error (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return *_errno();
}
@@ -2547,7 +2547,7 @@ int CDECL _open_osfhandle(intptr_t handle, int oflags)
flags |= split_oflags(oflags);
fd = msvcrt_alloc_fd((HANDLE)handle, flags);
- TRACE(":handle (%Iu) fd (%d) flags 0x%08x\n", handle, fd, flags);
+ TRACE(":handle (%Iu) fd (%d) flags 0x%08lx\n", handle, fd, flags);
return fd;
}
@@ -2913,14 +2913,14 @@ static int read_i(int fd, ioinfo *fdinfo, void *buf, unsigned int count)
}
else
{
- TRACE(":failed-last error (%d)\n",GetLastError());
+ TRACE(":failed-last error (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
}
if (count > 4)
- TRACE("(%u), %s\n",num_read,debugstr_an(buf, num_read));
+ TRACE("(%lu), %s\n",num_read,debugstr_an(buf, num_read));
return num_read;
}
@@ -3016,7 +3016,7 @@ int CDECL _stat64(const char* path, struct _stat64 * buf)
if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi))
{
- TRACE("failed (%d)\n",GetLastError());
+ TRACE("failed (%ld)\n",GetLastError());
*_errno() = ENOENT;
return -1;
}
@@ -3172,7 +3172,7 @@ int CDECL _wstat64(const wchar_t* path, struct _stat64 * buf)
if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi))
{
- TRACE("failed (%d)\n",GetLastError());
+ TRACE("failed (%ld)\n",GetLastError());
*_errno() = ENOENT;
return -1;
}
@@ -3323,7 +3323,7 @@ char * CDECL _tempnam(const char *dir, const char *prefix)
DeleteFileA(tmpbuf);
return _strdup(tmpbuf);
}
- TRACE("failed (%d)\n",GetLastError());
+ TRACE("failed (%ld)\n",GetLastError());
return NULL;
}
@@ -3344,7 +3344,7 @@ wchar_t * CDECL _wtempnam(const wchar_t *dir, const wchar_t *prefix)
DeleteFileW(tmpbuf);
return _wcsdup(tmpbuf);
}
- TRACE("failed (%d)\n",GetLastError());
+ TRACE("failed (%ld)\n",GetLastError());
return NULL;
}
@@ -3456,7 +3456,7 @@ int CDECL _write(int fd, const void* buf, unsigned int count)
if (!WriteFile(hand, buf, count, &num_written, NULL)
|| num_written != count)
{
- TRACE("WriteFile (fd %d, hand %p) failed-last error (%d)\n", fd,
+ TRACE("WriteFile (fd %d, hand %p) failed-last error (%ld)\n", fd,
hand, GetLastError());
msvcrt_set_errno(GetLastError());
num_written = -1;
@@ -3584,7 +3584,7 @@ int CDECL _write(int fd, const void* buf, unsigned int count)
if (num_written != j)
{
- TRACE("WriteFile/WriteConsoleW (fd %d, hand %p) failed-last error (%d)\n", fd,
+ TRACE("WriteFile/WriteConsoleW (fd %d, hand %p) failed-last error (%ld)\n", fd,
hand, GetLastError());
msvcrt_set_errno(GetLastError());
release_ioinfo(info);
@@ -4843,7 +4843,7 @@ int CDECL remove(const char *path)
TRACE("(%s)\n",path);
if (DeleteFileA(path))
return 0;
- TRACE(":failed (%d)\n",GetLastError());
+ TRACE(":failed (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
@@ -4856,7 +4856,7 @@ int CDECL _wremove(const wchar_t *path)
TRACE("(%s)\n",debugstr_w(path));
if (DeleteFileW(path))
return 0;
- TRACE(":failed (%d)\n",GetLastError());
+ TRACE(":failed (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
@@ -4869,7 +4869,7 @@ int CDECL rename(const char *oldpath,const char *newpath)
TRACE(":from %s to %s\n",oldpath,newpath);
if (MoveFileExA(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
return 0;
- TRACE(":failed (%d)\n",GetLastError());
+ TRACE(":failed (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
@@ -4882,7 +4882,7 @@ int CDECL _wrename(const wchar_t *oldpath,const wchar_t *newpath)
TRACE(":from %s to %s\n",debugstr_w(oldpath),debugstr_w(newpath));
if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
return 0;
- TRACE(":failed (%d)\n",GetLastError());
+ TRACE(":failed (%ld)\n",GetLastError());
msvcrt_set_errno(GetLastError());
return -1;
}
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 3b3d027f466..924671e7047 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -854,7 +854,7 @@ int CDECL __crtLCMapStringA(
WCHAR buf_out[32], *out = buf_out;
int in_len, out_len, r;
- TRACE("(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
+ TRACE("(lcid %lx, flags %lx, %s(%d), %p(%d), %x, %d), partial stub!\n",
lcid, mapflags, src, srclen, dst, dstlen, codepage, xflag);
in_len = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, src, srclen, NULL, 0);
@@ -904,7 +904,7 @@ done:
int CDECL __crtLCMapStringW(LCID lcid, DWORD mapflags, const wchar_t *src,
int srclen, wchar_t *dst, int dstlen, unsigned int codepage, int xflag)
{
- FIXME("(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
+ FIXME("(lcid %lx, flags %lx, %s(%d), %p(%d), %x, %d), partial stub!\n",
lcid, mapflags, debugstr_w(src), srclen, dst, dstlen, codepage, xflag);
return LCMapStringW(lcid, mapflags, src, srclen, dst, dstlen);
@@ -916,7 +916,7 @@ int CDECL __crtLCMapStringW(LCID lcid, DWORD mapflags, const wchar_t *src,
int CDECL __crtCompareStringA( LCID lcid, DWORD flags, const char *src1, int len1,
const char *src2, int len2 )
{
- FIXME("(lcid %x, flags %x, %s(%d), %s(%d), partial stub\n",
+ FIXME("(lcid %lx, flags %lx, %s(%d), %s(%d), partial stub\n",
lcid, flags, debugstr_a(src1), len1, debugstr_a(src2), len2 );
/* FIXME: probably not entirely right */
return CompareStringA( lcid, flags, src1, len1, src2, len2 );
@@ -928,7 +928,7 @@ int CDECL __crtCompareStringA( LCID lcid, DWORD flags, const char *src1, int len
int CDECL __crtCompareStringW( LCID lcid, DWORD flags, const wchar_t *src1, int len1,
const wchar_t *src2, int len2 )
{
- FIXME("(lcid %x, flags %x, %s(%d), %s(%d), partial stub\n",
+ FIXME("(lcid %lx, flags %lx, %s(%d), %s(%d), partial stub\n",
lcid, flags, debugstr_w(src1), len1, debugstr_w(src2), len2 );
/* FIXME: probably not entirely right */
return CompareStringW( lcid, flags, src1, len1, src2, len2 );
@@ -939,7 +939,7 @@ int CDECL __crtCompareStringW( LCID lcid, DWORD flags, const wchar_t *src1, int
*/
int CDECL __crtGetLocaleInfoW( LCID lcid, LCTYPE type, wchar_t *buffer, int len )
{
- FIXME("(lcid %x, type %x, %p(%d), partial stub\n", lcid, type, buffer, len );
+ FIXME("(lcid %lx, type %lx, %p(%d), partial stub\n", lcid, type, buffer, len );
/* FIXME: probably not entirely right */
return GetLocaleInfoW( lcid, type, buffer, len );
}
@@ -950,7 +950,7 @@ int CDECL __crtGetLocaleInfoW( LCID lcid, LCTYPE type, wchar_t *buffer, int len
*/
int CDECL __crtGetLocaleInfoEx( const WCHAR *locale, LCTYPE type, wchar_t *buffer, int len )
{
- TRACE("(%s, %x, %p, %d)\n", debugstr_w(locale), type, buffer, len);
+ TRACE("(%s, %lx, %p, %d)\n", debugstr_w(locale), type, buffer, len);
return GetLocaleInfoEx(locale, type, buffer, len);
}
#endif
@@ -964,7 +964,7 @@ int CDECL __crtGetLocaleInfoEx( const WCHAR *locale, LCTYPE type, wchar_t *buffe
BOOL CDECL __crtGetStringTypeW(DWORD unk, DWORD type,
wchar_t *buffer, int len, WORD *out)
{
- FIXME("(unk %x, type %x, wstr %p(%d), %p) partial stub\n",
+ FIXME("(unk %lx, type %lx, wstr %p(%d), %p) partial stub\n",
unk, type, buffer, len, out);
return GetStringTypeW(type, buffer, len, out);
diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c
index 23dfb24ac5d..db8554668ad 100644
--- a/dlls/msvcrt/main.c
+++ b/dlls/msvcrt/main.c
@@ -89,7 +89,7 @@ static inline void msvcrt_free_tls_mem(void)
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- TRACE("(%p, %s, %p) pid(%x), tid(%x), tls(%u)\n",
+ TRACE("(%p, %s, %p) pid(%lx), tid(%lx), tls(%lu)\n",
hinstDLL, msvcrt_get_reason(fdwReason), lpvReserved,
GetCurrentProcessId(), GetCurrentThreadId(),
msvcrt_tls_index);
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 33afe8d1d90..854403a71bf 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -10318,7 +10318,7 @@ double CDECL _except1(DWORD fpe, _FP_OPERATION_CODE op, double arg, double res,
WORD operation;
int raise = 0;
- TRACE("(%x %x %lf %lf %x %p)\n", fpe, op, arg, res, cw, unk);
+ TRACE("(%lx %x %lf %lf %lx %p)\n", fpe, op, arg, res, cw, unk);
#ifdef _WIN64
cw = ((cw >> 7) & 0x3f) | ((cw >> 3) & 0xc00);
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index 03af50d8b01..9758f354b89 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -325,7 +325,7 @@ threadmbcinfo* create_mbcinfo(int cp, LCID lcid, threadmbcinfo *old_mbcinfo)
ret = MultiByteToWideChar(newcp, 0, bufA, charcount, bufW, charcount);
if (ret != charcount)
- ERR("MultiByteToWideChar of chars failed for cp %d, ret=%d (exp %d), error=%d\n", newcp, ret, charcount, GetLastError());
+ ERR("MultiByteToWideChar of chars failed for cp %d, ret=%d (exp %d), error=%ld\n", newcp, ret, charcount, GetLastError());
GetStringTypeW(CT_CTYPE1, bufW, charcount, chartypes);
LCMapStringW(lcid, LCMAP_LOWERCASE, bufW, charcount, lowW, charcount);
@@ -350,7 +350,7 @@ threadmbcinfo* create_mbcinfo(int cp, LCID lcid, threadmbcinfo *old_mbcinfo)
ret = WideCharToMultiByte(newcp, 0, bufW, charcount, bufA, charcount, NULL, NULL);
if (ret != charcount)
- ERR("WideCharToMultiByte failed for cp %d, ret=%d (exp %d), error=%d\n", newcp, ret, charcount, GetLastError());
+ ERR("WideCharToMultiByte failed for cp %d, ret=%d (exp %d), error=%ld\n", newcp, ret, charcount, GetLastError());
charcount = 0;
for (i = 0; i < 256; i++)
diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c
index 73fadfcbb74..16188394b98 100644
--- a/dlls/msvcrt/misc.c
+++ b/dlls/msvcrt/misc.c
@@ -516,7 +516,7 @@ int CDECL __crtGetShowWindowMode(void)
STARTUPINFOW si;
GetStartupInfoW(&si);
- TRACE("flags=%x window=%d\n", si.dwFlags, si.wShowWindow);
+ TRACE("flags=%lx window=%d\n", si.dwFlags, si.wShowWindow);
return si.dwFlags & STARTF_USESHOWWINDOW ? si.wShowWindow : SW_SHOWDEFAULT;
}
@@ -526,7 +526,7 @@ int CDECL __crtGetShowWindowMode(void)
BOOL CDECL __crtInitializeCriticalSectionEx(
CRITICAL_SECTION *cs, DWORD spin_count, DWORD flags)
{
- TRACE("(%p %x %x)\n", cs, spin_count, flags);
+ TRACE("(%p %lx %lx)\n", cs, spin_count, flags);
return InitializeCriticalSectionEx(cs, spin_count, flags);
}
@@ -570,7 +570,7 @@ LONG CDECL __crtUnhandledException(EXCEPTION_POINTERS *ep)
*/
void CDECL __crtSleep(DWORD timeout)
{
- TRACE("(%u)\n", timeout);
+ TRACE("(%lu)\n", timeout);
Sleep(timeout);
}
diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c
index e71b949a6d5..6aad9a22d47 100644
--- a/dlls/msvcrt/thread.c
+++ b/dlls/msvcrt/thread.c
@@ -164,7 +164,7 @@ uintptr_t CDECL _beginthread(
(void*)start_address, &trampoline->module))
{
trampoline->module = NULL;
- WARN("failed to get module for the start_address: %d\n", GetLastError());
+ WARN("failed to get module for the start_address: %lu\n", GetLastError());
}
#endif
@@ -230,7 +230,7 @@ uintptr_t CDECL _beginthreadex(
(void*)start_address, &trampoline->module))
{
trampoline->module = NULL;
- WARN("failed to get module for the start_address: %d\n", GetLastError());
+ WARN("failed to get module for the start_address: %lu\n", GetLastError());
}
#endif
diff --git a/dlls/msvcrtd/Makefile.in b/dlls/msvcrtd/Makefile.in
index 7f9151d4c3a..bd4f78729d0 100644
--- a/dlls/msvcrtd/Makefile.in
+++ b/dlls/msvcrtd/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = msvcrtd.dll
IMPORTLIB = msvcrtd
IMPORTS = ntdll
diff --git a/dlls/ucrtbase/Makefile.in b/dlls/ucrtbase/Makefile.in
index e7d9951575e..bf7f62ada8a 100644
--- a/dlls/ucrtbase/Makefile.in
+++ b/dlls/ucrtbase/Makefile.in
@@ -1,4 +1,4 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES -D_CRTIMP=
+EXTRADEFS = -D_CRTIMP=
MODULE = ucrtbase.dll
IMPORTLIB = ucrtbase
IMPORTS = ntdll
2
17
[PATCH 1/2] winealsa: Remove the ability to read additional devices from the registry.
by Huw Davies 09 Feb '22
by Huw Davies 09 Feb '22
09 Feb '22
If necessary, this could be re-written using the NT registry api in
the unixlib.
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/winealsa.drv/mmdevdrv.c | 53 ------------------------------------
1 file changed, 53 deletions(-)
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index 5aa1b4aab63..8713b6153ce 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -165,9 +165,6 @@ static struct list g_sessions = LIST_INIT(g_sessions);
static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0};
static const char defname[] = "default";
-static const WCHAR drv_keyW[] = {'S','o','f','t','w','a','r','e','\\',
- 'W','i','n','e','\\','D','r','i','v','e','r','s','\\',
- 'w','i','n','e','a','l','s','a','.','d','r','v',0};
static const WCHAR drv_key_devicesW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','r','s','\\',
'w','i','n','e','a','l','s','a','.','d','r','v','\\','d','e','v','i','c','e','s',0};
@@ -474,54 +471,6 @@ static HRESULT alsa_get_card_devices(EDataFlow flow, snd_pcm_stream_t stream,
return S_OK;
}
-static void get_reg_devices(EDataFlow flow, snd_pcm_stream_t stream, WCHAR ***ids,
- GUID **guids, UINT *num)
-{
- static const WCHAR ALSAOutputDevices[] = {'A','L','S','A','O','u','t','p','u','t','D','e','v','i','c','e','s',0};
- static const WCHAR ALSAInputDevices[] = {'A','L','S','A','I','n','p','u','t','D','e','v','i','c','e','s',0};
- HKEY key;
- WCHAR reg_devices[256];
- DWORD size = sizeof(reg_devices), type;
- const WCHAR *value_name = (stream == SND_PCM_STREAM_PLAYBACK) ? ALSAOutputDevices : ALSAInputDevices;
-
- /* @@ Wine registry key: HKCU\Software\Wine\Drivers\winealsa.drv */
- if(RegOpenKeyW(HKEY_CURRENT_USER, drv_keyW, &key) == ERROR_SUCCESS){
- if(RegQueryValueExW(key, value_name, 0, &type,
- (BYTE*)reg_devices, &size) == ERROR_SUCCESS){
- WCHAR *p = reg_devices;
-
- if(type != REG_MULTI_SZ){
- ERR("Registry ALSA device list value type must be REG_MULTI_SZ\n");
- RegCloseKey(key);
- return;
- }
-
- while(*p){
- char devname[64];
-
- WideCharToMultiByte(CP_UNIXCP, 0, p, -1, devname, sizeof(devname), NULL, NULL);
-
- if(alsa_try_open(devname, stream)){
- if(*num){
- *ids = HeapReAlloc(GetProcessHeap(), 0, *ids, sizeof(WCHAR *) * (*num + 1));
- *guids = HeapReAlloc(GetProcessHeap(), 0, *guids, sizeof(GUID) * (*num + 1));
- }else{
- *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *));
- *guids = HeapAlloc(GetProcessHeap(), 0, sizeof(GUID));
- }
- (*ids)[*num] = construct_device_id(flow, p, NULL);
- get_device_guid(flow, devname, &(*guids)[*num]);
- ++*num;
- }
-
- p += lstrlenW(p) + 1;
- }
- }
-
- RegCloseKey(key);
- }
-}
-
struct card_type {
struct list entry;
int first_card_number;
@@ -570,8 +519,6 @@ static HRESULT alsa_enum_devices(EDataFlow flow, WCHAR ***ids, GUID **guids,
++*num;
}
- get_reg_devices(flow, stream, ids, guids, num);
-
for(err = snd_card_next(&card); card != -1 && err >= 0;
err = snd_card_next(&card)){
char cardpath[64];
--
2.25.1
2
1
From: Eric Pouech <eric.pouech(a)gmail.com>
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mf/Makefile.in | 1 -
dlls/mf/clock.c | 16 ++++----
dlls/mf/copier.c | 38 +++++++++---------
dlls/mf/evr.c | 36 ++++++++---------
dlls/mf/main.c | 20 +++++-----
dlls/mf/quality.c | 8 ++--
dlls/mf/samplegrabber.c | 26 ++++++-------
dlls/mf/sar.c | 58 +++++++++++++--------------
dlls/mf/session.c | 86 ++++++++++++++++++++---------------------
dlls/mf/topology.c | 58 +++++++++++++--------------
10 files changed, 173 insertions(+), 174 deletions(-)
diff --git a/dlls/mf/Makefile.in b/dlls/mf/Makefile.in
index cbb41fb8d74..36727d4d4e3 100644
--- a/dlls/mf/Makefile.in
+++ b/dlls/mf/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = mf.dll
IMPORTLIB = mf
IMPORTS = advapi32 mfplat ole32 uuid mfuuid strmiids
diff --git a/dlls/mf/clock.c b/dlls/mf/clock.c
index 4a3ad7ec7c1..e9877533a5a 100644
--- a/dlls/mf/clock.c
+++ b/dlls/mf/clock.c
@@ -158,7 +158,7 @@ static ULONG WINAPI sink_notification_AddRef(IUnknown *iface)
struct sink_notification *notification = impl_sink_notification_from_IUnknown(iface);
ULONG refcount = InterlockedIncrement(¬ification->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -168,7 +168,7 @@ static ULONG WINAPI sink_notification_Release(IUnknown *iface)
struct sink_notification *notification = impl_sink_notification_from_IUnknown(iface);
ULONG refcount = InterlockedDecrement(¬ification->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -253,7 +253,7 @@ static ULONG WINAPI present_clock_AddRef(IMFPresentationClock *iface)
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
ULONG refcount = InterlockedIncrement(&clock->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -265,7 +265,7 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface)
struct clock_timer *timer, *timer2;
struct clock_sink *sink, *sink2;
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -312,7 +312,7 @@ static HRESULT WINAPI present_clock_GetCorrelatedTime(IMFPresentationClock *ifac
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
HRESULT hr = MF_E_CLOCK_NO_TIME_SOURCE;
- TRACE("%p, %#x, %p, %p.\n", iface, reserved, clock_time, system_time);
+ TRACE("%p, %#lx, %p, %p.\n", iface, reserved, clock_time, system_time);
EnterCriticalSection(&clock->cs);
if (clock->time_source)
@@ -335,7 +335,7 @@ static HRESULT WINAPI present_clock_GetState(IMFPresentationClock *iface, DWORD
{
struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
- TRACE("%p, %#x, %p.\n", iface, reserved, state);
+ TRACE("%p, %#lx, %p.\n", iface, reserved, state);
EnterCriticalSection(&clock->cs);
*state = clock->state;
@@ -816,7 +816,7 @@ static HRESULT present_clock_schedule_timer(struct presentation_clock *clock, DW
{
if (FAILED(hr = IMFPresentationTimeSource_GetCorrelatedTime(clock->time_source, 0, &clocktime, &systime)))
{
- WARN("Failed to get clock time, hr %#x.\n", hr);
+ WARN("Failed to get clock time, hr %#lx.\n", hr);
return hr;
}
time -= clocktime;
@@ -885,7 +885,7 @@ static HRESULT WINAPI present_clock_timer_SetTimer(IMFTimer *iface, DWORD flags,
struct clock_timer *clock_timer;
HRESULT hr;
- TRACE("%p, %#x, %s, %p, %p, %p.\n", iface, flags, debugstr_time(time), callback, state, cancel_key);
+ TRACE("%p, %#lx, %s, %p, %p, %p.\n", iface, flags, debugstr_time(time), callback, state, cancel_key);
if (!(clock_timer = calloc(1, sizeof(*clock_timer))))
return E_OUTOFMEMORY;
diff --git a/dlls/mf/copier.c b/dlls/mf/copier.c
index fe5664ee4c7..ab995fb98db 100644
--- a/dlls/mf/copier.c
+++ b/dlls/mf/copier.c
@@ -72,7 +72,7 @@ static ULONG WINAPI sample_copier_transform_AddRef(IMFTransform *iface)
struct sample_copier *transform = impl_from_IMFTransform(iface);
ULONG refcount = InterlockedIncrement(&transform->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -82,7 +82,7 @@ static ULONG WINAPI sample_copier_transform_Release(IMFTransform *iface)
struct sample_copier *transform = impl_from_IMFTransform(iface);
ULONG refcount = InterlockedDecrement(&transform->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -120,7 +120,7 @@ static HRESULT WINAPI sample_copier_transform_GetStreamCount(IMFTransform *iface
static HRESULT WINAPI sample_copier_transform_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs,
DWORD output_size, DWORD *outputs)
{
- TRACE("%p, %u, %p, %u, %p.\n", iface, input_size, inputs, output_size, outputs);
+ TRACE("%p, %lu, %p, %lu, %p.\n", iface, input_size, inputs, output_size, outputs);
return E_NOTIMPL;
}
@@ -129,7 +129,7 @@ static HRESULT WINAPI sample_copier_transform_GetInputStreamInfo(IMFTransform *i
{
struct sample_copier *transform = impl_from_IMFTransform(iface);
- TRACE("%p, %u, %p.\n", iface, id, info);
+ TRACE("%p, %lu, %p.\n", iface, id, info);
memset(info, 0, sizeof(*info));
@@ -145,7 +145,7 @@ static HRESULT WINAPI sample_copier_transform_GetOutputStreamInfo(IMFTransform *
{
struct sample_copier *transform = impl_from_IMFTransform(iface);
- TRACE("%p, %u, %p.\n", iface, id, info);
+ TRACE("%p, %lu, %p.\n", iface, id, info);
memset(info, 0, sizeof(*info));
@@ -171,7 +171,7 @@ static HRESULT WINAPI sample_copier_transform_GetAttributes(IMFTransform *iface,
static HRESULT WINAPI sample_copier_transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
- TRACE("%p, %u, %p.\n", iface, id, attributes);
+ TRACE("%p, %lu, %p.\n", iface, id, attributes);
return E_NOTIMPL;
}
@@ -179,21 +179,21 @@ static HRESULT WINAPI sample_copier_transform_GetInputStreamAttributes(IMFTransf
static HRESULT WINAPI sample_copier_transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
- TRACE("%p, %u, %p.\n", iface, id, attributes);
+ TRACE("%p, %lu, %p.\n", iface, id, attributes);
return E_NOTIMPL;
}
static HRESULT WINAPI sample_copier_transform_DeleteInputStream(IMFTransform *iface, DWORD id)
{
- TRACE("%p, %u.\n", iface, id);
+ TRACE("%p, %lu.\n", iface, id);
return E_NOTIMPL;
}
static HRESULT WINAPI sample_copier_transform_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids)
{
- TRACE("%p, %u, %p.\n", iface, streams, ids);
+ TRACE("%p, %lu, %p.\n", iface, streams, ids);
return E_NOTIMPL;
}
@@ -204,7 +204,7 @@ static HRESULT WINAPI sample_copier_transform_GetInputAvailableType(IMFTransform
static const GUID *types[] = { &MFMediaType_Video, &MFMediaType_Audio };
HRESULT hr;
- TRACE("%p, %u, %u, %p.\n", iface, id, index, type);
+ TRACE("%p, %lu, %lu, %p.\n", iface, id, index, type);
if (id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -225,7 +225,7 @@ static HRESULT WINAPI sample_copier_transform_GetOutputAvailableType(IMFTransfor
IMFMediaType *cloned_type = NULL;
HRESULT hr = S_OK;
- TRACE("%p, %u, %u, %p.\n", iface, id, index, type);
+ TRACE("%p, %lu, %lu, %p.\n", iface, id, index, type);
EnterCriticalSection(&transform->cs);
if (transform->buffer_type)
@@ -326,7 +326,7 @@ static HRESULT WINAPI sample_copier_transform_SetInputType(IMFTransform *iface,
{
struct sample_copier *transform = impl_from_IMFTransform(iface);
- TRACE("%p, %u, %p, %#x.\n", iface, id, type, flags);
+ TRACE("%p, %lu, %p, %#lx.\n", iface, id, type, flags);
return sample_copier_set_media_type(transform, TRUE, id, type, flags);
}
@@ -335,7 +335,7 @@ static HRESULT WINAPI sample_copier_transform_SetOutputType(IMFTransform *iface,
{
struct sample_copier *transform = impl_from_IMFTransform(iface);
- TRACE("%p, %u, %p, %#x.\n", iface, id, type, flags);
+ TRACE("%p, %lu, %p, %#lx.\n", iface, id, type, flags);
return sample_copier_set_media_type(transform, FALSE, id, type, flags);
}
@@ -371,7 +371,7 @@ static HRESULT WINAPI sample_copier_transform_GetInputCurrentType(IMFTransform *
{
struct sample_copier *transform = impl_from_IMFTransform(iface);
- TRACE("%p, %u, %p.\n", iface, id, type);
+ TRACE("%p, %lu, %p.\n", iface, id, type);
return sample_copier_get_current_type(transform, id, SAMPLE_COPIER_INPUT_TYPE_SET, type);
}
@@ -380,7 +380,7 @@ static HRESULT WINAPI sample_copier_transform_GetOutputCurrentType(IMFTransform
{
struct sample_copier *transform = impl_from_IMFTransform(iface);
- TRACE("%p, %u, %p.\n", iface, id, type);
+ TRACE("%p, %lu, %p.\n", iface, id, type);
return sample_copier_get_current_type(transform, id, SAMPLE_COPIER_OUTPUT_TYPE_SET, type);
}
@@ -390,7 +390,7 @@ static HRESULT WINAPI sample_copier_transform_GetInputStatus(IMFTransform *iface
struct sample_copier *transform = impl_from_IMFTransform(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, id, flags);
+ TRACE("%p, %lu, %p.\n", iface, id, flags);
if (id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -431,7 +431,7 @@ static HRESULT WINAPI sample_copier_transform_SetOutputBounds(IMFTransform *ifac
static HRESULT WINAPI sample_copier_transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event)
{
- FIXME("%p, %u, %p.\n", iface, id, event);
+ FIXME("%p, %lu, %p.\n", iface, id, event);
return E_NOTIMPL;
}
@@ -463,7 +463,7 @@ static HRESULT WINAPI sample_copier_transform_ProcessInput(IMFTransform *iface,
struct sample_copier *transform = impl_from_IMFTransform(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p, %#x.\n", iface, id, sample, flags);
+ TRACE("%p, %lu, %p, %#lx.\n", iface, id, sample, flags);
if (id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -492,7 +492,7 @@ static HRESULT WINAPI sample_copier_transform_ProcessOutput(IMFTransform *iface,
HRESULT hr = S_OK;
LONGLONG time;
- TRACE("%p, %#x, %u, %p, %p.\n", iface, flags, count, buffers, status);
+ TRACE("%p, %#lx, %lu, %p, %p.\n", iface, flags, count, buffers, status);
EnterCriticalSection(&transform->cs);
if (!(transform->flags & SAMPLE_COPIER_OUTPUT_TYPE_SET))
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c
index 5e8b559af04..eae8338df7a 100644
--- a/dlls/mf/evr.c
+++ b/dlls/mf/evr.c
@@ -267,7 +267,7 @@ static ULONG WINAPI video_stream_sink_AddRef(IMFStreamSink *iface)
struct video_stream *stream = impl_from_IMFStreamSink(iface);
ULONG refcount = InterlockedIncrement(&stream->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -296,7 +296,7 @@ static HRESULT WINAPI video_stream_sink_GetEvent(IMFStreamSink *iface, DWORD fla
{
struct video_stream *stream = impl_from_IMFStreamSink(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
return IMFMediaEventQueue_GetEvent(stream->event_queue, flags, event);
}
@@ -325,7 +325,7 @@ static HRESULT WINAPI video_stream_sink_QueueEvent(IMFStreamSink *iface, MediaEv
{
struct video_stream *stream = impl_from_IMFStreamSink(iface);
- TRACE("%p, %d, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %ld, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
return IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, event_type, ext_type, hr, value);
}
@@ -403,7 +403,7 @@ static HRESULT WINAPI video_stream_sink_ProcessSample(IMFStreamSink *iface, IMFS
hr = MF_E_NO_CLOCK;
else if (FAILED(hr = IMFSample_GetSampleTime(sample, ×tamp)))
{
- WARN("No sample timestamp, hr %#x.\n", hr);
+ WARN("No sample timestamp, hr %#lx.\n", hr);
}
else if (stream->parent->state == EVR_STATE_RUNNING || stream->flags & EVR_STREAM_PREROLLING)
{
@@ -551,7 +551,7 @@ static HRESULT WINAPI video_stream_typehandler_GetMediaTypeCount(IMFMediaTypeHan
static HRESULT WINAPI video_stream_typehandler_GetMediaTypeByIndex(IMFMediaTypeHandler *iface, DWORD index,
IMFMediaType **type)
{
- TRACE("%p, %u, %p.\n", iface, index, type);
+ TRACE("%p, %lu, %p.\n", iface, index, type);
return MF_E_NO_MORE_TYPES;
}
@@ -1153,7 +1153,7 @@ static ULONG WINAPI video_renderer_sink_AddRef(IMFMediaSink *iface)
{
struct video_renderer *renderer = impl_from_IMFMediaSink(iface);
ULONG refcount = InterlockedIncrement(&renderer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -1162,7 +1162,7 @@ static ULONG WINAPI video_renderer_sink_Release(IMFMediaSink *iface)
struct video_renderer *renderer = impl_from_IMFMediaSink(iface);
ULONG refcount = InterlockedDecrement(&renderer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -1230,7 +1230,7 @@ static HRESULT WINAPI video_renderer_sink_AddStreamSink(IMFMediaSink *iface, DWO
struct video_renderer *renderer = impl_from_IMFMediaSink(iface);
HRESULT hr;
- TRACE("%p, %#x, %p, %p.\n", iface, id, media_type, stream_sink);
+ TRACE("%p, %#lx, %p, %p.\n", iface, id, media_type, stream_sink);
/* Rely on mixer for stream id validation. */
@@ -1254,7 +1254,7 @@ static HRESULT WINAPI video_renderer_sink_RemoveStreamSink(IMFMediaSink *iface,
HRESULT hr;
size_t i;
- TRACE("%p, %#x.\n", iface, id);
+ TRACE("%p, %#lx.\n", iface, id);
/* Rely on mixer for stream id validation. */
@@ -1309,7 +1309,7 @@ static HRESULT WINAPI video_renderer_sink_GetStreamSinkByIndex(IMFMediaSink *ifa
struct video_renderer *renderer = impl_from_IMFMediaSink(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, stream);
+ TRACE("%p, %lu, %p.\n", iface, index, stream);
EnterCriticalSection(&renderer->cs);
if (renderer->flags & EVR_SHUT_DOWN)
@@ -1335,7 +1335,7 @@ static HRESULT WINAPI video_renderer_sink_GetStreamSinkById(IMFMediaSink *iface,
HRESULT hr = S_OK;
size_t i;
- TRACE("%p, %#x, %p.\n", iface, id, stream);
+ TRACE("%p, %#lx, %p.\n", iface, id, stream);
EnterCriticalSection(&renderer->cs);
if (renderer->flags & EVR_SHUT_DOWN)
@@ -1747,7 +1747,7 @@ static HRESULT WINAPI video_renderer_InitializeRenderer(IMFVideoRenderer *iface,
IMFTransform_AddRef(mixer);
else if (FAILED(hr = video_renderer_create_mixer(NULL, &mixer)))
{
- WARN("Failed to create default mixer object, hr %#x.\n", hr);
+ WARN("Failed to create default mixer object, hr %#lx.\n", hr);
return hr;
}
@@ -1755,7 +1755,7 @@ static HRESULT WINAPI video_renderer_InitializeRenderer(IMFVideoRenderer *iface,
IMFVideoPresenter_AddRef(presenter);
else if (FAILED(hr = video_renderer_create_presenter(renderer, NULL, &presenter)))
{
- WARN("Failed to create default presenter, hr %#x.\n", hr);
+ WARN("Failed to create default presenter, hr %#lx.\n", hr);
IMFTransform_Release(mixer);
return hr;
}
@@ -1810,7 +1810,7 @@ static HRESULT WINAPI video_renderer_events_GetEvent(IMFMediaEventGenerator *ifa
{
struct video_renderer *renderer = impl_from_IMFMediaEventGenerator(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
return IMFMediaEventQueue_GetEvent(renderer->event_queue, flags, event);
}
@@ -1840,7 +1840,7 @@ static HRESULT WINAPI video_renderer_events_QueueEvent(IMFMediaEventGenerator *i
{
struct video_renderer *renderer = impl_from_IMFMediaEventGenerator(iface);
- TRACE("%p, %u, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
return IMFMediaEventQueue_QueueEventParamVar(renderer->event_queue, event_type, ext_type, hr, value);
}
@@ -2143,7 +2143,7 @@ static HRESULT WINAPI video_renderer_service_lookup_LookupService(IMFTopologySer
struct video_renderer *renderer = impl_from_IMFTopologyServiceLookup(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %u, %s, %s, %p, %p.\n", iface, lookup_type, index, debugstr_guid(service), debugstr_guid(riid),
+ TRACE("%p, %u, %lu, %s, %s, %p, %p.\n", iface, lookup_type, index, debugstr_guid(service), debugstr_guid(riid),
objects, num_objects);
EnterCriticalSection(&renderer->cs);
@@ -2237,7 +2237,7 @@ static HRESULT WINAPI video_renderer_event_sink_Notify(IMediaEventSink *iface, L
HRESULT hr = S_OK;
unsigned int idx;
- TRACE("%p, %d, %ld, %ld.\n", iface, event, param1, param2);
+ TRACE("%p, %ld, %Id, %Id.\n", iface, event, param1, param2);
EnterCriticalSection(&renderer->cs);
@@ -2275,7 +2275,7 @@ static HRESULT WINAPI video_renderer_event_sink_Notify(IMediaEventSink *iface, L
}
else
{
- WARN("Unhandled event %d.\n", event);
+ WARN("Unhandled event %ld.\n", event);
hr = MF_E_UNEXPECTED;
}
diff --git a/dlls/mf/main.c b/dlls/mf/main.c
index 50451170275..6b1d9293c8a 100644
--- a/dlls/mf/main.c
+++ b/dlls/mf/main.c
@@ -73,7 +73,7 @@ static ULONG WINAPI activate_object_AddRef(IMFActivate *iface)
struct activate_object *activate = impl_from_IMFActivate(iface);
ULONG refcount = InterlockedIncrement(&activate->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -83,7 +83,7 @@ static ULONG WINAPI activate_object_Release(IMFActivate *iface)
struct activate_object *activate = impl_from_IMFActivate(iface);
ULONG refcount = InterlockedDecrement(&activate->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -597,7 +597,7 @@ static ULONG WINAPI file_scheme_handler_AddRef(IMFSchemeHandler *iface)
struct file_scheme_handler *handler = impl_from_IMFSchemeHandler(iface);
ULONG refcount = InterlockedIncrement(&handler->refcount);
- TRACE("%p, refcount %u.\n", handler, refcount);
+ TRACE("%p, refcount %lu.\n", handler, refcount);
return refcount;
}
@@ -608,7 +608,7 @@ static ULONG WINAPI file_scheme_handler_Release(IMFSchemeHandler *iface)
ULONG refcount = InterlockedDecrement(&handler->refcount);
struct file_scheme_handler_result *result, *next;
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -665,7 +665,7 @@ static ULONG WINAPI create_object_context_AddRef(IUnknown *iface)
struct create_object_context *context = impl_from_IUnknown(iface);
ULONG refcount = InterlockedIncrement(&context->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -675,7 +675,7 @@ static ULONG WINAPI create_object_context_Release(IUnknown *iface)
struct create_object_context *context = impl_from_IUnknown(iface);
ULONG refcount = InterlockedDecrement(&context->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -703,7 +703,7 @@ static HRESULT WINAPI file_scheme_handler_BeginCreateObject(IMFSchemeHandler *if
IMFAsyncResult *caller, *item;
HRESULT hr;
- TRACE("%p, %s, %#x, %p, %p, %p, %p.\n", iface, debugstr_w(url), flags, props, cancel_cookie, callback, state);
+ TRACE("%p, %s, %#lx, %p, %p, %p, %p.\n", iface, debugstr_w(url), flags, props, cancel_cookie, callback, state);
if (cancel_cookie)
*cancel_cookie = NULL;
@@ -1238,7 +1238,7 @@ static ULONG WINAPI simple_type_handler_AddRef(IMFMediaTypeHandler *iface)
struct simple_type_handler *handler = impl_from_IMFMediaTypeHandler(iface);
ULONG refcount = InterlockedIncrement(&handler->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -1248,7 +1248,7 @@ static ULONG WINAPI simple_type_handler_Release(IMFMediaTypeHandler *iface)
struct simple_type_handler *handler = impl_from_IMFMediaTypeHandler(iface);
ULONG refcount = InterlockedDecrement(&handler->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -1304,7 +1304,7 @@ static HRESULT WINAPI simple_type_handler_GetMediaTypeByIndex(IMFMediaTypeHandle
{
struct simple_type_handler *handler = impl_from_IMFMediaTypeHandler(iface);
- TRACE("%p, %u, %p.\n", iface, index, type);
+ TRACE("%p, %lu, %p.\n", iface, index, type);
if (index > 0)
return MF_E_NO_MORE_TYPES;
diff --git a/dlls/mf/quality.c b/dlls/mf/quality.c
index 6c71a5a71c6..a611d6fdaed 100644
--- a/dlls/mf/quality.c
+++ b/dlls/mf/quality.c
@@ -86,7 +86,7 @@ static ULONG WINAPI standard_quality_manager_AddRef(IMFQualityManager *iface)
struct quality_manager *manager = impl_from_IMFQualityManager(iface);
ULONG refcount = InterlockedIncrement(&manager->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -96,7 +96,7 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
struct quality_manager *manager = impl_from_IMFQualityManager(iface);
ULONG refcount = InterlockedDecrement(&manager->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -178,7 +178,7 @@ static HRESULT WINAPI standard_quality_manager_NotifyPresentationClock(IMFQualit
static HRESULT WINAPI standard_quality_manager_NotifyProcessInput(IMFQualityManager *iface, IMFTopologyNode *node,
LONG input_index, IMFSample *sample)
{
- TRACE("%p, %p, %d, %p stub.\n", iface, node, input_index, sample);
+ TRACE("%p, %p, %ld, %p stub.\n", iface, node, input_index, sample);
return E_NOTIMPL;
}
@@ -186,7 +186,7 @@ static HRESULT WINAPI standard_quality_manager_NotifyProcessInput(IMFQualityMana
static HRESULT WINAPI standard_quality_manager_NotifyProcessOutput(IMFQualityManager *iface, IMFTopologyNode *node,
LONG output_index, IMFSample *sample)
{
- TRACE("%p, %p, %d, %p stub.\n", iface, node, output_index, sample);
+ TRACE("%p, %p, %ld, %p stub.\n", iface, node, output_index, sample);
return E_NOTIMPL;
}
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c
index e7d3be68df3..f711f6d8c44 100644
--- a/dlls/mf/samplegrabber.c
+++ b/dlls/mf/samplegrabber.c
@@ -206,7 +206,7 @@ static HRESULT WINAPI sample_grabber_stream_GetEvent(IMFStreamSink *iface, DWORD
{
struct sample_grabber *grabber = impl_from_IMFStreamSink(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
if (grabber->is_shut_down)
return MF_E_STREAMSINK_REMOVED;
@@ -245,7 +245,7 @@ static HRESULT WINAPI sample_grabber_stream_QueueEvent(IMFStreamSink *iface, Med
{
struct sample_grabber *grabber = impl_from_IMFStreamSink(iface);
- TRACE("%p, %u, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
if (grabber->is_shut_down)
return MF_E_STREAMSINK_REMOVED;
@@ -614,7 +614,7 @@ static HRESULT WINAPI sample_grabber_stream_type_handler_GetMediaTypeCount(IMFMe
static HRESULT WINAPI sample_grabber_stream_type_handler_GetMediaTypeByIndex(IMFMediaTypeHandler *iface, DWORD index,
IMFMediaType **media_type)
{
- TRACE("%p, %u, %p.\n", iface, index, media_type);
+ TRACE("%p, %lu, %p.\n", iface, index, media_type);
if (!media_type)
return E_POINTER;
@@ -741,14 +741,14 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba
if (!sample_reported)
{
if (FAILED(hr = sample_grabber_report_sample(grabber, item->u.sample, &sample_delivered)))
- WARN("Failed to report a sample, hr %#x.\n", hr);
+ WARN("Failed to report a sample, hr %#lx.\n", hr);
stream_release_pending_item(item);
sample_reported = TRUE;
}
else
{
if (FAILED(hr = stream_schedule_sample(grabber, item)))
- WARN("Failed to schedule a sample, hr %#x.\n", hr);
+ WARN("Failed to schedule a sample, hr %#lx.\n", hr);
break;
}
}
@@ -814,7 +814,7 @@ static ULONG WINAPI sample_grabber_sink_AddRef(IMFMediaSink *iface)
struct sample_grabber *grabber = impl_from_IMFMediaSink(iface);
ULONG refcount = InterlockedIncrement(&grabber->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -834,7 +834,7 @@ static ULONG WINAPI sample_grabber_sink_Release(IMFMediaSink *iface)
struct sample_grabber *grabber = impl_from_IMFMediaSink(iface);
ULONG refcount = InterlockedDecrement(&grabber->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -888,7 +888,7 @@ static HRESULT WINAPI sample_grabber_sink_AddStreamSink(IMFMediaSink *iface, DWO
{
struct sample_grabber *grabber = impl_from_IMFMediaSink(iface);
- TRACE("%p, %#x, %p, %p.\n", iface, stream_sink_id, media_type, stream_sink);
+ TRACE("%p, %#lx, %p, %p.\n", iface, stream_sink_id, media_type, stream_sink);
return grabber->is_shut_down ? MF_E_SHUTDOWN : MF_E_STREAMSINKS_FIXED;
}
@@ -897,7 +897,7 @@ static HRESULT WINAPI sample_grabber_sink_RemoveStreamSink(IMFMediaSink *iface,
{
struct sample_grabber *grabber = impl_from_IMFMediaSink(iface);
- TRACE("%p, %#x.\n", iface, stream_sink_id);
+ TRACE("%p, %#lx.\n", iface, stream_sink_id);
return grabber->is_shut_down ? MF_E_SHUTDOWN : MF_E_STREAMSINKS_FIXED;
}
@@ -922,7 +922,7 @@ static HRESULT WINAPI sample_grabber_sink_GetStreamSinkByIndex(IMFMediaSink *ifa
struct sample_grabber *grabber = impl_from_IMFMediaSink(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, stream);
+ TRACE("%p, %lu, %p.\n", iface, index, stream);
if (grabber->is_shut_down)
return MF_E_SHUTDOWN;
@@ -950,7 +950,7 @@ static HRESULT WINAPI sample_grabber_sink_GetStreamSinkById(IMFMediaSink *iface,
struct sample_grabber *grabber = impl_from_IMFMediaSink(iface);
HRESULT hr = S_OK;
- TRACE("%p, %#x, %p.\n", iface, stream_sink_id, stream);
+ TRACE("%p, %#lx, %p.\n", iface, stream_sink_id, stream);
EnterCriticalSection(&grabber->cs);
@@ -1233,7 +1233,7 @@ static HRESULT WINAPI sample_grabber_events_GetEvent(IMFMediaEventGenerator *ifa
{
struct sample_grabber *grabber = impl_from_IMFMediaEventGenerator(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
return IMFMediaEventQueue_GetEvent(grabber->event_queue, flags, event);
}
@@ -1263,7 +1263,7 @@ static HRESULT WINAPI sample_grabber_events_QueueEvent(IMFMediaEventGenerator *i
{
struct sample_grabber *grabber = impl_from_IMFMediaEventGenerator(iface);
- TRACE("%p, %u, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
return IMFMediaEventQueue_QueueEventParamVar(grabber->event_queue, event_type, ext_type, hr, value);
}
diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c
index 3c9bac90c9f..33040be3ed0 100644
--- a/dlls/mf/sar.c
+++ b/dlls/mf/sar.c
@@ -223,7 +223,7 @@ static ULONG WINAPI audio_renderer_sink_AddRef(IMFMediaSink *iface)
{
struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
ULONG refcount = InterlockedIncrement(&renderer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -262,7 +262,7 @@ static ULONG WINAPI audio_renderer_sink_Release(IMFMediaSink *iface)
struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
ULONG refcount = InterlockedDecrement(&renderer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -306,7 +306,7 @@ static HRESULT WINAPI audio_renderer_sink_AddStreamSink(IMFMediaSink *iface, DWO
{
struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
- TRACE("%p, %#x, %p, %p.\n", iface, stream_sink_id, media_type, stream_sink);
+ TRACE("%p, %#lx, %p, %p.\n", iface, stream_sink_id, media_type, stream_sink);
return renderer->flags & SAR_SHUT_DOWN ? MF_E_SHUTDOWN : MF_E_STREAMSINKS_FIXED;
}
@@ -315,7 +315,7 @@ static HRESULT WINAPI audio_renderer_sink_RemoveStreamSink(IMFMediaSink *iface,
{
struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
- TRACE("%p, %#x.\n", iface, stream_sink_id);
+ TRACE("%p, %#lx.\n", iface, stream_sink_id);
return renderer->flags & SAR_SHUT_DOWN ? MF_E_SHUTDOWN : MF_E_STREAMSINKS_FIXED;
}
@@ -343,7 +343,7 @@ static HRESULT WINAPI audio_renderer_sink_GetStreamSinkByIndex(IMFMediaSink *ifa
struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, stream);
+ TRACE("%p, %lu, %p.\n", iface, index, stream);
EnterCriticalSection(&renderer->cs);
@@ -368,7 +368,7 @@ static HRESULT WINAPI audio_renderer_sink_GetStreamSinkById(IMFMediaSink *iface,
struct audio_renderer *renderer = impl_from_IMFMediaSink(iface);
HRESULT hr = S_OK;
- TRACE("%p, %#x, %p.\n", iface, stream_sink_id, stream);
+ TRACE("%p, %#lx, %p.\n", iface, stream_sink_id, stream);
EnterCriticalSection(&renderer->cs);
@@ -557,7 +557,7 @@ static HRESULT WINAPI audio_renderer_events_GetEvent(IMFMediaEventGenerator *ifa
{
struct audio_renderer *renderer = impl_from_IMFMediaEventGenerator(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
return IMFMediaEventQueue_GetEvent(renderer->event_queue, flags, event);
}
@@ -587,7 +587,7 @@ static HRESULT WINAPI audio_renderer_events_QueueEvent(IMFMediaEventGenerator *i
{
struct audio_renderer *renderer = impl_from_IMFMediaEventGenerator(iface);
- TRACE("%p, %u, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
return IMFMediaEventQueue_QueueEventParamVar(renderer->event_queue, event_type, ext_type, hr, value);
}
@@ -634,7 +634,7 @@ static HRESULT WINAPI audio_renderer_clock_sink_OnClockStart(IMFClockStateSink *
if (renderer->state == STREAM_STATE_STOPPED)
{
if (FAILED(hr = IAudioClient_Start(renderer->audio_client)))
- WARN("Failed to start audio client, hr %#x.\n", hr);
+ WARN("Failed to start audio client, hr %#lx.\n", hr);
renderer->state = STREAM_STATE_RUNNING;
}
}
@@ -664,10 +664,10 @@ static HRESULT WINAPI audio_renderer_clock_sink_OnClockStop(IMFClockStateSink *i
if (SUCCEEDED(hr = IAudioClient_Stop(renderer->audio_client)))
{
if (FAILED(hr = IAudioClient_Reset(renderer->audio_client)))
- WARN("Failed to reset audio client, hr %#x.\n", hr);
+ WARN("Failed to reset audio client, hr %#lx.\n", hr);
}
else
- WARN("Failed to stop audio client, hr %#x.\n", hr);
+ WARN("Failed to stop audio client, hr %#lx.\n", hr);
renderer->state = STREAM_STATE_STOPPED;
renderer->flags &= ~SAR_PREROLLED;
}
@@ -694,7 +694,7 @@ static HRESULT WINAPI audio_renderer_clock_sink_OnClockPause(IMFClockStateSink *
if (renderer->audio_client)
{
if (FAILED(hr = IAudioClient_Stop(renderer->audio_client)))
- WARN("Failed to stop audio client, hr %#x.\n", hr);
+ WARN("Failed to stop audio client, hr %#lx.\n", hr);
renderer->state = STREAM_STATE_PAUSED;
}
else
@@ -723,7 +723,7 @@ static HRESULT WINAPI audio_renderer_clock_sink_OnClockRestart(IMFClockStateSink
if ((preroll = (renderer->state != STREAM_STATE_RUNNING)))
{
if (FAILED(hr = IAudioClient_Start(renderer->audio_client)))
- WARN("Failed to start audio client, hr %#x.\n", hr);
+ WARN("Failed to start audio client, hr %#lx.\n", hr);
renderer->state = STREAM_STATE_RUNNING;
}
}
@@ -1236,7 +1236,7 @@ static HRESULT WINAPI audio_renderer_stream_GetEvent(IMFStreamSink *iface, DWORD
{
struct audio_renderer *renderer = impl_from_IMFStreamSink(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
if (renderer->flags & SAR_SHUT_DOWN)
return MF_E_STREAMSINK_REMOVED;
@@ -1275,7 +1275,7 @@ static HRESULT WINAPI audio_renderer_stream_QueueEvent(IMFStreamSink *iface, Med
{
struct audio_renderer *renderer = impl_from_IMFStreamSink(iface);
- TRACE("%p, %u, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %lu, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
if (renderer->flags & SAR_SHUT_DOWN)
return MF_E_STREAMSINK_REMOVED;
@@ -1519,7 +1519,7 @@ static HRESULT WINAPI audio_renderer_stream_type_handler_GetMediaTypeByIndex(IMF
{
struct audio_renderer *renderer = impl_from_IMFMediaTypeHandler(iface);
- TRACE("%p, %u, %p.\n", iface, index, media_type);
+ TRACE("%p, %lu, %p.\n", iface, index, media_type);
if (index == 0)
{
@@ -1543,14 +1543,14 @@ static HRESULT audio_renderer_create_audio_client(struct audio_renderer *rendere
(void **)&renderer->audio_client);
if (FAILED(hr))
{
- WARN("Failed to create audio client, hr %#x.\n", hr);
+ WARN("Failed to create audio client, hr %#lx.\n", hr);
return hr;
}
/* FIXME: for now always use default format. */
if (FAILED(hr = IAudioClient_GetMixFormat(renderer->audio_client, &wfx)))
{
- WARN("Failed to get audio format, hr %#x.\n", hr);
+ WARN("Failed to get audio format, hr %#lx.\n", hr);
return hr;
}
@@ -1566,46 +1566,46 @@ static HRESULT audio_renderer_create_audio_client(struct audio_renderer *rendere
CoTaskMemFree(wfx);
if (FAILED(hr))
{
- WARN("Failed to initialize audio client, hr %#x.\n", hr);
+ WARN("Failed to initialize audio client, hr %#lx.\n", hr);
return hr;
}
if (FAILED(hr = IAudioClient_GetService(renderer->audio_client, &IID_IAudioStreamVolume,
(void **)&renderer->stream_volume)))
{
- WARN("Failed to get stream volume control, hr %#x.\n", hr);
+ WARN("Failed to get stream volume control, hr %#lx.\n", hr);
return hr;
}
if (FAILED(hr = IAudioClient_GetService(renderer->audio_client, &IID_ISimpleAudioVolume, (void **)&renderer->audio_volume)))
{
- WARN("Failed to get audio volume control, hr %#x.\n", hr);
+ WARN("Failed to get audio volume control, hr %#lx.\n", hr);
return hr;
}
if (FAILED(hr = IAudioClient_GetService(renderer->audio_client, &IID_IAudioRenderClient,
(void **)&renderer->audio_render_client)))
{
- WARN("Failed to get audio render client, hr %#x.\n", hr);
+ WARN("Failed to get audio render client, hr %#lx.\n", hr);
return hr;
}
if (FAILED(hr = IAudioClient_SetEventHandle(renderer->audio_client, renderer->buffer_ready_event)))
{
- WARN("Failed to set event handle, hr %#x.\n", hr);
+ WARN("Failed to set event handle, hr %#lx.\n", hr);
return hr;
}
if (FAILED(hr = IAudioClient_GetBufferSize(renderer->audio_client, &renderer->max_frames)))
{
- WARN("Failed to get buffer size, hr %#x.\n", hr);
+ WARN("Failed to get buffer size, hr %#lx.\n", hr);
return hr;
}
if (SUCCEEDED(hr = MFCreateAsyncResult(NULL, &renderer->render_callback, NULL, &result)))
{
if (FAILED(hr = MFPutWaitingWorkItem(renderer->buffer_ready_event, 0, result, &renderer->buffer_ready_key)))
- WARN("Failed to submit wait item, hr %#x.\n", hr);
+ WARN("Failed to submit wait item, hr %#lx.\n", hr);
IMFAsyncResult_Release(result);
}
@@ -1714,7 +1714,7 @@ static HRESULT audio_renderer_collect_supported_types(struct audio_renderer *ren
hr = IMMDevice_Activate(renderer->device, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void **)&client);
if (FAILED(hr))
{
- WARN("Failed to create audio client, hr %#x.\n", hr);
+ WARN("Failed to create audio client, hr %#lx.\n", hr);
return hr;
}
@@ -1724,7 +1724,7 @@ static HRESULT audio_renderer_collect_supported_types(struct audio_renderer *ren
IAudioClient_Release(client);
if (FAILED(hr))
{
- WARN("Failed to get device audio format, hr %#x.\n", hr);
+ WARN("Failed to get device audio format, hr %#lx.\n", hr);
return hr;
}
@@ -1732,7 +1732,7 @@ static HRESULT audio_renderer_collect_supported_types(struct audio_renderer *ren
CoTaskMemFree(format);
if (FAILED(hr))
{
- WARN("Failed to initialize media type, hr %#x.\n", hr);
+ WARN("Failed to initialize media type, hr %#lx.\n", hr);
return hr;
}
@@ -1843,7 +1843,7 @@ static void audio_renderer_render(struct audio_renderer *renderer, IMFAsyncResul
}
if (FAILED(hr = MFPutWaitingWorkItem(renderer->buffer_ready_event, 0, result, &renderer->buffer_ready_key)))
- WARN("Failed to submit wait item, hr %#x.\n", hr);
+ WARN("Failed to submit wait item, hr %#lx.\n", hr);
}
static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index e6c21332d20..05b7af81df7 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -338,7 +338,7 @@ static HRESULT WINAPI local_mft_registration_RegisterMFTs(IMFLocalMFTRegistratio
HRESULT hr = S_OK;
DWORD i;
- TRACE("%p, %p, %u.\n", iface, info, count);
+ TRACE("%p, %p, %lu.\n", iface, info, count);
for (i = 0; i < count; ++i)
{
@@ -380,7 +380,7 @@ static ULONG WINAPI session_op_AddRef(IUnknown *iface)
struct session_op *op = impl_op_from_IUnknown(iface);
ULONG refcount = InterlockedIncrement(&op->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -390,7 +390,7 @@ static ULONG WINAPI session_op_Release(IUnknown *iface)
struct session_op *op = impl_op_from_IUnknown(iface);
ULONG refcount = InterlockedDecrement(&op->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -701,7 +701,7 @@ static void session_shutdown_current_topology(struct media_session *session)
(void **)&activate)))
{
if (FAILED(hr = IMFActivate_ShutdownObject(activate)))
- WARN("Failed to shut down activation object for the sink, hr %#x.\n", hr);
+ WARN("Failed to shut down activation object for the sink, hr %#lx.\n", hr);
IMFActivate_Release(activate);
}
else if (SUCCEEDED(topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink)))
@@ -843,12 +843,12 @@ static void session_start(struct media_session *session, const GUID *time_format
if (FAILED(hr = IMFMediaSource_BeginGetEvent(source->source, &session->events_callback,
source->object)))
{
- WARN("Failed to subscribe to source events, hr %#x.\n", hr);
+ WARN("Failed to subscribe to source events, hr %#lx.\n", hr);
}
}
if (FAILED(hr = IMFMediaSource_Start(source->source, source->pd, &GUID_NULL, start_position)))
- WARN("Failed to start media source %p, hr %#x.\n", source->source, hr);
+ WARN("Failed to start media source %p, hr %#lx.\n", source->source, hr);
}
session->presentation.flags |= SESSION_FLAG_SOURCES_SUBSCRIBED;
@@ -1335,7 +1335,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
if (FAILED(hr = topology_node_get_object(node, &IID_IMFStreamSink, (void **)&topo_node->object.object)))
{
- WARN("Failed to get stream sink interface, hr %#x.\n", hr);
+ WARN("Failed to get stream sink interface, hr %#lx.\n", hr);
break;
}
@@ -1352,7 +1352,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
if (FAILED(hr = IMFVideoSampleAllocator_InitializeSampleAllocator(topo_node->u.sink.allocator,
2, media_type)))
{
- WARN("Failed to initialize sample allocator for the stream, hr %#x.\n", hr);
+ WARN("Failed to initialize sample allocator for the stream, hr %#lx.\n", hr);
}
IMFVideoSampleAllocator_QueryInterface(topo_node->u.sink.allocator,
&IID_IMFVideoSampleAllocatorCallback, (void **)&topo_node->u.sink.allocator_cb);
@@ -1369,7 +1369,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
if (FAILED(IMFTopologyNode_GetUnknown(node, &MF_TOPONODE_SOURCE, &IID_IMFMediaSource,
(void **)&topo_node->u.source.source)))
{
- WARN("Missing MF_TOPONODE_SOURCE, hr %#x.\n", hr);
+ WARN("Missing MF_TOPONODE_SOURCE, hr %#lx.\n", hr);
break;
}
@@ -1379,7 +1379,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
if (FAILED(hr = IMFTopologyNode_GetUnknown(node, &MF_TOPONODE_STREAM_DESCRIPTOR,
&IID_IMFStreamDescriptor, (void **)&sd)))
{
- WARN("Missing MF_TOPONODE_STREAM_DESCRIPTOR, hr %#x.\n", hr);
+ WARN("Missing MF_TOPONODE_STREAM_DESCRIPTOR, hr %#lx.\n", hr);
break;
}
@@ -1394,7 +1394,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
hr = session_set_transform_stream_info(topo_node);
}
else
- WARN("Failed to get IMFTransform for MFT node, hr %#x.\n", hr);
+ WARN("Failed to get IMFTransform for MFT node, hr %#lx.\n", hr);
break;
case MF_TOPOLOGY_TEE_NODE:
@@ -1469,7 +1469,7 @@ static HRESULT session_set_current_topology(struct media_session *session, IMFTo
if (FAILED(hr = IMFTopology_CloneFrom(session->presentation.current_topology, topology)))
{
- WARN("Failed to clone topology, hr %#x.\n", hr);
+ WARN("Failed to clone topology, hr %#lx.\n", hr);
return hr;
}
@@ -1647,7 +1647,7 @@ static ULONG WINAPI mfsession_AddRef(IMFMediaSession *iface)
struct media_session *session = impl_from_IMFMediaSession(iface);
ULONG refcount = InterlockedIncrement(&session->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -1657,7 +1657,7 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface)
struct media_session *session = impl_from_IMFMediaSession(iface);
ULONG refcount = InterlockedDecrement(&session->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -1689,7 +1689,7 @@ static HRESULT WINAPI mfsession_GetEvent(IMFMediaSession *iface, DWORD flags, IM
{
struct media_session *session = impl_from_IMFMediaSession(iface);
- TRACE("%p, %#x, %p.\n", iface, flags, event);
+ TRACE("%p, %#lx, %p.\n", iface, flags, event);
return IMFMediaEventQueue_GetEvent(session->event_queue, flags, event);
}
@@ -1717,7 +1717,7 @@ static HRESULT WINAPI mfsession_QueueEvent(IMFMediaSession *iface, MediaEventTyp
{
struct media_session *session = impl_from_IMFMediaSession(iface);
- TRACE("%p, %d, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ TRACE("%p, %ld, %s, %#lx, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
return IMFMediaEventQueue_QueueEventParamVar(session->event_queue, event_type, ext_type, hr, value);
}
@@ -1729,7 +1729,7 @@ static HRESULT WINAPI mfsession_SetTopology(IMFMediaSession *iface, DWORD flags,
WORD node_count = 0;
HRESULT hr;
- TRACE("%p, %#x, %p.\n", iface, flags, topology);
+ TRACE("%p, %#lx, %p.\n", iface, flags, topology);
if (topology)
{
@@ -1879,7 +1879,7 @@ static HRESULT WINAPI mfsession_GetFullTopology(IMFMediaSession *iface, DWORD fl
TOPOID topo_id;
HRESULT hr;
- TRACE("%p, %#x, %s, %p.\n", iface, flags, wine_dbgstr_longlong(id), topology);
+ TRACE("%p, %#lx, %s, %p.\n", iface, flags, wine_dbgstr_longlong(id), topology);
*topology = NULL;
@@ -1998,7 +1998,7 @@ static HRESULT session_get_renderer_node_service(struct media_session *session,
if (node_test_func(sink))
{
if (FAILED(hr = MFGetService((IUnknown *)sink, service, riid, obj)))
- WARN("Failed to get service from renderer node, %#x.\n", hr);
+ WARN("Failed to get service from renderer node, %#lx.\n", hr);
}
}
IMFStreamSink_Release(stream_sink);
@@ -2358,7 +2358,7 @@ static void session_set_presentation_clock(struct media_session *session)
hr = IMFPresentationClock_SetTimeSource(session->clock, session->system_time_source);
if (FAILED(hr))
- WARN("Failed to set time source, hr %#x.\n", hr);
+ WARN("Failed to set time source, hr %#lx.\n", hr);
LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry)
{
@@ -2368,7 +2368,7 @@ static void session_set_presentation_clock(struct media_session *session)
if (FAILED(hr = IMFStreamSink_BeginGetEvent(node->object.sink_stream, &session->events_callback,
node->object.object)))
{
- WARN("Failed to subscribe to stream sink events, hr %#x.\n", hr);
+ WARN("Failed to subscribe to stream sink events, hr %#lx.\n", hr);
}
}
@@ -2383,11 +2383,11 @@ static void session_set_presentation_clock(struct media_session *session)
if (sink->event_generator && FAILED(hr = IMFMediaEventGenerator_BeginGetEvent(sink->event_generator,
&session->events_callback, (IUnknown *)sink->event_generator)))
{
- WARN("Failed to subscribe to sink events, hr %#x.\n", hr);
+ WARN("Failed to subscribe to sink events, hr %#lx.\n", hr);
}
if (FAILED(hr = IMFMediaSink_SetPresentationClock(sink->sink, session->clock)))
- WARN("Failed to set presentation clock for the sink, hr %#x.\n", hr);
+ WARN("Failed to set presentation clock for the sink, hr %#lx.\n", hr);
}
LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry)
@@ -2420,7 +2420,7 @@ static HRESULT session_start_clock(struct media_session *session)
FIXME("Unhandled time format %s.\n", debugstr_guid(&session->presentation.time_format));
if (FAILED(hr = IMFPresentationClock_Start(session->clock, start_offset)))
- WARN("Failed to start session clock, hr %#x.\n", hr);
+ WARN("Failed to start session clock, hr %#lx.\n", hr);
return hr;
}
@@ -2521,7 +2521,7 @@ static void session_set_source_object_state(struct media_session *session, IUnkn
{
/* FIXME: abort and enter error state on failure. */
if (FAILED(hr = IMFMediaSinkPreroll_NotifyPreroll(sink->preroll, preroll_time)))
- WARN("Preroll notification failed, hr %#x.\n", hr);
+ WARN("Preroll notification failed, hr %#lx.\n", hr);
}
else
{
@@ -2795,14 +2795,14 @@ static void session_deliver_sample_to_node(struct media_session *session, IMFTop
if (topo_node->u.sink.requests)
{
if (FAILED(hr = IMFStreamSink_ProcessSample(topo_node->object.sink_stream, sample)))
- WARN("Stream sink failed to process sample, hr %#x.\n", hr);
+ WARN("Stream sink failed to process sample, hr %#lx.\n", hr);
topo_node->u.sink.requests--;
}
}
else if (FAILED(hr = IMFStreamSink_PlaceMarker(topo_node->object.sink_stream, MFSTREAMSINK_MARKER_ENDOFSEGMENT,
NULL, NULL)))
{
- WARN("Failed to place sink marker, hr %#x.\n", hr);
+ WARN("Failed to place sink marker, hr %#lx.\n", hr);
}
break;
case MF_TOPOLOGY_TRANSFORM_NODE:
@@ -2824,7 +2824,7 @@ static void session_deliver_sample_to_node(struct media_session *session, IMFTop
sample_entry->sample, 0)) == MF_E_NOTACCEPTING)
break;
if (FAILED(hr))
- WARN("Failed to process input for stream %u/%u, hr %#x.\n", i, stream_id, hr);
+ WARN("Failed to process input for stream %u/%lu, hr %#lx.\n", i, stream_id, hr);
transform_release_sample(sample_entry);
}
else
@@ -2838,7 +2838,7 @@ static void session_deliver_sample_to_node(struct media_session *session, IMFTop
if (drain)
{
if (FAILED(hr = IMFTransform_ProcessMessage(topo_node->object.transform, MFT_MESSAGE_COMMAND_DRAIN, 0)))
- WARN("Drain command failed for transform, hr %#x.\n", hr);
+ WARN("Drain command failed for transform, hr %#lx.\n", hr);
}
transform_node_pull_samples(session, topo_node);
@@ -2905,7 +2905,7 @@ static HRESULT session_request_sample_from_node(struct media_session *session, I
{
case MF_TOPOLOGY_SOURCESTREAM_NODE:
if (FAILED(hr = IMFMediaStream_RequestSample(topo_node->object.source_stream, NULL)))
- WARN("Sample request failed, hr %#x.\n", hr);
+ WARN("Sample request failed, hr %#lx.\n", hr);
break;
case MF_TOPOLOGY_TRANSFORM_NODE:
@@ -2961,7 +2961,7 @@ static void session_request_sample(struct media_session *session, IMFStreamSink
if (FAILED(hr = IMFTopologyNode_GetInput(sink_node->node, 0, &upstream_node, &upstream_output)))
{
- WARN("Failed to get upstream node connection, hr %#x.\n", hr);
+ WARN("Failed to get upstream node connection, hr %#lx.\n", hr);
return;
}
@@ -3000,7 +3000,7 @@ static void session_deliver_sample(struct media_session *session, IMFMediaStream
if (FAILED(hr = IMFTopologyNode_GetOutput(source_node->node, 0, &downstream_node, &downstream_input)))
{
- WARN("Failed to get downstream node connection, hr %#x.\n", hr);
+ WARN("Failed to get downstream node connection, hr %#lx.\n", hr);
return;
}
@@ -3028,7 +3028,7 @@ static void session_sink_invalidated(struct media_session *session, IMFMediaEven
if (!event)
{
if (FAILED(hr = MFCreateMediaEvent(MESinkInvalidated, &GUID_NULL, S_OK, NULL, &event)))
- WARN("Failed to create event, hr %#x.\n", hr);
+ WARN("Failed to create event, hr %#lx.\n", hr);
}
if (!event)
@@ -3153,20 +3153,20 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM
if (FAILED(hr = IMFMediaEventGenerator_EndGetEvent(event_source, result, &event)))
{
- WARN("Failed to get event from %p, hr %#x.\n", event_source, hr);
+ WARN("Failed to get event from %p, hr %#lx.\n", event_source, hr);
goto failed;
}
if (FAILED(hr = IMFMediaEvent_GetType(event, &event_type)))
{
- WARN("Failed to get event type, hr %#x.\n", hr);
+ WARN("Failed to get event type, hr %#lx.\n", hr);
goto failed;
}
value.vt = VT_EMPTY;
if (FAILED(hr = IMFMediaEvent_GetValue(event, &value)))
{
- WARN("Failed to get event value, hr %#x.\n", hr);
+ WARN("Failed to get event value, hr %#lx.\n", hr);
goto failed;
}
@@ -3333,7 +3333,7 @@ failed:
IMFMediaEvent_Release(event);
if (FAILED(hr = IMFMediaEventGenerator_BeginGetEvent(event_source, iface, (IUnknown *)event_source)))
- WARN("Failed to re-subscribe, hr %#x.\n", hr);
+ WARN("Failed to re-subscribe, hr %#lx.\n", hr);
IMFMediaEventGenerator_Release(event_source);
@@ -3400,7 +3400,7 @@ static HRESULT WINAPI session_sink_finalizer_callback_Invoke(IMFAsyncCallback *i
if (state == sink->object)
{
if (FAILED(hr = IMFMediaSink_QueryInterface(sink->sink, &IID_IMFFinalizableMediaSink, (void **)&fin_sink)))
- WARN("Unexpected, missing IMFFinalizableMediaSink, hr %#x.\n", hr);
+ WARN("Unexpected, missing IMFFinalizableMediaSink, hr %#lx.\n", hr);
}
else
{
@@ -3564,7 +3564,7 @@ static HRESULT session_is_presentation_rate_supported(struct media_session *sess
value = rate;
if (FAILED(hr = IMFRateSupport_IsRateSupported(rate_support, thin, rate, &value)))
- WARN("Source does not support rate %f, hr %#x.\n", rate, hr);
+ WARN("Source does not support rate %f, hr %#lx.\n", rate, hr);
IMFRateSupport_Release(rate_support);
/* Only "first" source is considered. */
@@ -3591,7 +3591,7 @@ static HRESULT session_is_presentation_rate_supported(struct media_session *sess
IMFRateSupport_Release(rate_support);
if (FAILED(hr))
{
- WARN("Sink %p does not support rate %f, hr %#x.\n", sink->sink, rate, hr);
+ WARN("Sink %p does not support rate %f, hr %#lx.\n", sink->sink, rate, hr);
break;
}
}
@@ -3721,7 +3721,7 @@ static ULONG WINAPI node_attribute_editor_Release(IMFTopologyNodeAttributeEditor
static HRESULT WINAPI node_attribute_editor_UpdateNodeAttributes(IMFTopologyNodeAttributeEditor *iface,
TOPOID id, DWORD count, MFTOPONODE_ATTRIBUTE_UPDATE *updates)
{
- FIXME("%p, %s, %u, %p.\n", iface, wine_dbgstr_longlong(id), count, updates);
+ FIXME("%p, %s, %lu, %p.\n", iface, wine_dbgstr_longlong(id), count, updates);
return E_NOTIMPL;
}
@@ -3791,7 +3791,7 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses
if (FAILED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTopoLoader,
(void **)&object->topo_loader)))
{
- WARN("Failed to create custom topology loader, hr %#x.\n", hr);
+ WARN("Failed to create custom topology loader, hr %#lx.\n", hr);
}
}
@@ -3802,7 +3802,7 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses
if (FAILED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFQualityManager,
(void **)&object->quality_manager)))
{
- WARN("Failed to create custom quality manager, hr %#x.\n", hr);
+ WARN("Failed to create custom quality manager, hr %#lx.\n", hr);
}
}
}
diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c
index 8eb1b763e64..ff90bc2c8af 100644
--- a/dlls/mf/topology.c
+++ b/dlls/mf/topology.c
@@ -174,7 +174,7 @@ static ULONG WINAPI topology_AddRef(IMFTopology *iface)
struct topology *topology = impl_from_IMFTopology(iface);
ULONG refcount = InterlockedIncrement(&topology->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -267,7 +267,7 @@ static ULONG WINAPI topology_Release(IMFTopology *iface)
struct topology *topology = impl_from_IMFTopology(iface);
ULONG refcount = InterlockedDecrement(&topology->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -702,7 +702,7 @@ static HRESULT WINAPI topology_CloneFrom(IMFTopology *iface, IMFTopology *src)
{
if (FAILED(hr = create_topology_node(src_topology->nodes.nodes[i]->node_type, &node)))
{
- WARN("Failed to create a node, hr %#x.\n", hr);
+ WARN("Failed to create a node, hr %#lx.\n", hr);
break;
}
@@ -931,7 +931,7 @@ static ULONG WINAPI topology_node_AddRef(IMFTopologyNode *iface)
struct topology_node *node = impl_from_IMFTopologyNode(iface);
ULONG refcount = InterlockedIncrement(&node->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -942,7 +942,7 @@ static ULONG WINAPI topology_node_Release(IMFTopologyNode *iface)
ULONG refcount = InterlockedDecrement(&node->refcount);
unsigned int i;
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -1441,7 +1441,7 @@ static HRESULT WINAPI topology_node_ConnectOutput(IMFTopologyNode *iface, DWORD
struct topology_node *node = impl_from_IMFTopologyNode(iface);
struct topology_node *connection = unsafe_impl_from_IMFTopologyNode(peer);
- TRACE("%p, %u, %p, %u.\n", iface, output_index, peer, input_index);
+ TRACE("%p, %lu, %p, %lu.\n", iface, output_index, peer, input_index);
if (!connection)
{
@@ -1456,7 +1456,7 @@ static HRESULT WINAPI topology_node_DisconnectOutput(IMFTopologyNode *iface, DWO
{
struct topology_node *node = impl_from_IMFTopologyNode(iface);
- TRACE("%p, %u.\n", iface, output_index);
+ TRACE("%p, %lu.\n", iface, output_index);
return topology_node_disconnect_output(node, output_index);
}
@@ -1467,7 +1467,7 @@ static HRESULT WINAPI topology_node_GetInput(IMFTopologyNode *iface, DWORD input
struct topology_node *node = impl_from_IMFTopologyNode(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p, %p.\n", iface, input_index, ret, output_index);
+ TRACE("%p, %lu, %p, %p.\n", iface, input_index, ret, output_index);
EnterCriticalSection(&node->cs);
@@ -1498,7 +1498,7 @@ static HRESULT WINAPI topology_node_GetOutput(IMFTopologyNode *iface, DWORD outp
struct topology_node *node = impl_from_IMFTopologyNode(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p, %p.\n", iface, output_index, ret, input_index);
+ TRACE("%p, %lu, %p, %p.\n", iface, output_index, ret, input_index);
EnterCriticalSection(&node->cs);
@@ -1528,7 +1528,7 @@ static HRESULT WINAPI topology_node_SetOutputPrefType(IMFTopologyNode *iface, DW
struct topology_node *node = impl_from_IMFTopologyNode(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, mediatype);
+ TRACE("%p, %lu, %p.\n", iface, index, mediatype);
EnterCriticalSection(&node->cs);
@@ -1562,7 +1562,7 @@ static HRESULT WINAPI topology_node_GetOutputPrefType(IMFTopologyNode *iface, DW
struct topology_node *node = impl_from_IMFTopologyNode(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, mediatype);
+ TRACE("%p, %lu, %p.\n", iface, index, mediatype);
EnterCriticalSection(&node->cs);
@@ -1581,7 +1581,7 @@ static HRESULT WINAPI topology_node_SetInputPrefType(IMFTopologyNode *iface, DWO
struct topology_node *node = impl_from_IMFTopologyNode(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, mediatype);
+ TRACE("%p, %lu, %p.\n", iface, index, mediatype);
EnterCriticalSection(&node->cs);
@@ -1622,7 +1622,7 @@ static HRESULT WINAPI topology_node_GetInputPrefType(IMFTopologyNode *iface, DWO
struct topology_node *node = impl_from_IMFTopologyNode(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, index, mediatype);
+ TRACE("%p, %lu, %p.\n", iface, index, mediatype);
EnterCriticalSection(&node->cs);
@@ -1833,7 +1833,7 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO
UINT32 primary_output;
HRESULT hr;
- TRACE("%p, %u, %d, %p.\n", node, stream, output, type);
+ TRACE("%p, %lu, %d, %p.\n", node, stream, output, type);
if (FAILED(hr = IMFTopologyNode_GetNodeType(node, &node_type)))
return hr;
@@ -1916,7 +1916,7 @@ static ULONG WINAPI topology_loader_AddRef(IMFTopoLoader *iface)
struct topology_loader *loader = impl_from_IMFTopoLoader(iface);
ULONG refcount = InterlockedIncrement(&loader->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -1926,7 +1926,7 @@ static ULONG WINAPI topology_loader_Release(IMFTopoLoader *iface)
struct topology_loader *loader = impl_from_IMFTopoLoader(iface);
ULONG refcount = InterlockedDecrement(&loader->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
free(loader);
@@ -2456,16 +2456,16 @@ static HRESULT topology_loader_create_copier(IMFTopologyNode *upstream_node, DWO
return hr;
if (FAILED(hr = MFGetTopoNodeCurrentType(upstream_node, upstream_output, TRUE, &input_type)))
- WARN("Failed to get upstream media type hr %#x.\n", hr);
+ WARN("Failed to get upstream media type hr %#lx.\n", hr);
if (SUCCEEDED(hr) && FAILED(hr = MFGetTopoNodeCurrentType(downstream_node, downstream_input, FALSE, &output_type)))
- WARN("Failed to get downstream media type hr %#x.\n", hr);
+ WARN("Failed to get downstream media type hr %#lx.\n", hr);
if (SUCCEEDED(hr) && FAILED(hr = IMFTransform_SetInputType(transform, 0, input_type, 0)))
- WARN("Input type wasn't accepted, hr %#x.\n", hr);
+ WARN("Input type wasn't accepted, hr %#lx.\n", hr);
if (SUCCEEDED(hr) && FAILED(hr = IMFTransform_SetOutputType(transform, 0, output_type, 0)))
- WARN("Output type wasn't accepted, hr %#x.\n", hr);
+ WARN("Output type wasn't accepted, hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
@@ -2558,7 +2558,7 @@ static void topology_loader_resolve_complete(struct topoloader_context *context)
IMFTopologyNode_SetUINT32(node, &MF_TOPONODE_STREAMID, 0);
if (FAILED(hr = topology_loader_connect_d3d_aware_input(context, node)))
- WARN("Failed to connect D3D-aware input, hr %#x.\n", hr);
+ WARN("Failed to connect D3D-aware input, hr %#lx.\n", hr);
}
else if (node_type == MF_TOPOLOGY_SOURCESTREAM_NODE)
{
@@ -2642,7 +2642,7 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
if (node_type == MF_TOPOLOGY_SOURCESTREAM_NODE)
{
if (FAILED(hr = topology_loader_clone_node(&context, node, NULL, 0)))
- WARN("Failed to clone source node, hr %#x.\n", hr);
+ WARN("Failed to clone source node, hr %#lx.\n", hr);
}
IMFTopologyNode_Release(node);
@@ -2652,7 +2652,7 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
{
if (FAILED(hr = topology_loader_resolve_nodes(&context, &layer_size)))
{
- WARN("Failed to resolve for marker %u, hr %#x.\n", context.marker, hr);
+ WARN("Failed to resolve for marker %u, hr %#lx.\n", context.marker, hr);
break;
}
@@ -2734,7 +2734,7 @@ static ULONG WINAPI seq_source_AddRef(IMFSequencerSource *iface)
struct seq_source *seq_source = impl_from_IMFSequencerSource(iface);
ULONG refcount = InterlockedIncrement(&seq_source->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -2744,7 +2744,7 @@ static ULONG WINAPI seq_source_Release(IMFSequencerSource *iface)
struct seq_source *seq_source = impl_from_IMFSequencerSource(iface);
ULONG refcount = InterlockedDecrement(&seq_source->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
free(seq_source);
@@ -2755,14 +2755,14 @@ static ULONG WINAPI seq_source_Release(IMFSequencerSource *iface)
static HRESULT WINAPI seq_source_AppendTopology(IMFSequencerSource *iface, IMFTopology *topology,
DWORD flags, MFSequencerElementId *id)
{
- FIXME("%p, %p, %x, %p.\n", iface, topology, flags, id);
+ FIXME("%p, %p, %lx, %p.\n", iface, topology, flags, id);
return E_NOTIMPL;
}
static HRESULT WINAPI seq_source_DeleteTopology(IMFSequencerSource *iface, MFSequencerElementId id)
{
- FIXME("%p, %#x.\n", iface, id);
+ FIXME("%p, %#lx.\n", iface, id);
return E_NOTIMPL;
}
@@ -2778,14 +2778,14 @@ static HRESULT WINAPI seq_source_GetPresentationContext(IMFSequencerSource *ifac
static HRESULT WINAPI seq_source_UpdateTopology(IMFSequencerSource *iface, MFSequencerElementId id,
IMFTopology *topology)
{
- FIXME("%p, %#x, %p.\n", iface, id, topology);
+ FIXME("%p, %#lx, %p.\n", iface, id, topology);
return E_NOTIMPL;
}
static HRESULT WINAPI seq_source_UpdateTopologyFlags(IMFSequencerSource *iface, MFSequencerElementId id, DWORD flags)
{
- FIXME("%p, %#x, %#x.\n", iface, id, flags);
+ FIXME("%p, %#lx, %#lx.\n", iface, id, flags);
return E_NOTIMPL;
}
--
2.34.1
1
0
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
Changes in this version:
- Move struct condrv_output_info_params_font to SetCurrentConsoleFontEx
as anonymous struct.
- ioctl size only contains meaningful bytes.
- Calculate face_name string size in conhost.
- Manage invalid font height, weight and face name parameters.
dlls/kernel32/console.c | 7 ------
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/tests/console.c | 40 ++++++++++++++++-----------------
dlls/kernelbase/console.c | 40 +++++++++++++++++++++++++++++++++
dlls/kernelbase/kernelbase.spec | 1 +
include/wine/condrv.h | 1 +
programs/conhost/conhost.c | 25 ++++++++++++++++++---
programs/conhost/conhost.h | 14 +++++++-----
programs/conhost/window.c | 27 +++++++++++++---------
9 files changed, 111 insertions(+), 46 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 80f3419cd7a..58bd18d2a5f 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -480,10 +480,3 @@ BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, C
SetLastError(LOWORD(E_NOTIMPL) /* win10 1709+ */);
return FALSE;
}
-
-BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix)
-{
- FIXME("(%p %d %p): stub!\n", hConsole, maxwindow, cfix);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 87fa0c39381..6e063bfaa7b 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1390,7 +1390,7 @@
@ stdcall -import SetConsoleTitleW(wstr)
@ stdcall -import SetConsoleWindowInfo(long long ptr)
@ stdcall SetCriticalSectionSpinCount(ptr long) NTDLL.RtlSetCriticalSectionSpinCount
-@ stdcall SetCurrentConsoleFontEx(long long ptr)
+@ stdcall -import SetCurrentConsoleFontEx(long long ptr)
@ stdcall -import SetCurrentDirectoryA(str)
@ stdcall -import SetCurrentDirectoryW(wstr)
@ stub SetDaylightFlag
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index e4d9d43f4c4..5443a611f80 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -3576,18 +3576,18 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
@@ -3595,47 +3595,47 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
cfix = orig_cfix;
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
@@ -3643,35 +3643,35 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
/* Restore original console font parameters */
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
}
static void test_GetConsoleFontSize(HANDLE std_output)
diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c
index a7eeb439232..5f64fc90fa3 100644
--- a/dlls/kernelbase/console.c
+++ b/dlls/kernelbase/console.c
@@ -1303,6 +1303,46 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleWindowInfo( HANDLE handle, BOOL absolute
}
+/******************************************************************************
+ * SetCurrentConsoleFontEx (kernelbase.@)
+ */
+BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix)
+{
+ struct
+ {
+ struct condrv_output_info_params params;
+ WCHAR face_name[LF_FACESIZE];
+ } data;
+
+ WCHAR *p = cfix->FaceName;
+ int len = 0;
+ DWORD size;
+
+ TRACE( "(%p %d %p)\n", hConsole, maxwindow, cfix );
+
+ if (cfix->cbSize != sizeof(CONSOLE_FONT_INFOEX))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ data.params.mask = SET_CONSOLE_OUTPUT_INFO_FONT;
+
+ data.params.info.font_width = cfix->dwFontSize.X;
+ data.params.info.font_height = cfix->dwFontSize.Y;
+ data.params.info.font_pitch_family = cfix->FontFamily;
+ data.params.info.font_weight = cfix->FontWeight;
+
+ while (*p && len < LF_FACESIZE) { p++; len++; }
+ size = len * sizeof(WCHAR);
+
+ memcpy( data.face_name, cfix->FaceName, size );
+ size += sizeof(struct condrv_output_info_params);
+
+ return console_ioctl( hConsole, IOCTL_CONDRV_SET_OUTPUT_INFO, &data, size, NULL, 0, NULL );
+}
+
+
/***********************************************************************
* ReadConsoleInputA (kernelbase.@)
*/
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 01135d6250a..91c4909e006 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1422,6 +1422,7 @@
@ stdcall SetConsoleTitleW(wstr)
@ stdcall SetConsoleWindowInfo(long long ptr)
@ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount
+@ stdcall SetCurrentConsoleFontEx(long long ptr)
@ stdcall SetCurrentDirectoryA(str)
@ stdcall SetCurrentDirectoryW(wstr)
@ stdcall SetDefaultDllDirectories(long)
diff --git a/include/wine/condrv.h b/include/wine/condrv.h
index 4d2332a1ee9..b5e294b9401 100644
--- a/include/wine/condrv.h
+++ b/include/wine/condrv.h
@@ -155,6 +155,7 @@ struct condrv_output_info_params
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0040
+#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0080
/* IOCTL_CONDRV_FILL_OUTPUT params */
struct condrv_fill_output_params
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 2b137c40fb0..77b6c222621 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -1830,7 +1830,7 @@ NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new
}
static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
- const struct condrv_output_info_params *params )
+ const struct condrv_output_info_params *params, size_t in_size )
{
const struct condrv_output_info *info = ¶ms->info;
NTSTATUS status;
@@ -1917,6 +1917,24 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
screen_buffer->max_width = info->max_width;
screen_buffer->max_height = info->max_height;
}
+ if (params->mask & SET_CONSOLE_OUTPUT_INFO_FONT)
+ {
+ WCHAR *face_name = (WCHAR *)(params + 1);
+ size_t face_name_size = in_size - sizeof(*params);
+ unsigned int height = info->font_height;
+ unsigned int weight = FW_NORMAL;
+
+ if (!*face_name)
+ {
+ face_name = screen_buffer->font.face_name;
+ face_name_size = screen_buffer->font.face_len * sizeof(WCHAR);
+ }
+
+ if (!height) height = 12;
+ if (info->font_weight >= FW_SEMIBOLD) weight = FW_BOLD;
+
+ update_console_font( screen_buffer->console, face_name, face_name_size, height, weight );
+ }
if (is_active( screen_buffer ))
{
@@ -2429,8 +2447,9 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign
return get_output_info( screen_buffer, out_size );
case IOCTL_CONDRV_SET_OUTPUT_INFO:
- if (in_size != sizeof(struct condrv_output_info_params) || *out_size) return STATUS_INVALID_PARAMETER;
- return set_output_info( screen_buffer, in_data );
+ if (in_size < sizeof(struct condrv_output_info_params) || *out_size)
+ return STATUS_INVALID_PARAMETER;
+ return set_output_info( screen_buffer, in_data, in_size );
case IOCTL_CONDRV_FILL_OUTPUT:
if (in_size != sizeof(struct condrv_fill_output_params) || *out_size != sizeof(DWORD))
diff --git a/programs/conhost/conhost.h b/programs/conhost/conhost.h
index 5e9b999380c..3cbd2ed2d80 100644
--- a/programs/conhost/conhost.h
+++ b/programs/conhost/conhost.h
@@ -130,17 +130,21 @@ struct screen_buffer
struct wine_rb_entry entry; /* map entry */
};
-BOOL init_window( struct console *console );
-void init_message_window( struct console *console );
-void update_window_region( struct console *console, const RECT *update );
-void update_window_config( struct console *console, BOOL delay );
-
+/* conhost.c */
NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records,
unsigned int count, BOOL flush );
void notify_screen_buffer_size( struct screen_buffer *screen_buffer );
NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height );
+/* window.c */
+void update_console_font( struct console *console, const WCHAR *face_name, size_t face_name_size,
+ unsigned int height, unsigned int weight );
+BOOL init_window( struct console *console );
+void init_message_window( struct console *console );
+void update_window_region( struct console *console, const RECT *update );
+void update_window_config( struct console *console, BOOL delay );
+
static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )
{
SetRect( rect, screen_buffer->width, screen_buffer->height, 0, 0 );
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index db04ba120e4..b88b95c41ce 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -652,7 +652,8 @@ static HFONT select_font_config( struct console_config *config, unsigned int cp,
return font;
}
-static void fill_logfont( LOGFONTW *lf, const WCHAR *name, unsigned int height, unsigned int weight )
+static void fill_logfont( LOGFONTW *lf, const WCHAR *face_name, size_t face_name_size,
+ unsigned int height, unsigned int weight )
{
lf->lfHeight = height;
lf->lfWidth = 0;
@@ -667,7 +668,8 @@ static void fill_logfont( LOGFONTW *lf, const WCHAR *name, unsigned int height,
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
- lstrcpyW( lf->lfFaceName, name );
+ memcpy( lf->lfFaceName, face_name, face_name_size );
+ lf->lfFaceName[face_name_size / sizeof(WCHAR)] = 0;
}
static BOOL set_console_font( struct console *console, const LOGFONTW *logfont )
@@ -705,6 +707,7 @@ static BOOL set_console_font( struct console *console, const LOGFONTW *logfont )
font_info->width = tm.tmAveCharWidth;
font_info->height = tm.tmHeight + tm.tmExternalLeading;
+ font_info->pitch_family = tm.tmPitchAndFamily;
font_info->weight = tm.tmWeight;
free( font_info->face_name );
@@ -851,15 +854,15 @@ static int WINAPI get_first_font_enum( const LOGFONTW *lf, const TEXTMETRICW *tm
/* sets logfont as the new font for the console */
-static void update_console_font( struct console *console, const WCHAR *font,
- unsigned int height, unsigned int weight )
+void update_console_font( struct console *console, const WCHAR *face_name, size_t face_name_size,
+ unsigned int height, unsigned int weight )
{
struct font_chooser fc;
LOGFONTW lf;
- if (font[0] && height && weight)
+ if (face_name[0] && height && weight)
{
- fill_logfont( &lf, font, height, weight );
+ fill_logfont( &lf, face_name, face_name_size, height, weight );
if (set_console_font( console, &lf )) return;
}
@@ -1581,8 +1584,9 @@ static BOOL select_font( struct dialog_info *di )
if (font_idx < 0 || size_idx < 0 || size_idx >= di->font_count)
return FALSE;
- fill_logfont( &lf, di->font[size_idx].faceName, di->font[size_idx].height,
- di->font[size_idx].weight );
+ fill_logfont( &lf, di->font[size_idx].faceName,
+ wcslen(di->font[size_idx].faceName) * sizeof(WCHAR),
+ di->font[size_idx].height, di->font[size_idx].weight );
font = select_font_config( &config, di->console->output_cp, di->console->win, &lf );
if (!font) return FALSE;
@@ -1702,7 +1706,9 @@ static INT_PTR WINAPI font_dialog_proc( HWND dialog, UINT msg, WPARAM wparam, LP
{
LOGFONTW lf;
- fill_logfont( &lf, di->font[val].faceName, di->font[val].height, di->font[val].weight );
+ fill_logfont( &lf, di->font[val].faceName,
+ wcslen(di->font[val].faceName) * sizeof(WCHAR),
+ di->font[val].height, di->font[val].weight );
DeleteObject( select_font_config( &di->config, di->console->output_cp,
di->console->win, &lf ));
}
@@ -1901,7 +1907,8 @@ static void apply_config( struct console *console, const struct console_config *
memcmp( console->active->font.face_name, config->face_name,
console->active->font.face_len * sizeof(WCHAR) ))
{
- update_console_font( console, config->face_name, config->cell_height, config->font_weight );
+ update_console_font( console, config->face_name, wcslen(config->face_name) * sizeof(WCHAR),
+ config->cell_height, config->font_weight );
}
update_window( console );
--
2.34.1
2
2
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
Changes in this version:
- Use wcsnlen to determine the length of the FaceName string.
- Use face_name_size to check for empty FaceName string.
dlls/kernel32/console.c | 7 ------
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/tests/console.c | 40 ++++++++++++++++-----------------
dlls/kernelbase/console.c | 37 ++++++++++++++++++++++++++++++
dlls/kernelbase/kernelbase.spec | 1 +
include/wine/condrv.h | 1 +
programs/conhost/conhost.c | 25 ++++++++++++++++++---
programs/conhost/conhost.h | 14 +++++++-----
programs/conhost/window.c | 27 +++++++++++++---------
9 files changed, 108 insertions(+), 46 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 80f3419cd7a..58bd18d2a5f 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -480,10 +480,3 @@ BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, C
SetLastError(LOWORD(E_NOTIMPL) /* win10 1709+ */);
return FALSE;
}
-
-BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix)
-{
- FIXME("(%p %d %p): stub!\n", hConsole, maxwindow, cfix);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 87fa0c39381..6e063bfaa7b 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1390,7 +1390,7 @@
@ stdcall -import SetConsoleTitleW(wstr)
@ stdcall -import SetConsoleWindowInfo(long long ptr)
@ stdcall SetCriticalSectionSpinCount(ptr long) NTDLL.RtlSetCriticalSectionSpinCount
-@ stdcall SetCurrentConsoleFontEx(long long ptr)
+@ stdcall -import SetCurrentConsoleFontEx(long long ptr)
@ stdcall -import SetCurrentDirectoryA(str)
@ stdcall -import SetCurrentDirectoryW(wstr)
@ stub SetDaylightFlag
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index e4d9d43f4c4..5443a611f80 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -3576,18 +3576,18 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
@@ -3595,47 +3595,47 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
cfix = orig_cfix;
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
@@ -3643,35 +3643,35 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
/* Restore original console font parameters */
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
}
static void test_GetConsoleFontSize(HANDLE std_output)
diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c
index a7eeb439232..56340922d32 100644
--- a/dlls/kernelbase/console.c
+++ b/dlls/kernelbase/console.c
@@ -1303,6 +1303,43 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleWindowInfo( HANDLE handle, BOOL absolute
}
+/******************************************************************************
+ * SetCurrentConsoleFontEx (kernelbase.@)
+ */
+BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix)
+{
+ struct
+ {
+ struct condrv_output_info_params params;
+ WCHAR face_name[LF_FACESIZE];
+ } data;
+
+ size_t size;
+
+ TRACE( "(%p %d %p)\n", hConsole, maxwindow, cfix );
+
+ if (cfix->cbSize != sizeof(CONSOLE_FONT_INFOEX))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ data.params.mask = SET_CONSOLE_OUTPUT_INFO_FONT;
+
+ data.params.info.font_width = cfix->dwFontSize.X;
+ data.params.info.font_height = cfix->dwFontSize.Y;
+ data.params.info.font_pitch_family = cfix->FontFamily;
+ data.params.info.font_weight = cfix->FontWeight;
+
+ size = wcsnlen( cfix->FaceName, LF_FACESIZE - 1 ) * sizeof(WCHAR);
+
+ memcpy( data.face_name, cfix->FaceName, size );
+ size += sizeof(struct condrv_output_info_params);
+
+ return console_ioctl( hConsole, IOCTL_CONDRV_SET_OUTPUT_INFO, &data, size, NULL, 0, NULL );
+}
+
+
/***********************************************************************
* ReadConsoleInputA (kernelbase.@)
*/
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 01135d6250a..91c4909e006 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1422,6 +1422,7 @@
@ stdcall SetConsoleTitleW(wstr)
@ stdcall SetConsoleWindowInfo(long long ptr)
@ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount
+@ stdcall SetCurrentConsoleFontEx(long long ptr)
@ stdcall SetCurrentDirectoryA(str)
@ stdcall SetCurrentDirectoryW(wstr)
@ stdcall SetDefaultDllDirectories(long)
diff --git a/include/wine/condrv.h b/include/wine/condrv.h
index 4d2332a1ee9..b5e294b9401 100644
--- a/include/wine/condrv.h
+++ b/include/wine/condrv.h
@@ -155,6 +155,7 @@ struct condrv_output_info_params
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0040
+#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0080
/* IOCTL_CONDRV_FILL_OUTPUT params */
struct condrv_fill_output_params
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 2b137c40fb0..8b03d749d21 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -1830,7 +1830,7 @@ NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new
}
static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
- const struct condrv_output_info_params *params )
+ const struct condrv_output_info_params *params, size_t in_size )
{
const struct condrv_output_info *info = ¶ms->info;
NTSTATUS status;
@@ -1917,6 +1917,24 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
screen_buffer->max_width = info->max_width;
screen_buffer->max_height = info->max_height;
}
+ if (params->mask & SET_CONSOLE_OUTPUT_INFO_FONT)
+ {
+ WCHAR *face_name = (WCHAR *)(params + 1);
+ size_t face_name_size = in_size - sizeof(*params);
+ unsigned int height = info->font_height;
+ unsigned int weight = FW_NORMAL;
+
+ if (!face_name_size)
+ {
+ face_name = screen_buffer->font.face_name;
+ face_name_size = screen_buffer->font.face_len * sizeof(WCHAR);
+ }
+
+ if (!height) height = 12;
+ if (info->font_weight >= FW_SEMIBOLD) weight = FW_BOLD;
+
+ update_console_font( screen_buffer->console, face_name, face_name_size, height, weight );
+ }
if (is_active( screen_buffer ))
{
@@ -2429,8 +2447,9 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign
return get_output_info( screen_buffer, out_size );
case IOCTL_CONDRV_SET_OUTPUT_INFO:
- if (in_size != sizeof(struct condrv_output_info_params) || *out_size) return STATUS_INVALID_PARAMETER;
- return set_output_info( screen_buffer, in_data );
+ if (in_size < sizeof(struct condrv_output_info_params) || *out_size)
+ return STATUS_INVALID_PARAMETER;
+ return set_output_info( screen_buffer, in_data, in_size );
case IOCTL_CONDRV_FILL_OUTPUT:
if (in_size != sizeof(struct condrv_fill_output_params) || *out_size != sizeof(DWORD))
diff --git a/programs/conhost/conhost.h b/programs/conhost/conhost.h
index 5e9b999380c..3cbd2ed2d80 100644
--- a/programs/conhost/conhost.h
+++ b/programs/conhost/conhost.h
@@ -130,17 +130,21 @@ struct screen_buffer
struct wine_rb_entry entry; /* map entry */
};
-BOOL init_window( struct console *console );
-void init_message_window( struct console *console );
-void update_window_region( struct console *console, const RECT *update );
-void update_window_config( struct console *console, BOOL delay );
-
+/* conhost.c */
NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records,
unsigned int count, BOOL flush );
void notify_screen_buffer_size( struct screen_buffer *screen_buffer );
NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height );
+/* window.c */
+void update_console_font( struct console *console, const WCHAR *face_name, size_t face_name_size,
+ unsigned int height, unsigned int weight );
+BOOL init_window( struct console *console );
+void init_message_window( struct console *console );
+void update_window_region( struct console *console, const RECT *update );
+void update_window_config( struct console *console, BOOL delay );
+
static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )
{
SetRect( rect, screen_buffer->width, screen_buffer->height, 0, 0 );
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index db04ba120e4..b88b95c41ce 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -652,7 +652,8 @@ static HFONT select_font_config( struct console_config *config, unsigned int cp,
return font;
}
-static void fill_logfont( LOGFONTW *lf, const WCHAR *name, unsigned int height, unsigned int weight )
+static void fill_logfont( LOGFONTW *lf, const WCHAR *face_name, size_t face_name_size,
+ unsigned int height, unsigned int weight )
{
lf->lfHeight = height;
lf->lfWidth = 0;
@@ -667,7 +668,8 @@ static void fill_logfont( LOGFONTW *lf, const WCHAR *name, unsigned int height,
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
- lstrcpyW( lf->lfFaceName, name );
+ memcpy( lf->lfFaceName, face_name, face_name_size );
+ lf->lfFaceName[face_name_size / sizeof(WCHAR)] = 0;
}
static BOOL set_console_font( struct console *console, const LOGFONTW *logfont )
@@ -705,6 +707,7 @@ static BOOL set_console_font( struct console *console, const LOGFONTW *logfont )
font_info->width = tm.tmAveCharWidth;
font_info->height = tm.tmHeight + tm.tmExternalLeading;
+ font_info->pitch_family = tm.tmPitchAndFamily;
font_info->weight = tm.tmWeight;
free( font_info->face_name );
@@ -851,15 +854,15 @@ static int WINAPI get_first_font_enum( const LOGFONTW *lf, const TEXTMETRICW *tm
/* sets logfont as the new font for the console */
-static void update_console_font( struct console *console, const WCHAR *font,
- unsigned int height, unsigned int weight )
+void update_console_font( struct console *console, const WCHAR *face_name, size_t face_name_size,
+ unsigned int height, unsigned int weight )
{
struct font_chooser fc;
LOGFONTW lf;
- if (font[0] && height && weight)
+ if (face_name[0] && height && weight)
{
- fill_logfont( &lf, font, height, weight );
+ fill_logfont( &lf, face_name, face_name_size, height, weight );
if (set_console_font( console, &lf )) return;
}
@@ -1581,8 +1584,9 @@ static BOOL select_font( struct dialog_info *di )
if (font_idx < 0 || size_idx < 0 || size_idx >= di->font_count)
return FALSE;
- fill_logfont( &lf, di->font[size_idx].faceName, di->font[size_idx].height,
- di->font[size_idx].weight );
+ fill_logfont( &lf, di->font[size_idx].faceName,
+ wcslen(di->font[size_idx].faceName) * sizeof(WCHAR),
+ di->font[size_idx].height, di->font[size_idx].weight );
font = select_font_config( &config, di->console->output_cp, di->console->win, &lf );
if (!font) return FALSE;
@@ -1702,7 +1706,9 @@ static INT_PTR WINAPI font_dialog_proc( HWND dialog, UINT msg, WPARAM wparam, LP
{
LOGFONTW lf;
- fill_logfont( &lf, di->font[val].faceName, di->font[val].height, di->font[val].weight );
+ fill_logfont( &lf, di->font[val].faceName,
+ wcslen(di->font[val].faceName) * sizeof(WCHAR),
+ di->font[val].height, di->font[val].weight );
DeleteObject( select_font_config( &di->config, di->console->output_cp,
di->console->win, &lf ));
}
@@ -1901,7 +1907,8 @@ static void apply_config( struct console *console, const struct console_config *
memcmp( console->active->font.face_name, config->face_name,
console->active->font.face_len * sizeof(WCHAR) ))
{
- update_console_font( console, config->face_name, config->cell_height, config->font_weight );
+ update_console_font( console, config->face_name, wcslen(config->face_name) * sizeof(WCHAR),
+ config->cell_height, config->font_weight );
}
update_window( console );
--
2.34.1
1
0