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
October 2023
----- 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
702 discussions
Start a n
N
ew thread
Joel Holdsworth : ntdll/tests: Add tests for FILE_LINK_IGNORE_READONLY_ATTRIBUTE.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 08ca54b494fa7732ee8522adab2779f23a04ff71 URL:
https://gitlab.winehq.org/wine/wine/-/commit/08ca54b494fa7732ee8522adab2779…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Wed Sep 20 10:28:10 2023 +0100 ntdll/tests: Add tests for FILE_LINK_IGNORE_READONLY_ATTRIBUTE. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 5164e864888..ae8956dedf4 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -3031,6 +3031,98 @@ static void test_file_link_information(FILE_INFORMATION_CLASS class) delete_object( oldpath ); } +static void test_file_link_information_ex(void) +{ + static const WCHAR fooW[] = {'f','o','o',0}; + WCHAR tmp_path[MAX_PATH], oldpath[MAX_PATH + 16], newpath[MAX_PATH + 16]; + FILE_LINK_INFORMATION *fli; + BOOL fileDeleted; + UNICODE_STRING name_str; + HANDLE handle, handle2; + IO_STATUS_BLOCK io; + NTSTATUS res; + + GetTempPathW( MAX_PATH, tmp_path ); + + /* oldpath is a file, newpath is a read-only file, with FILE_LINK_REPLACE_IF_EXISTS */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + res = GetTempFileNameW( tmp_path, fooW, 0, newpath ); + ok( res != 0, "failed to create temp file\n" ); + DeleteFileW( newpath ); + handle2 = CreateFileW( newpath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0 ); + ok( handle2 != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + CloseHandle( handle2 ); + pRtlDosPathNameToNtPathName_U( newpath, &name_str, NULL, NULL ); + fli = HeapAlloc( GetProcessHeap(), 0, sizeof(FILE_LINK_INFORMATION) + name_str.Length ); + fli->Flags = FILE_LINK_REPLACE_IF_EXISTS; + fli->RootDirectory = NULL; + fli->FileNameLength = name_str.Length; + memcpy( fli->FileName, name_str.Buffer, name_str.Length ); + pRtlFreeUnicodeString( &name_str ); + + io.Status = 0xdeadbeef; + res = pNtSetInformationFile( handle, &io, fli, sizeof(FILE_LINK_INFORMATION) + fli->FileNameLength, FileLinkInformationEx ); + + if (res == STATUS_NOT_IMPLEMENTED || res == STATUS_INVALID_INFO_CLASS) + { + win_skip( "FileLinkInformationEx not supported\n" ); + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fli ); + delete_object( oldpath ); + return; + } + + todo_wine ok( io.Status == 0xdeadbeef, "io.Status expected 0xdeadbeef, got %lx\n", io.Status ); + todo_wine ok( res == STATUS_ACCESS_DENIED, "res expected STATUS_ACCESS_DENIED, got %lx\n", res ); + fileDeleted = GetFileAttributesW( oldpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "file should exist\n" ); + fileDeleted = GetFileAttributesW( newpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "file should exist\n" ); + + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fli ); + delete_object( oldpath ); + delete_object( newpath ); + + /* oldpath is a file, newpath is a read-only file, with FILE_LINK_REPLACE_IF_EXISTS and FILE_LINK_IGNORE_READONLY_ATTRIBUTE */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + res = GetTempFileNameW( tmp_path, fooW, 0, newpath ); + ok( res != 0, "failed to create temp file\n" ); + DeleteFileW( newpath ); + handle2 = CreateFileW( newpath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0 ); + ok( handle2 != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + CloseHandle( handle2 ); + pRtlDosPathNameToNtPathName_U( newpath, &name_str, NULL, NULL ); + fli = HeapAlloc( GetProcessHeap(), 0, sizeof(FILE_LINK_INFORMATION) + name_str.Length ); + fli->Flags = FILE_LINK_REPLACE_IF_EXISTS | FILE_LINK_IGNORE_READONLY_ATTRIBUTE; + fli->RootDirectory = NULL; + fli->FileNameLength = name_str.Length; + memcpy( fli->FileName, name_str.Buffer, name_str.Length ); + pRtlFreeUnicodeString( &name_str ); + + io.Status = 0xdeadbeef; + res = pNtSetInformationFile( handle, &io, fli, sizeof(FILE_LINK_INFORMATION) + fli->FileNameLength, FileLinkInformationEx ); + ok( io.Status == STATUS_SUCCESS, "io.Status expected STATUS_SUCCESS, got %lx\n", io.Status ); + ok( res == STATUS_SUCCESS, "res expected STATUS_SUCCESS, got %lx\n", res ); + fileDeleted = GetFileAttributesW( oldpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "file should exist\n" ); + fileDeleted = GetFileAttributesW( newpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "file should exist\n" ); + + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fli ); + delete_object( oldpath ); + delete_object( newpath ); +} + static void test_file_both_information(void) { IO_STATUS_BLOCK io; @@ -5796,6 +5888,7 @@ START_TEST(file) test_file_rename_information_ex(); test_file_link_information(FileLinkInformation); test_file_link_information(FileLinkInformationEx); + test_file_link_information_ex(); test_file_disposition_information(); test_file_completion_information(); test_file_id_information();
1
0
0
0
Joel Holdsworth : ntdll/tests: Add tests for FILE_RENAME_IGNORE_READONLY_ATTRIBUTE.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 07e40a6f9f70338d9810d50b606696b7be984d98 URL:
https://gitlab.winehq.org/wine/wine/-/commit/07e40a6f9f70338d9810d50b606696…
Author: Joel Holdsworth <joel(a)airwebreathe.org.uk> Date: Wed Sep 20 11:34:09 2023 +0100 ntdll/tests: Add tests for FILE_RENAME_IGNORE_READONLY_ATTRIBUTE. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index cf04ccc1264..5164e864888 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1502,7 +1502,9 @@ static void test_file_all_information(void) static void delete_object( WCHAR *path ) { - BOOL ret = DeleteFileW( path ); + BOOL ret = SetFileAttributesW( path, FILE_ATTRIBUTE_NORMAL ); + ok( ret || GetLastError() == ERROR_FILE_NOT_FOUND, "SetFileAttribute failed with %lu\n", GetLastError() ); + ret = DeleteFileW( path ); ok( ret || GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_ACCESS_DENIED, "DeleteFileW failed with %lu\n", GetLastError() ); if (!ret && GetLastError() == ERROR_ACCESS_DENIED) @@ -2178,6 +2180,98 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class) delete_object( oldpath ); } +static void test_file_rename_information_ex(void) +{ + static const WCHAR fooW[] = {'f','o','o',0}; + WCHAR tmp_path[MAX_PATH], oldpath[MAX_PATH + 16], newpath[MAX_PATH + 16]; + FILE_RENAME_INFORMATION *fri; + BOOL fileDeleted; + UNICODE_STRING name_str; + HANDLE handle, handle2; + IO_STATUS_BLOCK io; + NTSTATUS res; + + GetTempPathW( MAX_PATH, tmp_path ); + + /* oldpath is a file, newpath is a read-only file, with FILE_RENAME_REPLACE_IF_EXISTS */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + res = GetTempFileNameW( tmp_path, fooW, 0, newpath ); + ok( res != 0, "failed to create temp file\n" ); + DeleteFileW( newpath ); + handle2 = CreateFileW( newpath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0 ); + ok( handle2 != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + CloseHandle( handle2 ); + pRtlDosPathNameToNtPathName_U( newpath, &name_str, NULL, NULL ); + fri = HeapAlloc( GetProcessHeap(), 0, sizeof(FILE_RENAME_INFORMATION) + name_str.Length ); + fri->Flags = FILE_RENAME_REPLACE_IF_EXISTS; + fri->RootDirectory = NULL; + fri->FileNameLength = name_str.Length; + memcpy( fri->FileName, name_str.Buffer, name_str.Length ); + pRtlFreeUnicodeString( &name_str ); + + io.Status = 0xdeadbeef; + res = pNtSetInformationFile( handle, &io, fri, sizeof(FILE_RENAME_INFORMATION) + fri->FileNameLength, FileRenameInformationEx ); + + if (res == STATUS_NOT_IMPLEMENTED || res == STATUS_INVALID_INFO_CLASS) + { + win_skip( "FileRenameInformationEx not supported\n" ); + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fri ); + delete_object( oldpath ); + return; + } + + todo_wine ok( io.Status == 0xdeadbeef, "io.Status expected 0xdeadbeef, got %lx\n", io.Status ); + todo_wine ok( res == STATUS_ACCESS_DENIED, "res expected STATUS_ACCESS_DENIED, got %lx\n", res ); + fileDeleted = GetFileAttributesW( oldpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + todo_wine ok( !fileDeleted, "file should exist\n" ); + fileDeleted = GetFileAttributesW( newpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "file should exist\n" ); + + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fri ); + delete_object( oldpath ); + delete_object( newpath ); + + /* oldpath is a file, newpath is a read-only file, with FILE_RENAME_REPLACE_IF_EXISTS and FILE_RENAME_IGNORE_READONLY_ATTRIBUTE */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + res = GetTempFileNameW( tmp_path, fooW, 0, newpath ); + ok( res != 0, "failed to create temp file\n" ); + DeleteFileW( newpath ); + handle2 = CreateFileW( newpath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0 ); + ok( handle2 != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + CloseHandle( handle2 ); + pRtlDosPathNameToNtPathName_U( newpath, &name_str, NULL, NULL ); + fri = HeapAlloc( GetProcessHeap(), 0, sizeof(FILE_RENAME_INFORMATION) + name_str.Length ); + fri->Flags = FILE_RENAME_REPLACE_IF_EXISTS | FILE_RENAME_IGNORE_READONLY_ATTRIBUTE; + fri->RootDirectory = NULL; + fri->FileNameLength = name_str.Length; + memcpy( fri->FileName, name_str.Buffer, name_str.Length ); + pRtlFreeUnicodeString( &name_str ); + + io.Status = 0xdeadbeef; + res = pNtSetInformationFile( handle, &io, fri, sizeof(FILE_RENAME_INFORMATION) + fri->FileNameLength, FileRenameInformationEx ); + ok( io.Status == STATUS_SUCCESS, "io.Status expected STATUS_SUCCESS, got %lx\n", io.Status ); + ok( res == STATUS_SUCCESS, "res expected STATUS_SUCCESS, got %lx\n", res ); + fileDeleted = GetFileAttributesW( oldpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( fileDeleted, "file should not exist\n" ); + fileDeleted = GetFileAttributesW( newpath ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "file should exist\n" ); + + CloseHandle( handle ); + HeapFree( GetProcessHeap(), 0, fri ); + delete_object( oldpath ); + delete_object( newpath ); +} + static void test_file_link_information(FILE_INFORMATION_CLASS class) { static const WCHAR foo_txtW[] = {'\\','f','o','o','.','t','x','t',0}; @@ -5699,6 +5793,7 @@ START_TEST(file) test_file_all_name_information(); test_file_rename_information(FileRenameInformation); test_file_rename_information(FileRenameInformationEx); + test_file_rename_information_ex(); test_file_link_information(FileLinkInformation); test_file_link_information(FileLinkInformationEx); test_file_disposition_information();
1
0
0
0
Piotr Caban : wineps: Add support for EMR_EXTCREATEPEN record playback.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: ad232b530a43743819d8a2b5a443ffa2e55d0566 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ad232b530a43743819d8a2b5a443ff…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Oct 5 13:27:29 2023 +0200 wineps: Add support for EMR_EXTCREATEPEN record playback. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55606
--- dlls/wineps.drv/printproc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 74f43b6d27c..3de05eea3f5 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -2309,6 +2309,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case OBJ_PEN: return PSDRV_SelectPen(data->ctx, obj, NULL) != NULL; case OBJ_BRUSH: return PSDRV_SelectBrush(data->ctx, obj, pattern) != NULL; case OBJ_FONT: return PSDRV_SelectFont(data->ctx, obj, &aa_flags) != NULL; + case OBJ_EXTPEN: return PSDRV_SelectPen(data->ctx, obj, NULL) != NULL; default: FIXME("unhandled object type %ld\n", GetObjectType(obj)); return 1; @@ -2843,6 +2844,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_SELECTCLIPPATH: case EMR_EXTSELECTCLIPRGN: case EMR_EXTCREATEFONTINDIRECTW: + case EMR_EXTCREATEPEN: case EMR_SETLAYOUT: return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count); default:
1
0
0
0
Piotr Caban : gdi32: Add partial support for creating EMREXTCREATEPEN records.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 59f72abfcf974dd9ad0a87c8c68474f5e47b6c75 URL:
https://gitlab.winehq.org/wine/wine/-/commit/59f72abfcf974dd9ad0a87c8c68474…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Oct 5 13:34:28 2023 +0200 gdi32: Add partial support for creating EMREXTCREATEPEN records. --- dlls/gdi32/emfdc.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index 45938172a37..645592fea0a 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -647,30 +647,45 @@ static BOOL emfdc_select_font( DC_ATTR *dc_attr, HFONT font ) return emfdc_record( emf, &emr.emr ); } -static DWORD emfdc_create_pen( struct emf *emf, HPEN hPen ) +static DWORD emfdc_ext_create_pen( struct emf *emf, HPEN pen ) { - EMRCREATEPEN emr; - DWORD index = 0; + EMREXTCREATEPEN *emr; + int size, emr_size; + DWORD ret = 0; - if (!GetObjectW( hPen, sizeof(emr.lopn), &emr.lopn )) - { - /* must be an extended pen */ - EXTLOGPEN *elp; - INT size = GetObjectW( hPen, 0, NULL ); + if (!(size = GetObjectW( pen, 0, NULL ))) + return 0; + emr_size = sizeof(*emr) - sizeof(emr->elp) + size; + emr = HeapAlloc( GetProcessHeap(), 0, emr_size ); + if (!emr) + return 0; + GetObjectW( pen, size, &emr->elp ); - if (!size) return 0; + if (emr->elp.elpBrushStyle == BS_DIBPATTERN || + emr->elp.elpBrushStyle == BS_DIBPATTERNPT || + emr->elp.elpBrushStyle == BS_PATTERN) + { + FIXME( "elpBrushStyle = %d\n", emr->elp.elpBrushStyle ); + HeapFree( GetProcessHeap(), 0, emr ); + return 0; + } + emr->offBmi = emr->cbBmi = emr->offBits = emr->cbBits = 0; - elp = HeapAlloc( GetProcessHeap(), 0, size ); + emr->emr.iType = EMR_EXTCREATEPEN; + emr->emr.nSize = emr_size; + emr->ihPen = ret = emfdc_add_handle( emf, pen ); + ret = emfdc_record( emf, &emr->emr ) ? ret : 0; + HeapFree( GetProcessHeap(), 0, emr ); + return ret; +} - GetObjectW( hPen, size, elp ); - /* FIXME: add support for user style pens */ - emr.lopn.lopnStyle = elp->elpPenStyle; - emr.lopn.lopnWidth.x = elp->elpWidth; - emr.lopn.lopnWidth.y = 0; - emr.lopn.lopnColor = elp->elpColor; +static DWORD emfdc_create_pen( struct emf *emf, HPEN hPen ) +{ + EMRCREATEPEN emr; + DWORD index = 0; - HeapFree( GetProcessHeap(), 0, elp ); - } + if (!GetObjectW( hPen, sizeof(emr.lopn), &emr.lopn )) + return emfdc_ext_create_pen( emf, hPen ); emr.emr.iType = EMR_CREATEPEN; emr.emr.nSize = sizeof(emr);
1
0
0
0
Daniel Lehman : advapi32/tests: Add ReadEventLogW tests for EventLogStarted.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 428a1219fd94919fb93527f2ef582bd28176c03f URL:
https://gitlab.winehq.org/wine/wine/-/commit/428a1219fd94919fb93527f2ef582b…
Author: Daniel Lehman <dlehman25(a)gmail.com> Date: Mon Oct 2 23:39:16 2023 -0700 advapi32/tests: Add ReadEventLogW tests for EventLogStarted. --- dlls/advapi32/tests/eventlog.c | 80 ++++++++++++++++++++++++++++++++++++++++++ include/Makefile.in | 1 + include/netevent.h | 24 +++++++++++++ 3 files changed, 105 insertions(+) diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c index 793addf3d29..57ead1078f5 100644 --- a/dlls/advapi32/tests/eventlog.c +++ b/dlls/advapi32/tests/eventlog.c @@ -30,6 +30,7 @@ #include "wmistr.h" #include "evntprov.h" #include "evntrace.h" +#include "netevent.h" #include "wine/test.h" @@ -1316,6 +1317,83 @@ done: DeleteFileA(filepath); } +static void test_eventlog_start(void) +{ + BOOL ret, found; + HANDLE handle, handle2; + EVENTLOGRECORD *record; + DWORD size, read, needed; + WCHAR *sourcename, *computername, *localcomputer; + + size = MAX_COMPUTERNAME_LENGTH + 1; + localcomputer = malloc(size * sizeof(WCHAR)); + GetComputerNameW(localcomputer, &size); + + handle = OpenEventLogW(0, L"System"); + handle2 = OpenEventLogW(0, L"System"); + todo_wine ok(handle != handle2, "Expected different handle\n"); + CloseEventLog(handle2); + + handle2 = OpenEventLogW(0, L"SYSTEM"); + ok(!!handle2, "Expected valid handle\n"); + CloseEventLog(handle2); + + ret = TRUE; + found = FALSE; + while (!found && ret) + { + read = needed = 0; + record = malloc(sizeof(EVENTLOGRECORD)); + if (!(ret = ReadEventLogW(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_BACKWARDS_READ, + 0, record, sizeof(EVENTLOGRECORD), &read, &needed)) && + GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + record = realloc(record, needed); + ret = ReadEventLogW(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_BACKWARDS_READ, + 0, record, needed, &read, &needed); + ok(needed == 0, "Expected 0, got %ld\n", needed); + } + if (ret && record->EventID == EVENT_EventlogStarted) + { + ok(record->Length == read, "Expected %ld, got %ld\n", read, record->Length); + ok(record->Reserved == 0x654c664c, "Expected 0x654c664c, got %ld\n", record->Reserved); + ok(record->RecordNumber > 0, "Expected 1 or higher, got %ld\n", record->RecordNumber); + ok(record->TimeGenerated == record->TimeWritten, "Expected time values to be the same\n"); + ok(record->EventType == EVENTLOG_INFORMATION_TYPE, + "Expected %d, got %d\n", EVENTLOG_INFORMATION_TYPE, record->EventType); + ok(record->NumStrings == 0, "Expected 0, got %d\n", record->NumStrings); + ok(record->EventCategory == 0, "Expected 0, got %d\n", record->EventCategory); + ok(record->ReservedFlags == 0, "Expected 0, got %d\n", record->ReservedFlags); + ok(record->ClosingRecordNumber == 0, "Expected 0, got %ld\n", record->ClosingRecordNumber); + ok(record->StringOffset == record->UserSidOffset, "Expected offsets to be the same\n"); + ok(record->UserSidLength == 0, "Expected 0, got %ld\n", record->UserSidLength); + ok(record->DataLength == 24, "Expected 24, got %ld\n", record->DataLength); + ok(record->DataOffset == record->UserSidOffset, "Expected offsets to be the same\n"); + + sourcename = (WCHAR *)(record + 1); + ok(!lstrcmpW(sourcename, L"EventLog"), + "Expected 'EventLog', got '%ls'\n", sourcename); + + computername = sourcename + sizeof("EventLog"); + ok(!lstrcmpiW(computername, localcomputer), "Expected '%ls', got '%ls'\n", + localcomputer, computername); + + size = sizeof(EVENTLOGRECORD) + sizeof(L"EventLog") + + (lstrlenW(computername) + 1) * sizeof(WCHAR); + size = (size + 7) & ~7; + ok(record->DataOffset == size || + broken(record->DataOffset == size - sizeof(WCHAR)), /* win8 */ + "Expected %ld, got %ld\n", size, record->DataOffset); + + found = TRUE; + } + free(record); + } + todo_wine ok(found, "EventlogStarted event not found\n"); + CloseEventLog(handle); + free(localcomputer); +} + START_TEST(eventlog) { SetLastError(0xdeadbeef); @@ -1349,4 +1427,6 @@ START_TEST(eventlog) /* Trace tests */ test_start_trace(); + + test_eventlog_start(); } diff --git a/include/Makefile.in b/include/Makefile.in index 987e45dffa9..5f61344324d 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -561,6 +561,7 @@ SOURCES = \ ndrtypes.h \ netcfgx.idl \ netcon.idl \ + netevent.h \ netfw.idl \ netioapi.h \ netiodef.h \ diff --git a/include/netevent.h b/include/netevent.h new file mode 100644 index 00000000000..d338a9321bb --- /dev/null +++ b/include/netevent.h @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Daniel Lehman + * + * 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 + */ + +#ifndef _NETEVENT_ +#define _NETEVENT_ + +#define EVENT_EventlogStarted 0x80001775 + +#endif
1
0
0
0
Alistair Leslie-Hughes : msado15: Show fixme only if field_list needs to be used in Recordset::AddNew.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 77b506709adaede075740b33e81dd356d449b6fa URL:
https://gitlab.winehq.org/wine/wine/-/commit/77b506709adaede075740b33e81dd3…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Oct 4 16:55:11 2023 +1100 msado15: Show fixme only if field_list needs to be used in Recordset::AddNew. --- dlls/msado15/recordset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index d0ee85e0f59..2b936f5c096 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -1582,7 +1582,8 @@ static HRESULT WINAPI recordset_AddNew( _Recordset *iface, VARIANT field_list, V struct recordset *recordset = impl_from_Recordset( iface ); TRACE( "%p, %s, %s\n", recordset, debugstr_variant(&field_list), debugstr_variant(&values) ); - FIXME( "ignoring field list and values\n" ); + if (V_VT(&field_list) != VT_ERROR) + FIXME( "ignoring field list and values\n" ); if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
1
0
0
0
Alistair Leslie-Hughes : msado15: Move to newly created row in Recordset::AddNew.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 8a4e235efca17dbd46ba382e1787203e8247b2d4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8a4e235efca17dbd46ba382e178720…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Oct 4 16:55:11 2023 +1100 msado15: Move to newly created row in Recordset::AddNew. It's valid to have a recordset with existing rows. AddNew needs to move to newly created row, so existing won't be used. --- dlls/msado15/recordset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index 99779f99dfa..d0ee85e0f59 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -1587,7 +1587,7 @@ static HRESULT WINAPI recordset_AddNew( _Recordset *iface, VARIANT field_list, V if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed ); if (!resize_recordset( recordset, recordset->count + 1 )) return E_OUTOFMEMORY; - recordset->index++; + recordset->index = recordset->count - 1; recordset->editmode = adEditAdd; return S_OK; }
1
0
0
0
Alexandre Julliard : winegcc: Enable dynamic base by default.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: 0d3ff192aaad8b65eb25ea426442760ebc4e35d0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0d3ff192aaad8b65eb25ea42644276…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Sep 27 13:32:49 2023 +0200 winegcc: Enable dynamic base by default. --- tools/winegcc/winegcc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 968e472227e..b8eb5e4fc79 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -409,6 +409,8 @@ static struct strarray get_link_args( struct options *opts, const char *output_n strarray_add( &flags, "-Wl,--exclude-all-symbols" ); strarray_add( &flags, "-Wl,--nxcompat" ); + strarray_add( &flags, "-Wl,--dynamicbase" ); + strarray_add( &flags, "-Wl,--disable-auto-image-base" ); if (opts->image_base) strarray_add( &flags, strmake("-Wl,--image-base,%s", opts->image_base ));
1
0
0
0
Alexandre Julliard : ntdll: Relocate dynamic base modules when mapping them.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: ec3de128257a8ceb0637fae9d9fd2b067bb0e0d8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ec3de128257a8ceb0637fae9d9fd2b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 5 10:43:02 2023 +0200 ntdll: Relocate dynamic base modules when mapping them. --- dlls/kernel32/tests/loader.c | 4 ++-- dlls/ntdll/unix/virtual.c | 25 ++++++++++++++++++++++++- server/mapping.c | 3 ++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index c250fc5d52d..ec6f2d5c6a7 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -2379,7 +2379,7 @@ static void test_import_resolution(void) offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, GetCurrentProcess(), (void **)&mod, 0, 0, &offset, &size, 1 /* ViewShare */, 0, PAGE_READONLY ); - todo_wine_if (test < 6) + todo_wine_if (test == 5) ok( status == (test == 6 ? STATUS_IMAGE_NOT_AT_BASE : STATUS_SUCCESS), "NtMapViewOfSection failed %lx\n", status ); ok( mod != (void *)nt.OptionalHeader.ImageBase, "loaded at image base %p\n", mod ); @@ -2392,7 +2392,7 @@ static void test_import_resolution(void) "tls relocated %p / %p\n", (void *)ptr->tls.StartAddressOfRawData, (char *)nt.OptionalHeader.ImageBase + DATA_RVA( data.tls_data )); } - else todo_wine + else todo_wine_if (test == 5) { ok( (void *)pnt->OptionalHeader.ImageBase == mod, "not at base %p / %p\n", (void *)pnt->OptionalHeader.ImageBase, mod ); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index c017b45fc1e..855aa9cd1eb 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2687,7 +2687,7 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena IMAGE_NT_HEADERS *nt; IMAGE_SECTION_HEADER sections[96]; IMAGE_SECTION_HEADER *sec; - IMAGE_DATA_DIRECTORY *imports; + IMAGE_DATA_DIRECTORY *imports, *relocs; NTSTATUS status = STATUS_CONFLICTING_ADDRESSES; int i; off_t pos; @@ -2695,6 +2695,7 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena char *header_end; char *ptr = view->base; SIZE_T header_size, total_size = view->size; + INT_PTR delta; TRACE_(module)( "mapping PE file %s at %p-%p\n", debugstr_w(filename), ptr, ptr + total_size ); @@ -2848,6 +2849,28 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena #endif if (machine && machine != nt->FileHeader.Machine) return STATUS_NOT_SUPPORTED; + /* relocate to dynamic base */ + + if (image_info->map_addr && (delta = image_info->map_addr - image_info->base)) + { + TRACE_(module)( "relocating %s dynamic base %lx -> %lx mapped at %p\n", debugstr_w(filename), + (ULONG_PTR)image_info->base, (ULONG_PTR)image_info->map_addr, ptr ); + + if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + ((IMAGE_NT_HEADERS64 *)nt)->OptionalHeader.ImageBase = image_info->map_addr; + else + ((IMAGE_NT_HEADERS32 *)nt)->OptionalHeader.ImageBase = image_info->map_addr; + + if ((relocs = get_data_dir( nt, total_size, IMAGE_DIRECTORY_ENTRY_BASERELOC ))) + { + IMAGE_BASE_RELOCATION *rel = (IMAGE_BASE_RELOCATION *)(ptr + relocs->VirtualAddress); + IMAGE_BASE_RELOCATION *end = (IMAGE_BASE_RELOCATION *)((char *)rel + relocs->Size); + + while (rel && rel < end - 1 && rel->SizeOfBlock && rel->VirtualAddress < total_size) + rel = process_relocation_block( ptr + rel->VirtualAddress, rel, delta ); + } + } + /* set the image protections */ set_vprot( view, ptr, ROUND_SIZE( 0, header_size ), VPROT_COMMITTED | VPROT_READ ); diff --git a/server/mapping.c b/server/mapping.c index 41585b35924..c570bcf8f94 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -1407,7 +1407,8 @@ DECL_HANDLER(map_image_view) view->image.entry_point = req->entry; add_process_view( current, view ); - if (view->base != mapping->image.base) set_error( STATUS_IMAGE_NOT_AT_BASE ); + if (view->base != (mapping->image.map_addr ? mapping->image.map_addr : mapping->image.base)) + set_error( STATUS_IMAGE_NOT_AT_BASE ); if (view->image.machine != current->process->machine) { /* on 32-bit, the native 64-bit machine is allowed */
1
0
0
0
Alexandre Julliard : server: Assign a system-wide mapping address for dynamic base modules.
by Alexandre Julliard
05 Oct '23
05 Oct '23
Module: wine Branch: master Commit: efd03f40e6e315d89cd1d09c48180aae82033f9f URL:
https://gitlab.winehq.org/wine/wine/-/commit/efd03f40e6e315d89cd1d09c48180a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 5 10:41:47 2023 +0200 server: Assign a system-wide mapping address for dynamic base modules. --- dlls/ntdll/unix/virtual.c | 27 +++++++++-- include/wine/server_protocol.h | 19 +++++++- server/fd.c | 21 +++++++++ server/file.h | 4 ++ server/main.c | 1 + server/mapping.c | 105 +++++++++++++++++++++++++++++++++++++++-- server/protocol.def | 9 ++++ server/request.h | 8 +++- server/trace.c | 13 +++++ tools/make_requests | 2 +- 10 files changed, 200 insertions(+), 9 deletions(-)
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
71
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
Results per page:
10
25
50
100
200