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
June
May
April
March
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
January 2012
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
972 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Get rid of the vertex buffer conversion hack in process_vertices_strided() .
by Alexandre Julliard
24 Jan '12
24 Jan '12
Module: wine Branch: master Commit: 41c910d5f066347ec7ed9918b0801ffb961f8637 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41c910d5f066347ec7ed9918b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Jan 23 20:33:33 2012 +0100 wined3d: Get rid of the vertex buffer conversion hack in process_vertices_strided(). The main thing that's broken is the unnecessary color conversion in case bgra vertex arrays are supported. It shouldn't be hard to fix that, but at this point I don't think this hack even helps a lot anymore. --- dlls/wined3d/device.c | 124 ++++++++++--------------------------------------- 1 files changed, 25 insertions(+), 99 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f56d027..348ee08 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3185,13 +3185,14 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD flags, DWORD DestFVF) { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - char *dest_ptr, *dest_conv = NULL, *dest_conv_addr = NULL; struct wined3d_matrix mat, proj_mat, view_mat, world_mat; struct wined3d_viewport vp; + UINT vertex_size; unsigned int i; + BYTE *dest_ptr; BOOL doClip; DWORD numTextures; + HRESULT hr; if (stream_info->use_map & (1 << WINED3D_FFP_NORMAL)) { @@ -3204,34 +3205,6 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO return WINED3DERR_INVALIDCALL; } - if (!dest->resource.allocatedMemory) - buffer_get_sysmem(dest, gl_info); - - /* Get a pointer into the destination vbo(create one if none exists) and - * write correct opengl data into it. It's cheap and allows us to run drawStridedFast - */ - if (!dest->buffer_object && gl_info->supported[ARB_VERTEX_BUFFER_OBJECT]) - { - dest->flags |= WINED3D_BUFFER_CREATEBO; - wined3d_buffer_preload(dest); - } - - if (dest->buffer_object) - { - unsigned char extrabytes = 0; - /* If the destination vertex buffer has D3DFVF_XYZ position(non-rhw), native d3d writes RHW position, where the RHW - * gets written into the 4 bytes after the Z position. In the case of a dest buffer that only has D3DFVF_XYZ data, - * this may write 4 extra bytes beyond the area that should be written - */ - if(DestFVF == WINED3DFVF_XYZ) extrabytes = 4; - dest_conv_addr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwCount * get_flexible_vertex_size(DestFVF) + extrabytes); - if(!dest_conv_addr) { - ERR("Out of memory\n"); - /* Continue without storing converted vertices */ - } - dest_conv = dest_conv_addr; - } - if (device->stateBlock->state.render_states[WINED3D_RS_CLIPPING]) { static BOOL warned = FALSE; @@ -3248,8 +3221,16 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO warned = TRUE; FIXME("Clipping is broken and disabled for now\n"); } - } else doClip = FALSE; - dest_ptr = ((char *)buffer_get_sysmem(dest, gl_info)) + dwDestIndex * get_flexible_vertex_size(DestFVF); + } + else + doClip = FALSE; + + vertex_size = get_flexible_vertex_size(DestFVF); + if (FAILED(hr = wined3d_buffer_map(dest, dwDestIndex * vertex_size, dwCount * vertex_size, &dest_ptr, 0))) + { + WARN("Failed to map buffer, hr %#x.\n", hr); + return hr; + } wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); @@ -3382,28 +3363,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO dest_ptr += 3 * sizeof(float); - if((DestFVF & WINED3DFVF_POSITION_MASK) == WINED3DFVF_XYZRHW) { + if ((DestFVF & WINED3DFVF_POSITION_MASK) == WINED3DFVF_XYZRHW) dest_ptr += sizeof(float); - } - - if(dest_conv) { - float w = 1 / rhw; - ( (float *) dest_conv)[0] = x * w; - ( (float *) dest_conv)[1] = y * w; - ( (float *) dest_conv)[2] = z * w; - ( (float *) dest_conv)[3] = w; - - dest_conv += 3 * sizeof(float); - - if((DestFVF & WINED3DFVF_POSITION_MASK) == WINED3DFVF_XYZRHW) { - dest_conv += sizeof(float); - } - } } - if (DestFVF & WINED3DFVF_PSIZE) { + + if (DestFVF & WINED3DFVF_PSIZE) dest_ptr += sizeof(DWORD); - if(dest_conv) dest_conv += sizeof(DWORD); - } + if (DestFVF & WINED3DFVF_NORMAL) { const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_NORMAL]; @@ -3411,9 +3377,6 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO /* AFAIK this should go into the lighting information */ FIXME("Didn't expect the destination to have a normal\n"); copy_and_next(dest_ptr, normal, 3 * sizeof(float)); - if(dest_conv) { - copy_and_next(dest_conv, normal, 3 * sizeof(float)); - } } if (DestFVF & WINED3DFVF_DIFFUSE) @@ -3431,20 +3394,10 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO *( (DWORD *) dest_ptr) = 0xffffffff; dest_ptr += sizeof(DWORD); - - if(dest_conv) { - *( (DWORD *) dest_conv) = 0xffffffff; - dest_conv += sizeof(DWORD); - } } - else { + else + { copy_and_next(dest_ptr, color_d, sizeof(DWORD)); - if(dest_conv) { - *( (DWORD *) dest_conv) = (*color_d & 0xff00ff00) ; /* Alpha + green */ - *( (DWORD *) dest_conv) |= (*color_d & 0x00ff0000) >> 16; /* Red */ - *( (DWORD *) dest_conv) |= (*color_d & 0xff0000ff) << 16; /* Blue */ - dest_conv += sizeof(DWORD); - } } } @@ -3464,20 +3417,10 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO *( (DWORD *) dest_ptr) = 0xFF000000; dest_ptr += sizeof(DWORD); - - if(dest_conv) { - *( (DWORD *) dest_conv) = 0xFF000000; - dest_conv += sizeof(DWORD); - } } - else { + else + { copy_and_next(dest_ptr, color_s, sizeof(DWORD)); - if(dest_conv) { - *( (DWORD *) dest_conv) = (*color_s & 0xff00ff00) ; /* Alpha + green */ - *( (DWORD *) dest_conv) |= (*color_s & 0x00ff0000) >> 16; /* Red */ - *( (DWORD *) dest_conv) |= (*color_s & 0xff0000ff) << 16; /* Blue */ - dest_conv += sizeof(DWORD); - } } } @@ -3488,33 +3431,16 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO if (!(stream_info->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + tex_index)))) { ERR("No source texture, but destination requests one\n"); - dest_ptr+=GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float); - if(dest_conv) dest_conv += GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float); + dest_ptr += GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float); } - else { + else + { copy_and_next(dest_ptr, tex_coord, GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float)); - if(dest_conv) { - copy_and_next(dest_conv, tex_coord, GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float)); - } } } } - if (dest_conv) - { - ENTER_GL(); - - GL_EXTCALL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, dest->buffer_object)); - checkGLcall("glBindBufferARB(GL_ARRAY_BUFFER_ARB)"); - GL_EXTCALL(glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, dwDestIndex * get_flexible_vertex_size(DestFVF), - dwCount * get_flexible_vertex_size(DestFVF), - dest_conv_addr)); - checkGLcall("glBufferSubDataARB(GL_ARRAY_BUFFER_ARB)"); - - LEAVE_GL(); - - HeapFree(GetProcessHeap(), 0, dest_conv_addr); - } + wined3d_buffer_unmap(dest); return WINED3D_OK; }
1
0
0
0
Thomas Faber : crypt32: Fix build with MSVC.
by Alexandre Julliard
24 Jan '12
24 Jan '12
Module: wine Branch: master Commit: a7144d916db882a3cb0d9f53e356726b00ba04bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7144d916db882a3cb0d9f53e…
Author: Thomas Faber <thfabba(a)gmx.de> Date: Mon Jan 23 18:37:35 2012 +0100 crypt32: Fix build with MSVC. --- dlls/crypt32/msg.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 50c1bee..610f8c5 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1809,7 +1809,12 @@ static BOOL CEnvelopedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, char oid_rsa_data[] = szOID_RSA_data; CRYPT_ENVELOPED_DATA envelopedData = { CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION, msg->cRecipientInfo, - msg->recipientInfo, { oid_rsa_data, msg->algo, msg->data } + msg->recipientInfo, { oid_rsa_data, { + msg->algo.pszObjId, + { msg->algo.Parameters.cbData, msg->algo.Parameters.pbData } + }, + { msg->data.cbData, msg->data.pbData } + } }; ret = CRYPT_AsnEncodePKCSEnvelopedData(&envelopedData, pvData,
1
0
0
0
Francois Gouget : cmd: Fix an internationalization issue in WCMD_ask_confirm().
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: af3d368acaf546df40a05a80eb7e268e3cb6d07d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af3d368acaf546df40a05a80e…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Jan 23 17:37:47 2012 +0100 cmd: Fix an internationalization issue in WCMD_ask_confirm(). Don't break the strings to translate in little chunks: this makes it hard or even impossible to translate them correctly. For instance it must be possible to insert an unbreakable space before question marks for French. --- po/ar.po | 14 +++++++++++--- po/bg.po | 14 +++++++++++--- po/ca.po | 21 +++++++++++++++++---- po/cs.po | 14 +++++++++++--- po/da.po | 19 +++++++++++++++---- po/de.po | 21 +++++++++++++++++---- po/el.po | 14 +++++++++++--- po/en.po | 20 ++++++++++++++------ po/en_US.po | 20 ++++++++++++++------ po/eo.po | 14 +++++++++++--- po/es.po | 19 +++++++++++++++---- po/fa.po | 14 +++++++++++--- po/fi.po | 14 +++++++++++--- po/fr.po | 21 +++++++++++++++++---- po/he.po | 21 +++++++++++++++++---- po/hi.po | 14 +++++++++++--- po/hu.po | 14 +++++++++++--- po/it.po | 21 +++++++++++++++++---- po/ja.po | 21 +++++++++++++++++---- po/ko.po | 21 +++++++++++++++++---- po/lt.po | 21 +++++++++++++++++---- po/ml.po | 14 +++++++++++--- po/nb_NO.po | 17 ++++++++++++++--- po/nl.po | 21 +++++++++++++++++---- po/or.po | 14 +++++++++++--- po/pa.po | 14 +++++++++++--- po/pl.po | 21 +++++++++++++++++---- po/pt_BR.po | 21 +++++++++++++++++---- po/pt_PT.po | 16 +++++++++++++--- po/rm.po | 14 +++++++++++--- po/ro.po | 19 +++++++++++++++---- po/ru.po | 21 +++++++++++++++++---- po/sk.po | 14 +++++++++++--- po/sl.po | 21 +++++++++++++++++---- po/sr_RS(a)cyrillic.po | 16 +++++++++++++--- po/sr_RS(a)latin.po | 16 +++++++++++++--- po/sv.po | 19 +++++++++++++++---- po/te.po | 14 +++++++++++--- po/th.po | 14 +++++++++++--- po/tr.po | 14 +++++++++++--- po/uk.po | 19 +++++++++++++++---- po/wa.po | 14 +++++++++++--- po/wine.pot | 14 +++++++++++--- po/zh_CN.po | 14 +++++++++++--- po/zh_TW.po | 14 +++++++++++--- programs/cmd/builtins.c | 40 +++++++++++++++++----------------------- programs/cmd/cmd.rc | 8 +++++--- programs/cmd/wcmd.h | 2 ++ 48 files changed, 632 insertions(+), 185 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=af3d368acaf546df40a05…
1
0
0
0
Francois Gouget : cmd: Fix asking for a Yes / No / All confirmation.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: c2a9aae4ca93d1187a0f9071c198bd46201e6684 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2a9aae4ca93d1187a0f9071c…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Jan 23 17:37:18 2012 +0100 cmd: Fix asking for a Yes / No / All confirmation. --- programs/cmd/builtins.c | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 272bac0..ca486b4 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -108,8 +108,7 @@ static BOOL verify_mode = FALSE; /************************************************************************** * WCMD_ask_confirm * - * Issue a message and ask 'Are you sure (Y/N)', waiting on a valid - * answer. + * Issue a message and ask for confirmation, waiting on a valid answer. * * Returns True if Y (or A) answer is selected * If optionAll contains a pointer, ALL is allowed, and if answered @@ -117,7 +116,7 @@ static BOOL verify_mode = FALSE; * */ static BOOL WCMD_ask_confirm (const WCHAR *message, BOOL showSureText, - const BOOL *optionAll) { + BOOL *optionAll) { WCHAR msgbuffer[MAXSTRING]; WCHAR Ybuffer[MAXSTRING]; @@ -132,8 +131,10 @@ static BOOL WCMD_ask_confirm (const WCHAR *message, BOOL showSureText, LoadStringW(hinst, WCMD_NO, Nbuffer, sizeof(Nbuffer)/sizeof(WCHAR)); LoadStringW(hinst, WCMD_ALL, Abuffer, sizeof(Abuffer)/sizeof(WCHAR)); - /* Loop waiting on a Y or N */ - while (answer[0] != Ybuffer[0] && answer[0] != Nbuffer[0]) { + /* Loop waiting on a valid answer */ + if (optionAll) + *optionAll = FALSE; + while (1) { static const WCHAR startBkt[] = {' ','(','\0'}; static const WCHAR endBkt[] = {')','?','\0'}; @@ -152,11 +153,16 @@ static BOOL WCMD_ask_confirm (const WCHAR *message, BOOL showSureText, WCMD_output_asis (endBkt); WCMD_ReadFile(GetStdHandle(STD_INPUT_HANDLE), answer, sizeof(answer)/sizeof(WCHAR), &count); answer[0] = toupperW(answer[0]); + if (answer[0] == Ybuffer[0]) + return TRUE; + if (answer[0] == Nbuffer[0]) + return FALSE; + if (optionAll && answer[0] == Abuffer[0]) + { + *optionAll = TRUE; + return TRUE; + } } - - /* Return the answer */ - return ((answer[0] == Ybuffer[0]) || - (optionAll && (answer[0] == Abuffer[0]))); } /****************************************************************************
1
0
0
0
Francois Gouget : cmd: Remove an unused variable.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: 774eb34e3687161a25067759f223a9ccacc65610 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=774eb34e3687161a25067759f…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Jan 23 17:24:30 2012 +0100 cmd: Remove an unused variable. --- programs/cmd/builtins.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index ca4fa87..272bac0 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1714,9 +1714,6 @@ void WCMD_move (void) /* Prompt if overwriting */ if (!force) { WCHAR* question; - WCHAR yesChar[10]; - - strcpyW(yesChar, WCMD_LoadMessage(WCMD_YES)); /* Ask for confirmation */ question = WCMD_format_string(WCMD_LoadMessage(WCMD_OVERWRITE), dest);
1
0
0
0
Francois Gouget : shell32: Don't translate the shell folder paths.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: 6fc6cf6935ff7aac005c080873db31fd706e359a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fc6cf6935ff7aac005c08087…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Jan 23 18:44:50 2012 +0100 shell32: Don't translate the shell folder paths. --- dlls/shell32/shell32.rc | 37 +++----- dlls/shell32/shellpath.c | 132 +++++++++++++++++---------- dlls/shell32/shresdef.h | 19 +---- po/ar.po | 213 ++++++++++++++++--------------------------- po/bg.po | 228 +++++++++++++++++---------------------------- po/ca.po | 222 +++++++++++++++++--------------------------- po/cs.po | 217 ++++++++++++++++---------------------------- po/da.po | 228 +++++++++++++++++---------------------------- po/de.po | 222 +++++++++++++++++--------------------------- po/el.po | 214 ++++++++++++++++--------------------------- po/en.po | 216 ++++++++++++++++---------------------------- po/en_US.po | 228 +++++++++++++++++----------------------------- po/eo.po | 222 +++++++++++++++++---------------------------- po/es.po | 228 +++++++++++++++++---------------------------- po/fa.po | 213 ++++++++++++++++--------------------------- po/fi.po | 222 +++++++++++++++++--------------------------- po/fr.po | 222 +++++++++++++++++--------------------------- po/he.po | 222 +++++++++++++++++--------------------------- po/hi.po | 204 +++++++++++++++-------------------------- po/hu.po | 228 +++++++++++++++++---------------------------- po/it.po | 222 +++++++++++++++++--------------------------- po/ja.po | 222 +++++++++++++++++--------------------------- po/ko.po | 222 +++++++++++++++++--------------------------- po/lt.po | 222 +++++++++++++++++--------------------------- po/ml.po | 204 +++++++++++++++-------------------------- po/nb_NO.po | 228 +++++++++++++++++---------------------------- po/nl.po | 222 +++++++++++++++++--------------------------- po/or.po | 204 +++++++++++++++-------------------------- po/pa.po | 204 +++++++++++++++-------------------------- po/pl.po | 222 +++++++++++++++++--------------------------- po/pt_BR.po | 222 +++++++++++++++++--------------------------- po/pt_PT.po | 222 +++++++++++++++++--------------------------- po/rm.po | 205 +++++++++++++++--------------------------- po/ro.po | 228 +++++++++++++++++---------------------------- po/ru.po | 222 +++++++++++++++++--------------------------- po/sk.po | 213 ++++++++++++++++--------------------------- po/sl.po | 222 +++++++++++++++++--------------------------- po/sr_RS(a)cyrillic.po | 222 +++++++++++++++++--------------------------- po/sr_RS(a)latin.po | 222 +++++++++++++++++--------------------------- po/sv.po | 222 +++++++++++++++++--------------------------- po/te.po | 204 +++++++++++++++-------------------------- po/th.po | 213 ++++++++++++++++--------------------------- po/tr.po | 228 +++++++++++++++++---------------------------- po/uk.po | 222 +++++++++++++++++--------------------------- po/wa.po | 213 ++++++++++++++++--------------------------- po/wine.pot | 204 +++++++++++++++-------------------------- po/zh_CN.po | 222 +++++++++++++++++--------------------------- po/zh_TW.po | 226 +++++++++++++++++---------------------------- 48 files changed, 3778 insertions(+), 6263 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6fc6cf6935ff7aac005c0…
1
0
0
0
Francois Gouget : shell32: Use the plural for 'My Videos' wherever appropriate.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: deffb92c9d6194189052343b3e3d6d9d7be06b2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=deffb92c9d6194189052343b3…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Jan 23 15:56:35 2012 +0100 shell32: Use the plural for 'My Videos' wherever appropriate. --- dlls/shell32/shell32.rc | 4 ++-- dlls/shell32/shellpath.c | 22 +++++++++++----------- dlls/shell32/shresdef.h | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc index 9c5ba78..88959d9 100644 --- a/dlls/shell32/shell32.rc +++ b/dlls/shell32/shell32.rc @@ -204,7 +204,7 @@ the folder?" IDS_SENDTO "SendTo" IDS_STARTMENU "Start Menu" IDS_MYMUSIC "My Music" - IDS_MYVIDEO "My Videos" + IDS_MYVIDEOS "My Videos" IDS_DESKTOPDIRECTORY "#msgctxt#directory#Desktop" IDS_NETHOOD "NetHood" IDS_TEMPLATES "Templates" @@ -223,7 +223,7 @@ the folder?" IDS_ADMINTOOLS "Start Menu\\Programs\\Administrative Tools" IDS_COMMON_MUSIC "Music" IDS_COMMON_PICTURES "Pictures" - IDS_COMMON_VIDEO "Videos" + IDS_COMMON_VIDEOS "Videos" IDS_CDBURN_AREA "Local Settings\\Application Data\\Microsoft\\CD Burning" IDS_CONTACTS "Contacts" IDS_LINKS "Links" diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 71d82c8..943f5c1 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -781,7 +781,7 @@ static const WCHAR HistoryW[] = {'H','i','s','t','o','r','y','\0'}; static const WCHAR Local_AppDataW[] = {'L','o','c','a','l',' ','A','p','p','D','a','t','a','\0'}; static const WCHAR My_MusicW[] = {'M','y',' ','M','u','s','i','c','\0'}; static const WCHAR My_PicturesW[] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR My_VideoW[] = {'M','y',' ','V','i','d','e','o','s','\0'}; +static const WCHAR My_VideosW[] = {'M','y',' ','V','i','d','e','o','s','\0'}; static const WCHAR NetHoodW[] = {'N','e','t','H','o','o','d','\0'}; static const WCHAR PersonalW[] = {'P','e','r','s','o','n','a','l','\0'}; static const WCHAR PrintHoodW[] = {'P','r','i','n','t','H','o','o','d','\0'}; @@ -918,8 +918,8 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x0e - CSIDL_MYVIDEO */ &FOLDERID_Videos, CSIDL_Type_User, - My_VideoW, - MAKEINTRESOURCEW(IDS_MYVIDEO) + My_VideosW, + MAKEINTRESOURCEW(IDS_MYVIDEOS) }, { /* 0x0f - unassigned */ &GUID_NULL, @@ -1165,7 +1165,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_PublicVideos, CSIDL_Type_AllUsers, CommonVideoW, - MAKEINTRESOURCEW(IDS_COMMON_VIDEO) + MAKEINTRESOURCEW(IDS_COMMON_VIDEOS) }, { /* 0x38 - CSIDL_RESOURCES */ &FOLDERID_ResourceDir, @@ -2503,8 +2503,8 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { case IDS_MYPICTURES: lstrcpyW(wszSubPath, My_PicturesW); break; - case IDS_MYVIDEO: - lstrcpyW(wszSubPath, My_VideoW); + case IDS_MYVIDEOS: + lstrcpyW(wszSubPath, My_VideosW); break; default: ERR("LoadString(%d) failed!\n", LOWORD(pwszSubPath)); @@ -2537,7 +2537,7 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { * - If there is a 'My Documents' directory in $HOME, the user probably wants * wine's 'My Documents' to point there. Furthermore, we imply that the user * is a Windows lover and has no problem with wine creating 'My Pictures', - * 'My Music' and 'My Video' subfolders under '$HOME/My Documents', if those + * 'My Music' and 'My Videos' subfolders under '$HOME/My Documents', if those * do not already exits. We put appropriate symbolic links in place for those, * too. * - If there is no 'My Documents' directory in $HOME, we let 'My Documents' @@ -2546,7 +2546,7 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { * there already is a 'My Music' directory in $HOME, we symlink the 'My Music' * shell folder to it. But if not, then we check XDG_MUSIC_DIR - "well known" * directory, and try to link to that. If that fails, then we symlink to - * $HOME directly. The same holds fo 'My Pictures' and 'My Video'. + * $HOME directly. The same holds fo 'My Pictures' and 'My Videos'. * - The Desktop shell folder is symlinked to XDG_DESKTOP_DIR. If that does not * exist, then we try '$HOME/Desktop'. If that does not exist, then we leave * it alone. @@ -2554,7 +2554,7 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { */ static void _SHCreateSymbolicLinks(void) { - UINT aidsMyStuff[] = { IDS_MYPICTURES, IDS_MYVIDEO, IDS_MYMUSIC }, i; + UINT aidsMyStuff[] = { IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC }, i; int acsidlMyStuff[] = { CSIDL_MYPICTURES, CSIDL_MYVIDEO, CSIDL_MYMUSIC }; static const char * const xdg_dirs[] = { "PICTURES", "VIDEOS", "MUSIC", "DESKTOP" }; static const unsigned int num = sizeof(xdg_dirs) / sizeof(xdg_dirs[0]); @@ -2614,7 +2614,7 @@ static void _SHCreateSymbolicLinks(void) } } - /* Create symbolic links for 'My Pictures', 'My Video' and 'My Music'. */ + /* Create symbolic links for 'My Pictures', 'My Videos' and 'My Music'. */ for (i=0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) { /* Create the current 'My Whatever' folder and get it's unix path. */ hr = SHGetFolderPathW(NULL, acsidlMyStuff[i]|CSIDL_FLAG_CREATE, NULL, @@ -2797,7 +2797,7 @@ HRESULT SHELL_RegisterShellFolders(void) HRESULT hr; /* Set up '$HOME' targeted symlinks for 'My Documents', 'My Pictures', - * 'My Video', 'My Music' and 'Desktop' in advance, so that the + * 'My Videos', 'My Music' and 'Desktop' in advance, so that the * _SHRegister*ShellFolders() functions will find everything nice and clean * and thus will not attempt to create them in the profile directory. */ _SHCreateSymbolicLinks(); diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h index 1c3a381..ad3d2a2 100644 --- a/dlls/shell32/shresdef.h +++ b/dlls/shell32/shresdef.h @@ -71,7 +71,7 @@ #define IDS_SENDTO 50 #define IDS_STARTMENU 51 #define IDS_MYMUSIC 52 -#define IDS_MYVIDEO 53 +#define IDS_MYVIDEOS 53 #define IDS_DESKTOPDIRECTORY 54 #define IDS_NETHOOD 55 #define IDS_TEMPLATES 56 @@ -88,7 +88,7 @@ #define IDS_ADMINTOOLS 67 #define IDS_COMMON_MUSIC 68 #define IDS_COMMON_PICTURES 69 -#define IDS_COMMON_VIDEO 70 +#define IDS_COMMON_VIDEOS 70 #define IDS_CDBURN_AREA 71 #define IDS_PROGRAM_FILESX86 72 #define IDS_PROGRAM_FILES_COMMONX86 73
1
0
0
0
Jacek Caban : mshtml: Added IHTMLWindow5 stub implementation.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: 58776e9f9a971ca7b7858d4b91c21b1a40f677e2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58776e9f9a971ca7b7858d4b9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jan 23 16:42:15 2012 +0100 mshtml: Added IHTMLWindow5 stub implementation. --- dlls/mshtml/htmlwindow.c | 90 ++++++++++++++++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 1 + 2 files changed, 91 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 1d6ed5d..25fd1ce 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -159,6 +159,9 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii }else if(IsEqualGUID(&IID_IHTMLWindow4, riid)) { TRACE("(%p)->(IID_IHTMLWindow4 %p)\n", This, ppv); *ppv = &This->IHTMLWindow4_iface; + }else if(IsEqualGUID(&IID_IHTMLWindow5, riid)) { + TRACE("(%p)->(IID_IHTMLWindow5 %p)\n", This, ppv); + *ppv = &This->IHTMLWindow5_iface; }else if(IsEqualGUID(&IID_IHTMLWindow6, riid)) { TRACE("(%p)->(IID_IHTMLWindow6 %p)\n", This, ppv); *ppv = &This->IHTMLWindow6_iface; @@ -1656,6 +1659,92 @@ static const IHTMLWindow4Vtbl HTMLWindow4Vtbl = { HTMLWindow4_get_frameElement }; +static inline HTMLWindow *impl_from_IHTMLWindow5(IHTMLWindow5 *iface) +{ + return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow5_iface); +} + +static HRESULT WINAPI HTMLWindow5_QueryInterface(IHTMLWindow5 *iface, REFIID riid, void **ppv) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv); +} + +static ULONG WINAPI HTMLWindow5_AddRef(IHTMLWindow5 *iface) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface); +} + +static ULONG WINAPI HTMLWindow5_Release(IHTMLWindow5 *iface) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IHTMLWindow2_Release(&This->IHTMLWindow2_iface); +} + +static HRESULT WINAPI HTMLWindow5_GetTypeInfoCount(IHTMLWindow5 *iface, UINT *pctinfo) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLWindow5_GetTypeInfo(IHTMLWindow5 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLWindow5_GetIDsOfNames(IHTMLWindow5 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI HTMLWindow5_Invoke(IHTMLWindow5 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLWindow5_put_XMLHttpRequest(IHTMLWindow5 *iface, VARIANT v) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIANT *p) +{ + HTMLWindow *This = impl_from_IHTMLWindow5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static const IHTMLWindow5Vtbl HTMLWindow5Vtbl = { + HTMLWindow5_QueryInterface, + HTMLWindow5_AddRef, + HTMLWindow5_Release, + HTMLWindow5_GetTypeInfoCount, + HTMLWindow5_GetTypeInfo, + HTMLWindow5_GetIDsOfNames, + HTMLWindow5_Invoke, + HTMLWindow5_put_XMLHttpRequest, + HTMLWindow5_get_XMLHttpRequest +}; + static inline HTMLWindow *impl_from_IHTMLWindow6(IHTMLWindow6 *iface) { return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow6_iface); @@ -2443,6 +2532,7 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML window->IHTMLWindow2_iface.lpVtbl = &HTMLWindow2Vtbl; window->IHTMLWindow3_iface.lpVtbl = &HTMLWindow3Vtbl; window->IHTMLWindow4_iface.lpVtbl = &HTMLWindow4Vtbl; + window->IHTMLWindow5_iface.lpVtbl = &HTMLWindow5Vtbl; window->IHTMLWindow6_iface.lpVtbl = &HTMLWindow6Vtbl; window->IHTMLPrivateWindow_iface.lpVtbl = &HTMLPrivateWindowVtbl; window->IDispatchEx_iface.lpVtbl = &WindowDispExVtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 90fab6d..7373e15 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -291,6 +291,7 @@ struct HTMLWindow { IHTMLWindow2 IHTMLWindow2_iface; IHTMLWindow3 IHTMLWindow3_iface; IHTMLWindow4 IHTMLWindow4_iface; + IHTMLWindow5 IHTMLWindow5_iface; IHTMLWindow6 IHTMLWindow6_iface; IHTMLPrivateWindow IHTMLPrivateWindow_iface; IDispatchEx IDispatchEx_iface;
1
0
0
0
Nikolay Sivov : msxml3: Allocate private data when cloning from existing document.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: 916de3998ed5b0f1a3c2f755776d455ae3cbd000 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=916de3998ed5b0f1a3c2f7557…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Jan 23 17:36:35 2012 +0300 msxml3: Allocate private data when cloning from existing document. --- dlls/msxml3/domdoc.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 72f9a31..517b581 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -2082,7 +2082,9 @@ static HRESULT WINAPI domdoc_load( if(pNewDoc) { domdoc *newDoc = impl_from_IXMLDOMDocument3( pNewDoc ); + xmldoc = xmlCopyDoc(get_doc(newDoc), 1); + xmldoc->_private = create_priv(); hr = attach_xmldoc(This, xmldoc); if(SUCCEEDED(hr)) @@ -3444,8 +3446,7 @@ HRESULT DOMDocument_create(MSXML_VERSION version, IUnknown *pUnkOuter, void **pp if(!xmldoc) return E_OUTOFMEMORY; - xmldoc->_private = create_priv(); - priv_from_xmlDocPtr(xmldoc)->properties = create_properties(version); + xmldoc_init(xmldoc, version); hr = get_domdoc_from_xmldoc(xmldoc, (IXMLDOMDocument3**)ppObj); if(FAILED(hr))
1
0
0
0
Alex Henrie : comdlg32: Correctly handle filters with multiple file extensions in Save As dialogs.
by Alexandre Julliard
23 Jan '12
23 Jan '12
Module: wine Branch: master Commit: 7a34094e6e3e8a321148c64b0c9e2b986e63a7d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a34094e6e3e8a321148c64b0…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Fri Jan 20 14:52:18 2012 -0700 comdlg32: Correctly handle filters with multiple file extensions in Save As dialogs. --- dlls/comdlg32/filedlg.c | 61 ++++++++++++++++++++--------- dlls/comdlg32/tests/filedlg.c | 85 ++++++++++++++++++++++++++++++----------- 2 files changed, 104 insertions(+), 42 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 43df312..c31641b 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -2533,12 +2533,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) /* Attach the file extension with file name*/ ext = PathFindExtensionW(lpstrPathAndFile); - if (! *ext) + if (! *ext && fodInfos->defext) { /* if no extension is specified with file name, then */ /* attach the extension from file filter or default one */ - const WCHAR *filterExt = NULL; + WCHAR *filterExt = NULL; LPWSTR lpstrFilter = NULL; static const WCHAR szwDot[] = {'.',0}; int PathLength = lstrlenW(lpstrPathAndFile); @@ -2548,15 +2548,39 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) fodInfos->ofnInfos->nFilterIndex-1); if (lpstrFilter != (LPWSTR)CB_ERR) /* control is not empty */ - filterExt = PathFindExtensionW(lpstrFilter); + { + WCHAR* filterAtSemicolon; + filterExt = HeapAlloc(GetProcessHeap(), 0, lstrlenW(lpstrFilter) * sizeof(WCHAR) + sizeof(WCHAR)); + strcpyW(filterExt, lpstrFilter); + + /* if a semicolon-separated list of file extensions was given, do not include the + semicolon or anything after it in the extension. + example: if filterExt was "*.abc;*.def", it will become "*.abc" */ + filterAtSemicolon = strchrW(filterExt, ';'); + if (filterAtSemicolon) + { + filterAtSemicolon[0] = '\0'; + } + + /* strip the * or anything else from the extension, "*.abc" becomes "abc" */ + strcpyW(filterExt, PathFindExtensionW(filterExt) + 1); + + /* if the extension contains a glob, ignore it */ + if (strchrW(filterExt, '*') || strchrW(filterExt, '?')) + { + HeapFree(GetProcessHeap(), 0, filterExt); + filterExt = NULL; + } + } - if ( filterExt && *filterExt ) /* attach the file extension from file type filter*/ - filterExt = filterExt + 1; - else if ( fodInfos->defext ) /* attach the default file extension*/ - filterExt = fodInfos->defext; + if (!filterExt) + { + /* use the default file extension */ + filterExt = HeapAlloc(GetProcessHeap(), 0, lstrlenW(fodInfos->defext) * sizeof(WCHAR) + sizeof(WCHAR)); + strcpyW(filterExt, fodInfos->defext); + } - /* If extension contains a glob, ignore it */ - if ( filterExt && !strchrW(filterExt, '*') && !strchrW(filterExt, '?') ) + if (*filterExt) /* ignore filterExt="" */ { /* Attach the dot*/ lstrcatW(lpstrPathAndFile, szwDot); @@ -2564,20 +2588,19 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) lstrcatW(lpstrPathAndFile, filterExt ); } + HeapFree(GetProcessHeap(), 0, filterExt); + /* In Open dialog: if file does not exist try without extension */ if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && !PathFileExistsW(lpstrPathAndFile)) lpstrPathAndFile[PathLength] = '\0'; - } - if (fodInfos->defext) /* add default extension */ - { - /* Set/clear the output OFN_EXTENSIONDIFFERENT flag */ - if (*ext) - ext++; - if (!lstrcmpiW(fodInfos->defext, ext)) - fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT; - else - fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT; + /* Set/clear the output OFN_EXTENSIONDIFFERENT flag */ + if (*ext) + ext++; + if (!lstrcmpiW(fodInfos->defext, ext)) + fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT; + else + fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT; } /* In Save dialog: check if the file already exists */ diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 8539d3d..0d1112f 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -1044,51 +1044,90 @@ static UINT_PTR WINAPI test_extension_wndproc(HWND dlg, UINT msg, WPARAM wParam, return FALSE; } -static const char *defext_filters[] = { - "TestFilter (*.pt*)\0*.pt*\0", - "TestFilter (*.ab?)\0*.ab?\0", - "TestFilter (*.*)\0*.*\0", - NULL /* is a test, not an endmark! */ -}; - #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) +static void test_extension_helper(OPENFILENAME* ofn, const char *filter, + const char *expected_filename) +{ + char *filename_ptr; + DWORD ret; + BOOL boolret; + + strcpy(ofn->lpstrFile, "deadbeef"); + ofn->lpstrFilter = filter; + + boolret = GetSaveFileNameA(ofn); + ok(boolret, "%s: expected TRUE\n", filter); + + ret = CommDlgExtendedError(); + ok(!ret, "%s: CommDlgExtendedError returned %#x\n", filter, ret); + + filename_ptr = ofn->lpstrFile + ofn->nFileOffset; + ok(strcmp(filename_ptr, expected_filename) == 0, + "%s: Filename is %s, expected %s\n", filter, filename_ptr, expected_filename); +} + static void test_extension(void) { OPENFILENAME ofn = { sizeof(OPENFILENAME)}; char filename[1024] = {0}; char curdir[MAX_PATH]; - char *filename_ptr; - const char *test_file_name = "deadbeef"; unsigned int i; - DWORD ret; BOOL boolret; + const char *defext_concrete_filters[] = { + "TestFilter (*.abc)\0*.abc\0", + "TestFilter (*.abc;)\0*.abc;\0", + "TestFilter (*.abc;*.def)\0*.abc;*.def\0", + }; + + const char *defext_wildcard_filters[] = { + "TestFilter (*.pt*)\0*.pt*\0", + "TestFilter (*.pt*;*.abc)\0*.pt*;*.abc\0", + "TestFilter (*.ab?)\0*.ab?\0", + "TestFilter (*.*)\0*.*\0", + NULL /* is a test, not an endmark! */ + }; + boolret = GetCurrentDirectoryA(sizeof(curdir), curdir); ok(boolret, "Failed to get current dir err %d\n", GetLastError()); - /* Ignore .* extension */ ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = NULL; ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.Flags = OFN_EXPLORER | OFN_ENABLEHOOK; - ofn.lpstrDefExt = NULL; ofn.lpstrInitialDir = curdir; ofn.lpfnHook = test_extension_wndproc; ofn.nFileExtension = 0; - for (i = 0; i < ARRAY_SIZE(defext_filters); i++) { - ofn.lpstrFilter = defext_filters[i]; - strcpy(filename, test_file_name); - boolret = GetSaveFileNameA(&ofn); - ok(boolret, "%u: expected true\n", i); - ret = CommDlgExtendedError(); - ok(!ret, "%u: CommDlgExtendedError returned %#x\n", i, ret); - filename_ptr = ofn.lpstrFile + strlen( ofn.lpstrFile ) - strlen( test_file_name ); - ok( strlen(ofn.lpstrFile) >= strlen(test_file_name), "Filename %s is too short\n", ofn.lpstrFile ); - ok( strcmp(filename_ptr, test_file_name) == 0, - "Filename is %s, expected %s\n", filename_ptr, test_file_name ); + ofn.lpstrDefExt = NULL; + + /* Without lpstrDefExt, append no extension */ + test_extension_helper(&ofn, "TestFilter (*.abc) lpstrDefExt=NULL\0*.abc\0", "deadbeef"); + test_extension_helper(&ofn, "TestFilter (*.ab?) lpstrDefExt=NULL\0*.ab?\0", "deadbeef"); + + ofn.lpstrDefExt = ""; + + /* If lpstrDefExt="" and the filter has a concrete extension, append it */ + test_extension_helper(&ofn, "TestFilter (*.abc) lpstrDefExt=\"\"\0*.abc\0", "deadbeef.abc"); + + /* If lpstrDefExt="" and the filter has a wildcard extension, do nothing */ + test_extension_helper(&ofn, "TestFilter (*.ab?) lpstrDefExt=\"\"\0*.ab?\0", "deadbeef"); + + ofn.lpstrDefExt = "xyz"; + + /* Append concrete extensions from filters */ + for (i = 0; i < ARRAY_SIZE(defext_concrete_filters); i++) { + test_extension_helper(&ofn, defext_concrete_filters[i], "deadbeef.abc"); + } + + /* Append nothing from this filter */ + test_extension_helper(&ofn, "TestFilter (*.)\0*.\0", "deadbeef"); + + /* Ignore wildcard extensions in filters */ + for (i = 0; i < ARRAY_SIZE(defext_wildcard_filters); i++) { + test_extension_helper(&ofn, defext_wildcard_filters[i], "deadbeef.xyz"); } }
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
98
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
Results per page:
10
25
50
100
200