winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
May 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
775 discussions
Start a n
N
ew thread
Zebediah Figura : qcap/tests: Test audio capture pin information.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: a6047aee24d1962dafcd32c58fa7ece81e9df598 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a6047aee24d1962dafcd32c58fa7ec…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu May 4 11:45:25 2023 -0500 qcap/tests: Test audio capture pin information. --- dlls/qcap/tests/audiorecord.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c index 9105ebc8509..96d06fad431 100644 --- a/dlls/qcap/tests/audiorecord.c +++ b/dlls/qcap/tests/audiorecord.c @@ -312,6 +312,36 @@ static void test_unconnected_filter_state(IBaseFilter *filter) ok(state == State_Stopped, "Got state %u.\n", state); } +static void test_pin_info(IBaseFilter *filter) +{ + PIN_DIRECTION dir; + PIN_INFO info; + HRESULT hr; + WCHAR *id; + IPin *pin; + + hr = IBaseFilter_FindPin(filter, L"Capture", &pin); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IPin_QueryPinInfo(pin, &info); + ok(hr == S_OK, "Got hr %#lx.\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); + ok(!wcscmp(info.achName, L"Capture"), "Got name %s.\n", debugstr_w(info.achName)); + IBaseFilter_Release(info.pFilter); + + hr = IPin_QueryDirection(pin, &dir); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(dir == PINDIR_OUTPUT, "Got direction %d.\n", dir); + + hr = IPin_QueryId(pin, &id); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!wcscmp(id, L"Capture"), "Got id %s.\n", debugstr_w(id)); + CoTaskMemFree(id); + + IPin_Release(pin); +} + START_TEST(audiorecord) { ICreateDevEnum *devenum; @@ -353,6 +383,7 @@ START_TEST(audiorecord) test_interfaces(filter); test_unconnected_filter_state(filter); + test_pin_info(filter); ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %ld.\n", ref);
1
0
0
0
Zebediah Figura : qcap/tests: Test audio capture pin interfaces.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: b9b425d68351808e824f398ea14bf8dbc361c251 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b9b425d68351808e824f398ea14bf8…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu May 4 11:45:13 2023 -0500 qcap/tests: Test audio capture pin interfaces. --- dlls/qcap/tests/audiorecord.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c index 5705925a50d..9105ebc8509 100644 --- a/dlls/qcap/tests/audiorecord.c +++ b/dlls/qcap/tests/audiorecord.c @@ -2,6 +2,7 @@ * Audio capture filter unit tests * * Copyright 2018 Zebediah Figura + * Copyright 2023 Zebediah Figura for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -46,6 +47,9 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO static void test_interfaces(IBaseFilter *filter) { + HRESULT hr; + IPin *pin; + todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); @@ -63,6 +67,20 @@ static void test_interfaces(IBaseFilter *filter) check_interface(filter, &IID_IQualProp, FALSE); check_interface(filter, &IID_IReferenceClock, FALSE); check_interface(filter, &IID_IVideoWindow, FALSE); + + hr = IBaseFilter_FindPin(filter, L"Capture", &pin); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + todo_wine check_interface(pin, &IID_IKsPropertySet, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAsyncReader, FALSE); + check_interface(pin, &IID_IMediaPosition, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE); + + IPin_Release(pin); } static const GUID test_iid = {0x33333333};
1
0
0
0
Zebediah Figura : qcap/audiorecord: Add a stub source pin.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: 6174d63b3d436233370c703f13f19a936e50292a URL:
https://gitlab.winehq.org/wine/wine/-/commit/6174d63b3d436233370c703f13f19a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu May 4 11:37:59 2023 -0500 qcap/audiorecord: Add a stub source pin. --- dlls/qcap/audiorecord.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index 53aae9e4fe1..6dcffb072fc 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -1,6 +1,8 @@ -/* Implementation of the Audio Capture Filter (CLSID_AudioRecord) +/* + * Audio capture filter * * Copyright 2015 Damjan Jovanovic + * Copyright 2023 Zeb Figura for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +27,8 @@ struct audio_record { struct strmbase_filter filter; IPersistPropertyBag IPersistPropertyBag_iface; + + struct strmbase_source source; }; static struct audio_record *impl_from_strmbase_filter(struct strmbase_filter *filter) @@ -32,6 +36,21 @@ static struct audio_record *impl_from_strmbase_filter(struct strmbase_filter *fi return CONTAINING_RECORD(filter, struct audio_record, filter); } +static HRESULT WINAPI audio_record_source_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props) +{ + ALLOCATOR_PROPERTIES ret_props; + + return IMemAllocator_SetProperties(allocator, props, &ret_props); +} + +static const struct strmbase_source_ops source_ops = +{ + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, + .pfnDecideBufferSize = audio_record_source_DecideBufferSize, +}; + static struct audio_record *impl_from_IPersistPropertyBag(IPersistPropertyBag *iface) { return CONTAINING_RECORD(iface, struct audio_record, IPersistPropertyBag_iface); @@ -39,7 +58,10 @@ static struct audio_record *impl_from_IPersistPropertyBag(IPersistPropertyBag *i static struct strmbase_pin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index) { - FIXME("iface %p, index %u, stub!\n", iface, index); + struct audio_record *filter = impl_from_strmbase_filter(iface); + + if (!index) + return &filter->source.pin; return NULL; } @@ -47,6 +69,7 @@ static void audio_record_destroy(struct strmbase_filter *iface) { struct audio_record *filter = impl_from_strmbase_filter(iface); + strmbase_source_cleanup(&filter->source); strmbase_filter_cleanup(&filter->filter); free(filter); } @@ -154,6 +177,8 @@ HRESULT audio_record_create(IUnknown *outer, IUnknown **out) object->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl; strmbase_filter_init(&object->filter, outer, &CLSID_AudioRecord, &filter_ops); + strmbase_source_init(&object->source, &object->filter, L"Capture", &source_ops); + TRACE("Created audio recorder %p.\n", object); *out = &object->filter.IUnknown_inner; return S_OK;
1
0
0
0
Zebediah Figura : qcap/audiorecord: Get rid of the AudioRecord typedef.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: eab26e615554891b4b946b516295e51cf501d48f URL:
https://gitlab.winehq.org/wine/wine/-/commit/eab26e615554891b4b946b516295e5…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon May 1 22:54:22 2023 -0500 qcap/audiorecord: Get rid of the AudioRecord typedef. --- dlls/qcap/audiorecord.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index a6f27cf4f26..53aae9e4fe1 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -21,19 +21,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -typedef struct { +struct audio_record +{ struct strmbase_filter filter; IPersistPropertyBag IPersistPropertyBag_iface; -} AudioRecord; +}; -static inline AudioRecord *impl_from_strmbase_filter(struct strmbase_filter *filter) +static struct audio_record *impl_from_strmbase_filter(struct strmbase_filter *filter) { - return CONTAINING_RECORD(filter, AudioRecord, filter); + return CONTAINING_RECORD(filter, struct audio_record, filter); } -static inline AudioRecord *impl_from_IPersistPropertyBag(IPersistPropertyBag *iface) +static struct audio_record *impl_from_IPersistPropertyBag(IPersistPropertyBag *iface) { - return CONTAINING_RECORD(iface, AudioRecord, IPersistPropertyBag_iface); + return CONTAINING_RECORD(iface, struct audio_record, IPersistPropertyBag_iface); } static struct strmbase_pin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index) @@ -44,7 +45,7 @@ static struct strmbase_pin *audio_record_get_pin(struct strmbase_filter *iface, static void audio_record_destroy(struct strmbase_filter *iface) { - AudioRecord *filter = impl_from_strmbase_filter(iface); + struct audio_record *filter = impl_from_strmbase_filter(iface); strmbase_filter_cleanup(&filter->filter); free(filter); @@ -52,7 +53,7 @@ static void audio_record_destroy(struct strmbase_filter *iface) static HRESULT audio_record_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - AudioRecord *filter = impl_from_strmbase_filter(iface); + struct audio_record *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_IPersistPropertyBag)) *out = &filter->IPersistPropertyBag_iface; @@ -72,32 +73,35 @@ static const struct strmbase_filter_ops filter_ops = static HRESULT WINAPI PPB_QueryInterface(IPersistPropertyBag *iface, REFIID riid, LPVOID *ppv) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); - return IUnknown_QueryInterface(This->filter.outer_unk, riid, ppv); + struct audio_record *filter = impl_from_IPersistPropertyBag(iface); + + return IUnknown_QueryInterface(filter->filter.outer_unk, riid, ppv); } static ULONG WINAPI PPB_AddRef(IPersistPropertyBag *iface) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); - return IUnknown_AddRef(This->filter.outer_unk); + struct audio_record *filter = impl_from_IPersistPropertyBag(iface); + + return IUnknown_AddRef(filter->filter.outer_unk); } static ULONG WINAPI PPB_Release(IPersistPropertyBag *iface) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); - return IUnknown_Release(This->filter.outer_unk); + struct audio_record *filter = impl_from_IPersistPropertyBag(iface); + + return IUnknown_Release(filter->filter.outer_unk); } static HRESULT WINAPI PPB_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); + struct audio_record *This = impl_from_IPersistPropertyBag(iface); TRACE("(%p/%p)->(%p)\n", iface, This, pClassID); return IBaseFilter_GetClassID(&This->filter.IBaseFilter_iface, pClassID); } static HRESULT WINAPI PPB_InitNew(IPersistPropertyBag *iface) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); + struct audio_record *This = impl_from_IPersistPropertyBag(iface); FIXME("(%p/%p)->(): stub\n", iface, This); return E_NOTIMPL; } @@ -105,7 +109,7 @@ static HRESULT WINAPI PPB_InitNew(IPersistPropertyBag *iface) static HRESULT WINAPI PPB_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); + struct audio_record *This = impl_from_IPersistPropertyBag(iface); HRESULT hr; VARIANT var; @@ -124,7 +128,7 @@ static HRESULT WINAPI PPB_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBa static HRESULT WINAPI PPB_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) { - AudioRecord *This = impl_from_IPersistPropertyBag(iface); + struct audio_record *This = impl_from_IPersistPropertyBag(iface); FIXME("(%p/%p)->(%p, %u, %u): stub\n", iface, This, pPropBag, fClearDirty, fSaveAllProperties); return E_NOTIMPL; } @@ -142,7 +146,7 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = HRESULT audio_record_create(IUnknown *outer, IUnknown **out) { - AudioRecord *object; + struct audio_record *object; if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
1
0
0
0
Alexandre Julliard : kernelbase: Move Wow64EnableWow64FsRedirection() from kernel32 to kernelbase.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: 483a2203eb15367314adbc46c73f7f582b9e9479 URL:
https://gitlab.winehq.org/wine/wine/-/commit/483a2203eb15367314adbc46c73f7f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 11 22:38:24 2023 +0200 kernelbase: Move Wow64EnableWow64FsRedirection() from kernel32 to kernelbase. Following recent Windows versions. --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/path.c | 11 ----------- dlls/kernelbase/file.c | 11 +++++++++++ dlls/kernelbase/kernelbase.spec | 1 + 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index c85b2aa9f6c..e51cef57638 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1632,8 +1632,8 @@ # @ stub WerpStringLookup @ stdcall -import WideCharToMultiByte(long long wstr long ptr long ptr ptr) @ stdcall WinExec(str long) -@ stdcall Wow64EnableWow64FsRedirection(long) KERNEL32_Wow64EnableWow64FsRedirection @ stdcall -import Wow64DisableWow64FsRedirection(ptr) +@ stdcall -import Wow64EnableWow64FsRedirection(long) @ stdcall Wow64GetThreadContext(long ptr) @ stdcall Wow64GetThreadSelectorEntry(long long ptr) @ stdcall -import Wow64RevertWow64FsRedirection(ptr) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 724f7288bc5..f4bdc08b87e 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -377,17 +377,6 @@ UINT WINAPI GetSystemDirectoryA( LPSTR path, UINT count ) } -/*********************************************************************** - * Wow64EnableWow64FsRedirection (KERNEL32.@) - * - * Microsoft C++ Redistributable installers are depending on all %eax bits being set. - */ -DWORD /*BOOLEAN*/ WINAPI KERNEL32_Wow64EnableWow64FsRedirection( BOOLEAN enable ) -{ - return set_ntstatus( RtlWow64EnableFsRedirection( enable )); -} - - /*********************************************************************** * wine_get_unix_file_name (KERNEL32.@) Not a Windows API * diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index b676c50c416..9a88d504fd6 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2858,6 +2858,17 @@ BOOL WINAPI DECLSPEC_HOTPATCH Wow64DisableWow64FsRedirection( PVOID *old_value ) } +/*********************************************************************** + * Wow64EnableWow64FsRedirection (kernelbase.@) + * + * Microsoft C++ Redistributable installers are depending on all %eax bits being set. + */ +DWORD /*BOOLEAN*/ WINAPI kernelbase_Wow64EnableWow64FsRedirection( BOOLEAN enable ) +{ + return set_ntstatus( RtlWow64EnableFsRedirection( enable )); +} + + /*********************************************************************** * Wow64RevertWow64FsRedirection (kernelbase.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 9fd9ad5f038..17ae37e824c 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1757,6 +1757,7 @@ # @ stub WerpNotifyUseStringResource @ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) @ stdcall Wow64DisableWow64FsRedirection(ptr) +@ stdcall Wow64EnableWow64FsRedirection(long) kernelbase_Wow64EnableWow64FsRedirection @ stdcall Wow64RevertWow64FsRedirection(ptr) # @ stub Wow64SetThreadDefaultGuestMachine # @ stub -arch=i386 Wow64Transition
1
0
0
0
Alexandre Julliard : win32u: Don't export wow64 Unix call functions.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: 6b90aea87afcec0cd4005cd15dfb83233f82045e URL:
https://gitlab.winehq.org/wine/wine/-/commit/6b90aea87afcec0cd4005cd15dfb83…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 11 11:19:49 2023 +0200 win32u: Don't export wow64 Unix call functions. They are not used, and can interfere with other libraries that link directly to win32u.so. --- dlls/win32u/syscall.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index a550d32bce9..80c108ab41b 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -339,21 +339,3 @@ unixlib_entry_t __wine_unix_call_funcs[] = init, callbacks_init, }; - -#ifdef _WIN64 - -WINE_DEFAULT_DEBUG_CHANNEL(win32u); - -static NTSTATUS wow64_init( void *args ) -{ - FIXME( "\n" ); - return STATUS_NOT_SUPPORTED; -} - -const unixlib_entry_t __wine_unix_call_wow64_funcs[] = -{ - init, - wow64_init, -}; - -#endif /* _WIN64 */
1
0
0
0
Alexandre Julliard : ntdll: Move the Unix function tables to avoid forward declarations, and make them static.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: f5d272f5610fc0644fced4fe7d54571920a01396 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f5d272f5610fc0644fced4fe7d5457…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 11 13:04:07 2023 +0200 ntdll: Move the Unix function tables to avoid forward declarations, and make them static. --- dlls/ntdll/unix/loader.c | 222 +++++++++++++++++++++-------------------- dlls/ntdll/unix/unix_private.h | 3 - 2 files changed, 112 insertions(+), 113 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 53f9ba8af2b..893f2566ed9 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1037,77 +1037,6 @@ static const void *get_module_data_dir( HMODULE module, ULONG dir, ULONG *size ) return get_rva( module, data->VirtualAddress ); } -static void load_ntdll_functions( HMODULE module ) -{ - void **p__wine_unix_call_dispatcher; - unixlib_handle_t *p__wine_unixlib_handle; - - ntdll_exports = get_module_data_dir( module, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); - assert( ntdll_exports ); - -#define GET_FUNC(name) \ - if (!(p##name = (void *)find_named_export( module, ntdll_exports, #name ))) \ - ERR( "%s not found\n", #name ) - - GET_FUNC( DbgUiRemoteBreakin ); - GET_FUNC( KiRaiseUserExceptionDispatcher ); - GET_FUNC( KiUserExceptionDispatcher ); - GET_FUNC( KiUserApcDispatcher ); - GET_FUNC( KiUserCallbackDispatcher ); - GET_FUNC( LdrInitializeThunk ); - GET_FUNC( LdrSystemDllInitBlock ); - GET_FUNC( RtlUserThreadStart ); - GET_FUNC( __wine_ctrl_routine ); - GET_FUNC( __wine_syscall_dispatcher ); - GET_FUNC( __wine_unix_call_dispatcher ); - GET_FUNC( __wine_unixlib_handle ); - *p__wine_unix_call_dispatcher = __wine_unix_call_dispatcher; - *p__wine_unixlib_handle = (UINT_PTR)__wine_unix_call_funcs; -#ifdef __aarch64__ - { - void **p__wine_current_teb; - GET_FUNC( __wine_current_teb ); - *p__wine_current_teb = NtCurrentTeb; - } -#endif -#undef GET_FUNC -} - -static void load_ntdll_wow64_functions( HMODULE module ) -{ - const IMAGE_EXPORT_DIRECTORY *exports; - - exports = get_module_data_dir( module, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); - assert( exports ); - - pLdrSystemDllInitBlock->ntdll_handle = (ULONG_PTR)module; - -#define GET_FUNC(name) pLdrSystemDllInitBlock->p##name = find_named_export( module, exports, #name ) - GET_FUNC( KiUserApcDispatcher ); - GET_FUNC( KiUserCallbackDispatcher ); - GET_FUNC( KiUserExceptionDispatcher ); - GET_FUNC( LdrInitializeThunk ); - GET_FUNC( LdrSystemDllInitBlock ); - GET_FUNC( RtlUserThreadStart ); - GET_FUNC( RtlpFreezeTimeBias ); - GET_FUNC( RtlpQueryProcessDebugInformationRemote ); -#undef GET_FUNC - - p__wine_ctrl_routine = (void *)find_named_export( module, exports, "__wine_ctrl_routine" ); - -#ifdef _WIN64 - { - unixlib_handle_t *p__wine_unixlib_handle = (void *)find_named_export( module, exports, - "__wine_unixlib_handle" ); - *p__wine_unixlib_handle = (UINT_PTR)__wine_unix_call_wow64_funcs; - } -#endif - - /* also set the 32-bit LdrSystemDllInitBlock */ - memcpy( (void *)(ULONG_PTR)pLdrSystemDllInitBlock->pLdrSystemDllInitBlock, - pLdrSystemDllInitBlock, sizeof(*pLdrSystemDllInitBlock) ); -} - /* reimplementation of LdrProcessRelocationBlock */ static const IMAGE_BASE_RELOCATION *process_relocation_block( void *module, const IMAGE_BASE_RELOCATION *rel, INT_PTR delta ) @@ -1343,6 +1272,39 @@ static NTSTATUS load_so_dll( void *args ) } +static const unixlib_entry_t unix_call_funcs[] = +{ + load_so_dll, + unwind_builtin_dll, + unixcall_wine_dbg_write, + unixcall_wine_server_call, + unixcall_wine_server_fd_to_handle, + unixcall_wine_server_handle_to_fd, + unixcall_wine_spawnvp, + system_time_precise, +}; + + +#ifdef _WIN64 + +static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } +static NTSTATUS wow64_unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } + +const unixlib_entry_t unix_call_wow64_funcs[] = +{ + wow64_load_so_dll, + wow64_unwind_builtin_dll, + wow64_wine_dbg_write, + wow64_wine_server_call, + wow64_wine_server_fd_to_handle, + wow64_wine_server_handle_to_fd, + wow64_wine_spawnvp, + system_time_precise, +}; + +#endif /* _WIN64 */ + + /* check if the library is the correct architecture */ /* only returns false for a valid library of the wrong arch */ static int check_library_arch( int fd ) @@ -1833,6 +1795,85 @@ NTSTATUS load_start_exe( WCHAR **image, void **module ) } +/*********************************************************************** + * load_ntdll_functions + */ +static void load_ntdll_functions( HMODULE module ) +{ + void **p__wine_unix_call_dispatcher; + unixlib_handle_t *p__wine_unixlib_handle; + + ntdll_exports = get_module_data_dir( module, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); + assert( ntdll_exports ); + +#define GET_FUNC(name) \ + if (!(p##name = (void *)find_named_export( module, ntdll_exports, #name ))) \ + ERR( "%s not found\n", #name ) + + GET_FUNC( DbgUiRemoteBreakin ); + GET_FUNC( KiRaiseUserExceptionDispatcher ); + GET_FUNC( KiUserExceptionDispatcher ); + GET_FUNC( KiUserApcDispatcher ); + GET_FUNC( KiUserCallbackDispatcher ); + GET_FUNC( LdrInitializeThunk ); + GET_FUNC( LdrSystemDllInitBlock ); + GET_FUNC( RtlUserThreadStart ); + GET_FUNC( __wine_ctrl_routine ); + GET_FUNC( __wine_syscall_dispatcher ); + GET_FUNC( __wine_unix_call_dispatcher ); + GET_FUNC( __wine_unixlib_handle ); + *p__wine_unix_call_dispatcher = __wine_unix_call_dispatcher; + *p__wine_unixlib_handle = (UINT_PTR)unix_call_funcs; +#ifdef __aarch64__ + { + void **p__wine_current_teb; + GET_FUNC( __wine_current_teb ); + *p__wine_current_teb = NtCurrentTeb; + } +#endif +#undef GET_FUNC +} + + +/*********************************************************************** + * load_ntdll_wow64_functions + */ +static void load_ntdll_wow64_functions( HMODULE module ) +{ + const IMAGE_EXPORT_DIRECTORY *exports; + + exports = get_module_data_dir( module, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); + assert( exports ); + + pLdrSystemDllInitBlock->ntdll_handle = (ULONG_PTR)module; + +#define GET_FUNC(name) pLdrSystemDllInitBlock->p##name = find_named_export( module, exports, #name ) + GET_FUNC( KiUserApcDispatcher ); + GET_FUNC( KiUserCallbackDispatcher ); + GET_FUNC( KiUserExceptionDispatcher ); + GET_FUNC( LdrInitializeThunk ); + GET_FUNC( LdrSystemDllInitBlock ); + GET_FUNC( RtlUserThreadStart ); + GET_FUNC( RtlpFreezeTimeBias ); + GET_FUNC( RtlpQueryProcessDebugInformationRemote ); +#undef GET_FUNC + + p__wine_ctrl_routine = (void *)find_named_export( module, exports, "__wine_ctrl_routine" ); + +#ifdef _WIN64 + { + unixlib_handle_t *p__wine_unixlib_handle = (void *)find_named_export( module, exports, + "__wine_unixlib_handle" ); + *p__wine_unixlib_handle = (UINT_PTR)unix_call_wow64_funcs; + } +#endif + + /* also set the 32-bit LdrSystemDllInitBlock */ + memcpy( (void *)(ULONG_PTR)pLdrSystemDllInitBlock->pLdrSystemDllInitBlock, + pLdrSystemDllInitBlock, sizeof(*pLdrSystemDllInitBlock) ); +} + + /*********************************************************************** * load_ntdll */ @@ -2001,45 +2042,6 @@ static ULONG_PTR get_image_address(void) return 0; } - -/*********************************************************************** - * __wine_unix_call_funcs - */ -const unixlib_entry_t __wine_unix_call_funcs[] = -{ - load_so_dll, - unwind_builtin_dll, - unixcall_wine_dbg_write, - unixcall_wine_server_call, - unixcall_wine_server_fd_to_handle, - unixcall_wine_server_handle_to_fd, - unixcall_wine_spawnvp, - system_time_precise, -}; - - -#ifdef _WIN64 - -static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } -static NTSTATUS wow64_unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } - -/*********************************************************************** - * __wine_unix_call_wow64_funcs - */ -const unixlib_entry_t __wine_unix_call_wow64_funcs[] = -{ - wow64_load_so_dll, - wow64_unwind_builtin_dll, - wow64_wine_dbg_write, - wow64_wine_server_call, - wow64_wine_server_fd_to_handle, - wow64_wine_server_handle_to_fd, - wow64_wine_spawnvp, - system_time_precise, -}; - -#endif /* _WIN64 */ - /*********************************************************************** * start_main_thread */ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 7b2dacf8afd..eac6434b64d 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -42,9 +42,6 @@ static const WORD current_machine = IMAGE_FILE_MACHINE_ARM64; #endif extern WORD native_machine DECLSPEC_HIDDEN; -extern const unixlib_entry_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN; -extern const unixlib_entry_t __wine_unix_call_wow64_funcs[] DECLSPEC_HIDDEN; - static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); static inline BOOL is_machine_64bit( WORD machine )
1
0
0
0
Alexandre Julliard : ntdll: Add a helper function to free a range of pages.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: 9f36fbdbc3d311334a7aff253b16903e89d8c934 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9f36fbdbc3d311334a7aff253b1690…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 11 13:50:50 2023 +0200 ntdll: Add a helper function to free a range of pages. --- dlls/ntdll/unix/virtual.c | 140 ++++++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 74 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 0841fb466aa..99ea3db31a8 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2166,6 +2166,62 @@ static NTSTATUS decommit_pages( struct file_view *view, size_t start, size_t siz } +/*********************************************************************** + * free_pages + * + * Free some pages of a given view. + * virtual_mutex must be held by caller. + */ +static NTSTATUS free_pages( struct file_view *view, char *base, size_t size ) +{ + if (size == view->size) + { + assert( base == view->base ); + delete_view( view ); + return STATUS_SUCCESS; + } + if (view->base != base && base + size != (char *)view->base + view->size) + { + struct file_view *new_view = alloc_view(); + + if (!new_view) + { + ERR( "out of memory for %p-%p\n", base, base + size ); + return STATUS_NO_MEMORY; + } + new_view->base = base + size; + new_view->size = (char *)view->base + view->size - (char *)new_view->base; + new_view->protect = view->protect; + + unregister_view( view ); + view->size = base - (char *)view->base; + register_view( view ); + register_view( new_view ); + + VIRTUAL_DEBUG_DUMP_VIEW( view ); + VIRTUAL_DEBUG_DUMP_VIEW( new_view ); + } + else + { + unregister_view( view ); + if (view->base == base) + { + view->base = base + size; + view->size -= size; + } + else view->size = base - (char *)view->base; + + register_view( view ); + VIRTUAL_DEBUG_DUMP_VIEW( view ); + } + + set_page_vprot( base, size, 0 ); + if (arm64ec_map) clear_arm64ec_range( base, size ); + unmap_area( base, size ); + return STATUS_SUCCESS; +} + + /*********************************************************************** * allocate_dos_memory * @@ -4260,85 +4316,21 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si } else if (!(view = find_view( base, 0 ))) status = STATUS_MEMORY_NOT_ALLOCATED; else if (!is_view_valloc( view )) status = STATUS_INVALID_PARAMETER; + else if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE; + else if ((char *)view->base + view->size - base < size) status = STATUS_UNABLE_TO_FREE_VM; + else if (type == MEM_DECOMMIT) status = decommit_pages( view, base - (char *)view->base, size ); else if (type == MEM_RELEASE) { - /* Free the pages */ - - if (size && (char *)view->base + view->size - base < size) status = STATUS_UNABLE_TO_FREE_VM; - else if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE; - else - { - if (!size) size = view->size; - - if (size == view->size) - { - assert( base == view->base ); - delete_view( view ); - } - else - { - struct file_view *new_view = NULL; - - if (view->base != base && base + size != (char *)view->base + view->size - && !(new_view = alloc_view())) - { - ERR( "out of memory for %p-%p\n", base, (char *)base + size ); - return STATUS_NO_MEMORY; - } - unregister_view( view ); - - if (new_view) - { - new_view->base = base + size; - new_view->size = (char *)view->base + view->size - (char *)new_view->base; - new_view->protect = view->protect; - - view->size = base - (char *)view->base; - register_view( view ); - register_view( new_view ); - - VIRTUAL_DEBUG_DUMP_VIEW( view ); - VIRTUAL_DEBUG_DUMP_VIEW( new_view ); - } - else - { - if (view->base == base) - { - view->base = base + size; - view->size -= size; - } - else - { - view->size = base - (char *)view->base; - } - register_view( view ); - VIRTUAL_DEBUG_DUMP_VIEW( view ); - } - - set_page_vprot( base, size, 0 ); - unmap_area( base, size ); - } - *addr_ptr = base; - *size_ptr = size; - } - } - else if (type == MEM_DECOMMIT) - { - if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE; - else if (base - (char *)view->base + size > view->size) status = STATUS_UNABLE_TO_FREE_VM; - else status = decommit_pages( view, base - (char *)view->base, size ); - if (status == STATUS_SUCCESS) - { - *addr_ptr = base; - *size_ptr = size; - } + if (!size) size = view->size; + status = free_pages( view, base, size ); } - else + else status = STATUS_INVALID_PARAMETER; + + if (status == STATUS_SUCCESS) { - WARN("called with wrong free type flags (%08x) !\n", (int)type); - status = STATUS_INVALID_PARAMETER; + *addr_ptr = base; + *size_ptr = size; } - server_leave_uninterrupted_section( &virtual_mutex, &sigset ); return status; }
1
0
0
0
Paul Gofman : ntdll: Add logging for free ranges.
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: f2efdfbdf9f189ec73f2299e8d87a11e27bab626 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f2efdfbdf9f189ec73f2299e8d87a1…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 4 20:26:39 2022 -0500 ntdll: Add logging for free ranges. --- dlls/ntdll/unix/virtual.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index ac3e4591ac4..0841fb466aa 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -77,6 +77,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(virtual); WINE_DECLARE_DEBUG_CHANNEL(module); +WINE_DECLARE_DEBUG_CHANNEL(virtual_ranges); struct preload_info { @@ -189,6 +190,7 @@ static struct list teb_list = LIST_INIT( teb_list ); #define ROUND_SIZE(addr,size) (((SIZE_T)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask) #define VIRTUAL_DEBUG_DUMP_VIEW(view) do { if (TRACE_ON(virtual)) dump_view(view); } while (0) +#define VIRTUAL_DEBUG_DUMP_RANGES() do { if (TRACE_ON(virtual_ranges)) dump_free_ranges(); } while (0) #ifndef MAP_NORESERVE #define MAP_NORESERVE 0 @@ -711,6 +713,12 @@ static struct range_entry *free_ranges_lower_bound( void *addr ) return begin; } +static void dump_free_ranges(void) +{ + struct range_entry *r; + for (r = free_ranges; r != free_ranges_end; ++r) + TRACE_(virtual_ranges)("%p - %p.\n", r->base, r->end); +} /*********************************************************************** * free_ranges_insert_view @@ -737,10 +745,14 @@ static void free_ranges_insert_view( struct file_view *view ) if (range->end == view_base && next->base >= view_end) view_end = view_base; - TRACE( "%p - %p, aligned %p - %p.\n", view->base, (char *)view->base + view->size, view_base, view_end ); + TRACE_(virtual_ranges)( "%p - %p, aligned %p - %p.\n", + view->base, (char *)view->base + view->size, view_base, view_end ); if (view_end <= view_base) + { + VIRTUAL_DEBUG_DUMP_RANGES(); return; + } /* this should never happen */ if (range->base > view_base || range->end < view_end) @@ -768,16 +780,19 @@ static void free_ranges_insert_view( struct file_view *view ) else range->base = view_end; - if (range->base < range->end) return; - + if (range->base < range->end) + { + VIRTUAL_DEBUG_DUMP_RANGES(); + return; + } /* and possibly remove it if it's now empty */ memmove( range, next, (free_ranges_end - next) * sizeof(struct range_entry) ); free_ranges_end -= 1; assert( free_ranges_end - free_ranges > 0 ); } + VIRTUAL_DEBUG_DUMP_RANGES(); } - /*********************************************************************** * free_ranges_remove_view * @@ -803,11 +818,14 @@ static void free_ranges_remove_view( struct file_view *view ) if (next_view_base && next_view_base < view_end && next_view_end > view_base) view_end = next_view_base; - TRACE( "%p - %p, aligned %p - %p.\n", view->base, (char *)view->base + view->size, view_base, view_end ); + TRACE_(virtual_ranges)( "%p - %p, aligned %p - %p.\n", + view->base, (char *)view->base + view->size, view_base, view_end ); if (view_end <= view_base) + { + VIRTUAL_DEBUG_DUMP_RANGES(); return; - + } /* free_ranges initial value is such that the view is either inside range or before another one. */ assert( range != free_ranges_end ); assert( range->end > view_base || next != free_ranges_end ); @@ -849,6 +867,7 @@ static void free_ranges_remove_view( struct file_view *view ) range->base = view_base; range->end = view_end; } + VIRTUAL_DEBUG_DUMP_RANGES(); }
1
0
0
0
Paul Gofman : ntdll: Support partial view release in NtFreeVirtualMemory().
by Alexandre Julliard
11 May '23
11 May '23
Module: wine Branch: master Commit: fb6a6374dda0532b031fbd958a2770ef950f0f66 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fb6a6374dda0532b031fbd958a2770…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Nov 11 18:41:50 2022 -0600 ntdll: Support partial view release in NtFreeVirtualMemory(). --- dlls/ntdll/tests/virtual.c | 14 +++++++------- dlls/ntdll/unix/virtual.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 555dbb5b4ff..ffa462f579f 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -1869,7 +1869,7 @@ static void test_NtFreeVirtualMemory(void) size = 0xfff; addr = (char *)addr1 + 0x1001; status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE); - todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); *(volatile char *)addr1 = 1; *((volatile char *)addr1 + 0x2000) = 1; ok(size == 0x1000, "Unexpected size %p.\n", (void *)size); @@ -1878,7 +1878,7 @@ static void test_NtFreeVirtualMemory(void) size = 0xfff; addr = (char *)addr1 + 1; status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE); - todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); *((volatile char *)addr1 + 0x2000) = 1; ok(size == 0x1000, "Unexpected size %p.\n", (void *)size); ok(addr == addr1, "Got addr %p, addr1 %p.\n", addr, addr1); @@ -1886,17 +1886,17 @@ static void test_NtFreeVirtualMemory(void) size = 0x1000; addr = addr1; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr, 0, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); ok(addr == addr1, "Unexpected addr %p, addr1 %p.\n", addr, addr1); ok(size == 0x1000, "Unexpected size %p.\n", (void *)size); size = 0x10000; status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_DECOMMIT); - todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status); + ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status); size = 0x10000; status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE); - todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status); + ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status); size = 0; addr = (char *)addr1 + 0x1000; @@ -1911,11 +1911,11 @@ static void test_NtFreeVirtualMemory(void) size = 0; addr = (char *)addr1 + 0x2000; status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE); - todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); size = 0x1000; status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE); - todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); } static void test_prefetch(void) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 1f24cbd6914..ac3e4591ac4 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4258,8 +4258,46 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si } else { - FIXME( "Parial view release is not supported.\n" ); - status = STATUS_INVALID_PARAMETER; + struct file_view *new_view = NULL; + + if (view->base != base && base + size != (char *)view->base + view->size + && !(new_view = alloc_view())) + { + ERR( "out of memory for %p-%p\n", base, (char *)base + size ); + return STATUS_NO_MEMORY; + } + unregister_view( view ); + + if (new_view) + { + new_view->base = base + size; + new_view->size = (char *)view->base + view->size - (char *)new_view->base; + new_view->protect = view->protect; + + view->size = base - (char *)view->base; + register_view( view ); + register_view( new_view ); + + VIRTUAL_DEBUG_DUMP_VIEW( view ); + VIRTUAL_DEBUG_DUMP_VIEW( new_view ); + } + else + { + if (view->base == base) + { + view->base = base + size; + view->size -= size; + } + else + { + view->size = base - (char *)view->base; + } + register_view( view ); + VIRTUAL_DEBUG_DUMP_VIEW( view ); + } + + set_page_vprot( base, size, 0 ); + unmap_area( base, size ); } *addr_ptr = base; *size_ptr = size;
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
78
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Results per page:
10
25
50
100
200