Wine-Devel
By message
wine-devel@list.winehq.org
By month
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- 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
February 2022
- 87 participants
- 926 discussions
Feb. 1, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/evr/presenter.c | 94 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 92 insertions(+), 2 deletions(-)
diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c
index 910af2891e3..7e14cb2f720 100644
--- a/dlls/evr/presenter.c
+++ b/dlls/evr/presenter.c
@@ -65,6 +65,7 @@ struct sample_queue
unsigned int used;
unsigned int front;
unsigned int back;
+ IMFSample *last_presented;
};
struct streaming_thread
@@ -120,6 +121,7 @@ struct video_presenter
struct
{
int presented;
+ LONGLONG sampletime;
} frame_stats;
CRITICAL_SECTION cs;
@@ -507,6 +509,13 @@ static void video_presenter_sample_present(struct video_presenter *presenter, IM
IDirect3DSwapChain9_Present(presenter->swapchain, NULL, NULL, NULL, NULL, 0);
presenter->frame_stats.presented++;
+ EnterCriticalSection(&presenter->cs);
+ if (presenter->thread.queue.last_presented)
+ IMFSample_Release(presenter->thread.queue.last_presented);
+ presenter->thread.queue.last_presented = sample;
+ IMFSample_AddRef(presenter->thread.queue.last_presented);
+ LeaveCriticalSection(&presenter->cs);
+
IDirect3DDevice9_Release(device);
IDirect3DSurface9_Release(backbuffer);
IDirect3DSurface9_Release(surface);
@@ -739,6 +748,8 @@ static HRESULT video_presenter_end_streaming(struct video_presenter *presenter)
TRACE("Terminated streaming thread tid %#lx.\n", presenter->thread.tid);
+ if (presenter->thread.queue.last_presented)
+ IMFSample_Release(presenter->thread.queue.last_presented);
memset(&presenter->thread, 0, sizeof(presenter->thread));
video_presenter_set_allocator_callback(presenter, NULL);
@@ -1461,9 +1472,88 @@ static HRESULT WINAPI video_presenter_control_RepaintVideo(IMFVideoDisplayContro
static HRESULT WINAPI video_presenter_control_GetCurrentImage(IMFVideoDisplayControl *iface, BITMAPINFOHEADER *header,
BYTE **dib, DWORD *dib_size, LONGLONG *timestamp)
{
- FIXME("%p, %p, %p, %p, %p.\n", iface, header, dib, dib_size, timestamp);
+ struct video_presenter *presenter = impl_from_IMFVideoDisplayControl(iface);
+ IDirect3DSurface9 *readback = NULL, *surface;
+ D3DSURFACE_DESC surface_desc;
+ D3DLOCKED_RECT mapped_rect;
+ IDirect3DDevice9 *device;
+ IMFSample *sample;
+ LONG stride;
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %p, %p, %p, %p.\n", iface, header, dib, dib_size, timestamp);
+
+ EnterCriticalSection(&presenter->cs);
+
+ sample = presenter->thread.queue.last_presented;
+ presenter->thread.queue.last_presented = NULL;
+
+ if (!presenter->swapchain || !sample)
+ {
+ hr = MF_E_INVALIDREQUEST;
+ }
+ else if (SUCCEEDED(hr = video_presenter_get_sample_surface(sample, &surface)))
+ {
+ IDirect3DSwapChain9_GetDevice(presenter->swapchain, &device);
+ IDirect3DSurface9_GetDesc(surface, &surface_desc);
+
+ if (surface_desc.Format != D3DFMT_X8R8G8B8)
+ {
+ FIXME("Unexpected surface format %d.\n", surface_desc.Format);
+ hr = E_FAIL;
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ if (FAILED(hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, surface_desc.Width,
+ surface_desc.Height, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &readback, NULL)))
+ {
+ WARN("Failed to create readback surface, hr %#lx.\n", hr);
+ }
+ }
+
+ if (SUCCEEDED(hr))
+ hr = IDirect3DDevice9_GetRenderTargetData(device, surface, readback);
+
+ if (SUCCEEDED(hr))
+ {
+ MFGetStrideForBitmapInfoHeader(D3DFMT_X8R8G8B8, surface_desc.Width, &stride);
+ *dib_size = abs(stride) * surface_desc.Height;
+ if (!(*dib = CoTaskMemAlloc(*dib_size)))
+ hr = E_OUTOFMEMORY;
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ if (SUCCEEDED(hr = IDirect3DSurface9_LockRect(readback, &mapped_rect, NULL, D3DLOCK_READONLY)))
+ {
+ memcpy(*dib, mapped_rect.pBits, *dib_size);
+ IDirect3DSurface9_UnlockRect(readback);
+ }
+ }
+
+ memset(header, 0, sizeof(*header));
+ header->biSize = sizeof(*header);
+ header->biWidth = surface_desc.Width;
+ header->biHeight = surface_desc.Height;
+ header->biPlanes = 1;
+ header->biBitCount = 32;
+ header->biSizeImage = *dib_size;
+ IMFSample_GetSampleTime(sample, timestamp);
+
+ if (readback)
+ IDirect3DSurface9_Release(readback);
+ IDirect3DSurface9_Release(surface);
+
+ IDirect3DDevice9_Release(device);
+ }
+
+ if (sample)
+ IMFSample_Release(sample);
+
+ LeaveCriticalSection(&presenter->cs);
+
+ return hr;
}
static HRESULT WINAPI video_presenter_control_SetBorderColor(IMFVideoDisplayControl *iface, COLORREF color)
--
2.34.1
2
2
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/xmllite/Makefile.in | 1 -
dlls/xmllite/reader.c | 24 ++++++++++----------
dlls/xmllite/writer.c | 48 +++++++++++++++++++++-------------------
3 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/dlls/xmllite/Makefile.in b/dlls/xmllite/Makefile.in
index 003c36a3a37..aeb448162f6 100644
--- a/dlls/xmllite/Makefile.in
+++ b/dlls/xmllite/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = xmllite.dll
IMPORTLIB = xmllite
diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c
index 834c36ae18c..ccdc1ae2c1b 100644
--- a/dlls/xmllite/reader.c
+++ b/dlls/xmllite/reader.c
@@ -840,7 +840,7 @@ static HRESULT readerinput_growraw(xmlreaderinput *readerinput)
read = 0;
hr = ISequentialStream_Read(readerinput->stream, buffer->data + buffer->written, len, &read);
- TRACE("written=%d, alloc=%d, requested=%d, read=%d, ret=0x%08x\n", buffer->written, buffer->allocated, len, read, hr);
+ TRACE("written=%d, alloc=%d, requested=%ld, read=%ld, ret=%#lx\n", buffer->written, buffer->allocated, len, read, hr);
readerinput->pending = hr == E_PENDING;
if (FAILED(hr)) return hr;
buffer->written += read;
@@ -2579,7 +2579,7 @@ static HRESULT reader_parse_nextnode(xmlreader *reader)
/* try to detect encoding by BOM or data and set input code page */
hr = readerinput_detectencoding(reader->input, &enc);
- TRACE("detected encoding %s, 0x%08x\n", enc == XmlEncoding_Unknown ? "(unknown)" :
+ TRACE("detected encoding %s, %#lx.\n", enc == XmlEncoding_Unknown ? "(unknown)" :
debugstr_w(xml_encoding_map[enc].name), hr);
if (FAILED(hr)) return hr;
@@ -2679,9 +2679,9 @@ static HRESULT WINAPI xmlreader_QueryInterface(IXmlReader *iface, REFIID riid, v
static ULONG WINAPI xmlreader_AddRef(IXmlReader *iface)
{
- xmlreader *This = impl_from_IXmlReader(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ xmlreader *reader = impl_from_IXmlReader(iface);
+ ULONG ref = InterlockedIncrement(&reader->ref);
+ TRACE("%p, refcount %ld.\n", iface, ref);
return ref;
}
@@ -2725,7 +2725,7 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
xmlreader *This = impl_from_IXmlReader(iface);
LONG ref = InterlockedDecrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ TRACE("%p, refcount %ld.\n", iface, ref);
if (ref == 0)
{
@@ -2841,7 +2841,7 @@ static HRESULT WINAPI xmlreader_SetProperty(IXmlReader* iface, UINT property, LO
{
xmlreader *This = impl_from_IXmlReader(iface);
- TRACE("(%p)->(%s 0x%lx)\n", This, debugstr_reader_prop(property), value);
+ TRACE("%p, %s, %Ix.\n", iface, debugstr_reader_prop(property), value);
switch (property)
{
@@ -3590,9 +3590,9 @@ static HRESULT WINAPI xmlreaderinput_QueryInterface(IXmlReaderInput *iface, REFI
static ULONG WINAPI xmlreaderinput_AddRef(IXmlReaderInput *iface)
{
- xmlreaderinput *This = impl_from_IXmlReaderInput(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ xmlreaderinput *input = impl_from_IXmlReaderInput(iface);
+ ULONG ref = InterlockedIncrement(&input->ref);
+ TRACE("%p, refcount %ld.\n", iface, ref);
return ref;
}
@@ -3601,7 +3601,7 @@ static ULONG WINAPI xmlreaderinput_Release(IXmlReaderInput *iface)
xmlreaderinput *This = impl_from_IXmlReaderInput(iface);
LONG ref = InterlockedDecrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ TRACE("%p, refcount %ld.\n", iface, ref);
if (ref == 0)
{
@@ -3662,7 +3662,7 @@ HRESULT WINAPI CreateXmlReader(REFIID riid, void **obj, IMalloc *imalloc)
hr = IXmlReader_QueryInterface(&reader->IXmlReader_iface, riid, obj);
IXmlReader_Release(&reader->IXmlReader_iface);
- TRACE("returning iface %p, hr %#x\n", *obj, hr);
+ TRACE("returning iface %p, hr %#lx.\n", *obj, hr);
return hr;
}
diff --git a/dlls/xmllite/writer.c b/dlls/xmllite/writer.c
index e4553ccf01d..ac02bd4c200 100644
--- a/dlls/xmllite/writer.c
+++ b/dlls/xmllite/writer.c
@@ -549,7 +549,7 @@ static HRESULT writeroutput_flush_stream(xmlwriteroutput *output)
written = 0;
hr = ISequentialStream_Write(output->stream, buffer->data + offset, buffer->written, &written);
if (FAILED(hr)) {
- WARN("write to stream failed (0x%08x)\n", hr);
+ WARN("write to stream failed %#lx.\n", hr);
buffer->written = 0;
return hr;
}
@@ -700,28 +700,30 @@ static HRESULT WINAPI xmlwriter_QueryInterface(IXmlWriter *iface, REFIID riid, v
static ULONG WINAPI xmlwriter_AddRef(IXmlWriter *iface)
{
- xmlwriter *This = impl_from_IXmlWriter(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%u)\n", This, ref);
+ xmlwriter *writer = impl_from_IXmlWriter(iface);
+ ULONG ref = InterlockedIncrement(&writer->ref);
+ TRACE("%p, refcount %lu.\n", iface, ref);
return ref;
}
static ULONG WINAPI xmlwriter_Release(IXmlWriter *iface)
{
- xmlwriter *This = impl_from_IXmlWriter(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
+ xmlwriter *writer = impl_from_IXmlWriter(iface);
+ ULONG ref = InterlockedDecrement(&writer->ref);
- TRACE("(%p)->(%u)\n", This, ref);
+ TRACE("%p, refcount %lu.\n", iface, ref);
- if (ref == 0) {
- IMalloc *imalloc = This->imalloc;
+ if (!ref)
+ {
+ IMalloc *imalloc = writer->imalloc;
- writeroutput_flush_stream(This->output);
- if (This->output) IUnknown_Release(&This->output->IXmlWriterOutput_iface);
+ writeroutput_flush_stream(writer->output);
+ if (writer->output)
+ IUnknown_Release(&writer->output->IXmlWriterOutput_iface);
- writer_free_element_stack(This);
+ writer_free_element_stack(writer);
- writer_free(This, This);
+ writer_free(writer, writer);
if (imalloc) IMalloc_Release(imalloc);
}
@@ -812,20 +814,20 @@ static HRESULT WINAPI xmlwriter_GetProperty(IXmlWriter *iface, UINT property, LO
static HRESULT WINAPI xmlwriter_SetProperty(IXmlWriter *iface, UINT property, LONG_PTR value)
{
- xmlwriter *This = impl_from_IXmlWriter(iface);
+ xmlwriter *writer = impl_from_IXmlWriter(iface);
- TRACE("(%p)->(%s %lu)\n", This, debugstr_writer_prop(property), value);
+ TRACE("%p, %s, %Id.\n", iface, debugstr_writer_prop(property), value);
switch (property)
{
case XmlWriterProperty_Indent:
- This->indent = !!value;
+ writer->indent = !!value;
break;
case XmlWriterProperty_ByteOrderMark:
- This->bom = !!value;
+ writer->bom = !!value;
break;
case XmlWriterProperty_OmitXmlDeclaration:
- This->omitxmldecl = !!value;
+ writer->omitxmldecl = !!value;
break;
default:
FIXME("Unimplemented property (%u)\n", property);
@@ -1822,9 +1824,9 @@ static HRESULT WINAPI xmlwriteroutput_QueryInterface(IXmlWriterOutput *iface, RE
static ULONG WINAPI xmlwriteroutput_AddRef(IXmlWriterOutput *iface)
{
- xmlwriteroutput *This = impl_from_IXmlWriterOutput(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ xmlwriteroutput *output = impl_from_IXmlWriterOutput(iface);
+ ULONG ref = InterlockedIncrement(&output->ref);
+ TRACE("%p, refcount %ld.\n", iface, ref);
return ref;
}
@@ -1833,7 +1835,7 @@ static ULONG WINAPI xmlwriteroutput_Release(IXmlWriterOutput *iface)
xmlwriteroutput *This = impl_from_IXmlWriterOutput(iface);
LONG ref = InterlockedDecrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ TRACE("%p, refcount %ld.\n", iface, ref);
if (ref == 0)
{
@@ -1884,7 +1886,7 @@ HRESULT WINAPI CreateXmlWriter(REFIID riid, void **obj, IMalloc *imalloc)
hr = IXmlWriter_QueryInterface(&writer->IXmlWriter_iface, riid, obj);
IXmlWriter_Release(&writer->IXmlWriter_iface);
- TRACE("returning iface %p, hr %#x\n", *obj, hr);
+ TRACE("returning iface %p, hr %#lx.\n", *obj, hr);
return hr;
}
--
2.34.1
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/evr/Makefile.in | 1 -
dlls/evr/evr.c | 2 +-
dlls/evr/mixer.c | 72 ++++++++++++++++++++++----------------------
dlls/evr/presenter.c | 40 ++++++++++++------------
dlls/evr/sample.c | 30 +++++++++---------
5 files changed, 72 insertions(+), 73 deletions(-)
diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in
index 2d86885d650..d5d78252113 100644
--- a/dlls/evr/Makefile.in
+++ b/dlls/evr/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = evr.dll
IMPORTLIB = evr
IMPORTS = mfuuid strmiids strmbase uuid dxguid ole32 oleaut32 user32 d3d9 dxva2
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c
index 1965fd247de..5e6ca03ea3d 100644
--- a/dlls/evr/evr.c
+++ b/dlls/evr/evr.c
@@ -109,7 +109,7 @@ static HRESULT WINAPI filter_config_SetNumberOfStreams(IEVRFilterConfig *iface,
{
struct evr *filter = impl_from_IEVRFilterConfig(iface);
- FIXME("filter %p, count %u, stub!\n", filter, count);
+ FIXME("filter %p, count %lu, stub!\n", filter, count);
return E_NOTIMPL;
}
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c
index 3d72270fc16..89215b4dec0 100644
--- a/dlls/evr/mixer.c
+++ b/dlls/evr/mixer.c
@@ -314,7 +314,7 @@ static ULONG WINAPI video_mixer_inner_AddRef(IUnknown *iface)
struct video_mixer *mixer = impl_from_IUnknown(iface);
ULONG refcount = InterlockedIncrement(&mixer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -339,7 +339,7 @@ static ULONG WINAPI video_mixer_inner_Release(IUnknown *iface)
ULONG refcount = InterlockedDecrement(&mixer->refcount);
unsigned int i;
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -419,7 +419,7 @@ static HRESULT WINAPI video_mixer_transform_GetStreamIDs(IMFTransform *iface, DW
struct video_mixer *mixer = impl_from_IMFTransform(iface);
HRESULT hr = S_OK;
- 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);
EnterCriticalSection(&mixer->cs);
if (mixer->input_count > input_size || !output_size)
@@ -438,7 +438,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputStreamInfo(IMFTransform *ifa
struct input_stream *input;
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, id, info);
+ TRACE("%p, %lu, %p.\n", iface, id, info);
EnterCriticalSection(&mixer->cs);
@@ -456,7 +456,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputStreamInfo(IMFTransform *ifa
static HRESULT WINAPI video_mixer_transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
{
- TRACE("%p, %u, %p.\n", iface, id, info);
+ TRACE("%p, %lu, %p.\n", iface, id, info);
if (id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -488,7 +488,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputStreamAttributes(IMFTransfor
struct input_stream *input;
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, id, attributes);
+ TRACE("%p, %lu, %p.\n", iface, id, attributes);
EnterCriticalSection(&mixer->cs);
@@ -507,7 +507,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputStreamAttributes(IMFTransfor
static HRESULT WINAPI video_mixer_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;
}
@@ -519,7 +519,7 @@ static HRESULT WINAPI video_mixer_transform_DeleteInputStream(IMFTransform *ifac
unsigned int idx;
HRESULT hr;
- TRACE("%p, %u.\n", iface, id);
+ TRACE("%p, %lu.\n", iface, id);
if (!id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -561,7 +561,7 @@ static HRESULT WINAPI video_mixer_transform_AddInputStreams(IMFTransform *iface,
unsigned int i, len;
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, count, ids);
+ TRACE("%p, %lu, %p.\n", iface, count, ids);
if (!ids)
return E_POINTER;
@@ -620,7 +620,7 @@ static HRESULT WINAPI video_mixer_transform_AddInputStreams(IMFTransform *iface,
static HRESULT WINAPI video_mixer_transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
IMFMediaType **type)
{
- TRACE("%p, %u, %u, %p.\n", iface, id, index, type);
+ TRACE("%p, %lu, %lu, %p.\n", iface, id, index, type);
return E_NOTIMPL;
}
@@ -631,7 +631,7 @@ static HRESULT WINAPI video_mixer_transform_GetOutputAvailableType(IMFTransform
struct video_mixer *mixer = impl_from_IMFTransform(iface);
HRESULT hr = S_OK;
- 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;
@@ -853,7 +853,7 @@ static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DW
unsigned int count;
GUID *guids;
- TRACE("%p, %u, %p, %#x.\n", iface, id, media_type, flags);
+ TRACE("%p, %lu, %p, %#lx.\n", iface, id, media_type, flags);
EnterCriticalSection(&mixer->cs);
@@ -910,7 +910,7 @@ static HRESULT WINAPI video_mixer_transform_SetOutputType(IMFTransform *iface, D
DWORD compare_flags;
unsigned int i;
- TRACE("%p, %u, %p, %#x.\n", iface, id, type, flags);
+ TRACE("%p, %lu, %p, %#lx.\n", iface, id, type, flags);
if (id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -985,7 +985,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputCurrentType(IMFTransform *if
struct input_stream *stream;
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, id, type);
+ TRACE("%p, %lu, %p.\n", iface, id, type);
EnterCriticalSection(&mixer->cs);
@@ -1010,7 +1010,7 @@ static HRESULT WINAPI video_mixer_transform_GetOutputCurrentType(IMFTransform *i
struct video_mixer *mixer = impl_from_IMFTransform(iface);
HRESULT hr = S_OK;
- TRACE("%p, %u, %p.\n", iface, id, type);
+ TRACE("%p, %lu, %p.\n", iface, id, type);
if (id)
return MF_E_INVALIDSTREAMNUMBER;
@@ -1036,7 +1036,7 @@ static HRESULT WINAPI video_mixer_transform_GetInputStatus(IMFTransform *iface,
struct input_stream *stream;
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, id, status);
+ TRACE("%p, %lu, %p.\n", iface, id, status);
if (!status)
return E_POINTER;
@@ -1106,7 +1106,7 @@ static HRESULT WINAPI video_mixer_transform_SetOutputBounds(IMFTransform *iface,
static HRESULT WINAPI video_mixer_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;
}
@@ -1126,7 +1126,7 @@ static HRESULT WINAPI video_mixer_transform_ProcessMessage(IMFTransform *iface,
HRESULT hr = S_OK;
unsigned int i;
- TRACE("%p, %#x, %#lx.\n", iface, message, param);
+ TRACE("%p, %#x, %Iu.\n", iface, message, param);
EnterCriticalSection(&mixer->cs);
@@ -1177,7 +1177,7 @@ static HRESULT WINAPI video_mixer_transform_ProcessInput(IMFTransform *iface, DW
struct input_stream *input;
HRESULT hr;
- TRACE("%p, %u, %p, %#x.\n", iface, id, sample, flags);
+ TRACE("%p, %lu, %p, %#lx.\n", iface, id, sample, flags);
if (!sample)
return E_POINTER;
@@ -1317,7 +1317,7 @@ static void video_mixer_render(struct video_mixer *mixer, IDirect3DSurface9 *rt)
if (FAILED(hr = video_mixer_get_sample_surface(stream->sample, &surface)))
{
- WARN("Failed to get source surface for stream %u, hr %#x.\n", i, hr);
+ WARN("Failed to get source surface for stream %u, hr %#lx.\n", i, hr);
break;
}
@@ -1346,7 +1346,7 @@ static void video_mixer_render(struct video_mixer *mixer, IDirect3DSurface9 *rt)
if (FAILED(hr = IDirectXVideoProcessor_VideoProcessBlt(mixer->processor, rt, ¶ms, samples,
mixer->input_count, NULL)))
{
- WARN("Failed to process samples, hr %#x.\n", hr);
+ WARN("Failed to process samples, hr %#lx.\n", hr);
}
}
@@ -1395,7 +1395,7 @@ static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, D
unsigned int i;
HRESULT hr;
- TRACE("%p, %#x, %u, %p, %p.\n", iface, flags, count, buffers, status);
+ TRACE("%p, %#lx, %lu, %p, %p.\n", iface, flags, count, buffers, status);
if (!buffers || !count || count > 1 || !buffers->pSample)
return E_INVALIDARG;
@@ -1572,7 +1572,7 @@ static HRESULT WINAPI video_mixer_service_client_InitServicePointers(IMFTopology
if (FAILED(hr = IMFTopologyServiceLookup_LookupService(service_lookup, MF_SERVICE_LOOKUP_GLOBAL, 0,
&MR_VIDEO_RENDER_SERVICE, &IID_IMediaEventSink, (void **)&mixer->event_sink, &count)))
{
- WARN("Failed to get renderer event sink, hr %#x.\n", hr);
+ WARN("Failed to get renderer event sink, hr %#lx.\n", hr);
}
LeaveCriticalSection(&mixer->cs);
@@ -1630,7 +1630,7 @@ static HRESULT WINAPI video_mixer_control_SetStreamZOrder(IMFVideoMixerControl2
struct input_stream *stream;
HRESULT hr;
- TRACE("%p, %u, %u.\n", iface, id, zorder);
+ TRACE("%p, %lu, %lu.\n", iface, id, zorder);
/* Can't change reference stream. */
if (!id && zorder)
@@ -1663,7 +1663,7 @@ static HRESULT WINAPI video_mixer_control_GetStreamZOrder(IMFVideoMixerControl2
struct input_stream *stream;
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, id, zorder);
+ TRACE("%p, %lu, %p.\n", iface, id, zorder);
if (!zorder)
return E_POINTER;
@@ -1685,7 +1685,7 @@ static HRESULT WINAPI video_mixer_control_SetStreamOutputRect(IMFVideoMixerContr
struct input_stream *stream;
HRESULT hr;
- TRACE("%p, %u, %s.\n", iface, id, debugstr_normalized_rect(rect));
+ TRACE("%p, %lu, %s.\n", iface, id, debugstr_normalized_rect(rect));
if (!rect)
return E_POINTER;
@@ -1713,7 +1713,7 @@ static HRESULT WINAPI video_mixer_control_GetStreamOutputRect(IMFVideoMixerContr
struct input_stream *stream;
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, id, rect);
+ TRACE("%p, %lu, %p.\n", iface, id, rect);
if (!rect)
return E_POINTER;
@@ -1732,7 +1732,7 @@ static HRESULT WINAPI video_mixer_control_SetMixingPrefs(IMFVideoMixerControl2 *
{
struct video_mixer *mixer = impl_from_IMFVideoMixerControl2(iface);
- TRACE("%p, %#x.\n", iface, flags);
+ TRACE("%p, %#lx.\n", iface, flags);
EnterCriticalSection(&mixer->cs);
mixer->mixing_flags = flags;
@@ -1898,7 +1898,7 @@ static ULONG WINAPI video_mixer_position_mapper_Release(IMFVideoPositionMapper *
static HRESULT WINAPI video_mixer_position_mapper_MapOutputCoordinateToInputStream(IMFVideoPositionMapper *iface,
float x_out, float y_out, DWORD output_stream, DWORD input_stream, float *x_in, float *y_in)
{
- FIXME("%p, %f, %f, %u, %u, %p, %p.\n", iface, x_out, y_out, output_stream, input_stream, x_in, y_in);
+ FIXME("%p, %f, %f, %lu, %lu, %p, %p.\n", iface, x_out, y_out, output_stream, input_stream, x_in, y_in);
return E_NOTIMPL;
}
@@ -1961,42 +1961,42 @@ static HRESULT WINAPI video_mixer_processor_SetVideoProcessorMode(IMFVideoProces
static HRESULT WINAPI video_mixer_processor_GetProcAmpRange(IMFVideoProcessor *iface, DWORD prop, DXVA2_ValueRange *range)
{
- FIXME("%p, %#x, %p.\n", iface, prop, range);
+ FIXME("%p, %#lx, %p.\n", iface, prop, range);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_processor_GetProcAmpValues(IMFVideoProcessor *iface, DWORD flags, DXVA2_ProcAmpValues *values)
{
- FIXME("%p, %#x, %p.\n", iface, flags, values);
+ FIXME("%p, %#lx, %p.\n", iface, flags, values);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_processor_SetProcAmpValues(IMFVideoProcessor *iface, DWORD flags, DXVA2_ProcAmpValues *values)
{
- FIXME("%p, %#x, %p.\n", iface, flags, values);
+ FIXME("%p, %#lx, %p.\n", iface, flags, values);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_processor_GetFilteringRange(IMFVideoProcessor *iface, DWORD prop, DXVA2_ValueRange *range)
{
- FIXME("%p, %#x, %p.\n", iface, prop, range);
+ FIXME("%p, %#lx, %p.\n", iface, prop, range);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_processor_GetFilteringValue(IMFVideoProcessor *iface, DWORD prop, DXVA2_Fixed32 *value)
{
- FIXME("%p, %#x, %p.\n", iface, prop, value);
+ FIXME("%p, %#lx, %p.\n", iface, prop, value);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_processor_SetFilteringValue(IMFVideoProcessor *iface, DWORD prop, DXVA2_Fixed32 *value)
{
- FIXME("%p, %#x, %p.\n", iface, prop, value);
+ FIXME("%p, %#lx, %p.\n", iface, prop, value);
return E_NOTIMPL;
}
@@ -2037,7 +2037,7 @@ static HRESULT WINAPI video_mixer_processor_SetBackgroundColor(IMFVideoProcessor
{
struct video_mixer *mixer = impl_from_IMFVideoProcessor(iface);
- TRACE("%p, %#x.\n", iface, color);
+ TRACE("%p, %#lx.\n", iface, color);
EnterCriticalSection(&mixer->cs);
if (mixer->bkgnd_color.rgba != color)
diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c
index cf8ba20cbb8..910af2891e3 100644
--- a/dlls/evr/presenter.c
+++ b/dlls/evr/presenter.c
@@ -320,7 +320,7 @@ static HRESULT video_presenter_set_media_type(struct video_presenter *presenter,
presenter->frame_time_threshold = frametime / 4;
}
else
- WARN("Failed to initialize sample allocator, hr %#x.\n", hr);
+ WARN("Failed to initialize sample allocator, hr %#lx.\n", hr);
return hr;
}
@@ -387,7 +387,7 @@ static HRESULT video_presenter_invalidate_media_type(struct video_presenter *pre
/* FIXME: check that d3d device supports this format */
if (FAILED(hr = IMFMediaType_CopyAllItems(candidate_type, (IMFAttributes *)media_type)))
- WARN("Failed to clone a media type, hr %#x.\n", hr);
+ WARN("Failed to clone a media type, hr %#lx.\n", hr);
IMFMediaType_Release(candidate_type);
hr = video_presenter_configure_output_type(presenter, &aperture, media_type);
@@ -490,13 +490,13 @@ static void video_presenter_sample_present(struct video_presenter *presenter, IM
if (FAILED(hr = video_presenter_get_sample_surface(sample, &surface)))
{
- WARN("Failed to get sample surface, hr %#x.\n", hr);
+ WARN("Failed to get sample surface, hr %#lx.\n", hr);
return;
}
if (FAILED(hr = IDirect3DSwapChain9_GetBackBuffer(presenter->swapchain, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer)))
{
- WARN("Failed to get a backbuffer, hr %#x.\n", hr);
+ WARN("Failed to get a backbuffer, hr %#lx.\n", hr);
IDirect3DSurface9_Release(surface);
return;
}
@@ -603,7 +603,7 @@ static HRESULT video_presenter_process_input(struct video_presenter *presenter)
if (FAILED(hr = IMFVideoSampleAllocator_AllocateSample(presenter->allocator, &sample)))
{
- WARN("Failed to allocate a sample, hr %#x.\n", hr);
+ WARN("Failed to allocate a sample, hr %#lx.\n", hr);
break;
}
@@ -722,7 +722,7 @@ static HRESULT video_presenter_start_streaming(struct video_presenter *presenter
CloseHandle(presenter->thread.ready_event);
presenter->thread.ready_event = NULL;
- TRACE("Started streaming thread, tid %#x.\n", presenter->thread.tid);
+ TRACE("Started streaming thread, tid %#lx.\n", presenter->thread.tid);
return S_OK;
}
@@ -737,7 +737,7 @@ static HRESULT video_presenter_end_streaming(struct video_presenter *presenter)
WaitForSingleObject(presenter->thread.hthread, INFINITE);
CloseHandle(presenter->thread.hthread);
- TRACE("Terminated streaming thread tid %#x.\n", presenter->thread.tid);
+ TRACE("Terminated streaming thread tid %#lx.\n", presenter->thread.tid);
memset(&presenter->thread, 0, sizeof(presenter->thread));
video_presenter_set_allocator_callback(presenter, NULL);
@@ -816,7 +816,7 @@ static ULONG WINAPI video_presenter_inner_AddRef(IUnknown *iface)
struct video_presenter *presenter = impl_from_IUnknown(iface);
ULONG refcount = InterlockedIncrement(&presenter->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -839,7 +839,7 @@ static ULONG WINAPI video_presenter_inner_Release(IUnknown *iface)
struct video_presenter *presenter = impl_from_IUnknown(iface);
ULONG refcount = InterlockedDecrement(&presenter->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -952,7 +952,7 @@ static HRESULT WINAPI video_presenter_ProcessMessage(IMFVideoPresenter *iface, M
struct video_presenter *presenter = impl_from_IMFVideoPresenter(iface);
HRESULT hr;
- TRACE("%p, %d, %lu.\n", iface, message, param);
+ TRACE("%p, %d, %Iu.\n", iface, message, param);
EnterCriticalSection(&presenter->cs);
@@ -1095,7 +1095,7 @@ static void video_presenter_set_mixer_rect(struct video_presenter *presenter)
if (FAILED(hr = IMFAttributes_SetBlob(attributes, &VIDEO_ZOOM_RECT, (const UINT8 *)&presenter->src_rect,
sizeof(presenter->src_rect))))
{
- WARN("Failed to set zoom rectangle attribute, hr %#x.\n", hr);
+ WARN("Failed to set zoom rectangle attribute, hr %#lx.\n", hr);
}
IMFAttributes_Release(attributes);
}
@@ -1112,7 +1112,7 @@ static HRESULT video_presenter_attach_mixer(struct video_presenter *presenter, I
if (FAILED(hr = IMFTopologyServiceLookup_LookupService(service_lookup, MF_SERVICE_LOOKUP_GLOBAL, 0,
&MR_VIDEO_MIXER_SERVICE, &IID_IMFTransform, (void **)&presenter->mixer, &count)))
{
- WARN("Failed to get mixer interface, hr %#x.\n", hr);
+ WARN("Failed to get mixer interface, hr %#lx.\n", hr);
return hr;
}
@@ -1174,7 +1174,7 @@ static HRESULT WINAPI video_presenter_service_client_InitServicePointers(IMFTopo
if (FAILED(hr = IMFTopologyServiceLookup_LookupService(service_lookup, MF_SERVICE_LOOKUP_GLOBAL, 0,
&MR_VIDEO_RENDER_SERVICE, &IID_IMediaEventSink, (void **)&presenter->event_sink, &count)))
{
- WARN("Failed to get renderer event sink, hr %#x.\n", hr);
+ WARN("Failed to get renderer event sink, hr %#lx.\n", hr);
}
}
@@ -1350,7 +1350,7 @@ static HRESULT WINAPI video_presenter_control_SetAspectRatioMode(IMFVideoDisplay
{
struct video_presenter *presenter = impl_from_IMFVideoDisplayControl(iface);
- TRACE("%p, %#x.\n", iface, mode);
+ TRACE("%p, %#lx.\n", iface, mode);
if (mode & ~MFVideoARMode_Mask)
return E_INVALIDARG;
@@ -1468,7 +1468,7 @@ static HRESULT WINAPI video_presenter_control_GetCurrentImage(IMFVideoDisplayCon
static HRESULT WINAPI video_presenter_control_SetBorderColor(IMFVideoDisplayControl *iface, COLORREF color)
{
- FIXME("%p, %#x.\n", iface, color);
+ FIXME("%p, %#lx.\n", iface, color);
return E_NOTIMPL;
}
@@ -1482,7 +1482,7 @@ static HRESULT WINAPI video_presenter_control_GetBorderColor(IMFVideoDisplayCont
static HRESULT WINAPI video_presenter_control_SetRenderingPrefs(IMFVideoDisplayControl *iface, DWORD flags)
{
- FIXME("%p, %#x.\n", iface, flags);
+ FIXME("%p, %#lx.\n", iface, flags);
return E_NOTIMPL;
}
@@ -1654,7 +1654,7 @@ static ULONG WINAPI video_presenter_position_mapper_Release(IMFVideoPositionMapp
static HRESULT WINAPI video_presenter_position_mapper_MapOutputCoordinateToInputStream(IMFVideoPositionMapper *iface,
float x_out, float y_out, DWORD output_stream, DWORD input_stream, float *x_in, float *y_in)
{
- FIXME("%p, %f, %f, %u, %u, %p, %p.\n", iface, x_out, y_out, output_stream, input_stream, x_in, y_in);
+ FIXME("%p, %f, %f, %lu, %lu, %p, %p.\n", iface, x_out, y_out, output_stream, input_stream, x_in, y_in);
return E_NOTIMPL;
}
@@ -2028,14 +2028,14 @@ static HRESULT video_presenter_init_d3d(struct video_presenter *presenter)
if (FAILED(hr))
{
- WARN("Failed to create d3d device, hr %#x.\n", hr);
+ WARN("Failed to create d3d device, hr %#lx.\n", hr);
return hr;
}
hr = IDirect3DDeviceManager9_ResetDevice(presenter->device_manager, device, presenter->reset_token);
IDirect3DDevice9_Release(device);
if (FAILED(hr))
- WARN("Failed to set new device for the manager, hr %#x.\n", hr);
+ WARN("Failed to set new device for the manager, hr %#lx.\n", hr);
if (SUCCEEDED(hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocator, (void **)&presenter->allocator)))
{
@@ -2080,7 +2080,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
if (FAILED(hr = video_presenter_init_d3d(object)))
{
- WARN("Failed to initialize d3d device, hr %#x.\n", hr);
+ WARN("Failed to initialize d3d device, hr %#lx.\n", hr);
goto failed;
}
diff --git a/dlls/evr/sample.c b/dlls/evr/sample.c
index cbba384e181..1d29b6cdc2c 100644
--- a/dlls/evr/sample.c
+++ b/dlls/evr/sample.c
@@ -147,7 +147,7 @@ static ULONG WINAPI tracked_async_result_AddRef(IMFAsyncResult *iface)
struct tracked_async_result *result = impl_from_IMFAsyncResult(iface);
ULONG refcount = InterlockedIncrement(&result->refcount);
- TRACE("%p, %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -157,7 +157,7 @@ static ULONG WINAPI tracked_async_result_Release(IMFAsyncResult *iface)
struct tracked_async_result *result = impl_from_IMFAsyncResult(iface);
ULONG refcount = InterlockedDecrement(&result->refcount);
- TRACE("%p, %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -201,7 +201,7 @@ static HRESULT WINAPI tracked_async_result_SetStatus(IMFAsyncResult *iface, HRES
{
struct tracked_async_result *result = impl_from_IMFAsyncResult(iface);
- TRACE("%p, %#x.\n", iface, status);
+ TRACE("%p, %#lx.\n", iface, status);
result->result.hrStatusResult = status;
@@ -351,7 +351,7 @@ static void video_sample_create_tracking_thread(void)
WaitForSingleObject(ready_event, INFINITE);
CloseHandle(ready_event);
- TRACE("Create tracking thread %#x.\n", tracking_thread.tid);
+ TRACE("Create tracking thread %#lx.\n", tracking_thread.tid);
}
LeaveCriticalSection(&tracking_thread_cs);
@@ -450,7 +450,7 @@ static ULONG WINAPI sample_allocator_AddRef(IMFVideoSampleAllocator *iface)
struct sample_allocator *allocator = impl_from_IMFVideoSampleAllocator(iface);
ULONG refcount = InterlockedIncrement(&allocator->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -478,7 +478,7 @@ static ULONG WINAPI sample_allocator_Release(IMFVideoSampleAllocator *iface)
struct sample_allocator *allocator = impl_from_IMFVideoSampleAllocator(iface);
ULONG refcount = InterlockedDecrement(&allocator->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -575,7 +575,7 @@ static HRESULT sample_allocator_create_samples(struct sample_allocator *allocato
if (FAILED(hr))
{
- WARN("Failed to get processor service, %#x.\n", hr);
+ WARN("Failed to get processor service, %#lx.\n", hr);
return hr;
}
}
@@ -638,7 +638,7 @@ static HRESULT WINAPI sample_allocator_InitializeSampleAllocator(IMFVideoSampleA
struct sample_allocator *allocator = impl_from_IMFVideoSampleAllocator(iface);
HRESULT hr;
- TRACE("%p, %u, %p.\n", iface, sample_count, media_type);
+ TRACE("%p, %lu, %p.\n", iface, sample_count, media_type);
if (!sample_count)
sample_count = 1;
@@ -912,7 +912,7 @@ static ULONG WINAPI video_sample_AddRef(IMFSample *iface)
struct video_sample *sample = impl_from_IMFSample(iface);
ULONG refcount = InterlockedIncrement(&sample->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -934,7 +934,7 @@ static ULONG WINAPI video_sample_Release(IMFSample *iface)
refcount = InterlockedDecrement(&sample->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
@@ -1232,7 +1232,7 @@ static HRESULT WINAPI video_sample_SetSampleFlags(IMFSample *iface, DWORD flags)
{
struct video_sample *sample = impl_from_IMFSample(iface);
- TRACE("%p, %#x.\n", iface, flags);
+ TRACE("%p, %#lx.\n", iface, flags);
return IMFSample_SetSampleFlags(sample->sample, flags);
}
@@ -1312,7 +1312,7 @@ static HRESULT WINAPI video_sample_GetBufferByIndex(IMFSample *iface, DWORD inde
{
struct video_sample *sample = impl_from_IMFSample(iface);
- TRACE("%p, %u, %p.\n", iface, index, buffer);
+ TRACE("%p, %lu, %p.\n", iface, index, buffer);
return IMFSample_GetBufferByIndex(sample->sample, index, buffer);
}
@@ -1337,7 +1337,7 @@ static HRESULT WINAPI video_sample_RemoveBufferByIndex(IMFSample *iface, DWORD i
{
struct video_sample *sample = impl_from_IMFSample(iface);
- TRACE("%p, %u.\n", iface, index);
+ TRACE("%p, %lu.\n", iface, index);
return IMFSample_RemoveBufferByIndex(sample->sample, index);
}
@@ -1585,7 +1585,7 @@ static ULONG WINAPI surface_buffer_AddRef(IMFMediaBuffer *iface)
struct surface_buffer *buffer = impl_from_IMFMediaBuffer(iface);
ULONG refcount = InterlockedIncrement(&buffer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
@@ -1595,7 +1595,7 @@ static ULONG WINAPI surface_buffer_Release(IMFMediaBuffer *iface)
struct surface_buffer *buffer = impl_from_IMFMediaBuffer(iface);
ULONG refcount = InterlockedDecrement(&buffer->refcount);
- TRACE("%p, refcount %u.\n", iface, refcount);
+ TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
--
2.34.1
1
1
[PATCH vkd3d 1/2] tests: Set the wrong descriptor heaps in test_descriptor_tables().
by Conor McCarthy Feb. 1, 2022
by Conor McCarthy Feb. 1, 2022
Feb. 1, 2022
Has no effect in Windows at least on AMD. Not calling SetDescriptorHeaps()
at all has no effect in Windows on any hardware so this is likely to be
universal too.
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
tests/d3d12.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 3b0c4242..df93b71a 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -16067,7 +16067,7 @@ static void test_srv_component_mapping(void)
static void test_descriptor_tables(void)
{
- ID3D12DescriptorHeap *heap, *sampler_heap, *heaps[2];
+ ID3D12DescriptorHeap *heap, *sampler_heap, *wrong_heap, *wrong_sampler_heap, *heaps[2];
D3D12_ROOT_SIGNATURE_DESC root_signature_desc;
D3D12_DESCRIPTOR_RANGE descriptor_range[4];
D3D12_CONSTANT_BUFFER_VIEW_DESC cbv_desc;
@@ -16194,6 +16194,8 @@ static void test_descriptor_tables(void)
heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 6);
sampler_heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, 1);
+ wrong_heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 6);
+ wrong_sampler_heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, 1);
descriptor_size = ID3D12Device_GetDescriptorHandleIncrementSize(context.device,
D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
@@ -16237,7 +16239,7 @@ static void test_descriptor_tables(void)
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
- heaps[0] = heap; heaps[1] = sampler_heap;
+ heaps[0] = wrong_heap; heaps[1] = wrong_sampler_heap;
ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, ARRAY_SIZE(heaps), heaps);
ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, 0, gpu_handle);
ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, 1,
@@ -16258,6 +16260,8 @@ static void test_descriptor_tables(void)
ID3D12Resource_Release(textures[i]);
ID3D12DescriptorHeap_Release(heap);
ID3D12DescriptorHeap_Release(sampler_heap);
+ ID3D12DescriptorHeap_Release(wrong_heap);
+ ID3D12DescriptorHeap_Release(wrong_sampler_heap);
destroy_test_context(&context);
}
--
2.34.1
3
5
[tools] testbot/SetWinLocale: Add support for the Powershell locale APIs.
by Francois Gouget Feb. 1, 2022
by Francois Gouget Feb. 1, 2022
Feb. 1, 2022
Doing so requires Windows 8+ so keep the intl.cpl code path as a
fallback.
Support for --sys-copy and --def-copy even requires Windows 11 so keep
leveraging intl.cpl to perform the copies.
Allow skipping the Powershell APIs by passing --use-intl.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
The Powershell APIs work a bit differently from intl.cpl:
* They automatically set the code pages to UTF-8 for Unicode-only system
locales (e.g. Hindi) whereas intl.cpl just fails to modify the system
locale in that case.
* They automatically adjust the display language locale, for instance
from en-CA to en-GB, when again intl.cpl just fails in such a case.
Unfortunately these differences make the SetWinLocale behavior a bit
inconsistent between these two code paths.
---
testbot/bin/SetWinLocale | 21 +++++++++++-----
testbot/bin/SetWinLocale.ps1 | 49 ++++++++++++++++++++++++++++++++++--
2 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 81bb2212b1..9f89280ab9 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -316,7 +316,7 @@ sub CheckLocale($$)
return undef;
}
-my ($OptHostName, $OptShow, $OptSysCopy, $OptDefCopy, $OptReboot);
+my ($OptHostName, $OptShow, $OptSysCopy, $OptDefCopy, $OptUseIntl, $OptReboot);
my ($OptDefault, $OptLocale, $OptCountry, $OptSystem, $OptUTF8, $OptMUI, $OptKeyboard);
while (@ARGV)
{
@@ -329,6 +329,10 @@ while (@ARGV)
{
$OptShow = 1;
}
+ elsif ($Arg eq "--use-intl")
+ {
+ $OptUseIntl = 1;
+ }
elsif ($Arg eq "--sys-copy")
{
$OptSysCopy = 1;
@@ -457,15 +461,16 @@ if (!defined $Usage)
Error("you must specify at least one locale to change\n");
$Usage = 2;
}
- if (defined $OptReboot)
+ if ($OptUseIntl or defined $OptReboot)
{
- Error("--(no-)reboot can only be used when changing a locale\n");
+ Error("--use-intl and --(no-)reboot can only be used when changing a locale\n");
$Usage = 2;
}
}
if ($OptShow and ($OptLocale or $OptCountry or $OptSystem or $OptUTF8 or
$OptMUI or $OptKeyboard or defined $OptSysCopy or
- defined $OptDefCopy or defined $OptReboot))
+ defined $OptDefCopy or defined $OptUseIntl or
+ defined $OptReboot))
{
Error("--show and the locale options are mutually incompatible\n");
$Usage = 2;
@@ -488,7 +493,7 @@ if (defined $Usage)
exit $Usage;
}
print "Usage: $name0 [options] --show HOSTNAME\n";
- print "or $name0 [options] [--default DEF] [--locale LOC] [--country CTY] [--system SYS] [--utf8] [--mui MUI] [--keyboard KBD] [--no-sys-copy] [--no-def-copy] [--no-reboot] HOSTNAME\n";
+ print "or $name0 [options] [--default DEF] [--locale LOC] [--country CTY] [--system SYS] [--utf8] [--mui MUI] [--keyboard KBD] [--no-sys-copy] [--no-def-copy] [--use-intl] [--no-reboot] HOSTNAME\n";
print "\n";
print "Sets the locale of the specified Windows machine.\n";
print "\n";
@@ -563,6 +568,9 @@ if (defined $Usage)
print " . Powershell (Windows 11+): Copy-UserInternationalSettingsToSystem -NewUser \$True\n";
print " . Intl.cpl: CopySettingsToDefaultUserAcct='true'\n";
print " --no-def-copy Do not copy the current locales to the default user account.\n";
+ print " --use-intl Change the locale using the intl.cpl control panel module\n";
+ print " instead of Powershell. This option should only be used for\n";
+ print " debugging.\n";
print " --no-reboot Do not reboot Windows. Some locale changes will only take\n";
print " effect after the next reboot. This will also prevent working\n";
print " around cases where some locale changes do not stick after a\n";
@@ -835,7 +843,8 @@ sub SetWinLocales($$$$$$$$)
"$name0.ps1", "locales", $Locale || ".", $CountryId || ".",
$System || ".", $UTF8 ? "true" : "false", $MUI || ".",
$KeyboardIds ? $KeyboardIds->[0] : ".",
- $SysCopy ? "true" : "false", $DefCopy ? "true" : "false"];
+ $SysCopy ? "true" : "false", $DefCopy ? "true" : "false",
+ $OptUseIntl ? "true" : "false"];
Debug(Elapsed($Start), " Running: ", join(" ", @$Cmd), "\n");
my $Ret = $TA->RunAndWait($Cmd, 0, 30, undef, "$name0.out", "$name0.out");
FatalError("$name0.ps1 locales failed: ", $TA->GetLastError(), "\n") if ($Ret < 0);
diff --git a/testbot/bin/SetWinLocale.ps1 b/testbot/bin/SetWinLocale.ps1
index afb60d6ee5..00e9a1af14 100644
--- a/testbot/bin/SetWinLocale.ps1
+++ b/testbot/bin/SetWinLocale.ps1
@@ -188,6 +188,40 @@ function SetCodePages($Value)
}
}
+$SWC_Success = $True
+
+function SetWinCulture([string]$Locale, [string]$CountryId, [string]$System, [bool]$UTF8, [string]$MUI, [string]$KeyboardId, [bool]$SysCopy, [bool]$DefCopy)
+{
+ $Cmd = Get-Command Set-Culture -ErrorAction SilentlyContinue
+ if ($Cmd -eq $null) {
+ Write-Output "Set-Culture is not supported"
+ $global:SWC_Success = $False
+ return
+ }
+
+ if ($Locale) { Set-Culture $Locale }
+ if ($CountryId) { Set-WinHomeLocation $CountryId }
+ if ($System) { Set-WinSystemLocale $System }
+ if ($UTF8) { SetCodePages(65001) }
+ if ($MUI) { Set-WinUILanguageOverride $MUI }
+ if ($KeyboardId) { Set-WinDefaultInputMethodOverride $KeyboardId }
+ if ($SysCopy -or $DefCopy)
+ {
+ $Cmd = Get-Command Copy-UserInternationalSettingsToSystem -ErrorAction SilentlyContinue
+ if ($Cmd -ne $null)
+ {
+ Copy-UserInternationalSettingsToSystem -WelcomeScreen $SysCopy -NewUser $DefCopy
+ }
+ else
+ {
+ Write-Output "Copy-UserInternationalSettingsToSystem is not supported. Falling back to intl.cpl for the locales copies."
+ WriteIntlCplConfig $undef $undef $undef $undef $undef $SysCopy $DefCopy >"$Name0.xml"
+ RunIntlCpl "$Name0.xml"
+ Remove-Item -Path "$Name0.xml"
+ }
+ }
+}
+
#
# The locale-change actions
@@ -226,6 +260,14 @@ function SetLocales($Argv)
$DefCopy = $Argv[8] -ne "false"
$UseIntlCpl = $Argv[9] -eq "true"
+ if ($UseIntlCpl -eq $False)
+ {
+ Write-OutPut "Setting the locales using the Powershell APIs"
+ SetWinCulture $Locale $CountryId $System $UTF8 $MUI $KeyboardId $SysCopy $DefCopy
+ if ($SWC_Success -eq $True) { exit 0 }
+ Write-Output "Falling back to intl.cpl"
+ }
+
WriteIntlCplConfig $Locale $CountryId $System $MUI $KeyboardId $SysCopy $DefCopy >"$Name0.xml"
RunIntlCpl "$Name0.xml"
Remove-Item -Path "$Name0.xml"
@@ -243,7 +285,7 @@ function ShowUsage()
{
Write-Output "Usage: $Name0 settings"
Write-Output "or $Name0 intlconfig LOCALE COUNTRYID SYSTEM UTF8 MUI KEYBOARDID SYSCOPY DEFCOPY"
- Write-Output "or $Name0 locales LOCALE COUNTRYID SYSTEM UTF8 MUI KEYBOARDID SYSCOPY DEFCOPY"
+ Write-Output "or $Name0 locales LOCALE COUNTRYID SYSTEM UTF8 MUI KEYBOARDID SYSCOPY DEFCOPY USEINTLCPL"
Write-Output "or $Name0 -?"
Write-Output ""
Write-Output "Shows or modifies the Windows locales."
@@ -251,7 +293,8 @@ function ShowUsage()
Write-Output "Where:"
Write-Output " settings Show the current Windows locale settings."
Write-Output " intlconfig Generates an XML configuration file for intl.cpl."
- Write-Output " locales Modifies the locales by invoking intl.cpl."
+ Write-Output " locales Modifies the locales either through the Powershell APIs or"
+ Write-Output " intl.cpl."
Write-Output " LOCALE Is the BCP-47 locale to use for formats, date and time."
Write-Output " COUNTRYID Is the numerical country code."
Write-Output " SYSTEM Is the BCP-47 locale to use as the system locale."
@@ -262,6 +305,8 @@ function ShowUsage()
Write-Output " (such as used for the logon screen). This is the default."
Write-Output " DEFCOPY If 'true' the locale settings will be copied to the default account"
Write-Output " (for new users). This is the default."
+ Write-Output " USEINTLCPL If 'true' apply the changes using intl.cpl instead of first trying"
+ Write-Output " the Powershell APIs."
Write-Output " -? Shows this help message."
}
--
2.30.2
1
0
[PATCH 1/3] d3d11: Always initialize out view pointer in CreateShaderResourceView().
by Nikolay Sivov Feb. 1, 2022
by Nikolay Sivov Feb. 1, 2022
Feb. 1, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d3d10core/tests/d3d10core.c | 6 ++++++
dlls/d3d11/device.c | 4 ++++
dlls/d3d11/tests/d3d11.c | 8 ++++++++
3 files changed, 18 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c
index ea710038e17..f8dcbb8cb47 100644
--- a/dlls/d3d10core/tests/d3d10core.c
+++ b/dlls/d3d10core/tests/d3d10core.c
@@ -3555,8 +3555,10 @@ static void test_create_shader_resource_view(void)
buffer = create_buffer(device, D3D10_BIND_SHADER_RESOURCE, 1024, NULL);
+ srview = (void *)0xdeadbeef;
hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)buffer, NULL, &srview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!srview, "Unexpected pointer %p\n", srview);
srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
srv_desc.ViewDimension = D3D10_SRV_DIMENSION_BUFFER;
@@ -3586,8 +3588,10 @@ static void test_create_shader_resource_view(void)
/* Without D3D10_BIND_SHADER_RESOURCE. */
buffer = create_buffer(device, 0, 1024, NULL);
+ srview = (void *)0xdeadbeef;
hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)buffer, &srv_desc, &srview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!srview, "Unexpected pointer %p\n", srview);
ID3D10Buffer_Release(buffer);
@@ -3693,9 +3697,11 @@ static void test_create_shader_resource_view(void)
texture = (ID3D10Resource *)texture3d;
}
+ srview = (void *)0xdeadbeef;
get_srv_desc(&srv_desc, &invalid_desc_tests[i].srv_desc);
hr = ID3D10Device_CreateShaderResourceView(device, texture, &srv_desc, &srview);
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(!srview, "Unexpected pointer %p.\n", srview);
ID3D10Resource_Release(texture);
}
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index f0cbb1741ab..858cd9f6d4a 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3377,6 +3377,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Dev
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ *view = NULL;
+
if (!resource)
return E_INVALIDARG;
@@ -6021,6 +6023,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView1(ID3D10De
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ *view = NULL;
+
if (!resource)
return E_INVALIDARG;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 56747e7168c..1db367f39fa 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4371,16 +4371,20 @@ static void test_create_shader_resource_view(void)
buffer = create_buffer(device, D3D11_BIND_SHADER_RESOURCE, 1024, NULL);
+ srview = (void *)0xdeadbeef;
hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, NULL, &srview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!srview, "Unexpected pointer %p.\n", srview);
srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
U1(U(srv_desc).Buffer).ElementOffset = 0;
U2(U(srv_desc).Buffer).ElementWidth = 64;
+ srview = (void *)0xdeadbeef;
hr = ID3D11Device_CreateShaderResourceView(device, NULL, &srv_desc, &srview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!srview, "Unexpected pointer %p.\n", srview);
expected_refcount = get_refcount(device) + 1;
hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, &srv_desc, &srview);
@@ -4405,8 +4409,10 @@ static void test_create_shader_resource_view(void)
/* Without D3D11_BIND_SHADER_RESOURCE. */
buffer = create_buffer(device, 0, 1024, NULL);
+ srview = (void *)0xdeadbeef;
hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, &srv_desc, &srview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!srview, "Unexpected pointer %p.\n", srview);
ID3D11Buffer_Release(buffer);
@@ -4564,9 +4570,11 @@ static void test_create_shader_resource_view(void)
texture = (ID3D11Resource *)texture3d;
}
+ srview = (void *)0xdeadbeef;
get_srv_desc(&srv_desc, &invalid_desc_tests[i].srv_desc);
hr = ID3D11Device_CreateShaderResourceView(device, texture, &srv_desc, &srview);
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(!srview, "Unexpected pointer %p.\n", srview);
ID3D11Resource_Release(texture);
}
--
2.34.1
3
8
[PATCH 5/5] user32: Destroy window server objects from destroy_thread_windows.
by Jacek Caban Feb. 1, 2022
by Jacek Caban Feb. 1, 2022
Feb. 1, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/user32/win.c | 9 +++++++++
server/window.c | 7 +++++--
2 files changed, 14 insertions(+), 2 deletions(-)
1
0
Feb. 1, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
This is a preparation for the next patch, which makes sure that there is
no inconsistency between server and user32 view of window handles after
destroy_thread_windows is done in user32, but not yet in server. This is
probably not a big deal right now (although it's not right either), my
main motivation is a rework of handles that I'm working on. If this and
the next patch are not convincing alone, please hold them. I plan to
share more patches for a better context soon, but I don't have them
cleaned up enough yet.
dlls/user32/win.c | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
1
0
Feb. 1, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
Having WM_WINE_* in ntuser.h is not right long term, we will want it to
be private to server and win32u, but it makes the conversion more
convenient for now.
dlls/user32/user_private.h | 18 ------------------
dlls/user32/win.c | 12 +-----------
include/ntuser.h | 19 +++++++++++++++++++
server/window.c | 6 +++---
4 files changed, 23 insertions(+), 32 deletions(-)
1
0
[PATCH 1/5] include: InterlockedExchangeAdd64 msvc intrinsic does not exist in x86.
by Stefan Dösinger Feb. 1, 2022
by Stefan Dösinger Feb. 1, 2022
Feb. 1, 2022
Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com>
---
Verified with a stand-alone Visual Studio project. There's also a lower-case
_interlockedexchangeadd64 intrinsic for arm, arm64 and x86_64, but not x86.
---
include/winnt.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/winnt.h b/include/winnt.h
index 18d9fa656f8..66a591ddaf2 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -6292,7 +6292,6 @@ typedef enum _PROCESS_MITIGATION_POLICY
#pragma intrinsic(_InterlockedCompareExchange64)
#pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchangeAdd)
-#pragma intrinsic(_InterlockedExchangeAdd64)
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedIncrement16)
#pragma intrinsic(_InterlockedDecrement)
@@ -6309,7 +6308,6 @@ long _InterlockedDecrement(long volatile*);
short _InterlockedDecrement16(short volatile*);
long _InterlockedExchange(long volatile*,long);
long _InterlockedExchangeAdd(long volatile*,long);
-long long _InterlockedExchangeAdd64(long long volatile*,long long);
long _InterlockedIncrement(long volatile*);
short _InterlockedIncrement16(short volatile*);
long _InterlockedOr(long volatile *,long);
@@ -6352,9 +6350,11 @@ static FORCEINLINE void MemoryBarrier(void)
#elif defined(__x86_64__)
+#pragma intrinsic(_InterlockedExchangeAdd64)
#pragma intrinsic(__faststorefence)
void __faststorefence(void);
+long long _InterlockedExchangeAdd64(long long volatile *, long long);
static FORCEINLINE void MemoryBarrier(void)
{
--
2.34.1
1
4
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/custom.c | 5 ++---
dlls/msi/handle.c | 6 +++---
dlls/msi/install.c | 17 ++++++++---------
dlls/msi/msipriv.h | 16 +++++-----------
dlls/msi/package.c | 15 +++++++--------
dlls/msi/streams.c | 3 ++-
dlls/msi/string.c | 10 ++++------
dlls/msi/where.c | 3 ++-
8 files changed, 33 insertions(+), 42 deletions(-)
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index ee4f59b5faa..94c159c6a2a 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -36,7 +36,6 @@
#include "msipriv.h"
#include "winemsi.h"
#include "wine/asm.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -68,12 +67,12 @@ static struct list msi_pending_custom_actions = LIST_INIT( msi_pending_custom_ac
void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len)
{
- return heap_alloc(len);
+ return malloc(len);
}
void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr)
{
- heap_free(ptr);
+ free(ptr);
}
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
diff --git a/dlls/msi/handle.c b/dlls/msi/handle.c
index 0881833ff68..26d8e7d7f85 100644
--- a/dlls/msi/handle.c
+++ b/dlls/msi/handle.c
@@ -92,13 +92,13 @@ static MSIHANDLE alloc_handle_table_entry(void)
if (msihandletable_size == 0)
{
newsize = 256;
- p = msi_alloc_zero(newsize*sizeof(msi_handle_info));
+ p = msi_alloc_zero(newsize * sizeof(*p));
}
else
{
newsize = msihandletable_size * 2;
- p = msi_realloc_zero(msihandletable,
- newsize*sizeof(msi_handle_info));
+ p = msi_realloc(msihandletable, newsize * sizeof(*p));
+ if (p) memset(p + msihandletable_size, 0, (newsize - msihandletable_size) * sizeof(*p));
}
if (!p)
return 0;
diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index a3bfb53cfff..4d909b67682 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -34,7 +34,6 @@
#include "msipriv.h"
#include "winemsi.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -273,7 +272,7 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW
if (!(remote = msi_get_remote(hinst)))
{
- heap_free(folderW);
+ free(folderW);
return ERROR_INVALID_HANDLE;
}
@@ -291,7 +290,7 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW
r = msi_strncpyWtoA(path, -1, buf, sz, TRUE);
midl_user_free(path);
- heap_free(folderW);
+ free(folderW);
return r;
}
@@ -301,7 +300,7 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW
else
r = ERROR_DIRECTORY;
- heap_free(folderW);
+ free(folderW);
msiobj_release(&package->hdr);
return r;
}
@@ -429,7 +428,7 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
if (!(remote = msi_get_remote(hinst)))
{
- heap_free(folderW);
+ free(folderW);
return ERROR_INVALID_HANDLE;
}
@@ -447,7 +446,7 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
r = msi_strncpyWtoA(path, -1, buf, sz, TRUE);
midl_user_free(path);
- heap_free(folderW);
+ free(folderW);
return r;
}
@@ -457,8 +456,8 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
else
r = ERROR_DIRECTORY;
- heap_free(path);
- heap_free(folderW);
+ free(path);
+ free(folderW);
msiobj_release(&package->hdr);
return r;
}
@@ -509,7 +508,7 @@ UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf,
else
r = ERROR_DIRECTORY;
- heap_free(path);
+ free(path);
msiobj_release(&package->hdr);
return r;
}
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 15130446b04..b5838bad6fe 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -1141,30 +1141,24 @@ extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN;
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *msi_alloc( size_t len )
{
- return HeapAlloc( GetProcessHeap(), 0, len );
+ return malloc( len );
}
static void *msi_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *msi_alloc_zero( size_t len )
{
- return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
+ return calloc( 1, len );
}
static void *msi_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
static inline void *msi_realloc( void *mem, size_t len )
{
- return HeapReAlloc( GetProcessHeap(), 0, mem, len );
+ return realloc( mem, len );
}
-static void *msi_realloc_zero( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
-static inline void *msi_realloc_zero( void *mem, size_t len )
+static inline void msi_free( void *mem )
{
- return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len );
-}
-
-static inline BOOL msi_free( void *mem )
-{
- return HeapFree( GetProcessHeap(), 0, mem );
+ free( mem );
}
static inline char *strdupWtoA( LPCWSTR str )
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 7488c095080..349d7c0ffa3 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -43,7 +43,6 @@
#include "msidefs.h"
#include "sddl.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -2272,7 +2271,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
if (!(remote = msi_get_remote(hinst)))
{
- heap_free(nameW);
+ free(nameW);
return ERROR_INVALID_HANDLE;
}
@@ -2286,13 +2285,13 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
}
__ENDTRY
- heap_free(nameW);
+ free(nameW);
if (!r)
{
/* String might contain embedded nulls.
* Native returns the correct size but truncates the string. */
- tmp = heap_alloc_zero((len + 1) * sizeof(WCHAR));
+ tmp = calloc(1, (len + 1) * sizeof(WCHAR));
if (!tmp)
{
midl_user_free(value);
@@ -2302,7 +2301,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
- heap_free(tmp);
+ free(tmp);
}
midl_user_free(value);
return r;
@@ -2314,7 +2313,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
- heap_free(nameW);
+ free(nameW);
if (row) msiobj_release(&row->hdr);
msiobj_release(&package->hdr);
return r;
@@ -2355,7 +2354,7 @@ UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWOR
{
/* String might contain embedded nulls.
* Native returns the correct size but truncates the string. */
- tmp = heap_alloc_zero((len + 1) * sizeof(WCHAR));
+ tmp = calloc(1, (len + 1) * sizeof(WCHAR));
if (!tmp)
{
midl_user_free(value);
@@ -2365,7 +2364,7 @@ UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWOR
r = msi_strncpyW(tmp, len, buf, sz);
- heap_free(tmp);
+ free(tmp);
}
midl_user_free(value);
return r;
diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c
index 1ef99c2ab05..8f6986039a9 100644
--- a/dlls/msi/streams.c
+++ b/dlls/msi/streams.c
@@ -57,7 +57,8 @@ static BOOL streams_resize_table( MSIDATABASE *db, UINT size )
{
MSISTREAM *tmp;
UINT new_size = db->num_streams_allocated * 2;
- if (!(tmp = msi_realloc_zero( db->streams, new_size * sizeof(MSISTREAM) ))) return FALSE;
+ if (!(tmp = msi_realloc( db->streams, new_size * sizeof(*tmp) ))) return FALSE;
+ memset( tmp + db->num_streams_allocated, 0, (new_size - db->num_streams_allocated) * sizeof(*tmp) );
db->streams = tmp;
db->num_streams_allocated = new_size;
}
diff --git a/dlls/msi/string.c b/dlls/msi/string.c
index 0e250ff4527..fb0134810b9 100644
--- a/dlls/msi/string.c
+++ b/dlls/msi/string.c
@@ -139,13 +139,11 @@ static int st_find_free_entry( string_table *st )
return i;
/* dynamically resize */
- sz = st->maxcount + 1 + st->maxcount/2;
- p = msi_realloc_zero( st->strings, sz * sizeof(struct msistring) );
- if( !p )
- return -1;
+ sz = st->maxcount + 1 + st->maxcount / 2;
+ if (!(p = msi_realloc( st->strings, sz * sizeof(*p) ))) return -1;
+ memset( p + st->maxcount, 0, (sz - st->maxcount) * sizeof(*p) );
- s = msi_realloc( st->sorted, sz*sizeof(UINT) );
- if( !s )
+ if (!(s = msi_realloc( st->sorted, sz * sizeof(*s) )))
{
msi_free( p );
return -1;
diff --git a/dlls/msi/where.c b/dlls/msi/where.c
index 2a64de8cd9d..684d9d5fb98 100644
--- a/dlls/msi/where.c
+++ b/dlls/msi/where.c
@@ -131,9 +131,10 @@ static UINT add_row(MSIWHEREVIEW *wv, UINT vals[])
MSIROWENTRY **new_reorder;
UINT newsize = wv->reorder_size * 2;
- new_reorder = msi_realloc_zero(wv->reorder, sizeof(MSIROWENTRY *) * newsize);
+ new_reorder = msi_realloc(wv->reorder, newsize * sizeof(*new_reorder));
if (!new_reorder)
return ERROR_OUTOFMEMORY;
+ memset(new_reorder + wv->reorder_size, 0, (newsize - wv->reorder_size) * sizeof(*new_reorder));
wv->reorder = new_reorder;
wv->reorder_size = newsize;
--
2.30.2
1
0
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/webservices/channel.c | 111 ++++++++++++-----------
dlls/webservices/error.c | 6 +-
dlls/webservices/heap.c | 6 +-
dlls/webservices/listener.c | 19 ++--
dlls/webservices/msg.c | 69 ++++++++-------
dlls/webservices/proxy.c | 6 +-
dlls/webservices/reader.c | 150 ++++++++++++++++----------------
dlls/webservices/string.c | 46 +++++-----
dlls/webservices/tests/writer.c | 28 +++---
dlls/webservices/url.c | 12 +--
dlls/webservices/writer.c | 46 +++++-----
11 files changed, 248 insertions(+), 251 deletions(-)
diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c
index 9079d0a8cb1..9315334c23f 100644
--- a/dlls/webservices/channel.c
+++ b/dlls/webservices/channel.c
@@ -25,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
#include "sock.h"
@@ -132,7 +131,7 @@ static void CALLBACK queue_runner( TP_CALLBACK_INSTANCE *instance, void *ctx )
while ((task = dequeue_task( queue )))
{
task->proc( task );
- heap_free( task );
+ free( task );
}
break;
}
@@ -249,7 +248,7 @@ static struct channel *alloc_channel(void)
struct channel *ret;
ULONG size = sizeof(*ret) + prop_size( channel_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = CHANNEL_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -266,7 +265,7 @@ static struct channel *alloc_channel(void)
static void clear_addr( WS_ENDPOINT_ADDRESS *addr )
{
- heap_free( addr->url.chars );
+ free( addr->url.chars );
addr->url.chars = NULL;
addr->url.length = 0;
}
@@ -282,7 +281,7 @@ static void clear_queue( struct queue *queue )
{
struct task *task = LIST_ENTRY( ptr, struct task, entry );
list_remove( &task->entry );
- heap_free( task );
+ free( task );
}
CloseHandle( queue->wait );
@@ -342,7 +341,7 @@ static void reset_channel( struct channel *channel )
channel->u.http.connect = NULL;
WinHttpCloseHandle( channel->u.http.session );
channel->u.http.session = NULL;
- heap_free( channel->u.http.path );
+ free( channel->u.http.path );
channel->u.http.path = NULL;
channel->u.http.flags = 0;
break;
@@ -364,8 +363,8 @@ static void reset_channel( struct channel *channel )
static void free_header_mappings( WS_HTTP_HEADER_MAPPING **mappings, ULONG count )
{
ULONG i;
- for (i = 0; i < count; i++) heap_free( mappings[i] );
- heap_free( mappings );
+ for (i = 0; i < count; i++) free( mappings[i] );
+ free( mappings );
}
static void free_message_mapping( const WS_HTTP_MESSAGE_MAPPING *mapping )
@@ -389,8 +388,8 @@ static void free_channel( struct channel *channel )
WsFreeWriter( channel->writer );
WsFreeReader( channel->reader );
- heap_free( channel->read_buf );
- heap_free( channel->send_buf );
+ free( channel->read_buf );
+ free( channel->send_buf );
free_props( channel );
channel->send_q.cs.DebugInfo->Spare[0] = 0;
@@ -399,14 +398,14 @@ static void free_channel( struct channel *channel )
DeleteCriticalSection( &channel->send_q.cs );
DeleteCriticalSection( &channel->recv_q.cs );
DeleteCriticalSection( &channel->cs );
- heap_free( channel );
+ free( channel );
}
static WS_HTTP_HEADER_MAPPING *dup_header_mapping( const WS_HTTP_HEADER_MAPPING *src )
{
WS_HTTP_HEADER_MAPPING *dst;
- if (!(dst = heap_alloc( sizeof(*dst) + src->headerName.length ))) return NULL;
+ if (!(dst = malloc( sizeof(*dst) + src->headerName.length ))) return NULL;
dst->headerName.bytes = (BYTE *)(dst + 1);
memcpy( dst->headerName.bytes, src->headerName.bytes, src->headerName.length );
@@ -420,7 +419,7 @@ static HRESULT dup_message_mapping( const WS_HTTP_MESSAGE_MAPPING *src, WS_HTTP_
ULONG i, size;
size = src->requestHeaderMappingCount * sizeof(*dst->responseHeaderMappings);
- if (!(dst->requestHeaderMappings = heap_alloc( size ))) return E_OUTOFMEMORY;
+ if (!(dst->requestHeaderMappings = malloc( size ))) return E_OUTOFMEMORY;
for (i = 0; i < src->requestHeaderMappingCount; i++)
{
@@ -432,9 +431,9 @@ static HRESULT dup_message_mapping( const WS_HTTP_MESSAGE_MAPPING *src, WS_HTTP_
}
size = src->responseHeaderMappingCount * sizeof(*dst->responseHeaderMappings);
- if (!(dst->responseHeaderMappings = heap_alloc( size )))
+ if (!(dst->responseHeaderMappings = malloc( size )))
{
- heap_free( dst->responseHeaderMappings );
+ free( dst->responseHeaderMappings );
return E_OUTOFMEMORY;
}
@@ -848,7 +847,7 @@ static HRESULT queue_shutdown_session( struct channel *channel, const WS_ASYNC_C
{
struct shutdown_session *s;
- if (!(s = heap_alloc( sizeof(*s) ))) return E_OUTOFMEMORY;
+ if (!(s = malloc( sizeof(*s) ))) return E_OUTOFMEMORY;
s->task.proc = shutdown_session_proc;
s->channel = channel;
s->ctx = *ctx;
@@ -921,7 +920,7 @@ static HRESULT queue_close_channel( struct channel *channel, const WS_ASYNC_CONT
{
struct close_channel *c;
- if (!(c = heap_alloc( sizeof(*c) ))) return E_OUTOFMEMORY;
+ if (!(c = malloc( sizeof(*c) ))) return E_OUTOFMEMORY;
c->task.proc = close_channel_proc;
c->channel = channel;
c->ctx = *ctx;
@@ -973,11 +972,11 @@ static HRESULT parse_http_url( const WCHAR *url, ULONG len, URL_COMPONENTS *uc )
memset( uc, 0, sizeof(*uc) );
uc->dwStructSize = sizeof(*uc);
uc->dwHostNameLength = 128;
- uc->lpszHostName = heap_alloc( uc->dwHostNameLength * sizeof(WCHAR) );
+ uc->lpszHostName = malloc( uc->dwHostNameLength * sizeof(WCHAR) );
uc->dwUrlPathLength = 128;
- uc->lpszUrlPath = heap_alloc( uc->dwUrlPathLength * sizeof(WCHAR) );
+ uc->lpszUrlPath = malloc( uc->dwUrlPathLength * sizeof(WCHAR) );
uc->dwExtraInfoLength = 128;
- uc->lpszExtraInfo = heap_alloc( uc->dwExtraInfoLength * sizeof(WCHAR) );
+ uc->lpszExtraInfo = malloc( uc->dwExtraInfoLength * sizeof(WCHAR) );
if (!uc->lpszHostName || !uc->lpszUrlPath || !uc->lpszExtraInfo) goto error;
if (!WinHttpCrackUrl( url, len, ICU_DECODE, uc ))
@@ -987,11 +986,11 @@ static HRESULT parse_http_url( const WCHAR *url, ULONG len, URL_COMPONENTS *uc )
hr = HRESULT_FROM_WIN32( err );
goto error;
}
- if (!(tmp = heap_realloc( uc->lpszHostName, uc->dwHostNameLength * sizeof(WCHAR) ))) goto error;
+ if (!(tmp = realloc( uc->lpszHostName, uc->dwHostNameLength * sizeof(WCHAR) ))) goto error;
uc->lpszHostName = tmp;
- if (!(tmp = heap_realloc( uc->lpszUrlPath, uc->dwUrlPathLength * sizeof(WCHAR) ))) goto error;
+ if (!(tmp = realloc( uc->lpszUrlPath, uc->dwUrlPathLength * sizeof(WCHAR) ))) goto error;
uc->lpszUrlPath = tmp;
- if (!(tmp = heap_realloc( uc->lpszExtraInfo, uc->dwExtraInfoLength * sizeof(WCHAR) ))) goto error;
+ if (!(tmp = realloc( uc->lpszExtraInfo, uc->dwExtraInfoLength * sizeof(WCHAR) ))) goto error;
uc->lpszExtraInfo = tmp;
WinHttpCrackUrl( url, len, ICU_DECODE, uc );
}
@@ -999,9 +998,9 @@ static HRESULT parse_http_url( const WCHAR *url, ULONG len, URL_COMPONENTS *uc )
return S_OK;
error:
- heap_free( uc->lpszHostName );
- heap_free( uc->lpszUrlPath );
- heap_free( uc->lpszExtraInfo );
+ free( uc->lpszHostName );
+ free( uc->lpszUrlPath );
+ free( uc->lpszExtraInfo );
return hr;
}
@@ -1014,7 +1013,7 @@ static HRESULT open_channel_http( struct channel *channel )
if (channel->u.http.connect) return S_OK;
if ((hr = parse_http_url( channel->addr.url.chars, channel->addr.url.length, &uc )) != S_OK) return hr;
- if (!(channel->u.http.path = heap_alloc( (uc.dwUrlPathLength + uc.dwExtraInfoLength + 1) * sizeof(WCHAR) )))
+ if (!(channel->u.http.path = malloc( (uc.dwUrlPathLength + uc.dwExtraInfoLength + 1) * sizeof(WCHAR) )))
{
hr = E_OUTOFMEMORY;
goto done;
@@ -1058,9 +1057,9 @@ done:
WinHttpCloseHandle( con );
WinHttpCloseHandle( ses );
}
- heap_free( uc.lpszHostName );
- heap_free( uc.lpszUrlPath );
- heap_free( uc.lpszExtraInfo );
+ free( uc.lpszHostName );
+ free( uc.lpszUrlPath );
+ free( uc.lpszExtraInfo );
return hr;
}
@@ -1080,14 +1079,14 @@ static HRESULT open_channel_tcp( struct channel *channel )
if ((hr = parse_url( &channel->addr.url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_NETTCP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, 0 );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((channel->u.tcp.socket = socket( addr->sa_family, SOCK_STREAM, 0 )) == -1)
@@ -1120,14 +1119,14 @@ static HRESULT open_channel_udp( struct channel *channel )
if ((hr = parse_url( &channel->addr.url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_SOAPUDP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, 0 );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((channel->u.udp.socket = socket( addr->sa_family, SOCK_DGRAM, 0 )) == -1)
@@ -1155,7 +1154,7 @@ static HRESULT open_channel( struct channel *channel, const WS_ENDPOINT_ADDRESS
TRACE( "endpoint %s\n", debugstr_wn(endpoint->url.chars, endpoint->url.length) );
- if (!(channel->addr.url.chars = heap_alloc( endpoint->url.length * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
+ if (!(channel->addr.url.chars = malloc( endpoint->url.length * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
memcpy( channel->addr.url.chars, endpoint->url.chars, endpoint->url.length * sizeof(WCHAR) );
channel->addr.url.length = endpoint->url.length;
@@ -1207,7 +1206,7 @@ static HRESULT queue_open_channel( struct channel *channel, const WS_ENDPOINT_AD
{
struct open_channel *o;
- if (!(o = heap_alloc( sizeof(*o) ))) return E_OUTOFMEMORY;
+ if (!(o = malloc( sizeof(*o) ))) return E_OUTOFMEMORY;
o->task.proc = open_channel_proc;
o->channel = channel;
o->endpoint = endpoint;
@@ -1279,7 +1278,7 @@ static HRESULT write_bytes( struct channel *channel, BYTE *bytes, ULONG len )
if (!channel->send_buf)
{
channel->send_buflen = get_max_buffer_size( channel );
- if (!(channel->send_buf = heap_alloc( channel->send_buflen ))) return E_OUTOFMEMORY;
+ if (!(channel->send_buf = malloc( channel->send_buflen ))) return E_OUTOFMEMORY;
}
if (channel->send_size + len >= channel->send_buflen) return WS_E_QUOTA_EXCEEDED;
@@ -1344,7 +1343,7 @@ static HRESULT write_string_table( struct channel *channel, const struct diction
static HRESULT string_to_utf8( const WS_STRING *str, unsigned char **ret, int *len )
{
*len = WideCharToMultiByte( CP_UTF8, 0, str->chars, str->length, NULL, 0, NULL, NULL );
- if (!(*ret = heap_alloc( *len ))) return E_OUTOFMEMORY;
+ if (!(*ret = malloc( *len ))) return E_OUTOFMEMORY;
WideCharToMultiByte( CP_UTF8, 0, str->chars, str->length, (char *)*ret, *len, NULL, NULL );
return S_OK;
}
@@ -1441,7 +1440,7 @@ static HRESULT write_preamble( struct channel *channel )
hr = write_byte( channel, FRAME_RECORD_TYPE_PREAMBLE_END );
done:
- heap_free( url );
+ free( url );
return hr;
}
@@ -1597,14 +1596,14 @@ static HRESULT CALLBACK dict_cb( void *state, const WS_XML_STRING *str, BOOL *fo
return S_OK;
}
- if (!(bytes = heap_alloc( str->length ))) return E_OUTOFMEMORY;
+ if (!(bytes = malloc( str->length ))) return E_OUTOFMEMORY;
memcpy( bytes, str->bytes, str->length );
if ((hr = insert_string( dict, bytes, str->length, index, id )) == S_OK)
{
*found = TRUE;
return S_OK;
}
- heap_free( bytes );
+ free( bytes );
*found = FALSE;
return hr;
@@ -1723,7 +1722,7 @@ static HRESULT queue_send_message( struct channel *channel, WS_MESSAGE *msg, con
{
struct send_message *s;
- if (!(s = heap_alloc( sizeof(*s) ))) return E_OUTOFMEMORY;
+ if (!(s = malloc( sizeof(*s) ))) return E_OUTOFMEMORY;
s->task.proc = send_message_proc;
s->channel = channel;
s->msg = msg;
@@ -1833,7 +1832,7 @@ static HRESULT resize_read_buffer( struct channel *channel, ULONG size )
{
if (!channel->read_buf)
{
- if (!(channel->read_buf = heap_alloc( size ))) return E_OUTOFMEMORY;
+ if (!(channel->read_buf = malloc( size ))) return E_OUTOFMEMORY;
channel->read_buflen = size;
return S_OK;
}
@@ -1841,7 +1840,7 @@ static HRESULT resize_read_buffer( struct channel *channel, ULONG size )
{
char *tmp;
ULONG new_size = max( size, channel->read_buflen * 2 );
- if (!(tmp = heap_realloc( channel->read_buf, new_size ))) return E_OUTOFMEMORY;
+ if (!(tmp = realloc( channel->read_buf, new_size ))) return E_OUTOFMEMORY;
channel->read_buf = tmp;
channel->read_buflen = new_size;
}
@@ -2064,14 +2063,14 @@ static HRESULT receive_preamble( struct channel *channel )
unsigned char *url;
if ((hr = receive_size( channel, &size )) != S_OK) return hr;
- if (!(url = heap_alloc( size ))) return E_OUTOFMEMORY;
+ if (!(url = malloc( size ))) return E_OUTOFMEMORY;
if ((hr = receive_bytes( channel, url, size )) != S_OK)
{
- heap_free( url );
+ free( url );
return hr;
}
TRACE( "transport URL %s\n", debugstr_an((char *)url, size) );
- heap_free( url ); /* FIXME: verify */
+ free( url ); /* FIXME: verify */
break;
}
case FRAME_RECORD_TYPE_KNOWN_ENCODING:
@@ -2175,7 +2174,7 @@ static HRESULT build_dict( const BYTE *buf, ULONG buflen, struct dictionary *dic
return WS_E_INVALID_FORMAT;
}
buflen -= size;
- if (!(bytes = heap_alloc( size )))
+ if (!(bytes = malloc( size )))
{
hr = E_OUTOFMEMORY;
goto error;
@@ -2183,13 +2182,13 @@ static HRESULT build_dict( const BYTE *buf, ULONG buflen, struct dictionary *dic
memcpy( bytes, ptr, size );
if ((index = find_string( dict, bytes, size, NULL )) == -1) /* duplicate */
{
- heap_free( bytes );
+ free( bytes );
ptr += size;
continue;
}
if ((hr = insert_string( dict, bytes, size, index, NULL )) != S_OK)
{
- heap_free( bytes );
+ free( bytes );
clear_dict( dict );
return hr;
}
@@ -2375,7 +2374,7 @@ static HRESULT queue_receive_message( struct channel *channel, WS_MESSAGE *msg,
{
struct receive_message *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = receive_message_proc;
r->channel = channel;
r->msg = msg;
@@ -2485,7 +2484,7 @@ static HRESULT queue_request_reply( struct channel *channel, WS_MESSAGE *request
{
struct request_reply *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = request_reply_proc;
r->channel = channel;
r->request = request;
@@ -2583,7 +2582,7 @@ static HRESULT queue_read_message_start( struct channel *channel, WS_MESSAGE *ms
{
struct read_message_start *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = read_message_start_proc;
r->channel = channel;
r->msg = msg;
@@ -2660,7 +2659,7 @@ static HRESULT queue_read_message_end( struct channel *channel, WS_MESSAGE *msg,
{
struct read_message_end *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = read_message_end_proc;
r->msg = msg;
r->ctx = *ctx;
@@ -2735,7 +2734,7 @@ static HRESULT queue_write_message_start( struct channel *channel, WS_MESSAGE *m
{
struct write_message_start *w;
- if (!(w = heap_alloc( sizeof(*w) ))) return E_OUTOFMEMORY;
+ if (!(w = malloc( sizeof(*w) ))) return E_OUTOFMEMORY;
w->task.proc = write_message_start_proc;
w->channel = channel;
w->msg = msg;
@@ -2815,7 +2814,7 @@ static HRESULT queue_write_message_end( struct channel *channel, WS_MESSAGE *msg
{
struct write_message_start *w;
- if (!(w = heap_alloc( sizeof(*w) ))) return E_OUTOFMEMORY;
+ if (!(w = malloc( sizeof(*w) ))) return E_OUTOFMEMORY;
w->task.proc = write_message_end_proc;
w->channel = channel;
w->msg = msg;
diff --git a/dlls/webservices/error.c b/dlls/webservices/error.c
index 34135851ecc..d1a679b2ff6 100644
--- a/dlls/webservices/error.c
+++ b/dlls/webservices/error.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -53,7 +53,7 @@ static struct error *alloc_error(void)
struct error *ret;
ULONG size = sizeof(*ret) + prop_size( error_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = ERROR_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -68,7 +68,7 @@ static void free_error( struct error *error )
{
error->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &error->cs );
- heap_free( error );
+ free( error );
}
/**************************************************************************
diff --git a/dlls/webservices/heap.c b/dlls/webservices/heap.c
index 618a9c8729b..a202b8308f0 100644
--- a/dlls/webservices/heap.c
+++ b/dlls/webservices/heap.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -181,7 +181,7 @@ static struct heap *alloc_heap(void)
struct heap *ret;
ULONG size = sizeof(*ret) + prop_size( heap_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = HEAP_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -247,7 +247,7 @@ void WINAPI WsFreeHeap( WS_HEAP *handle )
heap->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &heap->cs );
- heap_free( heap );
+ free( heap );
}
/**************************************************************************
diff --git a/dlls/webservices/listener.c b/dlls/webservices/listener.c
index d41b64b9749..01b739084ed 100644
--- a/dlls/webservices/listener.c
+++ b/dlls/webservices/listener.c
@@ -24,7 +24,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
#include "sock.h"
@@ -128,18 +127,18 @@ static struct listener *alloc_listener(void)
struct listener *ret;
ULONG size = sizeof(*ret) + prop_size( listener_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = LISTENER_MAGIC;
if (!(ret->wait = CreateEventW( NULL, FALSE, FALSE, NULL )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
if (!(ret->cancel = CreateEventW( NULL, FALSE, FALSE, NULL )))
{
CloseHandle( ret->wait );
- heap_free( ret );
+ free( ret );
return NULL;
}
InitializeCriticalSection( &ret->cs );
@@ -181,7 +180,7 @@ static void free_listener( struct listener *listener )
listener->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &listener->cs );
- heap_free( listener );
+ free( listener );
}
static HRESULT create_listener( WS_CHANNEL_TYPE type, WS_CHANNEL_BINDING binding,
@@ -327,7 +326,7 @@ HRESULT parse_url( const WS_STRING *str, WS_URL_SCHEME_TYPE *scheme, WCHAR **hos
if (url->host.length == 1 && (url->host.chars[0] == '+' || url->host.chars[0] == '*')) *host = NULL;
else
{
- if (!(*host = heap_alloc( (url->host.length + 1) * sizeof(WCHAR) )))
+ if (!(*host = malloc( (url->host.length + 1) * sizeof(WCHAR) )))
{
WsFreeHeap( heap );
return E_OUTOFMEMORY;
@@ -355,14 +354,14 @@ static HRESULT open_listener_tcp( struct listener *listener, const WS_STRING *ur
if ((hr = parse_url( url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_NETTCP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, AI_PASSIVE );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((listener->u.tcp.socket = socket( addr->sa_family, SOCK_STREAM, 0 )) == -1)
@@ -406,14 +405,14 @@ static HRESULT open_listener_udp( struct listener *listener, const WS_STRING *ur
if ((hr = parse_url( url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_SOAPUDP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, AI_PASSIVE );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((listener->u.udp.socket = socket( addr->sa_family, SOCK_DGRAM, 0 )) == -1)
diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c
index 51081217b7b..bd585b176fc 100644
--- a/dlls/webservices/msg.c
+++ b/dlls/webservices/msg.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -25,7 +26,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -94,10 +94,10 @@ static struct msg *alloc_msg(void)
struct msg *ret;
ULONG size = sizeof(*ret) + prop_size( msg_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
- if (!(ret->header = heap_alloc( HEADER_ARRAY_SIZE * sizeof(struct header *) )))
+ if (!(ret = calloc( 1, size ))) return NULL;
+ if (!(ret->header = malloc( HEADER_ARRAY_SIZE * sizeof(struct header *) )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
ret->magic = MSG_MAGIC;
@@ -114,10 +114,10 @@ static struct msg *alloc_msg(void)
static void free_header( struct header *header )
{
- heap_free( header->name.bytes );
- heap_free( header->ns.bytes );
+ free( header->name.bytes );
+ free( header->ns.bytes );
if (header->mapped) free_xml_string( header->u.text );
- heap_free( header );
+ free( header );
}
static void reset_msg( struct msg *msg )
@@ -129,7 +129,7 @@ static void reset_msg( struct msg *msg )
UuidCreate( &msg->id );
memset( &msg->id_req, 0, sizeof(msg->id_req) );
msg->is_addressed = FALSE;
- heap_free( msg->addr.chars );
+ free( msg->addr.chars );
msg->addr.chars = NULL;
msg->addr.length = 0;
@@ -159,11 +159,11 @@ static void free_msg( struct msg *msg )
WsFreeWriter( msg->writer );
WsFreeReader( msg->reader );
WsFreeHeap( msg->heap );
- heap_free( msg->header );
+ free( msg->header );
msg->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &msg->cs );
- heap_free( msg );
+ free( msg );
}
#define HEAP_MAX_SIZE (1 << 16)
@@ -454,7 +454,7 @@ HRESULT WINAPI WsAddressMessage( WS_MESSAGE *handle, const WS_ENDPOINT_ADDRESS *
if (msg->state < WS_MESSAGE_STATE_INITIALIZED || msg->is_addressed) hr = WS_E_INVALID_OPERATION;
else if (addr && addr->url.length)
{
- if (!(msg->addr.chars = heap_alloc( addr->url.length * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
+ if (!(msg->addr.chars = malloc( addr->url.length * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else
{
memcpy( msg->addr.chars, addr->url.chars, addr->url.length * sizeof(WCHAR) );
@@ -1101,8 +1101,7 @@ static HRESULT grow_header_array( struct msg *msg, ULONG size )
{
struct header **tmp;
if (size <= msg->header_size) return S_OK;
- if (!(tmp = heap_realloc( msg->header, 2 * msg->header_size * sizeof(struct header *) )))
- return E_OUTOFMEMORY;
+ if (!(tmp = realloc( msg->header, 2 * msg->header_size * sizeof(struct header *) ))) return E_OUTOFMEMORY;
msg->header = tmp;
msg->header_size *= 2;
return S_OK;
@@ -1112,10 +1111,10 @@ static struct header *alloc_header( WS_HEADER_TYPE type, BOOL mapped, const WS_X
const WS_XML_STRING *ns )
{
struct header *ret;
- if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
if (name && name->length)
{
- if (!(ret->name.bytes = heap_alloc( name->length )))
+ if (!(ret->name.bytes = malloc( name->length )))
{
free_header( ret );
return NULL;
@@ -1125,7 +1124,7 @@ static struct header *alloc_header( WS_HEADER_TYPE type, BOOL mapped, const WS_X
}
if (ns && ns->length)
{
- if (!(ret->ns.bytes = heap_alloc( ns->length )))
+ if (!(ret->ns.bytes = malloc( ns->length )))
{
free_header( ret );
return NULL;
@@ -1845,7 +1844,7 @@ HRESULT WINAPI WsRemoveCustomHeader( WS_MESSAGE *handle, const WS_XML_STRING *na
static WCHAR *build_http_header( const WCHAR *name, const WCHAR *value, ULONG *ret_len )
{
int len_name = lstrlenW( name ), len_value = lstrlenW( value );
- WCHAR *ret = heap_alloc( (len_name + len_value + 2) * sizeof(WCHAR) );
+ WCHAR *ret = malloc( (len_name + len_value + 2) * sizeof(WCHAR) );
if (!ret) return NULL;
memcpy( ret, name, len_name * sizeof(WCHAR) );
@@ -1866,7 +1865,7 @@ static WCHAR *from_xml_string( const WS_XML_STRING *str )
{
WCHAR *ret;
int len = MultiByteToWideChar( CP_UTF8, 0, (char *)str->bytes, str->length, NULL, 0 );
- if (!(ret = heap_alloc( (len + 1) * sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( (len + 1) * sizeof(*ret) ))) return NULL;
MultiByteToWideChar( CP_UTF8, 0, (char *)str->bytes, str->length, ret, len );
ret[len] = 0;
return ret;
@@ -1885,16 +1884,16 @@ static HRESULT insert_mapped_headers( struct msg *msg, HINTERNET req )
if (!(name = from_xml_string( &msg->header[i]->name ))) return E_OUTOFMEMORY;
if (!(value = from_xml_string( msg->header[i]->u.text )))
{
- heap_free( name );
+ free( name );
return E_OUTOFMEMORY;
}
header = build_http_header( name, value, &len );
- heap_free( name );
- heap_free( value );
+ free( name );
+ free( value );
if (!header) return E_OUTOFMEMORY;
hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_ADD|WINHTTP_ADDREQ_FLAG_REPLACE );
- heap_free( header );
+ free( header );
if (hr != S_OK) return hr;
}
return S_OK;
@@ -1932,13 +1931,13 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
if (!header) goto done;
if ((hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_ADD )) != S_OK) goto done;
- heap_free( header );
+ free( header );
hr = E_OUTOFMEMORY;
if (!(header = build_http_header( L"Content-Type", L"charset=utf-8", &len ))) goto done;
if ((hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON )) != S_OK)
goto done;
- heap_free( header );
+ free( header );
header = NULL;
switch (msg->version_env)
@@ -1949,14 +1948,14 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
break;
hr = E_OUTOFMEMORY;
- if (!(buf = heap_alloc( (len + 3) * sizeof(WCHAR) ))) goto done;
+ if (!(buf = malloc( (len + 3) * sizeof(WCHAR) ))) goto done;
buf[0] = '"';
MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, buf + 1, len );
buf[len + 1] = '"';
buf[len + 2] = 0;
header = build_http_header( L"SOAPAction", buf, &len );
- heap_free( buf );
+ free( buf );
if (!header) goto done;
hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_ADD );
@@ -1970,7 +1969,7 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
break;
hr = E_OUTOFMEMORY;
- if (!(buf = heap_alloc( (len + len_action + 2) * sizeof(WCHAR) ))) goto done;
+ if (!(buf = malloc( (len + len_action + 2) * sizeof(WCHAR) ))) goto done;
memcpy( buf, L"action=\"", len_action * sizeof(WCHAR) );
MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, buf + len_action, len );
len += len_action;
@@ -1978,7 +1977,7 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
buf[len] = 0;
header = build_http_header( L"Content-Type", buf, &len );
- heap_free( buf );
+ free( buf );
if (!header) goto done;
hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON );
@@ -1992,7 +1991,7 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
if (hr == S_OK) hr = insert_mapped_headers( msg, req );
done:
- heap_free( header );
+ free( header );
LeaveCriticalSection( &msg->cs );
TRACE( "returning %08x\n", hr );
return hr;
@@ -2012,26 +2011,26 @@ static HRESULT map_http_response_headers( struct msg *msg, HINTERNET req, const
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
HRESULT hr;
- if (!(value = heap_alloc( size )))
+ if (!(value = malloc( size )))
{
- heap_free( name );
+ free( name );
return E_OUTOFMEMORY;
}
if (!WinHttpQueryHeaders( req, WINHTTP_QUERY_CUSTOM, name, value, &size, NULL ))
{
- heap_free( name );
+ free( name );
return HRESULT_FROM_WIN32( GetLastError() );
}
hr = add_mapped_header( msg, &mapping->responseHeaderMappings[i]->headerName, WS_WSZ_TYPE,
WS_WRITE_REQUIRED_POINTER, &value, sizeof(value) );
- heap_free( value );
+ free( value );
if (hr != S_OK)
{
- heap_free( name );
+ free( name );
return hr;
}
}
- heap_free( name );
+ free( name );
}
return S_OK;
}
diff --git a/dlls/webservices/proxy.c b/dlls/webservices/proxy.c
index b6278a6354c..80e5965ce3e 100644
--- a/dlls/webservices/proxy.c
+++ b/dlls/webservices/proxy.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -59,7 +59,7 @@ static struct proxy *alloc_proxy(void)
struct proxy *ret;
ULONG size = sizeof(*ret) + prop_size( proxy_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = PROXY_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -83,7 +83,7 @@ static void free_proxy( struct proxy *proxy )
proxy->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &proxy->cs );
- heap_free( proxy );
+ free( proxy );
}
static HRESULT create_proxy( WS_CHANNEL *channel, const WS_PROXY_PROPERTY *properties, ULONG count,
diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c
index 69c4f2a3007..d01222bd518 100644
--- a/dlls/webservices/reader.c
+++ b/dlls/webservices/reader.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include <assert.h>
#include <float.h>
#include <locale.h>
@@ -27,7 +28,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -72,7 +72,7 @@ struct node *alloc_node( WS_XML_NODE_TYPE type )
{
struct node *ret;
- if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
ret->hdr.node.nodeType = type;
list_init( &ret->entry );
list_init( &ret->children );
@@ -85,8 +85,8 @@ void free_attribute( WS_XML_ATTRIBUTE *attr )
free_xml_string( attr->prefix );
free_xml_string( attr->localName );
free_xml_string( attr->ns );
- heap_free( attr->value );
- heap_free( attr );
+ free( attr->value );
+ free( attr );
}
void free_node( struct node *node )
@@ -100,7 +100,7 @@ void free_node( struct node *node )
ULONG i;
for (i = 0; i < elem->attributeCount; i++) free_attribute( elem->attributes[i] );
- heap_free( elem->attributes );
+ free( elem->attributes );
free_xml_string( elem->prefix );
free_xml_string( elem->localName );
free_xml_string( elem->ns );
@@ -109,13 +109,13 @@ void free_node( struct node *node )
case WS_XML_NODE_TYPE_TEXT:
{
WS_XML_TEXT_NODE *text = (WS_XML_TEXT_NODE *)node;
- heap_free( text->text );
+ free( text->text );
break;
}
case WS_XML_NODE_TYPE_COMMENT:
{
WS_XML_COMMENT_NODE *comment = (WS_XML_COMMENT_NODE *)node;
- heap_free( comment->value.bytes );
+ free( comment->value.bytes );
break;
}
case WS_XML_NODE_TYPE_CDATA:
@@ -129,7 +129,7 @@ void free_node( struct node *node )
ERR( "unhandled type %u\n", node_type( node ) );
break;
}
- heap_free( node );
+ free( node );
}
void destroy_nodes( struct node *node )
@@ -151,7 +151,7 @@ static WS_XML_ATTRIBUTE *dup_attribute( const WS_XML_ATTRIBUTE *src, WS_XML_WRIT
WS_XML_ATTRIBUTE *dst;
HRESULT hr;
- if (!(dst = heap_alloc_zero( sizeof(*dst) ))) return NULL;
+ if (!(dst = calloc( 1, sizeof(*dst) ))) return NULL;
dst->singleQuote = src->singleQuote;
dst->isXmlNs = src->isXmlNs;
@@ -191,13 +191,13 @@ static WS_XML_ATTRIBUTE **dup_attributes( WS_XML_ATTRIBUTE * const *src, ULONG c
WS_XML_ATTRIBUTE **dst;
ULONG i;
- if (!(dst = heap_alloc( sizeof(*dst) * count ))) return NULL;
+ if (!(dst = malloc( sizeof(*dst) * count ))) return NULL;
for (i = 0; i < count; i++)
{
if (!(dst[i] = dup_attribute( src[i], enc )))
{
for (; i > 0; i--) free_attribute( dst[i - 1] );
- heap_free( dst );
+ free( dst );
return NULL;
}
}
@@ -273,7 +273,7 @@ static struct node *dup_comment_node( const WS_XML_COMMENT_NODE *src )
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return NULL;
dst = (WS_XML_COMMENT_NODE *)node;
- if (src->value.length && !(dst->value.bytes = heap_alloc( src->value.length )))
+ if (src->value.length && !(dst->value.bytes = malloc( src->value.length )))
{
free_node( node );
return NULL;
@@ -413,10 +413,10 @@ static struct reader *alloc_reader(void)
struct reader *ret;
ULONG size = sizeof(*ret) + prop_size( reader_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
- if (!(ret->prefixes = heap_alloc_zero( sizeof(*ret->prefixes) )))
+ if (!(ret = calloc( 1, size ))) return NULL;
+ if (!(ret->prefixes = calloc( 1, sizeof(*ret->prefixes) )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
ret->nb_prefixes = ret->nb_prefixes_allocated = 1;
@@ -466,11 +466,12 @@ static HRESULT bind_prefix( struct reader *reader, const WS_XML_STRING *prefix,
}
if (i >= reader->nb_prefixes_allocated)
{
- ULONG new_size = reader->nb_prefixes_allocated * sizeof(*reader->prefixes) * 2;
- struct prefix *tmp = heap_realloc_zero( reader->prefixes, new_size );
+ ULONG new_size = reader->nb_prefixes_allocated * 2;
+ struct prefix *tmp = realloc( reader->prefixes, new_size * sizeof(*tmp) );
if (!tmp) return E_OUTOFMEMORY;
+ memset( tmp + reader->nb_prefixes_allocated, 0, (new_size - reader->nb_prefixes_allocated) * sizeof(*tmp) );
reader->prefixes = tmp;
- reader->nb_prefixes_allocated *= 2;
+ reader->nb_prefixes_allocated = new_size;
}
if ((hr = set_prefix( &reader->prefixes[i], prefix, ns )) != S_OK) return hr;
reader->nb_prefixes++;
@@ -517,13 +518,13 @@ static void free_reader( struct reader *reader )
{
destroy_nodes( reader->root );
clear_prefixes( reader->prefixes, reader->nb_prefixes );
- heap_free( reader->prefixes );
- heap_free( reader->stream_buf );
- heap_free( reader->input_conv );
+ free( reader->prefixes );
+ free( reader->stream_buf );
+ free( reader->input_conv );
reader->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &reader->cs );
- heap_free( reader );
+ free( reader );
}
static HRESULT init_reader( struct reader *reader )
@@ -839,7 +840,7 @@ WS_XML_UTF8_TEXT *alloc_utf8_text( const BYTE *data, ULONG len )
{
WS_XML_UTF8_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) + len ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) + len ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UTF8;
ret->value.length = len;
ret->value.bytes = len ? (BYTE *)(ret + 1) : NULL;
@@ -853,7 +854,7 @@ WS_XML_UTF16_TEXT *alloc_utf16_text( const BYTE *data, ULONG len )
{
WS_XML_UTF16_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) + len ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) + len ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UTF16;
ret->byteCount = len;
ret->bytes = len ? (BYTE *)(ret + 1) : NULL;
@@ -865,7 +866,7 @@ WS_XML_BASE64_TEXT *alloc_base64_text( const BYTE *data, ULONG len )
{
WS_XML_BASE64_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) + len ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) + len ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_BASE64;
ret->length = len;
ret->bytes = len ? (BYTE *)(ret + 1) : NULL;
@@ -877,7 +878,7 @@ WS_XML_BOOL_TEXT *alloc_bool_text( BOOL value )
{
WS_XML_BOOL_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_BOOL;
ret->value = value;
return ret;
@@ -887,7 +888,7 @@ WS_XML_INT32_TEXT *alloc_int32_text( INT32 value )
{
WS_XML_INT32_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_INT32;
ret->value = value;
return ret;
@@ -897,7 +898,7 @@ WS_XML_INT64_TEXT *alloc_int64_text( INT64 value )
{
WS_XML_INT64_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_INT64;
ret->value = value;
return ret;
@@ -907,7 +908,7 @@ WS_XML_UINT64_TEXT *alloc_uint64_text( UINT64 value )
{
WS_XML_UINT64_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UINT64;
ret->value = value;
return ret;
@@ -917,7 +918,7 @@ WS_XML_FLOAT_TEXT *alloc_float_text( float value )
{
WS_XML_FLOAT_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_FLOAT;
ret->value = value;
return ret;
@@ -927,7 +928,7 @@ WS_XML_DOUBLE_TEXT *alloc_double_text( double value )
{
WS_XML_DOUBLE_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_DOUBLE;
ret->value = value;
return ret;
@@ -937,7 +938,7 @@ WS_XML_GUID_TEXT *alloc_guid_text( const GUID *value )
{
WS_XML_GUID_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_GUID;
ret->value = *value;
return ret;
@@ -947,7 +948,7 @@ WS_XML_UNIQUE_ID_TEXT *alloc_unique_id_text( const GUID *value )
{
WS_XML_UNIQUE_ID_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UNIQUE_ID;
ret->value = *value;
return ret;
@@ -957,7 +958,7 @@ WS_XML_DATETIME_TEXT *alloc_datetime_text( const WS_DATETIME *value )
{
WS_XML_DATETIME_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_DATETIME;
ret->value = *value;
return ret;
@@ -1138,11 +1139,10 @@ HRESULT append_attribute( WS_XML_ELEMENT_NODE *elem, WS_XML_ATTRIBUTE *attr )
if (elem->attributeCount)
{
WS_XML_ATTRIBUTE **tmp;
- if (!(tmp = heap_realloc( elem->attributes, (elem->attributeCount + 1) * sizeof(attr) )))
- return E_OUTOFMEMORY;
+ if (!(tmp = realloc( elem->attributes, (elem->attributeCount + 1) * sizeof(attr) ))) return E_OUTOFMEMORY;
elem->attributes = tmp;
}
- else if (!(elem->attributes = heap_alloc( sizeof(attr) ))) return E_OUTOFMEMORY;
+ else if (!(elem->attributes = malloc( sizeof(attr) ))) return E_OUTOFMEMORY;
elem->attributes[elem->attributeCount++] = attr;
return S_OK;
}
@@ -1377,7 +1377,7 @@ static HRESULT read_attribute_value_text( struct reader *reader, WS_XML_ATTRIBUT
if (!(utf8 = alloc_utf8_text( NULL, len ))) return E_OUTOFMEMORY;
if ((hr = decode_text( start, len, utf8->value.bytes, &utf8->value.length )) != S_OK)
{
- heap_free( utf8 );
+ free( utf8 );
return hr;
}
}
@@ -1596,7 +1596,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!(text_base64 = alloc_base64_text( NULL, val_uint8 ))) return E_OUTOFMEMORY;
if ((hr = read_bytes( reader, text_base64->bytes, val_uint8 )) != S_OK)
{
- heap_free( text_base64 );
+ free( text_base64 );
return hr;
}
break;
@@ -1606,7 +1606,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!(text_base64 = alloc_base64_text( NULL, val_uint16 ))) return E_OUTOFMEMORY;
if ((hr = read_bytes( reader, text_base64->bytes, val_uint16 )) != S_OK)
{
- heap_free( text_base64 );
+ free( text_base64 );
return hr;
}
break;
@@ -1617,7 +1617,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!(text_base64 = alloc_base64_text( NULL, val_int32 ))) return E_OUTOFMEMORY;
if ((hr = read_bytes( reader, text_base64->bytes, val_int32 )) != S_OK)
{
- heap_free( text_base64 );
+ free( text_base64 );
return hr;
}
break;
@@ -1684,7 +1684,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!len) text_utf8->value.bytes = (BYTE *)(text_utf8 + 1); /* quirk */
if ((hr = read_bytes( reader, text_utf8->value.bytes, len )) != S_OK)
{
- heap_free( text_utf8 );
+ free( text_utf8 );
return hr;
}
}
@@ -1702,7 +1702,7 @@ static HRESULT read_attribute_text( struct reader *reader, WS_XML_ATTRIBUTE **re
WS_XML_STRING *prefix, *localname;
HRESULT hr;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
start = read_current_ptr( reader );
for (;;)
@@ -1773,7 +1773,7 @@ static HRESULT read_attribute_bin( struct reader *reader, WS_XML_ATTRIBUTE **ret
if ((hr = read_byte( reader, &type )) != S_OK) return hr;
if (!is_attribute_type( type )) return WS_E_INVALID_FORMAT;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
if (type >= RECORD_PREFIX_ATTRIBUTE_A && type <= RECORD_PREFIX_ATTRIBUTE_Z)
{
@@ -2175,13 +2175,13 @@ static HRESULT read_text_text( struct reader *reader )
text = (WS_XML_TEXT_NODE *)node;
if (!(utf8 = alloc_utf8_text( NULL, len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
if ((hr = decode_text( start, len, utf8->value.bytes, &utf8->value.length )) != S_OK)
{
- heap_free( utf8 );
- heap_free( node );
+ free( utf8 );
+ free( node );
return hr;
}
text->text = &utf8->text;
@@ -2201,7 +2201,7 @@ static struct node *alloc_utf8_text_node( const BYTE *data, ULONG len, WS_XML_UT
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(utf8 = alloc_utf8_text( data, len )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2219,7 +2219,7 @@ static struct node *alloc_base64_text_node( const BYTE *data, ULONG len, WS_XML_
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(base64 = alloc_base64_text( data, len )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2237,7 +2237,7 @@ static struct node *alloc_bool_text_node( BOOL value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_bool = alloc_bool_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2254,7 +2254,7 @@ static struct node *alloc_int32_text_node( INT32 value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_int32 = alloc_int32_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2271,7 +2271,7 @@ static struct node *alloc_int64_text_node( INT64 value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_int64 = alloc_int64_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2288,7 +2288,7 @@ static struct node *alloc_float_text_node( float value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_float = alloc_float_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2305,7 +2305,7 @@ static struct node *alloc_double_text_node( double value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_double = alloc_double_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2322,7 +2322,7 @@ static struct node *alloc_datetime_text_node( const WS_DATETIME *value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_datetime = alloc_datetime_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2339,7 +2339,7 @@ static struct node *alloc_unique_id_text_node( const GUID *value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_unique_id = alloc_unique_id_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2356,7 +2356,7 @@ static struct node *alloc_guid_text_node( const GUID *value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_guid = alloc_guid_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2373,7 +2373,7 @@ static struct node *alloc_uint64_text_node( UINT64 value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_uint64 = alloc_uint64_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2389,7 +2389,7 @@ static HRESULT append_text_bytes( struct reader *reader, WS_XML_TEXT_NODE *node,
if (!(new = alloc_base64_text( NULL, old->length + len ))) return E_OUTOFMEMORY;
memcpy( new->bytes, old->bytes, old->length );
if ((hr = read_bytes( reader, new->bytes + old->length, len )) != S_OK) return hr;
- heap_free( old );
+ free( old );
node->text = &new->text;
return S_OK;
}
@@ -2896,9 +2896,9 @@ static HRESULT read_comment_text( struct reader *reader )
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY;
comment = (WS_XML_COMMENT_NODE *)node;
- if (!(comment->value.bytes = heap_alloc( len )))
+ if (!(comment->value.bytes = malloc( len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
memcpy( comment->value.bytes, start, len );
@@ -2925,9 +2925,9 @@ static HRESULT read_comment_bin( struct reader *reader )
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY;
comment = (WS_XML_COMMENT_NODE *)node;
- if (!(comment->value.bytes = heap_alloc( len )))
+ if (!(comment->value.bytes = malloc( len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
if ((hr = read_bytes( reader, comment->value.bytes, len )) != S_OK)
@@ -2955,7 +2955,7 @@ static HRESULT read_startcdata( struct reader *reader )
if (!(node = alloc_node( WS_XML_NODE_TYPE_CDATA ))) return E_OUTOFMEMORY;
if (!(endnode = alloc_node( WS_XML_NODE_TYPE_END_CDATA )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
list_add_tail( &node->children, &endnode->entry );
@@ -2988,7 +2988,7 @@ static HRESULT read_cdata( struct reader *reader )
text = (WS_XML_TEXT_NODE *)node;
if (!(utf8 = alloc_utf8_text( start, len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
text->text = &utf8->text;
@@ -6905,7 +6905,7 @@ static HRESULT utf16le_to_utf8( const unsigned char *data, ULONG size, unsigned
{
if (size % sizeof(WCHAR)) return E_INVALIDARG;
*buflen = WideCharToMultiByte( CP_UTF8, 0, (const WCHAR *)data, size / sizeof(WCHAR), NULL, 0, NULL, NULL );
- if (!(*buf = heap_alloc( *buflen ))) return E_OUTOFMEMORY;
+ if (!(*buf = malloc( *buflen ))) return E_OUTOFMEMORY;
WideCharToMultiByte( CP_UTF8, 0, (const WCHAR *)data, size / sizeof(WCHAR), (char *)*buf, *buflen, NULL, NULL );
return S_OK;
}
@@ -6922,7 +6922,7 @@ static HRESULT set_input_buffer( struct reader *reader, const unsigned char *dat
HRESULT hr;
if ((hr = utf16le_to_utf8( data, size, &buf, &buflen )) != S_OK) return hr;
- heap_free( reader->input_conv );
+ free( reader->input_conv );
reader->read_bufptr = reader->input_conv = buf;
reader->read_size = reader->input_size = buflen;
}
@@ -7032,7 +7032,7 @@ HRESULT WINAPI WsSetInput( WS_XML_READER *handle, const WS_XML_READER_ENCODING *
case WS_XML_READER_INPUT_TYPE_STREAM:
{
const WS_XML_READER_STREAM_INPUT *stream = (const WS_XML_READER_STREAM_INPUT *)input;
- if (!reader->stream_buf && !(reader->stream_buf = heap_alloc( STREAM_BUFSIZE )))
+ if (!reader->stream_buf && !(reader->stream_buf = malloc( STREAM_BUFSIZE )))
{
hr = E_OUTOFMEMORY;
goto done;
@@ -7071,7 +7071,7 @@ static HRESULT set_input_xml_buffer( struct reader *reader, struct xmlbuf *xmlbu
HRESULT hr;
if ((hr = utf16le_to_utf8( xmlbuf->bytes.bytes, xmlbuf->bytes.length, &buf, &buflen )) != S_OK) return hr;
- heap_free( reader->input_conv );
+ free( reader->input_conv );
reader->read_bufptr = reader->input_conv = buf;
reader->read_size = reader->input_size = buflen;
}
@@ -7196,7 +7196,7 @@ HRESULT WINAPI WsSetReaderPosition( WS_XML_READER *handle, const WS_XML_NODE_POS
static HRESULT utf8_to_base64( const WS_XML_UTF8_TEXT *utf8, WS_XML_BASE64_TEXT *base64 )
{
if (utf8->value.length % 4) return WS_E_INVALID_FORMAT;
- if (!(base64->bytes = heap_alloc( utf8->value.length * 3 / 4 ))) return E_OUTOFMEMORY;
+ if (!(base64->bytes = malloc( utf8->value.length * 3 / 4 ))) return E_OUTOFMEMORY;
base64->length = decode_base64( utf8->value.bytes, utf8->value.length, base64->bytes );
return S_OK;
}
@@ -7242,14 +7242,14 @@ HRESULT WINAPI WsReadBytes( WS_XML_READER *handle, void *bytes, ULONG max_count,
if ((hr = utf8_to_base64( (const WS_XML_UTF8_TEXT *)text->text, &base64 )) != S_OK) goto done;
if (reader->text_conv_offset == base64.length)
{
- heap_free( base64.bytes );
+ free( base64.bytes );
hr = read_node( reader );
goto done;
}
*count = min( base64.length - reader->text_conv_offset, max_count );
memcpy( bytes, base64.bytes + reader->text_conv_offset, *count );
reader->text_conv_offset += *count;
- heap_free( base64.bytes );
+ free( base64.bytes );
}
done:
@@ -7261,7 +7261,7 @@ done:
static HRESULT utf8_to_utf16( const WS_XML_UTF8_TEXT *utf8, WS_XML_UTF16_TEXT *utf16 )
{
int len = MultiByteToWideChar( CP_UTF8, 0, (char *)utf8->value.bytes, utf8->value.length, NULL, 0 );
- if (!(utf16->bytes = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
+ if (!(utf16->bytes = malloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
MultiByteToWideChar( CP_UTF8, 0, (char *)utf8->value.bytes, utf8->value.length, (WCHAR *)utf16->bytes, len );
utf16->byteCount = len * sizeof(WCHAR);
return S_OK;
@@ -7309,14 +7309,14 @@ HRESULT WINAPI WsReadChars( WS_XML_READER *handle, WCHAR *chars, ULONG max_count
if ((hr = utf8_to_utf16( (const WS_XML_UTF8_TEXT *)text->text, &utf16 )) != S_OK) goto done;
if (reader->text_conv_offset == utf16.byteCount / sizeof(WCHAR))
{
- heap_free( utf16.bytes );
+ free( utf16.bytes );
hr = read_node( reader );
goto done;
}
*count = min( utf16.byteCount / sizeof(WCHAR) - reader->text_conv_offset, max_count );
memcpy( chars, utf16.bytes + reader->text_conv_offset * sizeof(WCHAR), *count * sizeof(WCHAR) );
reader->text_conv_offset += *count;
- heap_free( utf16.bytes );
+ free( utf16.bytes );
}
done:
diff --git a/dlls/webservices/string.c b/dlls/webservices/string.c
index 42af8fd9c58..3ecdcea85a4 100644
--- a/dlls/webservices/string.c
+++ b/dlls/webservices/string.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include <assert.h>
#include "windef.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -100,18 +100,18 @@ static HRESULT grow_dict( struct dictionary *dict, ULONG size )
if (!dict->dict.strings)
{
new_size = max( MIN_DICTIONARY_SIZE, size );
- if (!(dict->dict.strings = heap_alloc( new_size * sizeof(*dict->dict.strings) ))) return E_OUTOFMEMORY;
- if (!(dict->sorted = heap_alloc( new_size * sizeof(*dict->sorted) )))
+ if (!(dict->dict.strings = malloc( new_size * sizeof(*dict->dict.strings) ))) return E_OUTOFMEMORY;
+ if (!(dict->sorted = malloc( new_size * sizeof(*dict->sorted) )))
{
- heap_free( dict->dict.strings );
+ free( dict->dict.strings );
dict->dict.strings = NULL;
return E_OUTOFMEMORY;
}
- if (!(dict->sequence = heap_alloc( new_size * sizeof(*dict->sequence) )))
+ if (!(dict->sequence = malloc( new_size * sizeof(*dict->sequence) )))
{
- heap_free( dict->dict.strings );
+ free( dict->dict.strings );
dict->dict.strings = NULL;
- heap_free( dict->sorted );
+ free( dict->sorted );
dict->sorted = NULL;
return E_OUTOFMEMORY;
}
@@ -120,11 +120,11 @@ static HRESULT grow_dict( struct dictionary *dict, ULONG size )
}
new_size = max( dict->size * 2, size );
- if (!(tmp = heap_realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return E_OUTOFMEMORY;
+ if (!(tmp = realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return E_OUTOFMEMORY;
dict->dict.strings = tmp;
- if (!(tmp_sorted = heap_realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return E_OUTOFMEMORY;
+ if (!(tmp_sorted = realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return E_OUTOFMEMORY;
dict->sorted = tmp_sorted;
- if (!(tmp_sequence = heap_realloc( dict->sequence, new_size * sizeof(*tmp_sequence) ))) return E_OUTOFMEMORY;
+ if (!(tmp_sequence = realloc( dict->sequence, new_size * sizeof(*tmp_sequence) ))) return E_OUTOFMEMORY;
dict->sequence = tmp_sequence;
dict->size = new_size;
@@ -135,13 +135,13 @@ void clear_dict( struct dictionary *dict )
{
ULONG i;
assert( !dict->dict.isConst );
- for (i = 0; i < dict->dict.stringCount; i++) heap_free( dict->dict.strings[i].bytes );
- heap_free( dict->dict.strings );
+ for (i = 0; i < dict->dict.stringCount; i++) free( dict->dict.strings[i].bytes );
+ free( dict->dict.strings );
dict->dict.strings = NULL;
dict->dict.stringCount = 0;
- heap_free( dict->sorted );
+ free( dict->sorted );
dict->sorted = NULL;
- heap_free( dict->sequence );
+ free( dict->sequence );
dict->sequence = NULL;
dict->current_sequence = 0;
dict->size = 0;
@@ -179,7 +179,7 @@ HRESULT add_xml_string( WS_XML_STRING *str )
EnterCriticalSection( &dict_cs );
if ((index = find_string( &dict_builtin, str->bytes, str->length, &id )) == -1)
{
- heap_free( str->bytes );
+ free( str->bytes );
*str = dict_builtin.dict.strings[id];
}
else if ((hr = insert_string( &dict_builtin, str->bytes, str->length, index, &id )) == S_OK)
@@ -194,10 +194,10 @@ WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len )
{
WS_XML_STRING *ret;
- if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
- if ((ret->length = len) && !(ret->bytes = heap_alloc( len )))
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
+ if ((ret->length = len) && !(ret->bytes = malloc( len )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
if (data)
@@ -211,8 +211,8 @@ WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len )
void free_xml_string( WS_XML_STRING *str )
{
if (!str) return;
- if (!str->dictionary) heap_free( str->bytes );
- heap_free( str );
+ if (!str->dictionary) free( str->bytes );
+ free( str );
}
WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
@@ -223,7 +223,7 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
int index;
ULONG id;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
if (src->dictionary)
{
*ret = *src;
@@ -241,9 +241,9 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
LeaveCriticalSection( &dict_cs );
return ret;
}
- if (!(data = heap_alloc( src->length )))
+ if (!(data = malloc( src->length )))
{
- heap_free( ret );
+ free( ret );
LeaveCriticalSection( &dict_cs );
return NULL;
}
diff --git a/dlls/webservices/tests/writer.c b/dlls/webservices/tests/writer.c
index 1d769189014..ab74c2e84e3 100644
--- a/dlls/webservices/tests/writer.c
+++ b/dlls/webservices/tests/writer.c
@@ -901,7 +901,7 @@ static void test_simple_struct_type(void)
s.fields = fields;
s.fieldCount = 1;
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) );
+ test = malloc( sizeof(*test) );
test->field = L"value";
hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, NULL,
WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
@@ -968,7 +968,7 @@ static void test_simple_struct_type(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<struct struct=\"value\"/>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
}
@@ -1005,7 +1005,7 @@ static void test_WsWriteElement(void)
desc.type = WS_STRUCT_TYPE;
desc.typeDescription = &s;
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) );
+ test = malloc( sizeof(*test) );
test->str = L"test";
hr = WsWriteElement( NULL, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
@@ -1049,7 +1049,7 @@ static void test_WsWriteElement(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<str str=\"test\"/>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
}
@@ -1192,7 +1192,7 @@ static void test_WsWriteAttribute(void)
desc.type = WS_STRUCT_TYPE;
desc.typeDescription = &s;
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) );
+ test = malloc( sizeof(*test) );
test->str = L"test";
hr = WsWriteAttribute( NULL, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
@@ -1219,7 +1219,7 @@ static void test_WsWriteAttribute(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<str str=\"test\"/>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
}
@@ -1652,7 +1652,7 @@ static void test_complex_struct_type(void)
s.typeNs = &ns;
size = sizeof(struct officeconfig) + sizeof(struct services);
- test = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size );
+ test = calloc( 1, size );
test->services = (struct services *)(test + 1);
test->services->generationtime = L"2015-09-03T18:47:54";
hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s,
@@ -1663,7 +1663,7 @@ static void test_complex_struct_type(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output_buffer( buffer, expected, __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
WsFreeHeap( heap );
}
@@ -3116,7 +3116,7 @@ static void test_repeating_element(void)
hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL );
ok( hr == S_OK, "got %08x\n", hr );
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) + 2 * sizeof(const WCHAR *) );
+ test = malloc( sizeof(*test) + 2 * sizeof(const WCHAR *) );
test->val = (const WCHAR **)(test + 1);
test->val[0] = L"1";
test->val[1] = L"2";
@@ -3127,7 +3127,7 @@ static void test_repeating_element(void)
hr = WsWriteEndElement( writer, NULL );
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<test><wrapper><val>1</val><val>2</val></wrapper></test>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
/* array of integers, no wrapper */
hr = set_output( writer );
@@ -3139,7 +3139,7 @@ static void test_repeating_element(void)
f.localName = NULL;
f.ns = NULL;
- test2 = HeapAlloc( GetProcessHeap(), 0, sizeof(*test2) + 2 * sizeof(INT32) );
+ test2 = malloc( sizeof(*test2) + 2 * sizeof(INT32) );
test2->val = (INT32 *)(test2 + 1);
test2->val[0] = 1;
test2->val[1] = 2;
@@ -3167,7 +3167,7 @@ static void test_repeating_element(void)
hr = WsWriteEndElement( writer, NULL );
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<test><val>1</val><val>2</val></test>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test2 );
+ free( test2 );
/* nillable item */
hr = set_output( writer );
@@ -3198,7 +3198,7 @@ static void test_repeating_element(void)
f.options = WS_FIELD_POINTER|WS_FIELD_OPTIONAL|WS_FIELD_NILLABLE|WS_FIELD_NILLABLE_ITEM;
value.data = -1;
- test3 = HeapAlloc( GetProcessHeap(), 0, sizeof(*test3) + 2 * sizeof(const struct value *) );
+ test3 = malloc( sizeof(*test3) + 2 * sizeof(const struct value *) );
test3->val = (const struct value **)(test3 + 1);
test3->val[0] = &value;
test3->val[1] = NULL;
@@ -3211,7 +3211,7 @@ static void test_repeating_element(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<test><wrapper><val><data>-1</data></val><val a:nil=\"true\" "
"xmlns:a=\"http://www.w3.org/2001/XMLSchema-instance\"/></wrapper></test>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test3 );
+ free( test3 );
WsFreeWriter( writer );
}
diff --git a/dlls/webservices/url.c b/dlls/webservices/url.c
index b44ee468e27..7585abadee8 100644
--- a/dlls/webservices/url.c
+++ b/dlls/webservices/url.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -25,7 +26,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -70,7 +70,7 @@ static unsigned char *strdup_utf8( const WCHAR *str, ULONG len, ULONG *ret_len )
{
unsigned char *ret;
*ret_len = WideCharToMultiByte( CP_UTF8, 0, str, len, NULL, 0, NULL, NULL );
- if ((ret = heap_alloc( *ret_len )))
+ if ((ret = malloc( *ret_len )))
WideCharToMultiByte( CP_UTF8, 0, str, len, (char *)ret, *ret_len, NULL, NULL );
return ret;
}
@@ -156,13 +156,13 @@ static WCHAR *url_decode( WCHAR *str, ULONG len, WS_HEAP *heap, ULONG *ret_len )
len_utf8, NULL, 0 )))
{
WARN( "invalid UTF-8 sequence\n" );
- heap_free( utf8 );
+ free( utf8 );
return NULL;
}
if ((ret = ws_alloc( heap, *ret_len * sizeof(WCHAR) )))
MultiByteToWideChar( CP_UTF8, 0, (char *)utf8, len_utf8, ret, *ret_len );
- heap_free( utf8 );
+ free( utf8 );
return ret;
}
@@ -357,7 +357,7 @@ static HRESULT url_encode_size( const WCHAR *str, ULONG len, const char *except,
*ret_len = 0;
if (!(utf8 = strdup_utf8( str, len, &len_utf8 ))) return E_OUTOFMEMORY;
for (i = 0; i < len_utf8; i++) *ret_len += escape_size( utf8[i], except );
- heap_free( utf8 );
+ free( utf8 );
return S_OK;
}
@@ -416,7 +416,7 @@ static HRESULT url_encode( const WCHAR *str, ULONG len, WCHAR *buf, const char *
p += len_enc;
}
- heap_free( utf8 );
+ free( utf8 );
return hr;
}
diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c
index 044351f6094..1dacc10ec43 100644
--- a/dlls/webservices/writer.c
+++ b/dlls/webservices/writer.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
@@ -29,7 +30,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -106,7 +106,7 @@ static struct writer *alloc_writer(void)
struct writer *ret;
ULONG size = sizeof(*ret) + prop_size( writer_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = WRITER_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -122,11 +122,11 @@ static void free_writer( struct writer *writer )
destroy_nodes( writer->root );
free_xml_string( writer->current_ns );
WsFreeHeap( writer->output_heap );
- heap_free( writer->stream_buf );
+ free( writer->stream_buf );
writer->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &writer->cs );
- heap_free( writer );
+ free( writer );
}
static void write_insert_eof( struct writer *writer, struct node *eof )
@@ -430,7 +430,7 @@ HRESULT WINAPI WsSetOutput( WS_XML_WRITER *handle, const WS_XML_WRITER_ENCODING
case WS_XML_WRITER_OUTPUT_TYPE_STREAM:
{
const WS_XML_WRITER_STREAM_OUTPUT *stream = (const WS_XML_WRITER_STREAM_OUTPUT *)output;
- if (!writer->stream_buf && !(writer->stream_buf = heap_alloc( STREAM_BUFSIZE )))
+ if (!writer->stream_buf && !(writer->stream_buf = malloc( STREAM_BUFSIZE )))
{
hr = E_OUTOFMEMORY;
goto done;
@@ -1283,12 +1283,12 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_char( writer, len );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_CHARS16_TEXT:
@@ -1306,12 +1306,12 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_bytes( writer, (const BYTE *)&len, sizeof(len) );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_BYTES8_TEXT:
@@ -1629,7 +1629,7 @@ static HRESULT add_namespace_attribute( struct writer *writer, const WS_XML_STRI
WS_XML_ELEMENT_NODE *elem = &writer->current->hdr;
HRESULT hr;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
attr->singleQuote = !!single;
attr->isXmlNs = 1;
@@ -2044,7 +2044,7 @@ static HRESULT write_add_attribute( struct writer *writer, const WS_XML_STRING *
WS_XML_ELEMENT_NODE *elem = &writer->current->hdr;
HRESULT hr;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
if (!prefix && ns->length) prefix = elem->prefix;
@@ -2477,7 +2477,7 @@ static HRESULT write_set_attribute_value( struct writer *writer, const WS_XML_TE
{
WS_XML_UTF8_TEXT *new, *old = (WS_XML_UTF8_TEXT *)elem->attributes[elem->attributeCount - 1]->value;
if ((hr = text_to_utf8text( value, old, NULL, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
elem->attributes[elem->attributeCount - 1]->value = &new->text;
break;
}
@@ -2485,7 +2485,7 @@ static HRESULT write_set_attribute_value( struct writer *writer, const WS_XML_TE
{
WS_XML_TEXT *new, *old = elem->attributes[elem->attributeCount - 1]->value;
if ((hr = text_to_text( value, old, NULL, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
elem->attributes[elem->attributeCount - 1]->value = new;
break;
}
@@ -2517,7 +2517,7 @@ static HRESULT write_add_text_node( struct writer *writer, const WS_XML_TEXT *va
WS_XML_UTF8_TEXT *new;
if ((hr = text_to_utf8text( value, NULL, NULL, &new )) != S_OK)
{
- heap_free( node );
+ free( node );
return hr;
}
text->text = &new->text;
@@ -2528,7 +2528,7 @@ static HRESULT write_add_text_node( struct writer *writer, const WS_XML_TEXT *va
WS_XML_TEXT *new;
if ((hr = text_to_text( value, NULL, NULL, &new )) != S_OK)
{
- heap_free( node );
+ free( node );
return hr;
}
text->text = new;
@@ -2536,7 +2536,7 @@ static HRESULT write_add_text_node( struct writer *writer, const WS_XML_TEXT *va
}
default:
FIXME( "unhandled output encoding %u\n", writer->output_enc );
- heap_free( node );
+ free( node );
return E_NOTIMPL;
}
@@ -2691,13 +2691,13 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, 1 + sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_char( writer, type );
write_char( writer, len );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_CHARS16_TEXT_WITH_ENDELEMENT:
@@ -2715,13 +2715,13 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, 1 + sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_char( writer, type );
write_bytes( writer, (const BYTE *)&len, sizeof(len) );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_BYTES8_TEXT:
@@ -2920,7 +2920,7 @@ static HRESULT write_text_node( struct writer *writer, const WS_XML_TEXT *text )
WS_XML_UTF8_TEXT *new, *old = (WS_XML_UTF8_TEXT *)node->text;
offset = old->value.length;
if ((hr = text_to_utf8text( text, old, &offset, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
node->text = &new->text;
break;
}
@@ -2928,7 +2928,7 @@ static HRESULT write_text_node( struct writer *writer, const WS_XML_TEXT *text )
{
WS_XML_TEXT *new, *old = node->text;
if ((hr = text_to_text( text, old, &offset, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
node->text = new;
break;
}
@@ -4610,7 +4610,7 @@ static HRESULT write_add_comment_node( struct writer *writer, const WS_XML_STRIN
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY;
comment = (WS_XML_COMMENT_NODE *)node;
- if (value->length && !(comment->value.bytes = heap_alloc( value->length )))
+ if (value->length && !(comment->value.bytes = malloc( value->length )))
{
free_node( node );
return E_OUTOFMEMORY;
--
2.30.2
1
0
[PATCH 1/2] user32/tests: Rewrite msg tests ok_sequence to reduce verbosity.
by Rémi Bernon Feb. 1, 2022
by Rémi Bernon Feb. 1, 2022
Feb. 1, 2022
At WINETEST_DEBUG <= 1, only sequence mismatches will be checked and
reported.
At WINETEST_DEBUG == 2, individual message mismatches will be checked
and reported, expected / received sequences will be traced on mismatch.
At WINETEST_DEBUG > 2, individual message will be checked or traced,
all expected / received sequences will be traced.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51780
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/user32/tests/msg.c | 378 +++++++++++++---------------------------
1 file changed, 122 insertions(+), 256 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 90816a9df52..0626d77b638 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -2619,294 +2619,157 @@ static void flush_sequence(void)
LeaveCriticalSection( &sequence_cs );
}
-static void dump_sequence(const struct message *expected, const char *context, const char *file, int line)
+static int try_compare_message( const struct message *expected, const struct recvd_message *received )
{
- const struct recvd_message *actual = sequence;
- unsigned int count = 0;
+ static DWORD type_flags = hook | winevent_hook | kbd_hook;
+ int ret;
- trace_(file, line)("Failed sequence %s:\n", context );
- while (expected->message && actual->message)
+ if ((ret = (expected->flags & type_flags) - (received->flags & type_flags))) return ret;
+ if ((ret = expected->message - received->message)) return ret;
+
+ /* validate parent and defwinproc flags for optional messages */
+ if (!(expected->flags & optional)) return 0;
+ if ((ret = (expected->flags & defwinproc) - (received->flags & defwinproc))) return ret;
+ if ((ret = (expected->flags & parent) - (received->flags & parent))) return ret;
+
+ return 0;
+}
+
+static int compare_message( const struct message *expected, const struct recvd_message *received,
+ BOOL todo, const char *file, int line )
+{
+ static DWORD type_flags = hook | winevent_hook | kbd_hook;
+ static DWORD msg_flags = sent | posted;
+ int ret;
+
+ if ((ret = (expected->flags & type_flags) - (received->flags & type_flags))) goto done;
+ if ((ret = expected->message - received->message)) goto done;
+ if ((ret = (expected->flags & defwinproc) - (received->flags & defwinproc))) goto done;
+ if ((ret = (expected->flags & parent) - (received->flags & parent))) goto done;
+ if ((ret = (expected->flags & msg_flags) - (received->flags & msg_flags))) goto done;
+ if ((ret = (expected->flags & beginpaint) - (received->flags & beginpaint))) goto done;
+ if ((expected->flags & wparam) && (ret = (expected->wParam & ~expected->wp_mask) - (received->wParam & ~expected->wp_mask))) goto done;
+ if ((expected->flags & lparam) && (ret = (expected->lParam & ~expected->lp_mask) - (received->lParam & ~expected->lp_mask))) goto done;
+
+done:
+ if (ret && winetest_debug > 1)
{
- if (actual->output[0])
+ todo_wine_if(todo)
+ ok_(file, line)( 0, "mismatch %#x, %#x, %#lx, %#lx\n", received->message,
+ received->flags, received->wParam, received->lParam );
+ }
+ if (!ret && winetest_debug > 2)
+ trace_(file, line)( "match %#x, %#x, %#lx, %#lx\n", received->message,
+ received->flags, received->wParam, received->lParam );
+ return ret;
+}
+
+static BOOL find_next_message( const struct message **expected, const struct recvd_message **received,
+ BOOL *matches, BOOL todo, const char *file, int line )
+{
+ const struct recvd_message *first_received = *received, *tmp_received, *next_received;
+ const struct message *first_expected = *expected, *tmp_expected, *next_expected;
+ BOOL winhook_todo;
+
+ /* try matching messages in expected list with first received message */
+ for (next_expected = first_expected; next_expected->message; next_expected++)
+ if (!try_compare_message( next_expected, first_received )) break;
+
+ /* if current message doesn't match anything in the received list, match a non-optional message */
+ if (!next_expected->message) while (first_expected->flags & optional) first_expected++;
+
+ /* try matching messages in received list with first non-optional message */
+ for (next_received = first_received; next_received->message; next_received++)
+ if (!try_compare_message( first_expected, next_received ) &&
+ !(first_expected->flags & optional)) break;
+
+ /* couldn't find a match but there's more messages to try */
+ if (!next_expected->message && next_expected - first_expected > 1 &&
+ !next_received->message && next_received - first_received > 1)
+ return TRUE;
+
+ /* report the smallest mismatch which doesn't end the sequence */
+ if ((next_expected->message && next_expected - first_expected < next_received - first_received) ||
+ !next_received->message)
+ {
+ for (tmp_expected = first_expected; tmp_expected != next_expected; ++tmp_expected)
{
- if (expected->flags & hook)
+ if (tmp_expected->flags & optional) continue;
+ if ((tmp_expected->flags & winevent_hook) && !hEvent_hook) continue;
+ winhook_todo = (tmp_expected->flags & winevent_hook) && (tmp_expected->flags & winevent_hook_todo);
+ if (!winhook_todo) *matches = FALSE;
+ if (winetest_debug > 1)
{
- trace_(file, line)( " %u: expected: hook %04x - actual: %s\n",
- count, expected->message, actual->output );
- }
- else if (expected->flags & winevent_hook)
- {
- trace_(file, line)( " %u: expected: winevent %04x - actual: %s\n",
- count, expected->message, actual->output );
- }
- else if (expected->flags & kbd_hook)
- {
- trace_(file, line)( " %u: expected: kbd %04x - actual: %s\n",
- count, expected->message, actual->output );
- }
- else
- {
- trace_(file, line)( " %u: expected: msg %04x - actual: %s\n",
- count, expected->message, actual->output );
+ todo_wine_if(todo || winhook_todo)
+ ok_(file, line)( 0, "missing %#x, %#x, %#lx, %#lx\n", tmp_expected->message,
+ tmp_expected->flags, tmp_expected->wParam, tmp_expected->lParam );
}
}
+ *expected = next_expected;
+ }
- if (expected->message == actual->message)
- {
- if ((expected->flags & defwinproc) != (actual->flags & defwinproc) &&
- (expected->flags & optional))
- {
- /* don't match messages if their defwinproc status differs */
- expected++;
- }
- else
- {
- expected++;
- actual++;
- }
- }
- /* silently drop winevent messages if there is no support for them */
- else if ((expected->flags & optional) || ((expected->flags & winevent_hook) && !hEvent_hook) ||
- ((expected->flags & winevent_hook_todo) && !strcmp(winetest_platform, "wine")))
- expected++;
- else
+ if ((next_received->message && next_received - first_received < next_expected - first_expected) ||
+ !next_expected->message)
+ {
+ for (tmp_received = first_received; tmp_received != next_received; ++tmp_received)
{
- expected++;
- actual++;
+ *matches = FALSE;
+ if (winetest_debug > 1)
+ {
+ todo_wine_if(todo)
+ ok_(file, line)( 0, "spurious %#x, %#x, %#lx, %#lx\n", tmp_received->message,
+ tmp_received->flags, tmp_received->wParam, tmp_received->lParam );
+ }
}
- count++;
+ *received = next_received;
}
- /* optional trailing messages */
- while (expected->message && ((expected->flags & optional) ||
- ((expected->flags & winevent_hook) && !hEvent_hook)))
- {
- trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
- expected++;
- count++;
- }
-
- if (expected->message)
- {
- trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
- return;
- }
-
- while (actual->message && actual->output[0])
- {
- trace_(file, line)( " %u: expected: nothing - actual: %s\n", count, actual->output );
- actual++;
- count++;
- }
+ return (*expected)->message && (*received)->message;
}
#define ok_sequence( exp, contx, todo) \
ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)
-
-static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo,
+static void ok_sequence_(const struct message *expected, const char *context, BOOL todo,
const char *file, int line)
{
static const struct recvd_message end_of_sequence;
- const struct message *expected = expected_list;
- const struct recvd_message *actual;
- int failcount = 0, dump = 0;
- unsigned int count = 0;
+ const struct recvd_message *first_received, *received;
+ const struct message *first_expected = expected;
+ BOOL matches = TRUE;
add_message(&end_of_sequence);
+ received = first_received = sequence;
- actual = sequence;
-
- while (expected->message && actual->message)
+ while (expected->message || received->message)
{
- if (expected->message == actual->message &&
- !((expected->flags ^ actual->flags) & (hook|winevent_hook|kbd_hook)))
- {
- if (expected->flags & wparam)
- {
- if (((expected->wParam ^ actual->wParam) & ~expected->wp_mask) && todo)
- {
- todo_wine {
- failcount ++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE,
- "%s: %u: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->wParam, actual->wParam);
- }
- }
- else
- {
- ok_( file, line)( ((expected->wParam ^ actual->wParam) & ~expected->wp_mask) == 0,
- "%s: %u: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->wParam, actual->wParam);
- if ((expected->wParam ^ actual->wParam) & ~expected->wp_mask) dump++;
- }
-
- }
- if (expected->flags & lparam)
- {
- if (((expected->lParam ^ actual->lParam) & ~expected->lp_mask) && todo)
- {
- todo_wine {
- failcount ++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE,
- "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->lParam, actual->lParam);
- }
- }
- else
- {
- ok_( file, line)(((expected->lParam ^ actual->lParam) & ~expected->lp_mask) == 0,
- "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->lParam, actual->lParam);
- if ((expected->lParam ^ actual->lParam) & ~expected->lp_mask) dump++;
- }
- }
- if ((expected->flags & optional) &&
- ((expected->flags ^ actual->flags) & (defwinproc|parent)))
- {
- /* don't match optional messages if their defwinproc or parent status differs */
- expected++;
- count++;
- continue;
- }
- if ((expected->flags & defwinproc) != (actual->flags & defwinproc) && todo)
- {
- todo_wine {
- failcount ++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE,
- "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
- context, count, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
- }
- }
- else
- {
- ok_( file, line) ((expected->flags & defwinproc) == (actual->flags & defwinproc),
- "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
- context, count, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
- if ((expected->flags & defwinproc) != (actual->flags & defwinproc)) dump++;
- }
-
- ok_( file, line) ((expected->flags & beginpaint) == (actual->flags & beginpaint),
- "%s: %u: the msg 0x%04x should %shave been sent by BeginPaint\n",
- context, count, expected->message, (expected->flags & beginpaint) ? "" : "NOT ");
- if ((expected->flags & beginpaint) != (actual->flags & beginpaint)) dump++;
-
- ok_( file, line) ((expected->flags & (sent|posted)) == (actual->flags & (sent|posted)),
- "%s: %u: the msg 0x%04x should have been %s\n",
- context, count, expected->message, (expected->flags & posted) ? "posted" : "sent");
- if ((expected->flags & (sent|posted)) != (actual->flags & (sent|posted))) dump++;
-
- ok_( file, line) ((expected->flags & parent) == (actual->flags & parent),
- "%s: %u: the msg 0x%04x was expected in %s\n",
- context, count, expected->message, (expected->flags & parent) ? "parent" : "child");
- if ((expected->flags & parent) != (actual->flags & parent)) dump++;
-
- ok_( file, line) ((expected->flags & hook) == (actual->flags & hook),
- "%s: %u: the msg 0x%04x should have been sent by a hook\n",
- context, count, expected->message);
- if ((expected->flags & hook) != (actual->flags & hook)) dump++;
-
- ok_( file, line) ((expected->flags & winevent_hook) == (actual->flags & winevent_hook),
- "%s: %u: the msg 0x%04x should have been sent by a winevent hook\n",
- context, count, expected->message);
- if ((expected->flags & winevent_hook) != (actual->flags & winevent_hook)) dump++;
-
- ok_( file, line) ((expected->flags & kbd_hook) == (actual->flags & kbd_hook),
- "%s: %u: the msg 0x%04x should have been sent by a keyboard hook\n",
- context, count, expected->message);
- if ((expected->flags & kbd_hook) != (actual->flags & kbd_hook)) dump++;
-
- expected++;
- actual++;
- }
- /*
- * silently drop hook messages if there is no support for them, mark
- * winevent todo's.
- */
- else if ((expected->flags & optional) ||
- ((expected->flags & hook) && !hCBT_hook) ||
- ((expected->flags & winevent_hook) && !hEvent_hook) ||
- ((expected->flags & kbd_hook) && !hKBD_hook) ||
- ((expected->flags & winevent_hook_todo) && !strcmp(winetest_platform, "wine")))
+ winetest_push_context( "%u", expected - first_expected );
+ if (find_next_message( &expected, &received, &matches, todo, file, line ))
{
- if ((expected->flags & winevent_hook_todo) && hEvent_hook)
- {
- todo_wine {
- ok_( file, line) (FALSE,
- "%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
- context, count, expected->message, actual->message);
- }
- }
- expected++;
- }
- else if (todo)
- {
- failcount++;
- todo_wine {
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE, "%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
- context, count, expected->message, actual->message);
- }
- goto done;
- }
- else
- {
- ok_( file, line) (FALSE, "%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
- context, count, expected->message, actual->message);
- dump++;
+ if (compare_message( expected, received, todo, file, line )) matches = FALSE;
expected++;
- actual++;
+ received++;
}
- count++;
+ winetest_pop_context();
}
- /* skip all optional trailing messages, check for winevent todo's. */
- while (expected->message && ((expected->flags & optional) ||
- ((expected->flags & hook) && !hCBT_hook) ||
- ((expected->flags & winevent_hook) && !hEvent_hook) ||
- ((expected->flags & winevent_hook_todo) && !strcmp(winetest_platform, "wine"))))
+ todo_wine_if(todo)
+ ok_(file, line)( matches, "%s mismatches\n", context );
+
+ if (winetest_debug > (matches ? 2 : 1))
{
- if ((expected->flags & winevent_hook_todo) && hEvent_hook)
- {
- todo_wine {
- ok_( file, line) (FALSE, "%s: %u: the msg sequence is not complete: expected 0x%04x - actual 0x%04x\n",
- context, count, expected->message, actual->message);
- }
- }
- expected++;
+ trace_(file, line)( "expected:\n" );
+ for (expected = first_expected; expected->message; ++expected)
+ trace_(file, line)( " %u: %#x, %#x, %#lx, %#lx\n", expected - first_expected,
+ expected->message, expected->flags, expected->wParam,
+ expected->lParam );
+ trace_(file, line)( "received:\n" );
+ for (received = first_received; received->message; ++received)
+ trace_(file, line)( " %u: %#x, %#x, %#lx, %#lx\n", received - first_received,
+ received->message, received->flags, received->wParam,
+ received->lParam );
}
- if (todo)
- {
- todo_wine {
- if (expected->message || actual->message) {
- failcount++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE, "%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
- context, count, expected->message, actual->message);
- }
- }
- }
- else
- {
- if (expected->message || actual->message)
- {
- dump++;
- ok_( file, line) (FALSE, "%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
- context, count, expected->message, actual->message);
- }
- }
- if( todo && !failcount) /* succeeded yet marked todo */
- todo_wine {
- if (!strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line)( TRUE, "%s: marked \"todo_wine\" but succeeds\n", context);
- }
-
-done:
- if (dump) dump_sequence(expected_list, context, file, line);
flush_sequence();
}
@@ -13997,6 +13860,7 @@ static void test_ShowWindow(void)
};
char comment[64];
INT idx; /* index into the above array of names */
+ winetest_push_context("%u", i);
idx = (sw[i].cmd == SW_NORMALNA) ? 12 : sw[i].cmd;
@@ -14038,6 +13902,8 @@ static void test_ShowWindow(void)
if (0) /* FIXME: Wine behaves completely different here */
ok(EqualRect(&win_rc, &wp.rcNormalPosition), "expected %s got %s\n",
wine_dbgstr_rect(&win_rc), wine_dbgstr_rect(&wp.rcNormalPosition));
+
+ winetest_pop_context();
}
DestroyWindow(hwnd);
flush_events();
--
2.34.1
2
3
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/hnetcfg/apps.c | 21 ++++++++++-----------
dlls/hnetcfg/manager.c | 4 ++--
dlls/hnetcfg/policy.c | 14 +++++++-------
dlls/hnetcfg/port.c | 13 ++++++-------
dlls/hnetcfg/profile.c | 4 ++--
dlls/hnetcfg/service.c | 8 ++++----
6 files changed, 31 insertions(+), 33 deletions(-)
diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c
index b6447cf4d63..16379e3457b 100644
--- a/dlls/hnetcfg/apps.c
+++ b/dlls/hnetcfg/apps.c
@@ -29,7 +29,6 @@
#include "natupnp.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "hnetcfg_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
@@ -62,7 +61,7 @@ static ULONG WINAPI fw_app_Release(
{
TRACE("destroying %p\n", fw_app);
SysFreeString( fw_app->filename );
- HeapFree( GetProcessHeap(), 0, fw_app );
+ free( fw_app );
}
return refs;
}
@@ -281,7 +280,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, NULL, &sz);
if (res == WN_MORE_DATA)
{
- if (!(path = heap_alloc(sz)))
+ if (!(path = malloc(sz)))
return E_OUTOFMEMORY;
info = (UNIVERSAL_NAME_INFOW *)&path;
@@ -291,21 +290,21 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
SysFreeString(This->filename);
This->filename = SysAllocString(info->lpUniversalName);
}
- heap_free(path);
+ free(path);
return HRESULT_FROM_WIN32(res);
}
sz = GetFullPathNameW(image, 0, NULL, NULL);
- if (!(path = heap_alloc(++sz * sizeof(WCHAR))))
+ if (!(path = malloc(++sz * sizeof(WCHAR))))
return E_OUTOFMEMORY;
GetFullPathNameW(image, sz, path, NULL);
longsz = GetLongPathNameW(path, path, sz);
if (longsz > sz)
{
- if (!(path = heap_realloc(path, longsz * sizeof(WCHAR))))
+ if (!(path = realloc(path, longsz * sizeof(WCHAR))))
{
- heap_free(path);
+ free(path);
return E_OUTOFMEMORY;
}
GetLongPathNameW(path, path, longsz);
@@ -313,7 +312,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
SysFreeString( This->filename );
This->filename = SysAllocString(path);
- heap_free(path);
+ free(path);
return This->filename ? S_OK : E_OUTOFMEMORY;
}
@@ -432,7 +431,7 @@ HRESULT NetFwAuthorizedApplication_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fa = HeapAlloc( GetProcessHeap(), 0, sizeof(*fa) );
+ fa = malloc( sizeof(*fa) );
if (!fa) return E_OUTOFMEMORY;
fa->INetFwAuthorizedApplication_iface.lpVtbl = &fw_app_vtbl;
@@ -470,7 +469,7 @@ static ULONG WINAPI fw_apps_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_apps);
- HeapFree( GetProcessHeap(), 0, fw_apps );
+ free( fw_apps );
}
return refs;
}
@@ -645,7 +644,7 @@ HRESULT NetFwAuthorizedApplications_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fa = HeapAlloc( GetProcessHeap(), 0, sizeof(*fa) );
+ fa = malloc( sizeof(*fa) );
if (!fa) return E_OUTOFMEMORY;
fa->INetFwAuthorizedApplications_iface.lpVtbl = &fw_apps_vtbl;
diff --git a/dlls/hnetcfg/manager.c b/dlls/hnetcfg/manager.c
index 2c0790a73b5..fda69729901 100644
--- a/dlls/hnetcfg/manager.c
+++ b/dlls/hnetcfg/manager.c
@@ -58,7 +58,7 @@ static ULONG WINAPI fw_manager_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_manager);
- HeapFree( GetProcessHeap(), 0, fw_manager );
+ free( fw_manager );
}
return refs;
}
@@ -244,7 +244,7 @@ HRESULT NetFwMgr_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fm = HeapAlloc( GetProcessHeap(), 0, sizeof(*fm) );
+ fm = malloc( sizeof(*fm) );
if (!fm) return E_OUTOFMEMORY;
fm->INetFwMgr_iface.lpVtbl = &fw_manager_vtbl;
diff --git a/dlls/hnetcfg/policy.c b/dlls/hnetcfg/policy.c
index 1f5b0daa568..7bdc1563d90 100644
--- a/dlls/hnetcfg/policy.c
+++ b/dlls/hnetcfg/policy.c
@@ -105,7 +105,7 @@ static ULONG WINAPI netfw_rules_Release(
if (!refs)
{
TRACE("destroying %p\n", This);
- HeapFree( GetProcessHeap(), 0, This );
+ free( This );
}
return refs;
}
@@ -265,7 +265,7 @@ static HRESULT create_INetFwRules(INetFwRules **object)
TRACE("(%p)\n", object);
- rules = HeapAlloc( GetProcessHeap(), 0, sizeof(*rules) );
+ rules = malloc( sizeof(*rules) );
if (!rules) return E_OUTOFMEMORY;
rules->INetFwRules_iface.lpVtbl = &fw_rules_vtbl;
@@ -292,7 +292,7 @@ static ULONG WINAPI fw_policy_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_policy);
- HeapFree( GetProcessHeap(), 0, fw_policy );
+ free( fw_policy );
}
return refs;
}
@@ -435,7 +435,7 @@ HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl;
@@ -487,7 +487,7 @@ static ULONG WINAPI fwpolicy2_Release(INetFwPolicy2 *iface)
{
INetFwRules_Release(fw_policy->fw_policy2_rules);
TRACE("destroying %p\n", fw_policy);
- HeapFree( GetProcessHeap(), 0, fw_policy );
+ free( fw_policy );
}
return refs;
}
@@ -768,7 +768,7 @@ HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj )
TRACE("(%p,%p)\n", outer, obj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwPolicy2_iface.lpVtbl = &fw_policy2_vtbl;
@@ -778,7 +778,7 @@ HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj )
if (FAILED(create_INetFwRules(&fp->fw_policy2_rules)))
{
- HeapFree( GetProcessHeap(), 0, fp );
+ free( fp );
return E_OUTOFMEMORY;
}
diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c
index fd4ac4977d3..9e9264df1dc 100644
--- a/dlls/hnetcfg/port.c
+++ b/dlls/hnetcfg/port.c
@@ -28,7 +28,6 @@
#include "netfw.h"
#include "natupnp.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "hnetcfg_private.h"
@@ -64,7 +63,7 @@ static ULONG WINAPI fw_port_Release(
{
TRACE("destroying %p\n", fw_port);
SysFreeString( fw_port->name );
- HeapFree( GetProcessHeap(), 0, fw_port );
+ free( fw_port );
}
return refs;
}
@@ -363,7 +362,7 @@ HRESULT NetFwOpenPort_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwOpenPort_iface.lpVtbl = &fw_port_vtbl;
@@ -404,7 +403,7 @@ static ULONG WINAPI fw_ports_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_ports);
- HeapFree( GetProcessHeap(), 0, fw_ports );
+ free( fw_ports );
}
return refs;
}
@@ -592,7 +591,7 @@ HRESULT NetFwOpenPorts_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwOpenPorts_iface.lpVtbl = &fw_ports_vtbl;
@@ -653,7 +652,7 @@ static ULONG WINAPI upnpnat_Release(IUPnPNAT *iface)
LONG refs = InterlockedDecrement( &This->ref );
if (!refs)
{
- heap_free( This );
+ free( This );
}
return refs;
}
@@ -762,7 +761,7 @@ HRESULT IUPnPNAT_create(IUnknown *outer, void **object)
TRACE("(%p,%p)\n", outer, object);
- nat = heap_alloc( sizeof(*nat) );
+ nat = malloc( sizeof(*nat) );
if (!nat) return E_OUTOFMEMORY;
nat->IUPnPNAT_iface.lpVtbl = &upnpnat_vtbl;
diff --git a/dlls/hnetcfg/profile.c b/dlls/hnetcfg/profile.c
index d0e9f48dab4..63f6d0cc7ed 100644
--- a/dlls/hnetcfg/profile.c
+++ b/dlls/hnetcfg/profile.c
@@ -58,7 +58,7 @@ static ULONG WINAPI fw_profile_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_profile);
- HeapFree( GetProcessHeap(), 0, fw_profile );
+ free( fw_profile );
}
return refs;
}
@@ -334,7 +334,7 @@ HRESULT NetFwProfile_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwProfile_iface.lpVtbl = &fw_profile_vtbl;
diff --git a/dlls/hnetcfg/service.c b/dlls/hnetcfg/service.c
index 5bfeedaaedf..122d9797bab 100644
--- a/dlls/hnetcfg/service.c
+++ b/dlls/hnetcfg/service.c
@@ -58,7 +58,7 @@ static ULONG WINAPI fw_service_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_service);
- HeapFree( GetProcessHeap(), 0, fw_service );
+ free( fw_service );
}
return refs;
}
@@ -290,7 +290,7 @@ static HRESULT NetFwService_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwService_iface.lpVtbl = &fw_service_vtbl;
@@ -328,7 +328,7 @@ static ULONG WINAPI fw_services_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_services);
- HeapFree( GetProcessHeap(), 0, fw_services );
+ free( fw_services );
}
return refs;
}
@@ -464,7 +464,7 @@ HRESULT NetFwServices_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwServices_iface.lpVtbl = &fw_services_vtbl;
--
2.34.1
1
5
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
Runescape calls GL functions (SwapBuffers, glFinish) from different threads.
That mostly goes well except for when the DC is locked by ExtEscape() and the
other thread calls, e. g., SwapBuffers that fails because GL can't get driver
funcs (get_dc_ptr() in__wine_get_wgl_driver() returns NULL as the DC is locked
by the other thread).
I don't see any reason why getting GL funcs should fail in this case. Caching
gl_funcs and using them with get_dc_obj() locking solves this type of race.
dlls/win32u/dc.c | 19 -------------------
dlls/win32u/driver.c | 20 ++++++++++++--------
dlls/win32u/ntgdi_private.h | 21 +++++++++++++++++++++
3 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c
index 3aae73779e9..9c09bf66e03 100644
--- a/dlls/win32u/dc.c
+++ b/dlls/win32u/dc.c
@@ -63,25 +63,6 @@ static const struct gdi_obj_funcs dc_funcs =
};
-static inline DC *get_dc_obj( HDC hdc )
-{
- DWORD type;
- DC *dc = get_any_obj_ptr( hdc, &type );
- if (!dc) return NULL;
-
- switch (type)
- {
- case NTGDI_OBJ_DC:
- case NTGDI_OBJ_MEMDC:
- case NTGDI_OBJ_ENHMETADC:
- return dc;
- default:
- GDI_ReleaseObj( hdc );
- SetLastError( ERROR_INVALID_HANDLE );
- return NULL;
- }
-}
-
/* alloc DC_ATTR from a pool of memory accessible from client */
static DC_ATTR *alloc_dc_attr(void)
{
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c
index 39996086c6d..233427b0964 100644
--- a/dlls/win32u/driver.c
+++ b/dlls/win32u/driver.c
@@ -1347,14 +1347,18 @@ NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNE
*/
struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version )
{
- struct opengl_funcs *ret = NULL;
- DC * dc = get_dc_ptr( hdc );
+ struct opengl_funcs *ret;
+ PHYSDEV physdev;
+ DC * dc;
- if (dc)
- {
- PHYSDEV physdev = GET_DC_PHYSDEV( dc, wine_get_wgl_driver );
- ret = physdev->funcs->wine_get_wgl_driver( physdev, version );
- release_dc_ptr( dc );
- }
+ if (!(dc = get_dc_obj( hdc ))) return NULL;
+ ret = dc->gl_funcs;
+ GDI_ReleaseObj( hdc );
+ if (ret) return ret;
+
+ if (!(dc = get_dc_ptr( hdc ))) return NULL;
+ physdev = GET_DC_PHYSDEV( dc, wine_get_wgl_driver );
+ dc->gl_funcs = ret = physdev->funcs->wine_get_wgl_driver( physdev, version );
+ release_dc_ptr( dc );
return ret;
}
diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h
index bfeb4557da7..54a4dc17eaf 100644
--- a/dlls/win32u/ntgdi_private.h
+++ b/dlls/win32u/ntgdi_private.h
@@ -87,6 +87,8 @@ typedef struct tagDC
XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */
RECT bounds; /* Current bounding rect */
+
+ struct opengl_funcs *gl_funcs; /* Opengl driver functions */
} DC;
/* Certain functions will do no further processing if the driver returns this.
@@ -660,6 +662,25 @@ static inline void copy_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *src )
memcpy( dst, src, get_dib_info_size( src, DIB_RGB_COLORS ));
}
+static inline DC *get_dc_obj( HDC hdc )
+{
+ DWORD type;
+ DC *dc = get_any_obj_ptr( hdc, &type );
+ if (!dc) return NULL;
+
+ switch (type)
+ {
+ case NTGDI_OBJ_DC:
+ case NTGDI_OBJ_MEMDC:
+ case NTGDI_OBJ_ENHMETADC:
+ return dc;
+ default:
+ GDI_ReleaseObj( hdc );
+ SetLastError( ERROR_INVALID_HANDLE );
+ return NULL;
+ }
+}
+
extern void CDECL free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
void set_gdi_client_ptr( HGDIOBJ handle, void *ptr ) DECLSPEC_HIDDEN;
--
2.34.1
2
2
[PATCH 3/3] msdasql/tests: Fix printf format warnings with long types.
by Alistair Leslie-Hughes Feb. 1, 2022
by Alistair Leslie-Hughes Feb. 1, 2022
Feb. 1, 2022
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msdasql/tests/Makefile.in | 1 -
dlls/msdasql/tests/provider.c | 184 ++++++++++++++++-----------------
2 files changed, 92 insertions(+), 93 deletions(-)
diff --git a/dlls/msdasql/tests/Makefile.in b/dlls/msdasql/tests/Makefile.in
index 2b911ed9716..314238660e2 100644
--- a/dlls/msdasql/tests/Makefile.in
+++ b/dlls/msdasql/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = msdasql.dll
IMPORTS = uuid oleaut32 ole32 odbccp32
diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c
index 22fbf26c107..7a5175fa050 100644
--- a/dlls/msdasql/tests/provider.c
+++ b/dlls/msdasql/tests/provider.c
@@ -50,17 +50,17 @@ static void test_msdasql(void)
CLSID classid;
hr = CoCreateInstance( &CLSID_MSDASQL, NULL, CLSCTX_ALL, &IID_IUnknown, (void **)&unk);
- ok(hr == S_OK, "Failed to create object 0x%08x\n", hr);
+ ok(hr == S_OK, "Failed to create object 0x%08lx\n", hr);
if (FAILED(hr))
{
return;
}
hr = IUnknown_QueryInterface(unk, &IID_IPersist, (void**)&persist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IPersist_GetClassID(persist, &classid);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&classid, &CLSID_MSDASQL), "got %s\n", debugstr_guid(&classid));
IPersist_Release(persist);
@@ -91,7 +91,7 @@ static void test_Properties(void)
};
hr = CoCreateInstance( &CLSID_MSDASQL, NULL, CLSCTX_ALL, &IID_IDBProperties, (void **)&props);
- ok(hr == S_OK, "Failed to create object 0x%08x\n", hr);
+ ok(hr == S_OK, "Failed to create object 0x%08lx\n", hr);
propidset.rgPropertyIDs = NULL;
propidset.cPropertyIDs = 0;
@@ -99,13 +99,13 @@ static void test_Properties(void)
infocount = 0;
hr = IDBProperties_GetPropertyInfo(props, 1, &propidset, &infocount, &propinfoset, &desc);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
VARTYPE types[14] = { VT_BSTR, VT_BOOL, VT_BSTR, VT_BSTR, intptr_vartype, VT_BSTR, VT_I4, VT_I2 , VT_I4, VT_BSTR, VT_I4, VT_BSTR, VT_I4, VT_I4 };
ok(IsEqualGUID(&propinfoset->guidPropertySet, &DBPROPSET_DBINIT), "got %s\n", debugstr_guid(&propinfoset->guidPropertySet));
- ok(propinfoset->cPropertyInfos == 14, "got %d\n", propinfoset->cPropertyInfos);
+ ok(propinfoset->cPropertyInfos == 14, "got %lu\n", propinfoset->cPropertyInfos);
propidlist.guidPropertySet = DBPROPSET_DBINIT;
propidlist.cPropertyIDs = propinfoset->cPropertyInfos;
@@ -115,10 +115,10 @@ static void test_Properties(void)
{
ok(propinfoset->rgPropertyInfos[i].vtType == types[i], "got %d\n", propinfoset->rgPropertyInfos[i].vtType);
ok(propinfoset->rgPropertyInfos[i].dwFlags == (DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE),
- "got %d\n", propinfoset->rgPropertyInfos[i].dwFlags);
- ok(properties[i] == propinfoset->rgPropertyInfos[i].dwPropertyID, "%d, got %d\n", i,
+ "got %lu\n", propinfoset->rgPropertyInfos[i].dwFlags);
+ ok(properties[i] == propinfoset->rgPropertyInfos[i].dwPropertyID, "%lu, got %lu\n", i,
propinfoset->rgPropertyInfos[i].dwPropertyID);
- ok(propinfoset->rgPropertyInfos[i].vtType != VT_EMPTY, "%d, got %d\n", i,
+ ok(propinfoset->rgPropertyInfos[i].vtType != VT_EMPTY, "%lu, got %u\n", i,
propinfoset->rgPropertyInfos[i].vtType);
propidlist.rgPropertyIDs[i] = propinfoset->rgPropertyInfos[i].dwPropertyID;
@@ -131,15 +131,15 @@ static void test_Properties(void)
CoTaskMemFree(propinfoset);
hr = IDBProperties_GetProperties(props, 1, &propidlist, &propcnt, &propset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(propidlist.cPropertyIDs == 14, "got %d\n", propidlist.cPropertyIDs);
- ok(propset->cProperties == 14, "got %d\n", propset->cProperties);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
+ ok(propidlist.cPropertyIDs == 14, "got %lu\n", propidlist.cPropertyIDs);
+ ok(propset->cProperties == 14, "got %lu\n", propset->cProperties);
for (i = 0; i < propidlist.cPropertyIDs; i++)
{
VARTYPE vartype = VT_EMPTY;
- ok(properties[i] == propidlist.rgPropertyIDs[i], "%d, got %d\n", i, propidlist.rgPropertyIDs[i]);
+ ok(properties[i] == propidlist.rgPropertyIDs[i], "%lu, got %lu\n", i, propidlist.rgPropertyIDs[i]);
if(properties[i] == DBPROP_INIT_PROMPT)
{
@@ -157,7 +157,7 @@ static void test_Properties(void)
vartype = VT_I4;
}
- ok(V_VT(&propset->rgProperties[i].vValue) == vartype, "%d wrong type %d\n", i, V_VT(&propset->rgProperties[i].vValue));
+ ok(V_VT(&propset->rgProperties[i].vValue) == vartype, "%lu wrong type %d\n", i, V_VT(&propset->rgProperties[i].vValue));
}
CoTaskMemFree(propidlist.rgPropertyIDs);
@@ -172,11 +172,11 @@ static void test_Properties(void)
propcnt = 0;
propset = NULL;
hr = IDBProperties_GetProperties(props, 1, &propidlist, &propcnt, &propset);
- ok(hr == DB_E_ERRORSOCCURRED, "got 0x%08x\n", hr);
+ ok(hr == DB_E_ERRORSOCCURRED, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&propset->guidPropertySet, &DBPROPSET_DATASOURCEINFO), "got %s\n", debugstr_guid(&propset->guidPropertySet));
- ok(propset->cProperties == 1, "got %d\n", propset->cProperties);
- ok(propset->rgProperties[0].dwPropertyID == DBPROP_MULTIPLERESULTS, "got %d\n", propset->rgProperties[0].dwPropertyID);
- ok(propset->rgProperties[0].dwStatus == DBPROPSTATUS_NOTSUPPORTED, "got %d\n", propset->rgProperties[0].dwStatus);
+ ok(propset->cProperties == 1, "got %lu\n", propset->cProperties);
+ ok(propset->rgProperties[0].dwPropertyID == DBPROP_MULTIPLERESULTS, "got %ld\n", propset->rgProperties[0].dwPropertyID);
+ ok(propset->rgProperties[0].dwStatus == DBPROPSTATUS_NOTSUPPORTED, "got %ld\n", propset->rgProperties[0].dwStatus);
CoTaskMemFree(propset);
@@ -197,43 +197,43 @@ static void test_command_interfaces(IUnknown *cmd)
IUnknown *unk;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandProperties, (void**)&commandProp);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandProperties_Release(commandProp);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandWithParameters, (void**)&cmdwithparams);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandWithParameters_Release(cmdwithparams);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandText_Release(command_text);
hr = IUnknown_QueryInterface(cmd, &IID_IConvertType, (void**)&convertype);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IConvertType_Release(convertype);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandPrepare, (void**)&commandprepare);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandPrepare_Release(commandprepare);
hr = IUnknown_QueryInterface(cmd, &IID_IColumnsInfo, (void**)&colinfo);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IColumnsInfo_Release(colinfo);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandStream, (void**)&commandstream);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IMultipleResults, (void**)&multiple);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IRowsetChange, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IRowsetUpdate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IRowsetLocate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
}
static void test_command_text(IUnknown *cmd)
@@ -244,43 +244,43 @@ static void test_command_text(IUnknown *cmd)
GUID dialect;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == DB_E_NOCOMMAND, "got 0x%08x\n", hr);
+ ok(hr == DB_E_NOCOMMAND, "got 0x%08lx\n", hr);
if (0)
{
/* Crashes under windows */
hr = ICommandText_SetCommandText(command_text, NULL, L"select * from testing");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
}
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == DB_E_NOCOMMAND, "got 0x%08x\n", hr);
+ ok(hr == DB_E_NOCOMMAND, "got 0x%08lx\n", hr);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, L"select * from testing");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetCommandText(command_text, NULL, &str);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str));
HeapFree(GetProcessHeap(), 0, str);
/* dialect empty value */
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == DB_S_DIALECTIGNORED, "got 0x%08x\n", hr);
+ ok(hr == DB_S_DIALECTIGNORED, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&DBGUID_DEFAULT, &dialect), "got %s\n", debugstr_guid(&dialect));
ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str));
HeapFree(GetProcessHeap(), 0, str);
dialect = DBGUID_DEFAULT;
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&DBGUID_DEFAULT, &dialect), "got %s\n", debugstr_guid(&dialect));
ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str));
HeapFree(GetProcessHeap(), 0, str);
@@ -295,10 +295,10 @@ static void test_command_dbsession(IUnknown *cmd, IUnknown *session)
IUnknown *sess;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetDBSession(command_text, &IID_IUnknown, &sess);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(session == sess, "different session pointers\n");
ICommandText_Release(command_text);
@@ -315,40 +315,40 @@ static void test_rowset_interfaces(IRowset *rowset, ICommandText *commandtext)
HRESULT hr;
hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IRowsetInfo_GetSpecification(info, &IID_ICommandText, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IRowsetInfo_GetSpecification(info, &IID_ICommandText, (IUnknown**)&specification);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if (specification)
{
- ok(commandtext == specification, "got 0x%08x\n", hr);
+ ok(commandtext == specification, "got 0x%08lx\n", hr);
ICommandText_Release(specification);
}
IRowsetInfo_Release(info);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&col_info);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IColumnsInfo_Release(col_info);
hr = IRowset_QueryInterface(rowset, &IID_IAccessor, (void**)&accessor);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IAccessor_Release(accessor);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsRowset, (void**)&col_rs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IColumnsRowset_Release(col_rs);
hr = IRowset_QueryInterface(rowset, &IID_IRowsetChange, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IRowset_QueryInterface(rowset, &IID_IRowsetUpdate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IRowset_QueryInterface(rowset, &IID_IRowsetLocate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
}
static void test_command_rowset(IUnknown *cmd)
@@ -361,45 +361,45 @@ static void test_command_rowset(IUnknown *cmd)
DBROWCOUNT affected;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandPrepare, (void**)&commandprepare);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandPrepare_Prepare(commandprepare, 1);
- ok(hr == DB_E_NOCOMMAND, "got 0x%08x\n", hr);
+ ok(hr == DB_E_NOCOMMAND, "got 0x%08lx\n", hr);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, L"CREATE TABLE testing (col1 INT, col2 SHORT)");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandPrepare_Prepare(commandprepare, 1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandPrepare_Release(commandprepare);
affected = 9999;
hr = ICommandText_Execute(command_text, NULL, &IID_IRowset, NULL, &affected, &unk);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
todo_wine ok(unk == NULL, "Unexpected value\n");
- todo_wine ok(affected == -1, "got %ld\n", affected);
+ todo_wine ok(affected == -1, "got %Id\n", affected);
if (unk)
IUnknown_Release(unk);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, L"select * from testing");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
affected = 9999;
hr = ICommandText_Execute(command_text, NULL, &IID_IRowset, NULL, &affected, &unk);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(unk != NULL, "Unexpected value\n");
if (hr == S_OK)
{
ok(affected == -1, "wrong affected value\n");
hr = IUnknown_QueryInterface(unk, &IID_IRowset, (void**)&rowset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
test_rowset_interfaces(rowset, command_text);
@@ -441,11 +441,11 @@ static void test_sessions(void)
hr = CoCreateInstance( &CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, &IID_IDataInitialize,
(void **)&datainit );
- ok(hr == S_OK, "Failed to create object 0x%08x\n", hr);
+ ok(hr == S_OK, "Failed to create object 0x%08lx\n", hr);
hr = IDataInitialize_GetDataSource( datainit, NULL, CLSCTX_INPROC_SERVER, connect_str, &IID_IDBInitialize,
(IUnknown **)&dbinit );
SysFreeString(connect_str);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
if(FAILED(hr))
{
IDataInitialize_Release( datainit );
@@ -453,11 +453,11 @@ static void test_sessions(void)
}
hr = IDBInitialize_QueryInterface( dbinit, &IID_IDBProperties, (void **)&props );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IDBProperties_Release(props);
hr = IDBInitialize_Initialize( dbinit );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if(FAILED(hr))
{
IDBInitialize_Release( dbinit );
@@ -466,54 +466,54 @@ static void test_sessions(void)
}
hr = IDBInitialize_QueryInterface( dbinit, &IID_IDBCreateSession, (void **)&dbsession );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IDBCreateSession_CreateSession( dbsession, NULL, &IID_IUnknown, &session );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_IGetDataSource, (void**)&datasource);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IGetDataSource_GetDataSource(datasource, &IID_IDBProperties, (IUnknown**)&dsource);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(dsource == props, "different pointers\n");
IDBProperties_Release(dsource);
IGetDataSource_Release(datasource);
hr = IUnknown_QueryInterface(session, &IID_ITransaction, (void**)&transaction);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ITransaction_Release(transaction);
hr = IUnknown_QueryInterface(session, &IID_ITransactionLocal, (void**)&local);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
if(hr == S_OK)
ITransactionLocal_Release(local);
hr = IUnknown_QueryInterface(session, &IID_ITransactionObject, (void**)&object);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_ITransactionJoin, (void**)&join);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ITransactionJoin_Release(join);
hr = IUnknown_QueryInterface(session, &IID_IBindResource, (void**)&unimplemented);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_ICreateRow, (void**)&unimplemented);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_ISessionProperties, (void**)&session_props);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ISessionProperties_Release(session_props);
hr = IUnknown_QueryInterface(session, &IID_IOpenRowset, (void**)&openrowset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IOpenRowset_QueryInterface(openrowset, &IID_IDBCreateCommand, (void**)&create_command);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IDBCreateCommand_CreateCommand(create_command, NULL, &IID_IUnknown, (IUnknown **)&cmd);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
test_command_interfaces(cmd);
@@ -566,7 +566,7 @@ static void setup_database(void)
if (!db_created)
{
SQLInstallerError(1, &code, buffer, sizeof(buffer), &size);
- trace("code %d, buffer %s, size %d\n", code, debugstr_a(buffer), size);
+ trace("code %ld, buffer %s, size %d\n", code, debugstr_a(buffer), size);
HeapFree(GetProcessHeap(), 0, driver);
@@ -595,7 +595,7 @@ static void cleanup_database(void)
WORD size;
SQLInstallerError(1, &code, buffer, sizeof(buffer), &size);
- trace("code %d, buffer %s, size %d\n", code, debugstr_a(buffer), size);
+ trace("code %ld, buffer %s, size %d\n", code, debugstr_a(buffer), size);
}
DeleteFileA(mdbpath);
@@ -630,15 +630,15 @@ static void test_enumeration(void)
}
hr = ISourcesRowset_GetSourcesRowset(source, NULL, &IID_IRowset, 0, NULL, (IUnknown**)&rowset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ISourcesRowset_GetSourcesRowset(source, NULL, &IID_IRowset, 0, NULL, (IUnknown**)&rowset2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(rowset != rowset2, "same pointer\n");
IRowset_Release(rowset2);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&columninfo);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
DBORDINAL columns;
@@ -647,8 +647,8 @@ static void test_enumeration(void)
int i;
hr = IColumnsInfo_GetColumnInfo(columninfo, &columns, &dbcolumninfo, &buffer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(columns == 6, "got %lu\n", columns);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
+ ok(columns == 6, "got %Iu\n", columns);
for( i = 0; i < columns; i++ )
{
@@ -659,9 +659,9 @@ static void test_enumeration(void)
debugstr_w(dbcolumninfo[i].pwszName), debugstr_w(colinfo_data[i].pwszName));
ok (dbcolumninfo[i].pTypeInfo == colinfo_data[i].pTypeInfo, "got %p/%p", dbcolumninfo[i].pTypeInfo, colinfo_data[i].pTypeInfo);
- ok (dbcolumninfo[i].iOrdinal == colinfo_data[i].iOrdinal, "got %ld/%ld", dbcolumninfo[i].iOrdinal, colinfo_data[i].iOrdinal);
- ok (dbcolumninfo[i].dwFlags == colinfo_data[i].dwFlags, "got 0x%08x/0x%0x8", dbcolumninfo[i].dwFlags, colinfo_data[i].dwFlags);
- ok (dbcolumninfo[i].ulColumnSize == colinfo_data[i].ulColumnSize, "got %lu/%lu", dbcolumninfo[i].ulColumnSize, colinfo_data[i].ulColumnSize);
+ ok (dbcolumninfo[i].iOrdinal == colinfo_data[i].iOrdinal, "got %Id/%Id", dbcolumninfo[i].iOrdinal, colinfo_data[i].iOrdinal);
+ ok (dbcolumninfo[i].dwFlags == colinfo_data[i].dwFlags, "got 0x%08lx/0x%08lx", dbcolumninfo[i].dwFlags, colinfo_data[i].dwFlags);
+ ok (dbcolumninfo[i].ulColumnSize == colinfo_data[i].ulColumnSize, "got %Iu/%Iu", dbcolumninfo[i].ulColumnSize, colinfo_data[i].ulColumnSize);
ok (dbcolumninfo[i].wType == colinfo_data[i].wType, "got %d/%d", dbcolumninfo[i].wType, colinfo_data[i].wType);
ok (dbcolumninfo[i].bPrecision == colinfo_data[i].bPrecision, "got %d/%d", dbcolumninfo[i].bPrecision, colinfo_data[i].bPrecision);
ok (dbcolumninfo[i].bScale == colinfo_data[i].bScale, "got %d/%d", dbcolumninfo[i].bScale, colinfo_data[i].bScale);
@@ -672,15 +672,15 @@ static void test_enumeration(void)
}
hr = IRowset_QueryInterface(rowset, &IID_IAccessor, (void**)&accessor);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
/* Request only SOURCES_NAME column */
hr = IAccessor_CreateAccessor(accessor, DBACCESSOR_ROWDATA, 1, &bindings, 0, &hacc, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(hacc != 0, "got %Ix\n", hacc);
hr = IAccessor_ReleaseAccessor(accessor, hacc, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IAccessor_Release(accessor);
--
2.34.1
1
0
Feb. 1, 2022
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msdasql/session.c | 68 +++++++++++++++++++++++++++++++++++
dlls/msdasql/tests/provider.c | 5 ++-
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c
index abd8252218d..0f74c126138 100644
--- a/dlls/msdasql/session.c
+++ b/dlls/msdasql/session.c
@@ -44,6 +44,7 @@ struct msdasql_session
ISessionProperties ISessionProperties_iface;
IDBCreateCommand IDBCreateCommand_iface;
ITransactionJoin ITransactionJoin_iface;
+ ITransaction ITransaction_iface;
LONG refs;
IUnknown *datasource;
@@ -81,6 +82,11 @@ static inline struct msdasql_session *impl_from_ITransactionJoin( ITransactionJo
return CONTAINING_RECORD( iface, struct msdasql_session, ITransactionJoin_iface );
}
+static inline struct msdasql_session *impl_from_ITransaction( ITransaction *iface )
+{
+ return CONTAINING_RECORD( iface, struct msdasql_session, ITransaction_iface );
+}
+
static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
@@ -118,6 +124,11 @@ static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void
TRACE("(%p)->(ITransactionJoin %p)\n", iface, ppv);
*ppv = &session->ITransactionJoin_iface;
}
+ else if(IsEqualGUID(&IID_ITransaction, riid))
+ {
+ TRACE("(%p)->(ITransaction %p)\n", iface, ppv);
+ *ppv = &session->ITransaction_iface;
+ }
else if(IsEqualGUID(&IID_IBindResource, riid))
{
TRACE("(%p)->(IID_IBindResource not support)\n", iface);
@@ -1248,6 +1259,61 @@ static const ITransactionJoinVtbl transactionjoinVtbl =
transjoin_JoinTransaction
};
+static HRESULT WINAPI transaction_QueryInterface(ITransaction *iface, REFIID riid, void **out)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+ return IUnknown_QueryInterface(&session->session_iface, riid, out);
+}
+
+static ULONG WINAPI transaction_AddRef(ITransaction *iface)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+ return IUnknown_AddRef(&session->session_iface);
+}
+
+static ULONG WINAPI transaction_Release(ITransaction *iface)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+ return IUnknown_Release(&session->session_iface);
+}
+
+static HRESULT WINAPI transaction_Commit(ITransaction *iface, BOOL retaining, DWORD tc, DWORD rm)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+
+ FIXME("%p, %d, %ld, %ld\n", session, retaining, tc, rm);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transaction_Abort(ITransaction *iface, BOID *reason, BOOL retaining, BOOL async)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+
+ FIXME("%p, %p, %d, %d\n", session, reason, retaining, async);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transaction_GetTransactionInfo(ITransaction *iface, XACTTRANSINFO *info)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+
+ FIXME("%p, %p\n", session, info);
+
+ return E_NOTIMPL;
+}
+
+static const ITransactionVtbl transactionVtbl =
+{
+ transaction_QueryInterface,
+ transaction_AddRef,
+ transaction_Release,
+ transaction_Commit,
+ transaction_Abort,
+ transaction_GetTransactionInfo
+};
+
HRESULT create_db_session(REFIID riid, IUnknown *datasource, HDBC hdbc, void **unk)
{
struct msdasql_session *session;
@@ -1263,6 +1329,8 @@ HRESULT create_db_session(REFIID riid, IUnknown *datasource, HDBC hdbc, void **u
session->ISessionProperties_iface.lpVtbl = &propertiesVtbl;
session->IDBCreateCommand_iface.lpVtbl = &createcommandVtbl;
session->ITransactionJoin_iface.lpVtbl = &transactionjoinVtbl;
+ session->ITransaction_iface.lpVtbl = &transactionVtbl;
+
IUnknown_QueryInterface(datasource, &IID_IUnknown, (void**)&session->datasource);
session->refs = 1;
session->hdbc = hdbc;
diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c
index ee81ad1d311..22fbf26c107 100644
--- a/dlls/msdasql/tests/provider.c
+++ b/dlls/msdasql/tests/provider.c
@@ -481,9 +481,8 @@ static void test_sessions(void)
IGetDataSource_Release(datasource);
hr = IUnknown_QueryInterface(session, &IID_ITransaction, (void**)&transaction);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- if(hr == S_OK)
- ITransaction_Release(transaction);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ITransaction_Release(transaction);
hr = IUnknown_QueryInterface(session, &IID_ITransactionLocal, (void**)&local);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
--
2.34.1
1
0
[PATCH 1/3] msdasql: Fix printf format warnings with long types.
by Alistair Leslie-Hughes Feb. 1, 2022
by Alistair Leslie-Hughes Feb. 1, 2022
Feb. 1, 2022
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msdasql/Makefile.in | 1 -
dlls/msdasql/msdasql_main.c | 42 +++++++++++++-------------
dlls/msdasql/session.c | 60 ++++++++++++++++++-------------------
3 files changed, 51 insertions(+), 52 deletions(-)
diff --git a/dlls/msdasql/Makefile.in b/dlls/msdasql/Makefile.in
index 3e9c482dbd3..0f5453131f6 100644
--- a/dlls/msdasql/Makefile.in
+++ b/dlls/msdasql/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = msdasql.dll
IMPORTS = uuid ole32 oleaut32 odbc32
diff --git a/dlls/msdasql/msdasql_main.c b/dlls/msdasql/msdasql_main.c
index d6c833c4c14..3e1af95b1a7 100644
--- a/dlls/msdasql/msdasql_main.c
+++ b/dlls/msdasql/msdasql_main.c
@@ -188,7 +188,7 @@ static HRESULT convert_dbproperty_mode(const WCHAR *src, VARIANT *dest)
{
V_VT(dest) = VT_I4;
V_I4(dest) = prop->value;
- TRACE("%s = %#x\n", debugstr_w(src), prop->value);
+ TRACE("%s = %#lx\n", debugstr_w(src), prop->value);
return S_OK;
}
@@ -303,7 +303,7 @@ static ULONG WINAPI msdsql_AddRef(IUnknown *iface)
struct msdasql *provider = impl_from_IUnknown(iface);
ULONG ref = InterlockedIncrement(&provider->ref);
- TRACE("(%p) ref=%u\n", provider, ref);
+ TRACE("(%p) ref=%lu\n", provider, ref);
return ref;
}
@@ -313,7 +313,7 @@ static ULONG WINAPI msdsql_Release(IUnknown *iface)
struct msdasql *provider = impl_from_IUnknown(iface);
ULONG ref = InterlockedDecrement(&provider->ref);
- TRACE("(%p) ref=%u\n", provider, ref);
+ TRACE("(%p) ref=%lu\n", provider, ref);
if (!ref)
{
@@ -362,7 +362,7 @@ static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropert
int i, j, k;
DBPROPSET *propset;
- TRACE("(%p)->(%d %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
+ TRACE("(%p)->(%ld %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
*pcPropertySets = 1;
@@ -397,7 +397,7 @@ static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropert
for (i=0; i < cPropertyIDSets; i++)
{
- TRACE("Property id %d (count %d, set %s)\n", i, rgPropertyIDSets[i].cPropertyIDs,
+ TRACE("Property id %d (count %ld, set %s)\n", i, rgPropertyIDSets[i].cPropertyIDs,
debugstr_guid(&rgPropertyIDSets[i].guidPropertySet));
propset->cProperties = rgPropertyIDSets[i].cPropertyIDs;
@@ -434,7 +434,7 @@ static HRESULT WINAPI dbprops_GetPropertyInfo(IDBProperties *iface, ULONG cPrope
int size = 1;
OLECHAR *ptr;
- TRACE("(%p)->(%d %p %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
+ TRACE("(%p)->(%ld %p %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
prgPropertyInfoSets, ppDescBuffer);
infoset = CoTaskMemAlloc(sizeof(DBPROPINFOSET));
@@ -474,7 +474,7 @@ static HRESULT WINAPI dbprops_SetProperties(IDBProperties *iface, ULONG cPropert
struct msdasql *provider = impl_from_IDBProperties(iface);
int i, j, k;
- TRACE("(%p)->(%d %p)\n", provider, cPropertySets, rgPropertySets);
+ TRACE("(%p)->(%ld %p)\n", provider, cPropertySets, rgPropertySets);
for (i=0; i < cPropertySets; i++)
{
@@ -757,7 +757,7 @@ static ULONG WINAPI msdasql_enum_AddRef(ISourcesRowset *iface)
struct msdasql_enum *enumerator = msdasql_enum_from_ISourcesRowset(iface);
ULONG ref = InterlockedIncrement(&enumerator->ref);
- TRACE("(%p) ref=%u\n", enumerator, ref);
+ TRACE("(%p) ref=%lu\n", enumerator, ref);
return ref;
}
@@ -767,7 +767,7 @@ static ULONG WINAPI msdasql_enum_Release(ISourcesRowset *iface)
struct msdasql_enum *enumerator = msdasql_enum_from_ISourcesRowset(iface);
ULONG ref = InterlockedDecrement(&enumerator->ref);
- TRACE("(%p) ref=%u\n", enumerator, ref);
+ TRACE("(%p) ref=%lu\n", enumerator, ref);
if (!ref)
{
@@ -825,7 +825,7 @@ static ULONG WINAPI enum_rowset_AddRef(IRowset *iface)
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
LONG refs = InterlockedIncrement( &rowset->ref );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
return refs;
}
@@ -833,7 +833,7 @@ static ULONG WINAPI enum_rowset_Release(IRowset *iface)
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
LONG refs = InterlockedDecrement( &rowset->ref );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
if (!refs)
{
TRACE( "destroying %p\n", rowset );
@@ -847,7 +847,7 @@ static HRESULT WINAPI enum_rowset_AddRefRows(IRowset *iface, DBCOUNTITEM count,
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
+ FIXME("%p, %Iu, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
return E_NOTIMPL;
}
@@ -856,7 +856,7 @@ static HRESULT WINAPI enum_rowset_GetData(IRowset *iface, HROW row, HACCESSOR ac
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %p\n", rowset, row, accessor, data);
+ FIXME("%p, %Iu, %Iu, %p\n", rowset, row, accessor, data);
return E_NOTIMPL;
}
@@ -866,7 +866,7 @@ static HRESULT WINAPI enum_rowset_GetNextRows(IRowset *iface, HCHAPTER reserved,
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %ld, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
+ FIXME("%p, %Iu, %Iu, %Iu, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
if (!obtained || !rows)
return E_INVALIDARG;
@@ -884,7 +884,7 @@ static HRESULT WINAPI enum_rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM count,
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
+ FIXME("%p, %Iu, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
return S_OK;
}
@@ -893,7 +893,7 @@ static HRESULT WINAPI enum_rowset_RestartPosition(IRowset *iface, HCHAPTER reser
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld\n", rowset, reserved);
+ FIXME("%p, %Iu\n", rowset, reserved);
return S_OK;
}
@@ -931,7 +931,7 @@ static ULONG WINAPI enum_rs_accessor_Release(IAccessor *iface)
static HRESULT WINAPI enum_rs_accessor_AddRefAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Iu, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
@@ -941,7 +941,7 @@ static HRESULT WINAPI enum_rs_accessor_CreateAccessor(IAccessor *iface, DBACCESS
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p 0x%08x, %lu, %p, %lu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
+ FIXME("%p 0x%08lx, %Iu, %p, %Iu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
if (accessor)
*accessor = 0xdeadbeef;
@@ -953,7 +953,7 @@ static HRESULT WINAPI enum_rs_accessor_GetBindings(IAccessor *iface, HACCESSOR a
DBACCESSORFLAGS *flags, DBCOUNTITEM *count, DBBINDING **bindings)
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p %lu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
+ FIXME("%p, %Iu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
return E_NOTIMPL;
}
@@ -961,7 +961,7 @@ static HRESULT WINAPI enum_rs_accessor_ReleaseAccessor(IAccessor *iface, HACCESS
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Iu, %p\n", rowset, accessor, count);
if (count)
*count = 0;
@@ -987,7 +987,7 @@ static HRESULT WINAPI msdasql_enum_GetSourcesRowset(ISourcesRowset *iface, IUnkn
struct msdasql_enum_rowset *enum_rs;
HRESULT hr;
- TRACE("(%p) %p, %s, %d, %p, %p\n", enumerator, outer, debugstr_guid(riid), sets, properties, rowset);
+ TRACE("(%p) %p, %s, %lu, %p, %p\n", enumerator, outer, debugstr_guid(riid), sets, properties, rowset);
enum_rs = malloc(sizeof(*enum_rs));
enum_rs->IRowset_iface.lpVtbl = &enum_rowset_vtbl;
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c
index e58d152a418..abd8252218d 100644
--- a/dlls/msdasql/session.c
+++ b/dlls/msdasql/session.c
@@ -143,7 +143,7 @@ static ULONG WINAPI session_AddRef(IUnknown *iface)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
LONG refs = InterlockedIncrement( &session->refs );
- TRACE( "%p new refcount %d\n", session, refs );
+ TRACE( "%p new refcount %ld\n", session, refs );
return refs;
}
@@ -151,7 +151,7 @@ static ULONG WINAPI session_Release(IUnknown *iface)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
LONG refs = InterlockedDecrement( &session->refs );
- TRACE( "%p new refcount %d\n", session, refs );
+ TRACE( "%p new refcount %ld\n", session, refs );
if (!refs)
{
TRACE( "destroying %p\n", session );
@@ -230,7 +230,7 @@ HRESULT WINAPI openrowset_OpenRowset(IOpenRowset *iface, IUnknown *pUnkOuter, DB
DBID *index, REFIID riid, ULONG count, DBPROPSET propertysets[], IUnknown **rowset)
{
struct msdasql_session *session = impl_from_IOpenRowset( iface );
- FIXME("%p, %p, %p %p %s, %d %p %p stub\n", session, pUnkOuter, table, index, debugstr_guid(riid),
+ FIXME("%p, %p, %p %p %s, %ld %p %p stub\n", session, pUnkOuter, table, index, debugstr_guid(riid),
count, propertysets, rowset);
return E_NOTIMPL;
@@ -267,7 +267,7 @@ static HRESULT WINAPI properties_GetProperties(ISessionProperties *iface, ULONG
const DBPROPIDSET id_sets[], ULONG *count, DBPROPSET **sets)
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
- FIXME("%p %d %p %p %p\n", session, set_count, id_sets, count, sets);
+ FIXME("%p %lu %p %p %p\n", session, set_count, id_sets, count, sets);
return E_NOTIMPL;
}
@@ -276,7 +276,7 @@ static HRESULT WINAPI properties_SetProperties(ISessionProperties *iface, ULONG
DBPROPSET sets[])
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
- FIXME("%p %d %p\n", session, count, sets);
+ FIXME("%p %lu %p\n", session, count, sets);
return S_OK;
}
@@ -426,7 +426,7 @@ static ULONG WINAPI command_AddRef(ICommandText *iface)
{
struct command *command = impl_from_ICommandText( iface );
LONG refs = InterlockedIncrement( &command->refs );
- TRACE( "%p new refcount %d\n", command, refs );
+ TRACE( "%p new refcount %ld\n", command, refs );
return refs;
}
@@ -434,7 +434,7 @@ static ULONG WINAPI command_Release(ICommandText *iface)
{
struct command *command = impl_from_ICommandText( iface );
LONG refs = InterlockedDecrement( &command->refs );
- TRACE( "%p new refcount %d\n", command, refs );
+ TRACE( "%p new refcount %ld\n", command, refs );
if (!refs)
{
TRACE( "destroying %p\n", command );
@@ -551,7 +551,7 @@ static ULONG WINAPI msdasql_rowset_AddRef(IRowset *iface)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
LONG refs = InterlockedIncrement( &rowset->refs );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
return refs;
}
@@ -559,7 +559,7 @@ static ULONG WINAPI msdasql_rowset_Release(IRowset *iface)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
LONG refs = InterlockedDecrement( &rowset->refs );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
if (!refs)
{
TRACE( "destroying %p\n", rowset );
@@ -576,14 +576,14 @@ static HRESULT WINAPI msdasql_rowset_AddRefRows(IRowset *iface, DBCOUNTITEM coun
const HROW rows[], DBREFCOUNT ref_counts[], DBROWSTATUS status[])
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
+ FIXME("%p, %Id, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
return E_NOTIMPL;
}
static HRESULT WINAPI msdasql_rowset_GetData(IRowset *iface, HROW row, HACCESSOR accessor, void *data)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %p\n", rowset, row, accessor, data);
+ FIXME("%p, %Id, %Id, %p\n", rowset, row, accessor, data);
return E_NOTIMPL;
}
@@ -591,7 +591,7 @@ static HRESULT WINAPI msdasql_rowset_GetNextRows(IRowset *iface, HCHAPTER reserv
DBROWCOUNT count, DBCOUNTITEM *obtained, HROW **rows)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %ld, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
+ FIXME("%p, %Id, %Id, %Id, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
return E_NOTIMPL;
}
@@ -600,14 +600,14 @@ static HRESULT WINAPI msdasql_rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM cou
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
+ FIXME("%p, %Id, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
return E_NOTIMPL;
}
static HRESULT WINAPI msdasql_rowset_RestartPosition(IRowset *iface, HCHAPTER reserved)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld\n", rowset, reserved);
+ FIXME("%p, %Id\n", rowset, reserved);
return E_NOTIMPL;
}
@@ -645,7 +645,7 @@ static HRESULT WINAPI rowset_info_GetProperties(IRowsetInfo *iface, const ULONG
const DBPROPIDSET propertyidsets[], ULONG *out_count, DBPROPSET **propertysets)
{
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
- FIXME("%p, %d, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
+ FIXME("%p, %lu, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
return E_NOTIMPL;
}
@@ -653,7 +653,7 @@ static HRESULT WINAPI rowset_info_GetReferencedRowset(IRowsetInfo *iface, DBORDI
REFIID riid, IUnknown **unk)
{
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
- FIXME("%p, %ld, %s, %p\n", rowset, ordinal, debugstr_guid(riid), unk);
+ FIXME("%p, %Id, %s, %p\n", rowset, ordinal, debugstr_guid(riid), unk);
return E_NOTIMPL;
}
@@ -713,7 +713,7 @@ static HRESULT WINAPI rowset_colsinfo_MapColumnIDs(IColumnsInfo *iface, DBORDINA
const DBID *dbids, DBORDINAL *columns)
{
struct msdasql_rowset *rowset = rowset_impl_from_IColumnsInfo( iface );
- FIXME("%p, %lu, %p, %p\n", rowset, column_ids, dbids, columns);
+ FIXME("%p, %Id, %p, %p\n", rowset, column_ids, dbids, columns);
return E_NOTIMPL;
}
@@ -747,7 +747,7 @@ static ULONG WINAPI rowset_accessor_Release(IAccessor *iface)
static HRESULT WINAPI rowset_accessor_AddRefAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Id, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
@@ -756,7 +756,7 @@ static HRESULT WINAPI rowset_accessor_CreateAccessor(IAccessor *iface, DBACCESSO
DBBINDSTATUS status[])
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p 0x%08x, %lu, %p, %lu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
+ FIXME("%p, 0x%08lx, %Id, %p, %Id, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
return E_NOTIMPL;
}
@@ -764,14 +764,14 @@ static HRESULT WINAPI rowset_accessor_GetBindings(IAccessor *iface, HACCESSOR ac
DBACCESSORFLAGS *flags, DBCOUNTITEM *count, DBBINDING **bindings)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p %lu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
+ FIXME("%p, %Id, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
return E_NOTIMPL;
}
static HRESULT WINAPI rowset_accessor_ReleaseAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Id, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
@@ -815,7 +815,7 @@ static HRESULT WINAPI column_rs_GetColumnsRowset(IColumnsRowset *iface, IUnknown
const DBID columns[], REFIID riid, ULONG property_cnt, DBPROPSET property_sets[], IUnknown **unk_rs)
{
struct msdasql_rowset *rowset = impl_from_IColumnsRowset( iface );
- FIXME("(%p)->(%p %ld %p %s %u, %p %p): stub\n", rowset, outer, count, columns, debugstr_guid(riid),
+ FIXME("(%p)->(%p, %Id, %p, %s, %lu, %p, %p): stub\n", rowset, outer, count, columns, debugstr_guid(riid),
property_cnt, property_sets, unk_rs);
return E_NOTIMPL;
}
@@ -953,7 +953,7 @@ static HRESULT WINAPI command_prop_GetProperties(ICommandProperties *iface, ULON
const DBPROPIDSET propertyidsets[], ULONG *sets_cnt, DBPROPSET **propertyset)
{
struct command *command = impl_from_ICommandProperties( iface );
- FIXME("%p %d %p %p %p\n", command, count, propertyidsets, sets_cnt, propertyset);
+ FIXME("%p %lu %p %p %p\n", command, count, propertyidsets, sets_cnt, propertyset);
return E_NOTIMPL;
}
@@ -961,7 +961,7 @@ static HRESULT WINAPI command_prop_SetProperties(ICommandProperties *iface, ULON
DBPROPSET propertyset[])
{
struct command *command = impl_from_ICommandProperties( iface );
- FIXME("%p %p\n", command, propertyset);
+ FIXME("%p, %lu, %p\n", command, count, propertyset);
return S_OK;
}
@@ -1004,7 +1004,7 @@ static HRESULT WINAPI colsinfo_MapColumnIDs(IColumnsInfo *iface, DBORDINAL colum
const DBID *dbids, DBORDINAL *columns)
{
struct command *command = impl_from_IColumnsInfo( iface );
- FIXME("%p, %lu, %p, %p\n", command, column_ids, dbids, columns);
+ FIXME("%p, %Iu, %p, %p\n", command, column_ids, dbids, columns);
return E_NOTIMPL;
}
@@ -1038,7 +1038,7 @@ static ULONG WINAPI converttype_Release(IConvertType *iface)
static HRESULT WINAPI converttype_CanConvert(IConvertType *iface, DBTYPE from, DBTYPE to, DBCONVERTFLAGS flags)
{
struct command *command = impl_from_IConvertType( iface );
- FIXME("%p, %u, %d, 0x%08x\n", command, from, to, flags);
+ FIXME("%p, %u, %d, 0x%08lx\n", command, from, to, flags);
return E_NOTIMPL;
}
@@ -1073,7 +1073,7 @@ static HRESULT WINAPI commandprepare_Prepare(ICommandPrepare *iface, ULONG runs)
struct command *command = impl_from_ICommandPrepare( iface );
RETCODE ret;
- TRACE("%p, %u\n", command, runs);
+ TRACE("%p, %lu\n", command, runs);
if (!command->query)
return DB_E_NOCOMMAND;
@@ -1138,7 +1138,7 @@ static HRESULT WINAPI cmd_with_params_MapParameterNames(ICommandWithParameters *
LPCWSTR names[], DB_LPARAMS ordinals[])
{
struct command *command = impl_from_ICommandWithParameters( iface );
- FIXME("%p, %ld, %p, %p\n", command, uparams, names, ordinals);
+ FIXME("%p, %Iu, %p, %p\n", command, uparams, names, ordinals);
return E_NOTIMPL;
}
@@ -1146,7 +1146,7 @@ static HRESULT WINAPI cmd_with_params_SetParameterInfo(ICommandWithParameters *i
const DB_UPARAMS ordinals[], const DBPARAMBINDINFO bindinfo[])
{
struct command *command = impl_from_ICommandWithParameters( iface );
- FIXME("%p, %ld, %p, %p\n", command, uparams, ordinals, bindinfo);
+ FIXME("%p, %Iu, %p, %p\n", command, uparams, ordinals, bindinfo);
return E_NOTIMPL;
}
@@ -1234,7 +1234,7 @@ static HRESULT WINAPI transjoin_JoinTransaction(ITransactionJoin *iface, IUnknow
{
struct msdasql_session *session = impl_from_ITransactionJoin( iface );
- FIXME("%p, %p, %d, 0x%08x, %p\n", session, unk, level, flags, options);
+ FIXME("%p, %p, %lu, 0x%08lx, %p\n", session, unk, level, flags, options);
return E_NOTIMPL;
}
--
2.34.1
1
0
Feb. 1, 2022
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/hidclass.sys/Makefile.in | 1 -
dlls/hidclass.sys/device.c | 10 +++++-----
dlls/hidclass.sys/pnp.c | 20 ++++++++++----------
3 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in
index b597589dc53..788828ad66a 100644
--- a/dlls/hidclass.sys/Makefile.in
+++ b/dlls/hidclass.sys/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = hidclass.sys
IMPORTLIB = hidclass
IMPORTS = hal ntoskrnl user32 hidparse
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c
index 0744865f8f7..c252125d8eb 100644
--- a/dlls/hidclass.sys/device.c
+++ b/dlls/hidclass.sys/device.c
@@ -351,7 +351,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
if (!(report = find_report_with_type_and_id( ext, HidP_Input, buffer[0], FALSE )))
WARN( "dropping unknown input id %u\n", buffer[0] );
else if (!polled && io.Information < report->InputLength)
- WARN( "dropping short report, len %u expected %u\n", (ULONG)io.Information, report->InputLength );
+ WARN( "dropping short report, len %Iu expected %u\n", io.Information, report->InputLength );
else
{
packet->reportId = buffer[0];
@@ -364,7 +364,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
res = WaitForSingleObject(ext->u.pdo.halt_event, polled ? ext->u.pdo.poll_interval : 0);
} while (res == WAIT_TIMEOUT);
- TRACE("device thread exiting, res %#x\n", res);
+ TRACE( "device thread exiting, res %#lx\n", res );
return 1;
}
@@ -561,7 +561,7 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Information = 0;
- TRACE("device %p ioctl(%x)\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode);
+ TRACE( "device %p code %#lx\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode );
KeAcquireSpinLock(&ext->u.pdo.lock, &irql);
removed = ext->u.pdo.removed;
@@ -661,8 +661,8 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp)
default:
{
ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode;
- FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n",
- code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3);
+ FIXME( "Unsupported ioctl %#lx (device=%lx access=%lx func=%lx method=%lx)\n", code,
+ code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3 );
irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
break;
}
diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
index 6dafa1b95af..fec51af40a9 100644
--- a/dlls/hidclass.sys/pnp.c
+++ b/dlls/hidclass.sys/pnp.c
@@ -143,13 +143,13 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
if ((status = get_device_id(bus_pdo, BusQueryDeviceID, device_id)))
{
- ERR("Failed to get PDO device id, status %#x.\n", status);
+ ERR( "Failed to get PDO device id, status %#lx.\n", status );
return status;
}
if ((status = get_device_id(bus_pdo, BusQueryInstanceID, instance_id)))
{
- ERR("Failed to get PDO instance id, status %#x.\n", status);
+ ERR( "Failed to get PDO instance id, status %#lx.\n", status );
return status;
}
@@ -159,7 +159,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
if ((status = IoCreateDevice(driver, sizeof(*ext) + minidriver->minidriver.DeviceExtensionSize,
NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &fdo)))
{
- ERR("Failed to create bus FDO, status %#x.\n", status);
+ ERR( "Failed to create bus FDO, status %#lx.\n", status );
return status;
}
ext = fdo->DeviceExtension;
@@ -177,7 +177,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
status = minidriver->AddDevice(minidriver->minidriver.DriverObject, fdo);
if (status != STATUS_SUCCESS)
{
- ERR("Minidriver AddDevice failed (%x)\n",status);
+ ERR( "Minidriver AddDevice failed (%lx)\n", status );
IoDeleteDevice(fdo);
return status;
}
@@ -206,7 +206,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
call_minidriver( IOCTL_HID_GET_DEVICE_ATTRIBUTES, fdo, NULL, 0, &attr, sizeof(attr), &io );
if (io.Status != STATUS_SUCCESS)
{
- ERR( "Minidriver failed to get attributes, status %#x.\n", io.Status );
+ ERR( "Minidriver failed to get attributes, status %#lx.\n", io.Status );
return;
}
@@ -215,7 +215,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
RtlInitUnicodeString(&string, pdo_name);
if ((status = IoCreateDevice(fdo->DriverObject, sizeof(*pdo_ext), &string, 0, 0, FALSE, &child_pdo)))
{
- ERR( "Failed to create child PDO, status %#x.\n", io.Status );
+ ERR( "Failed to create child PDO, status %#lx.\n", io.Status );
return;
}
fdo_ext->u.fdo.child_pdo = child_pdo;
@@ -236,7 +236,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
call_minidriver( IOCTL_HID_GET_DEVICE_DESCRIPTOR, fdo, NULL, 0, &descriptor, sizeof(descriptor), &io );
if (io.Status != STATUS_SUCCESS)
{
- ERR("Cannot get Device Descriptor(%x)\n",status);
+ ERR( "Cannot get Device Descriptor, status %#lx\n", status );
IoDeleteDevice(child_pdo);
return;
}
@@ -256,7 +256,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
descriptor.DescriptorList[i].wReportLength, &io );
if (io.Status != STATUS_SUCCESS)
{
- ERR("Cannot get Report Descriptor(%x)\n",status);
+ ERR( "Cannot get Report Descriptor, status %#lx\n", status );
free(reportDescriptor);
IoDeleteDevice(child_pdo);
return;
@@ -290,7 +290,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32,
sizeof(pdo_ext->u.pdo.rawinput_handle), &pdo_ext->u.pdo.rawinput_handle)))
{
- ERR("Failed to set device handle property, status %x\n", status);
+ ERR( "Failed to set device handle property, status %#lx\n", status );
IoDeleteDevice(child_pdo);
return;
}
@@ -444,7 +444,7 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
case IRP_MN_START_DEVICE:
if ((status = IoRegisterDeviceInterface(device, ext->class_guid, NULL, &ext->u.pdo.link_name)))
{
- ERR("Failed to register interface, status %#x.\n", status);
+ ERR( "Failed to register interface, status %#lx.\n", status );
break;
}
--
2.34.1
1
2
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/dwrite/font.c | 2 +-
dlls/dwrite/main.c | 3 ++-
dlls/dwrite/opentype.c | 5 +++--
dlls/dwrite/shape.c | 4 ++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index cbc0434b72d..4b32bf1e0de 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -5084,7 +5084,7 @@ HRESULT get_eudc_fontcollection(IDWriteFactory7 *factory, IDWriteFontCollection3
struct dwrite_fontcollection *collection;
WCHAR eudckeypathW[16];
HKEY eudckey;
- DWORD index;
+ UINT32 index;
BOOL exists;
LONG retval;
HRESULT hr;
diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c
index ab53d5cb80d..26415201d91 100644
--- a/dlls/dwrite/main.c
+++ b/dlls/dwrite/main.c
@@ -1515,8 +1515,9 @@ static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory7 *if
static HRESULT create_system_path_list(WCHAR ***ret, unsigned int *ret_count)
{
- unsigned int index = 0, value_size, name_count, max_name_count, type, data_size;
+ unsigned int index = 0, value_size, max_name_count;
WCHAR **paths = NULL, *name, *value = NULL;
+ DWORD name_count, type, data_size;
size_t capacity = 0, count = 0;
HKEY hkey;
LONG r;
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 452b00240b8..5bac32f9ee7 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4607,8 +4607,8 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
next_bit = global_bit_shift + 1;
for (i = 0; i < features->count; ++i)
{
- unsigned int bits_needed;
BOOL found = FALSE;
+ DWORD bits_needed;
feature = &features->features[i];
@@ -5077,7 +5077,8 @@ static BOOL opentype_layout_apply_gsub_alt_substitution(struct scriptshaping_con
if (format == 1)
{
const struct ot_gsub_altsubst_format1 *format1 = table_read_ensure(table, subtable_offset, sizeof(*format1));
- unsigned int shift, alt_index;
+ DWORD shift;
+ unsigned int alt_index;
UINT16 set_offset;
coverage = table_read_be_word(table, subtable_offset + FIELD_OFFSET(struct ot_gsub_altsubst_format1, coverage));
diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c
index 177ad1d06fe..bf80d686052 100644
--- a/dlls/dwrite/shape.c
+++ b/dlls/dwrite/shape.c
@@ -67,10 +67,10 @@ void release_scriptshaping_cache(struct scriptshaping_cache *cache)
free(cache);
}
-static unsigned int shape_select_script(const struct scriptshaping_cache *cache, DWORD kind, const DWORD *scripts,
+static unsigned int shape_select_script(const struct scriptshaping_cache *cache, DWORD kind, const unsigned int *scripts,
unsigned int *script_index)
{
- static const DWORD fallback_scripts[] =
+ static const unsigned int fallback_scripts[] =
{
DWRITE_MAKE_OPENTYPE_TAG('D','F','L','T'),
DWRITE_MAKE_OPENTYPE_TAG('d','f','l','t'),
--
2.34.1
1
0
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/ws2_32/tests/protocol.c | 99 ++++++++++++++++++++++++++++++++++--
1 file changed, 95 insertions(+), 4 deletions(-)
diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c
index 5597e3df854..a23cf51a8bd 100644
--- a/dlls/ws2_32/tests/protocol.c
+++ b/dlls/ws2_32/tests/protocol.c
@@ -2815,10 +2815,86 @@ static void test_WSCGetProviderPath(void)
ok(len == 256, "Got unexpected len %d.\n", len);
}
+static void test_startup(void)
+{
+ unsigned int i;
+ WSADATA data;
+ int ret;
+
+ static const struct
+ {
+ WORD version;
+ WORD ret_version;
+ }
+ tests[] =
+ {
+ {MAKEWORD(0, 0), MAKEWORD(2, 2)},
+ {MAKEWORD(0, 1), MAKEWORD(2, 2)},
+ {MAKEWORD(1, 0), MAKEWORD(1, 0)},
+ {MAKEWORD(1, 1), MAKEWORD(1, 1)},
+ {MAKEWORD(1, 2), MAKEWORD(1, 1)},
+ {MAKEWORD(1, 0xff), MAKEWORD(1, 1)},
+ {MAKEWORD(2, 0), MAKEWORD(2, 0)},
+ {MAKEWORD(2, 1), MAKEWORD(2, 1)},
+ {MAKEWORD(2, 2), MAKEWORD(2, 2)},
+ {MAKEWORD(2, 3), MAKEWORD(2, 2)},
+ {MAKEWORD(2, 0xff), MAKEWORD(2, 2)},
+ {MAKEWORD(3, 0), MAKEWORD(2, 2)},
+ {MAKEWORD(0xff, 0), MAKEWORD(2, 2)},
+ };
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ winetest_push_context("Version %#x", tests[i].version);
+
+ memset(&data, 0xcc, sizeof(data));
+ data.lpVendorInfo = (void *)0xdeadbeef;
+ ret = WSAStartup(tests[i].version, &data);
+ ok(ret == (LOBYTE(tests[i].version) ? 0 : WSAVERNOTSUPPORTED), "got %d\n", ret);
+ todo_wine_if (tests[i].version != tests[i].ret_version)
+ ok(data.wVersion == tests[i].ret_version, "got version %#x\n", data.wVersion);
+ if (!ret)
+ {
+ ret = WSAStartup(tests[i].version, &data);
+ ok(!ret, "got %d\n", ret);
+
+ WSASetLastError(0xdeadbeef);
+ ret = WSACleanup();
+ ok(!ret, "got %d\n", ret);
+ todo_wine ok(!WSAGetLastError(), "got error %u\n", WSAGetLastError());
+
+ WSASetLastError(0xdeadbeef);
+ ret = WSACleanup();
+ ok(!ret, "got %d\n", ret);
+ todo_wine ok(!WSAGetLastError(), "got error %u\n", WSAGetLastError());
+ }
+ ok(data.lpVendorInfo == (void *)0xdeadbeef, "got vendor info %p\n", data.lpVendorInfo);
+ todo_wine_if (ret)
+ {
+ ok(data.wHighVersion == 0x202, "got maximum version %#x\n", data.wHighVersion);
+ ok(!strcmp(data.szDescription, "WinSock 2.0"), "got description %s\n", debugstr_a(data.szDescription));
+ ok(!strcmp(data.szSystemStatus, "Running"), "got status %s\n", debugstr_a(data.szSystemStatus));
+ }
+ todo_wine ok(data.iMaxSockets == (LOBYTE(tests[i].version) == 1 ? 32767 : 0), "got maximum sockets %u\n", data.iMaxSockets);
+ todo_wine ok(data.iMaxUdpDg == (LOBYTE(tests[i].version) == 1 ? 65467 : 0), "got maximum datagram size %u\n", data.iMaxUdpDg);
+
+ WSASetLastError(0xdeadbeef);
+ ret = WSACleanup();
+ ok(ret == -1, "got %d\n", ret);
+ ok(WSAGetLastError() == WSANOTINITIALISED, "got error %u\n", WSAGetLastError());
+
+ ret = WSAStartup(tests[i].version, NULL);
+ todo_wine_if (LOBYTE(tests[i].version))
+ ok(ret == (LOBYTE(tests[i].version) ? WSAEFAULT : WSAVERNOTSUPPORTED), "got %d\n", ret);
+
+ winetest_pop_context();
+ }
+}
+
START_TEST( protocol )
{
WSADATA data;
- WORD version = MAKEWORD( 2, 2 );
+ int ret;
pFreeAddrInfoExW = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "FreeAddrInfoExW");
pGetAddrInfoExOverlappedResult = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "GetAddrInfoExOverlappedResult");
@@ -2830,7 +2906,8 @@ START_TEST( protocol )
pInetPtonW = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "InetPtonW");
pWSCGetProviderInfo = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "WSCGetProviderInfo");
- if (WSAStartup( version, &data )) return;
+ ret = WSAStartup(0x202, &data);
+ ok(!ret, "got %d\n", ret);
test_WSAEnumProtocolsA();
test_WSAEnumProtocolsW();
@@ -2839,8 +2916,6 @@ START_TEST( protocol )
test_getservbyname();
test_WSALookupService();
- test_WSAAsyncGetServByPort();
- test_WSAAsyncGetServByName();
test_inet_ntoa();
test_inet_pton();
@@ -2862,4 +2937,20 @@ START_TEST( protocol )
test_WSAEnumNameSpaceProvidersW();
test_WSCGetProviderInfo();
test_WSCGetProviderPath();
+
+ WSACleanup();
+
+ /* These tests are finnicky. If WSAStartup() is ever called with a
+ * version below 2.2, it causes getaddrinfo() to behave differently. */
+
+ test_startup();
+
+ /* And if WSAAsyncGetServBy*() is ever called, it somehow causes
+ * WSAStartup() to succeed with 0.1 instead of failing. */
+
+ ret = WSAStartup(0x202, &data);
+ ok(!ret, "got %d\n", ret);
+
+ test_WSAAsyncGetServByPort();
+ test_WSAAsyncGetServByName();
}
--
2.34.1
2
6
[PATCH 12/22] taskschd/tests: Avoid "misleading indentation" warnings.
by Fabian Maurer Feb. 1, 2022
by Fabian Maurer Feb. 1, 2022
Feb. 1, 2022
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
dlls/taskschd/tests/scheduler.c | 36 ++++++++++++++++-----------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c
index c03ecd35b97..e7b39e5fdaf 100644
--- a/dlls/taskschd/tests/scheduler.c
+++ b/dlls/taskschd/tests/scheduler.c
@@ -151,11 +151,11 @@ static void test_GetFolder(void)
ok(hr == S_OK, "Connect error %#x\n", hr);
hr = ITaskService_GetFolder(service, slash, &folder);
-todo_wine
+ todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
hr = ITaskService_GetFolder(service, dot, &folder);
-todo_wine
+ todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */,
"expected ERROR_INVALID_NAME, got %#x\n", hr);
@@ -198,7 +198,7 @@ todo_wine
ITaskFolder_DeleteFolder(folder, Wine, 0);
hr = ITaskFolder_CreateFolder(folder, slash, v_null, &subfolder);
-todo_wine
+ todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
hr = ITaskService_GetFolder(service, Wine_Folder1_Folder2, &subfolder);
@@ -206,7 +206,7 @@ todo_wine
"expected ERROR_PATH_NOT_FOUND, got %#x\n", hr);
hr = ITaskFolder_CreateFolder(folder, bslash, v_null, &subfolder);
-todo_wine
+ todo_wine
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
hr = ITaskFolder_CreateFolder(folder, Wine_Folder1_Folder2, v_null, &subfolder);
@@ -360,7 +360,7 @@ todo_wine
ok(hr == E_ACCESSDENIED || hr == E_INVALIDARG /* Vista */, "expected E_ACCESSDENIED, got %#x\n", hr);
hr = ITaskFolder_DeleteFolder(folder, slash, 0);
-todo_wine
+ todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
ITaskFolder_Release(folder);
@@ -799,7 +799,7 @@ static void test_GetTask(void)
ok(hr == S_OK, "RegisterTask error %#x\n", hr);
hr = ITaskFolder_RegisterTask(root, Wine, xmlW, TASK_CREATE, v_null, v_null, TASK_LOGON_NONE, v_null, NULL);
-todo_wine
+ todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) || broken(hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) /* Vista */, "expected ERROR_ACCESS_DENIED, got %#x\n", hr);
hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, TASK_CREATE, v_null, v_null, TASK_LOGON_NONE, v_null, NULL);
@@ -860,11 +860,11 @@ todo_wine
SysFreeString(bstr);
hr = IRegisteredTask_get_State(task2, &state);
ok(hr == S_OK, "get_State error %#x\n", hr);
-todo_wine
+ todo_wine
ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state);
hr = IRegisteredTask_get_Enabled(task2, &vbool);
ok(hr == S_OK, "get_Enabled error %#x\n", hr);
-todo_wine
+ todo_wine
ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool);
IRegisteredTask_Release(task2);
@@ -897,11 +897,11 @@ todo_wine
ok(hr == S_OK, "put_Enabled error %#x\n", hr);
hr = IRegisteredTask_get_State(task1, &state);
ok(hr == S_OK, "get_State error %#x\n", hr);
-todo_wine
+ todo_wine
ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state);
hr = IRegisteredTask_get_Enabled(task1, &vbool);
ok(hr == S_OK, "get_Enabled error %#x\n", hr);
-todo_wine
+ todo_wine
ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool);
IRegisteredTask_Release(task1);
@@ -919,11 +919,11 @@ todo_wine
SysFreeString(bstr);
hr = IRegisteredTask_get_State(task2, &state);
ok(hr == S_OK, "get_State error %#x\n", hr);
-todo_wine
+ todo_wine
ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state);
hr = IRegisteredTask_get_Enabled(task2, &vbool);
ok(hr == S_OK, "get_Enabled error %#x\n", hr);
-todo_wine
+ todo_wine
ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool);
hr = IRegisteredTask_get_State(task2, NULL);
@@ -934,7 +934,7 @@ todo_wine
IRegisteredTask_Release(task2);
hr = ITaskFolder_DeleteTask(folder, NULL, 0);
-todo_wine
+ todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_DIR_NOT_EMPTY), "expected ERROR_DIR_NOT_EMPTY, got %#x\n", hr);
hr = ITaskFolder_DeleteTask(root, Wine_Task1, 0);
@@ -1592,7 +1592,7 @@ static void test_TaskDefinition(void)
MultiByteToWideChar(CP_ACP, 0, xml3, -1, xmlW, ARRAY_SIZE(xmlW));
hr = ITaskDefinition_put_XmlText(taskdef, xmlW);
-todo_wine
+ todo_wine
ok(hr == SCHED_E_UNEXPECTEDNODE, "expected SCHED_E_UNEXPECTEDNODE, got %#x\n", hr);
MultiByteToWideChar(CP_ACP, 0, xml4, -1, xmlW, ARRAY_SIZE(xmlW));
@@ -1601,7 +1601,7 @@ todo_wine
MultiByteToWideChar(CP_ACP, 0, xml5, -1, xmlW, ARRAY_SIZE(xmlW));
hr = ITaskDefinition_put_XmlText(taskdef, xmlW);
-todo_wine
+ todo_wine
ok(hr == SCHED_E_MISSINGNODE, "expected SCHED_E_MISSINGNODE, got %#x\n", hr);
MultiByteToWideChar(CP_ACP, 0, xml6, -1, xmlW, ARRAY_SIZE(xmlW));
@@ -1703,10 +1703,10 @@ todo_wine
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = NULL;
hr = IRegistrationInfo_get_SecurityDescriptor(reginfo, &var);
-todo_wine
+ todo_wine
ok(hr == S_OK, "get_SecurityDescriptor error %#x\n", hr);
-if (hr == S_OK)
- ok(V_VT(&var) == VT_EMPTY, "expected VT_EMPTY, got %u\n", V_VT(&var));
+ if (hr == S_OK)
+ ok(V_VT(&var) == VT_EMPTY, "expected VT_EMPTY, got %u\n", V_VT(&var));
IRegistrationInfo_Release(reginfo);
--
2.35.0
5
18
[PATCH] user32: Remove no longer needed assert() workarounds for MinGW.
by Zebediah Figura Jan. 31, 2022
by Zebediah Figura Jan. 31, 2022
Jan. 31, 2022
We build with msvcrt, so we don't link against MinGW's assert() anymore.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/user32/user_private.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index 3b542ea1452..d1016780658 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -296,12 +296,6 @@ typedef struct
extern int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) DECLSPEC_HIDDEN;
extern BOOL get_icon_size( HICON handle, SIZE *size ) DECLSPEC_HIDDEN;
-/* Mingw's assert() imports MessageBoxA and gets confused by user32 exporting it */
-#ifdef __MINGW32__
-#undef assert
-#define assert(expr) ((void)0)
-#endif
-
extern struct user_api_hook *user_api DECLSPEC_HIDDEN;
LRESULT WINAPI USER_DefDlgProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
LRESULT WINAPI USER_ScrollBarProc(HWND, UINT, WPARAM, LPARAM, BOOL) DECLSPEC_HIDDEN;
--
2.34.1
2
3
The fegetenv/feupdateenv functions are broken in msvcr120 and are
causing unintentional SSE control word changes.
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/msvcr120/tests/msvcr120.c | 29 +++++++++++++++++++++++++++++
dlls/msvcrt/math.c | 27 ++++++++++++++++++++++-----
2 files changed, 51 insertions(+), 5 deletions(-)
2
1
Jan. 31, 2022
From: Fabian Maurer <dark.shadow4(a)web.de>
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
v2: Use consistent formatting with other tests.
dlls/quartz/tests/acmwrapper.c | 6 ++---
dlls/quartz/tests/filtergraph.c | 38 +++++++++++--------------------
dlls/quartz/tests/videorenderer.c | 3 +--
3 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/dlls/quartz/tests/acmwrapper.c b/dlls/quartz/tests/acmwrapper.c
index 31b32b53ac9..8b9a472c0f3 100644
--- a/dlls/quartz/tests/acmwrapper.c
+++ b/dlls/quartz/tests/acmwrapper.c
@@ -380,8 +380,7 @@ static void test_pin_info(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
-todo_wine
- ok(!wcscmp(info.achName, L"Input"), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ todo_wine ok(!wcscmp(info.achName, L"Input"), "Got name %s.\n", debugstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
@@ -412,8 +411,7 @@ todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
-todo_wine
- ok(!wcscmp(info.achName, L"Output"), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ todo_wine ok(!wcscmp(info.achName, L"Output"), "Got name %s.\n", debugstr_w(info.achName));
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index a83bfde0806..620a1a56bad 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -2474,8 +2474,7 @@ static void test_graph_builder_connect(void)
IFilterGraph2_AddFilter(graph, &sink2.IBaseFilter_iface, NULL);
hr = IFilterGraph2_Connect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface);
-todo_wine
- ok(hr == VFW_S_PARTIAL_RENDER, "Got hr %#x.\n", hr);
+ todo_wine ok(hr == VFW_S_PARTIAL_RENDER, "Got hr %#x.\n", hr);
ok(source_pin.peer == &parser1_pins[0].IPin_iface, "Got peer %p.\n", source_pin.peer);
ok(sink_pin.peer == &parser1_pins[1].IPin_iface, "Got peer %p.\n", sink_pin.peer);
ok(!parser1_pins[2].peer, "Got peer %p.\n", parser1_pins[2].peer);
@@ -3105,32 +3104,24 @@ static void test_connect_direct(void)
/* Swap the pins when connecting. */
hr = IFilterGraph2_ConnectDirect(graph, &sink_pin.IPin_iface, &source_pin.IPin_iface, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
- ok(sink_pin.peer == &source_pin.IPin_iface, "Got peer %p.\n", sink_pin.peer);
+ todo_wine ok(sink_pin.peer == &source_pin.IPin_iface, "Got peer %p.\n", sink_pin.peer);
ok(!sink_pin.mt, "Got mt %p.\n", sink_pin.mt);
-todo_wine
- ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
+ todo_wine ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
hr = IFilterGraph2_Disconnect(graph, &sink_pin.IPin_iface);
-todo_wine
- ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
- ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ todo_wine ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
ok(!sink_pin.peer, "Got peer %p.\n", sink_pin.peer);
hr = IFilterGraph2_Connect(graph, &sink_pin.IPin_iface, &source_pin.IPin_iface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
- ok(sink_pin.peer == &source_pin.IPin_iface, "Got peer %p.\n", sink_pin.peer);
+ todo_wine ok(sink_pin.peer == &source_pin.IPin_iface, "Got peer %p.\n", sink_pin.peer);
ok(!sink_pin.mt, "Got mt %p.\n", sink_pin.mt);
-todo_wine
- ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
+ todo_wine ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
hr = IFilterGraph2_Disconnect(graph, &sink_pin.IPin_iface);
-todo_wine
- ok(hr == S_OK, "Got hr %#x.\n", hr);
-todo_wine
- ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ todo_wine ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
ok(!sink_pin.peer, "Got peer %p.\n", sink_pin.peer);
/* Disconnect() does not disconnect the peer. */
@@ -3304,8 +3295,7 @@ todo_wine
ok(source.ref == 1, "Got outstanding refcount %d.\n", source.ref);
ok(sink.ref == 1, "Got outstanding refcount %d.\n", sink.ref);
ok(source_pin.ref == 1, "Got outstanding refcount %d.\n", source_pin.ref);
-todo_wine
- ok(sink_pin.ref == 1, "Got outstanding refcount %d.\n", sink_pin.ref);
+ todo_wine ok(sink_pin.ref == 1, "Got outstanding refcount %d.\n", sink_pin.ref);
ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
ok(!sink_pin.peer, "Got peer %p.\n", sink_pin.peer);
}
@@ -3350,8 +3340,7 @@ static void test_sync_source(void)
ok(!filter2.clock, "Got clock %p.\n", filter2.clock);
hr = IMediaFilter_GetSyncSource(filter, &clock);
-todo_wine
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(!clock, "Got clock %p.\n", clock);
IReferenceClock_Release(systemclock);
@@ -3647,9 +3636,8 @@ static void test_filter_state(void)
hr = IMediaControl_Run(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
check_filter_state(graph, State_Running);
-todo_wine
- ok(source.start_time > 0 && source.start_time < 500 * 10000,
- "Got time %s.\n", wine_dbgstr_longlong(source.start_time));
+ todo_wine ok(source.start_time > 0 && source.start_time < 500 * 10000,
+ "Got time %s.\n", wine_dbgstr_longlong(source.start_time));
ok(sink.start_time == source.start_time, "Expected time %s, got %s.\n",
wine_dbgstr_longlong(source.start_time), wine_dbgstr_longlong(sink.start_time));
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index 5625971426b..ec212f1b5d6 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -347,8 +347,7 @@ static void test_pin_info(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
-todo_wine
- ok(!wcscmp(info.achName, L"Input"), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ todo_wine ok(!wcscmp(info.achName, L"Input"), "Got name %s.\n", debugstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
--
2.34.1
2
1