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
April 2018
----- 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
542 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Add support for loading IL-only dlls.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: 52e09e823e2a2b65f1f993145c0a65ab1d84713d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52e09e823e2a2b65f1f99314…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 2 18:11:51 2018 +0200 ntdll: Add support for loading IL-only dlls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index fe5ce9d..1a3dd80 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -956,7 +956,10 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void * if ((exports = RtlImageDirectoryEntryToData( imp->ldr.BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ))) - proc = find_named_export( imp->ldr.BaseAddress, exports, exp_size, "_CorExeMain", -1, load_path ); + { + const char *name = (wm->ldr.Flags & LDR_IMAGE_IS_DLL) ? "_CorDllMain" : "_CorExeMain"; + proc = find_named_export( imp->ldr.BaseAddress, exports, exp_size, name, -1, load_path ); + } if (!proc) return STATUS_PROCEDURE_NOT_FOUND; *entry = proc; return STATUS_SUCCESS; @@ -1929,7 +1932,11 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, ((nt->FileHeader.Characteristics & IMAGE_FILE_DLL) || nt->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_NATIVE)) { - if ((status = fixup_imports( wm, load_path )) != STATUS_SUCCESS) + if (wm->ldr.Flags & LDR_COR_ILONLY) + status = fixup_imports_ilonly( wm, load_path, &wm->ldr.EntryPoint ); + else + status = fixup_imports( wm, load_path ); + if (status != STATUS_SUCCESS) { /* the module has only be inserted in the load & memory order lists */ RemoveEntryList(&wm->ldr.InLoadOrderModuleList);
1
0
0
0
Alexandre Julliard : winegcc: Set page alignment to 4096 in all cases.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: 395a94d308d77786809eee9eb77b4e35c78fbf9e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=395a94d308d77786809eee9e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 2 14:20:10 2018 +0200 winegcc: Set page alignment to 4096 in all cases. This avoids leaving holes in builtin dll mappings. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 80dba4c..4be35d5 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1136,13 +1136,13 @@ static void build(struct options* opts) default: if (opts->image_base) { - if (!try_link(opts->prefix, link_args, "-Wl,-z,max-page-size=0x1000")) - strarray_add(link_args, "-Wl,-z,max-page-size=0x1000"); if (!try_link(opts->prefix, link_args, strmake("-Wl,-Ttext-segment=%s", opts->image_base))) strarray_add(link_args, strmake("-Wl,-Ttext-segment=%s", opts->image_base)); else prelink = PRELINK; } + if (!try_link(opts->prefix, link_args, "-Wl,-z,max-page-size=0x1000")) + strarray_add(link_args, "-Wl,-z,max-page-size=0x1000"); break; }
1
0
0
0
Alexandre Julliard : user32: Partially implement GetWindowDpiAwarenessContext().
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: 3f97ba3f463dfad41274f0bd64865267227d6b10 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3f97ba3f463dfad41274f0bd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 2 13:28:20 2018 +0200 user32: Partially implement GetWindowDpiAwarenessContext(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/sysparams.c | 60 +++++++++++++++++++++++++++++++++++++++++++ dlls/user32/user32.spec | 1 + dlls/user32/win.c | 27 +++++++++++++++++++ dlls/user32/win.h | 1 + include/winuser.h | 1 + 5 files changed, 90 insertions(+) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index b541be4..876f84f 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -44,6 +44,7 @@ static BOOL (WINAPI *pSetProcessDPIAware)(void); static BOOL (WINAPI *pSetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); static DPI_AWARENESS_CONTEXT (WINAPI *pGetThreadDpiAwarenessContext)(void); static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); +static DPI_AWARENESS_CONTEXT (WINAPI *pGetWindowDpiAwarenessContext)(HWND); static DPI_AWARENESS (WINAPI *pGetAwarenessFromDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); static BOOL strict; @@ -3067,6 +3068,63 @@ static void test_dpi_aware(void) test_GetSystemMetrics(); } +static void test_window_dpi(void) +{ + DPI_AWARENESS_CONTEXT context, orig; + DPI_AWARENESS awareness; + HWND hwnd; + + if (!pGetWindowDpiAwarenessContext) + { + win_skip( "GetWindowDpiAwarenessContext not supported\n" ); + return; + } + orig = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE ); + hwnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application", + WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL ); + ok( hwnd != 0, "failed to create window\n" ); + context = GetWindowDpiAwarenessContext( hwnd ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness ); + DestroyWindow( hwnd ); + + pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ); + hwnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application", + WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL ); + ok( hwnd != 0, "failed to create window\n" ); + context = GetWindowDpiAwarenessContext( hwnd ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness ); + DestroyWindow( hwnd ); + + pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ); + hwnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application", + WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL ); + ok( hwnd != 0, "failed to create window\n" ); + context = GetWindowDpiAwarenessContext( hwnd ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); + DestroyWindow( hwnd ); + + SetLastError( 0xdeadbeef ); + context = GetWindowDpiAwarenessContext( (HWND)0xdeadbeef ); + ok( !context, "got %p\n", context ); + ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + context = GetWindowDpiAwarenessContext( GetDesktopWindow() ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); + + pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE ); + SetLastError( 0xdeadbeef ); + context = GetWindowDpiAwarenessContext( GetDesktopWindow() ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); + + pSetThreadDpiAwarenessContext( orig ); +} + START_TEST(sysparams) { int argc; @@ -3084,6 +3142,7 @@ START_TEST(sysparams) pSetProcessDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessContext"); pGetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetThreadDpiAwarenessContext"); pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetThreadDpiAwarenessContext"); + pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetWindowDpiAwarenessContext"); pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetAwarenessFromDpiAwarenessContext"); hInstance = GetModuleHandleA( NULL ); @@ -3136,4 +3195,5 @@ START_TEST(sysparams) ReleaseDC( 0, hdc); test_dpi_aware(); + test_window_dpi(); } diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 85499b6..d407a18 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -394,6 +394,7 @@ @ stdcall GetWindowContextHelpId(long) @ stdcall GetWindowDC(long) @ stdcall GetWindowDisplayAffinity(long ptr) +@ stdcall GetWindowDpiAwarenessContext(long) @ stdcall GetWindowInfo(long ptr) @ stdcall GetWindowLongA(long long) @ stdcall -arch=win64 GetWindowLongPtrA(long long) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 019b178..0272566 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1498,6 +1498,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, wndPtr->hIconSmall = 0; wndPtr->hIconSmall2 = 0; wndPtr->hSysMenu = 0; + wndPtr->dpi_awareness = GetThreadDpiAwarenessContext(); wndPtr->min_pos.x = wndPtr->min_pos.y = -1; wndPtr->max_pos.x = wndPtr->max_pos.y = -1; @@ -2215,6 +2216,32 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd ) } +/*********************************************************************** + * GetWindowDpiAwarenessContext (USER32.@) + */ +DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd ) +{ + WND *win; + DPI_AWARENESS_CONTEXT ret; + + if (!(win = WIN_GetPtr( hwnd ))) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return 0; + } + if (win == WND_DESKTOP) return DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE; + if (win == WND_OTHER_PROCESS) + { + if (IsWindow( hwnd )) FIXME( "not supported on other process window %p\n", hwnd ); + else SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return 0; + } + ret = win->dpi_awareness; + WIN_ReleasePtr( win ); + return ret; +} + + /********************************************************************** * WIN_GetWindowLong * diff --git a/dlls/user32/win.h b/dlls/user32/win.h index f728d19..0c7fcc8 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -61,6 +61,7 @@ typedef struct tagWND HICON hIcon; /* window's icon */ HICON hIconSmall; /* window's small icon */ HICON hIconSmall2; /* window's secondary small icon, derived from hIcon */ + DPI_AWARENESS_CONTEXT dpi_awareness; /* DPI awareness context */ struct window_surface *surface; /* Window surface if any */ struct tagDIALOGINFO *dlgInfo;/* Dialog additional info (dialogs only) */ int pixel_format; /* Pixel format set by the graphics driver */ diff --git a/include/winuser.h b/include/winuser.h index 31ab49e..63cfd5c 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3780,6 +3780,7 @@ WINUSERAPI HWND WINAPI GetWindow(HWND,UINT); WINUSERAPI DWORD WINAPI GetWindowContextHelpId(HWND); WINUSERAPI HDC WINAPI GetWindowDC(HWND); WINUSERAPI BOOL WINAPI GetWindowDisplayAffinity(HWND,DWORD*); +WINUSERAPI DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext(HWND); WINUSERAPI BOOL WINAPI GetWindowInfo(HWND, PWINDOWINFO); WINUSERAPI LONG WINAPI GetWindowLongA(HWND,INT); WINUSERAPI LONG WINAPI GetWindowLongW(HWND,INT);
1
0
0
0
Alexandre Julliard : user32: Implement Get/SetThreadDpiAwarenessContext().
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: 478814ed95cdbb2aa89ef0af0903fd88dd10195c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=478814ed95cdbb2aa89ef0af…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 2 12:48:29 2018 +0200 user32: Implement Get/SetThreadDpiAwarenessContext(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 23 +++++++++++++++++++++-- dlls/user32/tests/sysparams.c | 40 ++++++++++++++++++++++++++++++++++++++++ dlls/user32/user32.spec | 1 + dlls/user32/user_private.h | 1 + include/winuser.h | 1 + 5 files changed, 64 insertions(+), 2 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 7780293..a018dfc 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -3042,12 +3042,31 @@ UINT WINAPI GetDpiForWindow( HWND hwnd ) } /********************************************************************** + * GetThreadDpiAwarenessContext (USER32.@) + */ +DPI_AWARENESS_CONTEXT WINAPI GetThreadDpiAwarenessContext(void) +{ + struct user_thread_info *info = get_user_thread_info(); + + if (info->dpi_awareness) return info->dpi_awareness; + if (dpi_awareness) return dpi_awareness; + return DPI_AWARENESS_CONTEXT_SYSTEM_AWARE; /* FIXME: should default to unaware */ +} + +/********************************************************************** * SetThreadDpiAwarenessContext (USER32.@) */ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT context ) { - FIXME("(%p): stub\n", context); - return NULL; + DPI_AWARENESS_CONTEXT prev = GetThreadDpiAwarenessContext(); + + if (!IsValidDpiAwarenessContext( context )) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } + get_user_thread_info()->dpi_awareness = context; + return prev; } /********************************************************************** diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 03fa8d5..b541be4 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -42,6 +42,9 @@ static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR, LPDEVMODEA, HWND, DWORD, static BOOL (WINAPI *pIsProcessDPIAware)(void); static BOOL (WINAPI *pSetProcessDPIAware)(void); static BOOL (WINAPI *pSetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); +static DPI_AWARENESS_CONTEXT (WINAPI *pGetThreadDpiAwarenessContext)(void); +static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); +static DPI_AWARENESS (WINAPI *pGetAwarenessFromDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); static BOOL strict; static int dpi, real_dpi; @@ -2998,6 +3001,13 @@ static void test_dpi_aware(void) if (pSetProcessDpiAwarenessContext) { + DPI_AWARENESS awareness; + DPI_AWARENESS_CONTEXT context; + + context = pGetThreadDpiAwarenessContext(); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + todo_wine + ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness ); SetLastError( 0xdeadbeef ); ret = pSetProcessDpiAwarenessContext( NULL ); ok( !ret, "got %d\n", ret ); @@ -3018,7 +3028,34 @@ static void test_dpi_aware(void) ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); ret = pIsProcessDPIAware(); ok(ret, "got %d\n", ret); + context = pGetThreadDpiAwarenessContext(); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness ); + SetLastError( 0xdeadbeef ); + context = pSetThreadDpiAwarenessContext( 0 ); + ok( !context, "got %p\n", context ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)-5 ); + ok( !context, "got %p\n", context ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness ); + context = pGetThreadDpiAwarenessContext(); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness ); + context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness ); + context = pGetThreadDpiAwarenessContext(); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); + context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ); + awareness = pGetAwarenessFromDpiAwarenessContext( context ); + ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); } + else win_skip( "SetProcessDPIAware not supported\n" ); ret = pSetProcessDPIAware(); ok(ret, "got %d\n", ret); @@ -3045,6 +3082,9 @@ START_TEST(sysparams) pIsProcessDPIAware = (void*)GetProcAddress(hdll, "IsProcessDPIAware"); pSetProcessDPIAware = (void*)GetProcAddress(hdll, "SetProcessDPIAware"); pSetProcessDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessContext"); + pGetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetThreadDpiAwarenessContext"); + pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetThreadDpiAwarenessContext"); + pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetAwarenessFromDpiAwarenessContext"); hInstance = GetModuleHandleA( NULL ); hdc = GetDC(0); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index b0109cb..85499b6 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -379,6 +379,7 @@ @ stdcall GetTabbedTextExtentW(long wstr long long ptr) @ stdcall GetTaskmanWindow () @ stdcall GetThreadDesktop(long) +@ stdcall GetThreadDpiAwarenessContext() @ stdcall GetTitleBarInfo(long ptr) @ stdcall GetTopWindow(long) @ stdcall GetTouchInputInfo(long long ptr long) diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 5d54cb1..7d33d9d 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -169,6 +169,7 @@ struct wm_char_mapping_data /* no attempt is made to keep the layout compatible with the Windows one */ struct user_thread_info { + DPI_AWARENESS_CONTEXT dpi_awareness; /* DPI awareness context */ HANDLE server_queue; /* Handle to server-side queue */ DWORD wake_mask; /* Current queue wake mask */ DWORD changed_mask; /* Current queue changed mask */ diff --git a/include/winuser.h b/include/winuser.h index 24d9e57..31ab49e 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3766,6 +3766,7 @@ WINUSERAPI DWORD WINAPI GetTabbedTextExtentW(HDC,LPCWSTR,INT,INT,const INT #define GetTabbedTextExtent WINELIB_NAME_AW(GetTabbedTextExtent) WINUSERAPI BOOL WINAPI GetTitleBarInfo(HWND,PTITLEBARINFO); WINUSERAPI HDESK WINAPI GetThreadDesktop(DWORD); +WINUSERAPI DPI_AWARENESS_CONTEXT WINAPI GetThreadDpiAwarenessContext(void); WINUSERAPI HWND WINAPI GetTopWindow(HWND); WINUSERAPI BOOL WINAPI GetTouchInputInfo(HTOUCHINPUT,UINT,TOUCHINPUT*,int); WINUSERAPI BOOL WINAPI GetUpdateRect(HWND,LPRECT,BOOL);
1
0
0
0
Alexandre Julliard : user32: Support forcing the DPI awareness through the image file execution options.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: c440af11bd53afda74635be679c89e1014c4fe81 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c440af11bd53afda74635be6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 2 11:19:17 2018 +0200 user32: Support forcing the DPI awareness through the image file execution options. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/user_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 057c7aa..418359a 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -219,11 +219,23 @@ static const WCHAR *get_default_desktop(void) static void dpiaware_init(void) { WCHAR buffer[256]; + DWORD option; static const WCHAR dpiAwareW[] = {'d','p','i','A','w','a','r','e',0}; static const WCHAR dpiAwarenessW[] = {'d','p','i','A','w','a','r','e','n','e','s','s',0}; static const WCHAR namespace2005W[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; static const WCHAR namespace2016W[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; + if (!LdrQueryImageFileExecutionOptions( &NtCurrentTeb()->Peb->ProcessParameters->ImagePathName, + dpiAwarenessW, REG_DWORD, &option, sizeof(option), NULL )) + { + TRACE( "got option %x\n", option ); + if (option <= 2) + { + SetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~(ULONG_PTR)option ); + return; + } + } + if (QueryActCtxSettingsW( 0, NULL, namespace2016W, dpiAwarenessW, buffer, ARRAY_SIZE(buffer), NULL )) { static const WCHAR unawareW[] = {'u','n','a','w','a','r','e',0};
1
0
0
0
Sebastian Lackner : ntdll: Throw exception if invalid handle is passed to NtClose and debugger enabled.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: c61c33ee66ea0e97450ac793ebc4ac41a1ccc793 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c61c33ee66ea0e97450ac793…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Mar 31 09:59:25 2018 +0000 ntdll: Throw exception if invalid handle is passed to NtClose and debugger enabled. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/om.c | 26 +++++++++++++++++ dlls/ntdll/tests/exception.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c index febe5bd..0b56251 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -38,6 +38,7 @@ #include "winternl.h" #include "ntdll_misc.h" #include "wine/server.h" +#include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -377,6 +378,12 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source, return ret; } +static LONG WINAPI invalid_handle_exception_handler( EXCEPTION_POINTERS *eptr ) +{ + EXCEPTION_RECORD *rec = eptr->ExceptionRecord; + return (rec->ExceptionCode == EXCEPTION_INVALID_HANDLE) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH; +} + /* Everquest 2 / Pirates of the Burning Sea hooks NtClose, so we need a wrapper */ NTSTATUS close_handle( HANDLE handle ) { @@ -390,6 +397,25 @@ NTSTATUS close_handle( HANDLE handle ) } SERVER_END_REQ; if (fd != -1) close( fd ); + + if (ret == STATUS_INVALID_HANDLE && handle && NtCurrentTeb()->Peb->BeingDebugged) + { + __TRY + { + EXCEPTION_RECORD record; + record.ExceptionCode = EXCEPTION_INVALID_HANDLE; + record.ExceptionFlags = 0; + record.ExceptionRecord = NULL; + record.ExceptionAddress = NULL; + record.NumberParameters = 0; + RtlRaiseException( &record ); + } + __EXCEPT(invalid_handle_exception_handler) + { + } + __ENDTRY + } + return ret; } diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index b3592e6..c47c8cb 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -52,6 +52,7 @@ static NTSTATUS (WINAPI *pNtTerminateProcess)(HANDLE handle, LONG exit_code); static NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI *pNtSetInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); +static NTSTATUS (WINAPI *pNtClose)(HANDLE); #if defined(__x86_64__) typedef struct @@ -1091,6 +1092,16 @@ static void test_debugger(void) if (stage == 10) continuestatus = DBG_EXCEPTION_NOT_HANDLED; } + else if (stage == 11 || stage == 12 || stage == 13) + { + ok(de.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_INVALID_HANDLE, + "unexpected exception code %08x, expected %08x\n", de.u.Exception.ExceptionRecord.ExceptionCode, + EXCEPTION_INVALID_HANDLE); + ok(de.u.Exception.ExceptionRecord.NumberParameters == 0, + "unexpected number of parameters %d, expected 0\n", de.u.Exception.ExceptionRecord.NumberParameters); + + if (stage == 12|| stage == 13) continuestatus = DBG_EXCEPTION_NOT_HANDLED; + } else ok(FALSE, "unexpected stage %x\n", stage); @@ -2895,6 +2906,54 @@ static void test_breakpoint(DWORD numexc) pRtlRemoveVectoredExceptionHandler(vectored_handler); } +static DWORD invalid_handle_exceptions; + +static LONG CALLBACK invalid_handle_vectored_handler(EXCEPTION_POINTERS *ExceptionInfo) +{ + PEXCEPTION_RECORD rec = ExceptionInfo->ExceptionRecord; + trace("vect. handler %08x addr:%p\n", rec->ExceptionCode, rec->ExceptionAddress); + + ok(rec->ExceptionCode == EXCEPTION_INVALID_HANDLE, "ExceptionCode is %08x instead of %08x\n", + rec->ExceptionCode, EXCEPTION_INVALID_HANDLE); + ok(rec->NumberParameters == 0, "ExceptionParameters is %d instead of 0\n", rec->NumberParameters); + + invalid_handle_exceptions++; + return (rec->ExceptionCode == EXCEPTION_INVALID_HANDLE) ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_CONTINUE_SEARCH; +} + +static void test_closehandle(DWORD numexc, HANDLE handle) +{ + PVOID vectored_handler; + NTSTATUS status; + DWORD res; + + if (!pRtlAddVectoredExceptionHandler || !pRtlRemoveVectoredExceptionHandler || !pRtlRaiseException) + { + skip("RtlAddVectoredExceptionHandler or RtlRemoveVectoredExceptionHandler or RtlRaiseException not found\n"); + return; + } + + vectored_handler = pRtlAddVectoredExceptionHandler(TRUE, &invalid_handle_vectored_handler); + ok(vectored_handler != 0, "RtlAddVectoredExceptionHandler failed\n"); + + invalid_handle_exceptions = 0; + res = CloseHandle(handle); + + ok(!res || (is_wow64 && res), "CloseHandle(%p) unexpectedly succeeded\n", handle); + ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error code %d instead of %d\n", + GetLastError(), ERROR_INVALID_HANDLE); + ok(invalid_handle_exceptions == numexc, "CloseHandle generated %d exceptions, expected %d\n", + invalid_handle_exceptions, numexc); + + invalid_handle_exceptions = 0; + status = pNtClose(handle); + ok(status == STATUS_INVALID_HANDLE || (is_wow64 && status == 0), "NtClose(%p) returned status %08x\n", handle, status); + ok(invalid_handle_exceptions == numexc, "NtClose generated %d exceptions, expected %d\n", + invalid_handle_exceptions, numexc); + + pRtlRemoveVectoredExceptionHandler(vectored_handler); +} + static void test_vectored_continue_handler(void) { PVOID handler1, handler2; @@ -2949,6 +3008,7 @@ START_TEST(exception) pNtGetContextThread = (void *)GetProcAddress( hntdll, "NtGetContextThread" ); pNtSetContextThread = (void *)GetProcAddress( hntdll, "NtSetContextThread" ); pNtReadVirtualMemory = (void *)GetProcAddress( hntdll, "NtReadVirtualMemory" ); + pNtClose = (void *)GetProcAddress( hntdll, "NtClose" ); pRtlUnwind = (void *)GetProcAddress( hntdll, "RtlUnwind" ); pRtlRaiseException = (void *)GetProcAddress( hntdll, "RtlRaiseException" ); pRtlCaptureContext = (void *)GetProcAddress( hntdll, "RtlCaptureContext" ); @@ -3020,6 +3080,12 @@ START_TEST(exception) test_breakpoint(0); test_stage = 10; test_breakpoint(1); + test_stage = 11; + test_closehandle(0, (HANDLE)0xdeadbeef); + test_stage = 12; + test_closehandle(1, (HANDLE)0xdeadbeef); + test_stage = 13; + test_closehandle(0, 0); /* Special case. */ } else skip( "RtlRaiseException not found\n" ); @@ -3036,6 +3102,7 @@ START_TEST(exception) test_ripevent(1); test_debug_service(1); test_breakpoint(1); + test_closehandle(0, (HANDLE)0xdeadbeef); test_vectored_continue_handler(); test_debugger(); test_simd_exceptions(); @@ -3069,6 +3136,7 @@ START_TEST(exception) test_ripevent(1); test_debug_service(1); test_breakpoint(1); + test_closehandle(0, (HANDLE)0xdeadbeef); test_vectored_continue_handler(); test_virtual_unwind(); test___C_specific_handler();
1
0
0
0
Dmitry Timoshkov : mstask: Store creator using IRegistrationInfo.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: 8f81fa82d53c92023e766e353f1a0e8dc34dcece URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8f81fa82d53c92023e766e35…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 2 13:27:10 2018 +0800 mstask: Store creator using IRegistrationInfo. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 60 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index d04666d..34d1fa0 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -301,20 +301,60 @@ static HRESULT WINAPI MSTASK_ITask_GetComment(ITask *iface, LPWSTR *comment) return hr; } -static HRESULT WINAPI MSTASK_ITask_SetCreator( - ITask* iface, - LPCWSTR pwszCreator) +static HRESULT WINAPI MSTASK_ITask_SetCreator(ITask *iface, LPCWSTR creator) { - FIXME("(%p, %p): stub\n", iface, pwszCreator); - return E_NOTIMPL; + TaskImpl *This = impl_from_ITask(iface); + IRegistrationInfo *info; + HRESULT hr; + + TRACE("(%p, %s)\n", iface, debugstr_w(creator)); + + if (!creator || !creator[0]) + creator = NULL; + + hr = ITaskDefinition_get_RegistrationInfo(This->task, &info); + if (hr == S_OK) + { + hr = IRegistrationInfo_put_Author(info, (BSTR)creator); + IRegistrationInfo_Release(info); + } + return hr; } -static HRESULT WINAPI MSTASK_ITask_GetCreator( - ITask* iface, - LPWSTR *ppwszCreator) +static HRESULT WINAPI MSTASK_ITask_GetCreator(ITask *iface, LPWSTR *creator) { - FIXME("(%p, %p): stub\n", iface, ppwszCreator); - return E_NOTIMPL; + TaskImpl *This = impl_from_ITask(iface); + IRegistrationInfo *info; + HRESULT hr; + BSTR author; + DWORD len; + + TRACE("(%p, %p)\n", iface, creator); + + hr = ITaskDefinition_get_RegistrationInfo(This->task, &info); + if (hr != S_OK) return hr; + + hr = IRegistrationInfo_get_Author(info, &author); + if (hr == S_OK) + { + len = author ? lstrlenW(author) + 1 : 1; + *creator = CoTaskMemAlloc(len * sizeof(WCHAR)); + if (*creator) + { + if (!author) + *creator[0] = 0; + else + lstrcpyW(*creator, author); + hr = S_OK; + } + else + hr = E_OUTOFMEMORY; + + SysFreeString(author); + } + + IRegistrationInfo_Release(info); + return hr; } static HRESULT WINAPI MSTASK_ITask_SetWorkItemData(
1
0
0
0
Dmitry Timoshkov : taskschd: IRegistrationInfo::put_Source() should accept NULL input.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: f6d63654302a9c23265e1f43f8b5e04ea457ca7c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f6d63654302a9c23265e1f43…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 2 13:27:05 2018 +0800 taskschd: IRegistrationInfo::put_Source() should accept NULL input. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/task.c | 15 ++++++++++----- dlls/taskschd/tests/scheduler.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 334fa3f..432f983 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -767,15 +767,14 @@ static HRESULT WINAPI RegistrationInfo_get_Source(IRegistrationInfo *iface, BSTR static HRESULT WINAPI RegistrationInfo_put_Source(IRegistrationInfo *iface, BSTR source) { registration_info *reginfo = impl_from_IRegistrationInfo(iface); + WCHAR *str = NULL; TRACE("%p,%s\n", iface, debugstr_w(source)); - if (!source) return E_INVALIDARG; - + if (source && !(str = heap_strdupW(source))) return E_OUTOFMEMORY; heap_free(reginfo->source); - reginfo->source = heap_strdupW(source); - /* FIXME: update XML on the server side */ - return reginfo->source ? S_OK : E_OUTOFMEMORY; + reginfo->source = str; + return S_OK; } static const IRegistrationInfoVtbl RegistrationInfo_vtbl = @@ -3341,6 +3340,12 @@ static HRESULT read_registration_info(IXmlReader *reader, IRegistrationInfo *inf if (hr == S_OK) IRegistrationInfo_put_URI(info, value); } + else if (!lstrcmpW(name, Source)) + { + hr = read_text_value(reader, &value); + if (hr == S_OK) + IRegistrationInfo_put_Source(info, value); + } else FIXME("unhandled RegistrationInfo element %s\n", debugstr_w(name)); diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index cb17eaf..12c30e8 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1429,6 +1429,7 @@ static void test_TaskDefinition(void) " <Date>2018-04-02T11:22:33</Date>\n" " <Documentation>doc</Documentation>\n" " <URI>uri</URI>\n" + " <Source>source</Source>\n" " </RegistrationInfo>\n" " <Settings>\n" " <Enabled>false</Enabled>\n" @@ -1513,6 +1514,7 @@ static void test_TaskDefinition(void) static const WCHAR dateW[] = { '2','0','1','8','-','0','4','-','0','2','T','1','1',':','2','2',':','3','3',0 }; static const WCHAR docW[] = { 'd','o','c',0 }; static const WCHAR uriW[] = { 'u','r','i',0 }; + static const WCHAR sourceW[] = { 's','o','u','r','c','e',0 }; static WCHAR Task1[] = { '"','T','a','s','k','1','"',0 }; static struct settings def_settings = { { 0 }, { 'P','T','7','2','H',0 }, { 0 }, 0, 7, TASK_INSTANCES_IGNORE_NEW, TASK_COMPATIBILITY_V2, VARIANT_TRUE, VARIANT_TRUE, @@ -1676,7 +1678,15 @@ todo_wine hr = IRegistrationInfo_get_Source(reginfo, &bstr); ok(hr == S_OK, "get_Source error %#x\n", hr); + ok(!lstrcmpW(bstr, sourceW), "expected %s, got %s\n", wine_dbgstr_w(sourceW), wine_dbgstr_w(bstr)); + SysFreeString(bstr); + hr = IRegistrationInfo_put_Source(reginfo, NULL); + ok(hr == S_OK, "put_Source error %#x\n", hr); + bstr = (BSTR)0xdeadbeef; + hr = IRegistrationInfo_get_Source(reginfo, &bstr); + ok(hr == S_OK, "get_Source error %#x\n", hr); ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + V_VT(&var) = VT_BSTR; V_BSTR(&var) = NULL; hr = IRegistrationInfo_get_SecurityDescriptor(reginfo, &var); @@ -1695,7 +1705,6 @@ if (hr == S_OK) hr = IRegistrationInfo_get_Description(reginfo, &bstr); ok(hr == S_OK, "get_Description error %#x\n", hr); -if (hr == S_OK) ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); hr = ITaskDefinition_get_Triggers(taskdef, &trigger_col);
1
0
0
0
Dmitry Timoshkov : mstask: Store comment using IRegistrationInfo.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: 6ff9f7e8700be0fb9924128c400501cc3b984a91 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ff9f7e8700be0fb9924128c…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 2 13:27:07 2018 +0800 mstask: Store comment using IRegistrationInfo. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 5a40236..d04666d 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -248,41 +248,56 @@ static HRESULT WINAPI MSTASK_ITask_GetExitCode( static HRESULT WINAPI MSTASK_ITask_SetComment(ITask *iface, LPCWSTR comment) { TaskImpl *This = impl_from_ITask(iface); + IRegistrationInfo *info; + HRESULT hr; TRACE("(%p, %s)\n", iface, debugstr_w(comment)); if (!comment || !comment[0]) comment = NULL; - return IExecAction_put_Id(This->action, (BSTR)comment); + hr = ITaskDefinition_get_RegistrationInfo(This->task, &info); + if (hr == S_OK) + { + hr = IRegistrationInfo_put_Description(info, (BSTR)comment); + IRegistrationInfo_Release(info); + } + return hr; } static HRESULT WINAPI MSTASK_ITask_GetComment(ITask *iface, LPWSTR *comment) { TaskImpl *This = impl_from_ITask(iface); + IRegistrationInfo *info; HRESULT hr; - BSTR id; + BSTR description; DWORD len; TRACE("(%p, %p)\n", iface, comment); - hr = IExecAction_get_Id(This->action, &id); + hr = ITaskDefinition_get_RegistrationInfo(This->task, &info); if (hr != S_OK) return hr; - len = id ? lstrlenW(id) + 1 : 1; - *comment = CoTaskMemAlloc(len * sizeof(WCHAR)); - if (*comment) + hr = IRegistrationInfo_get_Description(info, &description); + if (hr == S_OK) { - if (!id) - *comment[0] = 0; + len = description ? lstrlenW(description) + 1 : 1; + *comment = CoTaskMemAlloc(len * sizeof(WCHAR)); + if (*comment) + { + if (!description) + *comment[0] = 0; + else + lstrcpyW(*comment, description); + hr = S_OK; + } else - lstrcpyW(*comment, id); - hr = S_OK; + hr = E_OUTOFMEMORY; + + SysFreeString(description); } - else - hr = E_OUTOFMEMORY; - SysFreeString(id); + IRegistrationInfo_Release(info); return hr; }
1
0
0
0
Dmitry Timoshkov : taskschd: IRegistrationInfo::put_URI() should accept NULL input.
by Alexandre Julliard
02 Apr '18
02 Apr '18
Module: wine Branch: master Commit: eb39956bdd5a198d9722b006309f27d6c9726d7e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eb39956bdd5a198d9722b006…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 2 13:27:03 2018 +0800 taskschd: IRegistrationInfo::put_URI() should accept NULL input. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/task.c | 15 ++++++++++----- dlls/taskschd/tests/scheduler.c | 10 ++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 3a3b5e1..334fa3f 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -728,15 +728,14 @@ static HRESULT WINAPI RegistrationInfo_get_URI(IRegistrationInfo *iface, BSTR *u static HRESULT WINAPI RegistrationInfo_put_URI(IRegistrationInfo *iface, BSTR uri) { registration_info *reginfo = impl_from_IRegistrationInfo(iface); + WCHAR *str = NULL; TRACE("%p,%s\n", iface, debugstr_w(uri)); - if (!uri) return E_INVALIDARG; - + if (uri && !(str = heap_strdupW(uri))) return E_OUTOFMEMORY; heap_free(reginfo->uri); - reginfo->uri = heap_strdupW(uri); - /* FIXME: update XML on the server side */ - return reginfo->uri ? S_OK : E_OUTOFMEMORY; + reginfo->uri = str; + return S_OK; } static HRESULT WINAPI RegistrationInfo_get_SecurityDescriptor(IRegistrationInfo *iface, VARIANT *sddl) @@ -3336,6 +3335,12 @@ static HRESULT read_registration_info(IXmlReader *reader, IRegistrationInfo *inf if (hr == S_OK) IRegistrationInfo_put_Documentation(info, value); } + else if (!lstrcmpW(name, URI)) + { + hr = read_text_value(reader, &value); + if (hr == S_OK) + IRegistrationInfo_put_URI(info, value); + } else FIXME("unhandled RegistrationInfo element %s\n", debugstr_w(name)); diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index b499f0b..cb17eaf 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1428,6 +1428,7 @@ static void test_TaskDefinition(void) " <Version>1.0</Version>\n" " <Date>2018-04-02T11:22:33</Date>\n" " <Documentation>doc</Documentation>\n" + " <URI>uri</URI>\n" " </RegistrationInfo>\n" " <Settings>\n" " <Enabled>false</Enabled>\n" @@ -1511,6 +1512,7 @@ static void test_TaskDefinition(void) static const WCHAR versionW[] = { '1','.','0',0 }; static const WCHAR dateW[] = { '2','0','1','8','-','0','4','-','0','2','T','1','1',':','2','2',':','3','3',0 }; static const WCHAR docW[] = { 'd','o','c',0 }; + static const WCHAR uriW[] = { 'u','r','i',0 }; static WCHAR Task1[] = { '"','T','a','s','k','1','"',0 }; static struct settings def_settings = { { 0 }, { 'P','T','7','2','H',0 }, { 0 }, 0, 7, TASK_INSTANCES_IGNORE_NEW, TASK_COMPATIBILITY_V2, VARIANT_TRUE, VARIANT_TRUE, @@ -1663,7 +1665,15 @@ todo_wine hr = IRegistrationInfo_get_URI(reginfo, &bstr); ok(hr == S_OK, "get_URI error %#x\n", hr); + ok(!lstrcmpW(bstr, uriW), "expected %s, got %s\n", wine_dbgstr_w(uriW), wine_dbgstr_w(bstr)); + SysFreeString(bstr); + hr = IRegistrationInfo_put_URI(reginfo, NULL); + ok(hr == S_OK, "put_URI error %#x\n", hr); + bstr = (BSTR)0xdeadbeef; + hr = IRegistrationInfo_get_URI(reginfo, &bstr); + ok(hr == S_OK, "get_URI error %#x\n", hr); ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_Source(reginfo, &bstr); ok(hr == S_OK, "get_Source error %#x\n", hr); ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr));
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
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
Results per page:
10
25
50
100
200