ReactOS.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
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
List overview
Download
Ros-diffs
September 2009
----- 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
ros-diffs@reactos.org
16 participants
270 discussions
Start a n
N
ew thread
[khornicek] 43166: - sync d3d8, d3d9, ddraw, wined3d with Wine 1.1.30
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Sep 26 13:13:40 2009 New Revision: 43166 URL:
http://svn.reactos.org/svn/reactos?rev=43166&view=rev
Log: - sync d3d8, d3d9, ddraw, wined3d with Wine 1.1.30 Modified: trunk/reactos/dll/directx/wine/d3d8/cubetexture.c trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h trunk/reactos/dll/directx/wine/d3d8/device.c trunk/reactos/dll/directx/wine/d3d8/directx.c trunk/reactos/dll/directx/wine/d3d8/indexbuffer.c trunk/reactos/dll/directx/wine/d3d8/pixelshader.c trunk/reactos/dll/directx/wine/d3d8/surface.c trunk/reactos/dll/directx/wine/d3d8/swapchain.c trunk/reactos/dll/directx/wine/d3d8/texture.c trunk/reactos/dll/directx/wine/d3d8/vertexbuffer.c trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c trunk/reactos/dll/directx/wine/d3d8/vertexshader.c trunk/reactos/dll/directx/wine/d3d8/volume.c trunk/reactos/dll/directx/wine/d3d8/volumetexture.c trunk/reactos/dll/directx/wine/d3d9/cubetexture.c trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h trunk/reactos/dll/directx/wine/d3d9/device.c trunk/reactos/dll/directx/wine/d3d9/directx.c trunk/reactos/dll/directx/wine/d3d9/indexbuffer.c trunk/reactos/dll/directx/wine/d3d9/pixelshader.c trunk/reactos/dll/directx/wine/d3d9/surface.c trunk/reactos/dll/directx/wine/d3d9/swapchain.c trunk/reactos/dll/directx/wine/d3d9/texture.c trunk/reactos/dll/directx/wine/d3d9/vertexbuffer.c trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c trunk/reactos/dll/directx/wine/d3d9/vertexshader.c trunk/reactos/dll/directx/wine/d3d9/volume.c trunk/reactos/dll/directx/wine/d3d9/volumetexture.c trunk/reactos/dll/directx/wine/ddraw/ddraw.c trunk/reactos/dll/directx/wine/ddraw/ddraw_private.h trunk/reactos/dll/directx/wine/ddraw/device.c trunk/reactos/dll/directx/wine/ddraw/direct3d.c trunk/reactos/dll/directx/wine/ddraw/main.c trunk/reactos/dll/directx/wine/ddraw/surface.c trunk/reactos/dll/directx/wine/ddraw/utils.c trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c trunk/reactos/dll/directx/wine/wined3d/baseshader.c trunk/reactos/dll/directx/wine/wined3d/basetexture.c trunk/reactos/dll/directx/wine/wined3d/buffer.c trunk/reactos/dll/directx/wine/wined3d/context.c trunk/reactos/dll/directx/wine/wined3d/cubetexture.c trunk/reactos/dll/directx/wine/wined3d/device.c trunk/reactos/dll/directx/wine/wined3d/directx.c trunk/reactos/dll/directx/wine/wined3d/drawprim.c trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c trunk/reactos/dll/directx/wine/wined3d/pixelshader.c trunk/reactos/dll/directx/wine/wined3d/resource.c trunk/reactos/dll/directx/wine/wined3d/state.c trunk/reactos/dll/directx/wine/wined3d/stateblock.c trunk/reactos/dll/directx/wine/wined3d/surface.c trunk/reactos/dll/directx/wine/wined3d/surface_base.c trunk/reactos/dll/directx/wine/wined3d/surface_gdi.c trunk/reactos/dll/directx/wine/wined3d/swapchain.c trunk/reactos/dll/directx/wine/wined3d/swapchain_base.c trunk/reactos/dll/directx/wine/wined3d/swapchain_gdi.c trunk/reactos/dll/directx/wine/wined3d/texture.c trunk/reactos/dll/directx/wine/wined3d/utils.c trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c trunk/reactos/dll/directx/wine/wined3d/vertexshader.c trunk/reactos/dll/directx/wine/wined3d/volume.c trunk/reactos/dll/directx/wine/wined3d/volumetexture.c trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h trunk/reactos/include/reactos/wine/wined3d.idl [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/d3d8/cubetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/cube…
Modified: trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/d3d8…
Modified: trunk/reactos/dll/directx/wine/d3d8/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/devi…
Modified: trunk/reactos/dll/directx/wine/d3d8/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/dire…
Modified: trunk/reactos/dll/directx/wine/d3d8/indexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/inde…
Modified: trunk/reactos/dll/directx/wine/d3d8/pixelshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/pixe…
Modified: trunk/reactos/dll/directx/wine/d3d8/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/surf…
Modified: trunk/reactos/dll/directx/wine/d3d8/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/swap…
Modified: trunk/reactos/dll/directx/wine/d3d8/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/text…
Modified: trunk/reactos/dll/directx/wine/d3d8/vertexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/vert…
Modified: trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/vert…
Modified: trunk/reactos/dll/directx/wine/d3d8/vertexshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/vert…
Modified: trunk/reactos/dll/directx/wine/d3d8/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/volu…
Modified: trunk/reactos/dll/directx/wine/d3d8/volumetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/volu…
Modified: trunk/reactos/dll/directx/wine/d3d9/cubetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/cube…
Modified: trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/d3d9…
Modified: trunk/reactos/dll/directx/wine/d3d9/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/devi…
Modified: trunk/reactos/dll/directx/wine/d3d9/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/dire…
Modified: trunk/reactos/dll/directx/wine/d3d9/indexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/inde…
Modified: trunk/reactos/dll/directx/wine/d3d9/pixelshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/pixe…
Modified: trunk/reactos/dll/directx/wine/d3d9/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/surf…
Modified: trunk/reactos/dll/directx/wine/d3d9/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/swap…
Modified: trunk/reactos/dll/directx/wine/d3d9/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/text…
Modified: trunk/reactos/dll/directx/wine/d3d9/vertexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
Modified: trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
Modified: trunk/reactos/dll/directx/wine/d3d9/vertexshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
Modified: trunk/reactos/dll/directx/wine/d3d9/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
Modified: trunk/reactos/dll/directx/wine/d3d9/volumetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
Modified: trunk/reactos/dll/directx/wine/ddraw/ddraw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ddr…
Modified: trunk/reactos/dll/directx/wine/ddraw/ddraw_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ddr…
Modified: trunk/reactos/dll/directx/wine/ddraw/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/dev…
Modified: trunk/reactos/dll/directx/wine/ddraw/direct3d.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/dir…
Modified: trunk/reactos/dll/directx/wine/ddraw/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/mai…
Modified: trunk/reactos/dll/directx/wine/ddraw/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/sur…
Modified: trunk/reactos/dll/directx/wine/ddraw/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/uti…
Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/baseshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/basetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/cubetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/drawprim.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
Modified: trunk/reactos/dll/directx/wine/wined3d/pixelshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/p…
Modified: trunk/reactos/dll/directx/wine/wined3d/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/r…
Modified: trunk/reactos/dll/directx/wine/wined3d/state.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/stateblock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface_base.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface_gdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/swapchain_base.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/swapchain_gdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/t…
Modified: trunk/reactos/dll/directx/wine/wined3d/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/u…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/volumetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/include/reactos/wine/wined3d.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wined…
15 years, 3 months
1
0
0
0
[dchapyshev] 43165: - Sync winhlp32 with Wine 1.1.30
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Sep 26 12:49:56 2009 New Revision: 43165 URL:
http://svn.reactos.org/svn/reactos?rev=43165&view=rev
Log: - Sync winhlp32 with Wine 1.1.30 Modified: trunk/reactos/base/applications/winhlp32/hlpfile.c trunk/reactos/base/applications/winhlp32/hlpfile.h trunk/reactos/base/applications/winhlp32/winhelp.c Modified: trunk/reactos/base/applications/winhlp32/hlpfile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/hlpfile.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/hlpfile.c [iso-8859-1] Sat Sep 26 12:49:56 2009 @@ -761,6 +761,69 @@ return TRUE; } +static HLPFILE_LINK* HLPFILE_AllocLink(struct RtfData* rd, int cookie, + const char* str, unsigned len, LONG hash, + unsigned clrChange, unsigned bHotSpot, unsigned wnd); + +/****************************************************************** + * HLPFILE_AddHotSpotLinks + * + */ +static void HLPFILE_AddHotSpotLinks(struct RtfData* rd, HLPFILE* file, + const BYTE* start, ULONG hs_size, ULONG hs_offset) +{ + unsigned i, hs_num; + ULONG hs_macro; + const char* str; + + if (hs_size == 0 || hs_offset == 0) return; + + start += hs_offset; + /* always 1 ?? */ + hs_num = GET_USHORT(start, 1); + hs_macro = GET_UINT(start, 3); + + str = (const char*)start + 7 + 15 * hs_num + hs_macro; + /* FIXME: should use hs_size to prevent out of bounds reads */ + for (i = 0; i < hs_num; i++) + { + HLPFILE_HOTSPOTLINK* hslink; + + WINE_TRACE("%02x-%02x%02x {%s,%s}\n", + start[7 + 15 * i + 0], start[7 + 15 * i + 1], start[7 + 15 * i + 2], + str, str + strlen(str) + 1); + /* str points to two null terminated strings: + * hotspot name, then link name + */ + str += strlen(str) + 1; /* skip hotspot name */ + + switch (start[7 + 15 * i + 0]) + /* The next two chars always look like 0x04 0x00 ??? + * What are they for ? + */ + { + case 0xE6: + case 0xE7: + hslink = (HLPFILE_HOTSPOTLINK*) + HLPFILE_AllocLink(rd, (start[7 + 15 * i + 0] & 1) ? hlp_link_link : hlp_link_popup, + file->lpszPath, -1, HLPFILE_Hash(str), + 0, 1, -1); + if (hslink) + { + hslink->x = GET_USHORT(start, 7 + 15 * i + 3); + hslink->y = GET_USHORT(start, 7 + 15 * i + 5); + hslink->width = GET_USHORT(start, 7 + 15 * i + 7); + hslink->height = GET_USHORT(start, 7 + 15 * i + 9); + /* target = GET_UINT(start, 7 + 15 * i + 11); */ + } + break; + default: + WINE_FIXME("unknown hotsport target 0x%x\n", start[7 + 15 * i + 0]); + } + str += strlen(str) + 1; + } +} + /****************************************************************** * HLPFILE_RtfAddTransparentBitmap * @@ -848,7 +911,7 @@ * HLPFILE_RtfAddBitmap * */ -static BOOL HLPFILE_RtfAddBitmap(struct RtfData* rd, const BYTE* beg, BYTE type, BYTE pack) +static BOOL HLPFILE_RtfAddBitmap(struct RtfData* rd, HLPFILE* file, const BYTE* beg, BYTE type, BYTE pack) { const BYTE* ptr; const BYTE* pict_beg; @@ -859,6 +922,7 @@ BOOL clrImportant = FALSE; BOOL ret = FALSE; char tmp[256]; + unsigned hs_size, hs_offset; bi = HeapAlloc(GetProcessHeap(), 0, sizeof(*bi)); if (!bi) return FALSE; @@ -884,10 +948,11 @@ bi->bmiHeader.biWidth, bi->bmiHeader.biHeight); csz = fetch_ulong(&ptr); - fetch_ulong(&ptr); /* hotspot size */ - - off = GET_UINT(ptr, 0); ptr += 4; - /* GET_UINT(ptr, 0); hotspot offset */ ptr += 4; + hs_size = fetch_ulong(&ptr); + + off = GET_UINT(ptr, 0); ptr += 4; + hs_offset = GET_UINT(ptr, 0); ptr += 4; + HLPFILE_AddHotSpotLinks(rd, file, beg, hs_size, hs_offset); /* now read palette info */ if (type == 0x06) @@ -947,9 +1012,9 @@ * HLPFILE_RtfAddMetaFile * */ -static BOOL HLPFILE_RtfAddMetaFile(struct RtfData* rd, const BYTE* beg, BYTE pack) -{ - ULONG size, csize, off, hsoff; +static BOOL HLPFILE_RtfAddMetaFile(struct RtfData* rd, HLPFILE* file, const BYTE* beg, BYTE pack) +{ + ULONG size, csize, off, hs_offset, hs_size; const BYTE* ptr; const BYTE* bits; BYTE* alloc = NULL; @@ -969,13 +1034,15 @@ size = fetch_ulong(&ptr); /* decompressed size */ csize = fetch_ulong(&ptr); /* compressed size */ - fetch_ulong(&ptr); /* hotspot size */ + hs_size = fetch_ulong(&ptr); /* hotspot size */ off = GET_UINT(ptr, 0); - hsoff = GET_UINT(ptr, 4); + hs_offset = GET_UINT(ptr, 4); ptr += 8; - WINE_TRACE("sz=%u csz=%u offs=%u/%u,%u\n", - size, csize, off, (ULONG)(ptr - beg), hsoff); + HLPFILE_AddHotSpotLinks(rd, file, beg, hs_size, hs_offset); + + WINE_TRACE("sz=%u csz=%u offs=%u/%u,%u/%u\n", + size, csize, off, (ULONG)(ptr - beg), hs_size, hs_offset); bits = HLPFILE_DecompressGfx(beg + off, csize, size, pack, &alloc); if (!bits) return FALSE; @@ -1016,10 +1083,10 @@ { case 5: /* device dependent bmp */ case 6: /* device independent bmp */ - HLPFILE_RtfAddBitmap(rd, beg, type, pack); + HLPFILE_RtfAddBitmap(rd, hlpfile, beg, type, pack); break; case 8: - HLPFILE_RtfAddMetaFile(rd, beg, pack); + HLPFILE_RtfAddMetaFile(rd, hlpfile, beg, pack); break; default: WINE_FIXME("Unknown type %u\n", type); return FALSE; } @@ -1061,32 +1128,36 @@ */ static HLPFILE_LINK* HLPFILE_AllocLink(struct RtfData* rd, int cookie, const char* str, unsigned len, LONG hash, - unsigned clrChange, unsigned wnd) + unsigned clrChange, unsigned bHotSpot, unsigned wnd) { HLPFILE_LINK* link; char* link_str; + unsigned asz = bHotSpot ? sizeof(HLPFILE_HOTSPOTLINK) : sizeof(HLPFILE_LINK); /* FIXME: should build a string table for the attributes.link.lpszPath * they are reallocated for each link */ if (len == -1) len = strlen(str); - link = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_LINK) + len + 1); + link = HeapAlloc(GetProcessHeap(), 0, asz + len + 1); if (!link) return NULL; link->cookie = cookie; - link->string = link_str = (char*)(link + 1); + link->string = link_str = (char*)link + asz; memcpy(link_str, str, len); link_str[len] = '\0'; link->hash = hash; link->bClrChange = clrChange ? 1 : 0; + link->bHotSpot = bHotSpot; link->window = wnd; link->next = rd->first_link; rd->first_link = link; link->cpMin = rd->char_pos; - link->cpMax = 0; rd->force_color = clrChange; if (rd->current_link) WINE_FIXME("Pending link\n"); - rd->current_link = link; + if (bHotSpot) + link->cpMax = rd->char_pos; + else + rd->current_link = link; WINE_TRACE("Link[%d] to %s@%08x:%d\n", link->cookie, link->string, link->hash, link->window); @@ -1495,7 +1566,7 @@ case 0xCC: WINE_TRACE("macro => %s\n", format + 3); HLPFILE_AllocLink(rd, hlp_link_macro, (const char*)format + 3, - GET_USHORT(format, 1), 0, !(*format & 4), -1); + GET_USHORT(format, 1), 0, !(*format & 4), 0, -1); format += 3 + GET_USHORT(format, 1); break; @@ -1503,7 +1574,7 @@ case 0xE1: WINE_WARN("jump topic 1 => %u\n", GET_UINT(format, 1)); HLPFILE_AllocLink(rd, (*format & 1) ? hlp_link_link : hlp_link_popup, - page->file->lpszPath, -1, GET_UINT(format, 1), 1, -1); + page->file->lpszPath, -1, GET_UINT(format, 1), 1, 0, -1); format += 5; @@ -1515,7 +1586,7 @@ case 0xE7: HLPFILE_AllocLink(rd, (*format & 1) ? hlp_link_link : hlp_link_popup, page->file->lpszPath, -1, GET_UINT(format, 1), - !(*format & 4), -1); + !(*format & 4), 0, -1); format += 5; break; @@ -1552,7 +1623,7 @@ break; } HLPFILE_AllocLink(rd, (*format & 1) ? hlp_link_link : hlp_link_popup, - ptr, -1, GET_UINT(format, 4), !(*format & 4), wnd); + ptr, -1, GET_UINT(format, 4), !(*format & 4), 0, wnd); } format += 3 + GET_USHORT(format, 1); break; Modified: trunk/reactos/base/applications/winhlp32/hlpfile.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/hlpfile.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/hlpfile.h [iso-8859-1] Sat Sep 26 12:49:56 2009 @@ -41,11 +41,21 @@ LPCSTR string; /* name of the file to for the link (NULL if same file) */ LONG hash; /* topic index */ unsigned bClrChange : 1; /* true if the link is green & underlined */ + unsigned bHotSpot : 1; /* true if the link is an hotspot (actually HLPFILE_HOTSPOTLINK) */ unsigned window; /* window number for displaying the link (-1 is current) */ DWORD cpMin; DWORD cpMax; struct tagHlpFileLink* next; } HLPFILE_LINK; + +typedef struct tagHlpFileHotSpotLink +{ + HLPFILE_LINK link; + unsigned x; + unsigned y; + unsigned width; + unsigned height; +} HLPFILE_HOTSPOTLINK; typedef struct tagHlpFileMacro { Modified: trunk/reactos/base/applications/winhlp32/winhelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] Sat Sep 26 12:49:56 2009 @@ -646,6 +646,16 @@ (LPARAM)&char_ptl, cp); SendMessageW(GetDlgItem(win->hMainWnd, CTL_ID_TEXT), EM_POSFROMCHAR, (LPARAM)&char_next_ptl, cp + 1); + if (link->bHotSpot) + { + HLPFILE_HOTSPOTLINK* hslink = (HLPFILE_HOTSPOTLINK*)link; + if ((mouse_ptl.x < char_ptl.x + hslink->x) || + (mouse_ptl.x >= char_ptl.x + hslink->x + hslink->width) || + (mouse_ptl.y < char_ptl.y + hslink->y) || + (mouse_ptl.y >= char_ptl.y + hslink->y + hslink->height)) + continue; + break; + } if (char_next_ptl.y != char_ptl.y || mouse_ptl.x >= char_next_ptl.x) link = NULL; break;
15 years, 3 months
1
0
0
0
[dchapyshev] 43164: - Fix building of tests
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Sep 26 12:49:05 2009 New Revision: 43164 URL:
http://svn.reactos.org/svn/reactos?rev=43164&view=rev
Log: - Fix building of tests Modified: trunk/rostests/winetests/comctl32/dpa.c Modified: trunk/rostests/winetests/comctl32/dpa.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/dpa.c?…
============================================================================== --- trunk/rostests/winetests/comctl32/dpa.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/dpa.c [iso-8859-1] Sat Sep 26 12:49:05 2009 @@ -41,7 +41,6 @@ PVOID pvData; } ITEMDATA, *LPITEMDATA; -typedef PVOID (CALLBACK *PFNDPAMERGE)(UINT,PVOID,PVOID,LPARAM); typedef HRESULT (CALLBACK *PFNDPASTM)(LPITEMDATA,IStream*,LPARAM); static HDPA (WINAPI *pDPA_Clone)(const HDPA,const HDPA);
15 years, 3 months
1
0
0
0
[dchapyshev] 43163: - Sync shlwapi, msxml3 and windowscodecs with Wine 1.1.30
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Sep 26 12:48:07 2009 New Revision: 43163 URL:
http://svn.reactos.org/svn/reactos?rev=43163&view=rev
Log: - Sync shlwapi, msxml3 and windowscodecs with Wine 1.1.30 Modified: trunk/reactos/dll/win32/msxml3/element.c trunk/reactos/dll/win32/shlwapi/assoc.c trunk/reactos/dll/win32/shlwapi/ordinal.c trunk/reactos/dll/win32/shlwapi/shlwapi.spec trunk/reactos/dll/win32/shlwapi/string.c trunk/reactos/dll/win32/shlwapi/url.c trunk/reactos/dll/win32/windowscodecs/info.c trunk/reactos/dll/win32/windowscodecs/stream.c Modified: trunk/reactos/dll/win32/msxml3/element.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/element.c…
============================================================================== --- trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -73,6 +73,10 @@ else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) { *ppvObject = IXMLDOMNode_from_impl(This->node); + } + else if(dispex_query_interface(&This->node->dispex, riid, ppvObject)) + { + return *ppvObject ? S_OK : E_NOINTERFACE; } else { @@ -751,6 +755,18 @@ domelem_normalize, }; +static const tid_t domelem_iface_tids[] = { + IXMLDOMElement_tid, + 0 +}; + +static dispex_static_data_t domelem_dispex = { + NULL, + IXMLDOMElement_tid, + NULL, + domelem_iface_tids +}; + IUnknown* create_element( xmlNodePtr element ) { domelem *This; @@ -762,7 +778,7 @@ This->lpVtbl = &domelem_vtbl; This->ref = 1; - This->node = create_basic_node( element, (IUnknown*)&This->lpVtbl, NULL ); + This->node = create_basic_node( element, (IUnknown*)&This->lpVtbl, &domelem_dispex ); if(!This->node) { HeapFree(GetProcessHeap(), 0, This); Modified: trunk/reactos/dll/win32/shlwapi/assoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/assoc.c?…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -1,5 +1,5 @@ /* - * IQueryAssociations object and helper functions + * IQueryAssociations helper functions * * Copyright 2002 Jon Griffiths * @@ -26,67 +26,16 @@ #include "winreg.h" #include "objbase.h" #include "shlguid.h" +#include "shlobj.h" #include "shlwapi.h" -#include "winver.h" #include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); - -/************************************************************************** - * IQueryAssociations {SHLWAPI} - * - * DESCRIPTION - * This object provides a layer of abstraction over the system registry in - * order to simplify the process of parsing associations between files. - * Associations in this context means the registry entries that link (for - * example) the extension of a file with its description, list of - * applications to open the file with, and actions that can be performed on it - * (the shell displays such information in the context menu of explorer - * when you right-click on a file). - * - * HELPERS - * You can use this object transparently by calling the helper functions - * AssocQueryKeyA(), AssocQueryStringA() and AssocQueryStringByKeyA(). These - * create an IQueryAssociations object, perform the requested actions - * and then dispose of the object. Alternatively, you can create an instance - * of the object using AssocCreate() and call the following methods on it: - * - * METHODS - */ /* Default IQueryAssociations::Init() flags */ #define SHLWAPI_DEF_ASSOCF (ASSOCF_INIT_BYEXENAME|ASSOCF_INIT_DEFAULTTOSTAR| \ ASSOCF_INIT_DEFAULTTOFOLDER) - -typedef struct -{ - const IQueryAssociationsVtbl *lpVtbl; - LONG ref; - HKEY hkeySource; - HKEY hkeyProgID; -} IQueryAssociationsImpl; - -static const IQueryAssociationsVtbl IQueryAssociations_vtbl; - -/************************************************************************** - * IQueryAssociations_Constructor [internal] - * - * Construct a new IQueryAssociations object. - */ -static IQueryAssociations* IQueryAssociations_Constructor(void) -{ - IQueryAssociationsImpl* iface; - - iface = HeapAlloc(GetProcessHeap(),0,sizeof(IQueryAssociationsImpl)); - iface->lpVtbl = &IQueryAssociations_vtbl; - iface->ref = 1; - iface->hkeySource = NULL; - iface->hkeyProgID = NULL; - - TRACE("Returning IQueryAssociations* %p\n", iface); - return (IQueryAssociations*)iface; -} /************************************************************************* * SHLWAPI_ParamAToW @@ -139,52 +88,36 @@ */ HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface) { + TRACE("(%s,%s,%p)\n", debugstr_guid(&clsid), debugstr_guid(refiid), + lpInterface); + + if (!lpInterface) + return E_INVALIDARG; + + *(DWORD*)lpInterface = 0; + + if (!IsEqualGUID(&clsid, &CLSID_QueryAssociations)) + return CLASS_E_CLASSNOTAVAILABLE; + + return SHCoCreateInstance( NULL, &clsid, NULL, refiid, lpInterface ); +} + +/************************************************************************* + * AssocQueryKeyW [SHLWAPI.@] + * + * See AssocQueryKeyA. + */ +HRESULT WINAPI AssocQueryKeyW(ASSOCF cfFlags, ASSOCKEY assockey, LPCWSTR pszAssoc, + LPCWSTR pszExtra, HKEY *phkeyOut) +{ HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(%s,%s,%p)\n", debugstr_guid(&clsid), debugstr_guid(refiid), - lpInterface); - - if (!lpInterface) - return E_INVALIDARG; - - *(DWORD*)lpInterface = 0; - - if (!IsEqualGUID(&clsid, &CLSID_QueryAssociations)) - return CLASS_E_CLASSNOTAVAILABLE; - - lpAssoc = IQueryAssociations_Constructor(); - - if (!lpAssoc) - return E_OUTOFMEMORY; - - hRet = IQueryAssociations_QueryInterface(lpAssoc, refiid, lpInterface); - IQueryAssociations_Release(lpAssoc); - - if(hRet == E_NOINTERFACE) - return CLASS_E_CLASSNOTAVAILABLE; - - return hRet; -} - -/************************************************************************* - * AssocQueryKeyW [SHLWAPI.@] - * - * See AssocQueryKeyA. - */ -HRESULT WINAPI AssocQueryKeyW(ASSOCF cfFlags, ASSOCKEY assockey, LPCWSTR pszAssoc, - LPCWSTR pszExtra, HKEY *phkeyOut) -{ - HRESULT hRet; - IQueryAssociations* lpAssoc; - TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc), debugstr_w(pszExtra), phkeyOut); - lpAssoc = IQueryAssociations_Constructor(); - - if (!lpAssoc) - return E_OUTOFMEMORY; + hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void **)&lpAssoc ); + if (FAILED(hRet)) return hRet; cfFlags &= SHLWAPI_DEF_ASSOCF; hRet = IQueryAssociations_Init(lpAssoc, cfFlags, pszAssoc, NULL, NULL); @@ -254,10 +187,8 @@ if (!pcchOut) return E_UNEXPECTED; - lpAssoc = IQueryAssociations_Constructor(); - - if (!lpAssoc) - return E_OUTOFMEMORY; + hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void **)&lpAssoc ); + if (FAILED(hRet)) return hRet; hRet = IQueryAssociations_Init(lpAssoc, cfFlags & SHLWAPI_DEF_ASSOCF, pszAssoc, NULL, NULL); @@ -350,10 +281,8 @@ TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, debugstr_w(pszExtra), pszOut, pcchOut); - lpAssoc = IQueryAssociations_Constructor(); - - if (!lpAssoc) - return E_OUTOFMEMORY; + hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void **)&lpAssoc ); + if (FAILED(hRet)) return hRet; cfFlags &= SHLWAPI_DEF_ASSOCF; hRet = IQueryAssociations_Init(lpAssoc, cfFlags, 0, hkAssoc, NULL); @@ -440,627 +369,3 @@ FIXME("%s\n", debugstr_w(lpszAssoc)); return FALSE; } - -/************************************************************************** - * IQueryAssociations_QueryInterface {SHLWAPI} - * - * See IUnknown_QueryInterface. - */ -static HRESULT WINAPI IQueryAssociations_fnQueryInterface( - IQueryAssociations* iface, - REFIID riid, - LPVOID *ppvObj) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - - TRACE("(%p,%s,%p)\n",This, debugstr_guid(riid), ppvObj); - - *ppvObj = NULL; - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IQueryAssociations)) - { - *ppvObj = This; - - IQueryAssociations_AddRef((IQueryAssociations*)*ppvObj); - TRACE("Returning IQueryAssociations (%p)\n", *ppvObj); - return S_OK; - } - TRACE("Returning E_NOINTERFACE\n"); - return E_NOINTERFACE; -} - -/************************************************************************** - * IQueryAssociations_AddRef {SHLWAPI} - * - * See IUnknown_AddRef. - */ -static ULONG WINAPI IQueryAssociations_fnAddRef(IQueryAssociations *iface) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - ULONG refCount = InterlockedIncrement(&This->ref); - - TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); - - return refCount; -} - -/************************************************************************** - * IQueryAssociations_Release {SHLWAPI} - * - * See IUnknown_Release. - */ -static ULONG WINAPI IQueryAssociations_fnRelease(IQueryAssociations *iface) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - ULONG refCount = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); - - if (!refCount) - { - TRACE("Destroying IQueryAssociations (%p)\n", This); - RegCloseKey(This->hkeySource); - RegCloseKey(This->hkeyProgID); - HeapFree(GetProcessHeap(), 0, This); - } - - return refCount; -} - -/************************************************************************** - * IQueryAssociations_Init {SHLWAPI} - * - * Initialise an IQueryAssociations object. - * - * PARAMS - * iface [I] IQueryAssociations interface to initialise - * cfFlags [I] ASSOCF_ flags from "shlwapi.h" - * pszAssoc [I] String for the root key name, or NULL if hkeyProgid is given - * hkeyProgid [I] Handle for the root key, or NULL if pszAssoc is given - * hWnd [I] Reserved, must be NULL. - * - * RETURNS - * Success: S_OK. iface is initialised with the parameters given. - * Failure: An HRESULT error code indicating the error. - */ -static HRESULT WINAPI IQueryAssociations_fnInit( - IQueryAssociations *iface, - ASSOCF cfFlags, - LPCWSTR pszAssoc, - HKEY hkeyProgid, - HWND hWnd) -{ - static const WCHAR szProgID[] = {'P','r','o','g','I','D',0}; - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - LONG ret; - - TRACE("(%p)->(%d,%s,%p,%p)\n", iface, - cfFlags, - debugstr_w(pszAssoc), - hkeyProgid, - hWnd); - if (hWnd != NULL) - FIXME("hwnd != NULL not supported\n"); - if (cfFlags != 0) - FIXME("unsupported flags: %x\n", cfFlags); - if (pszAssoc != NULL) - { - ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, - pszAssoc, - 0, - KEY_READ, - &This->hkeySource); - if (ret != ERROR_SUCCESS) - return E_FAIL; - /* if this is not a prog id */ - if ((*pszAssoc == '.') || (*pszAssoc == '{')) - { - RegOpenKeyExW(This->hkeySource, - szProgID, - 0, - KEY_READ, - &This->hkeyProgID); - } - else - This->hkeyProgID = This->hkeySource; - return S_OK; - } - else if (hkeyProgid != NULL) - { - This->hkeyProgID = hkeyProgid; - return S_OK; - } - else - return E_INVALIDARG; -} - -static HRESULT ASSOC_GetValue(HKEY hkey, WCHAR ** pszText) -{ - DWORD len; - LONG ret; - - assert(pszText); - ret = RegQueryValueExW(hkey, NULL, 0, NULL, NULL, &len); - if (ret != ERROR_SUCCESS) - return HRESULT_FROM_WIN32(ret); - if (!len) - return E_FAIL; - *pszText = HeapAlloc(GetProcessHeap(), 0, len); - if (!*pszText) - return E_OUTOFMEMORY; - ret = RegQueryValueExW(hkey, NULL, 0, NULL, (LPBYTE)*pszText, - &len); - if (ret != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, *pszText); - return HRESULT_FROM_WIN32(ret); - } - return S_OK; -} - -static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, - LPCWSTR pszExtra, WCHAR **ppszCommand) -{ - HKEY hkeyCommand; - HKEY hkeyFile; - HKEY hkeyShell; - HKEY hkeyVerb; - HRESULT hr; - LONG ret; - WCHAR * pszExtraFromReg = NULL; - WCHAR * pszFileType; - static const WCHAR commandW[] = { 'c','o','m','m','a','n','d',0 }; - static const WCHAR shellW[] = { 's','h','e','l','l',0 }; - - hr = ASSOC_GetValue(This->hkeySource, &pszFileType); - if (FAILED(hr)) - return hr; - ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszFileType, 0, KEY_READ, &hkeyFile); - HeapFree(GetProcessHeap(), 0, pszFileType); - if (ret != ERROR_SUCCESS) - return HRESULT_FROM_WIN32(ret); - - ret = RegOpenKeyExW(hkeyFile, shellW, 0, KEY_READ, &hkeyShell); - RegCloseKey(hkeyFile); - if (ret != ERROR_SUCCESS) - return HRESULT_FROM_WIN32(ret); - - if (!pszExtra) - { - hr = ASSOC_GetValue(hkeyShell, &pszExtraFromReg); - /* if no default action */ - if (hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) - { - DWORD rlen; - ret = RegQueryInfoKeyW(hkeyShell, 0, 0, 0, 0, &rlen, 0, 0, 0, 0, 0, 0); - if (ret != ERROR_SUCCESS) - { - RegCloseKey(hkeyShell); - return HRESULT_FROM_WIN32(ret); - } - rlen++; - pszExtraFromReg = HeapAlloc(GetProcessHeap(), 0, rlen * sizeof(WCHAR)); - if (!pszExtraFromReg) - { - RegCloseKey(hkeyShell); - return E_OUTOFMEMORY; - } - ret = RegEnumKeyExW(hkeyShell, 0, pszExtraFromReg, &rlen, 0, NULL, NULL, NULL); - if (ret != ERROR_SUCCESS) - { - RegCloseKey(hkeyShell); - return HRESULT_FROM_WIN32(ret); - } - } - else if (FAILED(hr)) - { - RegCloseKey(hkeyShell); - return hr; - } - } - - ret = RegOpenKeyExW(hkeyShell, pszExtra ? pszExtra : pszExtraFromReg, 0, - KEY_READ, &hkeyVerb); - HeapFree(GetProcessHeap(), 0, pszExtraFromReg); - RegCloseKey(hkeyShell); - if (ret != ERROR_SUCCESS) - return HRESULT_FROM_WIN32(ret); - - ret = RegOpenKeyExW(hkeyVerb, commandW, 0, KEY_READ, &hkeyCommand); - RegCloseKey(hkeyVerb); - if (ret != ERROR_SUCCESS) - return HRESULT_FROM_WIN32(ret); - hr = ASSOC_GetValue(hkeyCommand, ppszCommand); - RegCloseKey(hkeyCommand); - return hr; -} - -static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This, - LPCWSTR pszExtra, LPWSTR path, - DWORD pathlen, DWORD *len) -{ - WCHAR *pszCommand; - WCHAR *pszStart; - WCHAR *pszEnd; - HRESULT hr; - - assert(len); - - hr = ASSOC_GetCommand(This, pszExtra, &pszCommand); - if (FAILED(hr)) - return hr; - - /* cleanup pszCommand */ - if (pszCommand[0] == '"') - { - pszStart = pszCommand + 1; - pszEnd = strchrW(pszStart, '"'); - } - else - { - pszStart = pszCommand; - pszEnd = strchrW(pszStart, ' '); - } - if (pszEnd) - *pszEnd = 0; - - *len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL); - HeapFree(GetProcessHeap(), 0, pszCommand); - if (!*len) - return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); - return S_OK; -} - -static HRESULT ASSOC_ReturnData(LPWSTR out, DWORD *outlen, LPCWSTR data, - DWORD datalen) -{ - assert(outlen); - - if (out) - { - if (*outlen < datalen) - { - *outlen = datalen; - return E_POINTER; - } - *outlen = datalen; - lstrcpynW(out, data, datalen); - return S_OK; - } - else - { - *outlen = datalen; - return S_FALSE; - } -} - -/************************************************************************** - * IQueryAssociations_GetString {SHLWAPI} - * - * Get a file association string from the registry. - * - * PARAMS - * iface [I] IQueryAssociations interface to query - * cfFlags [I] ASSOCF_ flags from "shlwapi.h" - * str [I] Type of string to get (ASSOCSTR enum from "shlwapi.h") - * pszExtra [I] Extra information about the string location - * pszOut [O] Destination for the association string - * pcchOut [I/O] Length of pszOut - * - * RETURNS - * Success: S_OK. pszOut contains the string, pcchOut contains its length. - * Failure: An HRESULT error code indicating the error. - */ -static HRESULT WINAPI IQueryAssociations_fnGetString( - IQueryAssociations *iface, - ASSOCF cfFlags, - ASSOCSTR str, - LPCWSTR pszExtra, - LPWSTR pszOut, - DWORD *pcchOut) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - const ASSOCF cfUnimplemented = ~(0); - DWORD len = 0; - HRESULT hr; - WCHAR path[MAX_PATH]; - - TRACE("(%p,0x%8x,0x%8x,%s,%p,%p)\n", This, cfFlags, str, - debugstr_w(pszExtra), pszOut, pcchOut); - - if (cfFlags & cfUnimplemented) - FIXME("%08x: unimplemented flags!\n", cfFlags & cfUnimplemented); - - if (!pcchOut) - return E_UNEXPECTED; - - switch (str) - { - case ASSOCSTR_COMMAND: - { - WCHAR *command; - hr = ASSOC_GetCommand(This, pszExtra, &command); - if (SUCCEEDED(hr)) - { - hr = ASSOC_ReturnData(pszOut, pcchOut, command, strlenW(command) + 1); - HeapFree(GetProcessHeap(), 0, command); - } - return hr; - } - - case ASSOCSTR_EXECUTABLE: - { - hr = ASSOC_GetExecutable(This, pszExtra, path, MAX_PATH, &len); - if (FAILED(hr)) - return hr; - len++; - return ASSOC_ReturnData(pszOut, pcchOut, path, len); - } - - case ASSOCSTR_FRIENDLYDOCNAME: - { - WCHAR *pszFileType; - DWORD ret; - DWORD size; - - hr = ASSOC_GetValue(This->hkeySource, &pszFileType); - if (FAILED(hr)) - return hr; - size = 0; - ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); - if (ret == ERROR_SUCCESS) - { - WCHAR *docName = HeapAlloc(GetProcessHeap(), 0, size); - if (docName) - { - ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL, docName, &size); - if (ret == ERROR_SUCCESS) - hr = ASSOC_ReturnData(pszOut, pcchOut, docName, strlenW(docName) + 1); - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, docName); - } - else - hr = E_OUTOFMEMORY; - } - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, pszFileType); - return hr; - } - - case ASSOCSTR_FRIENDLYAPPNAME: - { - PVOID verinfoW = NULL; - DWORD size, retval = 0; - UINT flen; - WCHAR *bufW; - static const WCHAR translationW[] = { - '\\','V','a','r','F','i','l','e','I','n','f','o', - '\\','T','r','a','n','s','l','a','t','i','o','n',0 - }; - static const WCHAR fileDescFmtW[] = { - '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o', - '\\','%','0','4','x','%','0','4','x', - '\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0 - }; - WCHAR fileDescW[41]; - - hr = ASSOC_GetExecutable(This, pszExtra, path, MAX_PATH, &len); - if (FAILED(hr)) - return hr; - - retval = GetFileVersionInfoSizeW(path, &size); - if (!retval) - goto get_friendly_name_fail; - verinfoW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, retval); - if (!verinfoW) - return E_OUTOFMEMORY; - if (!GetFileVersionInfoW(path, 0, retval, verinfoW)) - goto get_friendly_name_fail; - if (VerQueryValueW(verinfoW, translationW, (LPVOID *)&bufW, &flen)) - { - UINT i; - DWORD *langCodeDesc = (DWORD *)bufW; - for (i = 0; i < flen / sizeof(DWORD); i++) - { - sprintfW(fileDescW, fileDescFmtW, LOWORD(langCodeDesc[i]), - HIWORD(langCodeDesc[i])); - if (VerQueryValueW(verinfoW, fileDescW, (LPVOID *)&bufW, &flen)) - { - /* Does strlenW(bufW) == 0 mean we use the filename? */ - len = strlenW(bufW) + 1; - TRACE("found FileDescription: %s\n", debugstr_w(bufW)); - return ASSOC_ReturnData(pszOut, pcchOut, bufW, len); - } - } - } -get_friendly_name_fail: - PathRemoveExtensionW(path); - PathStripPathW(path); - TRACE("using filename: %s\n", debugstr_w(path)); - return ASSOC_ReturnData(pszOut, pcchOut, path, strlenW(path) + 1); - } - - case ASSOCSTR_CONTENTTYPE: - { - static const WCHAR Content_TypeW[] = {'C','o','n','t','e','n','t',' ','T','y','p','e',0}; - WCHAR *contentType; - DWORD ret; - DWORD size; - - size = 0; - ret = RegGetValueW(This->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, NULL, &size); - if (ret != ERROR_SUCCESS) - return HRESULT_FROM_WIN32(ret); - contentType = HeapAlloc(GetProcessHeap(), 0, size); - if (contentType != NULL) - { - ret = RegGetValueW(This->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, contentType, &size); - if (ret == ERROR_SUCCESS) - hr = ASSOC_ReturnData(pszOut, pcchOut, contentType, strlenW(contentType) + 1); - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, contentType); - } - else - hr = E_OUTOFMEMORY; - return hr; - } - - case ASSOCSTR_DEFAULTICON: - { - static const WCHAR DefaultIconW[] = {'D','e','f','a','u','l','t','I','c','o','n',0}; - WCHAR *pszFileType; - DWORD ret; - DWORD size; - HKEY hkeyFile; - - hr = ASSOC_GetValue(This->hkeySource, &pszFileType); - if (FAILED(hr)) - return hr; - ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszFileType, 0, KEY_READ, &hkeyFile); - if (ret == ERROR_SUCCESS) - { - size = 0; - ret = RegGetValueW(hkeyFile, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); - if (ret == ERROR_SUCCESS) - { - WCHAR *icon = HeapAlloc(GetProcessHeap(), 0, size); - if (icon) - { - ret = RegGetValueW(hkeyFile, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon, &size); - if (ret == ERROR_SUCCESS) - hr = ASSOC_ReturnData(pszOut, pcchOut, icon, strlenW(icon) + 1); - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, icon); - } - else - hr = E_OUTOFMEMORY; - } - else - hr = HRESULT_FROM_WIN32(ret); - RegCloseKey(hkeyFile); - } - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, pszFileType); - return hr; - } - - default: - FIXME("assocstr %d unimplemented!\n", str); - return E_NOTIMPL; - } -} - -/************************************************************************** - * IQueryAssociations_GetKey {SHLWAPI} - * - * Get a file association key from the registry. - * - * PARAMS - * iface [I] IQueryAssociations interface to query - * cfFlags [I] ASSOCF_ flags from "shlwapi.h" - * assockey [I] Type of key to get (ASSOCKEY enum from "shlwapi.h") - * pszExtra [I] Extra information about the key location - * phkeyOut [O] Destination for the association key - * - * RETURNS - * Success: S_OK. phkeyOut contains a handle to the key. - * Failure: An HRESULT error code indicating the error. - */ -static HRESULT WINAPI IQueryAssociations_fnGetKey( - IQueryAssociations *iface, - ASSOCF cfFlags, - ASSOCKEY assockey, - LPCWSTR pszExtra, - HKEY *phkeyOut) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - - FIXME("(%p,0x%8x,0x%8x,%s,%p)-stub!\n", This, cfFlags, assockey, - debugstr_w(pszExtra), phkeyOut); - return E_NOTIMPL; -} - -/************************************************************************** - * IQueryAssociations_GetData {SHLWAPI} - * - * Get the data for a file association key from the registry. - * - * PARAMS - * iface [I] IQueryAssociations interface to query - * cfFlags [I] ASSOCF_ flags from "shlwapi.h" - * assocdata [I] Type of data to get (ASSOCDATA enum from "shlwapi.h") - * pszExtra [I] Extra information about the data location - * pvOut [O] Destination for the association key - * pcbOut [I/O] Size of pvOut - * - * RETURNS - * Success: S_OK. pszOut contains the data, pcbOut contains its length. - * Failure: An HRESULT error code indicating the error. - */ -static HRESULT WINAPI IQueryAssociations_fnGetData( - IQueryAssociations *iface, - ASSOCF cfFlags, - ASSOCDATA assocdata, - LPCWSTR pszExtra, - LPVOID pvOut, - DWORD *pcbOut) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - - FIXME("(%p,0x%8x,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, assocdata, - debugstr_w(pszExtra), pvOut, pcbOut); - return E_NOTIMPL; -} - -/************************************************************************** - * IQueryAssociations_GetEnum {SHLWAPI} - * - * Not yet implemented in native Win32. - * - * PARAMS - * iface [I] IQueryAssociations interface to query - * cfFlags [I] ASSOCF_ flags from "shlwapi.h" - * assocenum [I] Type of enum to get (ASSOCENUM enum from "shlwapi.h") - * pszExtra [I] Extra information about the enum location - * riid [I] REFIID to look for - * ppvOut [O] Destination for the interface. - * - * RETURNS - * Success: S_OK. - * Failure: An HRESULT error code indicating the error. - * - * NOTES - * Presumably this function returns an enumerator object. - */ -static HRESULT WINAPI IQueryAssociations_fnGetEnum( - IQueryAssociations *iface, - ASSOCF cfFlags, - ASSOCENUM assocenum, - LPCWSTR pszExtra, - REFIID riid, - LPVOID *ppvOut) -{ - IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - - FIXME("(%p,0x%8x,0x%8x,%s,%s,%p)-stub!\n", This, cfFlags, assocenum, - debugstr_w(pszExtra), debugstr_guid(riid), ppvOut); - return E_NOTIMPL; -} - -static const IQueryAssociationsVtbl IQueryAssociations_vtbl = -{ - IQueryAssociations_fnQueryInterface, - IQueryAssociations_fnAddRef, - IQueryAssociations_fnRelease, - IQueryAssociations_fnInit, - IQueryAssociations_fnGetString, - IQueryAssociations_fnGetKey, - IQueryAssociations_fnGetData, - IQueryAssociations_fnGetEnum -}; Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -1472,6 +1472,43 @@ IUnknown_Release(pService); } return hRet; +} + +/************************************************************************* + * @ [SHLWAPI.479] + * + * Call an object's UIActivateIO method. + * + * PARAMS + * unknown [I] Object to call the UIActivateIO method on + * activate [I] Parameter for UIActivateIO call + * msg [I] Parameter for UIActivateIO call + * + * RETURNS + * Success: Value of UI_ActivateIO call + * Failure: An HRESULT error code + * + * NOTES + * unknown is expected to support the IInputObject interface. + */ +HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg) +{ + IInputObject* object = NULL; + HRESULT ret; + + if (!unknown) + return E_FAIL; + + /* Get an IInputObject interface from the object */ + ret = IUnknown_QueryInterface(unknown, &IID_IInputObject, (LPVOID*) &object); + + if (ret == S_OK) + { + ret = IInputObject_UIActivateIO(object, activate, msg); + IUnknown_Release(object); + } + + return ret; } /************************************************************************* @@ -4532,3 +4569,131 @@ return psd; } + +/*********************************************************************** + * SHCreatePropertyBagOnRegKey [SHLWAPI.471] + * + * Creates a property bag from a registry key + * + * PARAMS + * hKey [I] Handle to the desired registry key + * subkey [I] Name of desired subkey, or NULL to open hKey directly + * grfMode [I] Optional flags + * riid [I] IID of requested property bag interface + * ppv [O] Address to receive pointer to the new interface + * + * RETURNS + * success: 0 + * failure: error code + * + */ +HRESULT WINAPI SHCreatePropertyBagOnRegKey (HKEY hKey, LPCWSTR subkey, + DWORD grfMode, REFIID riid, void **ppv) +{ + FIXME("%p %s %d %s %p STUB\n", hKey, debugstr_w(subkey), grfMode, + debugstr_guid(riid), ppv); + + return E_NOTIMPL; +} + +/*********************************************************************** + * SHGetViewStatePropertyBag [SHLWAPI.515] + * + * Retrieves a property bag in which the view state information of a folder + * can be stored. + * + * PARAMS + * pidl [I] PIDL of the folder requested + * bag_name [I] Name of the property bag requested + * flags [I] Optional flags + * riid [I] IID of requested property bag interface + * ppv [O] Address to receive pointer to the new interface + * + * RETURNS + * success: S_OK + * failure: error code + * + */ +HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPWSTR bag_name, + DWORD flags, REFIID riid, void **ppv) +{ + FIXME("%p %s %d %s %p STUB\n", pidl, debugstr_w(bag_name), flags, + debugstr_guid(riid), ppv); + + return E_NOTIMPL; +} + +/*********************************************************************** + * SHFormatDateTimeW [SHLWAPI.354] + * + * Produces a string representation of a time. + * + * PARAMS + * fileTime [I] Pointer to FILETIME structure specifying the time + * flags [I] Flags specifying the desired output + * buf [O] Pointer to buffer for output + * bufSize [I] Number of characters that can be contained in buffer + * + * RETURNS + * success: number of characters written to the buffer + * failure: 0 + * + */ +INT WINAPI SHFormatDateTimeW(const FILETIME UNALIGNED *fileTime, DWORD *flags, + LPWSTR buf, UINT bufSize) +{ + FIXME("%p %p %s %d STUB\n", fileTime, flags, debugstr_w(buf), bufSize); + return 0; +} + +/*********************************************************************** + * SHFormatDateTimeA [SHLWAPI.353] + * + * See SHFormatDateTimeW. + * + */ +INT WINAPI SHFormatDateTimeA(const FILETIME UNALIGNED *fileTime, DWORD *flags, + LPCSTR buf, UINT bufSize) +{ + WCHAR *bufW; + DWORD buflenW, convlen; + INT retval; + + if (!buf || !bufSize) + return 0; + + buflenW = bufSize; + bufW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * buflenW); + retval = SHFormatDateTimeW(fileTime, flags, bufW, buflenW); + + if (retval != 0) + convlen = WideCharToMultiByte(CP_ACP, 0, bufW, -1, (LPSTR) buf, bufSize, NULL, NULL); + + HeapFree(GetProcessHeap(), 0, bufW); + return retval; +} + +/*********************************************************************** + * ZoneCheckUrlExW [SHLWAPI.231] + * + * Checks the details of the security zone for the supplied site. (?) + * + * PARAMS + * + * szURL [I] Pointer to the URL to check + * + * Other parameters currently unknown. + * + * RETURNS + * unknown + */ + +INT WINAPI ZoneCheckUrlExW(LPWSTR szURL, PVOID pUnknown, DWORD dwUnknown2, + DWORD dwUnknown3, DWORD dwUnknown4, DWORD dwUnknown5, DWORD dwUnknown6, + DWORD dwUnknown7) +{ + FIXME("(%s,%p,%x,%x,%x,%x,%x,%x) STUB\n", debugstr_w(szURL), pUnknown, dwUnknown2, + dwUnknown3, dwUnknown4, dwUnknown5, dwUnknown6, dwUnknown7); + + return 0; +} Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -228,7 +228,7 @@ 228 stub -noname ZoneCheckUrlA 229 stub -noname ZoneCheckUrlW 230 stub -noname ZoneCheckUrlExA -231 stub -noname ZoneCheckUrlExW +231 stdcall -noname ZoneCheckUrlExW(wstr ptr long long long long long long) 232 stub -noname ZoneCheckUrlExCacheA 233 stub -noname ZoneCheckUrlExCacheW 234 stub -noname ZoneCheckHost @@ -350,8 +350,8 @@ 350 stdcall -noname GetFileVersionInfoSizeWrapW(wstr ptr) 351 stdcall -noname GetFileVersionInfoWrapW(wstr long long ptr) 352 stdcall -noname VerQueryValueWrapW(ptr wstr ptr ptr) -353 stub -noname SHFormatDateTimeA -354 stub -noname SHFormatDateTimeW +353 stdcall -noname SHFormatDateTimeA(ptr ptr str long) +354 stdcall -noname SHFormatDateTimeW(ptr ptr wstr long) 355 stdcall -noname IUnknown_EnableModeless(ptr long) 356 stdcall -noname CreateAllAccessSecurityAttributes(ptr ptr long) 357 stdcall -noname SHGetNewLinkInfoWrapW(wstr wstr wstr long long) @@ -459,7 +459,7 @@ 459 stdcall -noname SHExpandEnvironmentStringsA(str ptr long) kernel32.ExpandEnvironmentStringsA 460 stdcall -noname SHExpandEnvironmentStringsW(wstr ptr long) kernel32.ExpandEnvironmentStringsW 461 stdcall -noname SHGetAppCompatFlags(long) -462 stub -noname UrlFixupW +462 stdcall -noname UrlFixupW(wstr wstr long) 463 stub -noname SHExpandEnvironmentStringsForUserA 464 stub -noname SHExpandEnvironmentStringsForUserW 465 stub -noname PathUnExpandEnvStringsForUserA @@ -468,7 +468,7 @@ 468 stub -noname RunIndirectRegCommand 469 stub -noname RunRegCommand 470 stub -noname IUnknown_ProfferServiceOld -471 stub -noname SHCreatePropertyBagOnRegKey +471 stdcall -noname SHCreatePropertyBagOnRegKey(long wstr long ptr ptr) 472 stub -noname SHCreatePropertyBagOnProfileSelection 473 stub -noname SHGetIniStringUTF7W 474 stub -noname SHSetIniStringUTF7W @@ -476,7 +476,7 @@ 476 stub -noname SHGetObjectCompatFlags 477 stub -noname SHCreatePropertyBagOnMemory 478 stdcall -noname IUnknown_TranslateAcceleratorIO(ptr ptr) -479 stub -noname IUnknown_UIActivateIO +479 stdcall -noname IUnknown_UIActivateIO(ptr long ptr) 480 stdcall -noname UrlCrackW(wstr long long ptr) wininet.InternetCrackUrlW 481 stdcall -noname IUnknown_HasFocusIO(ptr) 482 stub -noname SHMessageBoxHelpA @@ -508,7 +508,7 @@ 512 stub -noname IStream_ReadPidl 513 stub -noname IStream_WritePidl 514 stdcall -noname IUnknown_ProfferService(ptr ptr ptr ptr) -515 stub -noname SHGetViewStatePropertyBag +515 stdcall -noname SHGetViewStatePropertyBag(ptr wstr long ptr ptr) 516 stdcall -noname SKGetValueW(long wstr wstr long long long) 517 stub -noname SKSetValueW 518 stub -noname SKDeleteValueW @@ -757,6 +757,7 @@ @ stdcall StrChrA (str long) @ stdcall StrChrIA (str long) @ stdcall StrChrIW (wstr long) +@ stdcall StrChrNW(wstr long long) @ stdcall StrChrW (wstr long) @ stdcall StrCmpIW (wstr wstr) @ stdcall StrCmpLogicalW(wstr wstr) Modified: trunk/reactos/dll/win32/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -316,6 +316,25 @@ lpszStr = NULL; } return (LPWSTR)lpszStr; +} + +/************************************************************************* + * StrChrNW [SHLWAPI.@] + */ +LPWSTR WINAPI StrChrNW(LPCWSTR lpszStr, WCHAR ch, UINT cchMax) +{ + TRACE("(%s(%i),%i)\n", debugstr_wn(lpszStr,cchMax), cchMax, ch); + + if (lpszStr) + { + while (*lpszStr && cchMax-- > 0) + { + if (*lpszStr == ch) + return (LPWSTR)lpszStr; + lpszStr++; + } + } + return NULL; } /************************************************************************* Modified: trunk/reactos/dll/win32/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -2382,3 +2382,35 @@ } return hRet; } + +/*********************************************************************** + * UrlFixupW [SHLWAPI.462] + * + * Checks the scheme part of a URL and attempts to correct misspellings. + * + * PARAMS + * lpszUrl [I] Pointer to the URL to be corrected + * lpszTranslatedUrl [O] Pointer to a buffer to store corrected URL + * dwMaxChars [I] Maximum size of corrected URL + * + * RETURNS + * success: S_OK if URL corrected or already correct + * failure: S_FALSE if unable to correct / COM error code if other error + * + */ +HRESULT WINAPI UrlFixupW(LPCWSTR url, LPWSTR translatedUrl, DWORD maxChars) +{ + DWORD srcLen; + + FIXME("(%s,%p,%d) STUB\n", debugstr_w(url), translatedUrl, maxChars); + + if (!url) + return E_FAIL; + + srcLen = lstrlenW(url); + + /* For now just copy the URL directly */ + lstrcpynW(translatedUrl, url, (maxChars < srcLen) ? maxChars : srcLen); + + return S_OK; +} Modified: trunk/reactos/dll/win32/windowscodecs/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/in…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/info.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/info.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -952,7 +952,7 @@ list_add_tail(&This->objects, &item->entry); } - if (!SUCCEEDED(hr)) + if (FAILED(hr)) { HeapFree(GetProcessHeap(), 0, item); hr = S_OK; Modified: trunk/reactos/dll/win32/windowscodecs/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/st…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/stream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/stream.c [iso-8859-1] Sat Sep 26 12:48:07 2009 @@ -129,13 +129,12 @@ LARGE_INTEGER NewPosition; TRACE("(%p)\n", This); - if (dlibMove.QuadPart > 0xFFFFFFFF) return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); - if (dwOrigin == STREAM_SEEK_SET) NewPosition.QuadPart = dlibMove.QuadPart; else if (dwOrigin == STREAM_SEEK_CUR) NewPosition.QuadPart = This->dwCurPos + dlibMove.QuadPart; else if (dwOrigin == STREAM_SEEK_END) NewPosition.QuadPart = This->dwMemsize + dlibMove.QuadPart; else return E_INVALIDARG; + if (NewPosition.u.HighPart) return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); if (NewPosition.QuadPart > This->dwMemsize) return E_INVALIDARG; if (NewPosition.QuadPart < 0) return E_INVALIDARG; This->dwCurPos = NewPosition.u.LowPart;
15 years, 3 months
1
0
0
0
[dchapyshev] 43162: - Sync crypt32 with Wine 1.1.30
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Sep 26 12:46:37 2009 New Revision: 43162 URL:
http://svn.reactos.org/svn/reactos?rev=43162&view=rev
Log: - Sync crypt32 with Wine 1.1.30 Modified: trunk/reactos/dll/win32/crypt32/chain.c trunk/reactos/dll/win32/crypt32/msg.c trunk/reactos/dll/win32/crypt32/store.c trunk/reactos/dll/win32/crypt32/str.c Modified: trunk/reactos/dll/win32/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/chain.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] Sat Sep 26 12:46:37 2009 @@ -1567,12 +1567,7 @@ SetLastError(ERROR_INVALID_DATA); return FALSE; } - if (pChainPara->cbSize != sizeof(CERT_CHAIN_PARA_NO_EXTRA_FIELDS) && - pChainPara->cbSize != sizeof(CERT_CHAIN_PARA)) - { - SetLastError(E_INVALIDARG); - return FALSE; - } + if (!hChainEngine) hChainEngine = CRYPT_GetDefaultChainEngine(); /* FIXME: what about HCCE_LOCAL_MACHINE? */ Modified: trunk/reactos/dll/win32/crypt32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/msg.c?re…
============================================================================== --- trunk/reactos/dll/win32/crypt32/msg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/msg.c [iso-8859-1] Sat Sep 26 12:46:37 2009 @@ -2410,6 +2410,20 @@ else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; + case CMSG_ENCODED_SIGNER: + if (msg->u.signed_data.info) + { + if (dwIndex >= msg->u.signed_data.info->cSignerInfo) + SetLastError(CRYPT_E_INVALID_INDEX); + else + ret = CryptEncodeObjectEx( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, CMS_SIGNER_INFO, + &msg->u.signed_data.info->rgSignerInfo[dwIndex], 0, NULL, + pvData, pcbData); + } + else + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + break; case CMSG_ATTR_CERT_COUNT_PARAM: if (msg->u.signed_data.info) { Modified: trunk/reactos/dll/win32/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/store.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/store.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/store.c [iso-8859-1] Sat Sep 26 12:46:37 2009 @@ -978,7 +978,8 @@ ret = FALSE; else ret = hcs->certs.deleteContext(hcs, (void *)pCertContext); - CertFreeCertificateContext(pCertContext); + if (ret) + CertFreeCertificateContext(pCertContext); } return ret; } Modified: trunk/reactos/dll/win32/crypt32/str.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/str.c?re…
============================================================================== --- trunk/reactos/dll/win32/crypt32/str.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/str.c [iso-8859-1] Sat Sep 26 12:46:37 2009 @@ -930,10 +930,65 @@ return ret; } +/* Searches cert's extensions for the alternate name extension with OID + * altNameOID, and if found, searches it for the alternate name type entryType. + * If found, returns a pointer to the entry, otherwise returns NULL. + * Regardless of whether an entry of the desired type is found, if the + * alternate name extension is present, sets *info to the decoded alternate + * name extension, which you must free using LocalFree. + * The return value is a pointer within *info, so don't free *info before + * you're done with the return value. + */ +static PCERT_ALT_NAME_ENTRY cert_find_alt_name_entry(PCCERT_CONTEXT cert, + LPCSTR altNameOID, DWORD entryType, PCERT_ALT_NAME_INFO *info) +{ + PCERT_ALT_NAME_ENTRY entry = NULL; + PCERT_EXTENSION ext = CertFindExtension(altNameOID, + cert->pCertInfo->cExtension, cert->pCertInfo->rgExtension); + + if (ext) + { + DWORD bytes = 0; + + if (CryptDecodeObjectEx(cert->dwCertEncodingType, X509_ALTERNATE_NAME, + ext->Value.pbData, ext->Value.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, + info, &bytes)) + { + DWORD i; + + for (i = 0; !entry && i < (*info)->cAltEntry; i++) + if ((*info)->rgAltEntry[i].dwAltNameChoice == entryType) + entry = &(*info)->rgAltEntry[i]; + } + } + else + *info = NULL; + return entry; +} + +static DWORD cert_get_name_from_rdn_attr(DWORD encodingType, + PCERT_NAME_BLOB name, LPCSTR oid, LPWSTR pszNameString, DWORD cchNameString) +{ + CERT_NAME_INFO *nameInfo; + DWORD bytes = 0, ret = 0; + + if (CryptDecodeObjectEx(encodingType, X509_NAME, name->pbData, + name->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &nameInfo, &bytes)) + { + PCERT_RDN_ATTR nameAttr = CertFindRDNAttr(oid, nameInfo); + + if (nameAttr) + ret = CertRDNValueToStrW(nameAttr->dwValueType, &nameAttr->Value, + pszNameString, cchNameString); + LocalFree(nameInfo); + } + return ret; +} + DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString) { - DWORD ret; + DWORD ret = 0; PCERT_NAME_BLOB name; LPCSTR altNameOID; @@ -953,50 +1008,113 @@ switch (dwType) { + case CERT_NAME_EMAIL_TYPE: + { + CERT_ALT_NAME_INFO *info; + PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext, + altNameOID, CERT_ALT_NAME_RFC822_NAME, &info); + + if (entry) + { + if (!pszNameString) + ret = strlenW(entry->pwszRfc822Name) + 1; + else if (cchNameString) + { + ret = min(strlenW(entry->pwszRfc822Name), cchNameString - 1); + memcpy(pszNameString, entry->pwszRfc822Name, + ret * sizeof(WCHAR)); + pszNameString[ret++] = 0; + } + } + if (info) + LocalFree(info); + if (!ret) + ret = cert_get_name_from_rdn_attr(pCertContext->dwCertEncodingType, + name, szOID_RSA_emailAddr, pszNameString, cchNameString); + break; + } + case CERT_NAME_RDN_TYPE: + if (name->cbData) + ret = CertNameToStrW(pCertContext->dwCertEncodingType, name, + *(DWORD *)pvTypePara, pszNameString, cchNameString); + else + { + CERT_ALT_NAME_INFO *info; + PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext, + altNameOID, CERT_ALT_NAME_DIRECTORY_NAME, &info); + + if (entry) + ret = CertNameToStrW(pCertContext->dwCertEncodingType, + &entry->DirectoryName, *(DWORD *)pvTypePara, pszNameString, + cchNameString); + if (info) + LocalFree(info); + } + break; + case CERT_NAME_ATTR_TYPE: + ret = cert_get_name_from_rdn_attr(pCertContext->dwCertEncodingType, + name, pvTypePara, pszNameString, cchNameString); + if (!ret) + { + CERT_ALT_NAME_INFO *altInfo; + PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext, + altNameOID, CERT_ALT_NAME_DIRECTORY_NAME, &altInfo); + + if (entry) + ret = cert_name_to_str_with_indent(X509_ASN_ENCODING, 0, + &entry->DirectoryName, 0, pszNameString, cchNameString); + if (altInfo) + LocalFree(altInfo); + } + break; case CERT_NAME_SIMPLE_DISPLAY_TYPE: { static const LPCSTR simpleAttributeOIDs[] = { szOID_COMMON_NAME, szOID_ORGANIZATIONAL_UNIT_NAME, szOID_ORGANIZATION_NAME, szOID_RSA_emailAddr }; - CERT_NAME_INFO *info = NULL; - PCERT_RDN_ATTR nameAttr = NULL; + CERT_NAME_INFO *nameInfo = NULL; DWORD bytes = 0, i; if (CryptDecodeObjectEx(pCertContext->dwCertEncodingType, X509_NAME, - name->pbData, name->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, + name->pbData, name->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &nameInfo, &bytes)) { + PCERT_RDN_ATTR nameAttr = NULL; + for (i = 0; !nameAttr && i < sizeof(simpleAttributeOIDs) / sizeof(simpleAttributeOIDs[0]); i++) - nameAttr = CertFindRDNAttr(simpleAttributeOIDs[i], info); - } - if (!nameAttr) - { - PCERT_EXTENSION ext = CertFindExtension(altNameOID, - pCertContext->pCertInfo->cExtension, - pCertContext->pCertInfo->rgExtension); - - if (ext) - { - for (i = 0; !nameAttr && i < sizeof(simpleAttributeOIDs) / - sizeof(simpleAttributeOIDs[0]); i++) - nameAttr = CertFindRDNAttr(simpleAttributeOIDs[i], info); - if (!nameAttr) - { - /* FIXME: gotta then look for a rfc822Name choice in ext. - * Failing that, look for the first attribute. - */ - FIXME("CERT_NAME_SIMPLE_DISPLAY_TYPE: stub\n"); - } - } - } - if (nameAttr) - ret = CertRDNValueToStrW(nameAttr->dwValueType, &nameAttr->Value, - pszNameString, cchNameString); - else - ret = 0; - if (info) - LocalFree(info); + nameAttr = CertFindRDNAttr(simpleAttributeOIDs[i], nameInfo); + if (nameAttr) + ret = CertRDNValueToStrW(nameAttr->dwValueType, + &nameAttr->Value, pszNameString, cchNameString); + LocalFree(nameInfo); + } + if (!ret) + { + CERT_ALT_NAME_INFO *altInfo; + PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext, + altNameOID, CERT_ALT_NAME_RFC822_NAME, &altInfo); + + if (altInfo) + { + if (!entry && altInfo->cAltEntry) + entry = &altInfo->rgAltEntry[0]; + if (entry) + { + if (!pszNameString) + ret = strlenW(entry->pwszRfc822Name) + 1; + else if (cchNameString) + { + ret = min(strlenW(entry->pwszRfc822Name), + cchNameString - 1); + memcpy(pszNameString, entry->pwszRfc822Name, + ret * sizeof(WCHAR)); + pszNameString[ret++] = 0; + } + } + LocalFree(altInfo); + } + } break; } case CERT_NAME_FRIENDLY_DISPLAY_TYPE: @@ -1012,9 +1130,64 @@ cchNameString); break; } + case CERT_NAME_DNS_TYPE: + { + CERT_ALT_NAME_INFO *info; + PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext, + altNameOID, CERT_ALT_NAME_DNS_NAME, &info); + + if (entry) + { + if (!pszNameString) + ret = strlenW(entry->pwszDNSName) + 1; + else if (cchNameString) + { + ret = min(strlenW(entry->pwszDNSName), cchNameString - 1); + memcpy(pszNameString, entry->pwszDNSName, ret * sizeof(WCHAR)); + pszNameString[ret++] = 0; + } + } + if (info) + LocalFree(info); + if (!ret) + ret = cert_get_name_from_rdn_attr(pCertContext->dwCertEncodingType, + name, szOID_COMMON_NAME, pszNameString, cchNameString); + break; + } + case CERT_NAME_URL_TYPE: + { + CERT_ALT_NAME_INFO *info; + PCERT_ALT_NAME_ENTRY entry = cert_find_alt_name_entry(pCertContext, + altNameOID, CERT_ALT_NAME_URL, &info); + + if (entry) + { + if (!pszNameString) + ret = strlenW(entry->pwszURL) + 1; + else if (cchNameString) + { + ret = min(strlenW(entry->pwszURL), cchNameString - 1); + memcpy(pszNameString, entry->pwszURL, ret * sizeof(WCHAR)); + pszNameString[ret++] = 0; + } + } + if (info) + LocalFree(info); + break; + } default: FIXME("unimplemented for type %d\n", dwType); ret = 0; } - return ret; -} + if (!ret) + { + if (!pszNameString) + ret = 1; + else if (cchNameString) + { + pszNameString[0] = 0; + ret = 1; + } + } + return ret; +}
15 years, 3 months
1
0
0
0
[dchapyshev] 43161: - Sync comctl32/comdlg32 with Wine 1.1.30
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Sep 26 12:45:59 2009 New Revision: 43161 URL:
http://svn.reactos.org/svn/reactos?rev=43161&view=rev
Log: - Sync comctl32/comdlg32 with Wine 1.1.30 Modified: trunk/reactos/dll/win32/comctl32/comctl32.h trunk/reactos/dll/win32/comctl32/comctl32.spec trunk/reactos/dll/win32/comctl32/comctl32undoc.c trunk/reactos/dll/win32/comctl32/dpa.c trunk/reactos/dll/win32/comctl32/header.c trunk/reactos/dll/win32/comctl32/listview.c trunk/reactos/dll/win32/comctl32/monthcal.c trunk/reactos/dll/win32/comctl32/trackbar.c trunk/reactos/dll/win32/comctl32/updown.c trunk/reactos/dll/win32/comdlg32/filedlg.c Modified: trunk/reactos/dll/win32/comctl32/comctl32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32.h [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -182,18 +182,6 @@ INT WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT); INT WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT); - -INT WINAPI DPA_GetPtrIndex (HDPA, LPCVOID); -BOOL WINAPI DPA_Grow (HDPA, INT); - -#define DPAM_NOSORT 0x0001 -#define DPAM_INSERT 0x0004 -#define DPAM_DELETE 0x0008 - -typedef PVOID (CALLBACK *PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM); -BOOL WINAPI DPA_Merge (HDPA, HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM); - -#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet); BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2); Modified: trunk/reactos/dll/win32/comctl32/comctl32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -125,6 +125,7 @@ @ stdcall DestroyPropertySheetPage(long) @ stdcall -private DllGetVersion(ptr) @ stdcall -private DllInstall(long wstr) +@ stdcall DPA_GetSize(ptr) @ stdcall DrawShadowText(long wstr long ptr long long long long long) @ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA @ stdcall DrawStatusTextW(long ptr wstr long) Modified: trunk/reactos/dll/win32/comctl32/comctl32undoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32undoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32undoc.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -206,6 +206,10 @@ * - Free an MRU-list with FreeMRUList(). */ +typedef INT (CALLBACK *MRUStringCmpFnA)(LPCSTR lhs, LPCSTR rhs); +typedef INT (CALLBACK *MRUStringCmpFnW)(LPCWSTR lhs, LPCWSTR rhs); +typedef INT (CALLBACK *MRUBinaryCmpFn)(LPCVOID lhs, LPCVOID rhs, DWORD length); + typedef struct tagCREATEMRULISTA { DWORD cbSize; @@ -213,7 +217,11 @@ DWORD dwFlags; HKEY hKey; LPSTR lpszSubKey; - PROC lpfnCompare; + union + { + MRUStringCmpFnA string_cmpfn; + MRUBinaryCmpFn binary_cmpfn; + } u; } CREATEMRULISTA, *LPCREATEMRULISTA; typedef struct tagCREATEMRULISTW @@ -223,7 +231,11 @@ DWORD dwFlags; HKEY hKey; LPWSTR lpszSubKey; - PROC lpfnCompare; + union + { + MRUStringCmpFnW string_cmpfn; + MRUBinaryCmpFn binary_cmpfn; + } u; } CREATEMRULISTW, *LPCREATEMRULISTW; /* dwFlags */ @@ -385,7 +397,7 @@ UINT i; LPSTR dataA = NULL; - if (!mp || !mp->extview.lpfnCompare) + if (!mp || !mp->extview.u.string_cmpfn) return -1; if(!(mp->extview.dwFlags & MRUF_BINARY_LIST) && !mp->isUnicode) { @@ -397,13 +409,12 @@ for(i=0; i<mp->cursize; i++) { if (mp->extview.dwFlags & MRUF_BINARY_LIST) { - if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart, - cbData)) + if (!mp->extview.u.binary_cmpfn(lpData, &mp->array[i]->datastart, cbData)) break; } else { if(mp->isUnicode) { - if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart)) + if (!mp->extview.u.string_cmpfn(lpData, (LPWSTR)&mp->array[i]->datastart)) break; } else { DWORD len = WideCharToMultiByte(CP_ACP, 0, @@ -414,7 +425,7 @@ WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&mp->array[i]->datastart, -1, itemA, len, NULL, NULL); - cmp = mp->extview.lpfnCompare(dataA, itemA); + cmp = mp->extview.u.string_cmpfn((LPWSTR)dataA, (LPWSTR)itemA); Free(itemA); if(!cmp) break; @@ -672,7 +683,7 @@ ERR("(%u %u %x %p %s %p): Could not open key, error=%d\n", mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags, mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), - mp->extview.lpfnCompare, err); + mp->extview.u.string_cmpfn, err); return 0; } @@ -717,7 +728,7 @@ TRACE("(%u %u %x %p %s %p): Current Size = %d\n", mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags, mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), - mp->extview.lpfnCompare, mp->cursize); + mp->extview.u.string_cmpfn, mp->cursize); return mp; } Modified: trunk/reactos/dll/win32/comctl32/dpa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/dpa.c?r…
============================================================================== --- trunk/reactos/dll/win32/comctl32/dpa.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/dpa.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -45,14 +45,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(dpa); -struct _DPA +typedef struct _DPA { INT nItemCount; LPVOID *ptrs; HANDLE hHeap; INT nGrow; INT nMaxCount; -}; +} DPA; typedef struct _STREAMDATA { @@ -61,15 +61,6 @@ DWORD dwItems; } STREAMDATA, *PSTREAMDATA; -typedef struct _LOADDATA -{ - INT nCount; - PVOID ptr; -} LOADDATA, *LPLOADDATA; - -typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM); - - /************************************************************************** * DPA_LoadStream [COMCTL32.9] * @@ -79,29 +70,29 @@ * phDpa [O] pointer to a handle to a dynamic pointer array * loadProc [I] pointer to a callback function * pStream [I] pointer to a stream - * lParam [I] application specific value - * - * RETURNS - * Success: TRUE - * Failure: FALSE + * pData [I] pointer to callback data + * + * RETURNS + * Success: S_OK, S_FALSE - partial success + * Failure: HRESULT error code * * NOTES * No more information available yet! */ -HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc, - IStream *pStream, LPARAM lParam) +HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, PFNDPASTREAM loadProc, + IStream *pStream, LPVOID pData) { HRESULT errCode; LARGE_INTEGER position; - ULARGE_INTEGER newPosition; + ULARGE_INTEGER initial_pos; STREAMDATA streamData; - LOADDATA loadData; + DPASTREAMINFO streamInfo; ULONG ulRead; HDPA hDpa; PVOID *ptr; - FIXME ("phDpa=%p loadProc=%p pStream=%p lParam=%lx\n", - phDpa, loadProc, pStream, lParam); + TRACE ("phDpa=%p loadProc=%p pStream=%p pData=%p\n", + phDpa, loadProc, pStream, pData); if (!phDpa || !loadProc || !pStream) return E_INVALIDARG; @@ -110,27 +101,24 @@ position.QuadPart = 0; - /* - * Zero out our streamData - */ - memset(&streamData,0,sizeof(STREAMDATA)); - - errCode = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &newPosition); + errCode = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &initial_pos); if (errCode != S_OK) return errCode; + memset(&streamData, 0, sizeof(STREAMDATA)); errCode = IStream_Read (pStream, &streamData, sizeof(STREAMDATA), &ulRead); if (errCode != S_OK) return errCode; - FIXME ("dwSize=%u dwData2=%u dwItems=%u\n", + TRACE ("dwSize=%u dwData2=%u dwItems=%u\n", streamData.dwSize, streamData.dwData2, streamData.dwItems); - if ( ulRead < sizeof(STREAMDATA) || - lParam < sizeof(STREAMDATA) || - streamData.dwSize < sizeof(STREAMDATA) || - streamData.dwData2 < 1) { - errCode = E_FAIL; + if (ulRead < sizeof(STREAMDATA) || + streamData.dwSize < sizeof(STREAMDATA) || streamData.dwData2 != 1) { + /* back to initial position */ + position.QuadPart = initial_pos.QuadPart; + IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL); + return E_FAIL; } if (streamData.dwItems > (UINT_MAX / 2 / sizeof(VOID*))) /* 536870911 */ @@ -146,23 +134,23 @@ /* load data from the stream into the dpa */ ptr = hDpa->ptrs; - for (loadData.nCount = 0; loadData.nCount < streamData.dwItems; loadData.nCount++) { - errCode = (loadProc)(&loadData, pStream, lParam); + for (streamInfo.iPos = 0; streamInfo.iPos < streamData.dwItems; streamInfo.iPos++) { + errCode = (loadProc)(&streamInfo, pStream, pData); if (errCode != S_OK) { errCode = S_FALSE; break; } - *ptr = loadData.ptr; + *ptr = streamInfo.pvItem; ptr++; } /* set the number of items */ - hDpa->nItemCount = loadData.nCount; + hDpa->nItemCount = streamInfo.iPos; /* store the handle to the dpa */ *phDpa = hDpa; - FIXME ("new hDpa=%p, errorcode=%x\n", hDpa, errCode); + TRACE ("new hDpa=%p, errorcode=%x\n", hDpa, errCode); return errCode; } @@ -175,25 +163,80 @@ * * PARAMS * hDpa [I] handle to a dynamic pointer array - * loadProc [I] pointer to a callback function + * saveProc [I] pointer to a callback function * pStream [I] pointer to a stream - * lParam [I] application specific value - * - * RETURNS - * Success: TRUE - * Failure: FALSE + * pData [I] pointer to callback data + * + * RETURNS + * Success: S_OK, S_FALSE - partial success + * Failure: HRESULT error code * * NOTES * No more information available yet! */ -HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc, - IStream *pStream, LPARAM lParam) -{ - - FIXME ("hDpa=%p loadProc=%p pStream=%p lParam=%lx\n", - hDpa, loadProc, pStream, lParam); - - return E_FAIL; +HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, PFNDPASTREAM saveProc, + IStream *pStream, LPVOID pData) +{ + LARGE_INTEGER position; + ULARGE_INTEGER initial_pos, curr_pos; + STREAMDATA streamData; + DPASTREAMINFO streamInfo; + HRESULT hr; + PVOID *ptr; + + TRACE ("hDpa=%p saveProc=%p pStream=%p pData=%p\n", + hDpa, saveProc, pStream, pData); + + if (!hDpa || !saveProc || !pStream) return E_INVALIDARG; + + /* save initial position to write header after completion */ + position.QuadPart = 0; + hr = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &initial_pos); + if (hr != S_OK) + return hr; + + /* write empty header */ + streamData.dwSize = sizeof(streamData); + streamData.dwData2 = 1; + streamData.dwItems = 0; + + hr = IStream_Write (pStream, &streamData, sizeof(streamData), NULL); + if (hr != S_OK) { + position.QuadPart = initial_pos.QuadPart; + IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL); + return hr; + } + + /* no items - we're done */ + if (hDpa->nItemCount == 0) return S_OK; + + ptr = hDpa->ptrs; + for (streamInfo.iPos = 0; streamInfo.iPos < hDpa->nItemCount; streamInfo.iPos++) { + streamInfo.pvItem = *ptr; + hr = (saveProc)(&streamInfo, pStream, pData); + if (hr != S_OK) { + hr = S_FALSE; + break; + } + ptr++; + } + + /* write updated header */ + position.QuadPart = 0; + IStream_Seek (pStream, position, STREAM_SEEK_CUR, &curr_pos); + + streamData.dwSize = curr_pos.QuadPart - initial_pos.QuadPart; + streamData.dwData2 = 1; + streamData.dwItems = streamInfo.iPos; + + position.QuadPart = initial_pos.QuadPart; + IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL); + IStream_Write (pStream, &streamData, sizeof(streamData), NULL); + + position.QuadPart = curr_pos.QuadPart; + IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL); + + return hr; } @@ -241,7 +284,7 @@ if (IsBadCodePtr ((FARPROC)pfnMerge)) return FALSE; - if (!(dwFlags & DPAM_NOSORT)) { + if (!(dwFlags & DPAM_SORTED)) { TRACE("sorting dpa's!\n"); if (hdpa1->nItemCount > 0) DPA_Sort (hdpa1, pfnCompare, lParam); @@ -269,14 +312,14 @@ do { if (nIndex < 0) { - if ((nCount >= 0) && (dwFlags & DPAM_INSERT)) { + if ((nCount >= 0) && (dwFlags & DPAM_UNION)) { /* Now insert the remaining new items into DPA 1 */ TRACE("%d items to be inserted at start of DPA 1\n", nCount+1); for (i=nCount; i>=0; i--) { PVOID ptr; - ptr = (pfnMerge)(3, *pWork2, NULL, lParam); + ptr = (pfnMerge)(DPAMM_INSERT, *pWork2, NULL, lParam); if (!ptr) return FALSE; DPA_InsertPtr (hdpa1, 0, ptr); @@ -293,7 +336,7 @@ { PVOID ptr; - ptr = (pfnMerge)(1, *pWork1, *pWork2, lParam); + ptr = (pfnMerge)(DPAMM_MERGE, *pWork1, *pWork2, lParam); if (!ptr) return FALSE; @@ -306,14 +349,14 @@ else if (nResult > 0) { /* item in DPA 1 missing from DPA 2 */ - if (dwFlags & DPAM_DELETE) + if (dwFlags & DPAM_INTERSECT) { /* Now delete the extra item in DPA1 */ PVOID ptr; - ptr = DPA_DeletePtr (hdpa1, hdpa1->nItemCount - 1); - - (pfnMerge)(2, ptr, NULL, lParam); + ptr = DPA_DeletePtr (hdpa1, nIndex); + + (pfnMerge)(DPAMM_DELETE, ptr, NULL, lParam); } nIndex--; pWork1--; @@ -321,12 +364,12 @@ else { /* new item in DPA 2 */ - if (dwFlags & DPAM_INSERT) + if (dwFlags & DPAM_UNION) { /* Now insert the new item in DPA 1 */ PVOID ptr; - ptr = (pfnMerge)(3, *pWork2, NULL, lParam); + ptr = (pfnMerge)(DPAMM_INSERT, *pWork2, NULL, lParam); if (!ptr) return FALSE; DPA_InsertPtr (hdpa1, nIndex+1, ptr); @@ -954,3 +997,23 @@ DPA_EnumCallback (hdpa, enumProc, lParam); DPA_Destroy (hdpa); } + +/************************************************************************** + * DPA_GetSize [COMCTL32.@] + * + * Returns all array allocated memory size + * + * PARAMS + * hdpa [I] handle to the dynamic pointer array + * + * RETURNS + * Size in bytes + */ +ULONGLONG WINAPI DPA_GetSize(HDPA hdpa) +{ + TRACE("(%p)\n", hdpa); + + if (!hdpa) return 0; + + return sizeof(DPA) + hdpa->nMaxCount*sizeof(PVOID); +} Modified: trunk/reactos/dll/win32/comctl32/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/header.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -216,6 +216,14 @@ HEADER_PrevItem(const HEADER_INFO *infoPtr, INT iItem) { return HEADER_OrderToIndex(infoPtr, HEADER_IndexToOrder(infoPtr, iItem)-1); +} + +/* TRUE when item is not resizable with dividers, + note that valid index should be supplied */ +static inline BOOL +HEADER_IsItemFixed(const HEADER_INFO *infoPtr, INT iItem) +{ + return (infoPtr->dwStyle & HDS_NOSIZING) || (infoPtr->items[iItem].fmt & HDF_FIXEDWIDTH); } static void @@ -624,6 +632,13 @@ rcTest = rect; rcTest.right = rcTest.left + DIVIDER_WIDTH; if (PtInRect (&rcTest, *lpPt)) { + if (HEADER_IsItemFixed(infoPtr, HEADER_PrevItem(infoPtr, iCount))) + { + *pFlags |= HHT_ONHEADER; + *pItem = iCount; + TRACE("ON HEADER %d\n", *pItem); + return; + } if (bNoWidth) { *pFlags |= HHT_ONDIVOPEN; *pItem = HEADER_PrevItem(infoPtr, iCount); @@ -640,7 +655,8 @@ } rcTest = rect; rcTest.left = rcTest.right - DIVIDER_WIDTH; - if (PtInRect (&rcTest, *lpPt)) { + if (!HEADER_IsItemFixed(infoPtr, iCount) && PtInRect (&rcTest, *lpPt)) + { *pFlags |= HHT_ONDIVIDER; *pItem = iCount; TRACE("ON DIVIDER %d\n", *pItem); @@ -655,21 +671,24 @@ } /* check for last divider part (on nowhere) */ - rect = infoPtr->items[infoPtr->uNumItem-1].rect; - rect.left = rect.right; - rect.right += DIVIDER_WIDTH; - if (PtInRect (&rect, *lpPt)) { - if (bNoWidth) { - *pFlags |= HHT_ONDIVOPEN; - *pItem = infoPtr->uNumItem - 1; - TRACE("ON DIVOPEN %d\n", *pItem); - return; - } - else { - *pFlags |= HHT_ONDIVIDER; - *pItem = infoPtr->uNumItem-1; - TRACE("ON DIVIDER %d\n", *pItem); - return; + if (!HEADER_IsItemFixed(infoPtr, infoPtr->uNumItem - 1)) + { + rect = infoPtr->items[infoPtr->uNumItem-1].rect; + rect.left = rect.right; + rect.right += DIVIDER_WIDTH; + if (PtInRect (&rect, *lpPt)) { + if (bNoWidth) { + *pFlags |= HHT_ONDIVOPEN; + *pItem = infoPtr->uNumItem - 1; + TRACE("ON DIVOPEN %d\n", *pItem); + return; + } + else { + *pFlags |= HHT_ONDIVIDER; + *pItem = infoPtr->uNumItem - 1; + TRACE("ON DIVIDER %d\n", *pItem); + return; + } } } Modified: trunk/reactos/dll/win32/comctl32/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listvie…
============================================================================== --- trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -176,7 +176,8 @@ typedef struct tagCOLUMN_INFO { RECT rcHeader; /* tracks the header's rectangle */ - int fmt; /* same as LVCOLUMN.fmt */ + INT fmt; /* same as LVCOLUMN.fmt */ + INT cxMin; } COLUMN_INFO; typedef struct tagITEMHDR @@ -5733,6 +5734,9 @@ if (lpColumn->mask & LVCF_SUBITEM) lpColumn->iSubItem = hdi.lParam; + if (lpColumn->mask & LVCF_MINWIDTH) + lpColumn->cxMin = lpColumnInfo->cxMin; + return TRUE; } @@ -7299,7 +7303,10 @@ if (clrBk == CLR_NONE) infoPtr->hBkBrush = (HBRUSH)GetClassLongPtrW(infoPtr->hwndSelf, GCLP_HBRBACKGROUND); else + { infoPtr->hBkBrush = CreateSolidBrush(clrBk); + infoPtr->dwLvExStyle &= ~LVS_EX_TRANSPARENTBKGND; + } LISTVIEW_InvalidateList(infoPtr); } @@ -7333,6 +7340,9 @@ lphdi->fmt |= HDF_IMAGE; lphdi->iImage = I_IMAGECALLBACK; } + + if (lpColumn->fmt & LVCFMT_FIXED_WIDTH) + lphdi->fmt |= HDF_FIXEDWIDTH; } if (lpColumn->mask & LVCF_WIDTH) @@ -7450,6 +7460,7 @@ if (DPA_InsertPtr(infoPtr->hdpaColumns, nNewColumn, lpColumnInfo) == -1) goto fail; if (lpColumn->mask & LVCF_FMT) lpColumnInfo->fmt = lpColumn->fmt; + if (lpColumn->mask & LVCF_MINWIDTH) lpColumnInfo->cxMin = lpColumn->cxMin; if (!SendMessageW(infoPtr->hwndHeader, HDM_GETITEMRECT, nNewColumn, (LPARAM)&lpColumnInfo->rcHeader)) goto fail; @@ -7529,7 +7540,7 @@ if (lpColumn->mask & LVCF_FMT) { COLUMN_INFO *lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, nColumn); - int oldFmt = lpColumnInfo->fmt; + INT oldFmt = lpColumnInfo->fmt; lpColumnInfo->fmt = lpColumn->fmt; if ((oldFmt ^ lpColumn->fmt) & (LVCFMT_JUSTIFYMASK | LVCFMT_IMAGE)) @@ -7537,6 +7548,9 @@ if (infoPtr->uView == LV_VIEW_DETAILS) LISTVIEW_InvalidateColumn(infoPtr, nColumn); } } + + if (lpColumn->mask & LVCF_MINWIDTH) + LISTVIEW_GetColumnInfo(infoPtr, nColumn)->cxMin = lpColumn->cxMin; return TRUE; } @@ -7673,7 +7687,7 @@ /* call header to update the column change */ hdi.mask = HDI_WIDTH; - hdi.cxy = cx; + hdi.cxy = max(cx, LISTVIEW_GetColumnInfo(infoPtr, nColumn)->cxMin); TRACE("hdi.cxy=%d\n", hdi.cxy); return SendMessageW(infoPtr->hwndHeader, HDM_SETITEMW, nColumn, (LPARAM)&hdi); } @@ -7785,6 +7799,11 @@ LISTVIEW_UpdateSize(infoPtr); } + if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_TRANSPARENTBKGND) + { + if (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTBKGND) + LISTVIEW_SetBkColor(infoPtr, CLR_NONE); + } LISTVIEW_InvalidateList(infoPtr); return dwOldExStyle; @@ -8800,7 +8819,13 @@ if (!GetClipBox(hdc, &rc)) return FALSE; if (infoPtr->clrBk == CLR_NONE) - return SendMessageW(infoPtr->hwndNotify, WM_ERASEBKGND, (WPARAM)hdc, 0); + { + if (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTBKGND) + return SendMessageW(infoPtr->hwndNotify, WM_PRINTCLIENT, + (WPARAM)hdc, PRF_ERASEBKGND); + else + return SendMessageW(infoPtr->hwndNotify, WM_ERASEBKGND, (WPARAM)hdc, 0); + } /* for double buffered controls we need to do this during refresh */ if (infoPtr->dwLvExStyle & LVS_EX_DOUBLEBUFFER) return FALSE; Modified: trunk/reactos/dll/win32/comctl32/monthcal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/monthca…
============================================================================== --- trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -76,7 +76,8 @@ typedef struct { - HWND hwndSelf; + HWND hwndSelf; + DWORD dwStyle; /* cached GWL_STYLE */ COLORREF bk; COLORREF txt; COLORREF titlebk; @@ -90,7 +91,7 @@ int height_increment; int width_increment; int firstDayplace; /* place of the first day of the current month */ - int delta; /* scroll rate; # of months that the */ + INT delta; /* scroll rate; # of months that the */ /* control moves when user clicks a scroll button */ int visible; /* # of months visible */ int firstDay; /* Start month calendar with firstDay's day */ @@ -103,7 +104,7 @@ int status; /* See MC_SEL flags */ int curSelDay; /* current selected day */ int firstSelDay; /* first selected day */ - int maxSelCount; + INT maxSelCount; SYSTEMTIME minSel; SYSTEMTIME maxSel; DWORD rangeValid; @@ -157,9 +158,15 @@ } } +/* compares timestamps using date part only */ +static inline BOOL MONTHCAL_IsDateEqual(const SYSTEMTIME *first, const SYSTEMTIME *second) +{ + return (first->wYear == second->wYear) && (first->wMonth == second->wMonth) && + (first->wDay == second->wDay); +} /* make sure that time is valid */ -static int MONTHCAL_ValidateTime(SYSTEMTIME time) +static BOOL MONTHCAL_ValidateTime(SYSTEMTIME time) { if(time.wMonth < 1 || time.wMonth > 12 ) return FALSE; if(time.wDayOfWeek > 6) return FALSE; @@ -270,54 +277,20 @@ /* month is the month value(1 == january, 12 == december) */ static void MONTHCAL_CircleDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month) { - HPEN hRedPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0)); + HPEN hRedPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 0)); HPEN hOldPen2 = SelectObject(hdc, hRedPen); - POINT points[13]; - int x, y; + HBRUSH hOldBrush; RECT day_rect; - MONTHCAL_CalcPosFromDay(infoPtr, day, month, &day_rect); - x = day_rect.left; - y = day_rect.top; - - points[0].x = x; - points[0].y = y - 1; - points[1].x = x + 0.8 * infoPtr->width_increment; - points[1].y = y - 1; - points[2].x = x + 0.9 * infoPtr->width_increment; - points[2].y = y; - points[3].x = x + infoPtr->width_increment; - points[3].y = y + 0.5 * infoPtr->height_increment; - - points[4].x = x + infoPtr->width_increment; - points[4].y = y + 0.9 * infoPtr->height_increment; - points[5].x = x + 0.6 * infoPtr->width_increment; - points[5].y = y + 0.9 * infoPtr->height_increment; - points[6].x = x + 0.5 * infoPtr->width_increment; - points[6].y = y + 0.9 * infoPtr->height_increment; /* bring the bottom up just - a hair to fit inside the day rectangle */ - - points[7].x = x + 0.2 * infoPtr->width_increment; - points[7].y = y + 0.8 * infoPtr->height_increment; - points[8].x = x + 0.1 * infoPtr->width_increment; - points[8].y = y + 0.8 * infoPtr->height_increment; - points[9].x = x; - points[9].y = y + 0.5 * infoPtr->height_increment; - - points[10].x = x + 0.1 * infoPtr->width_increment; - points[10].y = y + 0.2 * infoPtr->height_increment; - points[11].x = x + 0.2 * infoPtr->width_increment; - points[11].y = y + 0.3 * infoPtr->height_increment; - points[12].x = x + 0.4 * infoPtr->width_increment; - points[12].y = y + 0.2 * infoPtr->height_increment; - - PolyBezier(hdc, points, 13); + hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH)); + Rectangle(hdc, day_rect.left, day_rect.top, day_rect.right, day_rect.bottom); + + SelectObject(hdc, hOldBrush); DeleteObject(hRedPen); SelectObject(hdc, hOldPen2); } - static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month, int x, int y, int bold) @@ -325,7 +298,7 @@ static const WCHAR fmtW[] = { '%','d',0 }; WCHAR buf[10]; RECT r; - static int haveBoldFont, haveSelectedDay = FALSE; + static BOOL haveBoldFont, haveSelectedDay = FALSE; HBRUSH hbr; COLORREF oldCol = 0; COLORREF oldBk = 0; @@ -340,16 +313,14 @@ if((day>=infoPtr->minSel.wDay) && (day<=infoPtr->maxSel.wDay) && (month==infoPtr->currentMonth)) { - HRGN hrgn; RECT r2; TRACE("%d %d %d\n",day, infoPtr->minSel.wDay, infoPtr->maxSel.wDay); TRACE("%s\n", wine_dbgstr_rect(&r)); oldCol = SetTextColor(hdc, infoPtr->monthbk); oldBk = SetBkColor(hdc, infoPtr->trailingtxt); - hbr = GetSysColorBrush(COLOR_GRAYTEXT); - hrgn = CreateEllipticRgn(r.left, r.top, r.right, r.bottom); - FillRgn(hdc, hrgn, hbr); + hbr = GetSysColorBrush(COLOR_HIGHLIGHT); + FillRect(hdc, &r, hbr); /* FIXME: this may need to be changed now b/c of the other drawing changes 11/3/99 CMM */ @@ -374,13 +345,13 @@ haveBoldFont = FALSE; } + SetBkMode(hdc,TRANSPARENT); + DrawTextW(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE ); + if(haveSelectedDay) { SetTextColor(hdc, oldCol); SetBkColor(hdc, oldBk); } - - SetBkMode(hdc,TRANSPARENT); - DrawTextW(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE ); /* draw a rectangle around the currently selected days text */ if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth)) @@ -406,8 +377,7 @@ stateNum += 1; else { - DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); - if (dwStyle & WS_DISABLED) stateNum += 2; + if (infoPtr->dwStyle & WS_DISABLED) stateNum += 2; } DrawThemeBackground (theme, hdc, SBP_ARROWBTN, states[stateNum], r, NULL); } @@ -418,8 +388,7 @@ style |= DFCS_PUSHED; else { - DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); - if (dwStyle & WS_DISABLED) style |= DFCS_INACTIVE; + if (infoPtr->dwStyle & WS_DISABLED) style |= DFCS_INACTIVE; } DrawFrameControl(hdc, r, DFC_SCROLL, style); @@ -450,7 +419,6 @@ WCHAR buf1[20]; WCHAR buf2[32]; COLORREF oldTextColor, oldBkColor; - DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); RECT rcTemp; RECT rcDay; /* used in MONTHCAL_CalcDayRect() */ SYSTEMTIME localtime; @@ -595,7 +563,7 @@ if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) && (day==infoPtr->todaysDate.wDay) && (infoPtr->currentYear == infoPtr->todaysDate.wYear)) { - if(!(dwStyle & MCS_NOTODAYCIRCLE)) + if(!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE)) MONTHCAL_CircleDay(infoPtr, hdc, day, infoPtr->currentMonth); } } @@ -617,7 +585,7 @@ if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) && (day==infoPtr->todaysDate.wDay) && (infoPtr->currentYear == infoPtr->todaysDate.wYear)) - if(!(dwStyle & MCS_NOTODAYCIRCLE)) + if(!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE)) MONTHCAL_CircleDay(infoPtr, hdc, day, infoPtr->currentMonth); } mask<<=1; @@ -658,8 +626,8 @@ /* draw `today' date if style allows it, and draw a circle before today's * date if necessary */ - if(!(dwStyle & MCS_NOTODAY)) { - if(!(dwStyle & MCS_NOTODAYCIRCLE)) { + if(!(infoPtr->dwStyle & MCS_NOTODAY)) { + if(!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE)) { /*day is the number of days from nextmonth we put on the calendar */ MONTHCAL_CircleDay(infoPtr, hdc, day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear), @@ -685,7 +653,7 @@ } /*eventually draw week numbers*/ - if(dwStyle & MCS_WEEKNUMBERS) { + if(infoPtr->dwStyle & MCS_WEEKNUMBERS) { /* display weeknumbers*/ int mindays; @@ -772,21 +740,17 @@ static LRESULT -MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - LPRECT lpRect = (LPRECT) lParam; - +MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect) +{ TRACE("rect %p\n", lpRect); - /* validate parameters */ - - if((infoPtr==NULL) ||(lpRect == NULL) ) return FALSE; + if(!lpRect) return FALSE; lpRect->left = infoPtr->title.left; lpRect->top = infoPtr->title.top; lpRect->right = infoPtr->title.right; lpRect->bottom = infoPtr->todayrect.bottom; - AdjustWindowRect(lpRect, GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE), FALSE); + AdjustWindowRect(lpRect, infoPtr->dwStyle, FALSE); TRACE("%s\n", wine_dbgstr_rect(lpRect)); @@ -795,11 +759,11 @@ static LRESULT -MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, WPARAM wParam) +MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, INT index) { TRACE("\n"); - switch((int)wParam) { + switch(index) { case MCSC_BACKGROUND: return infoPtr->bk; case MCSC_TEXT: @@ -819,40 +783,40 @@ static LRESULT -MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam) -{ - int prev = -1; - - TRACE("%ld: color %08lx\n", wParam, lParam); - - switch((int)wParam) { +MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, INT index, COLORREF color) +{ + COLORREF prev = -1; + + TRACE("%d: color %08x\n", index, color); + + switch(index) { case MCSC_BACKGROUND: prev = infoPtr->bk; - infoPtr->bk = (COLORREF)lParam; + infoPtr->bk = color; break; case MCSC_TEXT: prev = infoPtr->txt; - infoPtr->txt = (COLORREF)lParam; + infoPtr->txt = color; break; case MCSC_TITLEBK: prev = infoPtr->titlebk; - infoPtr->titlebk = (COLORREF)lParam; + infoPtr->titlebk = color; break; case MCSC_TITLETEXT: prev=infoPtr->titletxt; - infoPtr->titletxt = (COLORREF)lParam; + infoPtr->titletxt = color; break; case MCSC_MONTHBK: prev = infoPtr->monthbk; - infoPtr->monthbk = (COLORREF)lParam; + infoPtr->monthbk = color; break; case MCSC_TRAILINGTEXT: prev = infoPtr->trailingtxt; - infoPtr->trailingtxt = (COLORREF)lParam; + infoPtr->trailingtxt = color; break; } - InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); + InvalidateRect(infoPtr->hwndSelf, NULL, index == MCSC_BACKGROUND ? TRUE : FALSE); return prev; } @@ -870,13 +834,13 @@ static LRESULT -MONTHCAL_SetMonthDelta(MONTHCAL_INFO *infoPtr, WPARAM wParam) -{ - int prev = infoPtr->delta; - - TRACE("delta %ld\n", wParam); - - infoPtr->delta = (int)wParam; +MONTHCAL_SetMonthDelta(MONTHCAL_INFO *infoPtr, INT delta) +{ + INT prev = infoPtr->delta; + + TRACE("delta %d\n", delta); + + infoPtr->delta = delta; return prev; } @@ -893,32 +857,32 @@ /* FIXME: this needs to be implemented properly in MONTHCAL_Refresh() */ /* FIXME: we need more error checking here */ static LRESULT -MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, LPARAM lParam) +MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day) { int prev = MAKELONG(infoPtr->firstDay, infoPtr->firstDayHighWord); int localFirstDay; WCHAR buf[40]; - TRACE("day %ld\n", lParam); + TRACE("day %d\n", day); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, countof(buf)); TRACE("%s %d\n", debugstr_w(buf), strlenW(buf)); localFirstDay = atoiW(buf); - if(lParam == -1) + if(day == -1) { infoPtr->firstDay = localFirstDay; infoPtr->firstDayHighWord = FALSE; } - else if(lParam >= 7) + else if(day >= 7) { infoPtr->firstDay = 6; /* max first day allowed */ infoPtr->firstDayHighWord = TRUE; } else { - infoPtr->firstDay = lParam; + infoPtr->firstDay = day; infoPtr->firstDayHighWord = TRUE; } @@ -943,25 +907,24 @@ static LRESULT -MONTHCAL_SetRange(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam) -{ - SYSTEMTIME *lprgSysTimeArray=(SYSTEMTIME *)lParam; +MONTHCAL_SetRange(MONTHCAL_INFO *infoPtr, SHORT limits, SYSTEMTIME *range) +{ FILETIME ft_min, ft_max; - TRACE("%lx %lx\n", wParam, lParam); - - if ((wParam & GDTR_MIN && !MONTHCAL_ValidateTime(lprgSysTimeArray[0])) || - (wParam & GDTR_MAX && !MONTHCAL_ValidateTime(lprgSysTimeArray[1]))) + TRACE("%x %p\n", limits, range); + + if ((limits & GDTR_MIN && !MONTHCAL_ValidateTime(range[0])) || + (limits & GDTR_MAX && !MONTHCAL_ValidateTime(range[1]))) return FALSE; - if (wParam & GDTR_MIN) + if (limits & GDTR_MIN) { - MONTHCAL_CopyTime(&lprgSysTimeArray[0], &infoPtr->minDate); + MONTHCAL_CopyTime(&range[0], &infoPtr->minDate); infoPtr->rangeValid |= GDTR_MIN; } - if (wParam & GDTR_MAX) + if (limits & GDTR_MAX) { - MONTHCAL_CopyTime(&lprgSysTimeArray[1], &infoPtr->maxDate); + MONTHCAL_CopyTime(&range[1], &infoPtr->maxDate); infoPtr->rangeValid |= GDTR_MAX; } @@ -974,7 +937,7 @@ if (CompareFileTime(&ft_min, &ft_max) > 0) { - if ((wParam & (GDTR_MIN | GDTR_MAX)) == (GDTR_MIN | GDTR_MAX)) + if ((limits & (GDTR_MIN | GDTR_MAX)) == (GDTR_MIN | GDTR_MAX)) { /* Native swaps limits only when both limits are being set. */ SYSTEMTIME st_tmp = infoPtr->minDate; @@ -985,7 +948,7 @@ { /* Reset the other limit. */ /* FIXME: native sets date&time to 0. Should we do this too? */ - infoPtr->rangeValid &= wParam & GDTR_MIN ? ~GDTR_MAX : ~GDTR_MIN ; + infoPtr->rangeValid &= limits & GDTR_MIN ? ~GDTR_MAX : ~GDTR_MIN ; } } @@ -994,69 +957,66 @@ static LRESULT -MONTHCAL_GetRange(HWND hwnd, LPARAM lParam) -{ - MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); - SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *)lParam; - - /* validate parameters */ - - if((infoPtr==NULL) || (lprgSysTimeArray==NULL)) return FALSE; - - MONTHCAL_CopyTime(&infoPtr->maxDate, &lprgSysTimeArray[1]); - MONTHCAL_CopyTime(&infoPtr->minDate, &lprgSysTimeArray[0]); +MONTHCAL_GetRange(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *range) +{ + TRACE("%p\n", range); + + if(!range) return FALSE; + + MONTHCAL_CopyTime(&infoPtr->maxDate, &range[1]); + MONTHCAL_CopyTime(&infoPtr->minDate, &range[0]); return infoPtr->rangeValid; } static LRESULT -MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam) - -{ - int i, iMonths = (int)wParam; - MONTHDAYSTATE *dayStates = (LPMONTHDAYSTATE)lParam; - - TRACE("%lx %lx\n", wParam, lParam); - if(iMonths!=infoPtr->monthRange) return 0; - - for(i=0; i<iMonths; i++) - infoPtr->monthdayState[i] = dayStates[i]; +MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, INT months, MONTHDAYSTATE *states) +{ + int i; + + TRACE("%d %p\n", months, states); + if(months != infoPtr->monthRange) return 0; + + for(i = 0; i < months; i++) + infoPtr->monthdayState[i] = states[i]; + return 1; } static LRESULT -MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - SYSTEMTIME *lpSel = (SYSTEMTIME *) lParam; - - TRACE("%lx\n", lParam); - if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE; - if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return FALSE; - - MONTHCAL_CopyTime(&infoPtr->minSel, lpSel); - TRACE("%d/%d/%d\n", lpSel->wYear, lpSel->wMonth, lpSel->wDay); +MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) +{ + TRACE("%p\n", curSel); + if(!curSel) return FALSE; + if(infoPtr->dwStyle & MCS_MULTISELECT) return FALSE; + + MONTHCAL_CopyTime(&infoPtr->minSel, curSel); + TRACE("%d/%d/%d\n", curSel->wYear, curSel->wMonth, curSel->wDay); return TRUE; } /* FIXME: if the specified date is not visible, make it visible */ /* FIXME: redraw? */ static LRESULT -MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - SYSTEMTIME *lpSel = (SYSTEMTIME *)lParam; - - TRACE("%lx\n", lParam); - if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE; - if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return FALSE; - - if(!MONTHCAL_ValidateTime(*lpSel)) return FALSE; - - infoPtr->currentMonth=lpSel->wMonth; - infoPtr->currentYear=lpSel->wYear; - - MONTHCAL_CopyTime(lpSel, &infoPtr->minSel); - MONTHCAL_CopyTime(lpSel, &infoPtr->maxSel); +MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) +{ + TRACE("%p\n", curSel); + if(!curSel) return FALSE; + if(infoPtr->dwStyle & MCS_MULTISELECT) return FALSE; + + if(!MONTHCAL_ValidateTime(*curSel)) return FALSE; + + MONTHCAL_CopyTime(curSel, &infoPtr->minSel); + MONTHCAL_CopyTime(curSel, &infoPtr->maxSel); + + /* exit earlier if selection equals current */ + if (infoPtr->currentMonth == curSel->wMonth && + infoPtr->currentYear == curSel->wYear && + infoPtr->curSelDay == curSel->wDay) return TRUE; + + infoPtr->currentMonth = curSel->wMonth; + infoPtr->currentYear = curSel->wYear; InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); @@ -1072,12 +1032,12 @@ static LRESULT -MONTHCAL_SetMaxSelCount(MONTHCAL_INFO *infoPtr, WPARAM wParam) -{ - TRACE("%lx\n", wParam); - - if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) { - infoPtr->maxSelCount = wParam; +MONTHCAL_SetMaxSelCount(MONTHCAL_INFO *infoPtr, INT max) +{ + TRACE("%d\n", max); + + if(infoPtr->dwStyle & MCS_MULTISELECT) { + infoPtr->maxSelCount = max; } return TRUE; @@ -1085,20 +1045,16 @@ static LRESULT -MONTHCAL_GetSelRange(const MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *) lParam; - - TRACE("%lx\n", lParam); - - /* validate parameters */ - - if((infoPtr==NULL) ||(lprgSysTimeArray==NULL)) return FALSE; - - if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) +MONTHCAL_GetSelRange(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *range) +{ + TRACE("%p\n", range); + + if(!range) return FALSE; + + if(infoPtr->dwStyle & MCS_MULTISELECT) { - MONTHCAL_CopyTime(&infoPtr->maxSel, &lprgSysTimeArray[1]); - MONTHCAL_CopyTime(&infoPtr->minSel, &lprgSysTimeArray[0]); + MONTHCAL_CopyTime(&infoPtr->maxSel, &range[1]); + MONTHCAL_CopyTime(&infoPtr->minSel, &range[0]); TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay, infoPtr->maxSel.wDay); return TRUE; } @@ -1108,20 +1064,16 @@ static LRESULT -MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *) lParam; - - TRACE("%lx\n", lParam); - - /* validate parameters */ - - if((infoPtr==NULL) ||(lprgSysTimeArray==NULL)) return FALSE; - - if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) +MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range) +{ + TRACE("%p\n", range); + + if(!range) return FALSE; + + if(infoPtr->dwStyle & MCS_MULTISELECT) { - MONTHCAL_CopyTime(&lprgSysTimeArray[1], &infoPtr->maxSel); - MONTHCAL_CopyTime(&lprgSysTimeArray[0], &infoPtr->minSel); + MONTHCAL_CopyTime(&range[1], &infoPtr->maxSel); + MONTHCAL_CopyTime(&range[0], &infoPtr->minSel); TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay, infoPtr->maxSel.wDay); return TRUE; } @@ -1131,40 +1083,34 @@ static LRESULT -MONTHCAL_GetToday(const MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - SYSTEMTIME *lpToday = (SYSTEMTIME *) lParam; - - TRACE("%lx\n", lParam); - - /* validate parameters */ - - if((infoPtr==NULL) || (lpToday==NULL)) return FALSE; - MONTHCAL_CopyTime(&infoPtr->todaysDate, lpToday); +MONTHCAL_GetToday(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *today) +{ + TRACE("%p\n", today); + + if(!today) return FALSE; + MONTHCAL_CopyTime(&infoPtr->todaysDate, today); return TRUE; } static LRESULT -MONTHCAL_SetToday(MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - SYSTEMTIME *lpToday = (SYSTEMTIME *) lParam; - - TRACE("%lx\n", lParam); - - /* validate parameters */ - - if((infoPtr==NULL) ||(lpToday==NULL)) return FALSE; - MONTHCAL_CopyTime(lpToday, &infoPtr->todaysDate); +MONTHCAL_SetToday(MONTHCAL_INFO *infoPtr, SYSTEMTIME *today) +{ + TRACE("%p\n", today); + + if(!today) return FALSE; + + if(MONTHCAL_IsDateEqual(today, &infoPtr->todaysDate)) return TRUE; + + MONTHCAL_CopyTime(today, &infoPtr->todaysDate); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); return TRUE; } static LRESULT -MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, LPARAM lParam) -{ - PMCHITTESTINFO lpht = (PMCHITTESTINFO)lParam; +MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) +{ UINT x,y; DWORD retval; int day,wday,wnum; @@ -1282,8 +1228,6 @@ static void MONTHCAL_GoToNextMonth(MONTHCAL_INFO *infoPtr) { - DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); - TRACE("MONTHCAL_GoToNextMonth\n"); infoPtr->currentMonth++; @@ -1292,7 +1236,7 @@ infoPtr->currentMonth = 1; } - if(dwStyle & MCS_DAYSTATE) { + if(infoPtr->dwStyle & MCS_DAYSTATE) { NMDAYSTATE nmds; int i; @@ -1316,8 +1260,6 @@ static void MONTHCAL_GoToPrevMonth(MONTHCAL_INFO *infoPtr) { - DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); - TRACE("\n"); infoPtr->currentMonth--; @@ -1326,7 +1268,7 @@ infoPtr->currentMonth = 12; } - if(dwStyle & MCS_DAYSTATE) { + if(infoPtr->dwStyle & MCS_DAYSTATE) { NMDAYSTATE nmds; int i; @@ -1410,7 +1352,7 @@ ht.pt.x = (short)LOWORD(lParam); ht.pt.y = (short)HIWORD(lParam); - hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht); + hit = MONTHCAL_HitTest(infoPtr, &ht); /* FIXME: these flags should be checked by */ /*((hit & MCHT_XXX) == MCHT_XXX) b/c some of the flags are */ @@ -1507,8 +1449,8 @@ MONTHCAL_CopyTime(&ht.st, &selArray[0]); MONTHCAL_CopyTime(&ht.st, &selArray[1]); - MONTHCAL_SetSelRange(infoPtr, (LPARAM)selArray); - MONTHCAL_SetCurSel(infoPtr, (LPARAM)selArray); + MONTHCAL_SetSelRange(infoPtr, selArray); + MONTHCAL_SetCurSel(infoPtr, &selArray[0]); TRACE("MCHT_CALENDARDATE\n"); nmsc.nmhdr.hwndFrom = infoPtr->hwndSelf; nmsc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); @@ -1562,7 +1504,7 @@ ht.pt.x = (short)LOWORD(lParam); ht.pt.y = (short)HIWORD(lParam); - hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht); + hit = MONTHCAL_HitTest(infoPtr, &ht); infoPtr->status = MC_SEL_LBUTUP; @@ -1641,7 +1583,7 @@ ht.pt.x = (short)LOWORD(lParam); ht.pt.y = (short)HIWORD(lParam); - hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht); + hit = MONTHCAL_HitTest(infoPtr, &ht); /* not on the calendar date numbers? bail out */ TRACE("hit:%x\n",hit); @@ -1652,11 +1594,11 @@ infoPtr->curSelDay = selday; MONTHCAL_CalcPosFromDay(infoPtr, selday, ht.st. wMonth, &r); - if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) { + if(infoPtr->dwStyle & MCS_MULTISELECT) { SYSTEMTIME selArray[2]; int i; - MONTHCAL_GetSelRange(infoPtr, (LPARAM)selArray); + MONTHCAL_GetSelRange(infoPtr, selArray); i = 0; if(infoPtr->firstSelDay==selArray[0].wDay) i=1; TRACE("oldRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i); @@ -1686,7 +1628,7 @@ selArray[0].wDay = tempday; } - MONTHCAL_SetSelRange(infoPtr, (LPARAM)selArray); + MONTHCAL_SetSelRange(infoPtr, selArray); } } @@ -1703,21 +1645,21 @@ static LRESULT -MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, WPARAM wParam) +MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, HDC hdc_paint) { HDC hdc; PAINTSTRUCT ps; - if (wParam) + if (hdc_paint) { GetClientRect(infoPtr->hwndSelf, &ps.rcPaint); - hdc = (HDC)wParam; + hdc = hdc_paint; } else hdc = BeginPaint(infoPtr->hwndSelf, &ps); MONTHCAL_Refresh(infoPtr, hdc, &ps); - if (!wParam) EndPaint(infoPtr->hwndSelf, &ps); + if (!hdc_paint) EndPaint(infoPtr->hwndSelf, &ps); return 0; } @@ -1763,7 +1705,6 @@ RECT *todayrect=&infoPtr->todayrect; SIZE size; TEXTMETRICW tm; - DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE); HFONT currentFont; int xdiv, left_offset; RECT rcClient; @@ -1781,7 +1722,7 @@ /* recalculate the height and width increments and offsets */ GetTextExtentPoint32W(hdc, O0W, 2, &size); - xdiv = (dwStyle & MCS_WEEKNUMBERS) ? 8 : 7; + xdiv = (infoPtr->dwStyle & MCS_WEEKNUMBERS) ? 8 : 7; infoPtr->width_increment = size.cx * 2 + 4; infoPtr->height_increment = infoPtr->textHeight; @@ -1811,7 +1752,7 @@ /* setup the dimensions of the rectangle we draw the names of the */ /* days of the week in */ weeknumrect->left = left_offset; - if(dwStyle & MCS_WEEKNUMBERS) + if(infoPtr->dwStyle & MCS_WEEKNUMBERS) weeknumrect->right=prev->right; else weeknumrect->right=weeknumrect->left; @@ -1890,9 +1831,22 @@ return 0; } +static INT MONTHCAL_StyleChanged(MONTHCAL_INFO *infoPtr, WPARAM wStyleType, + const STYLESTRUCT *lpss) +{ + TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n", + wStyleType, lpss->styleOld, lpss->styleNew); + + if (wStyleType != GWL_STYLE) return 0; + + infoPtr->dwStyle = lpss->styleNew; + + return 0; +} + /* FIXME: check whether dateMin/dateMax need to be adjusted. */ static LRESULT -MONTHCAL_Create(HWND hwnd, LPARAM lParam) +MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) { MONTHCAL_INFO *infoPtr; @@ -1906,7 +1860,8 @@ } infoPtr->hwndSelf = hwnd; - infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent; + infoPtr->hwndNotify = lpcs->hwndParent; + infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE); MONTHCAL_SetFont(infoPtr, GetStockObject(DEFAULT_GUI_FONT), FALSE); @@ -1915,7 +1870,7 @@ GetLocalTime(&infoPtr->todaysDate); infoPtr->firstDayHighWord = FALSE; - MONTHCAL_SetFirstDayOfWeek(infoPtr, (LPARAM)-1); + MONTHCAL_SetFirstDayOfWeek(infoPtr, -1); infoPtr->currentMonth = infoPtr->todaysDate.wMonth; infoPtr->currentYear = infoPtr->todaysDate.wYear; MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->minDate); @@ -1974,10 +1929,10 @@ switch(uMsg) { case MCM_GETCURSEL: - return MONTHCAL_GetCurSel(infoPtr, lParam); + return MONTHCAL_GetCurSel(infoPtr, (LPSYSTEMTIME)lParam); case MCM_SETCURSEL: - return MONTHCAL_SetCurSel(infoPtr, lParam); + return MONTHCAL_SetCurSel(infoPtr, (LPSYSTEMTIME)lParam); case MCM_GETMAXSELCOUNT: return MONTHCAL_GetMaxSelCount(infoPtr); @@ -1986,46 +1941,46 @@ return MONTHCAL_SetMaxSelCount(infoPtr, wParam); case MCM_GETSELRANGE: - return MONTHCAL_GetSelRange(infoPtr, lParam); + return MONTHCAL_GetSelRange(infoPtr, (LPSYSTEMTIME)lParam); case MCM_SETSELRANGE: - return MONTHCAL_SetSelRange(infoPtr, lParam); + return MONTHCAL_SetSelRange(infoPtr, (LPSYSTEMTIME)lParam); case MCM_GETMONTHRANGE: return MONTHCAL_GetMonthRange(infoPtr); case MCM_SETDAYSTATE: - return MONTHCAL_SetDayState(infoPtr, wParam, lParam); + return MONTHCAL_SetDayState(infoPtr, (INT)wParam, (LPMONTHDAYSTATE)lParam); case MCM_GETMINREQRECT: - return MONTHCAL_GetMinReqRect(infoPtr, lParam); + return MONTHCAL_GetMinReqRect(infoPtr, (LPRECT)lParam); case MCM_GETCOLOR: return MONTHCAL_GetColor(infoPtr, wParam); case MCM_SETCOLOR: - return MONTHCAL_SetColor(infoPtr, wParam, lParam); + return MONTHCAL_SetColor(infoPtr, wParam, (COLORREF)lParam); case MCM_GETTODAY: - return MONTHCAL_GetToday(infoPtr, lParam); + return MONTHCAL_GetToday(infoPtr, (LPSYSTEMTIME)lParam); case MCM_SETTODAY: - return MONTHCAL_SetToday(infoPtr, lParam); + return MONTHCAL_SetToday(infoPtr, (LPSYSTEMTIME)lParam); case MCM_HITTEST: - return MONTHCAL_HitTest(infoPtr, lParam); + return MONTHCAL_HitTest(infoPtr, (PMCHITTESTINFO)lParam); case MCM_GETFIRSTDAYOFWEEK: return MONTHCAL_GetFirstDayOfWeek(infoPtr); case MCM_SETFIRSTDAYOFWEEK: - return MONTHCAL_SetFirstDayOfWeek(infoPtr, lParam); + return MONTHCAL_SetFirstDayOfWeek(infoPtr, (INT)lParam); case MCM_GETRANGE: - return MONTHCAL_GetRange(hwnd, lParam); + return MONTHCAL_GetRange(infoPtr, (LPSYSTEMTIME)lParam); case MCM_SETRANGE: - return MONTHCAL_SetRange(infoPtr, wParam, lParam); + return MONTHCAL_SetRange(infoPtr, (SHORT)wParam, (LPSYSTEMTIME)lParam); case MCM_GETMONTHDELTA: return MONTHCAL_GetMonthDelta(infoPtr); @@ -2056,7 +2011,7 @@ case WM_PRINTCLIENT: case WM_PAINT: - return MONTHCAL_Paint(infoPtr, wParam); + return MONTHCAL_Paint(infoPtr, (HDC)wParam); case WM_SETFOCUS: return MONTHCAL_SetFocus(infoPtr); @@ -2065,7 +2020,7 @@ return MONTHCAL_Size(infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); case WM_CREATE: - return MONTHCAL_Create(hwnd, lParam); + return MONTHCAL_Create(hwnd, (LPCREATESTRUCTW)lParam); case WM_SETFONT: return MONTHCAL_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam); @@ -2085,6 +2040,9 @@ case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); return 0; + + case WM_STYLECHANGED: + return MONTHCAL_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam); default: if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg)) Modified: trunk/reactos/dll/win32/comctl32/trackbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackba…
============================================================================== --- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -155,7 +155,7 @@ if (infoPtr->uTicFreq && infoPtr->lRangeMax >= infoPtr->lRangeMin) { nrTics=(infoPtr->lRangeMax - infoPtr->lRangeMin)/infoPtr->uTicFreq; /* don't add extra tic if there's no remainder */ - if ((infoPtr->lRangeMax - infoPtr->lRangeMin) % infoPtr->uTicFreq == 0) + if (nrTics && ((infoPtr->lRangeMax - infoPtr->lRangeMin) % infoPtr->uTicFreq == 0)) nrTics--; } else { @@ -1294,9 +1294,6 @@ static inline LRESULT TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos) { - if (infoPtr->dwStyle & TBS_AUTOTICKS) - return FALSE; - if ((lPos < infoPtr->lRangeMin) || (lPos> infoPtr->lRangeMax)) return FALSE; @@ -1408,7 +1405,7 @@ infoPtr->lSelMin = 0; infoPtr->lSelMax = 0; infoPtr->lPos = 0; - infoPtr->fLocation = -1; + infoPtr->fLocation = TBTS_TOP; infoPtr->uNumTics = 0; /* start and end tic are not included in count*/ infoPtr->uTicFreq = 1; infoPtr->tics = NULL; Modified: trunk/reactos/dll/win32/comctl32/updown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/updown.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/updown.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/updown.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -86,6 +86,7 @@ #define FLAG_DECR 0x02 #define FLAG_MOUSEIN 0x04 #define FLAG_PRESSED 0x08 +#define FLAG_BUDDYINT 0x10 /* UDS_SETBUDDYINT was set on creation */ #define FLAG_ARROW (FLAG_INCR | FLAG_DECR) #define BUDDY_TYPE_UNKNOWN 0 @@ -267,7 +268,7 @@ WCHAR txt[20], sep, *src, *dst; int newVal; - if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy))) + if (!((infoPtr->Flags & FLAG_BUDDYINT) && IsWindow(infoPtr->Buddy))) return FALSE; /*if the buddy is a list window, we must set curr index */ @@ -312,7 +313,7 @@ WCHAR txt[20]; int len; - if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy))) + if (!((infoPtr->Flags & FLAG_BUDDYINT) && IsWindow(infoPtr->Buddy))) return FALSE; TRACE("set new value(%d) to buddy.\n", infoPtr->CurVal); @@ -328,7 +329,7 @@ /* Do thousands separation if necessary */ - if (!(infoPtr->dwStyle & UDS_NOTHOUSANDS) && (len > 3)) { + if ((infoPtr->Base == 10) && !(infoPtr->dwStyle & UDS_NOTHOUSANDS) && (len > 3)) { WCHAR tmp[COUNT_OF(txt)], *src = tmp, *dst = txt; WCHAR sep = UPDOWN_GetThousandSep(); int start = len % 3; @@ -520,20 +521,25 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { WNDPROC superClassWndProc = (WNDPROC)GetPropW(hwnd, BUDDY_SUPERCLASS_WNDPROC); + HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND); + UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(upDownHwnd); TRACE("hwnd=%p, wndProc=%p, uMsg=%04x, wParam=%08lx, lParam=%08lx\n", hwnd, superClassWndProc, uMsg, wParam, lParam); - if (uMsg == WM_KEYDOWN) { - HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND); - - UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); + switch(uMsg) + { + case WM_KEYDOWN: + UPDOWN_KeyPressed(infoPtr, (int)wParam); if ((wParam == VK_UP) || (wParam == VK_DOWN)) return 0; - } - else if (uMsg == WM_MOUSEWHEEL) { - HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND); - - UPDOWN_MouseWheel(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); + break; + + case WM_MOUSEWHEEL: + UPDOWN_MouseWheel(infoPtr, (int)wParam); + break; + + default: + break; } return CallWindowProcW( superClassWndProc, hwnd, uMsg, wParam, lParam); @@ -586,7 +592,7 @@ infoPtr->BuddyType = BUDDY_TYPE_LISTBOX; } - if(infoPtr->dwStyle & UDS_ARROWKEYS){ + if (infoPtr->dwStyle & UDS_ARROWKEYS) { /* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property when we reset the upDown ctrl buddy to another buddy because it is not good to break the window proc chain. */ @@ -865,7 +871,7 @@ infoPtr->MaxVal = 0; infoPtr->Base = 10; /* Default to base 10 */ infoPtr->Buddy = 0; /* No buddy window yet */ - infoPtr->Flags = 0; /* And no flags */ + infoPtr->Flags = (infoPtr->dwStyle & UDS_SETBUDDYINT) ? FLAG_BUDDYINT : 0; SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle & ~WS_BORDER); @@ -1031,9 +1037,13 @@ case UDM_SETBASE: TRACE("UpDown Ctrl new base(%ld), hwnd=%p\n", wParam, hwnd); if (wParam==10 || wParam==16) { - WPARAM temp = infoPtr->Base; + WPARAM old_base = infoPtr->Base; infoPtr->Base = wParam; - return temp; + + if (old_base != infoPtr->Base) + UPDOWN_SetBuddyInt(infoPtr); + + return old_base; } break; @@ -1045,8 +1055,8 @@ case UDM_GETPOS: { - int temp = UPDOWN_GetBuddyInt (infoPtr); - return MAKELONG(infoPtr->CurVal, temp ? 0 : 1); + BOOL ret = UPDOWN_GetBuddyInt (infoPtr); + return MAKELONG(infoPtr->CurVal, ret ? 0 : 1); } case UDM_SETPOS: { @@ -1083,9 +1093,11 @@ break; case UDM_GETPOS32: - if ((LPBOOL)lParam != NULL) *((LPBOOL)lParam) = TRUE; + { + BOOL ret = UPDOWN_GetBuddyInt (infoPtr); + if ((LPBOOL)lParam) *((LPBOOL)lParam) = !ret; return infoPtr->CurVal; - + } case UDM_SETPOS32: { int temp; Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] Sat Sep 26 12:45:59 2009 @@ -910,7 +910,7 @@ WideCharToMultiByte(CP_ACP, 0, lpstrPath, -1, (LPSTR)lParam, (int)wParam, NULL, NULL); } - retval = lstrlenW(lpstrPath); + retval = lstrlenW(lpstrPath) + 1; break; case CDM_GETFOLDERIDLIST:
15 years, 3 months
1
0
0
0
[dchapyshev] 43160: - Sync headers with Wine 1.1.30
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Sep 26 12:45:05 2009 New Revision: 43160 URL:
http://svn.reactos.org/svn/reactos?rev=43160&view=rev
Log: - Sync headers with Wine 1.1.30 Modified: trunk/reactos/include/psdk/commctrl.h trunk/reactos/include/psdk/shlwapi.h Modified: trunk/reactos/include/psdk/commctrl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/commctrl.h?re…
============================================================================== --- trunk/reactos/include/psdk/commctrl.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/commctrl.h [iso-8859-1] Sat Sep 26 12:45:05 2009 @@ -2964,6 +2964,7 @@ #define LVCF_SUBITEM 0x0008 #define LVCF_IMAGE 0x0010 #define LVCF_ORDER 0x0020 +#define LVCF_MINWIDTH 0x0040 #define LVCFMT_LEFT 0x0000 #define LVCFMT_RIGHT 0x0001 @@ -4953,8 +4954,22 @@ struct _DPA; typedef struct _DPA *HDPA; +#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) + typedef INT (CALLBACK *PFNDPAENUMCALLBACK)(LPVOID, LPVOID); typedef INT (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM); +typedef PVOID (CALLBACK *PFNDPAMERGE)(UINT,PVOID,PVOID,LPARAM); + +/* merge callback codes */ +#define DPAMM_MERGE 1 +#define DPAMM_DELETE 2 +#define DPAMM_INSERT 3 + +/* merge options */ +#define DPAM_SORTED 0x00000001 +#define DPAM_NORMAL 0x00000002 +#define DPAM_UNION 0x00000004 +#define DPAM_INTERSECT 0x00000008 HDPA WINAPI DPA_Create(INT); BOOL WINAPI DPA_Destroy(HDPA); @@ -4962,11 +4977,25 @@ BOOL WINAPI DPA_DeleteAllPtrs(HDPA); BOOL WINAPI DPA_SetPtr(HDPA, INT, LPVOID); LPVOID WINAPI DPA_GetPtr(HDPA, INT); +INT WINAPI DPA_GetPtrIndex(HDPA, LPCVOID); +ULONGLONG WINAPI DPA_GetSize(HDPA); +BOOL WINAPI DPA_Grow(HDPA, INT); INT WINAPI DPA_InsertPtr(HDPA, INT, LPVOID); BOOL WINAPI DPA_Sort(HDPA, PFNDPACOMPARE, LPARAM); void WINAPI DPA_EnumCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID); void WINAPI DPA_DestroyCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID); INT WINAPI DPA_Search(HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT); +BOOL WINAPI DPA_Merge(HDPA, HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM); + +/* save/load from stream */ +typedef struct _DPASTREAMINFO +{ + INT iPos; /* item index */ + LPVOID pvItem; +} DPASTREAMINFO; + +struct IStream; +typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, LPVOID); BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR); Modified: trunk/reactos/include/psdk/shlwapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlwapi.h?rev…
============================================================================== --- trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] Sat Sep 26 12:45:05 2009 @@ -1014,7 +1014,7 @@ #define SHGVSPB_USERDEFAULTS (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS) #define SHGVSPB_GLOBALDEAFAULTS (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS) -HRESULT WINAPI SHGetViewStatePropertyBag(PCIDLIST_ABSOLUTE pidl, LPCWSTR pszBagName, DWORD dwFlags, REFIID riid, void** ppv); +HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPWSTR bag_name, DWORD flags, REFIID riid, void **ppv); #endif /* (_WIN32_IE >= 0x0600) */
15 years, 3 months
1
0
0
0
[cgutman] 43159: - Don't modify the size for now until I figure out where the incorrect code is
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Sep 26 08:50:06 2009 New Revision: 43159 URL:
http://svn.reactos.org/svn/reactos?rev=43159&view=rev
Log: - Don't modify the size for now until I figure out where the incorrect code is Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.c Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/wshtcpi…
============================================================================== --- trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] Sat Sep 26 08:50:06 2009 @@ -88,7 +88,7 @@ Sockaddr->sa_family = AF_INET; *((PUINT)Sockaddr->sa_data) = INADDR_BROADCAST; - *SockaddrLength = Size; + /* *SockaddrLength = Size; */ return NO_ERROR; } @@ -198,7 +198,7 @@ Sockaddr->sa_family = AF_INET; *((PUINT)Sockaddr->sa_data) = INADDR_ANY; - *SockaddrLength = Size; + /* *SockaddrLength = Size; */ return NO_ERROR; }
15 years, 3 months
1
0
0
0
[jimtabor] 43158: - Ilya Shpigor: User32: Skip STM_SETIMAGE message if the static control style does not match. - Enable EnhMeta functions.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat Sep 26 07:36:10 2009 New Revision: 43158 URL:
http://svn.reactos.org/svn/reactos?rev=43158&view=rev
Log: - Ilya Shpigor: User32: Skip STM_SETIMAGE message if the static control style does not match. - Enable EnhMeta functions. Modified: trunk/reactos/dll/win32/user32/controls/static.c Modified: trunk/reactos/dll/win32/user32/controls/static.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
============================================================================== --- trunk/reactos/dll/win32/user32/controls/static.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/controls/static.c [iso-8859-1] Sat Sep 26 07:36:10 2009 @@ -53,7 +53,7 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintBitmapfn( HWND hwnd, HDC hdc, DWORD style ); -//static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style ); +static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style ); //static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); //static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); @@ -85,7 +85,7 @@ STATIC_PaintTextfn, /* SS_LEFTNOWORDWRAP */ STATIC_PaintOwnerDrawfn, /* SS_OWNERDRAW */ STATIC_PaintBitmapfn, /* SS_BITMAP */ - NULL, /* STATIC_PaintEnhMetafn, SS_ENHMETAFILE */ + STATIC_PaintEnhMetafn, /* SS_ENHMETAFILE */ STATIC_PaintEtchedfn, /* SS_ETCHEDHORZ */ STATIC_PaintEtchedfn, /* SS_ETCHEDVERT */ STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */ @@ -255,15 +255,15 @@ * * Set the enhanced metafile for an SS_ENHMETAFILE control. */ -//static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style ) -//{ -// if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0; -// if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE) { -// WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n"); -// return 0; -// } -// return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile ); -//} +static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style ) +{ + if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0; + if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE) { + WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n"); + return 0; + } + return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile ); +} /*********************************************************************** * STATIC_GetImage @@ -617,13 +617,16 @@ case STM_SETIMAGE: switch(wParam) { case IMAGE_BITMAP: + if (style != SS_BITMAP) return 0; lResult = (LRESULT)STATIC_SetBitmap( hwnd, (HBITMAP)lParam, full_style ); break; -// case IMAGE_ENHMETAFILE: -// lResult = (LRESULT)STATIC_SetEnhMetaFile( hwnd, (HENHMETAFILE)lParam, full_style ); -// break; + case IMAGE_ENHMETAFILE: + if (style != SS_ENHMETAFILE) return 0; + lResult = (LRESULT)STATIC_SetEnhMetaFile( hwnd, (HENHMETAFILE)lParam, full_style ); + break; case IMAGE_ICON: case IMAGE_CURSOR: + if (style != SS_ICON) return 0; lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)lParam, full_style ); break; default: @@ -929,23 +932,23 @@ } -//static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style ) -//{ -// HENHMETAFILE hEnhMetaFile; -// RECT rc; -// HBRUSH hbrush; -// -// GetClientRect(hwnd, &rc); -// hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); -// FillRect(hdc, &rc, hbrush); -// if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))) -// { -// /* The control's current font is not selected into the -// device context! */ -// if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE) -// PlayEnhMetaFile(hdc, hEnhMetaFile, &rc); -// } -//} +static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style ) +{ + HENHMETAFILE hEnhMetaFile; + RECT rc; + HBRUSH hbrush; + + GetClientRect(hwnd, &rc); + hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); + FillRect(hdc, &rc, hbrush); + if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))) + { + /* The control's current font is not selected into the + device context! */ + if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE) + PlayEnhMetaFile(hdc, hEnhMetaFile, &rc); + } +} static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style )
15 years, 3 months
1
0
0
0
[jimtabor] 43157: - Alexandre Julliard : kernel32: Cope with an empty resource section in UpdateResource. - Wine Bug 19783 : http://bugs.winehq.org/show_bug.cgi?id=19783
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat Sep 26 07:25:52 2009 New Revision: 43157 URL:
http://svn.reactos.org/svn/reactos?rev=43157&view=rev
Log: - Alexandre Julliard : kernel32: Cope with an empty resource section in UpdateResource. - Wine Bug 19783 :
http://bugs.winehq.org/show_bug.cgi?id=19783
Modified: trunk/reactos/dll/win32/kernel32/misc/res.c Modified: trunk/reactos/dll/win32/kernel32/misc/res.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/re…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/res.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/res.c [iso-8859-1] Sat Sep 26 07:25:52 2009 @@ -405,13 +405,6 @@ return NULL; } - /* check that the resources section is last */ - if (i != num_sections - 1) - { - DPRINT("FIXME: .rsrc isn't the last section\n"); - return NULL; - } - return &sec[i]; } @@ -565,6 +558,9 @@ return TRUE; DPRINT("found .rsrc at %08x, size %08x\n", sec[i].PointerToRawData, sec[i].SizeOfRawData); + + if (!sec[i].PointerToRawData || sec[i].SizeOfRawData < sizeof(IMAGE_RESOURCE_DIRECTORY)) + return TRUE; root = (void*) ((BYTE*)base + sec[i].PointerToRawData); enumerate_mapped_resources( updates, base, mapping_size, root ); @@ -962,10 +958,15 @@ if (!sec) goto done; - if ((sec->SizeOfRawData + sec->PointerToRawData) != write_map->size) - { - DPRINT("FIXME: .rsrc isn't at the end of the image %08x + %08x != %08x\n", - sec->SizeOfRawData, sec->PointerToRawData, write_map->size); + if (!sec->PointerToRawData) /* empty section */ + { + sec->PointerToRawData = write_map->size; + sec->SizeOfRawData = 0; + } + else if ((sec->SizeOfRawData + sec->PointerToRawData) != write_map->size) + { + DPRINT(".rsrc isn't at the end of the image %08x + %08x != %08x for %s\n", + sec->SizeOfRawData, sec->PointerToRawData, write_map->size, updates->pFileName); goto done; }
15 years, 3 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
27
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
Results per page:
10
25
50
100
200