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
July 2021
----- 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
728 discussions
Start a n
N
ew thread
Nikolay Sivov : mfmediaengine: Handle Play() when called before topology is set.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: bf824dbb921eded8bbc37eeb8ec76a1d2933f2b8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bf824dbb921eded8bbc37eeb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 22 17:46:11 2021 +0300 mfmediaengine: Handle Play() when called before topology is set. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfmediaengine/main.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index bd3fd04aabd..a555d0dad99 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -84,6 +84,8 @@ enum media_engine_flags FLAGS_ENGINE_FIRST_FRAME = 0x2000, FLAGS_ENGINE_IS_ENDED = 0x4000, FLAGS_ENGINE_NEW_FRAME = 0x8000, + FLAGS_ENGINE_SOURCE_PENDING = 0x10000, + FLAGS_ENGINE_PLAY_PENDING = 0x20000, }; struct vec3 @@ -1181,9 +1183,18 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi return hr; } +static void media_engine_start_playback(struct media_engine *engine) +{ + PROPVARIANT var; + + var.vt = VT_EMPTY; + IMFMediaSession_Start(engine->session, &GUID_NULL, &var); +} + static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) { struct media_engine *engine = impl_from_load_handler_IMFAsyncCallback(iface); + unsigned int start_playback; MF_OBJECT_TYPE obj_type; IMFMediaSource *source; IUnknown *object = NULL; @@ -1194,6 +1205,9 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, engine->network_state = MF_MEDIA_ENGINE_NETWORK_LOADING; IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_LOADSTART, 0, 0); + start_playback = engine->flags & FLAGS_ENGINE_PLAY_PENDING; + media_engine_set_flag(engine, FLAGS_ENGINE_SOURCE_PENDING | FLAGS_ENGINE_PLAY_PENDING, FALSE); + if (FAILED(hr = IMFSourceResolver_EndCreateObjectFromURL(engine->resolver, result, &obj_type, &object))) WARN("Failed to create source object, hr %#x.\n", hr); @@ -1210,6 +1224,8 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, if (SUCCEEDED(hr)) { engine->network_state = MF_MEDIA_ENGINE_NETWORK_IDLE; + if (start_playback) + media_engine_start_playback(engine); } else { @@ -1387,6 +1403,9 @@ static HRESULT WINAPI media_engine_SetSource(IMFMediaEngine *iface, BSTR url) &IID_IPropertyStore, (void **)&props); hr = IMFSourceResolver_BeginCreateObjectFromURL(engine->resolver, url, flags, props, NULL, &engine->load_handler, NULL); + if (SUCCEEDED(hr)) + media_engine_set_flag(engine, FLAGS_ENGINE_SOURCE_PENDING, TRUE); + if (props) IPropertyStore_Release(props); } @@ -1723,7 +1742,6 @@ static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop) static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface) { struct media_engine *engine = impl_from_IMFMediaEngine(iface); - PROPVARIANT var; TRACE("%p.\n", iface); @@ -1736,8 +1754,10 @@ static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface) media_engine_set_flag(engine, FLAGS_ENGINE_PAUSED | FLAGS_ENGINE_IS_ENDED, FALSE); IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PLAY, 0, 0); - var.vt = VT_EMPTY; - IMFMediaSession_Start(engine->session, &GUID_NULL, &var); + if (!(engine->flags & FLAGS_ENGINE_SOURCE_PENDING)) + media_engine_start_playback(engine); + else + media_engine_set_flag(engine, FLAGS_ENGINE_PLAY_PENDING, TRUE); media_engine_set_flag(engine, FLAGS_ENGINE_WAITING, TRUE); }
1
0
0
0
Huw Davies : include: Add IN6_IS_ADDR_LINKLOCAL() and IN6_IS_ADDR_SITELOCAL().
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: c3c20fdc0b2d937edbd958dfd939a571dc27167e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c3c20fdc0b2d937edbd958df…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Jul 22 12:50:20 2021 +0100 include: Add IN6_IS_ADDR_LINKLOCAL() and IN6_IS_ADDR_SITELOCAL(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/ws2ipdef.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h index fc465804962..2f9d4f663ad 100644 --- a/include/ws2ipdef.h +++ b/include/ws2ipdef.h @@ -323,6 +323,16 @@ static inline BOOLEAN WS(IN6_IS_ADDR_UNSPECIFIED) ( const IN6_ADDR *a ) (a->s6_words[7] == 0)); } +static inline BOOLEAN WS(IN6_IS_ADDR_LINKLOCAL) ( const IN6_ADDR *a ) +{ + return ((a->s6_bytes[0] == 0xfe) && ((a->s6_bytes[1] & 0xc0) == 0x80)); +} + +static inline BOOLEAN WS(IN6_IS_ADDR_SITELOCAL) ( const IN6_ADDR *a ) +{ + return ((a->s6_bytes[0] == 0xfe) && ((a->s6_bytes[1] & 0xc0) == 0xc0)); +} + #ifdef __cplusplus } #endif
1
0
0
0
Huw Davies : iphlpapi: Retrieve the IPv4 addresses using an export rather than a helper.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: 8d9d7fc5d2b858182ab76f29ece658616004b7c2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8d9d7fc5d2b858182ab76f29…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Jul 22 12:50:19 2021 +0100 iphlpapi: Retrieve the IPv4 addresses using an export rather than a helper. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 6e1d95ab321..b2d597fd9ab 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -76,6 +76,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); #define CHARS_IN_GUID 39 DWORD WINAPI AllocateAndGetIfTableFromStack( MIB_IFTABLE **table, BOOL sort, HANDLE heap, DWORD flags ); +DWORD WINAPI AllocateAndGetIpAddrTableFromStack( MIB_IPADDRTABLE **table, BOOL sort, HANDLE heap, DWORD flags ); static const NPI_MODULEID *ip_module_id( USHORT family ) { @@ -350,7 +351,7 @@ DWORD WINAPI CreateSortedAddressPairs( const PSOCKADDR_IN6 src_list, DWORD src_c if (!(pairs = HeapAlloc( GetProcessHeap(), 0, size ))) return ERROR_NOT_ENOUGH_MEMORY; ptr = (SOCKADDR_IN6 *)&pairs[dst_count]; - if ((ret = getIPAddrTable( &table, GetProcessHeap(), 0 ))) + if ((ret = AllocateAndGetIpAddrTableFromStack( &table, FALSE, GetProcessHeap(), 0 ))) { HeapFree( GetProcessHeap(), 0, pairs ); return ret;
1
0
0
0
Huw Davies : iphlpapi: Implement AllocateAndGetIpAddrTableFromStack() on top of GetIpAddrTable().
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: 24ca70a60cbe61ea70e7710ae7724f0ab7b4105b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=24ca70a60cbe61ea70e7710a…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Jul 22 12:50:18 2021 +0100 iphlpapi: Implement AllocateAndGetIpAddrTableFromStack() on top of GetIpAddrTable(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 76 +++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 8442bc2b4a9..6e1d95ab321 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -139,48 +139,6 @@ DWORD WINAPI AddIPAddress(IPAddr Address, IPMask IpMask, DWORD IfIndex, PULONG N return ERROR_NOT_SUPPORTED; } -static int IpAddrTableNumericSorter(const void *a, const void *b) -{ - int ret = 0; - - if (a && b) - ret = ((const MIB_IPADDRROW*)a)->dwAddr - ((const MIB_IPADDRROW*)b)->dwAddr; - return ret; -} - -/****************************************************************** - * AllocateAndGetIpAddrTableFromStack (IPHLPAPI.@) - * - * Get interface-to-IP address mapping table. - * Like GetIpAddrTable(), but allocate the returned table from heap. - * - * PARAMS - * ppIpAddrTable [Out] pointer into which the MIB_IPADDRTABLE is - * allocated and returned. - * bOrder [In] whether to sort the table - * heap [In] heap from which the table is allocated - * flags [In] flags to HeapAlloc - * - * RETURNS - * ERROR_INVALID_PARAMETER if ppIpAddrTable is NULL, other error codes on - * failure, NO_ERROR on success. - */ -DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE *ppIpAddrTable, - BOOL bOrder, HANDLE heap, DWORD flags) -{ - DWORD ret; - - TRACE("ppIpAddrTable %p, bOrder %d, heap %p, flags 0x%08x\n", - ppIpAddrTable, bOrder, heap, flags); - ret = getIPAddrTable(ppIpAddrTable, heap, flags); - if (!ret && bOrder) - qsort((*ppIpAddrTable)->table, (*ppIpAddrTable)->dwNumEntries, - sizeof(MIB_IPADDRROW), IpAddrTableNumericSorter); - TRACE("returning %d\n", ret); - return ret; -} - - /****************************************************************** * CancelIPChangeNotify (IPHLPAPI.@) * @@ -2189,6 +2147,40 @@ err: } +/****************************************************************** + * AllocateAndGetIpAddrTableFromStack (IPHLPAPI.@) + * + * Get interface-to-IP address mapping table. + * Like GetIpAddrTable(), but allocate the returned table from heap. + * + * PARAMS + * table [Out] pointer into which the MIB_IPADDRTABLE is + * allocated and returned. + * sort [In] whether to sort the table + * heap [In] heap from which the table is allocated + * flags [In] flags to HeapAlloc + * + */ +DWORD WINAPI AllocateAndGetIpAddrTableFromStack( MIB_IPADDRTABLE **table, BOOL sort, HANDLE heap, DWORD flags ) +{ + DWORD err, size = FIELD_OFFSET(MIB_IPADDRTABLE, table[2]), attempt; + + TRACE( "table %p, sort %d, heap %p, flags 0x%08x\n", table, sort, heap, flags ); + + for (attempt = 0; attempt < 5; attempt++) + { + *table = HeapAlloc( heap, flags, size ); + if (!*table) return ERROR_NOT_ENOUGH_MEMORY; + + err = GetIpAddrTable( *table, &size, sort ); + if (!err) break; + HeapFree( heap, flags, *table ); + if (err != ERROR_INSUFFICIENT_BUFFER) break; + } + + return err; +} + /****************************************************************** * GetIpForwardTable (IPHLPAPI.@) *
1
0
0
0
Huw Davies : iphlpapi: Implement GetIpAddrTable() on top of nsi.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: beb844448731a2413e3700877c237dc9f5968870 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=beb844448731a2413e370087…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Jul 22 12:50:17 2021 +0100 iphlpapi: Implement GetIpAddrTable() on top of nsi. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 103 ++++++++++++++++++++--------------------- dlls/iphlpapi/tests/iphlpapi.c | 2 + 2 files changed, 51 insertions(+), 54 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 93d9b0440dd..8442bc2b4a9 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -148,19 +148,6 @@ static int IpAddrTableNumericSorter(const void *a, const void *b) return ret; } -static int IpAddrTableLoopbackSorter(const void *a, const void *b) -{ - const MIB_IPADDRROW *left = a, *right = b; - int ret = 0; - - if (isIfIndexLoopback(left->dwIndex)) - ret = 1; - else if (isIfIndexLoopback(right->dwIndex)) - ret = -1; - - return ret; -} - /****************************************************************** * AllocateAndGetIpAddrTableFromStack (IPHLPAPI.@) * @@ -2131,6 +2118,10 @@ DWORD WINAPI GetInterfaceInfo( IP_INTERFACE_INFO *table, ULONG *size ) return ERROR_SUCCESS; } +static int ipaddrrow_cmp( const void *a, const void *b ) +{ + return ((const MIB_IPADDRROW*)a)->dwAddr - ((const MIB_IPADDRROW*)b)->dwAddr; +} /****************************************************************** * GetIpAddrTable (IPHLPAPI.@) @@ -2138,59 +2129,63 @@ DWORD WINAPI GetInterfaceInfo( IP_INTERFACE_INFO *table, ULONG *size ) * Get interface-to-IP address mapping table. * * PARAMS - * pIpAddrTable [Out] buffer for mapping table - * pdwSize [In/Out] length of output buffer - * bOrder [In] whether to sort the table + * table [Out] buffer for mapping table + * size [In/Out] length of output buffer + * sort [In] whether to sort the table * * RETURNS * Success: NO_ERROR * Failure: error code from winerror.h * - * NOTES - * If pdwSize is less than required, the function will return - * ERROR_INSUFFICIENT_BUFFER, and *pdwSize will be set to the required byte - * size. - * If bOrder is true, the returned table will be sorted by the next hop and - * an assortment of arbitrary parameters. */ -DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder) +DWORD WINAPI GetIpAddrTable( MIB_IPADDRTABLE *table, ULONG *size, BOOL sort ) { - DWORD ret; + DWORD err, count, needed, i, loopback, row_num = 0; + struct nsi_ipv4_unicast_key *keys; + struct nsi_ip_unicast_rw *rw; - TRACE("pIpAddrTable %p, pdwSize %p, bOrder %d\n", pIpAddrTable, pdwSize, - (DWORD)bOrder); - if (!pdwSize) - ret = ERROR_INVALID_PARAMETER; - else { - PMIB_IPADDRTABLE table; + TRACE( "table %p, size %p, sort %d\n", table, size, sort ); + if (!size) return ERROR_INVALID_PARAMETER; + + err = NsiAllocateAndGetTable( 1, &NPI_MS_IPV4_MODULEID, NSI_IP_UNICAST_TABLE, (void **)&keys, sizeof(*keys), + (void **)&rw, sizeof(*rw), NULL, 0, NULL, 0, &count, 0 ); + if (err) return err; - ret = getIPAddrTable(&table, GetProcessHeap(), 0); - if (ret == NO_ERROR) + needed = FIELD_OFFSET( MIB_IPADDRTABLE, table[count] ); + + if (!table || *size < needed) { - ULONG size = FIELD_OFFSET(MIB_IPADDRTABLE, table[table->dwNumEntries]); + *size = needed; + err = ERROR_INSUFFICIENT_BUFFER; + goto err; + } - if (!pIpAddrTable || *pdwSize < size) { - *pdwSize = size; - ret = ERROR_INSUFFICIENT_BUFFER; - } - else { - *pdwSize = size; - memcpy(pIpAddrTable, table, size); - /* sort by numeric IP value */ - if (bOrder) - qsort(pIpAddrTable->table, pIpAddrTable->dwNumEntries, - sizeof(MIB_IPADDRROW), IpAddrTableNumericSorter); - /* sort ensuring loopback interfaces are in the end */ - else - qsort(pIpAddrTable->table, pIpAddrTable->dwNumEntries, - sizeof(MIB_IPADDRROW), IpAddrTableLoopbackSorter); - ret = NO_ERROR; - } - HeapFree(GetProcessHeap(), 0, table); + table->dwNumEntries = count; + + for (loopback = 0; loopback < 2; loopback++) /* Move the loopback addresses to the end */ + { + for (i = 0; i < count; i++) + { + MIB_IPADDRROW *row = table->table + row_num; + + if (!!loopback != (keys[i].luid.Info.IfType == MIB_IF_TYPE_LOOPBACK)) continue; + + row->dwAddr = keys[i].addr.WS_s_addr; + ConvertInterfaceLuidToIndex( &keys[i].luid, &row->dwIndex ); + ConvertLengthToIpv4Mask( rw[i].on_link_prefix, &row->dwMask ); + row->dwBCastAddr = 1; + row->dwReasmSize = 0xffff; + row->unused1 = 0; + row->wType = MIB_IPADDR_PRIMARY; + row_num++; + } } - } - TRACE("returning %d\n", ret); - return ret; + + if (sort) qsort( table->table, count, sizeof(MIB_IPADDRROW), ipaddrrow_cmp ); +err: + NsiFreeTable( keys, rw, NULL, NULL ); + + return err; } diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 1deac9b64f1..51566034f51 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -203,6 +203,8 @@ static void testGetIpAddrTable(void) for (i = 0; i < buf->dwNumEntries; i++) { ok (buf->table[i].wType != 0, "Test[%d]: expected wType > 0\n", i); + ok (buf->table[i].dwBCastAddr == 1, "Test[%d]: got %08x\n", i, buf->table[i].dwBCastAddr); + ok (buf->table[i].dwReasmSize == 0xffff, "Test[%d]: got %08x\n", i, buf->table[i].dwReasmSize); trace("Entry[%d]: addr %s, dwIndex %u, wType 0x%x\n", i, ntoa(buf->table[i].dwAddr), buf->table[i].dwIndex, buf->table[i].wType); }
1
0
0
0
Ziqing Hui : include: Add D2D1Composite definitions.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: 3ef3166b5c0939a84086fcd5aef83f0b20427d63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3ef3166b5c0939a84086fcd5…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu Jul 22 08:44:22 2021 +0800 include: Add D2D1Composite definitions. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d2d1effects.idl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/d2d1effects.idl b/include/d2d1effects.idl index 5dde46cbb6a..4154276345b 100644 --- a/include/d2d1effects.idl +++ b/include/d2d1effects.idl @@ -18,6 +18,7 @@ cpp_quote("DEFINE_GUID(CLSID_D2D12DAffineTransform, 0x6aa97485,0x6354,0x4cfc,0x90,0x8c,0xe4,0xa7,0x4f,0x62,0xc9,0x6c);") cpp_quote("DEFINE_GUID(CLSID_D2D13DPerspectiveTransform, 0xc2844d0b,0x3d86,0x46e7,0x85,0xba,0x52,0x6c,0x92,0x40,0xf3,0xfb);") +cpp_quote("DEFINE_GUID(CLSID_D2D1Composite, 0x48fc9f51,0xf6ac,0x48f1,0x8b,0x58,0x3b,0x28,0xac,0x46,0xf7,0x6d);") typedef enum D2D1_BORDER_MODE { @@ -68,3 +69,9 @@ typedef enum D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 0x4, D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff } D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE; + +typedef enum D2D1_COMPOSITE_PROP +{ + D2D1_COMPOSITE_PROP_MODE = 0x0, + D2D1_COMPOSITE_PROP_FORCE_DWORD = 0xffffffff +} D2D1_COMPOSITE_PROP;
1
0
0
0
Ziqing Hui : include: Add D2D13DPerspectiveTransform definitions.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: e1ad3757dd0a2690cd358b66b13776af1d35b877 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e1ad3757dd0a2690cd358b66…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu Jul 22 08:44:21 2021 +0800 include: Add D2D13DPerspectiveTransform definitions. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d2d1effects.idl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/include/d2d1effects.idl b/include/d2d1effects.idl index ee1dbe94728..5dde46cbb6a 100644 --- a/include/d2d1effects.idl +++ b/include/d2d1effects.idl @@ -16,7 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -cpp_quote("DEFINE_GUID(CLSID_D2D12DAffineTransform, 0x6aa97485,0x6354,0x4cfc,0x90,0x8c,0xe4,0xa7,0x4f,0x62,0xc9,0x6c);") +cpp_quote("DEFINE_GUID(CLSID_D2D12DAffineTransform, 0x6aa97485,0x6354,0x4cfc,0x90,0x8c,0xe4,0xa7,0x4f,0x62,0xc9,0x6c);") +cpp_quote("DEFINE_GUID(CLSID_D2D13DPerspectiveTransform, 0xc2844d0b,0x3d86,0x46e7,0x85,0xba,0x52,0x6c,0x92,0x40,0xf3,0xfb);") typedef enum D2D1_BORDER_MODE { @@ -44,3 +45,26 @@ typedef enum D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 0x5, D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff } D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE; + +typedef enum D2D1_3DPERSPECTIVETRANSFORM_PROP +{ + D2D1_3DPERSPECTIVETRANSFORM_PROP_INTERPOLATION_MODE = 0x0, + D2D1_3DPERSPECTIVETRANSFORM_PROP_BORDER_MODE = 0x1, + D2D1_3DPERSPECTIVETRANSFORM_PROP_DEPTH = 0x2, + D2D1_3DPERSPECTIVETRANSFORM_PROP_PERSPECTIVE_ORIGIN = 0x3, + D2D1_3DPERSPECTIVETRANSFORM_PROP_LOCAL_OFFSET = 0x4, + D2D1_3DPERSPECTIVETRANSFORM_PROP_GLOBAL_OFFSET = 0x5, + D2D1_3DPERSPECTIVETRANSFORM_PROP_ROTATION_ORIGIN = 0x6, + D2D1_3DPERSPECTIVETRANSFORM_PROP_ROTATION = 0x7, + D2D1_3DPERSPECTIVETRANSFORM_PROP_FORCE_DWORD = 0xffffffff +} D2D1_3DPERSPECTIVETRANSFORM_PROP; + +typedef enum D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE +{ + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0x0, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_LINEAR = 0x1, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_CUBIC = 0x2, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 0x3, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 0x4, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff +} D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE;
1
0
0
0
Alexandre Julliard : wow64: Add thunks for the atom syscalls.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: de9f285ee5fae8eb7046dc4385daebb3ff243032 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de9f285ee5fae8eb7046dc43…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 22 18:09:12 2021 +0200 wow64: Add thunks for the atom syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/syscall.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 4 ++++ 2 files changed, 57 insertions(+) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 10abe7a8b38..5c9bc8d4f27 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -78,6 +78,19 @@ void __cdecl __wine_spec_unimplemented_stub( const char *module, const char *fun } +/********************************************************************** + * wow64_NtAddAtom + */ +NTSTATUS WINAPI wow64_NtAddAtom( UINT *args ) +{ + const WCHAR *name = get_ptr( &args ); + ULONG len = get_ulong( &args ); + RTL_ATOM *atom = get_ptr( &args ); + + return NtAddAtom( name, len, atom ); +} + + /********************************************************************** * wow64_NtAllocateLocallyUniqueId */ @@ -114,6 +127,30 @@ NTSTATUS WINAPI wow64_NtClose( UINT *args ) } +/********************************************************************** + * wow64_NtDeleteAtom + */ +NTSTATUS WINAPI wow64_NtDeleteAtom( UINT *args ) +{ + RTL_ATOM atom = get_ulong( &args ); + + return NtDeleteAtom( atom ); +} + + +/********************************************************************** + * wow64_NtFindAtom + */ +NTSTATUS WINAPI wow64_NtFindAtom( UINT *args ) +{ + const WCHAR *name = get_ptr( &args ); + ULONG len = get_ulong( &args ); + RTL_ATOM *atom = get_ptr( &args ); + + return NtFindAtom( name, len, atom ); +} + + /********************************************************************** * wow64_NtGetCurrentProcessorNumber */ @@ -146,6 +183,22 @@ NTSTATUS WINAPI wow64_NtQueryDefaultUILanguage( UINT *args ) } +/********************************************************************** + * wow64_NtQueryInformationAtom + */ +NTSTATUS WINAPI wow64_NtQueryInformationAtom( UINT *args ) +{ + RTL_ATOM atom = get_ulong( &args ); + ATOM_INFORMATION_CLASS class = get_ulong( &args ); + void *info = get_ptr( &args ); + ULONG len = get_ulong( &args ); + ULONG *retlen = get_ptr( &args ); + + if (class != AtomBasicInformation) FIXME( "class %u not supported\n", class ); + return NtQueryInformationAtom( atom, class, info, len, retlen ); +} + + /********************************************************************** * wow64_NtQueryInstallUILanguage */ diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 33e1670a391..583af0db476 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -22,12 +22,16 @@ #define __WOW64_SYSCALL_H #define ALL_SYSCALLS \ + SYSCALL_ENTRY( NtAddAtom ) \ SYSCALL_ENTRY( NtAllocateLocallyUniqueId ) \ SYSCALL_ENTRY( NtAllocateUuids ) \ SYSCALL_ENTRY( NtClose ) \ + SYSCALL_ENTRY( NtDeleteAtom ) \ + SYSCALL_ENTRY( NtFindAtom ) \ SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ SYSCALL_ENTRY( NtQueryDefaultLocale ) \ SYSCALL_ENTRY( NtQueryDefaultUILanguage ) \ + SYSCALL_ENTRY( NtQueryInformationAtom ) \ SYSCALL_ENTRY( NtQueryInstallUILanguage ) \ SYSCALL_ENTRY( NtSetDefaultLocale ) \ SYSCALL_ENTRY( NtSetDefaultUILanguage )
1
0
0
0
Alexandre Julliard : wow64: Add thunks for a few simple syscalls.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: e8984787ac2bbfdaaeca9483352c6d5525d84a4e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e8984787ac2bbfdaaeca9483…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 22 18:05:19 2021 +0200 wow64: Add thunks for a few simple syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/syscall.c | 110 ++++++++++++++++++++++++++++++++++++++++++++- dlls/wow64/syscall.h | 35 +++++++++++++++ dlls/wow64/wow64_private.h | 10 +++++ 3 files changed, 153 insertions(+), 2 deletions(-) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 12e13b17574..10abe7a8b38 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -39,12 +39,16 @@ typedef NTSTATUS (WINAPI *syscall_thunk)( UINT *args ); static const syscall_thunk syscall_thunks[] = { - NULL +#define SYSCALL_ENTRY(func) wow64_ ## func, + ALL_SYSCALLS +#undef SYSCALL_ENTRY }; static const char *syscall_names[] = { - "" +#define SYSCALL_ENTRY(func) #func, + ALL_SYSCALLS +#undef SYSCALL_ENTRY }; static unsigned short syscall_map[1024]; @@ -74,6 +78,108 @@ void __cdecl __wine_spec_unimplemented_stub( const char *module, const char *fun } +/********************************************************************** + * wow64_NtAllocateLocallyUniqueId + */ +NTSTATUS WINAPI wow64_NtAllocateLocallyUniqueId( UINT *args ) +{ + LUID *luid = get_ptr( &args ); + + return NtAllocateLocallyUniqueId( luid ); +} + + +/********************************************************************** + * wow64_NtAllocateUuids + */ +NTSTATUS WINAPI wow64_NtAllocateUuids( UINT *args ) +{ + ULARGE_INTEGER *time = get_ptr( &args ); + ULONG *delta = get_ptr( &args ); + ULONG *sequence = get_ptr( &args ); + UCHAR *seed = get_ptr( &args ); + + return NtAllocateUuids( time, delta, sequence, seed ); +} + + +/********************************************************************** + * wow64_NtClose + */ +NTSTATUS WINAPI wow64_NtClose( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + + return NtClose( handle ); +} + + +/********************************************************************** + * wow64_NtGetCurrentProcessorNumber + */ +NTSTATUS WINAPI wow64_NtGetCurrentProcessorNumber( UINT *args ) +{ + return NtGetCurrentProcessorNumber(); +} + + +/********************************************************************** + * wow64_NtQueryDefaultLocale + */ +NTSTATUS WINAPI wow64_NtQueryDefaultLocale( UINT *args ) +{ + BOOLEAN user = get_ulong( &args ); + LCID *lcid = get_ptr( &args ); + + return NtQueryDefaultLocale( user, lcid ); +} + + +/********************************************************************** + * wow64_NtQueryDefaultUILanguage + */ +NTSTATUS WINAPI wow64_NtQueryDefaultUILanguage( UINT *args ) +{ + LANGID *lang = get_ptr( &args ); + + return NtQueryDefaultUILanguage( lang ); +} + + +/********************************************************************** + * wow64_NtQueryInstallUILanguage + */ +NTSTATUS WINAPI wow64_NtQueryInstallUILanguage( UINT *args ) +{ + LANGID *lang = get_ptr( &args ); + + return NtQueryInstallUILanguage( lang ); +} + + +/********************************************************************** + * wow64_NtSetDefaultLocale + */ +NTSTATUS WINAPI wow64_NtSetDefaultLocale( UINT *args ) +{ + BOOLEAN user = get_ulong( &args ); + LCID lcid = get_ulong( &args ); + + return NtSetDefaultLocale( user, lcid ); +} + + +/********************************************************************** + * wow64_NtSetDefaultUILanguage + */ +NTSTATUS WINAPI wow64_NtSetDefaultUILanguage( UINT *args ) +{ + LANGID lang = get_ulong( &args ); + + return NtSetDefaultUILanguage( lang ); +} + + /********************************************************************** * get_syscall_num */ diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h new file mode 100644 index 00000000000..33e1670a391 --- /dev/null +++ b/dlls/wow64/syscall.h @@ -0,0 +1,35 @@ +/* + * WoW64 syscall definitions + * + * Copyright 2021 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WOW64_SYSCALL_H +#define __WOW64_SYSCALL_H + +#define ALL_SYSCALLS \ + SYSCALL_ENTRY( NtAllocateLocallyUniqueId ) \ + SYSCALL_ENTRY( NtAllocateUuids ) \ + SYSCALL_ENTRY( NtClose ) \ + SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ + SYSCALL_ENTRY( NtQueryDefaultLocale ) \ + SYSCALL_ENTRY( NtQueryDefaultUILanguage ) \ + SYSCALL_ENTRY( NtQueryInstallUILanguage ) \ + SYSCALL_ENTRY( NtSetDefaultLocale ) \ + SYSCALL_ENTRY( NtSetDefaultUILanguage ) + +#endif /* __WOW64_SYSCALL_H */ diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index 2c8f6f313fc..c441f1bf481 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -21,6 +21,12 @@ #ifndef __WOW64_PRIVATE_H #define __WOW64_PRIVATE_H +#include "syscall.h" + +#define SYSCALL_ENTRY(func) extern NTSTATUS WINAPI wow64_ ## func( UINT *args ) DECLSPEC_HIDDEN; +ALL_SYSCALLS +#undef SYSCALL_ENTRY + extern USHORT native_machine DECLSPEC_HIDDEN; extern USHORT current_machine DECLSPEC_HIDDEN; @@ -43,4 +49,8 @@ static inline const WCHAR *get_machine_wow64_dir( USHORT machine ) } } +static inline ULONG get_ulong( UINT **args ) { return *(*args)++; } +static inline HANDLE get_handle( UINT **args ) { return LongToHandle( *(*args)++ ); } +static inline void *get_ptr( UINT **args ) { return ULongToPtr( *(*args)++ ); } + #endif /* __WOW64_PRIVATE_H */
1
0
0
0
Alexandre Julliard : wow64: Add support for setting up the syscall table.
by Alexandre Julliard
22 Jul '21
22 Jul '21
Module: wine Branch: master Commit: 1b63875c66c79a337f65c6c66882c8a55430d2c2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b63875c66c79a337f65c6c6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 22 13:42:56 2021 +0200 wow64: Add support for setting up the syscall table. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/syscall.c | 126 ++++++++++++++++++++++++++++++++++++++++++++- dlls/wow64/wow64_private.h | 5 ++ 2 files changed, 129 insertions(+), 2 deletions(-) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 504580e8717..12e13b17574 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -35,6 +35,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(wow); USHORT native_machine = 0; USHORT current_machine = 0; +typedef NTSTATUS (WINAPI *syscall_thunk)( UINT *args ); + +static const syscall_thunk syscall_thunks[] = +{ + NULL +}; + +static const char *syscall_names[] = +{ + "" +}; + +static unsigned short syscall_map[1024]; + +static SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock; + void *dummy = RtlUnwind; BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) @@ -58,6 +74,82 @@ void __cdecl __wine_spec_unimplemented_stub( const char *module, const char *fun } +/********************************************************************** + * get_syscall_num + */ +static DWORD get_syscall_num( const BYTE *syscall ) +{ + DWORD id = ~0u; + + if (!syscall) return id; + switch (current_machine) + { + case IMAGE_FILE_MACHINE_I386: + if (syscall[0] == 0xb8 && syscall[5] == 0xba && syscall[10] == 0xff && syscall[11] == 0xd2) + id = *(DWORD *)(syscall + 1); + break; + + case IMAGE_FILE_MACHINE_ARM: + if (*(WORD *)syscall == 0xb40f) + { + DWORD inst = *(DWORD *)((WORD *)syscall + 1); + id = ((inst << 1) & 0x0800) + ((inst << 12) & 0xf000) + + ((inst >> 20) & 0x0700) + ((inst >> 16) & 0x00ff); + } + break; + } + return id; +} + + +/********************************************************************** + * init_syscall_table + */ +static void init_syscall_table( HMODULE ntdll ) +{ + const IMAGE_EXPORT_DIRECTORY *exports; + const ULONG *functions, *names; + const USHORT *ordinals; + ULONG id, exp_size, exp_pos, wrap_pos; + + exports = RtlImageDirectoryEntryToData( ntdll, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ); + ordinals = get_rva( ntdll, exports->AddressOfNameOrdinals ); + functions = get_rva( ntdll, exports->AddressOfFunctions ); + names = get_rva( ntdll, exports->AddressOfNames ); + + for (exp_pos = wrap_pos = 0; exp_pos < exports->NumberOfNames; exp_pos++) + { + char *name = get_rva( ntdll, names[exp_pos] ); + int res = -1; + + if (strncmp( name, "Nt", 2 ) && strncmp( name, "wine", 4 ) && strncmp( name, "__wine", 6 )) + continue; /* not a syscall */ + + if ((id = get_syscall_num( get_rva( ntdll, functions[ordinals[exp_pos]] ))) == ~0u) + continue; /* not a syscall */ + + if (wrap_pos < ARRAY_SIZE(syscall_names)) + res = strcmp( name, syscall_names[wrap_pos] ); + + if (!res) /* got a match */ + { + if (id < ARRAY_SIZE(syscall_map)) syscall_map[id] = wrap_pos++; + else ERR( "invalid syscall id %04x for %s\n", id, name ); + } + else if (res > 0) + { + FIXME( "no ntdll export for syscall %s\n", syscall_names[wrap_pos] ); + wrap_pos++; + exp_pos--; /* try again */ + } + else FIXME( "missing wrapper for syscall %04x %s\n", id, name ); + } + + for ( ; wrap_pos < ARRAY_SIZE(syscall_thunks); wrap_pos++) + FIXME( "no ntdll export for syscall %s\n", syscall_names[wrap_pos] ); +} + + /********************************************************************** * load_cpu_dll */ @@ -100,10 +192,24 @@ static HMODULE load_cpu_dll(void) */ static void process_init(void) { + HMODULE module; + UNICODE_STRING str; + RtlWow64GetProcessMachines( GetCurrentProcess(), ¤t_machine, &native_machine ); if (!current_machine) current_machine = native_machine; +#define GET_PTR(name) p ## name = RtlFindExportedRoutineByName( module, #name ) + + RtlInitUnicodeString( &str, L"ntdll.dll" ); + LdrGetDllHandle( NULL, 0, &str, &module ); + GET_PTR( LdrSystemDllInitBlock ); + + module = (HMODULE)(ULONG_PTR)pLdrSystemDllInitBlock->ntdll_handle; + init_syscall_table( module ); + load_cpu_dll(); + +#undef GET_PTR } @@ -112,8 +218,24 @@ static void process_init(void) */ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args ) { - FIXME( "stub\n" ); - return STATUS_INVALID_SYSTEM_SERVICE; + NTSTATUS status; + + if (num >= ARRAY_SIZE( syscall_map ) || !syscall_map[num]) + { + ERR( "unsupported syscall %04x\n", num ); + return STATUS_INVALID_SYSTEM_SERVICE; + } + __TRY + { + syscall_thunk thunk = syscall_thunks[syscall_map[num]]; + status = thunk( args ); + } + __EXCEPT_ALL + { + status = GetExceptionCode(); + } + __ENDTRY; + return status; } diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index 52cc40566b1..2c8f6f313fc 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -24,6 +24,11 @@ extern USHORT native_machine DECLSPEC_HIDDEN; extern USHORT current_machine DECLSPEC_HIDDEN; +static inline void *get_rva( HMODULE module, DWORD va ) +{ + return (void *)((char *)module + va); +} + /* cf. GetSystemWow64Directory2 */ static inline const WCHAR *get_machine_wow64_dir( USHORT machine ) {
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
73
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
Results per page:
10
25
50
100
200