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 2009
----- 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
3 participants
1207 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Use context->valid in context_destroy_gl_resources ().
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: e3ca576576c46131330353f45990f55045cf7541 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e3ca576576c46131330353f45…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Oct 20 11:05:05 2009 +0200 wined3d: Use context->valid in context_destroy_gl_resources(). Instead of relying on wglMakeCurrent() to do what we want. --- dlls/wined3d/context.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 16304ee..a96dea4 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -633,22 +633,19 @@ static void context_destroy_gl_resources(struct wined3d_context *context) struct wined3d_occlusion_query *occlusion_query; struct wined3d_event_query *event_query; struct fbo_entry *entry, *entry2; - BOOL has_glctx; - - has_glctx = pwglMakeCurrent(context->hdc, context->glCtx); - if (!has_glctx) WARN("Failed to activate context. Window already destroyed?\n"); ENTER_GL(); LIST_FOR_EACH_ENTRY(occlusion_query, &context->occlusion_queries, struct wined3d_occlusion_query, entry) { - if (has_glctx && GL_SUPPORT(ARB_OCCLUSION_QUERY)) GL_EXTCALL(glDeleteQueriesARB(1, &occlusion_query->id)); + if (context->valid && GL_SUPPORT(ARB_OCCLUSION_QUERY)) + GL_EXTCALL(glDeleteQueriesARB(1, &occlusion_query->id)); occlusion_query->context = NULL; } LIST_FOR_EACH_ENTRY(event_query, &context->event_queries, struct wined3d_event_query, entry) { - if (has_glctx) + if (context->valid) { if (GL_SUPPORT(APPLE_FENCE)) GL_EXTCALL(glDeleteFencesAPPLE(1, &event_query->id)); else if (GL_SUPPORT(NV_FENCE)) GL_EXTCALL(glDeleteFencesNV(1, &event_query->id)); @@ -656,11 +653,13 @@ static void context_destroy_gl_resources(struct wined3d_context *context) event_query->context = NULL; } - LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &context->fbo_list, struct fbo_entry, entry) { - if (!has_glctx) entry->id = 0; + LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &context->fbo_list, struct fbo_entry, entry) + { + if (!context->valid) entry->id = 0; context_destroy_fbo_entry(context, entry); } - if (has_glctx) + + if (context->valid) { if (context->src_fbo) {
1
0
0
0
Henri Verbeet : wined3d: Validate the D3D context in FindContext().
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 43aaaa8a4b1b92976e466c63eab1cd1c6e9c0134 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43aaaa8a4b1b92976e466c63e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Oct 20 11:05:04 2009 +0200 wined3d: Validate the D3D context in FindContext(). Apparently it's valid to use a D3D device after its window is destroyed. OpenGL isn't always so forgiving, so this patch is a first step to avoid making GL calls on a context without window. --- dlls/wined3d/context.c | 17 +++++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 701e024..16304ee 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -782,6 +782,18 @@ BOOL context_set_current(struct wined3d_context *ctx) return TlsSetValue(wined3d_context_tls_idx, ctx); } +static void context_validate(struct wined3d_context *context) +{ + HWND wnd = WindowFromDC(context->hdc); + + if (wnd != context->win_handle) + { + WARN("DC %p belongs to window %p instead of %p.\n", + context->hdc, wnd, context->win_handle); + context->valid = 0; + } +} + /***************************************************************************** * Context_MarkStateDirty * @@ -1247,6 +1259,7 @@ struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceI } goto out; } + ret->valid = 1; ret->gl_info = &This->adapter->gl_info; ret->surface = (IWineD3DSurface *) target; ret->current_rt = (IWineD3DSurface *)target; @@ -1771,6 +1784,7 @@ static inline struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWin if (current_context && current_context->current_rt == target) { + context_validate(current_context); return current_context; } @@ -1858,6 +1872,8 @@ retry: context->render_offscreen = TRUE; } + context_validate(context); + if (context->render_offscreen != old_render_offscreen) { Context_MarkStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION), StateTable); @@ -2007,6 +2023,7 @@ struct wined3d_context *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurfac TRACE("(%p): Selecting context for render target %p, thread %d\n", This, target, tid); context = FindContext(This, target, tid); + if (!context->valid) return context; gl_info = context->gl_info; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4b6cb4c..9c4bd5e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1055,6 +1055,7 @@ struct wined3d_context WORD num_untracked_materials : 2; /* Max value 2 */ WORD current : 1; WORD destroyed : 1; + WORD valid : 1; BYTE texShaderBumpMap; /* MAX_TEXTURES, 8 */ BYTE lastWasPow2Texture; /* MAX_TEXTURES, 8 */ DWORD numbered_array_mask;
1
0
0
0
Henri Verbeet : wined3d: Get rid of the useless "isPBuffer" bitfield in struct wined3d_context.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 0cb6f28751b106833ed8fa9ac50e21bc825f7289 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0cb6f28751b106833ed8fa9ac…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Oct 20 11:05:03 2009 +0200 wined3d: Get rid of the useless "isPBuffer" bitfield in struct wined3d_context. --- dlls/wined3d/context.c | 3 +-- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index c6d6df8..701e024 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -698,7 +698,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context) ERR("Failed to disable GL context.\n"); } - if (context->isPBuffer) + if (context->pbuffer) { GL_EXTCALL(wglReleasePbufferDCARB(context->pbuffer, context->hdc)); GL_EXTCALL(wglDestroyPbufferARB(context->pbuffer)); @@ -1250,7 +1250,6 @@ struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceI ret->gl_info = &This->adapter->gl_info; ret->surface = (IWineD3DSurface *) target; ret->current_rt = (IWineD3DSurface *)target; - ret->isPBuffer = create_pbuffer; ret->tid = GetCurrentThreadId(); if(This->shader_backend->shader_dirtifyable_constants((IWineD3DDevice *) This)) { /* Create the dirty constants array and initialize them to dirty */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c9097cf..4b6cb4c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1051,7 +1051,6 @@ struct wined3d_context WORD last_was_blit : 1; WORD last_was_ckey : 1; WORD fog_coord : 1; - WORD isPBuffer : 1; WORD fog_enabled : 1; WORD num_untracked_materials : 2; /* Max value 2 */ WORD current : 1;
1
0
0
0
Henri Verbeet : d3d9: Add traces.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 4dbf1c49007fc5ebcf79cff71a8512ac4182987a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4dbf1c49007fc5ebcf79cff71…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Oct 20 11:05:02 2009 +0200 d3d9: Add traces. --- dlls/d3d9/cubetexture.c | 65 +++++--- dlls/d3d9/device.c | 387 +++++++++++++++++++++++++++-------------- dlls/d3d9/directx.c | 104 ++++++++---- dlls/d3d9/indexbuffer.c | 45 ++++-- dlls/d3d9/pixelshader.c | 42 +++-- dlls/d3d9/query.c | 25 ++- dlls/d3d9/stateblock.c | 22 ++- dlls/d3d9/surface.c | 57 ++++-- dlls/d3d9/swapchain.c | 34 +++-- dlls/d3d9/texture.c | 64 +++++--- dlls/d3d9/vertexbuffer.c | 44 +++-- dlls/d3d9/vertexdeclaration.c | 14 +- dlls/d3d9/vertexshader.c | 41 +++-- dlls/d3d9/volume.c | 31 ++-- dlls/d3d9/volumetexture.c | 47 +++--- 15 files changed, 679 insertions(+), 343 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4dbf1c49007fc5ebcf79c…
1
0
0
0
Paul Vriens : comctl32/tests: Fix some test failures on older comctl32.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 41099b0ff7851d889cfea4b122c9e9e98f23d49b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41099b0ff7851d889cfea4b12…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Tue Oct 20 09:42:30 2009 +0200 comctl32/tests: Fix some test failures on older comctl32. --- dlls/comctl32/tests/tooltips.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 4014322..8ca3f7b 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -444,7 +444,9 @@ static void test_ttm_gettoolinfo(void) ti.lParam = 0xaaaaaaaa; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti); ok(r, "Getting tooltip info failed\n"); - ok(0xdeadbeef == ti.lParam, "Expected 0xdeadbeef, got %lx\n", ti.lParam); + ok(0xdeadbeef == ti.lParam || + broken(0xdeadbeef != ti.lParam), /* comctl32 < 5.81 */ + "Expected 0xdeadbeef, got %lx\n", ti.lParam); tiW.cbSize = TTTOOLINFOW_V2_SIZE; tiW.hwnd = NULL; @@ -452,18 +454,22 @@ static void test_ttm_gettoolinfo(void) tiW.lParam = 0xaaaaaaaa; r = SendMessageA(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&tiW); ok(r, "Getting tooltip info failed\n"); - ok(0xdeadbeef == tiW.lParam, "Expected 0xdeadbeef, got %lx\n", tiW.lParam); + ok(0xdeadbeef == tiW.lParam || + broken(0xdeadbeef != tiW.lParam), /* comctl32 < 5.81 */ + "Expected 0xdeadbeef, got %lx\n", tiW.lParam); ti.cbSize = TTTOOLINFOA_V2_SIZE; ti.uId = 0x1234ABCD; ti.lParam = 0xaaaaaaaa; - r = SendMessageA(hwnd, TTM_SETTOOLINFOA, 0, (LPARAM)&ti); + SendMessageA(hwnd, TTM_SETTOOLINFOA, 0, (LPARAM)&ti); ti.cbSize = TTTOOLINFOA_V2_SIZE; ti.lParam = 0xdeadbeef; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti); ok(r, "Getting tooltip info failed\n"); - ok(0xaaaaaaaa == ti.lParam, "Expected 0xaaaaaaaa, got %lx\n", ti.lParam); + ok(0xaaaaaaaa == ti.lParam || + broken(0xaaaaaaaa != ti.lParam), /* comctl32 < 5.81 */ + "Expected 0xaaaaaaaa, got %lx\n", ti.lParam); DestroyWindow(hwnd);
1
0
0
0
Marcus Meissner : reg: Remove wrong and useless check (Coverity).
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 93dad930cdad9acb5ba4adbe6017459d739452d4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93dad930cdad9acb5ba4adbe6…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Tue Oct 20 09:31:15 2009 +0200 reg: Remove wrong and useless check (Coverity). --- programs/reg/reg.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/programs/reg/reg.c b/programs/reg/reg.c index a538d81..f0a8f8b 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -279,13 +279,6 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, DWORD count; LONG rc; - if (value_name) - { - RegCloseKey(subkey); - reg_message(STRING_INVALID_CMDLINE); - return 1; - } - rc = RegQueryInfoKeyW(subkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &maxValue, NULL, NULL, NULL); if (rc != ERROR_SUCCESS)
1
0
0
0
Vitaliy Margolen : ntoskrnl: Initialize structure size.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 82379e83e3712cb70ef56d591df4b4fbc744d9b9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82379e83e3712cb70ef56d591…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Mon Oct 19 23:23:13 2009 -0600 ntoskrnl: Initialize structure size. --- dlls/ntoskrnl.exe/ntoskrnl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index d95dc31..93d72a6 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -1237,6 +1237,7 @@ BOOLEAN WINAPI PsGetVersion(ULONG *major, ULONG *minor, ULONG *build, UNICODE_ST { RTL_OSVERSIONINFOEXW info; + info.dwOSVersionInfoSize = sizeof(info); RtlGetVersion( &info ); if (major) *major = info.dwMajorVersion; if (minor) *minor = info.dwMinorVersion;
1
0
0
0
Ken Thomases : winecoreaudio: Fix incorrect casts from float to DWORD in wodGetVolume.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: fd596b9cb80c86dcaf6bb89e3cf438131f2396fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fd596b9cb80c86dcaf6bb89e3…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Mon Oct 19 20:38:42 2009 -0500 winecoreaudio: Fix incorrect casts from float to DWORD in wodGetVolume. --- dlls/winecoreaudio.drv/audio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/winecoreaudio.drv/audio.c b/dlls/winecoreaudio.drv/audio.c index 835d1a9..91f6599 100644 --- a/dlls/winecoreaudio.drv/audio.c +++ b/dlls/winecoreaudio.drv/audio.c @@ -1452,7 +1452,7 @@ static DWORD wodGetVolume(WORD wDevID, WINE_WAVEOUT_INSTANCE* wwo, LPDWORD lpdwV AudioUnit_GetVolume(wwo->audioUnit, &left, &right); - *lpdwVol = ((WORD) left * 0xFFFFl) + (((WORD) right * 0xFFFFl) << 16); + *lpdwVol = (WORD)(left * 0xFFFFl) + ((WORD)(right * 0xFFFFl) << 16); return MMSYSERR_NOERROR; }
1
0
0
0
Juan Lang : crypt32: Implement CryptFindCertificateInStore for unicode strings.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: 1e424138feead8b70d4d406af92acb079f2304c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e424138feead8b70d4d406af…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 16 16:32:46 2009 -0700 crypt32: Implement CryptFindCertificateInStore for unicode strings. --- dlls/crypt32/cert.c | 66 +++++++++++++++++++++++++++++++++++++++++++++ dlls/crypt32/tests/cert.c | 3 -- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index b92aee9..5b3b6e3 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -1422,6 +1422,69 @@ static PCCERT_CONTEXT find_cert_by_issuer(HCERTSTORE store, DWORD dwType, return found; } +static BOOL compare_cert_by_name_str(PCCERT_CONTEXT pCertContext, + DWORD dwType, DWORD dwFlags, const void *pvPara) +{ + PCERT_NAME_BLOB name; + DWORD len; + BOOL ret = FALSE; + + if (dwType & CERT_INFO_SUBJECT_FLAG) + name = &pCertContext->pCertInfo->Subject; + else + name = &pCertContext->pCertInfo->Issuer; + len = CertNameToStrW(pCertContext->dwCertEncodingType, name, + CERT_SIMPLE_NAME_STR, NULL, 0); + if (len) + { + LPWSTR str = CryptMemAlloc(len * sizeof(WCHAR)); + + if (str) + { + LPWSTR ptr; + + CertNameToStrW(pCertContext->dwCertEncodingType, name, + CERT_SIMPLE_NAME_STR, str, len); + for (ptr = str; *ptr; ptr++) + *ptr = tolowerW(*ptr); + if (strstrW(str, pvPara)) + ret = TRUE; + CryptMemFree(str); + } + } + return ret; +} + +static PCCERT_CONTEXT find_cert_by_name_str(HCERTSTORE store, DWORD dwType, + DWORD dwFlags, const void *pvPara, PCCERT_CONTEXT prev) +{ + PCCERT_CONTEXT found = NULL; + + TRACE("%s\n", debugstr_w(pvPara)); + + if (pvPara) + { + DWORD len = strlenW(pvPara); + LPWSTR str = CryptMemAlloc((len + 1) * sizeof(WCHAR)); + + if (str) + { + LPCWSTR src; + LPWSTR dst; + + for (src = pvPara, dst = str; *src; src++, dst++) + *dst = tolowerW(*src); + *dst = 0; + found = cert_compare_certs_in_store(store, prev, + compare_cert_by_name_str, dwType, dwFlags, str); + CryptMemFree(str); + } + } + else + found = find_cert_any(store, dwType, dwFlags, NULL, prev); + return found; +} + PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFlags, DWORD dwType, const void *pvPara, PCCERT_CONTEXT pPrevCertContext) @@ -1450,6 +1513,9 @@ PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE hCertStore, case CERT_COMPARE_PUBLIC_KEY: compare = compare_cert_by_public_key; break; + case CERT_COMPARE_NAME_STR_W: + find = find_cert_by_name_str; + break; case CERT_COMPARE_SUBJECT_CERT: compare = compare_cert_by_subject_cert; break; diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index 8a00509..685a564 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -1148,7 +1148,6 @@ static void testFindCert(void) if (context) count++; } while (context); - todo_wine ok(count == 3, "expected 3 contexts\n"); count = 0; context = NULL; @@ -1158,7 +1157,6 @@ static void testFindCert(void) if (context) count++; } while (context); - todo_wine ok(count == 2, "expected 2 contexts\n"); count = 0; context = NULL; @@ -1168,7 +1166,6 @@ static void testFindCert(void) if (context) count++; } while (context); - todo_wine ok(count == 3, "expected 3 contexts\n"); SetLastError(0xdeadbeef); context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0,
1
0
0
0
Juan Lang : crypt32: Test CertFindCertificateStore for finding Unicode strings.
by Alexandre Julliard
20 Oct '09
20 Oct '09
Module: wine Branch: master Commit: af4b5303ba94adcf1feb8762917d358adc4bc18d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af4b5303ba94adcf1feb87629…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 16 16:33:22 2009 -0700 crypt32: Test CertFindCertificateStore for finding Unicode strings. --- dlls/crypt32/tests/cert.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index a989346..8a00509 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -1015,6 +1015,10 @@ static void testFindCert(void) CERT_INFO certInfo = { 0 }; CRYPT_HASH_BLOB blob; BYTE otherSerialNumber[] = { 2 }; + DWORD count; + static const WCHAR juan[] = { 'j','u','a','n',0 }; + static const WCHAR lang[] = { 'L','A','N','G',0 }; + static const WCHAR malcolm[] = { 'm','a','l','c','o','l','m',0 }; store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); @@ -1135,6 +1139,44 @@ static void testFindCert(void) ok(context == NULL, "Expected one cert only\n"); } + /* Searching for NULL string matches any context. */ + count = 0; + context = NULL; + do { + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_ISSUER_STR, NULL, context); + if (context) + count++; + } while (context); + todo_wine + ok(count == 3, "expected 3 contexts\n"); + count = 0; + context = NULL; + do { + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_ISSUER_STR, juan, context); + if (context) + count++; + } while (context); + todo_wine + ok(count == 2, "expected 2 contexts\n"); + count = 0; + context = NULL; + do { + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_ISSUER_STR, lang, context); + if (context) + count++; + } while (context); + todo_wine + ok(count == 3, "expected 3 contexts\n"); + SetLastError(0xdeadbeef); + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_ISSUER_STR, malcolm, NULL); + ok(!context, "expected no certs\n"); + ok(GetLastError() == CRYPT_E_NOT_FOUND, + "expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); + CertCloseStore(store, 0); /* Another subject cert search, using iTunes's certs */
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
121
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Results per page:
10
25
50
100
200