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
July
June
May
April
March
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 2016
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
777 discussions
Start a n
N
ew thread
Hugh McMaster : kernel32/tests: Add tests for GetConsoleScreenBufferInfoEx.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 95f8270bc2a9b73ee90a4abcbf4b0dd7ce1187c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=95f8270bc2a9b73ee90a4abcb…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Aug 17 01:35:39 2016 +0000 kernel32/tests: Add tests for GetConsoleScreenBufferInfoEx. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/console.c | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 5b66d9f..826ed43 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2938,6 +2938,55 @@ static void test_SetConsoleFont(HANDLE std_output) todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); } +static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output) +{ + HANDLE hmod; + BOOL (WINAPI *pGetConsoleScreenBufferInfoEx)(HANDLE, CONSOLE_SCREEN_BUFFER_INFOEX *); + CONSOLE_SCREEN_BUFFER_INFOEX csbix; + BOOL ret; + HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE); + + hmod = GetModuleHandleA("kernel32.dll"); + pGetConsoleScreenBufferInfoEx = (void *)GetProcAddress(hmod, "GetConsoleScreenBufferInfoEx"); + if (!pGetConsoleScreenBufferInfoEx) + { + win_skip("GetConsoleScreenBufferInfoEx is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pGetConsoleScreenBufferInfoEx(NULL, &csbix); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + csbix.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX); + + SetLastError(0xdeadbeef); + ret = pGetConsoleScreenBufferInfoEx(NULL, &csbix); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix); + ok(!ret, "got %d, expected zero\n", ret); + todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); +} + START_TEST(console) { static const char font_name[] = "Lucida Console"; @@ -3086,4 +3135,5 @@ START_TEST(console) test_GetLargestConsoleWindowSize(hConOut); test_GetConsoleFontInfo(hConOut); test_SetConsoleFont(hConOut); + test_GetConsoleScreenBufferInfoEx(hConOut); }
1
0
0
0
Nils Kuhnhenn : winex11.drv: Return default locale in LoadKeyboardLayout stub instead of 0.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 1def1e2f7f5352d8af0faedc8c09a8cb84e5562f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1def1e2f7f5352d8af0faedc8…
Author: Nils Kuhnhenn <kuhnhenn.nils(a)gmail.com> Date: Thu Aug 11 17:28:17 2016 +0200 winex11.drv: Return default locale in LoadKeyboardLayout stub instead of 0. Signed-off-by: Nils Kuhnhenn <kuhnhenn.nils(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/keyboard.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 47a9872..adb028a 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1947,9 +1947,8 @@ HKL CDECL X11DRV_GetKeyboardLayout(DWORD dwThreadid) */ HKL CDECL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags) { - FIXME("%s, %04x: stub!\n", debugstr_w(name), flags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + FIXME("%s, %04x: semi-stub! Returning default layout.\n", debugstr_w(name), flags); + return get_locale_kbd_layout(); }
1
0
0
0
Aric Stewart : hidclass.sys: Do not send IRP_MJ_POWER ioctls.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: b16ba45450a9e00df28652a6183fcb6e35bb4354 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b16ba45450a9e00df28652a61…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Aug 12 08:20:11 2016 -0500 hidclass.sys: Do not send IRP_MJ_POWER ioctls. That is the Plug and Play Manager's job. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hidclass.sys/pnp.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index c537bf6..8fd5c17 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -53,44 +53,6 @@ static NTSTATUS WINAPI internalComplete(DEVICE_OBJECT *deviceObject, IRP *irp, return STATUS_MORE_PROCESSING_REQUIRED; } -static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp) -{ - NTSTATUS status; - IO_STACK_LOCATION *irpsp; - HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL); - - irp->UserEvent = event; - irpsp = IoGetNextIrpStackLocation(irp); - irpsp->CompletionRoutine = internalComplete; - irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; - - IoCallDriver(device, irp); - - if (irp->IoStatus.u.Status == STATUS_PENDING) - WaitForSingleObject(event, INFINITE); - - status = irp->IoStatus.u.Status; - IoCompleteRequest(irp, IO_NO_INCREMENT ); - CloseHandle(event); - return status; -} - -static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power) -{ - IO_STATUS_BLOCK irp_status; - IO_STACK_LOCATION *irpsp; - - IRP *irp = IoBuildSynchronousFsdRequest(IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status); - - irpsp = IoGetNextIrpStackLocation(irp); - irpsp->MinorFunction = IRP_MN_SET_POWER; - - irpsp->Parameters.Power.Type = DevicePowerState; - irpsp->Parameters.Power.State.DeviceState = power; - - return SendDeviceIRP(device, irp); -} - static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCHAR **id) { NTSTATUS status; @@ -252,7 +214,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ext->ring_buffer = RingBuffer_Create(sizeof(HID_XFER_PACKET) + ext->preparseData->caps.InputReportByteLength); HID_StartDeviceThread(device); - PNP_SendPowerIRP(device, PowerDeviceD0); return STATUS_SUCCESS; } @@ -267,7 +228,6 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver) if (tracked_device->minidriver->DriverObject == driver) { list_remove(&tracked_device->entry); - PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3); HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO); HeapFree(GetProcessHeap(), 0, tracked_device); }
1
0
0
0
Aric Stewart : hidclass.sys: Do not send IRP_MJ_PNP ioctls.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 3036cfef2f8afab6419fa07b78a5dc53052e1f47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3036cfef2f8afab6419fa07b7…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Aug 12 08:20:01 2016 -0500 hidclass.sys: Do not send IRP_MJ_PNP ioctls. That is the Plug and Play Manager's job. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hidclass.sys/pnp.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index 6ce68e0..c537bf6 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -75,22 +75,6 @@ static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp) return status; } -static NTSTATUS PNP_SendPnPIRP(DEVICE_OBJECT *device, UCHAR minor) -{ - IO_STACK_LOCATION *irpsp; - IO_STATUS_BLOCK irp_status; - - IRP *irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status); - - irpsp = IoGetNextIrpStackLocation(irp); - irpsp->MinorFunction = minor; - - irpsp->Parameters.StartDevice.AllocatedResources = NULL; - irpsp->Parameters.StartDevice.AllocatedResourcesTranslated = NULL; - - return SendDeviceIRP(device, irp); -} - static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power) { IO_STATUS_BLOCK irp_status; @@ -183,22 +167,12 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) return status; } - status = PNP_SendPnPIRP(device, IRP_MN_START_DEVICE); - if (status != STATUS_SUCCESS) - { - ERR("Minidriver IRP_MN_START_DEVICE failed (%x)\n",status); - HeapFree(GetProcessHeap(), 0, PDO_id); - HID_DeleteDevice(&minidriver->minidriver, device); - return status; - } - status = call_minidriver(IOCTL_HID_GET_DEVICE_ATTRIBUTES, device, NULL, 0, &attr, sizeof(attr)); if (status != STATUS_SUCCESS) { ERR("Minidriver failed to get Attributes(%x)\n",status); - PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, PDO_id); return status; @@ -220,7 +194,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) if (status != STATUS_SUCCESS) { ERR("Cannot get Device Descriptor(%x)\n",status); - PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, PDO_id); return status; @@ -232,7 +205,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) if (i >= descriptor.bNumDescriptors) { ERR("No Report Descriptor found in reply\n"); - PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, PDO_id); return status; @@ -296,7 +268,6 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver) { list_remove(&tracked_device->entry); PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3); - PNP_SendPnPIRP(tracked_device->FDO, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO); HeapFree(GetProcessHeap(), 0, tracked_device); }
1
0
0
0
Aric Stewart : hidclass.sys: Call IoAttachDeviceToDeviceStack when creating HID device.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: ab3b9bd84db3b942ea7ce1e85ac6dd12087f2596 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab3b9bd84db3b942ea7ce1e85…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Aug 12 08:18:56 2016 -0500 hidclass.sys: Call IoAttachDeviceToDeviceStack when creating HID device. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hidclass.sys/device.c | 2 ++ include/ddk/wdm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index b137c9b..b90e701 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -75,6 +75,8 @@ NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRAT lstrcpyW(ext->device_name, dev_name); ext->link_name = NULL; + IoAttachDeviceToDeviceStack(*device, native_device); + return S_OK; } diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 5eda82d..68694af 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1213,6 +1213,7 @@ NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOI PVOID WINAPI IoAllocateErrorLogEntry(PVOID,UCHAR); PIRP WINAPI IoAllocateIrp(CCHAR,BOOLEAN); PMDL WINAPI IoAllocateMdl(PVOID,ULONG,BOOLEAN,BOOLEAN,IRP*); +PDEVICE_OBJECT WINAPI IoAttachDeviceToDeviceStack(PDEVICE_OBJECT,PDEVICE_OBJECT); PIRP WINAPI IoBuildDeviceIoControlRequest(ULONG,DEVICE_OBJECT*,PVOID,ULONG,PVOID,ULONG,BOOLEAN,PKEVENT,IO_STATUS_BLOCK*); PIRP WINAPI IoBuildSynchronousFsdRequest(ULONG,DEVICE_OBJECT*,PVOID,ULONG,PLARGE_INTEGER,PKEVENT,IO_STATUS_BLOCK*); NTSTATUS WINAPI IoCallDriver(DEVICE_OBJECT*,IRP*);
1
0
0
0
Aric Stewart : hidclass.sys: Use the PDO instance id for the HID instance id.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: f2392af888679e46f8917044e6d505a4dd80ae8b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2392af888679e46f8917044e…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Aug 12 08:17:55 2016 -0500 hidclass.sys: Use the PDO instance id for the HID instance id. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hidclass.sys/pnp.c | 91 +++++++++++++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index 5a6a0a7..6ce68e0 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -31,16 +31,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(hid); static const WCHAR device_enumeratorW[] = {'H','I','D',0}; +static const WCHAR separator_W[] = {'\\',0}; static const WCHAR device_deviceid_fmtW[] = {'%','s','\\', 'v','i','d','_','%','0','4','x','&','p','i','d','_','%', '0','4','x'}; -static const WCHAR device_instanceid_fmtW[] = {'%','s','\\', - 'v','i','d','_','%','0','4','x','&','p','i','d','_','%', - '0','4','x','&','%','s','\\','%','i','&','%','s',0}; typedef struct _NATIVE_DEVICE { struct list entry; - DWORD vidpid; DEVICE_OBJECT *PDO; DEVICE_OBJECT *FDO; HID_MINIDRIVER_REGISTRATION *minidriver; @@ -110,6 +107,37 @@ static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power return SendDeviceIRP(device, irp); } +static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCHAR **id) +{ + NTSTATUS status; + IO_STACK_LOCATION *irpsp; + IO_STATUS_BLOCK irp_status; + IRP *irp; + HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL); + + irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status); + if (irp == NULL) + return STATUS_NO_MEMORY; + + irp->UserEvent = event; + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->MinorFunction = IRP_MN_QUERY_ID; + irpsp->Parameters.QueryId.IdType = type; + irpsp->CompletionRoutine = internalComplete; + irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; + + IoCallDriver(device, irp); + if (irp->IoStatus.u.Status == STATUS_PENDING) + WaitForSingleObject(event, INFINITE); + + *id = (WCHAR*)irp->IoStatus.Information; + status = irp->IoStatus.u.Status; + IoCompleteRequest(irp, IO_NO_INCREMENT ); + CloseHandle(event); + + return status; +} + NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) { DEVICE_OBJECT *device = NULL; @@ -117,26 +145,28 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) minidriver *minidriver; HID_DEVICE_ATTRIBUTES attr; BASE_DEVICE_EXTENSION *ext = NULL; - WCHAR serial[256]; - WCHAR interface[256]; - DWORD index = HID_STRING_ID_ISERIALNUMBER; - NATIVE_DEVICE *tracked_device, *ptr; - INT interface_index = 1; + NATIVE_DEVICE *tracked_device; HID_DESCRIPTOR descriptor; BYTE *reportDescriptor; INT i; + WCHAR *PDO_id; + WCHAR *id_ptr; - static const WCHAR ig_fmtW[] = {'I','G','_','%','i',0}; - static const WCHAR im_fmtW[] = {'I','M','_','%','i',0}; - + status = get_device_id(PDO, BusQueryInstanceID, &PDO_id); + if (status != STATUS_SUCCESS) + { + ERR("Failed to get PDO id(%x)\n",status); + return status; + } - TRACE("PDO add device(%p)\n", PDO); + TRACE("PDO add device(%p:%s)\n", PDO, debugstr_w(PDO_id)); minidriver = find_minidriver(driver); status = HID_CreateDevice(PDO, &minidriver->minidriver, &device); if (status != STATUS_SUCCESS) { ERR("Failed to create HID object (%x)\n",status); + HeapFree(GetProcessHeap(), 0, PDO_id); return status; } @@ -148,6 +178,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) if (status != STATUS_SUCCESS) { ERR("Minidriver AddDevice failed (%x)\n",status); + HeapFree(GetProcessHeap(), 0, PDO_id); HID_DeleteDevice(&minidriver->minidriver, device); return status; } @@ -156,6 +187,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) if (status != STATUS_SUCCESS) { ERR("Minidriver IRP_MN_START_DEVICE failed (%x)\n",status); + HeapFree(GetProcessHeap(), 0, PDO_id); HID_DeleteDevice(&minidriver->minidriver, device); return status; } @@ -168,6 +200,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ERR("Minidriver failed to get Attributes(%x)\n",status); PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); + HeapFree(GetProcessHeap(), 0, PDO_id); return status; } @@ -177,14 +210,9 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ext->information.Polled = minidriver->minidriver.DevicesArePolled; tracked_device = HeapAlloc(GetProcessHeap(), 0, sizeof(*tracked_device)); - tracked_device->vidpid = MAKELONG(attr.VendorID, attr.ProductID); tracked_device->PDO = PDO; tracked_device->FDO = device; tracked_device->minidriver = &minidriver->minidriver; - - LIST_FOR_EACH_ENTRY(ptr, &tracked_devices, NATIVE_DEVICE, entry) - if (ptr->vidpid == tracked_device->vidpid) interface_index++; - list_add_tail(&tracked_devices, &tracked_device->entry); status = call_minidriver(IOCTL_HID_GET_DEVICE_DESCRIPTOR, device, NULL, 0, @@ -194,6 +222,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ERR("Cannot get Device Descriptor(%x)\n",status); PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); + HeapFree(GetProcessHeap(), 0, PDO_id); return status; } for (i = 0; i < descriptor.bNumDescriptors; i++) @@ -205,6 +234,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ERR("No Report Descriptor found in reply\n"); PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); + HeapFree(GetProcessHeap(), 0, PDO_id); return status; } @@ -216,6 +246,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ERR("Cannot get Report Descriptor(%x)\n",status); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, reportDescriptor); + HeapFree(GetProcessHeap(), 0, PDO_id); return status; } @@ -226,28 +257,20 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) { ERR("Cannot parse Report Descriptor\n"); HID_DeleteDevice(&minidriver->minidriver, device); + HeapFree(GetProcessHeap(), 0, PDO_id); return STATUS_NOT_SUPPORTED; } ext->information.DescriptorSize = ext->preparseData->dwSize; - serial[0] = 0; - status = call_minidriver(IOCTL_HID_GET_STRING, device, - &index, sizeof(DWORD), serial, sizeof(serial)); - - if (serial[0] == 0) - { - static const WCHAR wZeroSerial[]= {'0','0','0','0',0}; - lstrcpyW(serial, wZeroSerial); - } + lstrcpyW(ext->instance_id, device_enumeratorW); + strcatW(ext->instance_id, separator_W); + /* Skip the original enumerator */ + id_ptr = strchrW(PDO_id, '\\'); + id_ptr++; + strcatW(ext->instance_id, id_ptr); + HeapFree(GetProcessHeap(), 0, PDO_id); - if (ext->preparseData->caps.UsagePage == HID_USAGE_PAGE_GENERIC && - (ext->preparseData->caps.Usage == HID_USAGE_GENERIC_GAMEPAD || - ext->preparseData->caps.Usage == HID_USAGE_GENERIC_JOYSTICK)) - sprintfW(interface, ig_fmtW, interface_index); - else - sprintfW(interface, im_fmtW, interface_index); - sprintfW(ext->instance_id, device_instanceid_fmtW, device_enumeratorW, ext->information.VendorID, ext->information.ProductID, interface, ext->information.VersionNumber, serial); sprintfW(ext->device_id, device_deviceid_fmtW, device_enumeratorW, ext->information.VendorID, ext->information.ProductID); HID_LinkDevice(device);
1
0
0
0
André Hentschel : hal: Add WRITE_PORT_UCHAR stub.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 9087404a13d92dc6cd559a2cedaba853ed651a08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9087404a13d92dc6cd559a2ce…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Tue Aug 16 22:30:20 2016 +0200 hal: Add WRITE_PORT_UCHAR stub. Signed-off-by: André Hentschel <nerv(a)dawncrow.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hal/hal.c | 5 +++++ dlls/hal/hal.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 0b2e422..9cae67e 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -168,6 +168,11 @@ ULONG WINAPI READ_PORT_ULONG(ULONG *port) return 0; } +void WINAPI WRITE_PORT_UCHAR(UCHAR *port, UCHAR value) +{ + FIXME("(%p %d) stub!\n", port, value); +} + void WINAPI WRITE_PORT_ULONG(ULONG *port, ULONG value) { FIXME("(%p %d) stub!\n", port, value); diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec index c21806c..bd6bc35 100644 --- a/dlls/hal/hal.spec +++ b/dlls/hal/hal.spec @@ -87,6 +87,6 @@ @ stub WRITE_PORT_BUFFER_UCHAR @ stub WRITE_PORT_BUFFER_ULONG @ stub WRITE_PORT_BUFFER_USHORT -@ stub WRITE_PORT_UCHAR +@ stdcall WRITE_PORT_UCHAR(ptr long) @ stdcall WRITE_PORT_ULONG(ptr long) @ stub WRITE_PORT_USHORT
1
0
0
0
Bruno Jesus : dinput: Properly fill the HID information for the controller in the js driver.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 738e17b2d7caeacb614d93ea63ff6207174b4cf3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=738e17b2d7caeacb614d93ea6…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Aug 16 22:24:14 2016 -0300 dinput: Properly fill the HID information for the controller in the js driver. Even the Xbox 360 controller which does not use HID has the same flags and usage page set on Windows. Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_linux.c | 15 ++++++++++++++- dlls/dinput/tests/joystick.c | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index b08d4c9..c0a885d 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -83,7 +83,7 @@ struct JoyDev BYTE button_count; int *dev_axes_map; - WORD vendor_id, product_id; + WORD vendor_id, product_id, bus_type; }; typedef struct JoystickImpl JoystickImpl; @@ -250,6 +250,7 @@ static INT find_joystick_devices(void) read_sys_id_variable(i, "vendor", &joydev.vendor_id); read_sys_id_variable(i, "product", &joydev.product_id); + read_sys_id_variable(i, "bustype", &joydev.bus_type); if (joydev.vendor_id == 0 || joydev.product_id == 0) { @@ -299,6 +300,18 @@ static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver else lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8); + /* Assume the joystick as HID if it is attached to USB bus and has a valid VID/PID */ + if (joystick_devices[id].bus_type == BUS_USB && + joystick_devices[id].vendor_id && joystick_devices[id].product_id) + { + lpddi->dwDevType |= DIDEVTYPE_HID; + lpddi->wUsagePage = 0x01; /* Desktop */ + if (lpddi->dwDevType == DI8DEVTYPE_JOYSTICK || lpddi->dwDevType == DIDEVTYPE_JOYSTICK) + lpddi->wUsage = 0x04; /* Joystick */ + else + lpddi->wUsage = 0x05; /* Game Pad */ + } + MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszInstanceName, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszProductName, MAX_PATH); lpddi->guidFFDriver = GUID_NULL; diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index 35ec2d9..00d3b60 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -223,6 +223,12 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef) lpddi->wUsagePage, lpddi->wUsage); + /* Check if this is a HID device */ + if (lpddi->dwDevType & DIDEVTYPE_HID) + ok(lpddi->wUsagePage == 0x01 && (lpddi->wUsage == 0x04 || lpddi->wUsage == 0x05), + "Expected a game controller HID UsagePage and Usage, got page 0x%x usage 0x%x\n", + lpddi->wUsagePage, lpddi->wUsage); + /* Test for joystick ID property */ ZeroMemory(&dipw, sizeof(dipw)); dipw.diph.dwSize = sizeof(DIPROPDWORD);
1
0
0
0
Bruno Jesus : dinput: Implement GetDeviceInfo(A) using the W version in the js driver.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: cfd3076c3165d067a6c76234a2d92015f81a2437 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cfd3076c3165d067a6c76234a…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Aug 16 22:24:03 2016 -0300 dinput: Implement GetDeviceInfo(A) using the W version in the js driver. Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_linux.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index f7061d5..b08d4c9 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -281,7 +281,7 @@ static INT find_joystick_devices(void) return joystick_devices_count; } -static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) +static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version, int id) { DWORD dwSize = lpddi->dwSize; @@ -298,33 +298,33 @@ static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver lpddi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8); else lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8); - strcpy(lpddi->tszInstanceName, joystick_devices[id].name); - strcpy(lpddi->tszProductName, joystick_devices[id].name); + MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszInstanceName, MAX_PATH); + MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszProductName, MAX_PATH); lpddi->guidFFDriver = GUID_NULL; } -static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version, int id) +static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) { + DIDEVICEINSTANCEW lpddiW; DWORD dwSize = lpddi->dwSize; + lpddiW.dwSize = sizeof(lpddiW); + fill_joystick_dideviceinstanceW(&lpddiW, version, id); + TRACE("%d %p\n", dwSize, lpddi); memset(lpddi, 0, dwSize); - /* Return joystick */ + /* Convert W->A */ lpddi->dwSize = dwSize; - lpddi->guidInstance = DInput_Wine_Joystick_GUID; - lpddi->guidInstance.Data3 = id; - lpddi->guidProduct = joystick_devices[id].guid_product; - /* we only support traditional joysticks for now */ - if (version >= 0x0800) - lpddi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8); - else - lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8); - - MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszInstanceName, MAX_PATH); - MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszProductName, MAX_PATH); - lpddi->guidFFDriver = GUID_NULL; + lpddi->guidInstance = lpddiW.guidInstance; + lpddi->guidProduct = lpddiW.guidProduct; + lpddi->dwDevType = lpddiW.dwDevType; + strcpy(lpddi->tszInstanceName, joystick_devices[id].name); + strcpy(lpddi->tszProductName, joystick_devices[id].name); + lpddi->guidFFDriver = lpddiW.guidFFDriver; + lpddi->wUsagePage = lpddiW.wUsagePage; + lpddi->wUsage = lpddiW.wUsage; } static HRESULT joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
1
0
0
0
Bruno Jesus : dinput: Use a helper to read information files for the js device.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 7439f7948c417905028aa82685b1613b77f5cf59 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7439f7948c417905028aa8268…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Aug 16 22:23:45 2016 -0300 dinput: Use a helper to read information files for the js device. Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_linux.c | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 20e2573..f7061d5 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -142,6 +142,30 @@ static struct JoyDev *joystick_devices; static void joy_polldev(LPDIRECTINPUTDEVICE8A iface); +#define SYS_PATH_FORMAT "/sys/class/input/js%d/device/id/%s" +static BOOL read_sys_id_variable(int index, const char *property, WORD *value) +{ + char sys_path[sizeof(SYS_PATH_FORMAT) + 16], id_str[5]; + int sys_fd; + BOOL ret = FALSE; + + sprintf(sys_path, SYS_PATH_FORMAT, index, property); + sys_fd = open(sys_path, O_RDONLY); + if (sys_fd > 0) + { + if (read(sys_fd, id_str, 4) == 4) + { + id_str[4] = '\0'; + *value = strtol(id_str, NULL, 16); + ret = TRUE; + } + + close(sys_fd); + } + return ret; +} +#undef SYS_PATH_FORMAT + static INT find_joystick_devices(void) { INT i; @@ -151,10 +175,9 @@ static INT find_joystick_devices(void) joystick_devices_count = 0; for (i = 0; i < MAX_JOYSTICKS; i++) { - int fd, sys_fd; + int fd; struct JoyDev joydev, *new_joydevs; BYTE axes_map[ABS_MAX + 1]; - char sys_path[sizeof("/sys/class/input/js/device/id/product") + 10], id_str[5]; snprintf(joydev.device, sizeof(joydev.device), "%s%d", JOYDEV_NEW, i); if ((fd = open(joydev.device, O_RDONLY)) < 0) @@ -225,31 +248,8 @@ static INT find_joystick_devices(void) joydev.vendor_id = 0; joydev.product_id = 0; - sprintf(sys_path, "/sys/class/input/js%d/device/id/vendor", i); - sys_fd = open(sys_path, O_RDONLY); - if (sys_fd > 0) - { - if (read(sys_fd, id_str, 4) == 4) - { - id_str[4] = '\0'; - joydev.vendor_id = strtol(id_str, NULL, 16); - } - - close(sys_fd); - } - - sprintf(sys_path, "/sys/class/input/js%d/device/id/product", i); - sys_fd = open(sys_path, O_RDONLY); - if (sys_fd > 0) - { - if (read(sys_fd, id_str, 4) == 4) - { - id_str[4] = '\0'; - joydev.product_id = strtol(id_str, NULL, 16); - } - - close(sys_fd); - } + read_sys_id_variable(i, "vendor", &joydev.vendor_id); + read_sys_id_variable(i, "product", &joydev.product_id); if (joydev.vendor_id == 0 || joydev.product_id == 0) {
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
78
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Results per page:
10
25
50
100
200