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 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
2 participants
1030 discussions
Start a n
N
ew thread
Alexandre Julliard : mountmgr: Support $HOME paths to define shell folders.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: b3ea395681377265660e4bdc5df5b798f7a3f40e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b3ea395681377265660e4bdc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 17 16:50:00 2021 +0200 mountmgr: Support $HOME paths to define shell folders. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mountmgr.sys/mountmgr.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index cf7c9d636f0..27f642df7e8 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -301,7 +301,8 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize ) UNICODE_STRING name; NTSTATUS status; ULONG size = 256; - char *buffer, *backup = NULL; + const char *home; + char *buffer = NULL, *backup = NULL, *homelink = NULL; struct stat st; unsigned int i; @@ -319,8 +320,21 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize ) if (!link[0]) link = NULL; } + if (link && (!strcmp( link, "$HOME" ) || !strncmp( link, "$HOME/", 6 )) && (home = getenv( "HOME" ))) + { + link += 5; + homelink = HeapAlloc( GetProcessHeap(), 0, strlen(home) + strlen(link) + 1 ); + strcpy( homelink, home ); + strcat( homelink, link ); + link = homelink; + } + /* ignore nonexistent link targets */ - if (link && stat( link, &st )) return STATUS_OBJECT_NAME_NOT_FOUND; + if (link && (stat( link, &st ) || !S_ISDIR( st.st_mode ))) + { + status = STATUS_OBJECT_NAME_NOT_FOUND; + goto done; + } name.Buffer = (WCHAR *)((char *)in_buff + input->folder_offset); name.Length = input->folder_size; @@ -328,11 +342,16 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize ) for (;;) { - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size ))) return STATUS_NO_MEMORY; - status = wine_nt_to_unix_file_name( &attr, buffer, &size, FILE_OPEN ); - if (!status) break; + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size ))) + { + status = STATUS_NO_MEMORY; + goto done; + } + status = wine_nt_to_unix_file_name( &attr, buffer, &size, FILE_OPEN_IF ); + if (status == STATUS_NO_SUCH_FILE) status = STATUS_SUCCESS; + if (status == STATUS_SUCCESS) break; + if (status != STATUS_BUFFER_TOO_SMALL) goto done; HeapFree( GetProcessHeap(), 0, buffer ); - if (status != STATUS_BUFFER_TOO_SMALL) return status; } if (input->create_backup) @@ -376,6 +395,7 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize ) done: HeapFree( GetProcessHeap(), 0, buffer ); HeapFree( GetProcessHeap(), 0, backup ); + HeapFree( GetProcessHeap(), 0, homelink ); return status; }
1
0
0
0
Alexandre Julliard : mountmgr: Make creating a backup optional for shell folders.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: fefb5da4ba4f848f47b2da909a3dfe590376badd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fefb5da4ba4f848f47b2da90…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 17 16:49:30 2021 +0200 mountmgr: Make creating a backup optional for shell folders. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mountmgr.sys/mountmgr.c | 13 ++++++++----- include/ddk/mountmgr.h | 1 + programs/winecfg/drive.c | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index 2f669fcc868..cf7c9d636f0 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -335,13 +335,16 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize ) if (status != STATUS_BUFFER_TOO_SMALL) return status; } - if (!(backup = HeapAlloc( GetProcessHeap(), 0, strlen(buffer) + sizeof(".backup" ) ))) + if (input->create_backup) { - status = STATUS_NO_MEMORY; - goto done; + if (!(backup = HeapAlloc( GetProcessHeap(), 0, strlen(buffer) + sizeof(".backup" ) ))) + { + status = STATUS_NO_MEMORY; + goto done; + } + strcpy( backup, buffer ); + strcat( backup, ".backup" ); } - strcpy( backup, buffer ); - strcat( backup, ".backup" ); if (!lstat( buffer, &st )) /* move old folder/link out of the way */ { diff --git a/include/ddk/mountmgr.h b/include/ddk/mountmgr.h index 3c82e03ea36..11d4052305c 100644 --- a/include/ddk/mountmgr.h +++ b/include/ddk/mountmgr.h @@ -80,6 +80,7 @@ struct mountmgr_unix_drive struct mountmgr_shell_folder { + BOOL create_backup; ULONG folder_offset; ULONG folder_size; ULONG symlink_offset; diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c index a82fe74dfe2..bee5be3af34 100644 --- a/programs/winecfg/drive.c +++ b/programs/winecfg/drive.c @@ -362,6 +362,7 @@ void set_shell_folder( const WCHAR *path, const char *dest ) if (dest) len += strlen(dest) + 1; if (!(ioctl = HeapAlloc( GetProcessHeap(), 0, len ))) return; + ioctl->create_backup = TRUE; ioctl->folder_offset = sizeof(*ioctl); ioctl->folder_size = nt_name.Length; memcpy( (char *)ioctl + ioctl->folder_offset, nt_name.Buffer, nt_name.Length );
1
0
0
0
Alexandre Julliard : loader: Start the mount manager before registering dlls.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: cd37863832f54f38ba734b86b2bbc392d87a67c3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cd37863832f54f38ba734b86…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 17 12:53:04 2021 +0200 loader: Start the mount manager before registering dlls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- loader/wine.inf.in | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e600ee82b37..ce68069a9a2 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -26,12 +26,30 @@ [version] signature="$CHICAGO$" +[PreInstall] +WineFakeDlls=FakeDllsPreInstall + [PreInstall.ntamd64] +WineFakeDlls=FakeDllsPreInstall AddReg=Wow64 [PreInstall.ntarm64] +WineFakeDlls=FakeDllsPreInstall AddReg=Wow64 +[PreInstall.Services] +AddService=MountMgr,0x800,MountMgrService + +[PreInstall.ntamd64.Services] +AddService=MountMgr,0x800,MountMgrService + +[PreInstall.ntarm64.Services] +AddService=MountMgr,0x800,MountMgrService + +[FakeDllsPreInstall] +11,,winedevice.exe +12,,mountmgr.sys + [DefaultInstall] RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin32,FakeDlls @@ -156,7 +174,6 @@ AddService=BITS,0,BITSService AddService=EventLog,0,EventLogService AddService=HTTP,0,HTTPService AddService=MSIServer,0,MSIService -AddService=MountMgr,0x800,MountMgrService AddService=RpcSs,0,RpcSsService AddService=Spooler,0,SpoolerService AddService=StiSvc,0,StiService @@ -176,7 +193,6 @@ AddService=BITS,0,BITSService AddService=EventLog,0,EventLogService AddService=HTTP,0,HTTPService AddService=MSIServer,0,MSIService -AddService=MountMgr,0x800,MountMgrService AddService=RpcSs,0,RpcSsService AddService=Spooler,0,SpoolerService AddService=StiSvc,0,StiService @@ -196,7 +212,6 @@ AddService=BITS,0,BITSService AddService=EventLog,0,EventLogService AddService=HTTP,0,HTTPService AddService=MSIServer,0,MSIService -AddService=MountMgr,0x800,MountMgrService AddService=RpcSs,0,RpcSsService AddService=Spooler,0,SpoolerService AddService=StiSvc,0,StiService @@ -216,7 +231,6 @@ AddService=BITS,0,BITSService AddService=EventLog,0,EventLogService AddService=HTTP,0,HTTPService AddService=MSIServer,0,MSIService -AddService=MountMgr,0x800,MountMgrService AddService=RpcSs,0,RpcSsService AddService=Spooler,0,SpoolerService AddService=StiSvc,0,StiService
1
0
0
0
Alexandre Julliard : wineboot: Add a generic mechanism for pre-installing things before the main wine.inf section.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 0f284520ec45fcbed25e01399107c1df8c7de91a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f284520ec45fcbed25e0139…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 17 12:45:46 2021 +0200 wineboot: Add a generic mechanism for pre-installing things before the main wine.inf section. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/install.c | 9 --------- loader/wine.inf.in | 8 ++++++-- programs/wineboot/wineboot.c | 19 +++++++++---------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c index 23f0fbdd4f1..df39fd440b3 100644 --- a/dlls/setupapi/install.c +++ b/dlls/setupapi/install.c @@ -1076,15 +1076,6 @@ BOOL WINAPI SetupInstallFromInfSectionW( HWND owner, HINF hinf, PCWSTR section, BOOL ret; int i; - if (flags & SPINST_REGISTRY) - { - struct registry_callback_info info; - - info.default_root = key_root; - info.delete = FALSE; - if (!iterate_section_fields( hinf, section, L"WinePreInstall", registry_callback, &info )) - return FALSE; - } if (flags & SPINST_REGSVR) { if (iterate_section_fields( hinf, section, L"WineFakeDlls", fake_dlls_callback, NULL )) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index ac30d9560c6..e600ee82b37 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -26,6 +26,12 @@ [version] signature="$CHICAGO$" +[PreInstall.ntamd64] +AddReg=Wow64 + +[PreInstall.ntarm64] +AddReg=Wow64 + [DefaultInstall] RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin32,FakeDlls @@ -78,7 +84,6 @@ AddReg=\ [DefaultInstall.ntamd64] RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin64,FakeDlls -WinePreInstall=Wow64 UpdateInis=SystemIni CopyFiles=ColorFiles,EtcFiles,InfFiles,NlsFiles,SortFiles AddReg=\ @@ -105,7 +110,6 @@ AddReg=\ [DefaultInstall.ntarm64] RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin64,FakeDlls -WinePreInstall=Wow64 UpdateInis=SystemIni CopyFiles=ColorFiles,EtcFiles,InfFiles,NlsFiles,SortFiles AddReg=\ diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 92276fcbe76..4a18265c1de 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -1327,7 +1327,7 @@ static HWND show_wait_window(void) return hwnd; } -static HANDLE start_rundll32( const WCHAR *inf_path, WORD machine ) +static HANDLE start_rundll32( const WCHAR *inf_path, const WCHAR *install, WORD machine ) { WCHAR app[MAX_PATH + ARRAY_SIZE(L"\\rundll32.exe" )]; STARTUPINFOW si; @@ -1345,12 +1345,7 @@ static HANDLE start_rundll32( const WCHAR *inf_path, WORD machine ) len = lstrlenW(app) + ARRAY_SIZE(L" setupapi,InstallHinfSection DefaultInstall 128 ") + lstrlenW(inf_path); if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return 0; - - lstrcpyW( buffer, app ); - lstrcatW( buffer, L" setupapi,InstallHinfSection" ); - lstrcatW( buffer, machine != IMAGE_FILE_MACHINE_TARGET_HOST ? L" Wow64Install" : L" DefaultInstall" ); - lstrcatW( buffer, L" 128 " ); - lstrcatW( buffer, inf_path ); + swprintf( buffer, len, L"%s setupapi,InstallHinfSection %s 128 %s", app, install, inf_path ); if (CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi )) CloseHandle( pi.hThread ); @@ -1480,7 +1475,7 @@ static void update_wineprefix( BOOL force ) if (NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), machines, sizeof(machines), NULL )) machines[0] = 0; - if ((process = start_rundll32( inf_path, IMAGE_FILE_MACHINE_TARGET_HOST ))) + if ((process = start_rundll32( inf_path, L"PreInstall", IMAGE_FILE_MACHINE_TARGET_HOST ))) { HWND hwnd = show_wait_window(); for (;;) @@ -1490,9 +1485,13 @@ static void update_wineprefix( BOOL force ) if (res == WAIT_OBJECT_0) { CloseHandle( process ); - if (HIWORD(machines[count]) & 4 /* native machine */) count++; if (!machines[count]) break; - if (!(process = start_rundll32( inf_path, LOWORD(machines[count++]) ))) break; + if (HIWORD(machines[count]) & 4 /* native machine */) + process = start_rundll32( inf_path, L"DefaultInstall", IMAGE_FILE_MACHINE_TARGET_HOST ); + else + process = start_rundll32( inf_path, L"Wow64Install", LOWORD(machines[count]) ); + count++; + if (!process) break; } else while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageW( &msg ); }
1
0
0
0
Alexandre Julliard : winebus.sys: Remove the no longer used CFStringToWSTR function.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 80a57c617bd0f90c0fa584de08ac512447181cb9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=80a57c617bd0f90c0fa584de…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 17 12:56:49 2021 +0200 winebus.sys: Remove the no longer used CFStringToWSTR function. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_iohid.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c index d44f7ae257d..b1c11ee22ec 100644 --- a/dlls/winebus.sys/bus_iohid.c +++ b/dlls/winebus.sys/bus_iohid.c @@ -132,13 +132,6 @@ static struct platform_private *find_device_from_iohid(IOHIDDeviceRef IOHIDDevic return NULL; } -static void CFStringToWSTR(CFStringRef cstr, LPWSTR wstr, int length) -{ - int len = min(CFStringGetLength(cstr), length-1); - CFStringGetCharacters(cstr, CFRangeMake(0, len), (UniChar*)wstr); - wstr[len] = 0; -} - static DWORD CFNumberToDWORD(CFNumberRef num) { int dwNum = 0;
1
0
0
0
Alexandre Julliard : winebus.sys: Fix a typo in find_device_from_iohid().
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: aff08c7e14236d9cbcdaafd1e644aabd718acc4f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aff08c7e14236d9cbcdaafd1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 17 12:51:18 2021 +0200 winebus.sys: Fix a typo in find_device_from_iohid(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_iohid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c index 15f37dd2188..d44f7ae257d 100644 --- a/dlls/winebus.sys/bus_iohid.c +++ b/dlls/winebus.sys/bus_iohid.c @@ -127,7 +127,7 @@ static struct platform_private *find_device_from_iohid(IOHIDDeviceRef IOHIDDevic struct platform_private *private; LIST_FOR_EACH_ENTRY(private, &device_list, struct platform_private, unix_device.entry) - if (!private->device == IOHIDDevice) return private; + if (private->device == IOHIDDevice) return private; return NULL; }
1
0
0
0
Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputDevice8_EnumObjects tests.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 4b28a061ea106356e38b3dec1a64b62a40c279c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b28a061ea106356e38b3dec…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 09:06:27 2021 +0200 dinput8/tests: Add some HID joystick IDirectInputDevice8_EnumObjects tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/hid.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index ff23836e125..4316f2f8bb8 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -52,6 +52,7 @@ #include "ddk/hidsdi.h" #include "ddk/hidpi.h" #include "ddk/hidport.h" +#include "hidusage.h" #include "devguid.h" #include "wine/test.h" @@ -60,6 +61,7 @@ #include "driver_hid.h" static HINSTANCE instance; +static BOOL localized; /* object names get translated */ #define EXPECT_VIDPID MAKELONG( 0x1209, 0x0001 ) static const WCHAR expect_vidpid_str[] = L"VID_1209&PID_0001"; @@ -3281,6 +3283,65 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c return DIENUM_CONTINUE; } +struct check_objects_todos +{ + BOOL ofs; + BOOL type; + BOOL collection_number; +}; + +struct check_objects_params +{ + UINT index; + UINT expect_count; + const DIDEVICEOBJECTINSTANCEW *expect_objs; + const struct check_objects_todos *todo_objs; +}; + +static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) +{ + static const DIDEVICEOBJECTINSTANCEW unexpected_obj = {0}; + struct check_objects_params *params = args; + const DIDEVICEOBJECTINSTANCEW *exp = params->expect_objs + params->index; + const struct check_objects_todos *todo = params->todo_objs + params->index; + + winetest_push_context( "obj[%d]", params->index ); + + ok( params->index < params->expect_count, "unexpected extra object\n" ); + if (params->index >= params->expect_count) exp = &unexpected_obj; + + check_member( *obj, *exp, "%u", dwSize ); + check_member_guid( *obj, *exp, guidType ); + todo_wine_if( todo->ofs ) + check_member( *obj, *exp, "%#x", dwOfs ); + todo_wine_if( todo->type ) + check_member( *obj, *exp, "%#x", dwType ); + check_member( *obj, *exp, "%#x", dwFlags ); + if (!localized) todo_wine check_member_wstr( *obj, *exp, tszName ); + check_member( *obj, *exp, "%u", dwFFMaxForce ); + check_member( *obj, *exp, "%u", dwFFForceResolution ); + todo_wine_if( todo->collection_number ) + check_member( *obj, *exp, "%u", wCollectionNumber ); + check_member( *obj, *exp, "%u", wDesignatorIndex ); + check_member( *obj, *exp, "%#04x", wUsagePage ); + check_member( *obj, *exp, "%#04x", wUsage ); + check_member( *obj, *exp, "%#04x", dwDimension ); + check_member( *obj, *exp, "%#04x", wExponent ); + check_member( *obj, *exp, "%u", wReportId ); + + winetest_pop_context(); + + params->index++; + return DIENUM_CONTINUE; +} + +static BOOL CALLBACK check_object_count( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) +{ + DWORD *count = args; + *count = *count + 1; + return DIENUM_CONTINUE; +} + static void test_simple_joystick(void) { #include "psh_hid_macros.h" @@ -3428,7 +3489,98 @@ static void test_simple_joystick(void) .wUsagePage = HID_USAGE_PAGE_GENERIC, .wUsage = HID_USAGE_GENERIC_JOYSTICK, }; + const DIDEVICEOBJECTINSTANCEW expect_objects[] = + { + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_YAxis, + .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(1), + .dwFlags = DIDOI_ASPECTPOSITION, + .tszName = L"Y Axis", + .wCollectionNumber = 1, + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_Y, + .wReportId = 1, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_XAxis, + .dwOfs = 0x4, + .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(0), + .dwFlags = DIDOI_ASPECTPOSITION, + .tszName = L"X Axis", + .wCollectionNumber = 1, + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_X, + .wReportId = 1, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_POV, + .dwOfs = 0x8, + .dwType = DIDFT_POV|DIDFT_MAKEINSTANCE(0), + .tszName = L"Hat Switch", + .wCollectionNumber = 1, + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_HATSWITCH, + .wReportId = 1, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Button, + .dwOfs = 0xc, + .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(0), + .tszName = L"Button 0", + .wCollectionNumber = 1, + .wUsagePage = HID_USAGE_PAGE_BUTTON, + .wUsage = 0x1, + .wReportId = 1, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Button, + .dwOfs = 0xd, + .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(1), + .tszName = L"Button 1", + .wCollectionNumber = 1, + .wUsagePage = HID_USAGE_PAGE_BUTTON, + .wUsage = 0x2, + .wReportId = 1, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwType = DIDFT_COLLECTION|DIDFT_NODATA|DIDFT_MAKEINSTANCE(0), + .tszName = L"Collection 0 - Joystick", + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_JOYSTICK, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwType = DIDFT_COLLECTION|DIDFT_NODATA|DIDFT_MAKEINSTANCE(1), + .tszName = L"Collection 1 - Joystick", + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_JOYSTICK, + }, + }; + const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = + { + {.ofs = TRUE, .type = TRUE, .collection_number = TRUE}, + {.ofs = TRUE, .type = TRUE, .collection_number = TRUE}, + {.ofs = TRUE, .collection_number = TRUE}, + {.ofs = TRUE, .collection_number = TRUE}, + {.ofs = TRUE, .collection_number = TRUE}, + {}, + {.type = TRUE}, + }; + struct check_objects_params check_objects_params = + { + .expect_count = ARRAY_SIZE(expect_objects), + .expect_objs = expect_objects, + .todo_objs = objects_todos, + }; DIPROPGUIDANDPATH prop_guid_path = { .diph = @@ -3755,6 +3907,20 @@ static void test_simple_joystick(void) todo_wine ok( hr == DIERR_NOTINITIALIZED, "IDirectInputDevice8_GetProperty DIPROP_APPDATA returned %#x\n", hr ); + hr = IDirectInputDevice8_EnumObjects( device, NULL, NULL, DIDFT_ALL ); + ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, 0x20 ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + res = 0; + hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON ); + ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( res == 4, "got %u expected %u\n", res, 4 ); + hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL ); + ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n", + check_objects_params.expect_count - check_objects_params.index ); + hr = IDirectInputDevice8_SetDataFormat( device, NULL ); ok( hr == E_POINTER, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); @@ -4384,6 +4550,7 @@ START_TEST( hid ) BOOL is_wow64; instance = GetModuleHandleW( NULL ); + localized = GetUserDefaultLCID() != MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT); pSignerSign = (void *)GetProcAddress( LoadLibraryW( L"mssign32" ), "SignerSign" ); if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64)
1
0
0
0
Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputDevice8_SetProperty tests.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 10ac8095cd2535edc73b579898407ef56028674c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=10ac8095cd2535edc73b5798…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 09:06:26 2021 +0200 dinput8/tests: Add some HID joystick IDirectInputDevice8_SetProperty tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/hid.c | 391 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 391 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=10ac8095cd2535edc73b…
1
0
0
0
Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceData tests.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 878dff8dae3b2d00fd05f1777836686e24158d2a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=878dff8dae3b2d00fd05f177…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 09:06:25 2021 +0200 dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceData tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/hid.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 15e2c838a23..166ca805937 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3378,6 +3378,23 @@ static void test_simple_joystick(void) {.lX = 0, .lY = 0, .rgdwPOV = {-1, -1, -1, -1}, .rgbButtons = {0x80, 0x80}}, {.lX = 32767, .lY = 5594, .rgdwPOV = {13500, -1, -1, -1}, .rgbButtons = {0x80}}, }; + static const DIDEVICEOBJECTDATA expect_objdata[] = + { + {.dwOfs = 0x4, .dwData = 0xffff, .dwSequence = 0xa}, + {.dwOfs = 0x4, .dwData = 0xffff, .dwSequence = 0xa}, + {.dwOfs = 0, .dwData = 0xffff, .dwSequence = 0xa}, + {.dwOfs = 0x20, .dwData = 31500, .dwSequence = 0xa}, + {.dwOfs = 0x30, .dwData = 0x80, .dwSequence = 0xa}, + {.dwOfs = 0x4, .dwData = 0x512b, .dwSequence = 0xd}, + {.dwOfs = 0, .dwData = 0x512b, .dwSequence = 0xd}, + {.dwOfs = 0x20, .dwData = -1, .dwSequence = 0xd}, + {.dwOfs = 0x30, .dwData = 0, .dwSequence = 0xd}, + {.dwOfs = 0x31, .dwData = 0, .dwSequence = 0xd}, + {.dwOfs = 0x4, .dwData = 0, .dwSequence = 0xf}, + {.dwOfs = 0, .dwData = 0, .dwSequence = 0xf}, + {.dwOfs = 0x30, .dwData = 0x80, .dwSequence = 0xf}, + {.dwOfs = 0x31, .dwData = 0x80, .dwSequence = 0xf}, + }; const DIDEVICEINSTANCEW expect_devinst = { @@ -3437,6 +3454,7 @@ static void test_simple_joystick(void) }, }; WCHAR cwd[MAX_PATH], tempdir[MAX_PATH]; + DIDEVICEOBJECTDATA objdata[32] = {{0}}; DIDEVICEINSTANCEW devinst = {0}; DIDATAFORMAT dataformat = {0}; IDirectInputDevice8W *device; @@ -3838,6 +3856,116 @@ static void test_simple_joystick(void) check_member( state, expect_state[i], "%#x", rgbButtons[2] ); winetest_pop_context(); + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA) - 1, objdata, &res, DIGDD_PEEK ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); + ok( hr == DIERR_NOTBUFFERED, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + + hr = IDirectInputDevice8_Unacquire( device ); + ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + prop_dword.diph.dwHow = DIPH_DEVICE; + prop_dword.diph.dwObj = 0; + prop_dword.dwData = 1; + hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); + ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + hr = IDirectInputDevice8_Acquire( device ); + ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 0, "got %u expected %u\n", res, 0 ); + + send_hid_input( file, &injected_input[0], sizeof(*injected_input) ); + res = WaitForSingleObject( event, 100 ); + ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); + + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); + ok( hr == DI_BUFFEROVERFLOW, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 0, "got %u expected %u\n", res, 0 ); + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); + todo_wine + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 0, "got %u expected %u\n", res, 0 ); + + hr = IDirectInputDevice8_Unacquire( device ); + ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + prop_dword.diph.dwHow = DIPH_DEVICE; + prop_dword.diph.dwObj = 0; + prop_dword.dwData = 10; + hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); + ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + hr = IDirectInputDevice8_Acquire( device ); + ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + + send_hid_input( file, &injected_input[1], sizeof(*injected_input) ); + res = WaitForSingleObject( event, 100 ); + ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); + + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 1, "got %u expected %u\n", res, 1 ); + check_member( objdata[0], expect_objdata[0], "%#x", dwOfs ); + check_member( objdata[0], expect_objdata[0], "%#x", dwData ); + todo_wine + check_member( objdata[0], expect_objdata[0], "%#x", dwSequence ); + ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 ); + res = 4; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 4, "got %u expected %u\n", res, 4 ); + for (i = 0; i < 4; ++i) + { + winetest_push_context( "objdata[%d]", i ); + check_member( objdata[i], expect_objdata[1 + i], "%#x", dwOfs ); + check_member( objdata[i], expect_objdata[1 + i], "%#x", dwData ); + todo_wine + check_member( objdata[i], expect_objdata[1 + i], "%#x", dwSequence ); + ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 ); + winetest_pop_context(); + } + + send_hid_input( file, &injected_input[2], sizeof(*injected_input) ); + res = WaitForSingleObject( event, 100 ); + ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); + send_hid_input( file, &injected_input[4], sizeof(*injected_input) ); + res = WaitForSingleObject( event, 100 ); + ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); + + res = 1; + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); + ok( hr == DI_BUFFEROVERFLOW, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 1, "got %u expected %u\n", res, 1 ); + todo_wine + check_member( objdata[0], expect_objdata[5], "%#x", dwOfs ); + todo_wine + check_member( objdata[0], expect_objdata[5], "%#x", dwData ); + ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 ); + res = ARRAY_SIZE(objdata); + hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( res == 8, "got %u expected %u\n", res, 8 ); + for (i = 0; i < 8; ++i) + { + winetest_push_context( "objdata[%d]", i ); + todo_wine + check_member( objdata[i], expect_objdata[6 + i], "%#x", dwOfs ); + todo_wine_if( i != 3 && i != 4 && i != 7 ) + check_member( objdata[i], expect_objdata[6 + i], "%#x", dwData ); + ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 ); + winetest_pop_context(); + } + hr = IDirectInputDevice8_Unacquire( device ); ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr );
1
0
0
0
Rémi Bernon : dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceState tests.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 635219f92bd8c057b2f49544232c4b60b330a4d7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=635219f92bd8c057b2f49544…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 09:06:24 2021 +0200 dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceState tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/hid.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index c0690bac868..15e2c838a23 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3341,6 +3341,43 @@ static void test_simple_joystick(void) .dwPOVs = 1, .dwButtons = 2, }; + struct hid_expect injected_input[] = + { + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x10,0x10,0}, + }, + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x38,0x38,0xf8}, + }, + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x01,0x01,0x00}, + }, + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x01,0x01,0x00}, + }, + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x80,0x80,0xff}, + }, + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x10,0xee,0x54}, + }, + }; + static const struct DIJOYSTATE2 expect_state[] = + { + {.lX = 32767, .lY = 32767, .rgdwPOV = {-1, -1, -1, -1}, .rgbButtons = {0, 0}}, + {.lX = 32767, .lY = 32767, .rgdwPOV = {-1, -1, -1, -1}, .rgbButtons = {0, 0}}, + {.lX = 65535, .lY = 65535, .rgdwPOV = {31500, -1, -1, -1}, .rgbButtons = {0x80, 0x80}}, + {.lX = 20779, .lY = 20779, .rgdwPOV = {-1, -1, -1, -1}, .rgbButtons = {0, 0}}, + {.lX = 20779, .lY = 20779, .rgdwPOV = {-1, -1, -1, -1}, .rgbButtons = {0, 0}}, + {.lX = 0, .lY = 0, .rgdwPOV = {-1, -1, -1, -1}, .rgbButtons = {0x80, 0x80}}, + {.lX = 32767, .lY = 5594, .rgdwPOV = {13500, -1, -1, -1}, .rgbButtons = {0x80}}, + }; const DIDEVICEINSTANCEW expect_devinst = { @@ -3405,10 +3442,11 @@ static void test_simple_joystick(void) IDirectInputDevice8W *device; DIDEVCAPS caps = {0}; IDirectInput8W *di; - HANDLE event; + HANDLE event, file; + DIJOYSTATE2 state; + ULONG i, res, ref; HRESULT hr; WCHAR *tmp; - ULONG ref; HWND hwnd; GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd ); @@ -3701,6 +3739,10 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_SetEventNotification( device, event ); ok( hr == DI_OK, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr ); + file = CreateFileW( prop_guid_path.wszPath, FILE_READ_ACCESS | FILE_WRITE_ACCESS, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); + ok( file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError() ); + hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, 0 ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND ); @@ -3737,9 +3779,65 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE ); ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); + todo_wine + ok( hr == DIERR_NOTACQUIRED, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + + hr = IDirectInputDevice8_Poll( device ); + ok( hr == DIERR_NOTACQUIRED, "IDirectInputDevice8_Poll returned: %#x\n", hr ); + hr = IDirectInputDevice8_Acquire( device ); ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr ); + hr = IDirectInputDevice8_Poll( device ); + todo_wine + ok( hr == DI_NOEFFECT, "IDirectInputDevice8_Poll returned: %#x\n", hr ); + + hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2) + 1, &state ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + + for (i = 0; i < ARRAY_SIZE(injected_input); ++i) + { + winetest_push_context( "state[%d]", i ); + hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + todo_wine_if( i != 2 ) + check_member( state, expect_state[i], "%d", lX ); + todo_wine_if( i != 2 ) + check_member( state, expect_state[i], "%d", lY ); + check_member( state, expect_state[i], "%d", lZ ); + todo_wine_if( i == 0 ) + check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); + check_member( state, expect_state[i], "%#x", rgdwPOV[1] ); + check_member( state, expect_state[i], "%#x", rgbButtons[0] ); + check_member( state, expect_state[i], "%#x", rgbButtons[1] ); + check_member( state, expect_state[i], "%#x", rgbButtons[2] ); + + send_hid_input( file, &injected_input[i], sizeof(*injected_input) ); + + res = WaitForSingleObject( event, 100 ); + if (i == 0 || i == 3) todo_wine_if( i == 0 ) + ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); + else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); ResetEvent( event ); + winetest_pop_context(); + } + + hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); + ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + winetest_push_context( "state[%d]", i ); + todo_wine + check_member( state, expect_state[i], "%d", lX ); + todo_wine + check_member( state, expect_state[i], "%d", lY ); + check_member( state, expect_state[i], "%d", lZ ); + check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); + check_member( state, expect_state[i], "%#x", rgdwPOV[1] ); + check_member( state, expect_state[i], "%#x", rgbButtons[0] ); + check_member( state, expect_state[i], "%#x", rgbButtons[1] ); + check_member( state, expect_state[i], "%#x", rgbButtons[2] ); + winetest_pop_context(); + hr = IDirectInputDevice8_Unacquire( device ); ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); @@ -3750,6 +3848,7 @@ static void test_simple_joystick(void) ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref ); CloseHandle( event ); + CloseHandle( file ); ref = IDirectInput8_Release( di ); ok( ref == 0, "IDirectInput8_Release returned %d\n", ref );
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
103
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
Results per page:
10
25
50
100
200