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 2019
----- 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
629 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Don't use virtual_uninterrupted_read_memory() for invalid %gs check.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 5f10545b199ce44de7f91d719131767396e320c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5f10545b199ce44de7f91d71…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 17 16:02:55 2019 +0200 ntdll: Don't use virtual_uninterrupted_read_memory() for invalid %gs check. It doesn't work for code in system libraries. This is a partial revert of 58139dcb125390b9a2bcd79869d571337d8ab3d8. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47769
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 8d1c591504..f15b327624 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -1595,17 +1595,16 @@ static inline DWORD is_privileged_instr( CONTEXT *context ) */ static inline BOOL check_invalid_gs( ucontext_t *sigcontext, CONTEXT *context ) { - BYTE instr[14]; - unsigned int i, len; + unsigned int prefix_count = 0; + const BYTE *instr = (BYTE *)context->Eip; WORD system_gs = x86_thread_data()->gs; if (context->SegGs == system_gs) return FALSE; if (!wine_ldt_is_system( context->SegCs )) return FALSE; /* only handle faults in system libraries */ - if (virtual_is_valid_code_address( (BYTE *)context->Eip, 1 )) return FALSE; + if (virtual_is_valid_code_address( instr, 1 )) return FALSE; - len = virtual_uninterrupted_read_memory( (BYTE *)context->Eip, instr, sizeof(instr) ); - for (i = 0; i < len; i++) switch (instr[i]) + for (;;) switch(*instr) { /* instruction prefixes */ case 0x2e: /* %cs: */ @@ -1618,6 +1617,8 @@ static inline BOOL check_invalid_gs( ucontext_t *sigcontext, CONTEXT *context ) case 0xf0: /* lock */ case 0xf2: /* repne */ case 0xf3: /* repe */ + if (++prefix_count >= 15) return FALSE; + instr++; continue; case 0x65: /* %gs: */ TRACE( "%04x/%04x at %p, fixing up\n", context->SegGs, system_gs, instr ); @@ -1628,7 +1629,6 @@ static inline BOOL check_invalid_gs( ucontext_t *sigcontext, CONTEXT *context ) default: return FALSE; } - return FALSE; }
1
0
0
0
Piotr Caban : winebus.sys: Stop device report threads to avoid crash on driver unload.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 4b3437907badf9cd3f0938710d68792cc7fe3be2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b3437907badf9cd3f093871…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Sep 17 13:55:08 2019 +0200 winebus.sys: Stop device report threads to avoid crash on driver unload. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_udev.c | 9 +++++++++ dlls/winebus.sys/main.c | 10 +++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 3ed1b029e8..926c755a85 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1478,6 +1478,12 @@ static DWORD CALLBACK deviceloop_thread(void *args) return 0; } +static int device_unload(DEVICE_OBJECT *device, void *context) +{ + try_remove_device(impl_from_DEVICE_OBJECT(device)->udev_device); + return 1; +} + void udev_driver_unload( void ) { TRACE("Unload Driver\n"); @@ -1487,6 +1493,9 @@ void udev_driver_unload( void ) close(deviceloop_control[0]); close(deviceloop_control[1]); CloseHandle(deviceloop_handle); + + bus_enumerate_hid_devices(&hidraw_vtbl, device_unload, NULL); + bus_enumerate_hid_devices(&lnxev_vtbl, device_unload, NULL); } NTSTATUS udev_driver_init(void) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 89ea65bba6..fc6b8be7f5 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -329,17 +329,21 @@ DEVICE_OBJECT *bus_find_hid_device(const platform_vtbl *vtbl, void *platform_dev DEVICE_OBJECT* bus_enumerate_hid_devices(const platform_vtbl *vtbl, enum_func function, void* context) { - struct pnp_device *dev; + struct pnp_device *dev, *dev_next; DEVICE_OBJECT *ret = NULL; + int cont; TRACE("(%p)\n", vtbl); EnterCriticalSection(&device_list_cs); - LIST_FOR_EACH_ENTRY(dev, &pnp_devset, struct pnp_device, entry) + LIST_FOR_EACH_ENTRY_SAFE(dev, dev_next, &pnp_devset, struct pnp_device, entry) { struct device_extension *ext = (struct device_extension *)dev->device->DeviceExtension; if (ext->vtbl != vtbl) continue; - if (function(dev->device, context) == 0) + LeaveCriticalSection(&device_list_cs); + cont = function(dev->device, context); + EnterCriticalSection(&device_list_cs); + if (!cont) { ret = dev->device; break;
1
0
0
0
Piotr Caban : winebus.sys: Stop deviceloop_thread to avoid crash on driver unload.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 90fa9967bcd571ce880f7cdd522a5b0b96801a13 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=90fa9967bcd571ce880f7cdd…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Sep 17 13:45:42 2019 +0200 winebus.sys: Stop deviceloop_thread to avoid crash on driver unload. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_udev.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 20841b09ae..3ed1b029e8 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -92,6 +92,8 @@ WINE_DECLARE_DEBUG_CHANNEL(hid_report); static struct udev *udev_context = NULL; static DWORD disable_hidraw = 0; static DWORD disable_input = 0; +static HANDLE deviceloop_handle; +static int deviceloop_control[2]; static const WCHAR hidraw_busidW[] = {'H','I','D','R','A','W',0}; static const WCHAR lnxev_busidW[] = {'L','N','X','E','V',0}; @@ -1453,15 +1455,20 @@ static DWORD CALLBACK deviceloop_thread(void *args) { struct udev_monitor *monitor; HANDLE init_done = args; - struct pollfd pfd; + struct pollfd pfd[2]; - monitor = create_monitor(&pfd); + pfd[1].fd = deviceloop_control[0]; + pfd[1].events = POLLIN; + pfd[1].revents = 0; + + monitor = create_monitor(&pfd[0]); build_initial_deviceset(); SetEvent(init_done); while (monitor) { - if (poll(&pfd, 1, -1) <= 0) continue; + if (poll(pfd, 2, -1) <= 0) continue; + if (pfd[1].revents) break; process_monitor_event(monitor); } @@ -1474,6 +1481,12 @@ static DWORD CALLBACK deviceloop_thread(void *args) void udev_driver_unload( void ) { TRACE("Unload Driver\n"); + + write(deviceloop_control[1], "q", 1); + WaitForSingleObject(deviceloop_handle, INFINITE); + close(deviceloop_control[0]); + close(deviceloop_control[1]); + CloseHandle(deviceloop_handle); } NTSTATUS udev_driver_init(void) @@ -1485,10 +1498,16 @@ NTSTATUS udev_driver_init(void) static const WCHAR input_disabledW[] = {'D','i','s','a','b','l','e','I','n','p','u','t',0}; static const UNICODE_STRING input_disabled = {sizeof(input_disabledW) - sizeof(WCHAR), sizeof(input_disabledW), (WCHAR*)input_disabledW}; + if (pipe(deviceloop_control) != 0) + { + ERR("Control pipe creation failed\n"); + return STATUS_UNSUCCESSFUL; + } + if (!(udev_context = udev_new())) { ERR("Can't create udev object\n"); - return STATUS_UNSUCCESSFUL; + goto error; } disable_hidraw = check_bus_option(&hidraw_disabled, 0); @@ -1511,17 +1530,23 @@ NTSTATUS udev_driver_init(void) result = WaitForMultipleObjects(2, events, FALSE, INFINITE); CloseHandle(events[0]); - CloseHandle(events[1]); if (result == WAIT_OBJECT_0) { + deviceloop_handle = events[1]; TRACE("Initialization successful\n"); return STATUS_SUCCESS; } + CloseHandle(events[1]); error: ERR("Failed to initialize udev device thread\n"); - udev_unref(udev_context); - udev_context = NULL; + close(deviceloop_control[0]); + close(deviceloop_control[1]); + if (udev_context) + { + udev_unref(udev_context); + udev_context = NULL; + } return STATUS_UNSUCCESSFUL; }
1
0
0
0
Hans Leidekker : wbemprox: Implement Win32_WinSAT.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 6ecf912a7a64f8fd38c9ec613fd9e656cff73769 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ecf912a7a64f8fd38c9ec61…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 17 13:41:45 2019 +0200 wbemprox: Implement Win32_WinSAT. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 49 ++++++++++++++++++++++++++++++++++++++- dlls/wbemprox/tests/query.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 556f149346..9ee7762b5b 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -116,6 +116,8 @@ static const WCHAR class_systemenclosureW[] = {'W','i','n','3','2','_','S','y','s','t','e','m','E','n','c','l','o','s','u','r','e',0}; static const WCHAR class_videocontrollerW[] = {'W','i','n','3','2','_','V','i','d','e','o','C','o','n','t','r','o','l','l','e','r',0}; +static const WCHAR class_winsatW[] = + {'W','i','n','3','2','_','W','i','n','S','A','T',0}; static const WCHAR prop_accountnameW[] = {'A','c','c','o','u','n','t','N','a','m','e',0}; @@ -175,6 +177,8 @@ static const WCHAR prop_configuredclockspeedW[] = {'C','o','n','f','i','g','u','r','e','d','C','l','o','c','k','S','p','e','e','d',0}; static const WCHAR prop_countrycodeW[] = {'C','o','u','n','t','r','y','C','o','d','e',0}; +static const WCHAR prop_cpuscoreW[] = + {'C','P','U','S','c','o','r','e',0}; static const WCHAR prop_cpustatusW[] = {'C','p','u','S','t','a','t','u','s',0}; static const WCHAR prop_csdversionW[] = @@ -197,6 +201,8 @@ static const WCHAR prop_currenttimezoneW[] = {'C','u','r','r','e','n','t','T','i','m','e','Z','o','n','e',0}; static const WCHAR prop_currentverticalresW[] = {'C','u','r','r','e','n','t','V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0}; +static const WCHAR prop_d3dscoreW[] = + {'D','3','D','S','c','o','r','e',0}; static const WCHAR prop_datawidthW[] = {'D','a','t','a','W','i','d','t','h',0}; static const WCHAR prop_defaultipgatewayW[] = @@ -217,6 +223,8 @@ static const WCHAR prop_dhcpenabledW[] = {'D','H','C','P','E','n','a','b','l','e','d',0}; static const WCHAR prop_directionW[] = {'D','i','r','e','c','t','i','o','n',0}; +static const WCHAR prop_diskscoreW[] = + {'D','i','s','k','S','c','o','r','e',0}; static const WCHAR prop_displaynameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0}; static const WCHAR prop_diskindexW[] = @@ -251,6 +259,8 @@ static const WCHAR prop_freephysicalmemoryW[] = {'F','r','e','e','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR prop_handleW[] = {'H','a','n','d','l','e',0}; +static const WCHAR prop_graphicsscoreW[] = + {'G','r','a','p','h','i','c','s','S','c','o','r','e',0}; static const WCHAR prop_horizontalresolutionW[] = {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; static const WCHAR prop_idW[] = @@ -303,6 +313,8 @@ static const WCHAR prop_mediatypeW[] = {'M','e','d','i','a','T','y','p','e',0}; static const WCHAR prop_memberW[] = {'M','e','m','b','e','r',0}; +static const WCHAR prop_memoryscoreW[] = + {'M','e','m','o','r','y','S','c','o','r','e',0}; static const WCHAR prop_memorytypeW[] = {'M','e','m','o','r','y','T','y','p','e',0}; static const WCHAR prop_methodW[] = @@ -413,6 +425,8 @@ static const WCHAR prop_tagW[] = {'T','a','g',0}; static const WCHAR prop_threadcountW[] = {'T','h','r','e','a','d','C','o','u','n','t',0}; +static const WCHAR prop_timetakenW[] = + {'T','i','m','e','T','a','k','e','n',0}; static const WCHAR prop_totalphysicalmemoryW[] = {'T','o','t','a','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR prop_totalvirtualmemorysizeW[] = @@ -445,6 +459,10 @@ static const WCHAR prop_volumenameW[] = {'V','o','l','u','m','e','N','a','m','e',0}; static const WCHAR prop_volumeserialnumberW[] = {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0}; +static const WCHAR prop_winsatassessmentstateW[] = + {'W','i','n','S','A','T','A','s','s','e','s','s','m','e','n','t','S','t','a','t','e',0}; +static const WCHAR prop_winsprlevelW[] = + {'W','i','n','S','P','R','L','e','v','e','l',0}; static const WCHAR prop_workingsetsizeW[] = {'W','o','r','k','i','n','g','S','e','t','S','i','z','e',0}; @@ -802,6 +820,17 @@ static const struct column col_videocontroller[] = { prop_videomodedescriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_videoprocessorW, CIM_STRING|COL_FLAG_DYNAMIC }, }; +static const struct column col_winsat[] = +{ + { prop_cpuscoreW, CIM_REAL32 }, + { prop_d3dscoreW, CIM_REAL32 }, + { prop_diskscoreW, CIM_REAL32 }, + { prop_graphicsscoreW, CIM_REAL32 }, + { prop_memoryscoreW, CIM_REAL32 }, + { prop_timetakenW, CIM_STRING|COL_FLAG_KEY }, + { prop_winsatassessmentstateW, CIM_UINT32, VT_I4 }, + { prop_winsprlevelW, CIM_REAL32 }, +}; static const WCHAR baseboard_manufacturerW[] = {'I','n','t','e','l',' ','C','o','r','p','o','r','a','t','i','o','n',0}; @@ -897,6 +926,8 @@ static const WCHAR videocontroller_driverversionW[] = {'1','.','0',0}; static const WCHAR videocontroller_statusW[] = {'O','K',0}; +static const WCHAR winsat_timetakenW[] = + {'M','o','s','t','R','e','c','e','n','t','A','s','s','e','s','s','m','e','n','t',0}; #include "pshpack1.h" struct record_associator @@ -1252,6 +1283,17 @@ struct record_videocontroller const WCHAR *videomodedescription; const WCHAR *videoprocessor; }; +struct record_winsat +{ + FLOAT cpuscore; + FLOAT d3dscore; + FLOAT diskscrore; + FLOAT graphicsscore; + FLOAT memoryscore; + const WCHAR *timetaken; + UINT32 winsatassessmentstate; + FLOAT winsprlevel; +}; #include "poppack.h" static const struct record_associator data_associator[] = @@ -1325,6 +1367,10 @@ static const struct record_systemsecurity data_systemsecurity[] = { { security_get_sd, security_set_sd } }; +static const struct record_winsat data_winsat[] = +{ + { 8.0f, 8.0f, 8.0f, 8.0f, 8.0f, winsat_timetakenW, 1 /* Valid */, 8.0f }, +}; /* check if row matches condition and update status */ static BOOL match_row( const struct table *table, UINT row, const struct expr *cond, enum fill_status *status ) @@ -4360,7 +4406,8 @@ static struct table builtin_classes[] = { class_stdregprovW, C(col_stdregprov), D(data_stdregprov) }, { class_systemsecurityW, C(col_systemsecurity), D(data_systemsecurity) }, { class_systemenclosureW, C(col_systemenclosure), 0, 0, NULL, fill_systemenclosure }, - { class_videocontrollerW, C(col_videocontroller), 0, 0, NULL, fill_videocontroller } + { class_videocontrollerW, C(col_videocontroller), 0, 0, NULL, fill_videocontroller }, + { class_winsatW, C(col_winsat), D(data_winsat) }, }; #undef C #undef D diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index b1d15c0669..d2fe9dbad8 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -339,6 +339,9 @@ static void _check_property( ULONG line, IWbemClassObject *obj, const WCHAR *pro case VT_I4: trace( "%s: %d\n", wine_dbgstr_w(prop), V_I4(&val) ); break; + case VT_R4: + trace( "%s: %f\n", wine_dbgstr_w(prop), V_R4(&val) ); + break; default: break; } @@ -1643,6 +1646,58 @@ static void test_Win32_PnPEntity( IWbemServices *services ) IEnumWbemClassObject_Release( enm ); } +static void test_Win32_WinSAT( IWbemServices *services ) +{ + static const WCHAR cpuscoreW[] = + {'C','P','U','S','c','o','r','e',0}; + static const WCHAR d3dscoreW[] = + {'D','3','D','S','c','o','r','e',0}; + static const WCHAR diskscoreW[] = + {'D','i','s','k','S','c','o','r','e',0}; + static const WCHAR graphicsscoreW[] = + {'G','r','a','p','h','i','c','s','S','c','o','r','e',0}; + static const WCHAR memoryscoreW[] = + {'M','e','m','o','r','y','S','c','o','r','e',0}; + static const WCHAR winsatassessmentstateW[] = + {'W','i','n','S','A','T','A','s','s','e','s','s','m','e','n','t','S','t','a','t','e',0}; + static const WCHAR winsprlevelW[] = + {'W','i','n','S','P','R','L','e','v','e','l',0}; + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_','W','i','n','S','A','T',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK || broken(hr == WBEM_E_INVALID_CLASS) /* win2k8 */, "got %08x\n", hr ); + if (hr == WBEM_E_INVALID_CLASS) + { + win_skip( "class not found\n" ); + return; + } + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + + check_property( obj, cpuscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, d3dscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, diskscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, graphicsscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, memoryscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, winsatassessmentstateW, VT_I4, CIM_UINT32 ); + check_property( obj, winsprlevelW, VT_R4, CIM_REAL32 ); + IWbemClassObject_Release( obj ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + START_TEST(query) { static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; @@ -1693,6 +1748,7 @@ START_TEST(query) test_Win32_Service( services ); test_Win32_SystemEnclosure( services ); test_Win32_VideoController( services ); + test_Win32_WinSAT( services ); SysFreeString( path ); IWbemServices_Release( services );
1
0
0
0
Hans Leidekker : wbemprox: Implement more Win32_PhysicalMemory properties.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 18ff2817be1a44fa92f0541ff04504b96c22607c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=18ff2817be1a44fa92f0541f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 17 13:41:44 2019 +0200 wbemprox: Implement more Win32_PhysicalMemory properties. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 28acc3fc6f..556f149346 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -171,6 +171,8 @@ static const WCHAR prop_commandlineW[] = {'C','o','m','m','a','n','d','L','i','n','e',0}; static const WCHAR prop_configmanagererrorcodeW[] = {'C','o','n','f','i','g','M','a','n','a','g','e','r','E','r','r','o','r','C','o','d','e',0}; +static const WCHAR prop_configuredclockspeedW[] = + {'C','o','n','f','i','g','u','r','e','d','C','l','o','c','k','S','p','e','e','d',0}; static const WCHAR prop_countrycodeW[] = {'C','o','u','n','t','r','y','C','o','d','e',0}; static const WCHAR prop_cpustatusW[] = @@ -331,6 +333,8 @@ static const WCHAR prop_ostypeW[] = {'O','S','T','y','p','e',0}; static const WCHAR prop_parameterW[] = {'P','a','r','a','m','e','t','e','r',0}; +static const WCHAR prop_partnumberW[] = + {'P','a','r','t','N','u','m','b','e','r',0}; static const WCHAR prop_physicaladapterW[] = {'P','h','y','s','i','c','a','l','A','d','a','p','t','e','r',0}; static const WCHAR prop_pixelsperxlogicalinchW[] = @@ -650,9 +654,11 @@ static const struct column col_physicalmedia[] = }; static const struct column col_physicalmemory[] = { - { prop_capacityW, CIM_UINT64 }, - { prop_devicelocatorW, CIM_STRING }, - { prop_memorytypeW, CIM_UINT16, VT_I4 } + { prop_capacityW, CIM_UINT64 }, + { prop_configuredclockspeedW, CIM_UINT32, VT_I4 }, + { prop_devicelocatorW, CIM_STRING }, + { prop_memorytypeW, CIM_UINT16, VT_I4 }, + { prop_partnumberW, CIM_STRING } }; static const struct column col_pnpentity[] = { @@ -1099,8 +1105,10 @@ struct record_physicalmedia struct record_physicalmemory { UINT64 capacity; + UINT32 configuredclockspeed; const WCHAR *devicelocator; UINT16 memorytype; + const WCHAR *partnumber; }; struct record_pnpentity { @@ -3218,9 +3226,11 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_physicalmemory *)table->data; - rec->capacity = get_total_physical_memory(); - rec->devicelocator = heap_strdupW( dimm0W ); - rec->memorytype = 9; /* RAM */ + rec->capacity = get_total_physical_memory(); + rec->configuredclockspeed = 0; + rec->devicelocator = dimm0W; + rec->memorytype = 9; /* RAM */ + rec->partnumber = NULL; if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++;
1
0
0
0
Hans Leidekker : wbemprox: Implement more Win32_OperatingSystem properties.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: ee74d9ad7abcf86de53965f204fdf9f56e036083 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee74d9ad7abcf86de53965f2…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 17 13:41:43 2019 +0200 wbemprox: Implement more Win32_OperatingSystem properties. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 30 ++++++++++++++++++++++++++---- dlls/wbemprox/tests/query.c | 9 +++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index bb43f8a229..28acc3fc6f 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -87,7 +87,7 @@ static const WCHAR class_networkadapterW[] = static const WCHAR class_networkadapterconfigW[] = {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r', 'C','o','n','f','i','g','u','r','a','t','i','o','n',0}; -static const WCHAR class_osW[] = +static const WCHAR class_operatingsystemW[] = {'W','i','n','3','2','_','O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0}; static const WCHAR class_paramsW[] = {'_','_','P','A','R','A','M','E','T','E','R','S',0}; @@ -177,6 +177,8 @@ static const WCHAR prop_cpustatusW[] = {'C','p','u','S','t','a','t','u','s',0}; static const WCHAR prop_csdversionW[] = {'C','S','D','V','e','r','s','i','o','n',0}; +static const WCHAR prop_csnameW[] = + {'C','S','N','a','m','e',0}; static const WCHAR prop_currentbitsperpixelW[] = {'C','u','r','r','e','n','t','B','i','t','s','P','e','r','P','i','x','e','l',0}; static const WCHAR prop_currentclockspeedW[] = @@ -189,6 +191,8 @@ static const WCHAR prop_currentrefreshrateW[] = {'C','u','r','r','e','n','t','R','e','f','r','e','s','h','R','a','t','e',0}; static const WCHAR prop_currentscanmodeW[] = {'C','u','r','r','e','n','t','S','c','a','n','M','o','d','e',0}; +static const WCHAR prop_currenttimezoneW[] = + {'C','u','r','r','e','n','t','T','i','m','e','Z','o','n','e',0}; static const WCHAR prop_currentverticalresW[] = {'C','u','r','r','e','n','t','V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0}; static const WCHAR prop_datawidthW[] = @@ -597,18 +601,21 @@ static const struct column col_networkadapterconfig[] = { prop_macaddressW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_settingidW, CIM_STRING|COL_FLAG_DYNAMIC } }; -static const struct column col_os[] = +static const struct column col_operatingsystem[] = { { prop_buildnumberW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_codesetW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_countrycodeW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_csdversionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_csnameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_currenttimezoneW, CIM_SINT16 }, { prop_freephysicalmemoryW, CIM_UINT64 }, { prop_installdateW, CIM_DATETIME }, { prop_lastbootuptimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_manufacturerW, CIM_STRING }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_operatingsystemskuW, CIM_UINT32, VT_I4 }, { prop_osarchitectureW, CIM_STRING }, @@ -1049,11 +1056,14 @@ struct record_operatingsystem const WCHAR *codeset; const WCHAR *countrycode; const WCHAR *csdversion; + const WCHAR *csname; + INT16 currenttimezone; UINT64 freephysicalmemory; const WCHAR *installdate; const WCHAR *lastbootuptime; const WCHAR *localdatetime; const WCHAR *locale; + const WCHAR *manufacturer; const WCHAR *name; UINT32 operatingsystemsku; const WCHAR *osarchitecture; @@ -3773,9 +3783,18 @@ static DWORD get_operatingsystemsku(void) GetProductInfo( 6, 0, 0, 0, &ret ); return ret; } +static INT16 get_currenttimezone(void) +{ + TIME_ZONE_INFORMATION info; + DWORD status = GetTimeZoneInformation( &info ); + if (status == TIME_ZONE_ID_INVALID) return 0; + if (status == TIME_ZONE_ID_DAYLIGHT) return -(info.Bias + info.DaylightBias); + return -(info.Bias + info.StandardBias); +} -static enum fill_status fill_os( struct table *table, const struct expr *cond ) +static enum fill_status fill_operatingsystem( struct table *table, const struct expr *cond ) { + static const WCHAR wineprojectW[] = {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; struct record_operatingsystem *rec; enum fill_status status = FILL_STATUS_UNFILTERED; OSVERSIONINFOEXW ver; @@ -3792,11 +3811,14 @@ static enum fill_status fill_os( struct table *table, const struct expr *cond ) rec->codeset = get_codeset(); rec->countrycode = get_countrycode(); rec->csdversion = ver.szCSDVersion[0] ? heap_strdupW( ver.szCSDVersion ) : NULL; + rec->csname = get_computername(); + rec->currenttimezone = get_currenttimezone(); rec->freephysicalmemory = get_available_physical_memory() / 1024; rec->installdate = os_installdateW; rec->lastbootuptime = get_lastbootuptime(); rec->localdatetime = get_localdatetime(); rec->locale = get_locale(); + rec->manufacturer = wineprojectW; rec->name = get_osname( rec->caption ); rec->operatingsystemsku = get_operatingsystemsku(); rec->osarchitecture = get_osarchitecture(); @@ -4312,7 +4334,7 @@ static struct table builtin_classes[] = { class_logicaldisktopartitionW, C(col_logicaldisktopartition), 0, 0, NULL, fill_logicaldisktopartition }, { class_networkadapterW, C(col_networkadapter), 0, 0, NULL, fill_networkadapter }, { class_networkadapterconfigW, C(col_networkadapterconfig), 0, 0, NULL, fill_networkadapterconfig }, - { class_osW, C(col_os), 0, 0, NULL, fill_os }, + { class_operatingsystemW, C(col_operatingsystem), 0, 0, NULL, fill_operatingsystem }, { class_paramsW, C(col_param), D(data_param) }, { class_physicalmediaW, C(col_physicalmedia), D(data_physicalmedia) }, { class_physicalmemoryW, C(col_physicalmemory), 0, 0, NULL, fill_physicalmemory }, diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 23641fc0d3..b1d15c0669 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -333,6 +333,9 @@ static void _check_property( ULONG line, IWbemClassObject *obj, const WCHAR *pro case VT_BSTR: trace( "%s: %s\n", wine_dbgstr_w(prop), wine_dbgstr_w(V_BSTR(&val)) ); break; + case VT_I2: + trace( "%s: %d\n", wine_dbgstr_w(prop), V_I2(&val) ); + break; case VT_I4: trace( "%s: %d\n", wine_dbgstr_w(prop), V_I4(&val) ); break; @@ -1187,7 +1190,10 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) static const WCHAR buildnumberW[] = {'B','u','i','l','d','N','u','m','b','e','r',0}; static const WCHAR captionW[] = {'C','a','p','t','i','o','n',0}; static const WCHAR csdversionW[] = {'C','S','D','V','e','r','s','i','o','n',0}; + static const WCHAR csnameW[] = {'C','S','N','a','m','e',0}; + static const WCHAR currenttimezoneW[] = {'C','u','r','r','e','n','t','T','i','m','e','Z','o','n','e',0}; static const WCHAR freephysicalmemoryW[] = {'F','r','e','e','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; + static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; static const WCHAR nameW[] = {'N','a','m','e',0}; static const WCHAR operatingsystemskuW[] = {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m','S','K','U',0}; static const WCHAR osproductsuiteW[] = {'O','S','P','r','o','d','u','c','t','S','u','i','t','e',0}; @@ -1262,6 +1268,9 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) trace( "osproductsuite: %d (%08x)\n", V_I4( &val ), V_I4( &val ) ); VariantClear( &val ); + check_property( obj, csnameW, VT_BSTR, CIM_STRING ); + check_property( obj, currenttimezoneW, VT_I2, CIM_SINT16 ); + check_property( obj, manufacturerW, VT_BSTR, CIM_STRING ); check_property( obj, ostypeW, VT_I4, CIM_UINT16 ); check_property( obj, servicepackmajorW, VT_I4, CIM_UINT16 ); check_property( obj, servicepackminorW, VT_I4, CIM_UINT16 );
1
0
0
0
Hans Leidekker : wbemprox: Implement Win32_BIOS.CurrentLanguage.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: a94c466c54be1e8b0f3bbca13fa353bdd8e44d9d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a94c466c54be1e8b0f3bbca1…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 17 13:41:42 2019 +0200 wbemprox: Implement Win32_BIOS.CurrentLanguage. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 8bb5be0aac..bb43f8a229 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -183,6 +183,8 @@ static const WCHAR prop_currentclockspeedW[] = {'C','u','r','r','e','n','t','C','l','o','c','k','S','p','e','e','d',0}; static const WCHAR prop_currenthorizontalresW[] = {'C','u','r','r','e','n','t','H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; +static const WCHAR prop_currentlanguageW[] = + {'C','u','r','r','e','n','t','L','a','n','g','u','a','g','e',0}; static const WCHAR prop_currentrefreshrateW[] = {'C','u','r','r','e','n','t','R','e','f','r','e','s','h','R','a','t','e',0}; static const WCHAR prop_currentscanmodeW[] = @@ -457,6 +459,7 @@ static const struct column col_baseboard[] = }; static const struct column col_bios[] = { + { prop_currentlanguageW, CIM_STRING }, { prop_descriptionW, CIM_STRING }, { prop_identificationcodeW, CIM_STRING }, { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, @@ -901,6 +904,7 @@ struct record_baseboard }; struct record_bios { + const WCHAR *currentlanguage; const WCHAR *description; const WCHAR *identificationcode; const WCHAR *manufacturer; @@ -1634,6 +1638,7 @@ static enum fill_status fill_bios( struct table *table, const struct expr *cond GetSystemFirmwareTable( RSMB, 0, buf, len ); rec = (struct record_bios *)table->data; + rec->currentlanguage = NULL; rec->description = bios_descriptionW; rec->identificationcode = NULL; rec->manufacturer = get_bios_manufacturer( buf, len );
1
0
0
0
Hans Leidekker : wbemprox: Add support for CIM_REAL32 values.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 4e133e7aaf3edc9ce3c6d096e683c309993d60f3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e133e7aaf3edc9ce3c6d096…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 17 13:41:41 2019 +0200 wbemprox: Add support for CIM_REAL32 values. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/table.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/wbemprox/table.c b/dlls/wbemprox/table.c index 79c7eb13a4..7d531f5ec5 100644 --- a/dlls/wbemprox/table.c +++ b/dlls/wbemprox/table.c @@ -67,6 +67,8 @@ UINT get_type_size( CIMTYPE type ) case CIM_REFERENCE: case CIM_STRING: return sizeof(WCHAR *); + case CIM_REAL32: + return sizeof(FLOAT); default: ERR("unhandled type %u\n", type); break; @@ -139,6 +141,9 @@ HRESULT get_value( const struct table *table, UINT row, UINT column, LONGLONG *v case CIM_UINT64: *val = *(const UINT64 *)ptr; break; + case CIM_REAL32: + memcpy( val, ptr, sizeof(FLOAT) ); + break; default: ERR("invalid column type %u\n", table->columns[column].type & COL_TYPE_MASK); *val = 0;
1
0
0
0
Dmitry Timoshkov : rpcrt4: Implement RpcAsyncCompleteCall for server side.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: ccbfad5ea7e23dd1057328abae0ed4b0a91c194d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ccbfad5ea7e23dd1057328ab…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Sep 13 13:34:40 2019 +0800 rpcrt4: Implement RpcAsyncCompleteCall for server side. Based on NdrStubCall2 implementation. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_stubless.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/rpcrt4/ndr_stubless.h | 1 + dlls/rpcrt4/rpc_async.c | 3 +- 3 files changed, 94 insertions(+), 2 deletions(-) diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 70a26dd5b3..10de5a4f44 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -2082,3 +2082,95 @@ void RPC_ENTRY NdrAsyncServerCall(PRPC_MESSAGE pRpcMsg) else call_server_func(pServerInfo->DispatchTable[pRpcMsg->ProcNum], args, async_call_data->stack_size); } + +RPC_STATUS NdrpCompleteAsyncServerCall(RPC_ASYNC_STATE *pAsync, void *Reply) +{ + /* pointer to start of stack where arguments start */ + PMIDL_STUB_MESSAGE pStubMsg; + struct async_call_data *async_call_data; + /* the type of pass we are currently doing */ + enum stubless_phase phase; + /* location to put retval into */ + LONG_PTR *retval_ptr; + RPC_STATUS status = RPC_S_OK; + + if (!pAsync->StubInfo) + return RPC_S_INVALID_ASYNC_HANDLE; + + async_call_data = pAsync->StubInfo; + pStubMsg = async_call_data->pStubMsg; + + TRACE("pAsync %p, pAsync->StubInfo %p, pFormat %p\n", pAsync, pAsync->StubInfo, async_call_data->pHandleFormat); + + /* 3. INITOUT */ + TRACE("INITOUT\n"); + retval_ptr = stub_do_args(async_call_data->pStubMsg, async_call_data->pHandleFormat, STUBLESS_INITOUT, async_call_data->number_of_params); + if (retval_ptr) + { + TRACE("stub implementation returned 0x%lx\n", *(LONG_PTR *)Reply); + *retval_ptr = *(LONG_PTR *)Reply; + } + else + TRACE("void stub implementation\n"); + + for (phase = STUBLESS_CALCSIZE; phase <= STUBLESS_FREE; phase++) + { + TRACE("phase = %d\n", phase); + switch (phase) + { + case STUBLESS_GETBUFFER: + if (async_call_data->pProcHeader->Oi_flags & Oi_OBJECT_PROC) + { + ERR("objects not supported\n"); + HeapFree(GetProcessHeap(), 0, async_call_data->pStubMsg->StackTop); + I_RpcFree(async_call_data); + I_RpcFree(pAsync); + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + else + { + pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength; + /* allocate buffer for [out] and [ret] params */ + status = I_RpcGetBuffer(pStubMsg->RpcMsg); + if (status) + RpcRaiseException(status); + pStubMsg->Buffer = pStubMsg->RpcMsg->Buffer; + } + break; + + case STUBLESS_CALCSIZE: + case STUBLESS_MARSHAL: + case STUBLESS_MUSTFREE: + case STUBLESS_FREE: + stub_do_args(pStubMsg, async_call_data->pHandleFormat, phase, async_call_data->number_of_params); + break; + default: + ERR("shouldn't reach here. phase %d\n", phase); + break; + } + } + +#if 0 /* FIXME */ + if (ext_flags.HasNewCorrDesc) + { + /* free extra correlation package */ + NdrCorrelationFree(pStubMsg); + } + + if (Oif_flags.HasPipes) + { + /* NdrPipesDone(...) */ + } + + /* free the full pointer translation tables */ + if (async_call_data->pProcHeader->Oi_flags & Oi_FULL_PTR_USED) + NdrFullPointerXlatFree(pStubMsg->FullPtrXlatTables); +#endif + + /* free server function stack */ + HeapFree(GetProcessHeap(), 0, async_call_data->pStubMsg->StackTop); + I_RpcFree(async_call_data); + I_RpcFree(pAsync); + + return S_OK; +} diff --git a/dlls/rpcrt4/ndr_stubless.h b/dlls/rpcrt4/ndr_stubless.h index fc67cf9020..699a6bcfcf 100644 --- a/dlls/rpcrt4/ndr_stubless.h +++ b/dlls/rpcrt4/ndr_stubless.h @@ -261,3 +261,4 @@ PFORMAT_STRING convert_old_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFo unsigned int stack_size, BOOL object_proc, void *buffer, unsigned int size, unsigned int *count ) DECLSPEC_HIDDEN; RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply) DECLSPEC_HIDDEN; +RPC_STATUS NdrpCompleteAsyncServerCall(RPC_ASYNC_STATE *pAsync, void *Reply) DECLSPEC_HIDDEN; diff --git a/dlls/rpcrt4/rpc_async.c b/dlls/rpcrt4/rpc_async.c index 9c3d90cfba..00c2d6bede 100644 --- a/dlls/rpcrt4/rpc_async.c +++ b/dlls/rpcrt4/rpc_async.c @@ -125,8 +125,7 @@ RPC_STATUS WINAPI RpcAsyncCompleteCall(PRPC_ASYNC_STATE pAsync, void *Reply) if (data->pStubMsg->IsClient) return NdrpCompleteAsyncClientCall(pAsync, Reply); - FIXME("not implemented for server side\n"); - return RPC_S_CALL_FAILED; + return NdrpCompleteAsyncServerCall(pAsync, Reply); } /***********************************************************************
1
0
0
0
Dmitry Timoshkov : rpcrt4: Implement NdrAsyncServerCall.
by Alexandre Julliard
17 Sep '19
17 Sep '19
Module: wine Branch: master Commit: 29fa835687cd708b63db39ab0614508a3534d27c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=29fa835687cd708b63db39ab…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Sep 13 13:34:33 2019 +0800 rpcrt4: Implement NdrAsyncServerCall. Based on NdrStubCall2 and NdrAsyncClientCall implementations. In order to test asynchronous RPC I used dlls/rpcrt4/tests/server.c as a base, converted int_return() and sum() to use asynchronous RPC on both client and server sides (server.idl doesn't need any changes), and added server.acf: interface IServer { [async] int_return(); [async] sum(); } With this implementation these tests pass under Wine. Since widl doesn't support asynchronous RPC it's impossible to add appropriate Wine tests. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_stubless.c | 190 +++++++++++++++++++++++++++++++++++++++++---- dlls/rpcrt4/ndr_stubless.h | 15 ++++ dlls/rpcrt4/rpc_async.c | 11 ++- 3 files changed, 199 insertions(+), 17 deletions(-) diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 90537515ea..70a26dd5b3 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1559,21 +1559,6 @@ void WINAPI NdrServerCallAll( PRPC_MESSAGE msg ) FIXME("%p stub\n", msg); } -struct async_call_data -{ - MIDL_STUB_MESSAGE *pStubMsg; - const NDR_PROC_HEADER *pProcHeader; - PFORMAT_STRING pHandleFormat; - PFORMAT_STRING pParamFormat; - RPC_BINDING_HANDLE hBinding; - /* size of stack */ - unsigned short stack_size; - /* number of parameters. optional for client to give it to us */ - unsigned int number_of_params; - /* correlation cache */ - ULONG_PTR NdrCorrCache[256]; -}; - /* Helper for ndr_async_client_call, to factor out the part that may or may not be * guarded by a try/except block. */ static void do_ndr_async_client_call( const MIDL_STUB_DESC *pStubDesc, PFORMAT_STRING pFormat, void **stack_top ) @@ -1922,5 +1907,178 @@ RPCRTAPI LONG RPC_ENTRY NdrAsyncStubCall(struct IRpcStubBuffer* pThis, void RPC_ENTRY NdrAsyncServerCall(PRPC_MESSAGE pRpcMsg) { - FIXME("unimplemented, %p\n", pRpcMsg); + const MIDL_SERVER_INFO *pServerInfo; + const MIDL_STUB_DESC *pStubDesc; + PFORMAT_STRING pFormat; + /* pointer to start of stack to pass into stub implementation */ + unsigned char *args; + /* header for procedure string */ + const NDR_PROC_HEADER *pProcHeader; + struct async_call_data *async_call_data; + PRPC_ASYNC_STATE pAsync; + RPC_STATUS status; + + TRACE("%p\n", pRpcMsg); + + pServerInfo = ((RPC_SERVER_INTERFACE *)pRpcMsg->RpcInterfaceInformation)->InterpreterInfo; + + pStubDesc = pServerInfo->pStubDesc; + pFormat = pServerInfo->ProcString + pServerInfo->FmtStringOffset[pRpcMsg->ProcNum]; + pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0]; + + TRACE("NDR Version: 0x%x\n", pStubDesc->Version); + + async_call_data = I_RpcAllocate(sizeof(*async_call_data) + sizeof(MIDL_STUB_MESSAGE) + sizeof(RPC_MESSAGE)); + if (!async_call_data) RpcRaiseException(RPC_X_NO_MEMORY); + async_call_data->pProcHeader = pProcHeader; + + async_call_data->pStubMsg = (PMIDL_STUB_MESSAGE)(async_call_data + 1); + *(PRPC_MESSAGE)(async_call_data->pStubMsg + 1) = *pRpcMsg; + + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) + { + const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0]; + async_call_data->stack_size = header_rpc->stack_size; + pFormat += sizeof(NDR_PROC_HEADER_RPC); + } + else + { + async_call_data->stack_size = pProcHeader->stack_size; + pFormat += sizeof(NDR_PROC_HEADER); + } + + TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags); + + /* binding */ + switch (pProcHeader->handle_type) + { + /* explicit binding: parse additional section */ + case 0: + switch (*pFormat) /* handle_type */ + { + case FC_BIND_PRIMITIVE: /* explicit primitive */ + pFormat += sizeof(NDR_EHD_PRIMITIVE); + break; + case FC_BIND_GENERIC: /* explicit generic */ + pFormat += sizeof(NDR_EHD_GENERIC); + break; + case FC_BIND_CONTEXT: /* explicit context */ + pFormat += sizeof(NDR_EHD_CONTEXT); + break; + default: + ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type); + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + break; + case FC_BIND_GENERIC: /* implicit generic */ + case FC_BIND_PRIMITIVE: /* implicit primitive */ + case FC_CALLBACK_HANDLE: /* implicit callback */ + case FC_AUTO_HANDLE: /* implicit auto handle */ + break; + default: + ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type); + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) + { + ERR("objects not supported\n"); + I_RpcFree(async_call_data); + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + + NdrServerInitializeNew(pRpcMsg, async_call_data->pStubMsg, pStubDesc); + + /* create the full pointer translation tables, if requested */ + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) + async_call_data->pStubMsg->FullPtrXlatTables = NdrFullPointerXlatInit(0, XLAT_SERVER); + + /* use alternate memory allocation routines */ + if (pProcHeader->Oi_flags & Oi_RPCSS_ALLOC_USED) +#if 0 + NdrRpcSsEnableAllocate(&stubMsg); +#else + FIXME("Set RPCSS memory allocation routines\n"); +#endif + + TRACE("allocating memory for stack of size %x\n", async_call_data->stack_size); + + args = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, async_call_data->stack_size); + async_call_data->pStubMsg->StackTop = args; /* used by conformance of top-level objects */ + + pAsync = I_RpcAllocate(sizeof(*pAsync)); + if (!pAsync) RpcRaiseException(RPC_X_NO_MEMORY); + + status = RpcAsyncInitializeHandle(pAsync, sizeof(*pAsync)); + if (status != RPC_S_OK) + RpcRaiseException(status); + + pAsync->StubInfo = async_call_data; + TRACE("pAsync %p, pAsync->StubInfo %p, pFormat %p\n", pAsync, pAsync->StubInfo, async_call_data->pHandleFormat); + + /* add the implicit pAsync pointer as the first arg to the function */ + *(void **)args = pAsync; + + if (is_oicf_stubdesc(pStubDesc)) + { + const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat; + /* cache of Oif_flags from v2 procedure header */ + INTERPRETER_OPT_FLAGS Oif_flags; + /* cache of extension flags from NDR_PROC_HEADER_EXTS */ + INTERPRETER_OPT_FLAGS2 ext_flags = { 0 }; + + Oif_flags = pOIFHeader->Oi2Flags; + async_call_data->number_of_params = pOIFHeader->number_of_params; + + pFormat += sizeof(NDR_PROC_PARTIAL_OIF_HEADER); + + TRACE("Oif_flags = %s\n", debugstr_INTERPRETER_OPT_FLAGS(Oif_flags) ); + + if (Oif_flags.HasExtensions) + { + const NDR_PROC_HEADER_EXTS *pExtensions = (const NDR_PROC_HEADER_EXTS *)pFormat; + ext_flags = pExtensions->Flags2; + pFormat += pExtensions->Size; + } + + if (Oif_flags.HasPipes) + { + FIXME("pipes not supported yet\n"); + RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */ + /* init pipes package */ + /* NdrPipesInitialize(...) */ + } + if (ext_flags.HasNewCorrDesc) + { + /* initialize extra correlation package */ + NdrCorrelationInitialize(async_call_data->pStubMsg, async_call_data->NdrCorrCache, sizeof(async_call_data->NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + async_call_data->pStubMsg->CorrDespIncrement = 12; + } + } + else + { + pFormat = convert_old_args( async_call_data->pStubMsg, pFormat, async_call_data->stack_size, + pProcHeader->Oi_flags & Oi_OBJECT_PROC, + /* reuse the correlation cache, it's not needed for v1 format */ + async_call_data->NdrCorrCache, sizeof(async_call_data->NdrCorrCache), &async_call_data->number_of_params ); + } + + /* convert strings, floating point values and endianness into our + * preferred format */ + if ((pRpcMsg->DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION) + NdrConvert(async_call_data->pStubMsg, pFormat); + + async_call_data->pHandleFormat = pFormat; + + /* 1. UNMARSHAL */ + TRACE("UNMARSHAL\n"); + stub_do_args(async_call_data->pStubMsg, pFormat, STUBLESS_UNMARSHAL, async_call_data->number_of_params); + + /* 2. CALLSERVER */ + TRACE("CALLSERVER\n"); + if (pServerInfo->ThunkTable && pServerInfo->ThunkTable[pRpcMsg->ProcNum]) + pServerInfo->ThunkTable[pRpcMsg->ProcNum](async_call_data->pStubMsg); + else + call_server_func(pServerInfo->DispatchTable[pRpcMsg->ProcNum], args, async_call_data->stack_size); } diff --git a/dlls/rpcrt4/ndr_stubless.h b/dlls/rpcrt4/ndr_stubless.h index 606513ff24..fc67cf9020 100644 --- a/dlls/rpcrt4/ndr_stubless.h +++ b/dlls/rpcrt4/ndr_stubless.h @@ -224,6 +224,21 @@ typedef struct _NDR_EHD_CONTEXT #include "poppack.h" +struct async_call_data +{ + MIDL_STUB_MESSAGE *pStubMsg; + const NDR_PROC_HEADER *pProcHeader; + PFORMAT_STRING pHandleFormat; + PFORMAT_STRING pParamFormat; + RPC_BINDING_HANDLE hBinding; + /* size of stack */ + unsigned short stack_size; + /* number of parameters. optional for client to give it to us */ + unsigned int number_of_params; + /* correlation cache */ + ULONG_PTR NdrCorrCache[256]; +}; + enum stubless_phase { STUBLESS_UNMARSHAL, diff --git a/dlls/rpcrt4/rpc_async.c b/dlls/rpcrt4/rpc_async.c index 891fc5ad72..9c3d90cfba 100644 --- a/dlls/rpcrt4/rpc_async.c +++ b/dlls/rpcrt4/rpc_async.c @@ -110,6 +110,8 @@ RPC_STATUS WINAPI RpcAsyncGetCallStatus(PRPC_ASYNC_STATE pAsync) */ RPC_STATUS WINAPI RpcAsyncCompleteCall(PRPC_ASYNC_STATE pAsync, void *Reply) { + struct async_call_data *data; + TRACE("(%p, %p)\n", pAsync, Reply); if (!valid_async_handle(pAsync)) @@ -117,7 +119,14 @@ RPC_STATUS WINAPI RpcAsyncCompleteCall(PRPC_ASYNC_STATE pAsync, void *Reply) /* FIXME: check completed */ - return NdrpCompleteAsyncClientCall(pAsync, Reply); + TRACE("pAsync %p, pAsync->StubInfo %p\n", pAsync, pAsync->StubInfo); + + data = pAsync->StubInfo; + if (data->pStubMsg->IsClient) + return NdrpCompleteAsyncClientCall(pAsync, Reply); + + FIXME("not implemented for server side\n"); + return RPC_S_CALL_FAILED; } /***********************************************************************
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
63
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
Results per page:
10
25
50
100
200