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
June 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
947 discussions
Start a n
N
ew thread
Sebastian Lackner : ntdll: Implement NtQueryInformationThread(ThreadTimes) using procfs.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 847b93c7400f82225057e8b71938eb8ccd5d23be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=847b93c7400f82225057e8b7…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sun Jun 28 20:43:17 2020 -0500 ntdll: Implement NtQueryInformationThread(ThreadTimes) using procfs. Based on a patch by Ray Hinchliffe <ray(a)pobox.co.uk>. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=20230
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/thread.c | 82 +++++++++++++++++++++++++++++++++--------- include/wine/server_protocol.h | 4 ++- server/protocol.def | 2 ++ server/request.h | 4 ++- server/thread.c | 2 ++ server/trace.c | 2 ++ 6 files changed, 77 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index f3dddd2b02..54483e1f99 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -29,6 +29,8 @@ #include <errno.h> #include <limits.h> #include <stdarg.h> +#include <stdio.h> +#include <string.h> #include <pthread.h> #include <signal.h> #include <sys/types.h> @@ -821,6 +823,59 @@ static void wow64_context_to_server( context_t *to, const WOW64_CONTEXT *from ) #endif /* __x86_64__ */ +#ifdef linux +static BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LARGE_INTEGER *user_time) +{ + unsigned long clocks_per_sec = sysconf( _SC_CLK_TCK ); + unsigned long usr, sys; + const char *pos; + char buf[512]; + FILE *f; + int i; + + sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid ); + if (!(f = fopen( buf, "r" ))) + { + ERR("Failed to open %s: %s\n", buf, strerror(errno)); + return FALSE; + } + + pos = fgets( buf, sizeof(buf), f ); + fclose( f ); + + /* the process name is printed unescaped, so we have to skip to the last ')' + * to avoid misinterpreting the string */ + if (pos) pos = strrchr( pos, ')' ); + if (pos) pos = strchr( pos + 1, ' ' ); + if (pos) pos++; + + /* skip over the following fields: state, ppid, pgid, sid, tty_nr, tty_pgrp, + * task->flags, min_flt, cmin_flt, maj_flt, cmaj_flt */ + for (i = 0; i < 11 && pos; i++) + { + pos = strchr( pos + 1, ' ' ); + if (pos) pos++; + } + + /* the next two values are user and system time */ + if (pos && (sscanf( pos, "%lu %lu", &usr, &sys ) == 2)) + { + kernel_time->QuadPart = (ULONGLONG)sys * 10000000 / clocks_per_sec; + user_time->QuadPart = (ULONGLONG)usr * 10000000 / clocks_per_sec; + return TRUE; + } + + ERR("Failed to parse %s\n", debugstr_a(buf)); + return FALSE; +} +#else +static BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LARGE_INTEGER *user_time) +{ + static int once; + if (!once++) FIXME("not implemented on this platform\n"); + return FALSE; +} +#endif /****************************************************************************** * NtQueryInformationThread (NTDLL.@) @@ -886,6 +941,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, case ThreadTimes: { KERNEL_USER_TIMES kusrt; + int unix_pid, unix_tid; SERVER_START_REQ( get_thread_times ) { @@ -895,15 +951,21 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, { kusrt.CreateTime.QuadPart = reply->creation_time; kusrt.ExitTime.QuadPart = reply->exit_time; + unix_pid = reply->unix_pid; + unix_tid = reply->unix_tid; } } SERVER_END_REQ; if (status == STATUS_SUCCESS) { - /* We call times(2) for kernel time or user time */ - /* We can only (portably) do this for the current thread */ - if (handle == GetCurrentThread()) + BOOL ret = FALSE; + + kusrt.KernelTime.QuadPart = kusrt.UserTime.QuadPart = 0; + if (unix_pid != -1 && unix_tid != -1) + ret = get_thread_times( unix_pid, unix_tid, &kusrt.KernelTime, &kusrt.UserTime ); + if (!ret && handle == GetCurrentThread()) { + /* fall back to process times */ struct tms time_buf; long clocks_per_sec = sysconf(_SC_CLK_TCK); @@ -911,20 +973,6 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, kusrt.KernelTime.QuadPart = (ULONGLONG)time_buf.tms_stime * 10000000 / clocks_per_sec; kusrt.UserTime.QuadPart = (ULONGLONG)time_buf.tms_utime * 10000000 / clocks_per_sec; } - else - { - static BOOL reported = FALSE; - - kusrt.KernelTime.QuadPart = 0; - kusrt.UserTime.QuadPart = 0; - if (reported) - TRACE("Cannot get kerneltime or usertime of other threads\n"); - else - { - FIXME("Cannot get kerneltime or usertime of other threads\n"); - reported = TRUE; - } - } if (data) memcpy( data, &kusrt, min( length, sizeof(kusrt) )); if (ret_len) *ret_len = min( length, sizeof(kusrt) ); } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 1acaded199..0473c6a64a 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -1037,6 +1037,8 @@ struct get_thread_times_reply struct reply_header __header; timeout_t creation_time; timeout_t exit_time; + int unix_pid; + int unix_tid; }; @@ -6700,7 +6702,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 609 +#define SERVER_PROTOCOL_VERSION 610 /* ### protocol_version end ### */ diff --git a/server/protocol.def b/server/protocol.def index d412889518..ed8ca3c478 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -967,6 +967,8 @@ struct rawinput_device @REPLY timeout_t creation_time; /* thread creation time */ timeout_t exit_time; /* thread exit time */ + int unix_pid; /* thread native pid */ + int unix_tid; /* thread native pid */ @END diff --git a/server/request.h b/server/request.h index 7c7c0fd92f..2a64643848 100644 --- a/server/request.h +++ b/server/request.h @@ -862,7 +862,9 @@ C_ASSERT( FIELD_OFFSET(struct get_thread_times_request, handle) == 12 ); C_ASSERT( sizeof(struct get_thread_times_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_thread_times_reply, creation_time) == 8 ); C_ASSERT( FIELD_OFFSET(struct get_thread_times_reply, exit_time) == 16 ); -C_ASSERT( sizeof(struct get_thread_times_reply) == 24 ); +C_ASSERT( FIELD_OFFSET(struct get_thread_times_reply, unix_pid) == 24 ); +C_ASSERT( FIELD_OFFSET(struct get_thread_times_reply, unix_tid) == 28 ); +C_ASSERT( sizeof(struct get_thread_times_reply) == 32 ); C_ASSERT( FIELD_OFFSET(struct set_thread_info_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct set_thread_info_request, mask) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_thread_info_request, priority) == 20 ); diff --git a/server/thread.c b/server/thread.c index e2bfa50c7b..3cf447b1a0 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1554,6 +1554,8 @@ DECL_HANDLER(get_thread_times) { reply->creation_time = thread->creation_time; reply->exit_time = thread->exit_time; + reply->unix_pid = thread->unix_pid; + reply->unix_tid = thread->unix_tid; release_object( thread ); } diff --git a/server/trace.c b/server/trace.c index 6c7f3251db..2b22dc5207 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1442,6 +1442,8 @@ static void dump_get_thread_times_reply( const struct get_thread_times_reply *re { dump_timeout( " creation_time=", &req->creation_time ); dump_timeout( ", exit_time=", &req->exit_time ); + fprintf( stderr, ", unix_pid=%d", req->unix_pid ); + fprintf( stderr, ", unix_tid=%d", req->unix_tid ); } static void dump_set_thread_info_request( const struct set_thread_info_request *req )
1
0
0
0
Jefferson Carpenter : ntoskrnl.exe: Initialize context.handle and context.irp.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 045455bfe452e180bab85ea2df8d97af07f1322f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=045455bfe452e180bab85ea2…
Author: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Date: Sat Jun 27 11:11:30 2020 +0000 ntoskrnl.exe: Initialize context.handle and context.irp. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49462
Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index f952e5d53b..d407cffee6 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -854,6 +854,8 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event ) NTSTATUS status = STATUS_SUCCESS; HANDLE handles[2]; + context.handle = NULL; + context.irp = NULL; context.in_size = 4096; context.in_buff = NULL;
1
0
0
0
Vijay Kiran Kamuju : qdvd: Register the DvdGraphBuilder coclass.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: f7164ccfd17da8d978dbabff6eff84ce6caf1c8d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f7164ccfd17da8d978dbabff…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Sun Jun 28 17:33:45 2020 -0500 qdvd: Register the DvdGraphBuilder coclass. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49458
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qdvd/Makefile.in | 3 +++ dlls/qdvd/qdvd.spec | 4 ++-- dlls/qdvd/qdvd_classes.idl | 26 ++++++++++++++++++++++++++ dlls/qdvd/qdvd_main.c | 17 +++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/dlls/qdvd/Makefile.in b/dlls/qdvd/Makefile.in index c4b7dcce1f..b3b13486ed 100644 --- a/dlls/qdvd/Makefile.in +++ b/dlls/qdvd/Makefile.in @@ -4,3 +4,6 @@ EXTRADLLFLAGS = -mno-cygwin C_SRCS = \ qdvd_main.c + +IDL_SRCS = \ + qdvd_classes.idl diff --git a/dlls/qdvd/qdvd.spec b/dlls/qdvd/qdvd.spec index c534b4fbf4..b16365d0c9 100644 --- a/dlls/qdvd/qdvd.spec +++ b/dlls/qdvd/qdvd.spec @@ -1,4 +1,4 @@ @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) -@ stub DllRegisterServer -@ stub DllUnregisterServer +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/qdvd/qdvd_classes.idl b/dlls/qdvd/qdvd_classes.idl new file mode 100644 index 0000000000..7fd2a081ba --- /dev/null +++ b/dlls/qdvd/qdvd_classes.idl @@ -0,0 +1,26 @@ +/* + * Copyright 2020 Vijay Kiran Kamuju + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("DVD Graph Builder"), + threading(both), + uuid(fcc152b7-f372-11d0-8e00-00c04fd7c08b), +] +coclass DvdGraphBuilder {} diff --git a/dlls/qdvd/qdvd_main.c b/dlls/qdvd/qdvd_main.c index 5c7368ce90..72dcda7c91 100644 --- a/dlls/qdvd/qdvd_main.c +++ b/dlls/qdvd/qdvd_main.c @@ -21,17 +21,24 @@ #include <stdarg.h> #include "windef.h" #include "winbase.h" +#include "oleidl.h" +#include "rpcproxy.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(qdvd); +static HINSTANCE qdvd_instance; + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { if (reason == DLL_WINE_PREATTACH) return FALSE; /* prefer native version */ if (reason == DLL_PROCESS_ATTACH) + { + qdvd_instance = instance; DisableThreadLibraryCalls(instance); + } return TRUE; } @@ -41,6 +48,16 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) return CLASS_E_CLASSNOTAVAILABLE; } +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(qdvd_instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(qdvd_instance); +} + HRESULT WINAPI DllCanUnloadNow(void) { return S_FALSE;
1
0
0
0
Zebediah Figura : kernel32: Open the INI file in PROFILE_DeleteSection().
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 50553b5db14b6408612eeec18d2125436e3f966f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=50553b5db14b6408612eeec1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Jun 28 13:51:18 2020 -0500 kernel32: Open the INI file in PROFILE_DeleteSection(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/profile.c | 113 +++++++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 50 deletions(-) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index 63a400cce6..2cf0819023 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -488,30 +488,6 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) } -/*********************************************************************** - * PROFILE_DeleteSection - * - * Delete a section from a profile tree. - */ -static BOOL PROFILE_DeleteSection( PROFILESECTION **section, LPCWSTR name ) -{ - while (*section) - { - if (!strcmpiW( (*section)->name, name )) - { - PROFILESECTION *to_del = *section; - *section = to_del->next; - to_del->next = NULL; - PROFILE_Free( to_del ); - CurProfile->changed = TRUE; - return TRUE; - } - section = &(*section)->next; - } - return TRUE; -} - - /*********************************************************************** * PROFILE_DeleteKey * @@ -923,6 +899,37 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name, return 0; } +static BOOL PROFILE_DeleteSection( const WCHAR *filename, const WCHAR *name ) +{ + PROFILESECTION **section; + + EnterCriticalSection( &PROFILE_CritSect ); + + if (!PROFILE_Open( filename, TRUE )) + { + LeaveCriticalSection( &PROFILE_CritSect ); + return FALSE; + } + + for (section = &CurProfile->section; *section; section = &(*section)->next) + { + if (!strcmpiW( (*section)->name, name )) + { + PROFILESECTION *to_del = *section; + *section = to_del->next; + to_del->next = NULL; + PROFILE_Free( to_del ); + CurProfile->changed = TRUE; + PROFILE_FlushFile(); + break; + } + } + + LeaveCriticalSection( &PROFILE_CritSect ); + return TRUE; +} + + /* See GetPrivateProfileSectionNamesA for documentation */ static INT PROFILE_GetSectionNames( LPWSTR buffer, UINT len ) { @@ -1317,27 +1324,30 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry, { BOOL ret = FALSE; - RtlEnterCriticalSection( &PROFILE_CritSect ); - if (!section && !entry && !string) /* documented "file flush" case */ { + EnterCriticalSection( &PROFILE_CritSect ); if (!filename || PROFILE_Open( filename, TRUE )) { - if (CurProfile) PROFILE_ReleaseFile(); /* always return FALSE in this case */ + if (CurProfile) PROFILE_ReleaseFile(); } + LeaveCriticalSection( &PROFILE_CritSect ); + return FALSE; } - else if (PROFILE_Open( filename, TRUE )) + if (!entry) return PROFILE_DeleteSection( filename, section ); + + EnterCriticalSection( &PROFILE_CritSect ); + + if (PROFILE_Open( filename, TRUE )) { if (!section) SetLastError(ERROR_FILE_NOT_FOUND); - else if (!entry) - ret = PROFILE_DeleteSection( &CurProfile->section, section ); else ret = PROFILE_SetString( section, entry, string, FALSE); if (ret) ret = PROFILE_FlushFile(); } - RtlLeaveCriticalSection( &PROFILE_CritSect ); + LeaveCriticalSection( &PROFILE_CritSect ); return ret; } @@ -1377,37 +1387,40 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section, BOOL ret = FALSE; LPWSTR p; - RtlEnterCriticalSection( &PROFILE_CritSect ); - if (!section && !string) { + EnterCriticalSection( &PROFILE_CritSect ); if (!filename || PROFILE_Open( filename, TRUE )) { - if (CurProfile) PROFILE_ReleaseFile(); /* always return FALSE in this case */ + if (CurProfile) PROFILE_ReleaseFile(); } + LeaveCriticalSection( &PROFILE_CritSect ); + return FALSE; } - else if (PROFILE_Open( filename, TRUE )) { - if (!string) + if (!string) return PROFILE_DeleteSection( filename, section ); + + EnterCriticalSection( &PROFILE_CritSect ); + + if (PROFILE_Open( filename, TRUE )) + { + PROFILE_DeleteAllKeys(section); + ret = TRUE; + while (*string && ret) { - ret = PROFILE_DeleteSection( &CurProfile->section, section ); - } else { - PROFILE_DeleteAllKeys(section); - ret = TRUE; - while(*string && ret) { - LPWSTR buf = HeapAlloc( GetProcessHeap(), 0, (strlenW(string)+1) * sizeof(WCHAR) ); - strcpyW( buf, string ); - if((p = strchrW( buf, '='))) { - *p='\0'; - ret = PROFILE_SetString( section, buf, p+1, TRUE); - } - HeapFree( GetProcessHeap(), 0, buf ); - string += strlenW(string)+1; + WCHAR *buf = HeapAlloc( GetProcessHeap(), 0, (strlenW( string ) + 1) * sizeof(WCHAR) ); + strcpyW( buf, string ); + if ((p = strchrW( buf, '='))) + { + *p = '\0'; + ret = PROFILE_SetString( section, buf, p+1, TRUE ); } + HeapFree( GetProcessHeap(), 0, buf ); + string += strlenW( string ) + 1; } if (ret) ret = PROFILE_FlushFile(); } - RtlLeaveCriticalSection( &PROFILE_CritSect ); + LeaveCriticalSection( &PROFILE_CritSect ); return ret; }
1
0
0
0
Zebediah Figura : kernel32: Call PROFILE_DeleteSection directly from WritePrivateProfile* functions.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 17a3c0964dd1734bbfe7bb6d926d33d6023af434 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=17a3c0964dd1734bbfe7bb6d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Jun 28 13:51:17 2020 -0500 kernel32: Call PROFILE_DeleteSection directly from WritePrivateProfile* functions. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/profile.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index dfda24446c..63a400cce6 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -503,11 +503,12 @@ static BOOL PROFILE_DeleteSection( PROFILESECTION **section, LPCWSTR name ) *section = to_del->next; to_del->next = NULL; PROFILE_Free( to_del ); + CurProfile->changed = TRUE; return TRUE; } section = &(*section)->next; } - return FALSE; + return TRUE; } @@ -971,15 +972,7 @@ static INT PROFILE_GetSectionNames( LPWSTR buffer, UINT len ) static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name, LPCWSTR value, BOOL create_always ) { - if (!key_name) /* Delete a whole section */ - { - TRACE("(%s)\n", debugstr_w(section_name)); - CurProfile->changed |= PROFILE_DeleteSection( &CurProfile->section, - section_name ); - return TRUE; /* Even if PROFILE_DeleteSection() has failed, - this is not an error on application's level.*/ - } - else if (!value) /* Delete a key */ + if (!value) /* Delete a key */ { TRACE("(%s,%s)\n", debugstr_w(section_name), debugstr_w(key_name) ); CurProfile->changed |= PROFILE_DeleteKey( &CurProfile->section, @@ -1335,12 +1328,13 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry, } else if (PROFILE_Open( filename, TRUE )) { - if (!section) { + if (!section) SetLastError(ERROR_FILE_NOT_FOUND); - } else { + else if (!entry) + ret = PROFILE_DeleteSection( &CurProfile->section, section ); + else ret = PROFILE_SetString( section, entry, string, FALSE); - if (ret) ret = PROFILE_FlushFile(); - } + if (ret) ret = PROFILE_FlushFile(); } RtlLeaveCriticalSection( &PROFILE_CritSect ); @@ -1393,8 +1387,9 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section, } } else if (PROFILE_Open( filename, TRUE )) { - if (!string) {/* delete the named section*/ - ret = PROFILE_SetString(section,NULL,NULL, FALSE); + if (!string) + { + ret = PROFILE_DeleteSection( &CurProfile->section, section ); } else { PROFILE_DeleteAllKeys(section); ret = TRUE;
1
0
0
0
Zebediah Figura : d3dcompiler: Print the data type when dumping IR.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: d60b126b24398d75e1781dc852a0f5b2d67a895f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d60b126b24398d75e1781dc8…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 22 17:47:21 2020 -0500 d3dcompiler: Print the data type when dumping IR. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/utils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index aadad17691..30aa9de1dd 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1806,9 +1806,11 @@ static void debug_dump_ir_var(const struct hlsl_ir_var *var) static void debug_dump_deref(const struct hlsl_deref *deref) { - wine_dbg_printf("deref("); - debug_dump_ir_var(deref->var); - wine_dbg_printf(")"); + if (deref->offset) + /* Print the variable's type for convenience. */ + wine_dbg_printf("(%s %s)", debug_hlsl_type(deref->var->data_type), deref->var->name); + else + wine_dbg_printf("%s", deref->var->name); if (deref->offset) { wine_dbg_printf("["); @@ -2045,6 +2047,9 @@ static void debug_dump_instr(const struct hlsl_ir_node *instr) wine_dbg_printf("%4u: ", instr->index); else wine_dbg_printf("%p: ", instr); + + wine_dbg_printf("%10s | ", instr->data_type ? debug_hlsl_type(instr->data_type) : ""); + switch (instr->type) { case HLSL_IR_EXPR:
1
0
0
0
Zebediah Figura : d3dcompiler: Rename make_simple_assignment() to new_simple_assignment().
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 56be9dde9273f13b6b73186e500ffa63674824dd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=56be9dde9273f13b6b73186e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 22 17:47:20 2020 -0500 d3dcompiler: Rename make_simple_assignment() to new_simple_assignment(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/hlsl.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 4e43a80275..2182833793 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -557,7 +557,7 @@ static struct hlsl_ir_assignment *new_assignment(struct hlsl_ir_var *var, struct return assign; } -static struct hlsl_ir_assignment *make_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) +static struct hlsl_ir_assignment *new_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) { return new_assignment(lhs, NULL, rhs, 0, rhs->loc); } @@ -575,7 +575,7 @@ static struct hlsl_ir_jump *add_return(struct list *instrs, if (!(return_value = add_implicit_conversion(instrs, return_value, return_type, &loc))) return NULL; - if (!(assignment = make_simple_assignment(hlsl_ctx.cur_function->return_var, return_value))) + if (!(assignment = new_simple_assignment(hlsl_ctx.cur_function->return_var, return_value))) return NULL; list_add_after(&return_value->entry, &assignment->node.entry); } @@ -681,7 +681,7 @@ static struct hlsl_ir_load *add_load(struct list *instrs, struct hlsl_ir_node *v TRACE("Synthesized variable %p for %s node.\n", var, debug_node_type(var_node->type)); - if (!(assign = make_simple_assignment(var, var_node))) + if (!(assign = new_simple_assignment(var, var_node))) return NULL; list_add_tail(instrs, &assign->node.entry);
1
0
0
0
Zebediah Figura : d3dcompiler: Add the node to the instruction list in new_expr().
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 7260f978f380355490d535daaa52ee09d453b897 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7260f978f380355490d535da…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 22 17:47:19 2020 -0500 d3dcompiler: Add the node to the instruction list in new_expr(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 27 ++++++++--------------- dlls/d3dcompiler_43/hlsl.y | 36 +++++++++++++++++++++++++++---- dlls/d3dcompiler_43/utils.c | 5 +++-- 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 97b84c4494..50457b2e64 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -1059,9 +1059,18 @@ static inline void init_node(struct hlsl_ir_node *node, enum hlsl_ir_node_type t struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lhs, enum parse_assign_op assign_op, struct hlsl_ir_node *rhs) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *add_expr(struct list *instrs, enum hlsl_ir_expr_op op, struct hlsl_ir_node *operands[3], + struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_node *add_implicit_conversion(struct list *instrs, struct hlsl_ir_node *node, struct hlsl_type *type, struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_node *new_binary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, + struct hlsl_ir_node *arg2) DECLSPEC_HIDDEN; +struct hlsl_ir_node *new_unary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, + struct source_location loc) DECLSPEC_HIDDEN; + BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN; struct hlsl_ir_var *get_variable(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN; void free_declaration(struct hlsl_ir_var *decl) DECLSPEC_HIDDEN; @@ -1075,10 +1084,6 @@ BOOL find_function(const char *name) DECLSPEC_HIDDEN; unsigned int components_count_type(struct hlsl_type *type) DECLSPEC_HIDDEN; BOOL compare_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2) DECLSPEC_HIDDEN; BOOL compatible_data_types(struct hlsl_type *s1, struct hlsl_type *s2) DECLSPEC_HIDDEN; -struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **operands, - struct source_location *loc) DECLSPEC_HIDDEN; -struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type, - struct source_location *loc) DECLSPEC_HIDDEN; void push_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; void init_functions_tree(struct wine_rb_tree *funcs) DECLSPEC_HIDDEN; @@ -1098,20 +1103,6 @@ void free_instr(struct hlsl_ir_node *node) DECLSPEC_HIDDEN; void free_instr_list(struct list *list) DECLSPEC_HIDDEN; void free_function_rb(struct wine_rb_entry *entry, void *context) DECLSPEC_HIDDEN; -static inline struct hlsl_ir_node *new_unary_expr(enum hlsl_ir_expr_op op, - struct hlsl_ir_node *op1, struct source_location loc) -{ - struct hlsl_ir_node *operands[3] = {op1}; - return &new_expr(op, operands, &loc)->node; -} - -static inline struct hlsl_ir_node *new_binary_expr(enum hlsl_ir_expr_op op, - struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, struct source_location loc) -{ - struct hlsl_ir_node *operands[3] = {op1, op2}; - return &new_expr(op, operands, &loc)->node; -} - #define MAKE_TAG(ch0, ch1, ch2, ch3) \ ((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \ ((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 )) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 43ffa43a02..4e43a80275 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -608,6 +608,34 @@ static struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct s return c; } +struct hlsl_ir_node *new_unary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, struct source_location loc) +{ + struct hlsl_ir_expr *expr; + + if (!(expr = d3dcompiler_alloc(sizeof(*expr)))) + return NULL; + init_node(&expr->node, HLSL_IR_EXPR, arg->data_type, loc); + expr->op = op; + expr->operands[0] = arg; + return &expr->node; +} + +struct hlsl_ir_node *new_binary_expr(enum hlsl_ir_expr_op op, + struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2) +{ + struct hlsl_ir_expr *expr; + + assert(compare_hlsl_types(arg1->data_type, arg2->data_type)); + + if (!(expr = d3dcompiler_alloc(sizeof(*expr)))) + return NULL; + init_node(&expr->node, HLSL_IR_EXPR, arg1->data_type, arg1->loc); + expr->op = op; + expr->operands[0] = arg1; + expr->operands[1] = arg2; + return &expr->node; +} + static struct hlsl_ir_load *new_var_load(struct hlsl_ir_var *var, const struct source_location loc) { struct hlsl_ir_load *load = d3dcompiler_alloc(sizeof(*load)); @@ -636,7 +664,7 @@ static struct hlsl_ir_load *add_load(struct list *instrs, struct hlsl_ir_node *v var = src->var; if (src->offset) { - if (!(add = new_binary_expr(HLSL_IR_BINOP_ADD, src->offset, offset, loc))) + if (!(add = new_binary_expr(HLSL_IR_BINOP_ADD, src->offset, offset))) return NULL; list_add_tail(instrs, &add->entry); offset = add; @@ -712,7 +740,7 @@ static struct hlsl_ir_load *add_array_load(struct list *instrs, struct hlsl_ir_n if (!(c = new_uint_constant(data_type->reg_size * 4, loc))) return NULL; list_add_tail(instrs, &c->node.entry); - if (!(mul = new_binary_expr(HLSL_IR_BINOP_MUL, index, &c->node, loc))) + if (!(mul = new_binary_expr(HLSL_IR_BINOP_MUL, index, &c->node))) return NULL; list_add_tail(instrs, &mul->entry); index = mul; @@ -1196,10 +1224,10 @@ static struct list *append_unop(struct list *list, struct hlsl_ir_node *node) static struct list *add_binary_expr(struct list *list1, struct list *list2, enum hlsl_ir_expr_op op, struct source_location loc) { - struct hlsl_ir_node *arg1 = node_from_list(list1), *arg2 = node_from_list(list2); + struct hlsl_ir_node *args[3] = {node_from_list(list1), node_from_list(list2)}; list_move_tail(list1, list2); d3dcompiler_free(list2); - list_add_tail(list1, &new_binary_expr(op, arg1, arg2, loc)->entry); + add_expr(list1, op, args, &loc); return list1; } diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 3f063e1a0a..aadad17691 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1328,7 +1328,7 @@ struct hlsl_ir_node *add_implicit_conversion(struct list *instrs, struct hlsl_ir return &cast->node; } -struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **operands, +struct hlsl_ir_expr *add_expr(struct list *instrs, enum hlsl_ir_expr_op op, struct hlsl_ir_node *operands[3], struct source_location *loc) { struct hlsl_ir_expr *expr; @@ -1372,6 +1372,7 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope expr->operands[0] = operands[0]; expr->operands[1] = operands[1]; expr->operands[2] = operands[2]; + list_add_tail(instrs, &expr->node.entry); return expr; } @@ -1519,7 +1520,7 @@ struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lh struct hlsl_ir_node *expr; TRACE("Adding an expression for the compound assignment.\n"); - expr = new_binary_expr(op, lhs, rhs, lhs->loc); + expr = new_binary_expr(op, lhs, rhs); list_add_after(&rhs->entry, &expr->entry); rhs = expr; }
1
0
0
0
Zebediah Figura : d3dcompiler: Create the expression in append_binop().
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 6083b1dd39d9946c35799272f780015e94a5260f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6083b1dd39d9946c35799272…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 22 17:47:18 2020 -0500 d3dcompiler: Create the expression in append_binop(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/hlsl.y | 139 ++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 76 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 96a27d6a30..43ffa43a02 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1193,12 +1193,14 @@ static struct list *append_unop(struct list *list, struct hlsl_ir_node *node) return list; } -static struct list *append_binop(struct list *first, struct list *second, struct hlsl_ir_node *node) +static struct list *add_binary_expr(struct list *list1, struct list *list2, + enum hlsl_ir_expr_op op, struct source_location loc) { - list_move_tail(first, second); - d3dcompiler_free(second); - list_add_tail(first, &node->entry); - return first; + struct hlsl_ir_node *arg1 = node_from_list(list1), *arg2 = node_from_list(list2); + list_move_tail(list1, list2); + d3dcompiler_free(list2); + list_add_tail(list1, &new_binary_expr(op, arg1, arg2, loc)->entry); + return list1; } static struct list *make_list(struct hlsl_ir_node *node) @@ -2578,40 +2580,33 @@ unary_op: '+' $$ = UNARY_OP_BITNOT; } -mul_expr: unary_expr - { - $$ = $1; - } - | mul_expr '*' unary_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_MUL, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | mul_expr '/' unary_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_DIV, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | mul_expr '%' unary_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_MOD, - node_from_list($1), node_from_list($3), get_location(&@2))); - } +mul_expr: -add_expr: mul_expr - { - $$ = $1; - } - | add_expr '+' mul_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_ADD, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | add_expr '-' mul_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_SUB, - node_from_list($1), node_from_list($3), get_location(&@2))); - } + unary_expr + | mul_expr '*' unary_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_MUL, get_location(&@2)); + } + | mul_expr '/' unary_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_DIV, get_location(&@2)); + } + | mul_expr '%' unary_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_MOD, get_location(&@2)); + } + +add_expr: + + mul_expr + | add_expr '+' mul_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_ADD, get_location(&@2)); + } + | add_expr '-' mul_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_SUB, get_location(&@2)); + } shift_expr: add_expr { @@ -2626,45 +2621,37 @@ shift_expr: add_expr FIXME("Right shift\n"); } -relational_expr: shift_expr - { - $$ = $1; - } - | relational_expr '<' shift_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_LESS, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | relational_expr '>' shift_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_GREATER, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | relational_expr OP_LE shift_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_LEQUAL, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | relational_expr OP_GE shift_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_GEQUAL, - node_from_list($1), node_from_list($3), get_location(&@2))); - } +relational_expr: -equality_expr: relational_expr - { - $$ = $1; - } - | equality_expr OP_EQ relational_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_EQUAL, - node_from_list($1), node_from_list($3), get_location(&@2))); - } - | equality_expr OP_NE relational_expr - { - $$ = append_binop($1, $3, new_binary_expr(HLSL_IR_BINOP_NEQUAL, - node_from_list($1), node_from_list($3), get_location(&@2))); - } + shift_expr + | relational_expr '<' shift_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_LESS, get_location(&@2)); + } + | relational_expr '>' shift_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_GREATER, get_location(&@2)); + } + | relational_expr OP_LE shift_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_LEQUAL, get_location(&@2)); + } + | relational_expr OP_GE shift_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_GEQUAL, get_location(&@2)); + } + +equality_expr: + + relational_expr + | equality_expr OP_EQ relational_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_EQUAL, get_location(&@2)); + } + | equality_expr OP_NE relational_expr + { + $$ = add_binary_expr($1, $3, HLSL_IR_BINOP_NEQUAL, get_location(&@2)); + } bitand_expr: equality_expr {
1
0
0
0
Jacek Caban : server: Remove no longer needed support for opening current console in open_console request.
by Alexandre Julliard
26 Jun '20
26 Jun '20
Module: wine Branch: master Commit: 13b2587d4f55d64a1381c60ac34acf4abe6bb1e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=13b2587d4f55d64a1381c60a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 25 22:28:05 2020 +0200 server: Remove no longer needed support for opening current console in open_console request. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wine/server_protocol.h | 1 - server/console.c | 15 ++------------- server/protocol.def | 3 +-- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 24bebb8f10..1acaded199 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -1902,7 +1902,6 @@ struct open_console_request { struct request_header __header; obj_handle_t from; - unsigned int access; unsigned int attributes; int share; diff --git a/server/console.c b/server/console.c index 57592e6ab0..729cfa4061 100644 --- a/server/console.c +++ b/server/console.c @@ -1664,19 +1664,8 @@ DECL_HANDLER(open_console) { struct object *obj = NULL; - reply->handle = 0; - if (!req->from) - { - if (current->process->console) - obj = grab_object( (struct object*)current->process->console ); - } - else if (req->from == (obj_handle_t)1) - { - if (current->process->console && current->process->console->active) - obj = grab_object( (struct object*)current->process->console->active ); - } - else if ((obj = get_handle_obj( current->process, req->from, - FILE_READ_PROPERTIES|FILE_WRITE_PROPERTIES, &console_input_ops ))) + if ((obj = get_handle_obj( current->process, req->from, + FILE_READ_PROPERTIES|FILE_WRITE_PROPERTIES, &console_input_ops ))) { struct console_input *console = (struct console_input *)obj; obj = (console->active) ? grab_object( console->active ) : NULL; diff --git a/server/protocol.def b/server/protocol.def index c3442c06e9..d412889518 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1523,8 +1523,7 @@ struct console_renderer_event /* Open a handle to the process console */ @REQ(open_console) - obj_handle_t from; /* 0 (resp 1) input (resp output) of current process console */ - /* otherwise console_in handle to get active screen buffer? */ + obj_handle_t from; /* console_in handle to get active screen buffer */ unsigned int access; /* wanted access rights */ unsigned int attributes; /* object attributes */ int share; /* share mask (only for output handles) */
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
95
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
Results per page:
10
25
50
100
200