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
July 2022
----- 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
639 discussions
Start a n
N
ew thread
Alexandre Julliard : git-notify: Remove support for obsolete CIA notifications.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: tools Branch: master Commit: f3e6f9d6ee8857631f41360cc7bc803bab1b854c URL:
https://gitlab.winehq.org/winehq/tools/-/commit/f3e6f9d6ee8857631f41360cc7b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 11 13:08:35 2022 +0200 git-notify: Remove support for obsolete CIA notifications. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- git-notify | 66 -------------------------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/git-notify b/git-notify index 9918117c..91f29a65 100755 --- a/git-notify +++ b/git-notify @@ -14,7 +14,6 @@ # # Usage: git-notify [options] [--] old-sha1 new-sha1 refname # -# -c name Send CIA notifications under specified project name # -m addr Send mail notifications to specified address # -n max Set max number of individual mails to send # -r name Set the git repository name @@ -41,9 +40,6 @@ sub get_repos_name(); # set this to something that takes "-s" my $mailer = "/usr/bin/mail"; -# CIA notification address -my $cia_address = "cia\(a)cia.vc"; - # debug mode my $debug = 0; @@ -61,9 +57,6 @@ my $max_diff_size = git_config( "notify.maxdiff" ) || 10000; # address for mail notices (can be set with -m option) my $commitlist_address = git_config( "notify.mail" ); -# project name for CIA notices (can be set with -c option) -my $cia_project_name = git_config( "notify.cia" ); - # max number of individual notices before falling back to a single global notice (can be set with -n option) my $max_individual_notices = git_config( "notify.maxnotices" ) || 100; @@ -79,7 +72,6 @@ my @revlist_options; sub usage() { print "Usage: $0 [options] [--] old-sha1 new-sha1 refname\n"; - print " -c name Send CIA notifications under specified project name\n"; print " -m addr Send mail notifications to specified address\n"; print " -n max Set max number of individual mails to send\n"; print " -r name Set the git repository name\n"; @@ -141,7 +133,6 @@ sub parse_options() my $arg = shift @ARGV; if ($arg eq '--') { last; } - elsif ($arg eq '-c') { $cia_project_name = shift @ARGV; } elsif ($arg eq '-m') { $commitlist_address = shift @ARGV; } elsif ($arg eq '-n') { $max_individual_notices = shift @ARGV; } elsif ($arg eq '-r') { $repos_name = shift @ARGV; } @@ -296,62 +287,6 @@ sub send_commit_notice($$) mail_notification($commitlist_address, $subject, "text/plain; charset=UTF-8", @notice); } -# send a commit notice to the CIA server -sub send_cia_notice($$) -{ - my ($ref,$commit) = @_; - my %info = get_object_info($commit); - my @cia_text = (); - - return if $info{"type"} ne "commit"; - - push @cia_text, - "<message>", - " <generator>", - " <name>git-notify script for CIA</name>", - " </generator>", - " <source>", - " <project>" . xml_escape($cia_project_name) . "</project>", - " <module>" . xml_escape($repos_name) . "</module>", - " <branch>" . xml_escape($ref). "</branch>", - " </source>", - " <body>", - " <commit>", - " <revision>" . substr($commit,0,10) . "</revision>", - " <author>" . xml_escape($info{"author"}) . "</author>", - " <log>" . xml_escape(join "\n", @{$info{"log"}}) . "</log>", - " <files>"; - - open COMMIT, "-|" or exec "git", "diff-tree", "--name-status", "-r", "-M", $commit or die "cannot run git-diff-tree"; - while (<COMMIT>) - { - chomp; - if (/^([AMD])\t(.*)$/) - { - my ($action, $file) = ($1, $2); - my %actions = ( "A" => "add", "M" => "modify", "D" => "remove" ); - next unless defined $actions{$action}; - push @cia_text, " <file action=\"$actions{$action}\">" . xml_escape($file) . "</file>"; - } - elsif (/^R\d+\t(.*)\t(.*)$/) - { - my ($old, $new) = ($1, $2); - push @cia_text, " <file action=\"rename\" to=\"" . xml_escape($new) . "\">" . xml_escape($old) . "</file>"; - } - } - close COMMIT; - - push @cia_text, - " </files>", - $gitweb_url ? " <url>" . xml_escape("$gitweb_url/?a=commit;h=$commit") . "</url>" : "", - " </commit>", - " </body>", - " <timestamp>" . $info{"author_date"} . "</timestamp>", - "</message>"; - - mail_notification($cia_address, "DeliverXML", "text/xml", @cia_text); -} - # send a global commit notice when there are too many commits for individual mails sub send_global_notice($$$) { @@ -406,7 +341,6 @@ sub send_all_notices($$$) foreach my $commit (@commits) { send_commit_notice( $ref, $commit ) if $commitlist_address; - send_cia_notice( $ref, $commit ) if $cia_project_name; } }
1
0
0
0
David Kahurani : ieframe: Fix memory leak in open_dde_url.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: 6e32c011a2b977246f9ab2282d30b69cff90142b URL:
https://gitlab.winehq.org/wine/wine/-/commit/6e32c011a2b977246f9ab2282d30b6…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Mon Jul 11 19:15:43 2022 +0300 ieframe: Fix memory leak in open_dde_url. Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/ieframe/iexplore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ieframe/iexplore.c b/dlls/ieframe/iexplore.c index 1616d4d7f84..6eb86d93e5e 100644 --- a/dlls/ieframe/iexplore.c +++ b/dlls/ieframe/iexplore.c @@ -1027,10 +1027,12 @@ static HDDEDATA open_dde_url(WCHAR *dde_url) } hres = IWebBrowser2_Navigate2(&ie->IWebBrowser2_iface, &urlv, NULL, NULL, NULL, NULL); - if(FAILED(hres)) - return 0; + SysFreeString(V_BSTR(&urlv)); IWebBrowser2_Release(&ie->IWebBrowser2_iface); + + if(FAILED(hres)) + return 0; return ULongToHandle(DDE_FACK); }
1
0
0
0
Brendan Shanks : ntdll: Add ".globl" for asm labels referenced from C.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: b8ec1068baadc49051a1f762dc9f884bd160da58 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b8ec1068baadc49051a1f762dc9f88…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon Jul 11 11:21:31 2022 -0700 ntdll: Add ".globl" for asm labels referenced from C. Fixes syscall faults on 32-bit macOS. Spotted by Stefan Dösinger. --- dlls/ntdll/unix/signal_arm.c | 3 ++- dlls/ntdll/unix/signal_arm64.c | 3 ++- dlls/ntdll/unix/signal_i386.c | 6 ++++-- dlls/ntdll/unix/signal_x86_64.c | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index c8edf22b170..73843ba56a6 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -1261,7 +1261,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "5:\tmovw r0, #0x000d\n\t" /* STATUS_INVALID_PARAMETER */ "movt r0, #0xc000\n\t" "add sp, sp, #0x10\n\t" - "b 4b\n" + "b 4b\n\t" + ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" "mov r8, r0\n\t" "mov r0, r1\n\t" diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 45cb3d1bf13..10543322a8f 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -1382,7 +1382,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "ret x16\n" "4:\tmov x0, #0xc0000000\n\t" /* STATUS_INVALID_PARAMETER */ "movk x0, #0x000d\n\t" - "b 3b\n" + "b 3b\n\t" + ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" "mov sp, x0\n\t" "mov x0, x1\n\t" diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 7be0c39c424..5ddef2701c4 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2498,7 +2498,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movw $0,0x02(%ecx)\n\t" /* frame->restore_flags */ "popl 0x08(%ecx)\n\t" /* frame->eip */ "pushfl\n\t" - "popl 0x04(%ecx)\n" /* frame->eflags */ + "popl 0x04(%ecx)\n\t" /* frame->eflags */ + ".globl " __ASM_NAME("__wine_syscall_dispatcher_prolog_end") "\n" __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t" "movl %esp,0x0c(%ecx)\n\t" /* frame->esp */ "movw %cs,0x10(%ecx)\n\t" @@ -2611,7 +2612,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "popl %ds\n\t" "iret\n" "6:\tmovl $0xc000000d,%eax\n\t" /* STATUS_INVALID_PARAMETER */ - "jmp 5b\n" + "jmp 5b\n\t" + ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" "movl 8(%esp),%eax\n\t" "movl 4(%esp),%esp\n\t" diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 54353e50e3d..bb7c9ab712e 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -3295,6 +3295,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "pushfq\n\t" "popq 0x80(%rcx)\n\t" "movl $0,0x94(%rcx)\n\t" /* frame->restore_flags */ + ".globl " __ASM_NAME("__wine_syscall_dispatcher_prolog_end") "\n" __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t" "movq %rax,0x00(%rcx)\n\t" "movq %rbx,0x08(%rcx)\n\t" @@ -3424,7 +3425,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movq 0x10(%rcx),%rcx\n" "iretq\n" "5:\tmovl $0xc000000d,%edx\n\t" /* STATUS_INVALID_PARAMETER */ - "movq %rsp,%rcx\n" + "movq %rsp,%rcx\n\t" + ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" "movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */ "movq %rdx,%rax\n\t"
1
0
0
0
Jacek Caban : imm32: Use default IME window WM_DESTROY to call imm_couninit_thread.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: 8f3e19a52f4cb373ef0225a1bcab4fb9ae06a851 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8f3e19a52f4cb373ef0225a1bcab4f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jul 8 14:20:52 2022 +0200 imm32: Use default IME window WM_DESTROY to call imm_couninit_thread. --- dlls/imm32/imm.c | 9 ++++++++- dlls/user32/tests/win.c | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index d290e580a23..42cf6a712f9 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -1028,7 +1028,6 @@ static HWND imm_detach_default_window(IMMThreadData *thread_data) to_destroy = thread_data->hwndDefault; thread_data->hwndDefault = NULL; thread_data->windowRefs = 0; - imm_couninit_thread(TRUE); return to_destroy; } @@ -3470,6 +3469,14 @@ LRESULT WINAPI __wine_ime_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp init_messages(); return TRUE; + case WM_DESTROY: + { + HWND default_hwnd = ImmGetDefaultIMEWnd(0); + if (!default_hwnd || hwnd == default_hwnd) + imm_couninit_thread(TRUE); + } + return TRUE; + case WM_IME_INTERNAL: return ime_internal_msg(wparam, lparam); } diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 3727efb1b41..4c2af09d0c6 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -3760,7 +3760,6 @@ static void test_SetActiveWindow_0_proc( char **argv ) else /* < Win10 */ { ok( tmp == hwnd, "SetActiveWindow returned %p\n", tmp ); - todo_wine ok( GetLastError() == 0, "got error %lu\n", GetLastError() ); tmp = GetForegroundWindow();
1
0
0
0
Jacek Caban : imm32: Use a separated struct for COM initialization spy.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: d7d9344003edf5599a5190ada049461a2acca808 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d7d9344003edf5599a5190ada04946…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jul 8 13:54:34 2022 +0200 imm32: Use a separated struct for COM initialization spy. --- dlls/imm32/imm.c | 149 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 86 insertions(+), 63 deletions(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index be4ff25a3f9..d290e580a23 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -107,8 +107,13 @@ typedef struct _tagIMMThreadData { HWND hwndDefault; BOOL disableIME; DWORD windowRefs; +} IMMThreadData; + +struct coinit_spy +{ IInitializeSpy IInitializeSpy_iface; - ULARGE_INTEGER spy_cookie; + LONG ref; + ULARGE_INTEGER cookie; enum { IMM_APT_INIT = 0x1, @@ -116,7 +121,9 @@ typedef struct _tagIMMThreadData { IMM_APT_CAN_FREE = 0x4, IMM_APT_BROKEN = 0x8 } apt_flags; -} IMMThreadData; +}; + +static LONG spy_tls = TLS_OUT_OF_INDEXES; static struct list ImmHklList = LIST_INIT(ImmHklList); static struct list ImmThreadDataList = LIST_INIT(ImmThreadDataList); @@ -249,62 +256,38 @@ static DWORD convert_candidatelist_AtoW( return ret; } -static void imm_coinit_thread(IMMThreadData *thread_data) +static void imm_couninit_thread(BOOL cleanup) { - HRESULT hr; - - TRACE("implicit COM initialization\n"); - - if (thread_data->threadID != GetCurrentThreadId()) - return; - - if (thread_data->apt_flags & (IMM_APT_INIT | IMM_APT_BROKEN)) - return; - thread_data->apt_flags |= IMM_APT_INIT; + struct coinit_spy *spy; - if(!thread_data->spy_cookie.QuadPart) - { - hr = CoRegisterInitializeSpy(&thread_data->IInitializeSpy_iface, - &thread_data->spy_cookie); - if (FAILED(hr)) - return; - } - - hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - if (SUCCEEDED(hr)) - thread_data->apt_flags |= IMM_APT_CREATED; -} - -static void imm_couninit_thread(IMMThreadData *thread_data, BOOL cleanup) -{ TRACE("implicit COM deinitialization\n"); - if (thread_data->apt_flags & IMM_APT_BROKEN) + if (!(spy = TlsGetValue(spy_tls)) || (spy->apt_flags & IMM_APT_BROKEN)) return; - if (cleanup && thread_data->spy_cookie.QuadPart) + if (cleanup && spy->cookie.QuadPart) { - CoRevokeInitializeSpy(thread_data->spy_cookie); - thread_data->spy_cookie.QuadPart = 0; + CoRevokeInitializeSpy(spy->cookie); + spy->cookie.QuadPart = 0; } - if (!(thread_data->apt_flags & IMM_APT_INIT)) + if (!(spy->apt_flags & IMM_APT_INIT)) return; - thread_data->apt_flags &= ~IMM_APT_INIT; + spy->apt_flags &= ~IMM_APT_INIT; - if (thread_data->apt_flags & IMM_APT_CREATED) + if (spy->apt_flags & IMM_APT_CREATED) { - thread_data->apt_flags &= ~IMM_APT_CREATED; - if (thread_data->apt_flags & IMM_APT_CAN_FREE) + spy->apt_flags &= ~IMM_APT_CREATED; + if (spy->apt_flags & IMM_APT_CAN_FREE) CoUninitialize(); } if (cleanup) - thread_data->apt_flags = 0; + spy->apt_flags = 0; } -static inline IMMThreadData *impl_from_IInitializeSpy(IInitializeSpy *iface) +static inline struct coinit_spy *impl_from_IInitializeSpy(IInitializeSpy *iface) { - return CONTAINING_RECORD(iface, IMMThreadData, IInitializeSpy_iface); + return CONTAINING_RECORD(iface, struct coinit_spy, IInitializeSpy_iface); } static HRESULT WINAPI InitializeSpy_QueryInterface(IInitializeSpy *iface, REFIID riid, void **obj) @@ -323,24 +306,28 @@ static HRESULT WINAPI InitializeSpy_QueryInterface(IInitializeSpy *iface, REFIID static ULONG WINAPI InitializeSpy_AddRef(IInitializeSpy *iface) { - return 2; + struct coinit_spy *spy = impl_from_IInitializeSpy(iface); + return InterlockedIncrement(&spy->ref); } static ULONG WINAPI InitializeSpy_Release(IInitializeSpy *iface) { - return 1; + struct coinit_spy *spy = impl_from_IInitializeSpy(iface); + LONG ref = InterlockedDecrement(&spy->ref); + if (!ref) HeapFree(GetProcessHeap(), 0, spy); + return ref; } static HRESULT WINAPI InitializeSpy_PreInitialize(IInitializeSpy *iface, DWORD coinit, DWORD refs) { - IMMThreadData *thread_data = impl_from_IInitializeSpy(iface); + struct coinit_spy *spy = impl_from_IInitializeSpy(iface); - if ((thread_data->apt_flags & IMM_APT_CREATED) && + if ((spy->apt_flags & IMM_APT_CREATED) && !(coinit & COINIT_APARTMENTTHREADED) && refs == 1) { - imm_couninit_thread(thread_data, TRUE); - thread_data->apt_flags |= IMM_APT_BROKEN; + imm_couninit_thread(TRUE); + spy->apt_flags |= IMM_APT_BROKEN; } return S_OK; } @@ -348,12 +335,12 @@ static HRESULT WINAPI InitializeSpy_PreInitialize(IInitializeSpy *iface, static HRESULT WINAPI InitializeSpy_PostInitialize(IInitializeSpy *iface, HRESULT hr, DWORD coinit, DWORD refs) { - IMMThreadData *thread_data = impl_from_IInitializeSpy(iface); + struct coinit_spy *spy = impl_from_IInitializeSpy(iface); - if ((thread_data->apt_flags & IMM_APT_CREATED) && hr == S_FALSE && refs == 2) + if ((spy->apt_flags & IMM_APT_CREATED) && hr == S_FALSE && refs == 2) hr = S_OK; if (SUCCEEDED(hr)) - thread_data->apt_flags |= IMM_APT_CAN_FREE; + spy->apt_flags |= IMM_APT_CAN_FREE; return hr; } @@ -364,12 +351,14 @@ static HRESULT WINAPI InitializeSpy_PreUninitialize(IInitializeSpy *iface, DWORD static HRESULT WINAPI InitializeSpy_PostUninitialize(IInitializeSpy *iface, DWORD refs) { - IMMThreadData *thread_data = impl_from_IInitializeSpy(iface); + struct coinit_spy *spy = impl_from_IInitializeSpy(iface); + + TRACE("%lu %p\n", refs, ImmGetDefaultIMEWnd(0)); - if (refs == 1 && !thread_data->windowRefs) - imm_couninit_thread(thread_data, FALSE); + if (refs == 1 && !ImmGetDefaultIMEWnd(0)) + imm_couninit_thread(FALSE); else if (!refs) - thread_data->apt_flags &= ~IMM_APT_CAN_FREE; + spy->apt_flags &= ~IMM_APT_CAN_FREE; return S_OK; } @@ -384,6 +373,45 @@ static const IInitializeSpyVtbl InitializeSpyVtbl = InitializeSpy_PostUninitialize, }; +static void imm_coinit_thread(void) +{ + struct coinit_spy *spy; + HRESULT hr; + + TRACE("implicit COM initialization\n"); + + if (spy_tls == TLS_OUT_OF_INDEXES) + { + DWORD tls = TlsAlloc(); + if (tls == TLS_OUT_OF_INDEXES) return; + if (InterlockedCompareExchange(&spy_tls, tls, TLS_OUT_OF_INDEXES)) TlsFree(tls); + } + if (!(spy = TlsGetValue(spy_tls))) + { + if (!(spy = HeapAlloc(GetProcessHeap(), 0, sizeof(*spy)))) return; + spy->IInitializeSpy_iface.lpVtbl = &InitializeSpyVtbl; + spy->ref = 1; + spy->cookie.QuadPart = 0; + spy->apt_flags = 0; + TlsSetValue(spy_tls, spy); + } + + if (spy->apt_flags & (IMM_APT_INIT | IMM_APT_BROKEN)) + return; + spy->apt_flags |= IMM_APT_INIT; + + if(!spy->cookie.QuadPart) + { + hr = CoRegisterInitializeSpy(&spy->IInitializeSpy_iface, &spy->cookie); + if (FAILED(hr)) + return; + } + + hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + if (SUCCEEDED(hr)) + spy->apt_flags |= IMM_APT_CREATED; +} + static IMMThreadData *IMM_GetThreadData(HWND hwnd, DWORD thread) { IMMThreadData *data; @@ -410,7 +438,6 @@ static IMMThreadData *IMM_GetThreadData(HWND hwnd, DWORD thread) if (data->threadID == thread) return data; data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data)); - data->IInitializeSpy_iface.lpVtbl = &InitializeSpyVtbl; data->threadID = thread; list_add_head(&ImmThreadDataList,&data->entry); TRACE("Thread Data Created (%lx)\n",thread); @@ -429,6 +456,7 @@ static BOOL IMM_IsDefaultContext(HIMC imc) static void IMM_FreeThreadData(void) { + struct coinit_spy *spy; IMMThreadData *data; EnterCriticalSection(&threaddata_cs); @@ -439,13 +467,14 @@ static void IMM_FreeThreadData(void) list_remove(&data->entry); LeaveCriticalSection(&threaddata_cs); IMM_DestroyContext(data->defaultContext); - imm_couninit_thread(data, TRUE); HeapFree(GetProcessHeap(),0,data); TRACE("Thread Data Destroyed\n"); return; } } LeaveCriticalSection(&threaddata_cs); + + if ((spy = TlsGetValue(spy_tls))) IInitializeSpy_Release(&spy->IInitializeSpy_iface); } static HMODULE load_graphics_driver(void) @@ -704,19 +733,13 @@ static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC) BOOL WINAPI ImmSetActiveContext(HWND hwnd, HIMC himc, BOOL activate) { InputContextData *data = get_imc_data(himc); - IMMThreadData *thread_data; TRACE("(%p, %p, %x)\n", hwnd, himc, activate); if (himc && !data && activate) return FALSE; - thread_data = IMM_GetThreadData(hwnd, 0); - if (thread_data) - { - imm_coinit_thread(thread_data); - LeaveCriticalSection(&threaddata_cs); - } + imm_coinit_thread(); if (data) { @@ -1002,10 +1025,10 @@ static HWND imm_detach_default_window(IMMThreadData *thread_data) { HWND to_destroy; - imm_couninit_thread(thread_data, TRUE); to_destroy = thread_data->hwndDefault; thread_data->hwndDefault = NULL; thread_data->windowRefs = 0; + imm_couninit_thread(TRUE); return to_destroy; }
1
0
0
0
Jacek Caban : imm32: Move default IMM window proc implementation from user32.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: 7babf7578927cd70941a3692552e945272c284a7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7babf7578927cd70941a3692552e94…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jul 8 00:43:21 2022 +0200 imm32: Move default IMM window proc implementation from user32. --- dlls/imm32/imm.c | 117 +++++++++++++++++++++++++++++++++++++++++-- dlls/imm32/imm32.spec | 2 +- dlls/user32/misc.c | 112 +++-------------------------------------- dlls/win32u/ntuser_private.h | 4 -- include/ntuser.h | 5 ++ 5 files changed, 126 insertions(+), 114 deletions(-)
1
0
0
0
Jacek Caban : imm32: Use win32u to manage input context handles.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: f6ddd4ca86672fe2739ea7d17015112bce677e21 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f6ddd4ca86672fe2739ea7d1701511…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jul 11 13:26:46 2022 +0200 imm32: Use win32u to manage input context handles. --- dlls/imm32/Makefile.in | 2 +- dlls/imm32/imm.c | 55 ++++++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/dlls/imm32/Makefile.in b/dlls/imm32/Makefile.in index 214b2b753d4..29de6063792 100644 --- a/dlls/imm32/Makefile.in +++ b/dlls/imm32/Makefile.in @@ -1,6 +1,6 @@ MODULE = imm32.dll IMPORTLIB = imm32 -IMPORTS = user32 gdi32 advapi32 +IMPORTS = user32 gdi32 advapi32 win32u DELAYIMPORTS = ole32 C_SRCS = \ diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index bcb02b82c83..e27c658b930 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -29,7 +29,7 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" -#include "winuser.h" +#include "ntuser.h" #include "winerror.h" #include "wine/debug.h" #include "imm.h" @@ -73,6 +73,7 @@ typedef struct _tagImmHkl{ typedef struct tagInputContextData { + HIMC handle; DWORD dwLock; INPUTCONTEXT IMC; DWORD threadID; @@ -80,7 +81,6 @@ typedef struct tagInputContextData ImmHkl *immKbd; UINT lastVK; BOOL threadDefault; - DWORD magic; } InputContextData; #define WINE_IMC_VALID_MAGIC 0x56434D49 @@ -628,19 +628,13 @@ static HIMCC ImmCreateBlankCompStr(void) return rc; } -static InputContextData* get_imc_data(HIMC hIMC) +static InputContextData *get_imc_data(HIMC handle) { - InputContextData *data = hIMC; + InputContextData *ret; - if (hIMC == NULL) - return NULL; - - if(IsBadReadPtr(data, sizeof(InputContextData)) || data->magic != WINE_IMC_VALID_MAGIC) - { - SetLastError(ERROR_INVALID_HANDLE); - return NULL; - } - return data; + if (!handle) return NULL; + ret = (void *)NtUserQueryInputContext( handle, NtUserInputContextClientPtr ); + return ret && ret->handle == handle ? ret : NULL; } static HIMC get_default_context( HWND hwnd ) @@ -668,7 +662,7 @@ static HIMC get_default_context( HWND hwnd ) ret = ImmCreateContext(); if (!ret) return 0; - ((InputContextData*)ret)->threadDefault = TRUE; + get_imc_data(ret)->threadDefault = TRUE; /* thread_data is in the current thread so we can assume it's still valid */ EnterCriticalSection(&threaddata_cs); @@ -903,16 +897,24 @@ HIMC WINAPI ImmCreateContext(void) InputContextData *new_context; LPGUIDELINE gl; LPCANDIDATEINFO ci; + HIMC handle; int i; new_context = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(InputContextData)); + if (!(handle = NtUserCreateInputContext((UINT_PTR)new_context))) + { + HeapFree(GetProcessHeap(),0,new_context); + return 0; + } + /* Load the IME */ new_context->immKbd = IMM_GetImmHkl(GetKeyboardLayout(0)); if (!new_context->immKbd->hIME) { TRACE("IME dll could not be loaded\n"); + NtUserDestroyInputContext(handle); HeapFree(GetProcessHeap(),0,new_context); return 0; } @@ -940,9 +942,10 @@ HIMC WINAPI ImmCreateContext(void) new_context->IMC.fdwConversion = new_context->immKbd->imeInfo.fdwConversionCaps; new_context->IMC.fdwSentence = new_context->immKbd->imeInfo.fdwSentenceCaps; - if (!new_context->immKbd->pImeSelect(new_context, TRUE)) + if (!new_context->immKbd->pImeSelect(handle, TRUE)) { TRACE("Selection of IME failed\n"); + NtUserDestroyInputContext(handle); IMM_DestroyContext(new_context); return 0; } @@ -952,8 +955,7 @@ HIMC WINAPI ImmCreateContext(void) new_context->immKbd->uSelected++; TRACE("Created context %p\n",new_context); - new_context->magic = WINE_IMC_VALID_MAGIC; - return new_context; + return new_context->handle = handle; } static BOOL IMM_DestroyContext(HIMC hIMC) @@ -975,7 +977,7 @@ static BOOL IMM_DestroyContext(HIMC hIMC) ImmDestroyIMCC(data->IMC.hPrivate); ImmDestroyIMCC(data->IMC.hMsgBuf); - data->magic = 0; + NtUserDestroyInputContext(data->handle); HeapFree(GetProcessHeap(),0,data); return TRUE; @@ -1730,8 +1732,9 @@ HIMC WINAPI ImmGetContext(HWND hWnd) if (rc) { - InputContextData *data = rc; - data->IMC.hWnd = hWnd; + InputContextData *data = get_imc_data(rc); + if (data) data->IMC.hWnd = hWnd; + else rc = 0; } TRACE("returning %p\n", rc); @@ -2218,7 +2221,7 @@ BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos) UINT WINAPI ImmGetVirtualKey(HWND hWnd) { OSVERSIONINFOA version; - InputContextData *data = ImmGetContext( hWnd ); + InputContextData *data = get_imc_data( ImmGetContext( hWnd )); TRACE("%p\n", hWnd); if ( data ) @@ -3233,10 +3236,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD TRACE("%p %x %x %x\n",hwnd, msg, (UINT)wParam, (UINT)lKeyData); - if (imc) - data = imc; - else - return FALSE; + if (!(data = get_imc_data( imc ))) return FALSE; if (!data->immKbd->hIME || !data->immKbd->pImeToAsciiEx || data->lastVK == VK_PROCESSKEY) return FALSE; @@ -3292,10 +3292,7 @@ BOOL WINAPI ImmProcessKey(HWND hwnd, HKL hKL, UINT vKey, LPARAM lKeyData, DWORD TRACE("%p %p %x %x %lx\n",hwnd, hKL, vKey, (UINT)lKeyData, unknown); - if (imc) - data = imc; - else - return FALSE; + if (!(data = get_imc_data( imc ))) return FALSE; /* Make sure we are inputting to the correct keyboard */ if (data->immKbd->hkl != hKL)
1
0
0
0
Jacek Caban : win32u: Implement input context object.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: d9fc5b3f967f1c5126278565beb6b967f9d6d80a URL:
https://gitlab.winehq.org/wine/wine/-/commit/d9fc5b3f967f1c5126278565beb6b9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 6 22:06:03 2022 +0200 win32u: Implement input context object. --- dlls/win32u/Makefile.in | 1 + dlls/win32u/imm.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 4 ++ dlls/win32u/win32u.spec | 8 +-- dlls/wow64win/syscall.h | 4 ++ dlls/wow64win/user.c | 31 ++++++++++ include/ntuser.h | 13 +++++ 7 files changed, 205 insertions(+), 4 deletions(-)
1
0
0
0
Jacek Caban : wow64win: Sort user syscall thunks.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: 87a5c1bda526259ce03b16babef3274b39f7c727 URL:
https://gitlab.winehq.org/wine/wine/-/commit/87a5c1bda526259ce03b16babef327…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jul 9 17:13:06 2022 +0200 wow64win: Sort user syscall thunks. --- dlls/wow64win/user.c | 1238 +++++++++++++++++++++++++------------------------- 1 file changed, 619 insertions(+), 619 deletions(-)
1
0
0
0
Paul Gofman : crypt32: Support MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG.
by Alexandre Julliard
11 Jul '22
11 Jul '22
Module: wine Branch: master Commit: 5f3cd85361274cf868928c77389c208cb33ef90c URL:
https://gitlab.winehq.org/wine/wine/-/commit/5f3cd85361274cf868928c77389c20…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Jul 8 11:49:54 2022 -0500 crypt32: Support MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/crypt32/chain.c | 63 +++++++++++++++++++++++++++++++++++++++++++--- dlls/crypt32/tests/chain.c | 15 +++++++++++ include/wincrypt.h | 1 + 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index cf244f2ac6c..4a60e9a60ff 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -3696,6 +3696,44 @@ static BYTE msPubKey4[] = { 0xa6,0xc6,0x48,0x4c,0xc3,0x37,0x51,0x23,0xd3,0x27,0xd7,0xb8,0x4e,0x70,0x96, 0xf0,0xa1,0x44,0x76,0xaf,0x78,0xcf,0x9a,0xe1,0x66,0x13,0x02,0x03,0x01,0x00, 0x01 }; +/* from Microsoft Root Certificate Authority 2011 */ +static BYTE msPubKey5[] = { +0x30,0x82,0x02,0x0a,0x02,0x82,0x02,0x01,0x00,0xb2,0x80,0x41,0xaa,0x35,0x38, +0x4d,0x13,0x72,0x32,0x68,0x22,0x4d,0xb8,0xb2,0xf1,0xff,0xd5,0x52,0xbc,0x6c, +0xc7,0xf5,0xd2,0x4a,0x8c,0x36,0xee,0xd1,0xc2,0x5c,0x7e,0x8c,0x8a,0xae,0xaf, +0x13,0x28,0x6f,0xc0,0x73,0xe3,0x3a,0xce,0xd0,0x25,0xa8,0x5a,0x3a,0x6d,0xef, +0xa8,0xb8,0x59,0xab,0x13,0x23,0x68,0xcd,0x0c,0x29,0x87,0xd1,0x6f,0x80,0x5c, +0x8f,0x44,0x7f,0x5d,0x90,0x01,0x52,0x58,0xac,0x51,0xc5,0x5f,0x2a,0x87,0xdc, +0xdc,0xd8,0x0a,0x1d,0xc1,0x03,0xb9,0x7b,0xb0,0x56,0xe8,0xa3,0xde,0x64,0x61, +0xc2,0x9e,0xf8,0xf3,0x7c,0xb9,0xec,0x0d,0xb5,0x54,0xfe,0x4c,0xb6,0x65,0x4f, +0x88,0xf0,0x9c,0x48,0x99,0x0c,0x42,0x0b,0x09,0x7c,0x31,0x59,0x17,0x79,0x06, +0x78,0x28,0x8d,0x89,0x3a,0x4c,0x03,0x25,0xbe,0x71,0x6a,0x5c,0x0b,0xe7,0x84, +0x60,0xa4,0x99,0x22,0xe3,0xd2,0xaf,0x84,0xa4,0xa7,0xfb,0xd1,0x98,0xed,0x0c, +0xa9,0xde,0x94,0x89,0xe1,0x0e,0xa0,0xdc,0xc0,0xce,0x99,0x3d,0xea,0x08,0x52, +0xbb,0x56,0x79,0xe4,0x1f,0x84,0xba,0x1e,0xb8,0xb4,0xc4,0x49,0x5c,0x4f,0x31, +0x4b,0x87,0xdd,0xdd,0x05,0x67,0x26,0x99,0x80,0xe0,0x71,0x11,0xa3,0xb8,0xa5, +0x41,0xe2,0xa4,0x53,0xb9,0xf7,0x32,0x29,0x83,0x0c,0x13,0xbf,0x36,0x5e,0x04, +0xb3,0x4b,0x43,0x47,0x2f,0x6b,0xe2,0x91,0x1e,0xd3,0x98,0x4f,0xdd,0x42,0x07, +0xc8,0xe8,0x1d,0x12,0xfc,0x99,0xa9,0x6b,0x3e,0x92,0x7e,0xc8,0xd6,0x69,0x3a, +0xfc,0x64,0xbd,0xb6,0x09,0x9d,0xca,0xfd,0x0c,0x0b,0xa2,0x9b,0x77,0x60,0x4b, +0x03,0x94,0xa4,0x30,0x69,0x12,0xd6,0x42,0x2d,0xc1,0x41,0x4c,0xca,0xdc,0xaa, +0xfd,0x8f,0x5b,0x83,0x46,0x9a,0xd9,0xfc,0xb1,0xd1,0xe3,0xb3,0xc9,0x7f,0x48, +0x7a,0xcd,0x24,0xf0,0x41,0x8f,0x5c,0x74,0xd0,0xac,0xb0,0x10,0x20,0x06,0x49, +0xb7,0xc7,0x2d,0x21,0xc8,0x57,0xe3,0xd0,0x86,0xf3,0x03,0x68,0xfb,0xd0,0xce, +0x71,0xc1,0x89,0x99,0x4a,0x64,0x01,0x6c,0xfd,0xec,0x30,0x91,0xcf,0x41,0x3c, +0x92,0xc7,0xe5,0xba,0x86,0x1d,0x61,0x84,0xc7,0x5f,0x83,0x39,0x62,0xae,0xb4, +0x92,0x2f,0x47,0xf3,0x0b,0xf8,0x55,0xeb,0xa0,0x1f,0x59,0xd0,0xbb,0x74,0x9b, +0x1e,0xd0,0x76,0xe6,0xf2,0xe9,0x06,0xd7,0x10,0xe8,0xfa,0x64,0xde,0x69,0xc6, +0x35,0x96,0x88,0x02,0xf0,0x46,0xb8,0x3f,0x27,0x99,0x6f,0xcb,0x71,0x89,0x29, +0x35,0xf7,0x48,0x16,0x02,0x35,0x8f,0xd5,0x79,0x7c,0x4d,0x02,0xcf,0x5f,0xeb, +0x8a,0x83,0x4f,0x45,0x71,0x88,0xf9,0xa9,0x0d,0x4e,0x72,0xe9,0xc2,0x9c,0x07, +0xcf,0x49,0x1b,0x4e,0x04,0x0e,0x63,0x51,0x8c,0x5e,0xd8,0x00,0xc1,0x55,0x2c, +0xb6,0xc6,0xe0,0xc2,0x65,0x4e,0xc9,0x34,0x39,0xf5,0x9c,0xb3,0xc4,0x7e,0xe8, +0x61,0x6e,0x13,0x5f,0x15,0xc4,0x5f,0xd9,0x7e,0xed,0x1d,0xce,0xee,0x44,0xec, +0xcb,0x2e,0x86,0xb1,0xec,0x38,0xf6,0x70,0xed,0xab,0x5c,0x13,0xc1,0xd9,0x0f, +0x0d,0xc7,0x80,0xb2,0x55,0xed,0x34,0xf7,0xac,0x9b,0xe4,0xc3,0xda,0xe7,0x47, +0x3c,0xa6,0xb5,0x8f,0x31,0xdf,0xc5,0x4b,0xaf,0xeb,0xf1,0x02,0x03,0x01,0x00, +0x01 }; static BOOL WINAPI verify_ms_root_policy(LPCSTR szPolicyOID, PCCERT_CHAIN_CONTEXT pChainContext, PCERT_CHAIN_POLICY_PARA pPolicyPara, @@ -3705,21 +3743,38 @@ static BOOL WINAPI verify_ms_root_policy(LPCSTR szPolicyOID, CERT_PUBLIC_KEY_INFO msPubKey = { { 0 } }; DWORD i; - CRYPT_DATA_BLOB keyBlobs[] = { + static const CRYPT_DATA_BLOB keyBlobs[] = { { sizeof(msPubKey1), msPubKey1 }, { sizeof(msPubKey2), msPubKey2 }, { sizeof(msPubKey3), msPubKey3 }, { sizeof(msPubKey4), msPubKey4 }, }; + static const CRYPT_DATA_BLOB keyBlobs_approot[] = { + { sizeof(msPubKey5), msPubKey5 }, + }; PCERT_SIMPLE_CHAIN rootChain = pChainContext->rgpChain[pChainContext->cChain - 1]; PCCERT_CONTEXT root = rootChain->rgpElement[rootChain->cElement - 1]->pCertContext; - for (i = 0; !isMSRoot && i < ARRAY_SIZE(keyBlobs); i++) + const CRYPT_DATA_BLOB *keys; + unsigned int key_count; + + if (pPolicyPara && pPolicyPara->dwFlags & MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG) + { + keys = keyBlobs_approot; + key_count = ARRAY_SIZE(keyBlobs_approot); + } + else + { + keys = keyBlobs; + key_count = ARRAY_SIZE(keyBlobs); + } + + for (i = 0; !isMSRoot && i < key_count; i++) { - msPubKey.PublicKey.cbData = keyBlobs[i].cbData; - msPubKey.PublicKey.pbData = keyBlobs[i].pbData; + msPubKey.PublicKey.cbData = keys[i].cbData; + msPubKey.PublicKey.pbData = keys[i].pbData; if (CertComparePublicKeyInfo(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &root->pCertInfo->SubjectPublicKeyInfo, &msPubKey)) isMSRoot = TRUE; } diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 9ed1b28bf70..32f00801799 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -4958,6 +4958,13 @@ static const ChainPolicyCheck msRootPolicyCheck[] = { { 0, CERT_E_UNTRUSTEDROOT, 0, 0, NULL }, NULL, 0 }, }; +static const ChainPolicyCheck msRootPolicyCheck_approot[] = { + { { ARRAY_SIZE(chain32), chain32 }, + { 0, CERT_E_UNTRUSTEDROOT, 0, 2, NULL }, NULL, TODO_ELEMENTS }, + { { ARRAY_SIZE(chain33), chain33 }, + { 0, 0, 0, 0, NULL }, NULL, 0 }, +}; + static const char *num_to_str(WORD num) { static char buf[6]; @@ -5295,8 +5302,16 @@ static void check_ssl_policy(void) static void check_msroot_policy(void) { + CERT_CHAIN_POLICY_PARA para; + CHECK_CHAIN_POLICY_STATUS_ARRAY(CERT_CHAIN_POLICY_MICROSOFT_ROOT, NULL, msRootPolicyCheck, &may2020, NULL); + + para.cbSize = sizeof(para); + para.pvExtraPolicyPara = NULL; + para.dwFlags = MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG; + CHECK_CHAIN_POLICY_STATUS_ARRAY(CERT_CHAIN_POLICY_MICROSOFT_ROOT, NULL, + msRootPolicyCheck_approot, &may2020, ¶); } static void testVerifyCertChainPolicy(void) diff --git a/include/wincrypt.h b/include/wincrypt.h index 59a8d6650bb..04b57e70dbd 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -1086,6 +1086,7 @@ typedef struct _CERT_CHAIN_POLICY_STATUS { #define CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG 0x00004000 #define CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG 0x00008000 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000 +#define MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG 0x00020000 typedef struct _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA { DWORD cbSize;
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
64
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
Results per page:
10
25
50
100
200