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
September 2020
----- 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
703 discussions
Start a n
N
ew thread
Arkadiusz Hiler : msvcirt: Include iostream in strstream's and stdiostream's rtti hierarchy.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: b3428ac9d03a37b0309a6ae1396e49014f901ec4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b3428ac9d03a37b0309a6ae1…
Author: Arkadiusz Hiler <ahiler(a)codeweavers.com> Date: Mon Sep 7 19:22:02 2020 +0300 msvcirt: Include iostream in strstream's and stdiostream's rtti hierarchy. Signed-off-by: Arkadiusz Hiler <ahiler(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 4 ++-- dlls/msvcp90/cxx.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index b5fd19c39e..170dcee462 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -315,10 +315,10 @@ DEFINE_RTTI_DATA2(ifstream, sizeof(istream), DEFINE_RTTI_DATA4(iostream, sizeof(iostream), &istream_rtti_base_descriptor, &ios_rtti_base_descriptor, &ostream_rtti_base_descriptor, &ios_rtti_base_descriptor, ".?AViostream@@") -DEFINE_RTTI_DATA4(strstream, sizeof(iostream), +DEFINE_RTTI_DATA5(strstream, sizeof(iostream), &iostream_rtti_base_descriptor, &istream_rtti_base_descriptor, &ios_rtti_base_descriptor, &ostream_rtti_base_descriptor, &ios_rtti_base_descriptor, ".?AVstrstream@@") -DEFINE_RTTI_DATA4(stdiostream, sizeof(iostream), +DEFINE_RTTI_DATA5(stdiostream, sizeof(iostream), &iostream_rtti_base_descriptor, &istream_rtti_base_descriptor, &ios_rtti_base_descriptor, &ostream_rtti_base_descriptor, &ios_rtti_base_descriptor, ".?AVstdiostream@@") diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 721d02c548..02735a3c16 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -247,6 +247,8 @@ static void init_ ## type ## _cxx(char *base) \ DEFINE_RTTI_DATA(name, off, 3, cl1, cl2, cl3, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name) #define DEFINE_RTTI_DATA4(name, off, cl1, cl2, cl3, cl4, mangled_name) \ DEFINE_RTTI_DATA(name, off, 4, cl1, cl2, cl3, cl4, NULL, NULL, NULL, NULL, NULL, mangled_name) +#define DEFINE_RTTI_DATA5(name, off, cl1, cl2, cl3, cl4, cl5, mangled_name) \ + DEFINE_RTTI_DATA(name, off, 5, cl1, cl2, cl3, cl4, cl5, NULL, NULL, NULL, NULL, mangled_name) #define DEFINE_RTTI_DATA8(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, mangled_name) \ DEFINE_RTTI_DATA(name, off, 8, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, NULL, mangled_name) #define DEFINE_RTTI_DATA9(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
1
0
0
0
Arkadiusz Hiler : msvcirt: Implement _mtlock() and _mtunlock().
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: d25e7429ccd7ddd30cdfc29cd565b9160e90101d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d25e7429ccd7ddd30cdfc29c…
Author: Arkadiusz Hiler <ahiler(a)codeweavers.com> Date: Fri Sep 4 17:16:19 2020 +0300 msvcirt: Implement _mtlock() and _mtunlock(). Looks like they are just cdecl wrappers around stdcall EnterCriticalSection() and LeaveCriticalSection(). The game TRON 2.0 was crashing on the stubs. Now it makes it a bit further. Signed-off-by: Arkadiusz Hiler <ahiler(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 12 +++++++++++ dlls/msvcirt/msvcirt.spec | 4 ++-- dlls/msvcirt/tests/msvcirt.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ dlls/msvcrt20/msvcrt20.spec | 4 ++-- dlls/msvcrt40/msvcrt40.spec | 4 ++-- 5 files changed, 67 insertions(+), 6 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 6bd910e9a8..b5fd19c39e 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -4723,6 +4723,18 @@ DEFINE_VTBL_WRAPPER(56); void* (__cdecl *MSVCRT_operator_new)(SIZE_T); void (__cdecl *MSVCRT_operator_delete)(void*); +void __cdecl _mtlock(CRITICAL_SECTION *crit) +{ + TRACE("(%p)\n", crit); + EnterCriticalSection(crit); +} + +void __cdecl _mtunlock(CRITICAL_SECTION *crit) +{ + TRACE("(%p)\n", crit); + LeaveCriticalSection(crit); +} + static void init_cxx_funcs(void) { HMODULE hmod = GetModuleHandleA("msvcrt.dll"); diff --git a/dlls/msvcirt/msvcirt.spec b/dlls/msvcirt/msvcirt.spec index c2b4b9d30e..4e8f221b2c 100644 --- a/dlls/msvcirt/msvcirt.spec +++ b/dlls/msvcirt/msvcirt.spec @@ -786,5 +786,5 @@ @ thiscall -arch=win32 ?xsputn@streambuf@@UAEHPBDH@Z(ptr ptr long) streambuf_xsputn @ cdecl -arch=win64 ?xsputn@streambuf@@UEAAHPEBDH@Z(ptr ptr long) streambuf_xsputn @ stub __dummy_export -@ stub _mtlock -@ stub _mtunlock +@ cdecl _mtlock(ptr) +@ cdecl _mtunlock(ptr) diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index e1a6296783..b87bd42266 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -447,6 +447,10 @@ static const char* (*__thiscall p_exception_what)(exception*); static logic_error* (*__thiscall p_logic_error_ctor)(logic_error*, const char**); static void (*__thiscall p_logic_error_dtor)(logic_error*); +/* locking */ +static void (*__cdecl p__mtlock)(CRITICAL_SECTION *); +static void (*__cdecl p__mtunlock)(CRITICAL_SECTION *); + /* Predefined streams */ static istream *p_cin; static ostream *p_cout, *p_cerr, *p_clog; @@ -1005,6 +1009,9 @@ static BOOL init(void) SET(p_cerr, "?cerr@@3Vostream_withassign@@A"); SET(p_clog, "?clog@@3Vostream_withassign@@A"); + SET(p__mtlock, "_mtlock"); + SET(p__mtunlock, "_mtunlock"); + init_thiscall_thunk(); return TRUE; } @@ -7957,6 +7964,47 @@ static void test_exception(void) call_func1(p_logic_error_dtor, (void*) &le); } +static DWORD WINAPI _try_enter_critical(void *crit) +{ + BOOL ret = TryEnterCriticalSection(crit); + + if (ret) + LeaveCriticalSection(crit); + + return ret; +} + +static void test_mtlock_mtunlock(void) +{ + CRITICAL_SECTION crit; + HANDLE thread; + DWORD exit_code, ret; + + InitializeCriticalSection(&crit); + + p__mtlock(&crit); + + thread = CreateThread(NULL, 0, _try_enter_critical, &crit, 0, NULL); + ok(thread != NULL, "failed to create a thread, error: %x\n", GetLastError()); + ret = WaitForSingleObject(thread, 1000); + ok(ret == WAIT_OBJECT_0, "failed to wait for the thread, ret: %d, error: %x\n", ret, GetLastError()); + ok(GetExitCodeThread(thread, &exit_code), "failed to get exit code of the thread\n"); + ok(exit_code == FALSE, "the thread entered critical section\n"); + ret = CloseHandle(thread); + ok(ret, "failed to close thread's handle, error: %x\n", GetLastError()); + + p__mtunlock(&crit); + + thread = CreateThread(NULL, 0, _try_enter_critical, &crit, 0, NULL); + ok(thread != NULL, "failed to create a thread, error: %x\n", GetLastError()); + ret = WaitForSingleObject(thread, 1000); + ok(ret == WAIT_OBJECT_0, "failed to wait for the thread, ret: %d, error: %x\n", ret, GetLastError()); + ok(GetExitCodeThread(thread, &exit_code), "failed to get exit code of the thread\n"); + ok(exit_code == TRUE, "the thread was not able to enter critical section\n"); + ret = CloseHandle(thread); + ok(ret, "failed to close thread's handle, error: %x\n", GetLastError()); +} + START_TEST(msvcirt) { if(!init()) @@ -7984,6 +8032,7 @@ START_TEST(msvcirt) test_Iostream_init(); test_std_streams(); test_exception(); + test_mtlock_mtunlock(); FreeLibrary(msvcrt); FreeLibrary(msvcirt); diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec index 2ce72c6b13..b791202470 100644 --- a/dlls/msvcrt20/msvcrt20.spec +++ b/dlls/msvcrt20/msvcrt20.spec @@ -1072,8 +1072,8 @@ @ cdecl _mkdir(str) msvcrt._mkdir @ cdecl _mktemp(str) msvcrt._mktemp @ cdecl _msize(ptr) msvcrt._msize -@ stub _mtlock -@ stub _mtunlock +@ cdecl _mtlock(ptr) msvcirt._mtlock +@ cdecl _mtunlock(ptr) msvcirt._mtunlock @ cdecl _nextafter(double double) msvcrt._nextafter @ cdecl _onexit(ptr) msvcrt._onexit @ varargs _open(str long) msvcrt._open diff --git a/dlls/msvcrt40/msvcrt40.spec b/dlls/msvcrt40/msvcrt40.spec index efa3e3251d..3f4f2f90e1 100644 --- a/dlls/msvcrt40/msvcrt40.spec +++ b/dlls/msvcrt40/msvcrt40.spec @@ -1163,8 +1163,8 @@ @ cdecl _mkdir(str) msvcrt._mkdir @ cdecl _mktemp(str) msvcrt._mktemp @ cdecl _msize(ptr) msvcrt._msize -@ stub _mtlock -@ stub _mtunlock +@ cdecl _mtlock(ptr) msvcirt._mtlock +@ cdecl _mtunlock(ptr) msvcirt._mtunlock @ cdecl _nextafter(double double) msvcrt._nextafter @ cdecl _onexit(ptr) msvcrt._onexit @ varargs _open(str long) msvcrt._open
1
0
0
0
Derek Lesho : winegstreamer: Implement IMFMediaSource::Shutdown.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: e7b8911695d42ddb826c941dcd9c26da5c3312b9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e7b8911695d42ddb826c941d…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Wed Sep 2 14:26:02 2020 -0500 winegstreamer: Implement IMFMediaSource::Shutdown. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/tests/mfplat.c | 4 ++-- dlls/winegstreamer/media_source.c | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 94fdf9e6f3..309f7b669a 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -673,14 +673,14 @@ todo_wine IMFMediaTypeHandler_Release(handler); IMFPresentationDescriptor_Release(descriptor); +skip_source_tests: + hr = IMFMediaSource_Shutdown(mediasource); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); hr = IMFMediaSource_CreatePresentationDescriptor(mediasource, NULL); ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr); -skip_source_tests: - IMFMediaSource_Release(mediasource); IMFByteStream_Release(stream); diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index cbe51fa957..84ecf305d4 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -39,6 +39,12 @@ struct media_source IMFMediaSource IMFMediaSource_iface; LONG ref; IMFMediaEventQueue *event_queue; + enum + { + SOURCE_OPENING, + SOURCE_STOPPED, + SOURCE_SHUTDOWN, + } state; }; static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *iface) @@ -88,6 +94,7 @@ static ULONG WINAPI media_source_Release(IMFMediaSource *iface) if (!ref) { + IMFMediaSource_Shutdown(&source->IMFMediaSource_iface); IMFMediaEventQueue_Release(source->event_queue); heap_free(source); } @@ -138,6 +145,9 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO FIXME("(%p)->(%p): stub\n", source, characteristics); + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + return E_NOTIMPL; } @@ -147,6 +157,9 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * FIXME("(%p)->(%p): stub\n", source, descriptor); + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + return E_NOTIMPL; } @@ -157,6 +170,9 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD FIXME("(%p)->(%p, %p, %p): stub\n", source, descriptor, time_format, start_position); + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + return E_NOTIMPL; } @@ -166,6 +182,9 @@ static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) FIXME("(%p): stub\n", source); + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + return E_NOTIMPL; } @@ -175,6 +194,9 @@ static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface) FIXME("(%p): stub\n", source); + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + return E_NOTIMPL; } @@ -182,9 +204,17 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) { struct media_source *source = impl_from_IMFMediaSource(iface); - FIXME("(%p): stub\n", source); + TRACE("(%p)\n", source); - return E_NOTIMPL; + if (source->state == SOURCE_SHUTDOWN) + return MF_E_SHUTDOWN; + + source->state = SOURCE_SHUTDOWN; + + if (source->event_queue) + IMFMediaEventQueue_Shutdown(source->event_queue); + + return S_OK; } static const IMFMediaSourceVtbl IMFMediaSource_vtbl = @@ -215,6 +245,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) goto fail; + object->state = SOURCE_STOPPED; + object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; object->ref = 1;
1
0
0
0
Derek Lesho : winegstreamer: Implement source event methods.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: d832ebf1b0a082a41f5c8e1169d934fefb41d0f2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d832ebf1b0a082a41f5c8e11…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Wed Sep 2 14:26:01 2020 -0500 winegstreamer: Implement source event methods. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/media_source.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 21245c718b..cbe51fa957 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -38,6 +38,7 @@ struct media_source { IMFMediaSource IMFMediaSource_iface; LONG ref; + IMFMediaEventQueue *event_queue; }; static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *iface) @@ -87,6 +88,7 @@ static ULONG WINAPI media_source_Release(IMFMediaSource *iface) if (!ref) { + IMFMediaEventQueue_Release(source->event_queue); heap_free(source); } @@ -95,31 +97,39 @@ static ULONG WINAPI media_source_Release(IMFMediaSource *iface) static HRESULT WINAPI media_source_GetEvent(IMFMediaSource *iface, DWORD flags, IMFMediaEvent **event) { - FIXME("(%p)->(%#x, %p)\n", iface, flags, event); + struct media_source *source = impl_from_IMFMediaSource(iface); - return E_NOTIMPL; + TRACE("(%p)->(%#x, %p)\n", source, flags, event); + + return IMFMediaEventQueue_GetEvent(source->event_queue, flags, event); } static HRESULT WINAPI media_source_BeginGetEvent(IMFMediaSource *iface, IMFAsyncCallback *callback, IUnknown *state) { - FIXME("(%p)->(%p, %p)\n", iface, callback, state); + struct media_source *source = impl_from_IMFMediaSource(iface); - return E_NOTIMPL; + TRACE("(%p)->(%p, %p)\n", source, callback, state); + + return IMFMediaEventQueue_BeginGetEvent(source->event_queue, callback, state); } static HRESULT WINAPI media_source_EndGetEvent(IMFMediaSource *iface, IMFAsyncResult *result, IMFMediaEvent **event) { - FIXME("(%p)->(%p, %p)\n", iface, result, event); + struct media_source *source = impl_from_IMFMediaSource(iface); - return E_NOTIMPL; + TRACE("(%p)->(%p, %p)\n", source, result, event); + + return IMFMediaEventQueue_EndGetEvent(source->event_queue, result, event); } static HRESULT WINAPI media_source_QueueEvent(IMFMediaSource *iface, MediaEventType event_type, REFGUID ext_type, HRESULT hr, const PROPVARIANT *value) { - FIXME("(%p)->(%d, %s, %#x, %p)\n", iface, event_type, debugstr_guid(ext_type), hr, value); + struct media_source *source = impl_from_IMFMediaSource(iface); - return E_NOTIMPL; + TRACE("(%p)->(%d, %s, %#x, %p)\n", source, event_type, debugstr_guid(ext_type), hr, value); + + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, event_type, ext_type, hr, value); } static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWORD *characteristics) @@ -197,15 +207,25 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_source **out_media_source) { struct media_source *object = heap_alloc_zero(sizeof(*object)); + HRESULT hr; if (!object) return E_OUTOFMEMORY; + if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) + goto fail; + object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; object->ref = 1; *out_media_source = object; return S_OK; + + fail: + WARN("Failed to construct MFMediaSource, hr %#x.\n", hr); + + IMFMediaSource_Release(&object->IMFMediaSource_iface); + return hr; } struct winegstreamer_stream_handler_result
1
0
0
0
Derek Lesho : winegstreamer: Add stub media source.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: 784ae1e9bd4129a4f0967c656c51e6c9cc3855f5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=784ae1e9bd4129a4f0967c65…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Wed Sep 2 14:26:00 2020 -0500 winegstreamer: Add stub media source. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/tests/mfplat.c | 1 - dlls/winegstreamer/media_source.c | 197 +++++++++++++++++++++++++++++++++++++- 2 files changed, 195 insertions(+), 3 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index fa90f1e4ba..94fdf9e6f3 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -382,7 +382,6 @@ static HRESULT WINAPI test_create_from_file_handler_callback_Invoke(IMFAsyncCall handler = (IMFSchemeHandler *)IMFAsyncResult_GetStateNoAddRef(result); hr = IMFSchemeHandler_EndCreateObject(handler, result, &obj_type, &object); -todo_wine ok(hr == S_OK, "Failed to create an object, hr %#x.\n", hr); if (SUCCEEDED(hr)) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 2bde4efea2..21245c718b 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -34,6 +34,180 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); +struct media_source +{ + IMFMediaSource IMFMediaSource_iface; + LONG ref; +}; + +static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); +} + +static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + TRACE("(%p)->(%s %p)\n", source, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IMFMediaSource) || + IsEqualIID(riid, &IID_IMFMediaEventGenerator) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = &source->IMFMediaSource_iface; + } + else + { + FIXME("(%s, %p)\n", debugstr_guid(riid), out); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*out); + return S_OK; +} + +static ULONG WINAPI media_source_AddRef(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + ULONG ref = InterlockedIncrement(&source->ref); + + TRACE("(%p) ref=%u\n", source, ref); + + return ref; +} + +static ULONG WINAPI media_source_Release(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + ULONG ref = InterlockedDecrement(&source->ref); + + TRACE("(%p) ref=%u\n", source, ref); + + if (!ref) + { + heap_free(source); + } + + return ref; +} + +static HRESULT WINAPI media_source_GetEvent(IMFMediaSource *iface, DWORD flags, IMFMediaEvent **event) +{ + FIXME("(%p)->(%#x, %p)\n", iface, flags, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_BeginGetEvent(IMFMediaSource *iface, IMFAsyncCallback *callback, IUnknown *state) +{ + FIXME("(%p)->(%p, %p)\n", iface, callback, state); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_EndGetEvent(IMFMediaSource *iface, IMFAsyncResult *result, IMFMediaEvent **event) +{ + FIXME("(%p)->(%p, %p)\n", iface, result, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_QueueEvent(IMFMediaSource *iface, MediaEventType event_type, REFGUID ext_type, + HRESULT hr, const PROPVARIANT *value) +{ + FIXME("(%p)->(%d, %s, %#x, %p)\n", iface, event_type, debugstr_guid(ext_type), hr, value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWORD *characteristics) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p): stub\n", source, characteristics); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource *iface, IMFPresentationDescriptor **descriptor) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p): stub\n", source, descriptor); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationDescriptor *descriptor, + const GUID *time_format, const PROPVARIANT *start_position) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p, %p, %p): stub\n", source, descriptor, time_format, start_position); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + FIXME("(%p): stub\n", source); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + FIXME("(%p): stub\n", source); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +{ + struct media_source *source = impl_from_IMFMediaSource(iface); + + FIXME("(%p): stub\n", source); + + return E_NOTIMPL; +} + +static const IMFMediaSourceVtbl IMFMediaSource_vtbl = +{ + media_source_QueryInterface, + media_source_AddRef, + media_source_Release, + media_source_GetEvent, + media_source_BeginGetEvent, + media_source_EndGetEvent, + media_source_QueueEvent, + media_source_GetCharacteristics, + media_source_CreatePresentationDescriptor, + media_source_Start, + media_source_Stop, + media_source_Pause, + media_source_Shutdown, +}; + +static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_source **out_media_source) +{ + struct media_source *object = heap_alloc_zero(sizeof(*object)); + + if (!object) + return E_OUTOFMEMORY; + + object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; + object->ref = 1; + + *out_media_source = object; + return S_OK; +} + struct winegstreamer_stream_handler_result { struct list entry; @@ -386,9 +560,28 @@ static HRESULT WINAPI winegstreamer_stream_handler_callback_GetParameters(IMFAsy static HRESULT winegstreamer_stream_handler_create_object(struct winegstreamer_stream_handler *This, WCHAR *url, IMFByteStream *stream, DWORD flags, IPropertyStore *props, IUnknown **out_object, MF_OBJECT_TYPE *out_obj_type) { - FIXME("(%p %s %p %u %p %p %p)\n", This, debugstr_w(url), stream, flags, props, out_object, out_obj_type); + TRACE("(%p %s %p %u %p %p %p)\n", This, debugstr_w(url), stream, flags, props, out_object, out_obj_type); - return E_NOTIMPL; + if (flags & MF_RESOLUTION_MEDIASOURCE) + { + HRESULT hr; + struct media_source *new_source; + + if (FAILED(hr = media_source_constructor(stream, &new_source))) + return hr; + + TRACE("->(%p)\n", new_source); + + *out_object = (IUnknown*)&new_source->IMFMediaSource_iface; + *out_obj_type = MF_OBJECT_MEDIASOURCE; + + return S_OK; + } + else + { + FIXME("flags = %08x\n", flags); + return E_NOTIMPL; + } } static HRESULT WINAPI winegstreamer_stream_handler_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result)
1
0
0
0
Derek Lesho : winegstreamer: Add stub bytestream handler.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: a6be76bb9cd00614c565c2f1b69d6733e38414db URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6be76bb9cd00614c565c2f1…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Wed Sep 2 15:05:02 2020 -0500 winegstreamer: Add stub bytestream handler. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 6 + dlls/winegstreamer/Makefile.in | 1 + dlls/winegstreamer/gst_private.h | 2 + dlls/winegstreamer/media_source.c | 474 +++++++++++++++++++++++++++ dlls/winegstreamer/mfplat.c | 3 + dlls/winegstreamer/winegstreamer_classes.idl | 7 + 6 files changed, 493 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a6be76bb9cd00614c565…
1
0
0
0
Derek Lesho : mfplat: Remove fallback media source.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: c58bb881a08a7abd175466f648ac9c9f4e09e4cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c58bb881a08a7abd175466f6…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Wed Sep 2 14:25:58 2020 -0500 mfplat: Remove fallback media source. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 207 +-------------------------------------------- dlls/mfplat/tests/mfplat.c | 106 +++++++++++++---------- 2 files changed, 64 insertions(+), 249 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c58bb881a08a7abd1754…
1
0
0
0
Akihiro Sagawa : po: Update Japanese translation.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: 0713b754f0392791b16ec8ce7909badca54a03be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0713b754f0392791b16ec8ce…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Mon Sep 7 23:17:05 2020 +0900 po: Update Japanese translation. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- po/ja.po | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/po/ja.po b/po/ja.po index 2f9a0a4eb5..b992960a28 100644 --- a/po/ja.po +++ b/po/ja.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
https://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2020-05-10 19:59+0900\n" +"PO-Revision-Date: 2020-09-07 22:53+0900\n" "Last-Translator: Akihiro Sagawa <sagawa.aki(a)gmail.com>\n" "Language-Team: Japanese\n" "Language: ja\n" @@ -3606,7 +3606,7 @@ msgstr "ゲーム コントローラ" #: joy.rc:32 msgid "Test and configure game controllers." -msgstr "" +msgstr "ゲーム コントローラのテストと設定をします。" #: jscript.rc:28 msgid "Error converting object to primitive type" @@ -3614,17 +3614,15 @@ msgstr "オブジェクトを基本型に変換できません" #: jscript.rc:29 msgid "Invalid procedure call or argument" -msgstr "手続き呼び出しまたは引数が無効です" +msgstr "使用できない手続き呼び出しまたは引数です" #: jscript.rc:30 msgid "Subscript out of range" msgstr "添字が範囲外です" #: jscript.rc:31 -#, fuzzy -#| msgid "Out of paper; " msgid "Out of stack space" -msgstr "用紙切れ - " +msgstr "スタック スペースが不足しています" #: jscript.rc:32 msgid "Object required" @@ -3672,7 +3670,7 @@ msgstr "'='を期待していました" #: jscript.rc:43 msgid "Invalid character" -msgstr "無効な文字です" +msgstr "使用できない文字です" #: jscript.rc:44 msgid "Unterminated string constant" @@ -3763,16 +3761,12 @@ msgid "JScript object expected" msgstr "JScript オブジェクトを期待していました" #: jscript.rc:63 -#, fuzzy -#| msgid "Array object expected" msgid "Enumerator object expected" -msgstr "配列オブジェクトを期待していました" +msgstr "列挙子オブジェクトを期待していました" #: jscript.rc:64 -#, fuzzy -#| msgid "Boolean object expected" msgid "Regular Expression object expected" -msgstr "Boolean オブジェクトを期待していました" +msgstr "正規表現オブジェクトを期待していました" #: jscript.rc:65 msgid "Syntax error in regular expression" @@ -3784,7 +3778,7 @@ msgstr "例外が送出されましたが捕捉されませんでした" #: jscript.rc:68 msgid "URI to be encoded contains invalid characters" -msgstr "エンコードされる URI に無効な文字が含まれています" +msgstr "エンコードされる URI に使用できない文字が含まれています" #: jscript.rc:67 msgid "URI to be decoded is incorrect" @@ -3841,7 +3835,7 @@ msgstr "処理は成功しました。\n" #: winerror.mc:33 msgid "Invalid function.\n" -msgstr "ファンクションが正しくありません。\n" +msgstr "使用できないファンクションです。\n" #: winerror.mc:38 msgid "File not found.\n" @@ -6797,10 +6791,8 @@ msgid "Connection reset by peer.\n" msgstr "相手側により接続がリセットされました。\n" #: winerror.mc:3767 -#, fuzzy -#| msgid "Not implemented" msgid "Not implemented.\n" -msgstr "未実装" +msgstr "未実装です。\n" #: winerror.mc:3760 msgid "No Signature found in file.\n" @@ -8402,7 +8394,7 @@ msgstr "接続をテスト(&T)" #: version.rc:92 msgid "Advanced" -msgstr "中級" +msgstr "高度" #: version.rc:95 msgid "Network settings" @@ -12504,6 +12496,9 @@ msgid "" "\n" "hardlink hardlink management\n" msgstr "" +"- サポートしているコマンド -\n" +"\n" +"hardlink ハードリンクの管理\n" #: fsutil.mc:35 msgid "" @@ -12511,10 +12506,13 @@ msgid "" "\n" "create create a hardlink\n" msgstr "" +"- Hardlink - サポートしているコマンド -\n" +"\n" +"create ハードリンクを作成する\n" #: fsutil.mc:40 msgid "Syntax: fsutil hardlink create <new> <existing>\n" -msgstr "" +msgstr "構文: fsutil hardlink create <新規> <既存>\n" #: hostname.rc:30 msgid "Usage: hostname\n" @@ -12526,7 +12524,7 @@ msgstr "エラー: 無効なオプション '%c'。\n" #: hostname.rc:32 msgid "Error: Could not get hostname: %u.\n" -msgstr "エラー: ホスト名が得られません: %u\n" +msgstr "エラー: ホスト名が得られません: %u。\n" #: hostname.rc:33 msgid "" @@ -16519,10 +16517,8 @@ msgid "&Beginner" msgstr "初級(&B)" #: winemine.rc:45 -#, fuzzy -#| msgid "Interface" msgid "&Intermediate" -msgstr "インターフェイス" +msgstr "中級(&I)" #: winemine.rc:46 msgid "&Expert" @@ -16553,10 +16549,8 @@ msgid "Beginner" msgstr "初級" #: winemine.rc:65 -#, fuzzy -#| msgid "Interface" msgid "Intermediate" -msgstr "インターフェイス" +msgstr "中級" #: winemine.rc:66 msgid "Expert"
1
0
0
0
Jacek Caban : dwrite.idl: Use DEFINE_ENUM_FLAG_OPERATORS for enums that need it.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: eb0c19e89b6ec9a0b7a231410aaa7464fcfd5957 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eb0c19e89b6ec9a0b7a23141…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Sep 7 12:49:53 2020 +0200 dwrite.idl: Use DEFINE_ENUM_FLAG_OPERATORS for enums that need it. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dwrite.idl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dwrite.idl b/include/dwrite.idl index d5ce849386..64cb5ee488 100644 --- a/include/dwrite.idl +++ b/include/dwrite.idl @@ -147,6 +147,7 @@ typedef enum DWRITE_FONT_SIMULATIONS DWRITE_FONT_SIMULATIONS_BOLD, DWRITE_FONT_SIMULATIONS_OBLIQUE } DWRITE_FONT_SIMULATIONS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS);") typedef enum DWRITE_PIXEL_GEOMETRY { @@ -328,6 +329,7 @@ typedef enum DWRITE_SCRIPT_SHAPES DWRITE_SCRIPT_SHAPES_DEFAULT = 0, DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1 } DWRITE_SCRIPT_SHAPES; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES);") typedef enum DWRITE_NUMBER_SUBSTITUTION_METHOD {
1
0
0
0
Rémi Bernon : widl: Support fully qualified names in WinRT mode.
by Alexandre Julliard
07 Sep '20
07 Sep '20
Module: wine Branch: master Commit: 280932536f9c05bf09f2010eb14ca552a762e6e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=280932536f9c05bf09f2010e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 3 14:42:01 2020 +0200 widl: Support fully qualified names in WinRT mode. Interfaces are going to reference each other across namespaces, so this implements a type lookup with the full name. It supports the following idl syntax in WinRT mode: #ifdef __WIDL__ #pragma winrt ns_prefix #endif import "wtypes.idl"; namespace Windows { namespace Foo { [object] interface IFoo {} } namespace Bar { [object] interface IBar { HRESULT DoBar([in] Windows.Foo.IFoo *foo); } } } That was previously failing to parse the Windows.Foo.IFoo part and to lookup the corresponding type. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.h | 1 + tools/widl/parser.l | 2 +- tools/widl/parser.y | 60 +++++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/tools/widl/parser.h b/tools/widl/parser.h index a67b160d48..a6dc94ae6b 100644 --- a/tools/widl/parser.h +++ b/tools/widl/parser.h @@ -38,6 +38,7 @@ void pop_import(void); #define parse_only import_stack_ptr int is_type(const char *name); +int is_namespace(const char *name); int do_warning(char *toggle, warning_list_t *wnum); int is_warning_enabled(int warning); diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 3cbf4ff2d2..925265d00d 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -451,7 +451,7 @@ static int kw_token(const char *kw) return kwp->token; } parser_lval.str = xstrdup(kw); - return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER; + return is_type(kw) ? aKNOWNTYPE : is_namespace(kw) ? aNAMESPACE : aIDENTIFIER; } static int attr_token(const char *kw) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 91c5b809bb..7d5aaebf33 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -81,6 +81,8 @@ static var_t *reg_const(var_t *var); static void push_namespace(const char *name); static void pop_namespace(const char *name); +static void init_lookup_namespace(const char *name); +static void push_lookup_namespace(const char *name); static void check_arg_attrs(const var_t *arg); static void check_statements(const statement_list_t *stmts, int is_inside_library); @@ -122,6 +124,7 @@ static struct namespace global_namespace = { }; static struct namespace *current_namespace = &global_namespace; +static struct namespace *lookup_namespace = &global_namespace; static typelib_t *current_typelib; @@ -156,7 +159,7 @@ static typelib_t *current_typelib; } %token <str> aIDENTIFIER aPRAGMA -%token <str> aKNOWNTYPE +%token <str> aKNOWNTYPE aNAMESPACE %token <num> aNUM aHEXNUM %token <dbl> aDOUBLE %token <str> aSTRING aWSTRING aSQSTRING @@ -271,7 +274,7 @@ static typelib_t *current_typelib; %type <str> namespacedef %type <type> base_type int_std %type <type> enumdef structdef uniondef typedecl -%type <type> type +%type <type> type qualified_seq qualified_type %type <ifref> coclass_int %type <ifref_list> coclass_ints %type <var> arg ne_union_field union_field s_field case enum declaration @@ -817,6 +820,16 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); } | tINT3264 { $$ = type_new_int(TYPE_BASIC_INT3264, 0); } ; +qualified_seq: + aKNOWNTYPE { $$ = find_type_or_error($1, 0); } + | aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; } + ; + +qualified_type: + aKNOWNTYPE { $$ = find_type_or_error($1, 0); } + | aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; } + ; + coclass: tCOCLASS aIDENTIFIER { $$ = type_new_coclass($2); } | tCOCLASS aKNOWNTYPE { $$ = find_type($2, NULL, 0); if (type_get_type_detect_alias($$) != TYPE_COCLASS) @@ -837,6 +850,7 @@ coclassdef: coclasshdr '{' coclass_ints '}' semicolon_opt ; namespacedef: tNAMESPACE aIDENTIFIER { $$ = $2; } + | tNAMESPACE aNAMESPACE { $$ = $2; } ; coclass_ints: { $$ = NULL; } @@ -881,7 +895,7 @@ dispinterfacedef: dispinterfacehdr '{' ; inherit: { $$ = NULL; } - | ':' aKNOWNTYPE { $$ = find_type_or_error2($2, 0); } + | ':' qualified_type { $$ = $2; } ; interface: tINTERFACE aIDENTIFIER { $$ = get_type(TYPE_INTERFACE, $2, current_namespace, 0); } @@ -1096,7 +1110,7 @@ structdef: tSTRUCT t_ident '{' fields '}' { $$ = type_new_struct($2, current_nam ; type: tVOID { $$ = type_new_void(); } - | aKNOWNTYPE { $$ = find_type_or_error($1, 0); } + | qualified_type { $$ = $1; } | base_type { $$ = $1; } | enumdef { $$ = $1; } | tENUM aIDENTIFIER { $$ = type_new_enum($2, current_namespace, FALSE, NULL); } @@ -1848,6 +1862,20 @@ static void pop_namespace(const char *name) current_namespace = current_namespace->parent; } +static void init_lookup_namespace(const char *name) +{ + if (!(lookup_namespace = find_sub_namespace(&global_namespace, name))) + error_loc("namespace '%s' not found\n", name); +} + +static void push_lookup_namespace(const char *name) +{ + struct namespace *namespace; + if (!(namespace = find_sub_namespace(lookup_namespace, name))) + error_loc("namespace '%s' not found\n", name); + lookup_namespace = namespace; +} + struct rtype { const char *name; type_t *type; @@ -1959,12 +1987,14 @@ type_t *find_type(const char *name, struct namespace *namespace, int t) static type_t *find_type_or_error(const char *name, int t) { - type_t *type = find_type(name, current_namespace, t); - if (!type) { - error_loc("type '%s' not found\n", name); - return NULL; - } - return type; + type_t *type; + if (!(type = find_type(name, current_namespace, t)) && + !(type = find_type(name, lookup_namespace, t))) + { + error_loc("type '%s' not found\n", name); + return NULL; + } + return type; } static type_t *find_type_or_error2(char *name, int t) @@ -1976,7 +2006,15 @@ static type_t *find_type_or_error2(char *name, int t) int is_type(const char *name) { - return find_type(name, current_namespace, 0) != NULL; + return find_type(name, current_namespace, 0) != NULL || + find_type(name, lookup_namespace, 0) != NULL; +} + +int is_namespace(const char *name) +{ + if (!winrt_mode) return 0; + return find_sub_namespace(current_namespace, name) != NULL || + find_sub_namespace(&global_namespace, name) != NULL; } type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t)
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
71
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
Results per page:
10
25
50
100
200