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
August 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
1051 discussions
Start a n
N
ew thread
Alexandre Julliard : wow64: Add thunks for the system information query syscalls.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: e145a06c46a248e4e7e239935a5cbe9231911cb5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e145a06c46a248e4e7e23993…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Aug 2 14:54:48 2021 +0200 wow64: Add thunks for the system information query syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/struct32.h | 210 ++++++++++++++++++++ dlls/wow64/syscall.h | 3 + dlls/wow64/system.c | 525 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 738 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e145a06c46a248e4e7e2…
1
0
0
0
Alexandre Julliard : ntdll: Make wine_nt_to_unix_file_name() and wine_unix_to_nt_file_name() follow NT syscall conventions.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 9bf46d5ce608a97e264681d2637ff3105e42c363 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9bf46d5ce608a97e264681d2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Aug 2 15:54:05 2021 +0200 ntdll: Make wine_nt_to_unix_file_name() and wine_unix_to_nt_file_name() follow NT syscall conventions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 8 +++++--- dlls/kernel32/path.c | 8 +++++--- dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/path.c | 6 ++++-- dlls/ntdll/unix/file.c | 11 +++++------ include/winternl.h | 6 +++--- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index ee14bd25119..54af7562321 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1352,7 +1352,7 @@ static int add_unix_face( const char *unix_name, const WCHAR *file, void *data_p static WCHAR *get_dos_file_name( LPCSTR str ) { WCHAR *buffer; - SIZE_T len = strlen(str) + 1; + ULONG len = strlen(str) + 1; len += 8; /* \??\unix prefix */ if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; @@ -1374,11 +1374,13 @@ static WCHAR *get_dos_file_name( LPCSTR str ) static char *get_unix_file_name( LPCWSTR dosW ) { UNICODE_STRING nt_name; + OBJECT_ATTRIBUTES attr; NTSTATUS status; - SIZE_T size = 256; + ULONG size = 256; char *buffer; if (!RtlDosPathNameToNtPathName_U( dosW, &nt_name, NULL, NULL )) return NULL; + InitializeObjectAttributes( &attr, &nt_name, 0, 0, NULL ); for (;;) { if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, size ))) @@ -1386,7 +1388,7 @@ static char *get_unix_file_name( LPCWSTR dosW ) RtlFreeUnicodeString( &nt_name ); return NULL; } - status = wine_nt_to_unix_file_name( &nt_name, buffer, &size, FILE_OPEN_IF ); + status = wine_nt_to_unix_file_name( &attr, buffer, &size, FILE_OPEN_IF ); if (status != STATUS_BUFFER_TOO_SMALL) break; RtlFreeHeap( GetProcessHeap(), 0, buffer ); } diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 023dff826d6..957e9fca01d 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -275,11 +275,13 @@ DWORD /*BOOLEAN*/ WINAPI KERNEL32_Wow64EnableWow64FsRedirection( BOOLEAN enable char * CDECL wine_get_unix_file_name( LPCWSTR dosW ) { UNICODE_STRING nt_name; + OBJECT_ATTRIBUTES attr; NTSTATUS status; - SIZE_T size = 256; + ULONG size = 256; char *buffer; if (!RtlDosPathNameToNtPathName_U( dosW, &nt_name, NULL, NULL )) return NULL; + InitializeObjectAttributes( &attr, &nt_name, 0, 0, NULL ); for (;;) { if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size ))) @@ -287,7 +289,7 @@ char * CDECL wine_get_unix_file_name( LPCWSTR dosW ) RtlFreeUnicodeString( &nt_name ); return NULL; } - status = wine_nt_to_unix_file_name( &nt_name, buffer, &size, FILE_OPEN_IF ); + status = wine_nt_to_unix_file_name( &attr, buffer, &size, FILE_OPEN_IF ); if (status != STATUS_BUFFER_TOO_SMALL) break; HeapFree( GetProcessHeap(), 0, buffer ); } @@ -313,7 +315,7 @@ WCHAR * CDECL wine_get_dos_file_name( LPCSTR str ) UNICODE_STRING nt_name; NTSTATUS status; WCHAR *buffer; - SIZE_T len = strlen(str) + 1; + ULONG len = strlen(str) + 1; if (str[0] != '/') /* relative path name */ { diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index aad7bd89d14..5ac5a16ed44 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1645,5 +1645,5 @@ @ cdecl wine_get_host_version(ptr ptr) # Filesystem -@ cdecl -syscall wine_nt_to_unix_file_name(ptr ptr ptr long) -@ cdecl -syscall wine_unix_to_nt_file_name(str ptr ptr) +@ stdcall -syscall wine_nt_to_unix_file_name(ptr ptr ptr long) +@ stdcall -syscall wine_unix_to_nt_file_name(str ptr ptr) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 53be23fe4ec..131b0e33683 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -606,17 +606,19 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size) { char *unix_name; WCHAR *nt_str; - SIZE_T buflen; + ULONG buflen; NTSTATUS status; UNICODE_STRING str; + OBJECT_ATTRIBUTES attr; nt_str = RtlAllocateHeap( GetProcessHeap(), 0, (wcslen(name) + 9) * sizeof(WCHAR) ); wcscpy( nt_str, L"\\??\\unix" ); wcscat( nt_str, name ); RtlInitUnicodeString( &str, nt_str ); + InitializeObjectAttributes( &attr, &str, 0, 0, NULL ); buflen = 3 * wcslen(name) + 1; unix_name = RtlAllocateHeap( GetProcessHeap(), 0, buflen ); - status = wine_nt_to_unix_file_name( &str, unix_name, &buflen, FILE_OPEN_IF ); + status = wine_nt_to_unix_file_name( &attr, unix_name, &buflen, FILE_OPEN_IF ); if (!status || status == STATUS_NO_SUCH_FILE) { buflen = wcslen(name) + 9; diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 10cbd64be70..45e444d8576 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3435,17 +3435,16 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U * element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is * returned, but the unix name is still filled in properly. */ -NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nameA, SIZE_T *size, +NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size, UINT disposition ) { char *buffer = NULL; NTSTATUS status; UNICODE_STRING redir; - OBJECT_ATTRIBUTES attr; + OBJECT_ATTRIBUTES new_attr = *attr; - InitializeObjectAttributes( &attr, (UNICODE_STRING *)nameW, OBJ_CASE_INSENSITIVE, 0, NULL ); - get_redirect( &attr, &redir ); - status = nt_to_unix_file_name( &attr, &buffer, disposition ); + get_redirect( &new_attr, &redir ); + status = nt_to_unix_file_name( &new_attr, &buffer, disposition ); if (buffer) { @@ -3576,7 +3575,7 @@ NTSTATUS unix_to_nt_file_name( const char *name, WCHAR **nt ) /****************************************************************** * wine_unix_to_nt_file_name */ -NTSTATUS CDECL wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, SIZE_T *size ) +NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, ULONG *size ) { WCHAR *nt_name = NULL; NTSTATUS status; diff --git a/include/winternl.h b/include/winternl.h index f42261a9797..663d8aceaaa 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4508,9 +4508,9 @@ NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL); /* Wine internal functions */ -NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nameA, SIZE_T *size, - UINT disposition ); -NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, SIZE_T *size ); +NTSYSAPI NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size, + UINT disposition ); +NTSYSAPI NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, ULONG *size ); /***********************************************************************
1
0
0
0
Alexandre Julliard : ntdll: Fix the SYSTEM_CACHE_INFORMATION structure definition.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 37ed43a1717fd7a58b8d6733dc65783bd5c57709 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37ed43a1717fd7a58b8d6733…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Aug 2 14:53:11 2021 +0200 ntdll: Fix the SYSTEM_CACHE_INFORMATION structure definition. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/info.c | 1 - include/winternl.h | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index ccce197206b..8bd8b319241 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -869,7 +869,6 @@ static void test_query_cache(void) ULONG expected; INT i; - /* the large SYSTEM_CACHE_INFORMATION on WIN64 is not documented */ expected = sizeof(SYSTEM_CACHE_INFORMATION); for (i = sizeof(buffer); i>= expected; i--) { diff --git a/include/winternl.h b/include/winternl.h index 68aa4afc176..f42261a9797 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2444,15 +2444,15 @@ typedef struct _SYSTEM_HANDLE_INFORMATION_EX /* System Information Class 0x15 */ typedef struct _SYSTEM_CACHE_INFORMATION { - ULONG CurrentSize; - ULONG PeakSize; + SIZE_T CurrentSize; + SIZE_T PeakSize; ULONG PageFaultCount; - ULONG MinimumWorkingSet; - ULONG MaximumWorkingSet; - ULONG unused[4]; -#ifdef _WIN64 - ULONG unknown64[7]; -#endif + SIZE_T MinimumWorkingSet; + SIZE_T MaximumWorkingSet; + SIZE_T CurrentSizeIncludingTransitionInPages; + SIZE_T PeakSizeIncludingTransitionInPages; + ULONG TransitionRePurposeCount; + ULONG Flags; } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION; /* System Information Class 0x17 */
1
0
0
0
Nikolay Sivov : include: Add IMFVideoProcessorControl3 definition.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 1c2b728ae34bbbb05cac4d9cc5384261588db746 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1c2b728ae34bbbb05cac4d9c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Aug 2 13:05:52 2021 +0300 include: Add IMFVideoProcessorControl3 definition. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mfidl.idl | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/mfidl.idl b/include/mfidl.idl index 5b16c08bb90..62e0ca3025a 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -1231,6 +1231,48 @@ interface IMFVideoProcessorControl2 : IMFVideoProcessorControl ); } +typedef enum _MFVideoSphericalFormat +{ + MFVideoSphericalFormat_Unsupported, + MFVideoSphericalFormat_Equirectangular, +} MFVideoSphericalFormat; + +typedef enum MFVideoSphericalProjectionMode +{ + MFVideoSphericalProjectionMode_Spherical, + MFVideoSphericalProjectionMode_Flat, +} MFVideoSphericalProjectionMode; + +[ + object, + uuid(2424b3f2-eb23-40f1-91aa-74bddeea0883), + local +] +interface IMFVideoProcessorControl3 : IMFVideoProcessorControl2 +{ + HRESULT GetNaturalOutputType( + [out] IMFMediaType **media_type + ); + + HRESULT EnableSphericalVideoProcessing( + [in] BOOL enable, + [in] MFVideoSphericalFormat format, + [in] MFVideoSphericalProjectionMode projection_mode + ); + + HRESULT SetSphericalVideoProperties( + [in] float x, + [in] float y, + [in] float z, + [in] float w, + [in] float fov + ); + + HRESULT SetOutputDevice( + [in] IUnknown *output_device + ); +} + [ object, uuid(2347d60b-3fb5-480c-8803-8df3adcd3ef0),
1
0
0
0
Nikolay Sivov : evr: Added MFIsFormatYUV().
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 68d75bbded45d3aa93ff22fd969ed4ecafe9c97c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=68d75bbded45d3aa93ff22fd…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Aug 2 13:00:08 2021 +0300 evr: Added MFIsFormatYUV(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/evr/evr.spec | 2 +- dlls/evr/main.c | 26 ++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 42 ++++++++++++++++++++++++++++++++++++++++++ include/mfapi.h | 1 + 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/dlls/evr/evr.spec b/dlls/evr/evr.spec index 8aea0a607a8..fd96781e903 100644 --- a/dlls/evr/evr.spec +++ b/dlls/evr/evr.spec @@ -25,4 +25,4 @@ @ stub MFGetUncompressedVideoFormat @ stub MFInitVideoFormat @ stdcall -import MFInitVideoFormat_RGB(ptr long long long) -@ stub MFIsFormatYUV +@ stdcall MFIsFormatYUV(long) diff --git a/dlls/evr/main.c b/dlls/evr/main.c index e843f15c04f..b5bab74c4f6 100644 --- a/dlls/evr/main.c +++ b/dlls/evr/main.c @@ -25,6 +25,7 @@ #include "ole2.h" #include "rpcproxy.h" +#include "d3d9.h" #include "evr_private.h" @@ -206,3 +207,28 @@ HRESULT WINAPI MFCreateVideoMixerAndPresenter(IUnknown *mixer_outer, IUnknown *p return hr; } + +/*********************************************************************** + * MFIsFormatYUV (evr.@) + */ +BOOL WINAPI MFIsFormatYUV(DWORD format) +{ + TRACE("%s.\n", debugstr_an((char *)&format, 4)); + + switch (format) + { + case D3DFMT_UYVY: + case D3DFMT_YUY2: + case MAKEFOURCC('A','Y','U','V'): + case MAKEFOURCC('I','M','C','1'): + case MAKEFOURCC('I','M','C','2'): + case MAKEFOURCC('Y','V','1','2'): + case MAKEFOURCC('N','V','1','1'): + case MAKEFOURCC('N','V','1','2'): + case MAKEFOURCC('Y','2','1','0'): + case MAKEFOURCC('Y','2','1','6'): + return TRUE; + default: + return FALSE; + } +} diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index d240ebe4456..01edda7bc9b 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2722,6 +2722,47 @@ done: DestroyWindow(window); } +static void test_MFIsFormatYUV(void) +{ + static const DWORD formats[] = + { + D3DFMT_UYVY, + D3DFMT_YUY2, + MAKEFOURCC('A','Y','U','V'), + MAKEFOURCC('I','M','C','1'), + MAKEFOURCC('I','M','C','2'), + MAKEFOURCC('Y','V','1','2'), + MAKEFOURCC('N','V','1','1'), + MAKEFOURCC('N','V','1','2'), + MAKEFOURCC('Y','2','1','0'), + MAKEFOURCC('Y','2','1','6'), + }; + static const DWORD unsupported_formats[] = + { + D3DFMT_A8R8G8B8, + MAKEFOURCC('I','Y','U','V'), + MAKEFOURCC('I','4','2','0'), + MAKEFOURCC('Y','V','Y','U'), + MAKEFOURCC('Y','V','U','9'), + MAKEFOURCC('Y','4','1','0'), + MAKEFOURCC('Y','4','1','6'), + }; + unsigned int i; + BOOL ret; + + for (i = 0; i < ARRAY_SIZE(formats); ++i) + { + ret = MFIsFormatYUV(formats[i]); + ok(ret, "Unexpected ret %d, format %s.\n", ret, debugstr_an((char *)&formats[i], 4)); + } + + for (i = 0; i < ARRAY_SIZE(unsupported_formats); ++i) + { + ret = MFIsFormatYUV(unsupported_formats[i]); + ok(!ret, "Unexpected ret %d, format %s.\n", ret, debugstr_an((char *)&unsupported_formats[i], 4)); + } +} + START_TEST(evr) { CoInitialize(NULL); @@ -2746,6 +2787,7 @@ START_TEST(evr) test_mixer_output_rectangle(); test_mixer_zorder(); test_mixer_samples(); + test_MFIsFormatYUV(); CoUninitialize(); } diff --git a/include/mfapi.h b/include/mfapi.h index 382210ad9e2..bcb5d26121e 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -558,6 +558,7 @@ HRESULT WINAPI MFTEnum2(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INF HRESULT WINAPI MFTEnumEx(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type, const MFT_REGISTER_TYPE_INFO *output_type, IMFActivate ***activate, UINT32 *pcount); +BOOL WINAPI MFIsFormatYUV(DWORD format); HRESULT WINAPI MFInitAttributesFromBlob(IMFAttributes *attributes, const UINT8 *buffer, UINT size); HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WAVEFORMATEX *format, UINT32 size); HRESULT WINAPI MFInitVideoFormat_RGB(MFVIDEOFORMAT *format, DWORD width, DWORD height, DWORD d3dformat);
1
0
0
0
Zebediah Figura : ws2_32: Move the setsockopt(TCP_NODELAY) implementation to ntdll.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 8c47f02cb53a261f7836a26ffd1aa88c77f0da16 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8c47f02cb53a261f7836a26f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Jul 30 18:55:40 2021 -0500 ws2_32: Move the setsockopt(TCP_NODELAY) implementation to ntdll. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 3 + dlls/ws2_32/socket.c | 185 +---------------------------------------------- include/wine/afd.h | 1 + 3 files changed, 6 insertions(+), 183 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 86e415f5dce..0e52db178d8 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -2002,6 +2002,9 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc case IOCTL_AFD_WINE_GET_TCP_NODELAY: return do_getsockopt( handle, io, IPPROTO_TCP, TCP_NODELAY, out_buffer, out_size ); + case IOCTL_AFD_WINE_SET_TCP_NODELAY: + return do_setsockopt( handle, io, IPPROTO_TCP, TCP_NODELAY, in_buffer, in_size ); + default: { if ((code >> 16) == FILE_DEVICE_NETWORK) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index ab1578ebed4..f7996410db1 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -31,10 +31,6 @@ #include "ws2_32_private.h" -#if defined(linux) && !defined(IP_UNICAST_IF) -#define IP_UNICAST_IF 50 -#endif - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) # define sipx_network sipx_addr.x_net # define sipx_node sipx_addr.x_host.c_host @@ -428,80 +424,6 @@ static int ws_protocol_info(SOCKET s, int unicode, WSAPROTOCOL_INFOW *buffer, in #define MAP_OPTION(opt) { WS_##opt, opt } -static const int ws_sock_map[][2] = -{ - MAP_OPTION( SO_DEBUG ), - MAP_OPTION( SO_ACCEPTCONN ), - MAP_OPTION( SO_REUSEADDR ), - MAP_OPTION( SO_KEEPALIVE ), - MAP_OPTION( SO_DONTROUTE ), - MAP_OPTION( SO_BROADCAST ), - MAP_OPTION( SO_LINGER ), - MAP_OPTION( SO_OOBINLINE ), - MAP_OPTION( SO_SNDBUF ), - MAP_OPTION( SO_RCVBUF ), - MAP_OPTION( SO_ERROR ), - MAP_OPTION( SO_TYPE ), -#ifdef SO_RCVTIMEO - MAP_OPTION( SO_RCVTIMEO ), -#endif -#ifdef SO_SNDTIMEO - MAP_OPTION( SO_SNDTIMEO ), -#endif -}; - -static const int ws_tcp_map[][2] = -{ -#ifdef TCP_NODELAY - MAP_OPTION( TCP_NODELAY ), -#endif -}; - -static const int ws_ip_map[][2] = -{ - MAP_OPTION( IP_MULTICAST_IF ), - MAP_OPTION( IP_MULTICAST_TTL ), - MAP_OPTION( IP_MULTICAST_LOOP ), - MAP_OPTION( IP_ADD_MEMBERSHIP ), - MAP_OPTION( IP_DROP_MEMBERSHIP ), - MAP_OPTION( IP_ADD_SOURCE_MEMBERSHIP ), - MAP_OPTION( IP_DROP_SOURCE_MEMBERSHIP ), - MAP_OPTION( IP_BLOCK_SOURCE ), - MAP_OPTION( IP_UNBLOCK_SOURCE ), - MAP_OPTION( IP_OPTIONS ), -#ifdef IP_HDRINCL - MAP_OPTION( IP_HDRINCL ), -#endif - MAP_OPTION( IP_TOS ), - MAP_OPTION( IP_TTL ), -#if defined(IP_PKTINFO) - MAP_OPTION( IP_PKTINFO ), -#elif defined(IP_RECVDSTADDR) - { WS_IP_PKTINFO, IP_RECVDSTADDR }, -#endif -#ifdef IP_UNICAST_IF - MAP_OPTION( IP_UNICAST_IF ), -#endif -}; - -static const int ws_ipv6_map[][2] = -{ -#ifdef IPV6_ADD_MEMBERSHIP - MAP_OPTION( IPV6_ADD_MEMBERSHIP ), -#endif -#ifdef IPV6_DROP_MEMBERSHIP - MAP_OPTION( IPV6_DROP_MEMBERSHIP ), -#endif - MAP_OPTION( IPV6_MULTICAST_IF ), - MAP_OPTION( IPV6_MULTICAST_HOPS ), - MAP_OPTION( IPV6_MULTICAST_LOOP ), - MAP_OPTION( IPV6_UNICAST_HOPS ), - MAP_OPTION( IPV6_V6ONLY ), -#ifdef IPV6_UNICAST_IF - MAP_OPTION( IPV6_UNICAST_IF ), -#endif -}; - static const int ws_socktype_map[][2] = { MAP_OPTION( SOCK_DGRAM ), @@ -578,14 +500,6 @@ UINT sock_get_error( int err ) } } -static UINT wsaErrno(void) -{ - int loc_errno = errno; - WARN("errno %d, (%s).\n", loc_errno, strerror(loc_errno)); - - return sock_get_error( loc_errno ); -} - static DWORD NtStatusToWSAError( NTSTATUS status ) { static const struct @@ -743,66 +657,6 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) return TRUE; } -/*********************************************************************** - * convert_sockopt() - * - * Converts socket flags from Windows format. - * Return 1 if converted, 0 if not (error). - */ -static int convert_sockopt(INT *level, INT *optname) -{ - unsigned int i; - switch (*level) - { - case WS_SOL_SOCKET: - *level = SOL_SOCKET; - for(i = 0; i < ARRAY_SIZE(ws_sock_map); i++) { - if( ws_sock_map[i][0] == *optname ) - { - *optname = ws_sock_map[i][1]; - return 1; - } - } - FIXME("Unknown SOL_SOCKET optname 0x%x\n", *optname); - break; - case WS_IPPROTO_TCP: - *level = IPPROTO_TCP; - for(i = 0; i < ARRAY_SIZE(ws_tcp_map); i++) { - if ( ws_tcp_map[i][0] == *optname ) - { - *optname = ws_tcp_map[i][1]; - return 1; - } - } - FIXME("Unknown IPPROTO_TCP optname 0x%x\n", *optname); - break; - case WS_IPPROTO_IP: - *level = IPPROTO_IP; - for(i = 0; i < ARRAY_SIZE(ws_ip_map); i++) { - if (ws_ip_map[i][0] == *optname ) - { - *optname = ws_ip_map[i][1]; - return 1; - } - } - FIXME("Unknown IPPROTO_IP optname 0x%x\n", *optname); - break; - case WS_IPPROTO_IPV6: - *level = IPPROTO_IPV6; - for(i = 0; i < ARRAY_SIZE(ws_ipv6_map); i++) { - if (ws_ipv6_map[i][0] == *optname ) - { - *optname = ws_ipv6_map[i][1]; - return 1; - } - } - FIXME("Unknown IPPROTO_IPV6 optname 0x%x\n", *optname); - break; - default: FIXME("Unimplemented or unknown socket level\n"); - } - return 0; -} - int convert_socktype_w2u(int windowssocktype) { unsigned int i; @@ -3219,9 +3073,6 @@ static int server_setsockopt( SOCKET s, ULONG code, const char *optval, int optl int WINAPI WS_setsockopt(SOCKET s, int level, int optname, const char *optval, int optlen) { - int fd; - int woptval; - TRACE("(socket %04lx, %s, optval %s, optlen %d)\n", s, debugstr_sockopt(level, optname), debugstr_optval(optval, optlen), optlen); @@ -3370,13 +3221,12 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, } break; /* case WS_NSPROTO_IPX */ - /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */ case WS_IPPROTO_TCP: switch(optname) { case WS_TCP_NODELAY: - convert_sockopt(&level, &optname); - break; + return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_NODELAY, optval, optlen ); + default: FIXME("Unknown IPPROTO_TCP optname 0x%08x\n", optname); return SOCKET_ERROR; @@ -3485,37 +3335,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, SetLastError(WSAEINVAL); return SOCKET_ERROR; } /* end switch(level) */ - - /* avoid endianness issues if argument is a 16-bit int */ - if (optval && optlen < sizeof(int)) - { - woptval= *((const INT16 *) optval); - optval= (char*) &woptval; - woptval&= (1 << optlen * 8) - 1; - optlen=sizeof(int); - } - fd = get_sock_fd( s, 0, NULL ); - if (fd == -1) return SOCKET_ERROR; - - if (setsockopt(fd, level, optname, optval, optlen) == 0) - { -#ifdef __APPLE__ - if (level == SOL_SOCKET && optname == SO_REUSEADDR && - setsockopt(fd, level, SO_REUSEPORT, optval, optlen) != 0) - { - SetLastError(wsaErrno()); - release_sock_fd( s, fd ); - return SOCKET_ERROR; - } -#endif - release_sock_fd( s, fd ); - return 0; - } - TRACE("Setting socket error, %d\n", wsaErrno()); - SetLastError(wsaErrno()); - release_sock_fd( s, fd ); - - return SOCKET_ERROR; } diff --git a/include/wine/afd.h b/include/wine/afd.h index c826351ff4c..1c5f8020c2c 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -227,6 +227,7 @@ struct afd_get_events_params #define IOCTL_AFD_WINE_SET_IPX_PTYPE WINE_AFD_IOC(282) #define IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES WINE_AFD_IOC(283) #define IOCTL_AFD_WINE_GET_TCP_NODELAY WINE_AFD_IOC(284) +#define IOCTL_AFD_WINE_SET_TCP_NODELAY WINE_AFD_IOC(285) struct afd_create_params {
1
0
0
0
Zebediah Figura : ws2_32: Move the getsockopt(TCP_NODELAY) implementation to ntdll.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: b1669e3a4ca084d3bf314ecda52d7259dbe042b0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b1669e3a4ca084d3bf314ecd…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Jul 30 18:55:39 2021 -0500 ws2_32: Move the getsockopt(TCP_NODELAY) implementation to ntdll. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 3 +++ dlls/ws2_32/socket.c | 19 ++++++------------- include/wine/afd.h | 1 + 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 7fc41ff9f1a..86e415f5dce 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -1999,6 +1999,9 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc } #endif + case IOCTL_AFD_WINE_GET_TCP_NODELAY: + return do_getsockopt( handle, io, IPPROTO_TCP, TCP_NODELAY, out_buffer, out_size ); + default: { if ((code >> 16) == FILE_DEVICE_NETWORK) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 7da975167ee..ab1578ebed4 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1880,7 +1880,6 @@ static int server_getsockopt( SOCKET s, ULONG code, char *optval, int *optlen ) INT WINAPI WS_getsockopt(SOCKET s, INT level, INT optname, char *optval, INT *optlen) { - int fd; INT ret = 0; TRACE("(socket %04lx, %s, optval %s, optlen %p (%d))\n", s, @@ -2186,19 +2185,13 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, switch(optname) { case WS_TCP_NODELAY: - if ( (fd = get_sock_fd( s, 0, NULL )) == -1) - return SOCKET_ERROR; - convert_sockopt(&level, &optname); - if (getsockopt(fd, level, optname, optval, (socklen_t *)optlen) != 0 ) - { - SetLastError(wsaErrno()); - ret = SOCKET_ERROR; - } - release_sock_fd( s, fd ); - return ret; + return server_getsockopt( s, IOCTL_AFD_WINE_GET_TCP_NODELAY, optval, optlen ); + + default: + FIXME( "unrecognized TCP option %#x\n", optname ); + SetLastError( WSAENOPROTOOPT ); + return -1; } - FIXME("Unknown IPPROTO_TCP optname 0x%08x\n", optname); - return SOCKET_ERROR; case WS_IPPROTO_IP: switch(optname) diff --git a/include/wine/afd.h b/include/wine/afd.h index 6e601f60095..c826351ff4c 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -226,6 +226,7 @@ struct afd_get_events_params #define IOCTL_AFD_WINE_GET_IPX_PTYPE WINE_AFD_IOC(281) #define IOCTL_AFD_WINE_SET_IPX_PTYPE WINE_AFD_IOC(282) #define IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES WINE_AFD_IOC(283) +#define IOCTL_AFD_WINE_GET_TCP_NODELAY WINE_AFD_IOC(284) struct afd_create_params {
1
0
0
0
Zebediah Figura : ws2_32: Move the getsockopt(IRLMP_ENUMDEVICES) implementation to ntdll.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 3e09e2506899107eb832f173ad4356421ae3c3e3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3e09e2506899107eb832f173…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Jul 30 18:55:38 2021 -0500 ws2_32: Move the getsockopt(IRLMP_ENUMDEVICES) implementation to ntdll. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 43 ++++++++++++++++++++++++++++++++++ dlls/ws2_32/socket.c | 60 +----------------------------------------------- include/wine/afd.h | 1 + 3 files changed, 45 insertions(+), 59 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index a63209e6ae6..7fc41ff9f1a 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -1956,6 +1956,49 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc } #endif +#ifdef HAS_IRDA +#define MAX_IRDA_DEVICES 10 + case IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES: + { + char buffer[offsetof( struct irda_device_list, dev[MAX_IRDA_DEVICES] )]; + struct irda_device_list *unix_list = (struct irda_device_list *)buffer; + socklen_t len = sizeof(buffer); + DEVICELIST *ws_list = out_buffer; + int fd, needs_close = FALSE; + NTSTATUS status; + unsigned int i; + int ret; + + if ((status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ))) + return status; + + ret = getsockopt( fd, SOL_IRLMP, IRLMP_ENUMDEVICES, buffer, &len ); + if (needs_close) close( fd ); + if (ret) return sock_errno_to_status( errno ); + + io->Information = offsetof( DEVICELIST, unix_list->len ); + if (out_size < io->Information) + return STATUS_BUFFER_TOO_SMALL; + + TRACE( "IRLMP_ENUMDEVICES: got %u devices:\n", unix_list->len ); + ws_list->numDevice = unix_list->len; + for (i = 0; i < unix_list->len; ++i) + { + const struct irda_device_info *unix_dev = &unix_list->dev[i]; + IRDA_DEVICE_INFO *ws_dev = &ws_list->Device[i]; + + TRACE( "saddr %#08x, daddr %#08x, info %s, hints 0x%02x%02x\n", + unix_dev->saddr, unix_dev->daddr, unix_dev->info, unix_dev->hints[0], unix_dev->hints[1] ); + memcpy( ws_dev->irdaDeviceID, &unix_dev->daddr, sizeof(unix_dev->daddr) ); + memcpy( ws_dev->irdaDeviceName, unix_dev->info, sizeof(unix_dev->info) ); + ws_dev->irdaDeviceHints1 = unix_dev->hints[0]; + ws_dev->irdaDeviceHints2 = unix_dev->hints[1]; + ws_dev->irdaCharSet = unix_dev->charset; + } + return STATUS_SUCCESS; + } +#endif + default: { if ((code >> 16) == FILE_DEVICE_NETWORK) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index da45734803c..7da975167ee 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2169,75 +2169,17 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, }/* end switch(optname) */ } /* end case WS_NSPROTO_IPX */ -#ifdef HAS_IRDA -#define MAX_IRDA_DEVICES 10 - case WS_SOL_IRLMP: switch(optname) { case WS_IRLMP_ENUMDEVICES: - { - char buf[sizeof(struct irda_device_list) + - (MAX_IRDA_DEVICES - 1) * sizeof(struct irda_device_info)]; - int res; - socklen_t len = sizeof(buf); + return server_getsockopt( s, IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES, optval, optlen ); - if ( (fd = get_sock_fd( s, 0, NULL )) == -1) - return SOCKET_ERROR; - res = getsockopt( fd, SOL_IRLMP, IRLMP_ENUMDEVICES, buf, &len ); - release_sock_fd( s, fd ); - if (res < 0) - { - SetLastError(wsaErrno()); - return SOCKET_ERROR; - } - else - { - struct irda_device_list *src = (struct irda_device_list *)buf; - DEVICELIST *dst = (DEVICELIST *)optval; - INT needed = sizeof(DEVICELIST); - unsigned int i; - - if (src->len > 0) - needed += (src->len - 1) * sizeof(IRDA_DEVICE_INFO); - if (*optlen < needed) - { - SetLastError(WSAEFAULT); - return SOCKET_ERROR; - } - *optlen = needed; - TRACE("IRLMP_ENUMDEVICES: %d devices found:\n", src->len); - dst->numDevice = src->len; - for (i = 0; i < src->len; i++) - { - TRACE("saddr = %08x, daddr = %08x, info = %s, hints = %02x%02x\n", - src->dev[i].saddr, src->dev[i].daddr, - src->dev[i].info, src->dev[i].hints[0], - src->dev[i].hints[1]); - memcpy( dst->Device[i].irdaDeviceID, - &src->dev[i].daddr, - sizeof(dst->Device[i].irdaDeviceID) ) ; - memcpy( dst->Device[i].irdaDeviceName, - src->dev[i].info, - sizeof(dst->Device[i].irdaDeviceName) ) ; - memcpy( &dst->Device[i].irdaDeviceHints1, - &src->dev[i].hints[0], - sizeof(dst->Device[i].irdaDeviceHints1) ) ; - memcpy( &dst->Device[i].irdaDeviceHints2, - &src->dev[i].hints[1], - sizeof(dst->Device[i].irdaDeviceHints2) ) ; - dst->Device[i].irdaCharSet = src->dev[i].charset; - } - return 0; - } - } default: FIXME("IrDA optname:0x%x\n", optname); return SOCKET_ERROR; } break; /* case WS_SOL_IRLMP */ -#undef MAX_IRDA_DEVICES -#endif /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */ case WS_IPPROTO_TCP: diff --git a/include/wine/afd.h b/include/wine/afd.h index 4db6525a7d8..6e601f60095 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -225,6 +225,7 @@ struct afd_get_events_params #define IOCTL_AFD_WINE_SET_IPV6_V6ONLY WINE_AFD_IOC(280) #define IOCTL_AFD_WINE_GET_IPX_PTYPE WINE_AFD_IOC(281) #define IOCTL_AFD_WINE_SET_IPX_PTYPE WINE_AFD_IOC(282) +#define IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES WINE_AFD_IOC(283) struct afd_create_params {
1
0
0
0
Zebediah Figura : ws2_32: Move the setsockopt(IPX_PTYPE) implementation to ntdll.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: 55c761540dc7cf96904fabc407e439c03b0eb15d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=55c761540dc7cf96904fabc4…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Jul 30 18:55:37 2021 -0500 ws2_32: Move the setsockopt(IPX_PTYPE) implementation to ntdll. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 12 ++++++++++++ dlls/ws2_32/socket.c | 40 +--------------------------------------- include/wine/afd.h | 1 + 3 files changed, 14 insertions(+), 39 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index c2cbaff24e1..a63209e6ae6 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -1925,6 +1925,9 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc #ifdef SOL_IPX case IOCTL_AFD_WINE_GET_IPX_PTYPE: return do_getsockopt( handle, io, SOL_IPX, IPX_TYPE, out_buffer, out_size ); + + case IOCTL_AFD_WINE_SET_IPX_PTYPE: + return do_setsockopt( handle, io, SOL_IPX, IPX_TYPE, in_buffer, in_size ); #elif defined(SO_DEFAULT_HEADERS) case IOCTL_AFD_WINE_GET_IPX_PTYPE: { @@ -1942,6 +1945,15 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc *(DWORD *)out_buffer = value.ipx_pt; return STATUS_SUCCESS; } + + case IOCTL_AFD_WINE_SET_IPX_PTYPE: + { + struct ipx value = {0}; + + /* FIXME: should we retrieve SO_DEFAULT_HEADERS first and modify it? */ + value.ipx_pt = *(DWORD *)in_buffer; + return do_setsockopt( handle, io, 0, SO_DEFAULT_HEADERS, &value, sizeof(value) ); + } #endif default: diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 71b5e9a8658..da45734803c 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -825,42 +825,6 @@ convert_socktype_u2w(int unixsocktype) { return -1; } -static int set_ipx_packettype(int sock, int ptype) -{ -#ifdef HAS_IPX - int fd = get_sock_fd( sock, 0, NULL ), ret = 0; - TRACE("trying to set IPX_PTYPE: %d (fd: %d)\n", ptype, fd); - - if (fd == -1) return SOCKET_ERROR; - - /* We try to set the ipx type on ipx socket level. */ -#ifdef SOL_IPX - if(setsockopt(fd, SOL_IPX, IPX_TYPE, &ptype, sizeof(ptype)) == -1) - { - ERR("IPX: could not set ipx option type; expect weird behaviour\n"); - ret = SOCKET_ERROR; - } -#else - { - struct ipx val; - /* Should we retrieve val using a getsockopt call and then - * set the modified one? */ - val.ipx_pt = ptype; - setsockopt(fd, 0, SO_DEFAULT_HEADERS, &val, sizeof(struct ipx)); - } -#endif - release_sock_fd( sock, fd ); - return ret; -#else - WARN("IPX support is not enabled, can't set packet type\n"); - return SOCKET_ERROR; -#endif -} - -/* ----------------------------------- API ----- - * - * Init / cleanup / error checking. - */ /*********************************************************************** * WSAStartup (WS2_32.115) @@ -3453,12 +3417,11 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, } break; /* case WS_SOL_SOCKET */ -#ifdef HAS_IPX case WS_NSPROTO_IPX: switch(optname) { case WS_IPX_PTYPE: - return set_ipx_packettype(s, *(int*)optval); + return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPX_PTYPE, optval, optlen ); case WS_IPX_FILTERPTYPE: /* Sets the receive filter packet type, at the moment we don't support it */ @@ -3471,7 +3434,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, return SOCKET_ERROR; } break; /* case WS_NSPROTO_IPX */ -#endif /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */ case WS_IPPROTO_TCP: diff --git a/include/wine/afd.h b/include/wine/afd.h index 6630a6402fc..4db6525a7d8 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -224,6 +224,7 @@ struct afd_get_events_params #define IOCTL_AFD_WINE_GET_IPV6_V6ONLY WINE_AFD_IOC(279) #define IOCTL_AFD_WINE_SET_IPV6_V6ONLY WINE_AFD_IOC(280) #define IOCTL_AFD_WINE_GET_IPX_PTYPE WINE_AFD_IOC(281) +#define IOCTL_AFD_WINE_SET_IPX_PTYPE WINE_AFD_IOC(282) struct afd_create_params {
1
0
0
0
Zebediah Figura : ws2_32: Move the getsockopt(IPX_PTYPE) implementation to ntdll.
by Alexandre Julliard
02 Aug '21
02 Aug '21
Module: wine Branch: master Commit: ce1c5ffcaec30af65551a5783bd500f6d02163f4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce1c5ffcaec30af65551a578…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Jul 30 18:55:36 2021 -0500 ws2_32: Move the getsockopt(IPX_PTYPE) implementation to ntdll. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 22 ++++++++++++++++++++++ dlls/ws2_32/socket.c | 27 ++++----------------------- include/wine/afd.h | 1 + 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 24090c1a17b..c2cbaff24e1 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -1922,6 +1922,28 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc return ret ? sock_errno_to_status( errno ) : STATUS_SUCCESS; } +#ifdef SOL_IPX + case IOCTL_AFD_WINE_GET_IPX_PTYPE: + return do_getsockopt( handle, io, SOL_IPX, IPX_TYPE, out_buffer, out_size ); +#elif defined(SO_DEFAULT_HEADERS) + case IOCTL_AFD_WINE_GET_IPX_PTYPE: + { + int fd, needs_close = FALSE; + struct ipx value; + socklen_t len = sizeof(value); + int ret; + + if ((status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ))) + return status; + + ret = getsockopt( fd, 0, SO_DEFAULT_HEADERS, &value, &len ); + if (needs_close) close( fd ); + if (ret) return sock_errno_to_status( errno ); + *(DWORD *)out_buffer = value.ipx_pt; + return STATUS_SUCCESS; + } +#endif + default: { if ((code >> 16) == FILE_DEVICE_NETWORK) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index a28c25ec697..71b5e9a8658 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2158,7 +2158,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, return SOCKET_ERROR; } /* end switch(optname) */ }/* end case WS_SOL_SOCKET */ -#ifdef HAS_IPX + case WS_NSPROTO_IPX: { struct WS_sockaddr_ipx addr; @@ -2166,27 +2166,6 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, int namelen; switch(optname) { - case WS_IPX_PTYPE: - if ((fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR; -#ifdef SOL_IPX - if(getsockopt(fd, SOL_IPX, IPX_TYPE, optval, (socklen_t *)optlen) == -1) - { - ret = SOCKET_ERROR; - } -#else - { - struct ipx val; - socklen_t len=sizeof(struct ipx); - if(getsockopt(fd, 0, SO_DEFAULT_HEADERS, &val, &len) == -1 ) - ret = SOCKET_ERROR; - else - *optval = (int)val.ipx_pt; - } -#endif - TRACE("ptype: %d (fd: %d)\n", *(int*)optval, fd); - release_sock_fd( s, fd ); - return ret; - case WS_IPX_ADDRESS: /* * On a Win2000 system with one network card there are usually @@ -2217,12 +2196,14 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, *(int*)optval = 1; /* As noted under IPX_ADDRESS we have just one card. */ return 0; + case WS_IPX_PTYPE: + return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPX_PTYPE, optval, optlen ); + default: FIXME("IPX optname:%x\n", optname); return SOCKET_ERROR; }/* end switch(optname) */ } /* end case WS_NSPROTO_IPX */ -#endif #ifdef HAS_IRDA #define MAX_IRDA_DEVICES 10 diff --git a/include/wine/afd.h b/include/wine/afd.h index 9a1edb1fda6..6630a6402fc 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -223,6 +223,7 @@ struct afd_get_events_params #define IOCTL_AFD_WINE_SET_IPV6_UNICAST_IF WINE_AFD_IOC(278) #define IOCTL_AFD_WINE_GET_IPV6_V6ONLY WINE_AFD_IOC(279) #define IOCTL_AFD_WINE_SET_IPV6_V6ONLY WINE_AFD_IOC(280) +#define IOCTL_AFD_WINE_GET_IPX_PTYPE WINE_AFD_IOC(281) struct afd_create_params {
1
0
0
0
← Newer
1
...
101
102
103
104
105
106
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Results per page:
10
25
50
100
200