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
January 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
30 participants
755 discussions
Start a n
N
ew thread
[dchapyshev] 39243: - Add qmgr to build and bootcd - Add more stuff to bootcd See issue #4095 for more details.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Jan 31 10:49:22 2009 New Revision: 39243 URL:
http://svn.reactos.org/svn/reactos?rev=39243&view=rev
Log: - Add qmgr to build and bootcd - Add more stuff to bootcd See issue #4095 for more details. Added: trunk/reactos/dll/win32/qmgr/bits.idl_i.c (with props) Modified: trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/qmgr/qmgr.rbuild trunk/reactos/dll/win32/win32.rbuild Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Sat Jan 31 10:49:22 2009 @@ -41,6 +41,7 @@ base\applications\cmdutils\more\more.exe 1 base\applications\cmdutils\xcopy\xcopy.exe 1 base\applications\control\control.exe 1 +base\applications\dxdiag\dxdiag.exe 1 base\applications\mscutils\devmgmt\devmgmt.exe 1 base\applications\mscutils\eventvwr\eventvwr.exe 1 base\applications\games\solitaire\sol.exe 1 @@ -65,6 +66,7 @@ base\applications\notepad\notepad.exe 1 base\applications\regedit\regedit.exe 4 base\applications\regedit\clb\clb.dll 1 +base\applications\regedt32\regedt32.exe 1 base\applications\sc\sc.exe 1 base\applications\screensavers\3dtext\3dtext.scr 1 base\applications\screensavers\logon\logon.scr 1 @@ -119,16 +121,19 @@ dll\cpl\console\console.dll 1 dll\cpl\desk\desk.cpl 1 dll\cpl\hdwwiz\hdwwiz.cpl 1 +dll\cpl\input\input.dll 1 dll\cpl\intl\intl.cpl 1 +dll\cpl\joy\joy.cpl 1 +;dll\cpl\liccpa\liccpa.cpl 1 dll\cpl\main\main.cpl 1 dll\cpl\mmsys\mmsys.cpl 1 dll\cpl\ncpa\ncpa.cpl 1 +;dll\cpl\odbccp32\odbccp32.cpl 1 dll\cpl\powercfg\powercfg.cpl 1 dll\cpl\sysdm\sysdm.cpl 1 ;dll\cpl\telephon\telephon.cpl 1 dll\cpl\timedate\timedate.cpl 1 -dll\cpl\input\input.dll 1 -dll\cpl\joy\joy.cpl 1 +;dll\cpl\usrmgr\usrmgr.cpl 1 dll\directx\dinput\dinput.dll 1 dll\directx\dinput8\dinput8.dll 1 @@ -329,6 +334,7 @@ dll\win32\printui\printui.dll 1 dll\win32\psapi\psapi.dll 1 dll\win32\pstorec\pstorec.dll 1 +dll\win32\qmgr\qmgr.dll 1 dll\win32\rasapi32\rasapi32.dll 1 dll\win32\rasdlg\rasdlg.dll 1 dll\win32\rasman\rasman.dll 1 Added: trunk/reactos/dll/win32/qmgr/bits.idl_i.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/bits.idl_i.…
============================================================================== --- trunk/reactos/dll/win32/qmgr/bits.idl_i.c (added) +++ trunk/reactos/dll/win32/qmgr/bits.idl_i.c [iso-8859-1] Sat Jan 31 10:49:22 2009 @@ -1,0 +1,26 @@ +/*** Autogenerated by WIDL 0.4-SVN from f:\reactos\include\psdk\bits.idl - Do not edit ***/ + +#include <rpc.h> +#include <rpcndr.h> + +#include <initguid.h> + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(IID_IBackgroundCopyFile, 0x01b7bd23, 0xfb88, 0x4a77, 0x84,0x90, 0x58,0x91,0xd3,0xe4,0x65,0x3a); +DEFINE_GUID(IID_IEnumBackgroundCopyFiles, 0xca51e165, 0xc365, 0x424c, 0x8d,0x41, 0x24,0xaa,0xa4,0xff,0x3c,0x40); +DEFINE_GUID(IID_IBackgroundCopyError, 0x19c613a0, 0xfcb8, 0x4f28, 0x81,0xae, 0x89,0x7c,0x3d,0x07,0x8f,0x81); +DEFINE_GUID(IID_IBackgroundCopyJob, 0x37668d37, 0x507e, 0x4160, 0x93,0x16, 0x26,0x30,0x6d,0x15,0x0b,0x12); +DEFINE_GUID(IID_IEnumBackgroundCopyJobs, 0x1af4f612, 0x3b71, 0x466f, 0x8f,0x58, 0x7b,0x6f,0x73,0xac,0x57,0xad); +DEFINE_GUID(IID_IBackgroundCopyCallback, 0x97ea99c7, 0x0186, 0x4ad4, 0x8d,0xf9, 0xc5,0xb4,0xe0,0xed,0x6b,0x22); +DEFINE_GUID(IID_IBackgroundCopyManager, 0x5ce34c0d, 0x0dc9, 0x4c1f, 0x89,0x7c, 0xda,0xa1,0xb7,0x8c,0xee,0x7c); +DEFINE_GUID(LIBID_BackgroundCopyManager, 0x1deeb74f, 0x7915, 0x4560, 0xb5,0x58, 0x91,0x8c,0x83,0xf1,0x76,0xa6); +DEFINE_GUID(CLSID_BackgroundCopyManager, 0x4991d34b, 0x80a1, 0x4291, 0x83,0xb6, 0x33,0x28,0x36,0x6b,0x90,0x97); +DEFINE_GUID(IID_IBackgroundCopyJob2, 0x54b50739, 0x686f, 0x45eb, 0x9d,0xff, 0xd6,0xa9,0xa0,0xfa,0xa9,0xaf); + +#ifdef __cplusplus +} +#endif + Propchange: trunk/reactos/dll/win32/qmgr/bits.idl_i.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/qmgr/qmgr.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.rbuild…
============================================================================== --- trunk/reactos/dll/win32/qmgr/qmgr.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/qmgr.rbuild [iso-8859-1] Sat Jan 31 10:49:22 2009 @@ -23,6 +23,10 @@ <file>qmgr.c</file> <file>qmgr_main.c</file> <file>service.c</file> + + <!-- FIXME: this file should be autogenerated with WIDL --> + <file>bits.idl_i.c</file> + <file>rsrc.rc</file> </module> <module name="qmgr_local_header" type="idlheader"> Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Sat Jan 31 10:49:22 2009 @@ -301,9 +301,9 @@ <directory name="pstorec"> <xi:include href="pstorec/pstorec.rbuild" /> </directory> -<!--directory name="qmgr"> +<directory name="qmgr"> <xi:include href="qmgr/qmgr.rbuild" /> -</directory--> +</directory> <directory name="rasapi32"> <xi:include href="rasapi32/rasapi32.rbuild" /> </directory>
15 years, 10 months
1
0
0
0
[cwittich] 39242: replace hack by manually generated msiserver.idl_i.c (which should be generated by rbuild)
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 09:46:48 2009 New Revision: 39242 URL:
http://svn.reactos.org/svn/reactos?rev=39242&view=rev
Log: replace hack by manually generated msiserver.idl_i.c (which should be generated by rbuild) Added: trunk/reactos/dll/win32/msi/msiserver.idl_i.c (with props) Modified: trunk/reactos/dll/win32/msi/msi.rbuild trunk/reactos/dll/win32/msi/regsvr.c Modified: trunk/reactos/dll/win32/msi/msi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.rbuild?r…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.rbuild [iso-8859-1] Sat Jan 31 09:46:48 2009 @@ -53,6 +53,10 @@ <file>upgrade.c</file> <file>where.c</file> <file>msi.rc</file> + + <!-- FIXME: this file should be autogenerated with WIDL --> + <file>msiserver.idl_i.c</file> + <include base="msi" root="intermediate">.</include> <library>wine</library> <library>uuid</library> Added: trunk/reactos/dll/win32/msi/msiserver.idl_i.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msiserver.id…
============================================================================== --- trunk/reactos/dll/win32/msi/msiserver.idl_i.c (added) +++ trunk/reactos/dll/win32/msi/msiserver.idl_i.c [iso-8859-1] Sat Jan 31 09:46:48 2009 @@ -1,0 +1,32 @@ +/*** Autogenerated by WIDL 0.4-SVN from msiserver.idl - Do not edit ***/ + +#include <rpc.h> +#include <rpcndr.h> + +#include <initguid.h> + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(IID_IWineMsiRemoteDatabase, 0x7bde2046, 0xd03b, 0x4ffc, 0xb8,0x4c, 0xa0,0x98,0xf3,0x8c,0xff,0x0b); +DEFINE_GUID(IID_IWineMsiRemotePackage, 0x902b3592, 0x9d08, 0x4dfd, 0xa5,0x93, 0xd0,0x7c,0x52,0x54,0x64,0x21); +DEFINE_GUID(IID_IWineMsiRemoteCustomAction, 0x56d58b64, 0x8780, 0x4c22, 0xa8,0xbc, 0x8b,0x0b,0x29,0xe4,0xa9,0xf8); +DEFINE_GUID(LIBID_WindowsInstaller, 0x000c1092, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_Installer, 0x000c1090, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_Record, 0x000c1093, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_StringList, 0x000c1095, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_RecordList, 0x000c1096, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_UIPreview, 0x000c109a, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_SummaryInfo, 0x000c109b, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_View, 0x000c109c, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_Database, 0x000c109d, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_Session, 0x000c109e, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_FeatureInfo, 0x000c109f, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_Product, 0x000c10a0, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(DIID_Patch, 0x000c10a1, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); + +#ifdef __cplusplus +} +#endif + Propchange: trunk/reactos/dll/win32/msi/msiserver.idl_i.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/msi/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/regsvr.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/regsvr.c [iso-8859-1] Sat Jan 31 09:46:48 2009 @@ -41,7 +41,6 @@ #include "msi.h" #include "initguid.h" #include "msipriv.h" -#include "msiserver.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); /*
15 years, 10 months
1
0
0
0
[gschneider] 39241: Remove dead StretchBlt code
by gschneider@svn.reactos.org
Author: gschneider Date: Sat Jan 31 09:38:16 2009 New Revision: 39241 URL:
http://svn.reactos.org/svn/reactos?rev=39241&view=rev
Log: Remove dead StretchBlt code Modified: trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib32bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c Modified: trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c [iso-8859-1] Sat Jan 31 09:38:16 2009 @@ -452,377 +452,6 @@ #endif return TRUE; } -/* -======================================= - Stretching functions goes below - Some parts of code are based on an - article "Bresenhame image scaling" - Dr. Dobb Journal, May 2002 -======================================= -*/ - -typedef unsigned short PIXEL; - -/* 16-bit HiColor (565 format) */ -__inline PIXEL average16(PIXEL a, PIXEL b) -{ -// This one should be correct, but it's too long -/* - unsigned char r1, g1, b1, r2, g2, b2, rr, gr, br; - unsigned short res; - - r1 = (a & 0xF800) >> 11; - g1 = (a & 0x7E0) >> 5; - b1 = (a & 0x1F); - - r2 = (b & 0xF800) >> 11; - g2 = (b & 0x7E0) >> 5; - b2 = (b & 0x1F); - - rr = (r1+r2) / 2; - gr = (g1+g2) / 2; - br = (b1+b2) / 2; - - res = (rr << 11) + (gr << 5) + br; - - return res; -*/ - // This one is the short form of the correct one, but does not work for QEMU (expects 555 format) - //return (((a ^ b) & 0xf7deU) >> 1) + (a & b); - - //hack until short version works properly - return a; -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -void ScaleLineAvg16(PIXEL *Target, PIXEL *Source, int SrcWidth, int TgtWidth) -{ - int NumPixels = TgtWidth; - int IntPart = SrcWidth / TgtWidth; - int FractPart = SrcWidth % TgtWidth; - int Mid = TgtWidth >> 1; - int E = 0; - int skip; - PIXEL p; - - skip = (TgtWidth < SrcWidth) ? 0 : (TgtWidth / (2*SrcWidth) + 1); - NumPixels -= skip; - - while (NumPixels-- > 0) - { - p = *Source; - if (E >= Mid) - { - p = average16(p, *(Source+1)); - } - *Target++ = p; - Source += IntPart; - E += FractPart; - if (E >= TgtWidth) - { - E -= TgtWidth; - Source++; - } - } - while (skip-- > 0) - { - *Target++ = *Source; - } -} - -static BOOLEAN -FinalCopy16(PIXEL *Target, PIXEL *Source, PSPAN ClipSpans, UINT ClipSpansCount, UINT *SpanIndex, - UINT DestY, RECTL *DestRect) -{ - LONG Left, Right; - - while ( ClipSpans[*SpanIndex].Y < DestY || - (ClipSpans[*SpanIndex].Y == DestY && - ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width < DestRect->left)) - { - (*SpanIndex)++; - if (ClipSpansCount <= *SpanIndex) - { - /* No more spans, everything else is clipped away, we're done */ - return FALSE; - } - } - while (ClipSpans[*SpanIndex].Y == DestY) - { - if (ClipSpans[*SpanIndex].X < DestRect->right) - { - Left = max(ClipSpans[*SpanIndex].X, DestRect->left); - - Right = min(ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width, - DestRect->right); - - memcpy(Target + Left - DestRect->left, Source + Left - DestRect->left, - (Right - Left) * sizeof(PIXEL)); - } - - (*SpanIndex)++; - - if (ClipSpansCount <= *SpanIndex) - { - /* No more spans, everything else is clipped away, we're done */ - return FALSE; - } - } - - return TRUE; -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN ScaleRectAvg16(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - int NumPixels = DestRect->bottom - DestRect->top; - - int IntPart = (((SourceRect->bottom - SourceRect->top) / - (DestRect->bottom - DestRect->top)) * SourceSurf->lDelta) >> 1; - - int FractPart = (SourceRect->bottom - SourceRect->top) % - (DestRect->bottom - DestRect->top); - - int Mid = (DestRect->bottom - DestRect->top) >> 1; - int E = 0; - int skip; - PIXEL *ScanLine, *ScanLineAhead; - PIXEL *PrevSource = NULL; - PIXEL *PrevSourceAhead = NULL; - - PIXEL *Target = (PIXEL *) ((PBYTE)DestSurf->pvScan0 + (DestRect->top * - DestSurf->lDelta) + 2 * DestRect->left); - - PIXEL *Source = (PIXEL *) ((PBYTE)SourceSurf->pvScan0 + (SourceRect->top * - SourceSurf->lDelta) + 2 * SourceRect->left); - - PSPAN ClipSpans; - UINT ClipSpansCount; - UINT SpanIndex; - LONG DestY; - - if (! ClipobjToSpans(&ClipSpans, &ClipSpansCount, ClipRegion, DestRect)) - { - return FALSE; - } - if (0 == ClipSpansCount) - { - /* No clip spans == empty clipping region, everything clipped away */ - ASSERT(NULL == ClipSpans); - return TRUE; - } - skip = (DestRect->bottom - DestRect->top < SourceRect->bottom - SourceRect->top) - ? 0 : ((DestRect->bottom - DestRect->top) / - (2 * (SourceRect->bottom - SourceRect->top)) + 1); - - NumPixels -= skip; - - ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * - sizeof(PIXEL)); - - ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - - DestRect->left) * sizeof(PIXEL)); - - if (!ScanLine || !ScanLineAhead) - { - if (ScanLine) ExFreePool(ScanLine); - if (ScanLineAhead) ExFreePool(ScanLineAhead); - return FALSE; - } - - DestY = DestRect->top; - SpanIndex = 0; - while (NumPixels-- > 0) - { - if (Source != PrevSource) - { - if (Source == PrevSourceAhead) - { - /* the next scan line has already been scaled and stored in - * ScanLineAhead; swap the buffers that ScanLine and ScanLineAhead - * point to - */ - PIXEL *tmp = ScanLine; - ScanLine = ScanLineAhead; - ScanLineAhead = tmp; - } - else - { - ScaleLineAvg16(ScanLine, Source, SourceRect->right - SourceRect->left, - DestRect->right - DestRect->left); - } - PrevSource = Source; - } - - if (E >= Mid && PrevSourceAhead != (PIXEL *)((BYTE *)Source + - SourceSurf->lDelta)) - { - int x; - - ScaleLineAvg16(ScanLineAhead, (PIXEL *)((BYTE *)Source + - SourceSurf->lDelta), SourceRect->right - - SourceRect->left, DestRect->right - DestRect->left); - - for (x = 0; x < DestRect->right - DestRect->left; x++) - { - ScanLine[x] = average16(ScanLine[x], ScanLineAhead[x]); - } - - PrevSourceAhead = (PIXEL *)((BYTE *)Source + SourceSurf->lDelta); - } - - if (! FinalCopy16(Target, ScanLine, ClipSpans, ClipSpansCount, &SpanIndex, DestY, DestRect)) - { - /* No more spans, everything else is clipped away, we're done */ - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - return TRUE; - } - - DestY++; - Target = (PIXEL *)((BYTE *)Target + DestSurf->lDelta); - Source += IntPart; - E += FractPart; - - if (E >= DestRect->bottom - DestRect->top) - { - E -= DestRect->bottom - DestRect->top; - Source = (PIXEL *)((BYTE *)Source + SourceSurf->lDelta); - } - } /* while */ - - if (skip > 0 && Source != PrevSource) - { - ScaleLineAvg16(ScanLine, Source, SourceRect->right - SourceRect->left, - DestRect->right - DestRect->left); - } - - while (skip-- > 0) - { - if (! FinalCopy16(Target, ScanLine, ClipSpans, ClipSpansCount, &SpanIndex, - DestY, DestRect)) - { - /* No more spans, everything else is clipped away, we're done */ - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - return TRUE; - } - DestY++; - Target = (PIXEL *)((BYTE *)Target + DestSurf->lDelta); - } - - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - - return TRUE; -} - - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - LONG SrcSizeY; - LONG SrcSizeX; - LONG DesSizeY; - LONG DesSizeX; - LONG sx = 0; - LONG sy = 0; - LONG DesX; - LONG DesY; - - LONG SrcZoomXHight; - LONG SrcZoomXLow; - LONG SrcZoomYHight; - LONG SrcZoomYLow; - - LONG sy_dec = 0; - LONG sy_max; - - LONG sx_dec = 0; - LONG sx_max; - ULONG color; - - DPRINT("DIB_16BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", - BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, - DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); - - /* Calc the Zoom height of Source */ - SrcSizeY = SourceRect->bottom - SourceRect->top; - - /* Calc the Zoom Width of Source */ - SrcSizeX = SourceRect->right - SourceRect->left; - - /* Calc the Zoom height of Destinations */ - DesSizeY = DestRect->bottom - DestRect->top; - - /* Calc the Zoom width of Destinations */ - DesSizeX = DestRect->right - DestRect->left; - - /* Calc the zoom factor of source height */ - SrcZoomYHight = SrcSizeY / DesSizeY; - SrcZoomYLow = SrcSizeY - (SrcZoomYHight * DesSizeY); - - /* Calc the zoom factor of source width */ - SrcZoomXHight = SrcSizeX / DesSizeX; - SrcZoomXLow = SrcSizeX - (SrcZoomXHight * DesSizeX); - - sx_max = DesSizeX; - sy_max = DesSizeY; - sy = SourceRect->top; - - if (SourceSurf->iBitmapFormat != BMF_16BPP) - { - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) - { - sx = SourceRect->left; - sx_dec = 0; - - for (DesX=DestRect->left; DesX<DestRect->right; DesX++) - { - color = XLATEOBJ_iXlate(ColorTranslation, - DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. - DIB_GetPixel(SourceSurf, sx, sy)); - - DIB_16BPP_PutPixel(DestSurf, DesX, DesY, color); - - sx += SrcZoomXHight; - sx_dec += SrcZoomXLow; - if (sx_dec >= sx_max) - { - sx++; - sx_dec -= sx_max; - } - } - - sy += SrcZoomYHight; - sy_dec += SrcZoomYLow; - if (sy_dec >= sy_max) - { - sy++; - sy_dec -= sy_max; - } - } - } - else - { - return ScaleRectAvg16(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin, - ClipRegion, ColorTranslation, Mode); - } - return TRUE; -} BOOLEAN DIB_16BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, Modified: trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c [iso-8859-1] Sat Jan 31 09:38:16 2009 @@ -492,47 +492,6 @@ return TRUE; } -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! - -BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - LONG SrcSizeY; - LONG SrcSizeX; - LONG DesSizeY; - LONG DesSizeX; - LONG sx; - LONG sy; - LONG DesX; - LONG DesY; - LONG color; - - SrcSizeY = SourceRect->bottom - SourceRect->top; - SrcSizeX = SourceRect->right - SourceRect->left; - - DesSizeY = DestRect->bottom - DestRect->top; - DesSizeX = DestRect->right - DestRect->left; - - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) - { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - - for (DesX=DestRect->left; DesX<DestRect->right; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. - DIB_GetPixel(SourceSurf, sx, sy); - DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); - } - } - return TRUE; -} - BOOLEAN DIB_1BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL* DestRect, POINTL *SourcePoint, Modified: trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] Sat Jan 31 09:38:16 2009 @@ -403,97 +403,6 @@ return TRUE; } -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - LONG SrcSizeY; - LONG SrcSizeX; - LONG DesSizeY; - LONG DesSizeX; - LONG sx = 0; - LONG sy = 0; - LONG DesX; - LONG DesY; - - LONG SrcZoomXHight; - LONG SrcZoomXLow; - LONG SrcZoomYHight; - LONG SrcZoomYLow; - - LONG sy_dec = 0; - LONG sy_max; - - LONG sx_dec = 0; - LONG sx_max; - ULONG color; - - DPRINT("DIB_24BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", - BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, - DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); - - /* Calc the Zoom height of Source */ - SrcSizeY = SourceRect->bottom - SourceRect->top; - - /* Calc the Zoom Width of Source */ - SrcSizeX = SourceRect->right - SourceRect->left; - - /* Calc the Zoom height of Destinations */ - DesSizeY = DestRect->bottom - DestRect->top; - - /* Calc the Zoom width of Destinations */ - DesSizeX = DestRect->right - DestRect->left; - - /* Calc the zoom factor of source height */ - SrcZoomYHight = SrcSizeY / DesSizeY; - SrcZoomYLow = SrcSizeY - (SrcZoomYHight * DesSizeY); - - /* Calc the zoom factor of source width */ - SrcZoomXHight = SrcSizeX / DesSizeX; - SrcZoomXLow = SrcSizeX - (SrcZoomXHight * DesSizeX); - - sx_max = DesSizeX; - sy_max = DesSizeY; - sy = SourceRect->top; - - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) - { - sx = SourceRect->left; - sx_dec = 0; - - for (DesX=DestRect->left; DesX<DestRect->right; DesX++) - { - color = XLATEOBJ_iXlate(ColorTranslation, - DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. - DIB_GetPixel(SourceSurf, sx, sy)); - - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); - - sx += SrcZoomXHight; - sx_dec += SrcZoomXLow; - if (sx_dec >= sx_max) - { - sx++; - sx_dec -= sx_max; - } - } - - sy += SrcZoomYHight; - sy_dec += SrcZoomYLow; - if (sy_dec >= sy_max) - { - sy++; - sy_dec -= sy_max; - } - } - return TRUE; -} - BOOLEAN DIB_24BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL* DestRect, POINTL *SourcePoint, Modified: trunk/reactos/subsystems/win32/win32k/dib/dib32bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib32bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib32bpp.c [iso-8859-1] Sat Jan 31 09:38:16 2009 @@ -277,312 +277,6 @@ return TRUE; } - -/* -======================================= - Stretching functions goes below - Some parts of code are based on an - article "Bresenhame image scaling" - Dr. Dobb Journal, May 2002 -======================================= -*/ - -typedef unsigned long PIXEL; - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! - -/* 32-bit Color (___ format) */ -__inline PIXEL average32(PIXEL a, PIXEL b) -{ - return a; // FIXME: Temp hack to remove "PCB-effect" from the image -} - -void ScaleLineAvg32(PIXEL *Target, PIXEL *Source, int SrcWidth, int TgtWidth) -{ - int NumPixels = TgtWidth; - int IntPart = SrcWidth / TgtWidth; - int FractPart = SrcWidth % TgtWidth; - int Mid = TgtWidth >> 1; - int E = 0; - int skip; - PIXEL p; - - skip = (TgtWidth < SrcWidth) ? 0 : (TgtWidth / (2*SrcWidth) + 1); - NumPixels -= skip; - - while (NumPixels-- > 0) { - p = *Source; - if (E >= Mid) - p = average32(p, *(Source+1)); - *Target++ = p; - Source += IntPart; - E += FractPart; - if (E >= TgtWidth) { - E -= TgtWidth; - Source++; - } /* if */ - } /* while */ - while (skip-- > 0) - *Target++ = *Source; -} - -static BOOLEAN -FinalCopy32(PIXEL *Target, PIXEL *Source, PSPAN ClipSpans, UINT ClipSpansCount, UINT *SpanIndex, - UINT DestY, RECTL *DestRect) -{ - LONG Left, Right; - - while (ClipSpans[*SpanIndex].Y < DestY - || (ClipSpans[*SpanIndex].Y == DestY - && ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width < DestRect->left)) - { - (*SpanIndex)++; - if (ClipSpansCount <= *SpanIndex) - { - /* No more spans, everything else is clipped away, we're done */ - return FALSE; - } - } - while (ClipSpans[*SpanIndex].Y == DestY) - { - if (ClipSpans[*SpanIndex].X < DestRect->right) - { - Left = max(ClipSpans[*SpanIndex].X, DestRect->left); - Right = min(ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width, DestRect->right); - memcpy(Target + Left - DestRect->left, Source + Left - DestRect->left, - (Right - Left) * sizeof(PIXEL)); - } - (*SpanIndex)++; - if (ClipSpansCount <= *SpanIndex) - { - /* No more spans, everything else is clipped away, we're done */ - return FALSE; - } - } - - return TRUE; -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN ScaleRectAvg32(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - int NumPixels = DestRect->bottom - DestRect->top; - int IntPart = (((SourceRect->bottom - SourceRect->top) / (DestRect->bottom - DestRect->top)) * SourceSurf->lDelta) / 4; - int FractPart = (SourceRect->bottom - SourceRect->top) % (DestRect->bottom - DestRect->top); - int Mid = (DestRect->bottom - DestRect->top) >> 1; - int E = 0; - int skip; - PIXEL *ScanLine, *ScanLineAhead; - PIXEL *PrevSource = NULL; - PIXEL *PrevSourceAhead = NULL; - PIXEL *Target = (PIXEL *) ((PBYTE)DestSurf->pvScan0 + (DestRect->top * DestSurf->lDelta) + 4 * DestRect->left); - PIXEL *Source = (PIXEL *) ((PBYTE)SourceSurf->pvScan0 + (SourceRect->top * SourceSurf->lDelta) + 4 * SourceRect->left); - PSPAN ClipSpans; - UINT ClipSpansCount; - UINT SpanIndex; - LONG DestY; - - if (! ClipobjToSpans(&ClipSpans, &ClipSpansCount, ClipRegion, DestRect)) - { - return FALSE; - } - if (0 == ClipSpansCount) - { - /* No clip spans == empty clipping region, everything clipped away */ - ASSERT(NULL == ClipSpans); - return TRUE; - } - skip = (DestRect->bottom - DestRect->top < SourceRect->bottom - SourceRect->top) ? 0 : ((DestRect->bottom - DestRect->top) / (2 * (SourceRect->bottom - SourceRect->top)) + 1); - NumPixels -= skip; - - ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL)); - ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL)); - - if (!ScanLine || !ScanLineAhead) - { - if (ScanLine) ExFreePool(ScanLine); - if (ScanLineAhead) ExFreePool(ScanLineAhead); - return FALSE; - } - - DestY = DestRect->top; - SpanIndex = 0; - while (NumPixels-- > 0) { - if (Source != PrevSource) { - if (Source == PrevSourceAhead) { - /* the next scan line has already been scaled and stored in - * ScanLineAhead; swap the buffers that ScanLine and ScanLineAhead - * point to - */ - PIXEL *tmp = ScanLine; - ScanLine = ScanLineAhead; - ScanLineAhead = tmp; - } else { - ScaleLineAvg32(ScanLine, Source, SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); - } /* if */ - PrevSource = Source; - } /* if */ - - if (E >= Mid && PrevSourceAhead != (PIXEL *)((BYTE *)Source + SourceSurf->lDelta)) { - int x; - ScaleLineAvg32(ScanLineAhead, (PIXEL *)((BYTE *)Source + SourceSurf->lDelta), SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); - for (x = 0; x < DestRect->right - DestRect->left; x++) - ScanLine[x] = average32(ScanLine[x], ScanLineAhead[x]); - PrevSourceAhead = (PIXEL *)((BYTE *)Source + SourceSurf->lDelta); - } /* if */ - - if (! FinalCopy32(Target, ScanLine, ClipSpans, ClipSpansCount, &SpanIndex, DestY, DestRect)) - { - /* No more spans, everything else is clipped away, we're done */ - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - return TRUE; - } - DestY++; - Target = (PIXEL *)((BYTE *)Target + DestSurf->lDelta); - Source += IntPart; - E += FractPart; - if (E >= DestRect->bottom - DestRect->top) { - E -= DestRect->bottom - DestRect->top; - Source = (PIXEL *)((BYTE *)Source + SourceSurf->lDelta); - } /* if */ - } /* while */ - - if (skip > 0 && Source != PrevSource) - ScaleLineAvg32(ScanLine, Source, SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); - while (skip-- > 0) { - if (! FinalCopy32(Target, ScanLine, ClipSpans, ClipSpansCount, &SpanIndex, DestY, DestRect)) - { - /* No more spans, everything else is clipped away, we're done */ - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - return TRUE; - } - DestY++; - Target = (PIXEL *)((BYTE *)Target + DestSurf->lDelta); - } /* while */ - - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - - return TRUE; -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - - LONG SrcSizeY; - LONG SrcSizeX; - LONG DesSizeY; - LONG DesSizeX; - LONG sx = 0; - LONG sy = 0; - LONG DesX; - LONG DesY; - PULONG DestBits; - LONG DifflDelta; - - LONG SrcZoomXHight; - LONG SrcZoomXLow; - LONG SrcZoomYHight; - LONG SrcZoomYLow; - - LONG sy_dec = 0; - LONG sy_max; - - LONG sx_dec = 0; - LONG sx_max; - - - DPRINT("DIB_32BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", - BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, - SourceRect->bottom, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); - - /* Calc the Zoom height of Source */ - SrcSizeY = SourceRect->bottom - SourceRect->top; - - /* Calc the Zoom Width of Source */ - SrcSizeX = SourceRect->right - SourceRect->left; - - /* Calc the Zoom height of Destinations */ - DesSizeY = DestRect->bottom - DestRect->top; - - /* Calc the Zoom width of Destinations */ - DesSizeX = DestRect->right - DestRect->left; - - /* Calc the zoom factor of source height */ - SrcZoomYHight = SrcSizeY / DesSizeY; - SrcZoomYLow = SrcSizeY - (SrcZoomYHight * DesSizeY); - - /* Calc the zoom factor of source width */ - SrcZoomXHight = SrcSizeX / DesSizeX; - SrcZoomXLow = SrcSizeX - (SrcZoomXHight * DesSizeX); - - sx_max = DesSizeX; - sy_max = DesSizeY; - sy = SourceRect->top; - - DestBits = (PULONG)((PBYTE)DestSurf->pvScan0 + (DestRect->left << 2) + - DestRect->top * DestSurf->lDelta); - - DifflDelta = DestSurf->lDelta - (DesSizeX << 2); - - if (SourceSurf->iBitmapFormat != BMF_32BPP) - { - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) - { - sx = SourceRect->left; - sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) - { - *DestBits = XLATEOBJ_iXlate(ColorTranslation, - DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. - DIB_GetPixel(SourceSurf, sx, sy)); - - DestBits = (PULONG)((ULONG_PTR)DestBits + 4); - - sx += SrcZoomXHight; - sx_dec += SrcZoomXLow; - if (sx_dec >= sx_max) - { - sx++; - sx_dec -= sx_max; - } - } - - DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta); - - sy += SrcZoomYHight; - sy_dec += SrcZoomYLow; - if (sy_dec >= sy_max) - { - sy++; - sy_dec -= sy_max; - } - } - } - else - { - return ScaleRectAvg32(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin, - ClipRegion, ColorTranslation, Mode); - } - return TRUE; -} - BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL* DestRect, POINTL *SourcePoint, Modified: trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c [iso-8859-1] Sat Jan 31 09:38:16 2009 @@ -374,46 +374,6 @@ return TRUE; } -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - LONG SrcSizeY; - LONG SrcSizeX; - LONG DesSizeY; - LONG DesSizeX; - LONG sx; - LONG sy; - LONG DesX; - LONG DesY; - LONG color; - - SrcSizeY = SourceRect->bottom - SourceRect->top; - SrcSizeX = SourceRect->right - SourceRect->left; - - DesSizeY = DestRect->bottom - DestRect->top; - DesSizeX = DestRect->right - DestRect->left; - - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) - { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - - for (DesX=DestRect->left; DesX<DestRect->right; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. - DIB_GetPixel(SourceSurf, sx, sy); - DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); - } - } - return TRUE; -} - BOOLEAN DIB_4BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL* DestRect, POINTL *SourcePoint, Modified: trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c [iso-8859-1] Sat Jan 31 09:38:16 2009 @@ -264,300 +264,7 @@ return TRUE; } -/* -======================================= - Stretching functions goes below - Some parts of code are based on an - article "Bresenhame image scaling" - Dr. Dobb Journal, May 2002 -======================================= -*/ - -typedef unsigned char PIXEL; - -/* 16-bit HiColor (565 format) */ -__inline PIXEL average8(PIXEL a, PIXEL b) -{ - return a; // FIXME: Depend on SetStretchMode -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -void ScaleLineAvg8(PIXEL *Target, PIXEL *Source, int SrcWidth, int TgtWidth) -{ - int NumPixels = TgtWidth; - int IntPart = SrcWidth / TgtWidth; - int FractPart = SrcWidth % TgtWidth; - int Mid = TgtWidth >> 1; - int E = 0; - int skip; - PIXEL p; - - skip = (TgtWidth < SrcWidth) ? 0 : (TgtWidth / (2*SrcWidth) + 1); - NumPixels -= skip; - - while (NumPixels-- > 0) { - p = *Source; - if (E >= Mid) - p = average8(p, *(Source+1)); - *Target++ = p; - Source += IntPart; - E += FractPart; - if (E >= TgtWidth) { - E -= TgtWidth; - Source++; - } /* if */ - } /* while */ - while (skip-- > 0) - *Target++ = *Source; -} - -static BOOLEAN -FinalCopy8(PIXEL *Target, PIXEL *Source, PSPAN ClipSpans, UINT ClipSpansCount, UINT *SpanIndex, - UINT DestY, RECTL *DestRect) -{ - LONG Left, Right; - - while (ClipSpans[*SpanIndex].Y < DestY - || (ClipSpans[*SpanIndex].Y == DestY - && ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width < DestRect->left)) - { - (*SpanIndex)++; - if (ClipSpansCount <= *SpanIndex) - { - /* No more spans, everything else is clipped away, we're done */ - return FALSE; - } - } - while (ClipSpans[*SpanIndex].Y == DestY) - { - if (ClipSpans[*SpanIndex].X < DestRect->right) - { - Left = max(ClipSpans[*SpanIndex].X, DestRect->left); - Right = min(ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width, DestRect->right); - memcpy(Target + Left - DestRect->left, Source + Left - DestRect->left, - (Right - Left) * sizeof(PIXEL)); - } - (*SpanIndex)++; - if (ClipSpansCount <= *SpanIndex) - { - /* No more spans, everything else is clipped away, we're done */ - return FALSE; - } - } - - return TRUE; -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN ScaleRectAvg8(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - int NumPixels = DestRect->bottom - DestRect->top; - int IntPart = (((SourceRect->bottom - SourceRect->top) / (DestRect->bottom - DestRect->top)) * SourceSurf->lDelta); //((SourceRect->bottom - SourceRect->top) / (DestRect->bottom - DestRect->top)) * (SourceRect->right - SourceRect->left); - int FractPart = (SourceRect->bottom - SourceRect->top) % (DestRect->bottom - DestRect->top); - int Mid = (DestRect->bottom - DestRect->top) >> 1; - int E = 0; - int skip; - PIXEL *ScanLine, *ScanLineAhead; - PIXEL *PrevSource = NULL; - PIXEL *PrevSourceAhead = NULL; - PIXEL *Target = (PIXEL *) ((PBYTE)DestSurf->pvScan0 + (DestRect->top * DestSurf->lDelta) + DestRect->left); - PIXEL *Source = (PIXEL *) ((PBYTE)SourceSurf->pvScan0 + (SourceRect->top * SourceSurf->lDelta) + SourceRect->left); - PSPAN ClipSpans; - UINT ClipSpansCount; - UINT SpanIndex; - LONG DestY; - - if (! ClipobjToSpans(&ClipSpans, &ClipSpansCount, ClipRegion, DestRect)) - { - return FALSE; - } - if (0 == ClipSpansCount) - { - /* No clip spans == empty clipping region, everything clipped away */ - ASSERT(NULL == ClipSpans); - return TRUE; - } - skip = (DestRect->bottom - DestRect->top < SourceRect->bottom - SourceRect->top) ? 0 : ((DestRect->bottom - DestRect->top) / (2 * (SourceRect->bottom - SourceRect->top)) + 1); - NumPixels -= skip; - - ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL)); - ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL)); - - if (!ScanLine || !ScanLineAhead) - { - if (ScanLine) ExFreePool(ScanLine); - if (ScanLineAhead) ExFreePool(ScanLineAhead); - return FALSE; - } - - DestY = DestRect->top; - SpanIndex = 0; - while (NumPixels-- > 0) { - if (Source != PrevSource) { - if (Source == PrevSourceAhead) { - /* the next scan line has already been scaled and stored in - * ScanLineAhead; swap the buffers that ScanLine and ScanLineAhead - * point to - */ - PIXEL *tmp = ScanLine; - ScanLine = ScanLineAhead; - ScanLineAhead = tmp; - } else { - ScaleLineAvg8(ScanLine, Source, SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); - } /* if */ - PrevSource = Source; - } /* if */ - - if (E >= Mid && PrevSourceAhead != (PIXEL *)((BYTE *)Source + SourceSurf->lDelta)) { - int x; - ScaleLineAvg8(ScanLineAhead, (PIXEL *)((BYTE *)Source + SourceSurf->lDelta), SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); - for (x = 0; x < DestRect->right - DestRect->left; x++) - ScanLine[x] = average8(ScanLine[x], ScanLineAhead[x]); - PrevSourceAhead = (PIXEL *)((BYTE *)Source + SourceSurf->lDelta); - } /* if */ - - if (! FinalCopy8(Target, ScanLine, ClipSpans, ClipSpansCount, &SpanIndex, DestY, DestRect)) - { - /* No more spans, everything else is clipped away, we're done */ - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - return TRUE; - } - DestY++; - Target = (PIXEL *)((BYTE *)Target + DestSurf->lDelta); - Source += IntPart; - E += FractPart; - if (E >= DestRect->bottom - DestRect->top) { - E -= DestRect->bottom - DestRect->top; - Source = (PIXEL *)((BYTE *)Source + SourceSurf->lDelta); - } /* if */ - } /* while */ - - if (skip > 0 && Source != PrevSource) - ScaleLineAvg8(ScanLine, Source, SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); - while (skip-- > 0) { - if (! FinalCopy8(Target, ScanLine, ClipSpans, ClipSpansCount, &SpanIndex, DestY, DestRect)) - { - /* No more spans, everything else is clipped away, we're done */ - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - return TRUE; - } - DestY++; - Target = (PIXEL *)((BYTE *)Target + DestSurf->lDelta); - } /* while */ - - ExFreePool(ClipSpans); - ExFreePool(ScanLine); - ExFreePool(ScanLineAhead); - - return TRUE; -} - -//NOTE: If you change something here, please do the same in other dibXXbpp.c files! -BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - RECTL* DestRect, RECTL *SourceRect, - POINTL* MaskOrigin, POINTL BrushOrigin, - CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, - ULONG Mode) -{ - LONG SrcSizeY; - LONG SrcSizeX; - LONG DesSizeY; - LONG DesSizeX; - LONG sx = 0; - LONG sy = 0; - LONG DesX; - LONG DesY; - - LONG SrcZoomXHight; - LONG SrcZoomXLow; - LONG SrcZoomYHight; - LONG SrcZoomYLow; - - LONG sy_dec = 0; - LONG sy_max; - - LONG sx_dec = 0; - LONG sx_max; - - ULONG color; - - DPRINT("DIB_8BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", - BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, - DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); - - /* Calc the Zoom height of Source */ - SrcSizeY = SourceRect->bottom - SourceRect->top; - - /* Calc the Zoom Width of Source */ - SrcSizeX = SourceRect->right - SourceRect->left; - - /* Calc the Zoom height of Destinations */ - DesSizeY = DestRect->bottom - DestRect->top; - - /* Calc the Zoom width of Destinations */ - DesSizeX = DestRect->right - DestRect->left; - - /* Calc the zoom factor of source height */ - SrcZoomYHight = SrcSizeY / DesSizeY; - SrcZoomYLow = SrcSizeY - (SrcZoomYHight * DesSizeY); - - /* Calc the zoom factor of source width */ - SrcZoomXHight = SrcSizeX / DesSizeX; - SrcZoomXLow = SrcSizeX - (SrcZoomXHight * DesSizeX); - - sx_max = DesSizeX; - sy_max = DesSizeY; - sy = SourceRect->top; - - if (SourceSurf->iBitmapFormat != BMF_8BPP) - { - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) - { - sx = SourceRect->left; - sx_dec = 0; - for (DesX=DestRect->left; DesX<DestRect->right; DesX++) - { - color = XLATEOBJ_iXlate(ColorTranslation, - DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. - DIB_GetPixel(SourceSurf, sx, sy)); - - DIB_8BPP_PutPixel(DestSurf, DesX, DesY, color); - - sx += SrcZoomXHight; - sx_dec += SrcZoomXLow; - if (sx_dec >= sx_max) - { - sx++; - sx_dec -= sx_max; - } - } - - sy += SrcZoomYHight; - sy_dec += SrcZoomYLow; - if (sy_dec >= sy_max) - { - sy++; - sy_dec -= sy_max; - } - } - } - else - { - return ScaleRectAvg8(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin, - ClipRegion, ColorTranslation, Mode); - } - return TRUE; -} + BOOLEAN DIB_8BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
15 years, 10 months
1
0
0
0
[dchapyshev] 39240: - Add some headers from Wine - Import qmgr from Wine (not included yet to build)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Jan 31 09:32:09 2009 New Revision: 39240 URL:
http://svn.reactos.org/svn/reactos?rev=39240&view=rev
Log: - Add some headers from Wine - Import qmgr from Wine (not included yet to build) Added: trunk/reactos/dll/win32/qmgr/ (with props) trunk/reactos/dll/win32/qmgr/enum_files.c (with props) trunk/reactos/dll/win32/qmgr/enum_jobs.c (with props) trunk/reactos/dll/win32/qmgr/factory.c (with props) trunk/reactos/dll/win32/qmgr/file.c (with props) trunk/reactos/dll/win32/qmgr/job.c (with props) trunk/reactos/dll/win32/qmgr/qmgr.c (with props) trunk/reactos/dll/win32/qmgr/qmgr.h (with props) trunk/reactos/dll/win32/qmgr/qmgr.inf (with props) trunk/reactos/dll/win32/qmgr/qmgr.rbuild (with props) trunk/reactos/dll/win32/qmgr/qmgr.spec (with props) trunk/reactos/dll/win32/qmgr/qmgr_local.idl (with props) trunk/reactos/dll/win32/qmgr/qmgr_main.c (with props) trunk/reactos/dll/win32/qmgr/rsrc.rc (with props) trunk/reactos/dll/win32/qmgr/service.c (with props) trunk/reactos/include/psdk/bits.idl (with props) trunk/reactos/include/psdk/bits1_5.idl (with props) trunk/reactos/include/psdk/bitsmsg.h (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/dll/win32/win32.rbuild trunk/reactos/include/psdk/psdk.rbuild [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=392…
Added: trunk/reactos/dll/win32/qmgr/enum_files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/enum_files.…
Added: trunk/reactos/dll/win32/qmgr/enum_jobs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/enum_jobs.c…
Added: trunk/reactos/dll/win32/qmgr/factory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/factory.c?r…
Added: trunk/reactos/dll/win32/qmgr/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/file.c?rev=…
Added: trunk/reactos/dll/win32/qmgr/job.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/job.c?rev=3…
Added: trunk/reactos/dll/win32/qmgr/qmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.c?rev=…
Added: trunk/reactos/dll/win32/qmgr/qmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.h?rev=…
Added: trunk/reactos/dll/win32/qmgr/qmgr.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.inf?re…
Added: trunk/reactos/dll/win32/qmgr/qmgr.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.rbuild…
Added: trunk/reactos/dll/win32/qmgr/qmgr.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.spec?r…
Added: trunk/reactos/dll/win32/qmgr/qmgr_local.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr_local.…
Added: trunk/reactos/dll/win32/qmgr/qmgr_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr_main.c…
Added: trunk/reactos/dll/win32/qmgr/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/rsrc.rc?rev…
Added: trunk/reactos/dll/win32/qmgr/service.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/service.c?r…
Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
Added: trunk/reactos/include/psdk/bits.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/bits.idl?rev=…
Added: trunk/reactos/include/psdk/bits1_5.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/bits1_5.idl?r…
Added: trunk/reactos/include/psdk/bitsmsg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/bitsmsg.h?rev…
Modified: trunk/reactos/include/psdk/psdk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/psdk.rbuild?r…
15 years, 10 months
1
0
0
0
[cwittich] 39239: sync shlwapi_winetest with wine 1.1.14
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 08:49:08 2009 New Revision: 39239 URL:
http://svn.reactos.org/svn/reactos?rev=39239&view=rev
Log: sync shlwapi_winetest with wine 1.1.14 Added: trunk/rostests/winetests/shlwapi/assoc.c (with props) Modified: trunk/rostests/winetests/shlwapi/clist.c trunk/rostests/winetests/shlwapi/clsid.c trunk/rostests/winetests/shlwapi/generated.c trunk/rostests/winetests/shlwapi/istream.c trunk/rostests/winetests/shlwapi/ordinal.c trunk/rostests/winetests/shlwapi/path.c trunk/rostests/winetests/shlwapi/shlwapi.rbuild trunk/rostests/winetests/shlwapi/shreg.c trunk/rostests/winetests/shlwapi/string.c trunk/rostests/winetests/shlwapi/url.c Added: trunk/rostests/winetests/shlwapi/assoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/assoc.c…
============================================================================== --- trunk/rostests/winetests/shlwapi/assoc.c (added) +++ trunk/rostests/winetests/shlwapi/assoc.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -1,0 +1,248 @@ +/* Unit test suite for SHLWAPI IQueryAssociations functions + * + * Copyright 2008 Google (Lei Zhang) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "wine/test.h" +#include "shlwapi.h" + +#define expect(expected, got) ok ( expected == got, "Expected %d, got %d\n", expected, got) +#define expect_hr(expected, got) ok ( expected == got, "Expected %08x, got %08x\n", expected, got) + +static HRESULT (WINAPI *pAssocQueryStringA)(ASSOCF,ASSOCSTR,LPCSTR,LPCSTR,LPSTR,LPDWORD) = NULL; +static HRESULT (WINAPI *pAssocQueryStringW)(ASSOCF,ASSOCSTR,LPCWSTR,LPCWSTR,LPWSTR,LPDWORD) = NULL; + +/* Every version of Windows with IE should have this association? */ +static const WCHAR dotHtml[] = { '.','h','t','m','l',0 }; +static const WCHAR badBad[] = { 'b','a','d','b','a','d',0 }; +static const WCHAR dotBad[] = { '.','b','a','d',0 }; +static const WCHAR open[] = { 'o','p','e','n',0 }; +static const WCHAR invalid[] = { 'i','n','v','a','l','i','d',0 }; + +static void test_getstring_bad(void) +{ + HRESULT hr; + DWORD len; + + if (!pAssocQueryStringW) + { + win_skip("AssocQueryStringW() is missing\n"); + return; + } + + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, NULL, open, NULL, &len); + expect_hr(E_INVALIDARG, hr); + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, badBad, open, NULL, &len); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotBad, open, NULL, &len); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, invalid, NULL, + &len); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, open, NULL, NULL); + ok(hr == E_UNEXPECTED || + hr == E_INVALIDARG, /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); + + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, NULL, open, NULL, &len); + expect_hr(E_INVALIDARG, hr); + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, badBad, open, NULL, + &len); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotBad, open, NULL, + &len); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, invalid, NULL, + &len); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || /* W2K/Vista/W2K8 */ + hr == E_FAIL, /* Win9x/WinMe/NT4 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, NULL, + NULL); + ok(hr == E_UNEXPECTED || + hr == E_INVALIDARG, /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); +} + +static void test_getstring_basic(void) +{ + HRESULT hr; + WCHAR * friendlyName; + WCHAR * executableName; + DWORD len, len2, slen; + + if (!pAssocQueryStringW) + { + win_skip("AssocQueryStringW() is missing\n"); + return; + } + + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, open, NULL, &len); + expect_hr(S_FALSE, hr); + if (hr != S_FALSE) + { + skip("failed to get initial len\n"); + return; + } + + executableName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + len * sizeof(WCHAR)); + if (!executableName) + { + skip("failed to allocate memory\n"); + return; + } + + len2 = len; + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, open, + executableName, &len2); + expect_hr(S_OK, hr); + slen = lstrlenW(executableName) + 1; + expect(len, len2); + expect(len, slen); + + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, NULL, + &len); + ok(hr == S_FALSE || + hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* Win9x/NT4 */ + "Unexpected result : %08x\n", hr); + if (hr != S_FALSE) + { + HeapFree(GetProcessHeap(), 0, executableName); + skip("failed to get initial len\n"); + return; + } + + friendlyName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + len * sizeof(WCHAR)); + if (!friendlyName) + { + HeapFree(GetProcessHeap(), 0, executableName); + skip("failed to allocate memory\n"); + return; + } + + len2 = len; + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, + friendlyName, &len2); + expect_hr(S_OK, hr); + slen = lstrlenW(friendlyName) + 1; + expect(len, len2); + expect(len, slen); + + HeapFree(GetProcessHeap(), 0, executableName); + HeapFree(GetProcessHeap(), 0, friendlyName); +} + +static void test_getstring_no_extra(void) +{ + LONG ret; + HKEY hkey; + HRESULT hr; + static const CHAR dotWinetest[] = { + '.','w','i','n','e','t','e','s','t',0 + }; + static const CHAR winetestfile[] = { + 'w','i','n','e','t','e','s','t', 'f','i','l','e',0 + }; + static const CHAR winetestfileAction[] = { + 'w','i','n','e','t','e','s','t','f','i','l','e', + '\\','s','h','e','l','l', + '\\','f','o','o', + '\\','c','o','m','m','a','n','d',0 + }; + static const CHAR action[] = { + 'n','o','t','e','p','a','d','.','e','x','e',0 + }; + CHAR buf[MAX_PATH]; + DWORD len = MAX_PATH; + + if (!pAssocQueryStringA) + { + win_skip("AssocQueryStringA() is missing\n"); + return; + } + + buf[0] = '\0'; + ret = RegCreateKeyA(HKEY_CLASSES_ROOT, dotWinetest, &hkey); + if (ret != ERROR_SUCCESS) { + skip("failed to create dotWinetest key\n"); + return; + } + + ret = RegSetValueA(hkey, NULL, REG_SZ, winetestfile, lstrlenA(winetestfile)); + RegCloseKey(hkey); + if (ret != ERROR_SUCCESS) + { + skip("failed to set dotWinetest key\n"); + goto cleanup; + } + + ret = RegCreateKeyA(HKEY_CLASSES_ROOT, winetestfileAction, &hkey); + if (ret != ERROR_SUCCESS) + { + skip("failed to create winetestfileAction key\n"); + goto cleanup; + } + + ret = RegSetValueA(hkey, NULL, REG_SZ, action, lstrlenA(action)); + RegCloseKey(hkey); + if (ret != ERROR_SUCCESS) + { + skip("failed to set winetestfileAction key\n"); + goto cleanup; + } + + hr = pAssocQueryStringA(0, ASSOCSTR_EXECUTABLE, dotWinetest, NULL, buf, &len); + ok(hr == S_OK || + hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP and W2K3 */ + "Unexpected result : %08x\n", hr); + hr = pAssocQueryStringA(0, ASSOCSTR_EXECUTABLE, dotWinetest, "foo", buf, &len); + expect_hr(S_OK, hr); + ok(strstr(buf, action) != NULL, + "got '%s' (Expected result to include 'notepad.exe')\n", buf); + +cleanup: + SHDeleteKeyA(HKEY_CLASSES_ROOT, dotWinetest); + SHDeleteKeyA(HKEY_CLASSES_ROOT, winetestfile); + +} + +START_TEST(assoc) +{ + HMODULE hshlwapi; + hshlwapi = GetModuleHandleA("shlwapi.dll"); + pAssocQueryStringA = (void*)GetProcAddress(hshlwapi, "AssocQueryStringA"); + pAssocQueryStringW = (void*)GetProcAddress(hshlwapi, "AssocQueryStringW"); + + test_getstring_bad(); + test_getstring_basic(); + test_getstring_no_extra(); +} Propchange: trunk/rostests/winetests/shlwapi/assoc.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/winetests/shlwapi/clist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/clist.c…
============================================================================== --- trunk/rostests/winetests/shlwapi/clist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/clist.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -116,7 +116,7 @@ else { unsigned int i; - char* buff = (char*)lpMem; + char* buff = lpMem; /* Read item data */ if (!This->item->ulSize) Modified: trunk/rostests/winetests/shlwapi/clsid.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/clsid.c…
============================================================================== --- trunk/rostests/winetests/shlwapi/clsid.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/clsid.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -24,12 +24,12 @@ #include "winerror.h" #include "winnls.h" #include "winuser.h" +#include "initguid.h" #include "shlguid.h" #include "shobjidl.h" #include "olectl.h" -#define INITGUID -#include "initguid.h" +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); /* This GUID has been removed from the PSDK */ DEFINE_OLEGUID(WINE_IID_IDelayedRelease, 0x000214EDL, 0, 0); @@ -107,6 +107,7 @@ DWORD dwLen; BOOL bRet; int i = 0; + int is_vista = 0; if (!pSHLWAPI_269 || !pSHLWAPI_23) return; @@ -114,7 +115,8 @@ while (*guids) { dwLen = pSHLWAPI_23(*guids, szBuff, 256); - ok(dwLen == 39, "wrong size for id %d\n", i); + if (!i && dwLen == S_OK) is_vista = 1; /* seems to return an HRESULT on vista */ + ok(dwLen == (is_vista ? S_OK : 39), "wrong size %u for id %d\n", dwLen, i); bRet = pSHLWAPI_269(szBuff, &guid); ok(bRet != FALSE, "created invalid string '%s'\n", szBuff); @@ -128,7 +130,7 @@ /* Test endianess */ dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 256); - ok(dwLen == 39, "wrong size for IID_Endianess\n"); + ok(dwLen == (is_vista ? S_OK : 39), "wrong size %u for IID_Endianess\n", dwLen); ok(!strcmp(szBuff, "{01020304-0506-0708-090A-0B0C0D0E0F0A}"), "Endianess Broken, got '%s'\n", szBuff); @@ -136,17 +138,17 @@ /* test lengths */ szBuff[0] = ':'; dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 0); - ok(dwLen == 0, "accepted bad length\n"); + ok(dwLen == (is_vista ? E_FAIL : 0), "accepted bad length\n"); ok(szBuff[0] == ':', "wrote to buffer with no length\n"); szBuff[0] = ':'; dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 38); - ok(dwLen == 0, "accepted bad length\n"); + ok(dwLen == (is_vista ? E_FAIL : 0), "accepted bad length\n"); ok(szBuff[0] == ':', "wrote to buffer with no length\n"); szBuff[0] = ':'; dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 39); - ok(dwLen == 39, "rejected ok length\n"); + ok(dwLen == (is_vista ? S_OK : 39), "rejected ok length\n"); ok(szBuff[0] == '{', "Didn't write to buffer with ok length\n"); /* Test string */ @@ -155,7 +157,7 @@ ok(bRet == FALSE, "accepted invalid string\n"); dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 39); - ok(dwLen == 39, "rejected ok length\n"); + ok(dwLen == (is_vista ? S_OK : 39), "rejected ok length\n"); ok(szBuff[0] == '{', "Didn't write to buffer with ok length\n"); } Modified: trunk/rostests/winetests/shlwapi/generated.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/generat…
============================================================================== --- trunk/rostests/winetests/shlwapi/generated.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/generated.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -1,4 +1,4 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ /* This file can be copied, modified and distributed without restriction. */ /* @@ -33,21 +33,13 @@ */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -64,104 +56,109 @@ * Test helper macros */ -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) +#ifdef _WIN64 + +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) + #else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) + +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); + +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif + +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif + +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); + #endif -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) -#else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) - -/*********************************************************************** - * Test macros - */ - -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ - -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) - -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) - -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); - -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); static void test_pack_ASSOCF(void) { /* ASSOCF */ - TEST_TYPE(ASSOCF, 4, 4); - TEST_TYPE_UNSIGNED(ASSOCF); + TEST_TYPE_SIZE (ASSOCF, 4) + TEST_TYPE_ALIGN (ASSOCF, 4) + TEST_TYPE_UNSIGNED(ASSOCF) } static void test_pack_DLLGETVERSIONPROC(void) { /* DLLGETVERSIONPROC */ - TEST_TYPE(DLLGETVERSIONPROC, 4, 4); + TEST_TYPE_SIZE (DLLGETVERSIONPROC, 4) + TEST_TYPE_ALIGN (DLLGETVERSIONPROC, 4) } static void test_pack_DLLVERSIONINFO(void) { /* DLLVERSIONINFO (pack 8) */ - TEST_TYPE(DLLVERSIONINFO, 20, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwPlatformID, 16, 4, 4); + TEST_TYPE_SIZE (DLLVERSIONINFO, 20) + TEST_TYPE_ALIGN (DLLVERSIONINFO, 4) + TEST_FIELD_SIZE (DLLVERSIONINFO, cbSize, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, cbSize, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, cbSize, 0) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwMajorVersion, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMajorVersion, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMajorVersion, 4) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwMinorVersion, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMinorVersion, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMinorVersion, 8) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwBuildNumber, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwBuildNumber, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwBuildNumber, 12) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwPlatformID, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwPlatformID, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwPlatformID, 16) } static void test_pack_DLLVERSIONINFO2(void) { /* DLLVERSIONINFO2 (pack 8) */ - TEST_TYPE(DLLVERSIONINFO2, 32, 8); - TEST_FIELD(DLLVERSIONINFO2, DLLVERSIONINFO, info1, 0, 20, 4); - TEST_FIELD(DLLVERSIONINFO2, DWORD, dwFlags, 20, 4, 4); - TEST_FIELD(DLLVERSIONINFO2, ULONGLONG, ullVersion, 24, 8, 8); + TEST_TYPE_SIZE (DLLVERSIONINFO2, 32) + TEST_TYPE_ALIGN (DLLVERSIONINFO2, 8) + TEST_FIELD_SIZE (DLLVERSIONINFO2, info1, 20) + TEST_FIELD_ALIGN (DLLVERSIONINFO2, info1, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO2, info1, 0) + TEST_FIELD_SIZE (DLLVERSIONINFO2, dwFlags, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO2, dwFlags, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO2, dwFlags, 20) + TEST_FIELD_SIZE (DLLVERSIONINFO2, ullVersion, 8) + TEST_FIELD_ALIGN (DLLVERSIONINFO2, ullVersion, 8) + TEST_FIELD_OFFSET(DLLVERSIONINFO2, ullVersion, 24) } static void test_pack_HUSKEY(void) { /* HUSKEY */ - TEST_TYPE(HUSKEY, 4, 4); + TEST_TYPE_SIZE (HUSKEY, 4) + TEST_TYPE_ALIGN (HUSKEY, 4) } static void test_pack_PHUSKEY(void) { /* PHUSKEY */ - TEST_TYPE(PHUSKEY, 4, 4); - TEST_TYPE_POINTER(PHUSKEY, 4, 4); + TEST_TYPE_SIZE (PHUSKEY, 4) + TEST_TYPE_ALIGN (PHUSKEY, 4) + TEST_TARGET_SIZE (PHUSKEY, 4) + TEST_TARGET_ALIGN(PHUSKEY, 4) } static void test_pack(void) @@ -176,5 +173,9 @@ START_TEST(generated) { +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else test_pack(); +#endif } Modified: trunk/rostests/winetests/shlwapi/istream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/istream…
============================================================================== --- trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -209,8 +209,12 @@ /* invalid arguments */ stream = NULL; + /* NT: ERROR_PATH_NOT_FOUND, 9x: ERROR_BAD_PATHNAME */ ret = (*pSHCreateStreamOnFileA)(NULL, mode | stgm, &stream); - ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), got 0x%08x\n", ret); + ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || + ret == HRESULT_FROM_WIN32(ERROR_BAD_PATHNAME), + "SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)" + "or HRESULT_FROM_WIN32(ERROR_BAD_PATHNAME), got 0x%08x\n", ret); ok(stream == NULL, "SHCreateStreamOnFileA: expected a NULL IStream object, got %p\n", stream); #if 0 /* This test crashes on WinXP SP2 */ @@ -290,27 +294,35 @@ HRESULT ret; ULONG refcount; WCHAR test_file[MAX_PATH]; - static const WCHAR testW_txt[] = { '\\', 't', 'e', 's', 't', 'W', '.', 't', 'x', 't', '\0' }; + CHAR test_fileA[MAX_PATH]; + static const CHAR testW_txt[] = "\\testW.txt"; trace("SHCreateStreamOnFileW: testing mode %d, STGM flags %08x\n", mode, stgm); /* Don't used a fixed path for the testW.txt file */ - GetTempPathW(MAX_PATH, test_file); - lstrcatW(test_file, testW_txt); + GetTempPathA(MAX_PATH, test_fileA); + lstrcatA(test_fileA, testW_txt); + MultiByteToWideChar(CP_ACP, 0, test_fileA, -1, test_file, MAX_PATH); /* invalid arguments */ - stream = NULL; - ret = (*pSHCreateStreamOnFileW)(NULL, mode | stgm, &stream); - ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */ - ret == E_INVALIDARG /* Vista */, - "SHCreateStreamOnFileW: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret); - ok(stream == NULL, "SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n", stream); - -#if 0 /* This test crashes on WinXP SP2 */ - ret = (*pSHCreateStreamOnFileW)(test_file, mode | stgm, NULL); - ok(ret == E_INVALIDARG, "SHCreateStreamOnFileW: expected E_INVALIDARG, got 0x%08x\n", ret); -#endif + if (0) + { + /* Crashes on NT4 */ + stream = NULL; + ret = (*pSHCreateStreamOnFileW)(NULL, mode | stgm, &stream); + ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */ + ret == E_INVALIDARG /* Vista */, + "SHCreateStreamOnFileW: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret); + ok(stream == NULL, "SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n", stream); + } + + if (0) + { + /* This test crashes on WinXP SP2 */ + ret = (*pSHCreateStreamOnFileW)(test_file, mode | stgm, NULL); + ok(ret == E_INVALIDARG, "SHCreateStreamOnFileW: expected E_INVALIDARG, got 0x%08x\n", ret); + } stream = NULL; ret = (*pSHCreateStreamOnFileW)(test_file, mode | STGM_CONVERT | stgm, &stream); @@ -373,7 +385,9 @@ refcount = IStream_Release(stream); ok(refcount == 0, "SHCreateStreamOnFileW: expected 0, got %d\n", refcount); - ok(DeleteFileW(test_file), "SHCreateStreamOnFileW: could not delete the test file, got error %d\n", GetLastError()); + ok(DeleteFileA(test_fileA), + "SHCreateStreamOnFileW: could not delete the test file, got error %d\n", + GetLastError()); } } @@ -385,32 +399,44 @@ HRESULT ret; ULONG refcount; WCHAR test_file[MAX_PATH]; - static const WCHAR testEx_txt[] = { '\\', 't', 'e', 's', 't', 'E','x', '.', 't', 'x', 't', '\0' }; + CHAR test_fileA[MAX_PATH]; + static const CHAR testEx_txt[] = "\\testEx.txt"; trace("SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x\n", mode, stgm); /* Don't used a fixed path for the testEx.txt file */ - GetTempPathW(MAX_PATH, test_file); - lstrcatW(test_file, testEx_txt); + GetTempPathA(MAX_PATH, test_fileA); + lstrcatA(test_fileA, testEx_txt); + MultiByteToWideChar(CP_ACP, 0, test_fileA, -1, test_file, MAX_PATH); /* invalid arguments */ - stream = NULL; - ret = (*pSHCreateStreamOnFileEx)(NULL, mode, 0, FALSE, NULL, &stream); - ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */ - ret == E_INVALIDARG /* Vista */, - "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret); + if (0) + { + /* Crashes on NT4 */ + stream = NULL; + ret = (*pSHCreateStreamOnFileEx)(NULL, mode, 0, FALSE, NULL, &stream); + ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */ + ret == E_INVALIDARG /* Vista */, + "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret); + ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream); + } + + stream = NULL; + ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, template, &stream); + ok( ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + ret == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or " + "HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got 0x%08x\n", ret); + ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream); - stream = NULL; - ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, template, &stream); - ok(ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x\n", ret); - ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream); - -#if 0 /* This test crashes on WinXP SP2 */ - ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, NULL, NULL); - ok(ret == E_INVALIDARG, "SHCreateStreamOnFileEx: expected E_INVALIDARG, got 0x%08x\n", ret); -#endif + if (0) + { + /* This test crashes on WinXP SP2 */ + ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, NULL, NULL); + ok(ret == E_INVALIDARG, "SHCreateStreamOnFileEx: expected E_INVALIDARG, got 0x%08x\n", ret); + } /* file does not exist */ @@ -425,12 +451,22 @@ return; } } else { - ok(ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x\n", ret); + ok( ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + ret == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), + "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or " + "HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got 0x%08x\n", ret); } ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream); stream = NULL; ret = (*pSHCreateStreamOnFileEx)(test_file, mode | STGM_FAILIFTHERE | stgm, 0, TRUE, NULL, &stream); + /* not supported on win9x */ + if (broken(ret == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER) && stream == NULL)) { + skip("Not supported\n"); + DeleteFileA(test_fileA); + return; + } + ok(ret == S_OK, "SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n", ret); ok(stream != NULL, "SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n"); @@ -440,7 +476,9 @@ refcount = IStream_Release(stream); ok(refcount == 0, "SHCreateStreamOnFileEx: expected 0, got %d\n", refcount); - ok(DeleteFileW(test_file), "SHCreateStreamOnFileEx: could not delete the test file, got error %d\n", GetLastError()); + ok(DeleteFileA(test_fileA), + "SHCreateStreamOnFileEx: could not delete the test file, got error %d\n", + GetLastError()); } stream = NULL; @@ -454,7 +492,9 @@ refcount = IStream_Release(stream); ok(refcount == 0, "SHCreateStreamOnFileEx: expected 0, got %d\n", refcount); - ok(DeleteFileW(test_file), "SHCreateStreamOnFileEx: could not delete the test file, got error %d\n", GetLastError()); + ok(DeleteFileA(test_fileA), + "SHCreateStreamOnFileEx: could not delete the test file, got error %d\n", + GetLastError()); } stream = NULL; @@ -514,7 +554,9 @@ ok(refcount == 0, "SHCreateStreamOnFileEx: expected 0, got %d\n", refcount); } - ok(DeleteFileW(test_file), "SHCreateStreamOnFileEx: could not delete the test file, got error %d\n", GetLastError()); + ok(DeleteFileA(test_fileA), + "SHCreateStreamOnFileEx: could not delete the test file, got error %d\n", + GetLastError()); } Modified: trunk/rostests/winetests/shlwapi/ordinal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/ordinal…
============================================================================== --- trunk/rostests/winetests/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/ordinal.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -42,13 +42,19 @@ DWORD buffersize, buffersize2, exactsize; char buffer[100]; - if (!pGetAcceptLanguagesA) + if (!pGetAcceptLanguagesA) { + win_skip("GetAcceptLanguagesA is not available\n"); return; + } buffersize = sizeof(buffer); memset(buffer, 0, sizeof(buffer)); SetLastError(ERROR_SUCCESS); retval = pGetAcceptLanguagesA( buffer, &buffersize); + if (!retval && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { + win_skip("GetAcceptLanguagesA is not implemented\n"); + return; + } trace("GetAcceptLanguagesA: retval %08x, size %08x, buffer (%s)," " last error %u\n", retval, buffersize, buffer, GetLastError()); if(retval != S_OK) { @@ -58,28 +64,31 @@ ok( (ERROR_NO_IMPERSONATION_TOKEN == GetLastError()) || (ERROR_CLASS_DOES_NOT_EXIST == GetLastError()) || (ERROR_PROC_NOT_FOUND == GetLastError()) || - (ERROR_CALL_NOT_IMPLEMENTED == GetLastError()) || (ERROR_SUCCESS == GetLastError()), "last error set to %u\n", GetLastError()); exactsize = strlen(buffer); SetLastError(ERROR_SUCCESS); retval = pGetAcceptLanguagesA( NULL, NULL); - ok(retval == E_FAIL, + ok(retval == E_FAIL || + retval == E_INVALIDARG, /* w2k8 */ "function result wrong: got %08x; expected E_FAIL\n", retval); ok(ERROR_SUCCESS == GetLastError(), "last error set to %u\n", GetLastError()); buffersize = sizeof(buffer); SetLastError(ERROR_SUCCESS); retval = pGetAcceptLanguagesA( NULL, &buffersize); - ok(retval == E_FAIL, + ok(retval == E_FAIL || + retval == E_INVALIDARG, /* w2k8 */ "function result wrong: got %08x; expected E_FAIL\n", retval); - ok(buffersize == sizeof(buffer), - "buffersize was changed (2nd parameter; not on Win2k)\n"); + ok(buffersize == sizeof(buffer) || + buffersize == 0, /* w2k8*/ + "buffersize was changed and is not 0; size (%d))\n", buffersize); ok(ERROR_SUCCESS == GetLastError(), "last error set to %u\n", GetLastError()); SetLastError(ERROR_SUCCESS); retval = pGetAcceptLanguagesA( buffer, NULL); - ok(retval == E_FAIL, + ok(retval == E_FAIL || + retval == E_INVALIDARG, /* w2k8 */ "function result wrong: got %08x; expected E_FAIL\n", retval); ok(ERROR_SUCCESS == GetLastError(), "last error set to %u\n", GetLastError()); @@ -87,7 +96,8 @@ memset(buffer, 0, sizeof(buffer)); SetLastError(ERROR_SUCCESS); retval = pGetAcceptLanguagesA( buffer, &buffersize); - ok(retval == E_FAIL, + ok(retval == E_FAIL || + retval == E_INVALIDARG, /* w2k8 */ "function result wrong: got %08x; expected E_FAIL\n", retval); ok(buffersize == 0, "buffersize wrong(changed) got %08x; expected 0 (2nd parameter; not on Win2k)\n", buffersize); @@ -100,9 +110,9 @@ switch(retval) { case 0L: if(buffersize == exactsize) { - ok( (ERROR_SUCCESS == GetLastError()) || (ERROR_CALL_NOT_IMPLEMENTED == GetLastError()) || + ok( (ERROR_SUCCESS == GetLastError()) || (ERROR_PROC_NOT_FOUND == GetLastError()) || (ERROR_NO_IMPERSONATION_TOKEN == GetLastError()), - "last error wrong: got %u; expected ERROR_SUCCESS(NT4)/ERROR_CALL_NOT_IMPLEMENTED(98/ME)/" + "last error wrong: got %u; expected ERROR_SUCCESS(NT4)/" "ERROR_PROC_NOT_FOUND(NT4)/ERROR_NO_IMPERSONATION_TOKEN(XP)\n", GetLastError()); ok(exactsize == strlen(buffer), "buffer content (length) wrong: got %08x, expected %08x\n", lstrlenA(buffer), exactsize); @@ -219,7 +229,7 @@ hmem=pSHAllocShared(&val,4,procid); ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %u\n", GetLastError()); - p=(int*)pSHLockShared(hmem,procid); + p=pSHLockShared(hmem,procid); ok(p!=NULL,"SHLockShared failed: %u\n", GetLastError()); if (p!=NULL) ok(*p==val,"Wrong value in shared memory: %d instead of %d\n",*p,val); @@ -363,12 +373,25 @@ pGetShellSecurityDescriptor=(void*)GetProcAddress(hShlwapi,(char*)475); + if(!pGetShellSecurityDescriptor) + { + win_skip("GetShellSecurityDescriptor not available\n"); + return; + } + psd = pGetShellSecurityDescriptor(NULL, 2); ok(psd==NULL, "GetShellSecurityDescriptor should fail\n"); psd = pGetShellSecurityDescriptor(rgsup, 0); ok(psd==NULL, "GetShellSecurityDescriptor should fail\n"); + SetLastError(0xdeadbeef); psd = pGetShellSecurityDescriptor(rgsup, 2); + if (psd == NULL && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + /* The previous calls to GetShellSecurityDescriptor don't set the last error */ + win_skip("GetShellSecurityDescriptor is not implemented\n"); + return; + } ok(psd!=NULL, "GetShellSecurityDescriptor failed\n"); if (psd!=NULL) { Modified: trunk/rostests/winetests/shlwapi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/path.c?…
============================================================================== --- trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -82,7 +82,26 @@ {"foo.bar", FALSE}, {"bogusscheme:", TRUE}, {"http:partial", TRUE}, - {"
www.winehq.org
", FALSE} + {"
www.winehq.org
", FALSE}, + /* More examples that the user might enter as the browser start page */ + {"
winehq.org
", FALSE}, + {"
ftp.winehq.org
", FALSE}, + {"
http://winehq.org
", TRUE}, + {"
http://www.winehq.org
", TRUE}, + {"
https://winehq.org
", TRUE}, + {"
https://www.winehq.org
", TRUE}, + {"
ftp://winehq.org
", TRUE}, + {"
ftp://ftp.winehq.org
", TRUE}, + {"file://does_not_exist.txt", TRUE}, + {"about:blank", TRUE}, + {"about:home", TRUE}, + {"about:mozilla", TRUE}, + /* scheme is case independent */ + {"
HTTP://www.winehq.org
", TRUE}, + /* a space at the start is not allowed */ + {"
http://www.winehq.org
", FALSE}, + {"", FALSE}, + {NULL, FALSE} }; struct { @@ -271,62 +290,34 @@ BOOL ret; unsigned int c; - ret = pPathIsValidCharA( 0x7f, 0 ); - ok ( !ret, "PathIsValidCharA succeeded: 0x%08x\n", (DWORD)ret ); - - ret = pPathIsValidCharA( 0x7f, 1 ); - ok ( !ret, "PathIsValidCharA succeeded: 0x%08x\n", (DWORD)ret ); - for (c = 0; c < 0x7f; c++) { ret = pPathIsValidCharA( c, ~0U ); - ok ( ret == SHELL_charclass[c] || (ret == 1 && SHELL_charclass[c] == 0xffffffff), - "PathIsValidCharA failed: 0x%02x got 0x%08x expected 0x%08x\n", - c, (DWORD)ret, SHELL_charclass[c] ); + ok ( ret || !SHELL_charclass[c], "PathIsValidCharA failed: 0x%02x got 0x%08x\n", c, ret ); } for (c = 0x7f; c <= 0xff; c++) { ret = pPathIsValidCharA( c, ~0U ); - ok ( ret == 0x00000100, - "PathIsValidCharA failed: 0x%02x got 0x%08x expected 0x00000100\n", - c, (DWORD)ret ); + ok ( ret, "PathIsValidCharA failed: 0x%02x got 0x%08x\n", c, ret ); } } static void test_PathIsValidCharW(void) { BOOL ret; - unsigned int c, err_count = 0; - - ret = pPathIsValidCharW( 0x7f, 0 ); - ok ( !ret, "PathIsValidCharW succeeded: 0x%08x\n", (DWORD)ret ); - - ret = pPathIsValidCharW( 0x7f, 1 ); - ok ( !ret, "PathIsValidCharW succeeded: 0x%08x\n", (DWORD)ret ); + unsigned int c; for (c = 0; c < 0x7f; c++) { ret = pPathIsValidCharW( c, ~0U ); - ok ( ret == SHELL_charclass[c] || (ret == 1 && SHELL_charclass[c] == 0xffffffff), - "PathIsValidCharW failed: 0x%02x got 0x%08x expected 0x%08x\n", - c, (DWORD)ret, SHELL_charclass[c] ); + ok ( ret || !SHELL_charclass[c], "PathIsValidCharW failed: 0x%02x got 0x%08x\n", c, ret ); } for (c = 0x007f; c <= 0xffff; c++) { ret = pPathIsValidCharW( c, ~0U ); - ok ( ret == 0x00000100, - "PathIsValidCharW failed: 0x%02x got 0x%08x expected 0x00000100\n", - c, (DWORD)ret ); - if (ret != 0x00000100) - { - if(++err_count > 100 ) { - trace("skipping rest of PathIsValidCharW tests " - "because of the current number of errors\n"); - break; - } - } + ok ( ret, "PathIsValidCharW failed: 0x%02x got 0x%08x\n", c, ret ); } } @@ -799,7 +790,7 @@ static void test_PathCanonicalizeA(void) { - char dest[MAX_PATH]; + char dest[LONG_LEN + MAX_PATH]; char too_long[LONG_LEN]; BOOL res; @@ -891,7 +882,9 @@ res = PathCanonicalizeA(dest, "C:\\one/.\\two\\.."); ok(res, "Expected success\n"); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); - ok(!lstrcmp(dest, "C:\\one/."), "Expected C:\\one/., got %s\n", dest); + ok(!lstrcmp(dest, "C:\\one/.") || + !lstrcmp(dest, "C:\\one/"), /* Vista */ + "Expected \"C:\\one/.\" or \"C:\\one/\", got \"%s\"\n", dest); /* try forward slashes with change dirs * NOTE: if there is a forward slash in between two backslashes, @@ -913,7 +906,8 @@ ok(!res, "Expected failure\n"); todo_wine { - ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef || GetLastError() == ERROR_FILENAME_EXCED_RANGE /* Vista */, + "Expected 0xdeadbeef or ERROR_FILENAME_EXCED_RANGE, got %d\n", GetLastError()); } ok(lstrlen(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlen(too_long)); } @@ -1012,7 +1006,9 @@ lstrcpy(path, "aaaaaaaaa"); root = PathBuildRootA(path, -1); ok(root == path, "Expected root == path, got %p\n", root); - ok(!lstrcmp(path, "aaaaaaaaa"), "Expected aaaaaaaaa, got %s\n", path); + ok(!lstrcmp(path, "aaaaaaaaa") || + lstrlenA(path) == 0, /* Vista */ + "Expected aaaaaaaaa or empty string, got %s\n", path); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); /* test a drive number greater than 25 */ @@ -1020,7 +1016,9 @@ lstrcpy(path, "aaaaaaaaa"); root = PathBuildRootA(path, 26); ok(root == path, "Expected root == path, got %p\n", root); - ok(!lstrcmp(path, "aaaaaaaaa"), "Expected aaaaaaaaa, got %s\n", path); + ok(!lstrcmp(path, "aaaaaaaaa") || + lstrlenA(path) == 0, /* Vista */ + "Expected aaaaaaaaa or empty string, got %s\n", path); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); /* length of path is less than 4 */ Modified: trunk/rostests/winetests/shlwapi/shlwapi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/shlwapi…
============================================================================== --- trunk/rostests/winetests/shlwapi/shlwapi.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/shlwapi.rbuild [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -5,6 +5,7 @@ <compilerflag compiler="cc">-Wno-format</compilerflag> <include base="shlwapi_winetest">.</include> <define name="__ROS_LONG64__" /> + <file>assoc.c</file> <file>clist.c</file> <file>clsid.c</file> <file>generated.c</file> Modified: trunk/rostests/winetests/shlwapi/shreg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/shreg.c…
============================================================================== --- trunk/rostests/winetests/shlwapi/shreg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/shreg.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -31,7 +31,7 @@ /* Keys used for testing */ #define REG_TEST_KEY "Software\\Wine\\Test" -#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion" +#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer" static HMODULE hshlwapi; typedef DWORD (WINAPI *SHCopyKeyA_func)(HKEY,LPCSTR,HKEY,DWORD); @@ -284,6 +284,12 @@ HKEY hKeySrc, hKeyDst; DWORD dwRet; + if (!pSHCopyKeyA) + { + win_skip("SHCopyKeyA is not available\n"); + return; + } + /* Delete existing destination sub keys */ hKeyDst = NULL; if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst) && hKeyDst) @@ -305,22 +311,19 @@ if (dwRet || !hKeySrc) { ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet); + RegCloseKey(hKeyDst); return; } - - if (pSHCopyKeyA) - { - dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0); - ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet); - } + dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0); + ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet); RegCloseKey(hKeySrc); RegCloseKey(hKeyDst); /* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */ hKeyDst = NULL; - dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst); + dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst); if (dwRet || !hKeyDst) { ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet); @@ -328,7 +331,7 @@ } /* And the we copied the values too */ - ok(!SHQueryValueExA(hKeyDst, "BootDir", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n"); + ok(!SHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n"); RegCloseKey(hKeyDst); } Modified: trunk/rostests/winetests/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/string.…
============================================================================== --- trunk/rostests/winetests/shlwapi/string.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/string.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -33,6 +33,11 @@ #define expect_eq(expr, val, type, fmt) do { \ type ret = expr; \ ok(ret == val, "Unexpected value of '" #expr "': " #fmt " instead of " #val "\n", ret); \ +} while (0); + +#define expect_eq2(expr, val1, val2, type, fmt) do { \ + type ret = expr; \ + ok(ret == val1 || ret == val2, "Unexpected value of '" #expr "': " #fmt " instead of " #val1 " or " #val2 "\n", ret); \ } while (0); static BOOL (WINAPI *pIntlStrEqWorkerA)(BOOL,LPCSTR,LPCSTR,int); @@ -198,9 +203,8 @@ for (count = 32; count < 128; count++) { LPSTR result = StrChrA(string+32, count); - ok(result - string == count, - "found char '%c' in wrong place: got %d, expected %d\n", - count, result - string, count); + INT pos = result - string; + ok(pos == count, "found char '%c' in wrong place: got %d, expected %d\n", count, pos, count); } for (count = 32; count < 128; count++) @@ -335,9 +339,8 @@ for (count = 32; count < 128; count++) { LPWSTR result = StrRChrW(string+32, NULL, count); - ok(result - string == count, - "found char %d in wrong place: got %d, expected %d\n", - count, result - string, count); + INT pos = result - string; + ok(pos == count, "found char %d in wrong place: got %d, expected %d\n", count, pos, count); } for (count = 32; count < 128; count++) @@ -481,7 +484,7 @@ if (lpszStr) { ok(!strcmp(result->byte_size_64, lpszStr), "Copied string wrong\n"); - LocalFree((HLOCAL)lpszStr); + LocalFree(lpszStr); } result++; } @@ -491,7 +494,7 @@ */ lpszStr = StrDupA(NULL); ok(lpszStr == NULL || *lpszStr == '\0', "NULL string returned %p\n", lpszStr); - LocalFree((HLOCAL)lpszStr); + LocalFree(lpszStr); } static void test_StrFormatByteSize64A(void) @@ -659,16 +662,14 @@ ret = pStrRetToBSTR(&strret, NULL, &bstr); ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW), "STRRET_WSTR: dup failed, ret=0x%08x, bstr %p\n", ret, bstr); - if (bstr) - SysFreeString(bstr); + SysFreeString(bstr); strret.uType = STRRET_CSTR; lstrcpyA(U(strret).cStr, "Test"); ret = pStrRetToBSTR(&strret, NULL, &bstr); ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW), "STRRET_CSTR: dup failed, ret=0x%08x, bstr %p\n", ret, bstr); - if (bstr) - SysFreeString(bstr); + SysFreeString(bstr); strret.uType = STRRET_OFFSET; U(strret).uOffset = 1; @@ -676,8 +677,7 @@ ret = pStrRetToBSTR(&strret, iidl, &bstr); ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW), "STRRET_OFFSET: dup failed, ret=0x%08x, bstr %p\n", ret, bstr); - if (bstr) - SysFreeString(bstr); + SysFreeString(bstr); /* Native crashes if str is NULL */ } @@ -850,7 +850,7 @@ memset(wbuf, 0xbf, sizeof(wbuf)); strret.uType = STRRET_WSTR; U(strret).pOleStr = StrDupW(wstr1); - expect_eq(pStrRetToBufW(&strret, NULL, wbuf, 10), S_OK, HRESULT, "%x"); + expect_eq2(pStrRetToBufW(&strret, NULL, wbuf, 10), S_OK, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) /* Vista */, HRESULT, "%x"); expect_eq(wbuf[9], 0, WCHAR, "%x"); expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); } @@ -862,7 +862,7 @@ memset(buf, 0xbf, sizeof(buf)); strret.uType = STRRET_CSTR; StrCpyN(U(strret).cStr, str1, MAX_PATH); - expect_eq(pStrRetToBufA(&strret, NULL, buf, 10), S_OK, HRESULT, "%x"); + expect_eq2(pStrRetToBufA(&strret, NULL, buf, 10), S_OK, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) /* Vista */, HRESULT, "%x"); expect_eq(buf[9], 0, CHAR, "%x"); expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x"); } @@ -873,7 +873,7 @@ { memset(buf, 0xbf, sizeof(buf)); ret = pwnsprintfA(buf, 10, "%s", str1); - todo_wine ok(ret == 9, "Unexpected wsnprintfA return %d, expected 9\n", ret); + ok(broken(ret == 9) || ret == -1 /* Vista */, "Unexpected wsnprintfA return %d, expected 9 or -1\n", ret); expect_eq(buf[9], 0, CHAR, "%x"); expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x"); } @@ -884,7 +884,7 @@ { memset(wbuf, 0xbf, sizeof(wbuf)); ret = pwnsprintfW(wbuf, 10, fmt, wstr1); - todo_wine ok(ret == 9, "Unexpected wsnprintfW return %d, expected 9\n", ret); + ok(broken(ret == 9) || ret == -1 /* Vista */, "Unexpected wsnprintfW return %d, expected 9 or -1\n", ret); expect_eq(wbuf[9], 0, WCHAR, "%x"); expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); } Modified: trunk/rostests/winetests/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/url.c?r…
============================================================================== --- trunk/rostests/winetests/shlwapi/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/url.c [iso-8859-1] Sat Jan 31 08:49:08 2009 @@ -1,7 +1,7 @@ /* Unit test suite for Path functions * * Copyright 2002 Matthew Mastracci - * Copyright 2007 Detlef Riekenberg + * Copyright 2007,2008 Detlef Riekenberg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,6 +37,35 @@ static const char* TEST_URL_3 = "
http://foo:bar@localhost:21/internal.php?query=x&return=y
"; static const WCHAR winehqW[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/',0}; static const CHAR winehqA[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/',0}; + +/* ################ */ + +static const CHAR untouchedA[] = "untouched"; + +#define TEST_APPLY_MAX_LENGTH INTERNET_MAX_URL_LENGTH + +typedef struct _TEST_URL_APPLY { + const char * url; + DWORD flags; + HRESULT res; + DWORD newlen; + const char * newurl; +} TEST_URL_APPLY; + +static const TEST_URL_APPLY TEST_APPLY[] = { + {"
www.winehq.org
", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 21, "
http://www.winehq.org
"}, + {"
www.winehq.org
", URL_APPLY_GUESSSCHEME, S_OK, 21, "
http://www.winehq.org
"}, + {"
www.winehq.org
", URL_APPLY_DEFAULT, S_OK, 21, "
http://www.winehq.org
"}, + {"
ftp.winehq.org
", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 20, "
ftp://ftp.winehq.org
"}, + {"
ftp.winehq.org
", URL_APPLY_GUESSSCHEME, S_OK, 20, "
ftp://ftp.winehq.org
"}, + {"
ftp.winehq.org
", URL_APPLY_DEFAULT, S_OK, 21, "
http://ftp.winehq.org
"}, + {"
winehq.org
", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 17, "
http://winehq.org
"}, + {"
winehq.org
", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, + {"
winehq.org
", URL_APPLY_DEFAULT, S_OK, 17, "
http://winehq.org
"}, + {"", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 7, "http://"}, + {"", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, + {"", URL_APPLY_DEFAULT, S_OK, 7, "http://"} +}; /* ################ */ @@ -103,7 +132,7 @@ {"res:///c:\\tests\\foo bar", URL_DONT_SIMPLIFY, S_OK, "res:///c:\\tests\\foo bar", TRUE}, {"A", 0, S_OK, "A", FALSE}, {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", TRUE} /*LimeWire online installer calls this*/, - {"", 0, S_OK, "", FALSE} + {"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"}, }; /* ################ */ @@ -233,6 +262,8 @@ {"foo:today", "bar:calendar", 0, S_OK, "bar:calendar"}, {"foo:/today", "foo:calendar", 0, S_OK, "foo:/calendar"}, {"foo:/today/", "foo:calendar", 0, S_OK, "foo:/today/calendar"}, + {"mk:@MSITStore:dir/test.chm::dir/index.html", "image.jpg", 0, S_OK, "mk:@MSITStore:dir/test.chm::dir/image.jpg"}, + {"mk:@MSITStore:dir/test.chm::dir/dir2/index.html", "../image.jpg", 0, S_OK, "mk:@MSITStore:dir/test.chm::dir/image.jpg"} }; /* ################ */ @@ -264,7 +295,8 @@ const char *expect; } TEST_URL_UNESCAPE[] = { {"file://foo/bar", "file://foo/bar"}, - {"file://fo%20o%5Ca/bar", "file://fo o\\a/bar"} + {"file://fo%20o%5Ca/bar", "file://fo o\\a/bar"}, + {"file://%24%25foobar", "file://$%foobar"} }; /* ################ */ @@ -335,6 +367,79 @@ /* ########################### */ +static void test_UrlApplyScheme(void) +{ + CHAR newurl[TEST_APPLY_MAX_LENGTH]; + WCHAR urlW[TEST_APPLY_MAX_LENGTH]; + WCHAR newurlW[TEST_APPLY_MAX_LENGTH]; + HRESULT res; + DWORD len; + DWORD i; + + for(i = 0; i < sizeof(TEST_APPLY)/sizeof(TEST_APPLY[0]); i++) { + len = TEST_APPLY_MAX_LENGTH; + lstrcpyA(newurl, untouchedA); + res = UrlApplySchemeA(TEST_APPLY[i].url, newurl, &len, TEST_APPLY[i].flags); + ok( res == TEST_APPLY[i].res, + "#%dA: got HRESULT 0x%x (expected 0x%x)\n", i, res, TEST_APPLY[i].res); + + ok( len == TEST_APPLY[i].newlen, + "#%dA: got len %d (expected %d)\n", i, len, TEST_APPLY[i].newlen); + + ok( !lstrcmpA(newurl, TEST_APPLY[i].newurl), + "#%dA: got '%s' (expected '%s')\n", i, newurl, TEST_APPLY[i].newurl); + + /* returned length is in character */ + len = TEST_APPLY_MAX_LENGTH; + lstrcpyA(newurl, untouchedA); + MultiByteToWideChar(CP_ACP, 0, newurl, -1, newurlW, len); + MultiByteToWideChar(CP_ACP, 0, TEST_APPLY[i].url, -1, urlW, len); + + res = UrlApplySchemeW(urlW, newurlW, &len, TEST_APPLY[i].flags); + WideCharToMultiByte(CP_ACP, 0, newurlW, -1, newurl, TEST_APPLY_MAX_LENGTH, NULL, NULL); + ok( res == TEST_APPLY[i].res, + "#%dW: got HRESULT 0x%x (expected 0x%x)\n", i, res, TEST_APPLY[i].res); + + ok( len == TEST_APPLY[i].newlen, + "#%dW: got len %d (expected %d)\n", i, len, TEST_APPLY[i].newlen); + + ok( !lstrcmpA(newurl, TEST_APPLY[i].newurl), + "#%dW: got '%s' (expected '%s')\n", i, newurl, TEST_APPLY[i].newurl); + + } + + /* buffer too small */ + lstrcpyA(newurl, untouchedA); + len = lstrlenA(TEST_APPLY[0].newurl); + res = UrlApplySchemeA(TEST_APPLY[0].url, newurl, &len, TEST_APPLY[0].flags); + ok(res == E_POINTER, "got HRESULT 0x%x (expected E_POINTER)\n", res); + /* The returned length include the space for the terminating 0 */ + i = lstrlenA(TEST_APPLY[0].newurl)+1; + ok(len == i, "got len %d (expected %d)\n", len, i); + ok(!lstrcmpA(newurl, untouchedA), "got '%s' (expected '%s')\n", newurl, untouchedA); + + /* NULL as parameter. The length and the buffer are not modified */ + lstrcpyA(newurl, untouchedA); + len = TEST_APPLY_MAX_LENGTH; + res = UrlApplySchemeA(NULL, newurl, &len, TEST_APPLY[0].flags); + ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res); + ok(len == TEST_APPLY_MAX_LENGTH, "got len %d\n", len); + ok(!lstrcmpA(newurl, untouchedA), "got '%s' (expected '%s')\n", newurl, untouchedA); + + len = TEST_APPLY_MAX_LENGTH; + res = UrlApplySchemeA(TEST_APPLY[0].url, NULL, &len, TEST_APPLY[0].flags); + ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res); + ok(len == TEST_APPLY_MAX_LENGTH, "got len %d\n", len); + + lstrcpyA(newurl, untouchedA); + res = UrlApplySchemeA(TEST_APPLY[0].url, newurl, NULL, TEST_APPLY[0].flags); + ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res); + ok(!lstrcmpA(newurl, untouchedA), "got '%s' (expected '%s')\n", newurl, untouchedA); + +} + +/* ########################### */ + static void hash_url(const char* szUrl) { LPCSTR szTestUrl = szUrl; @@ -441,19 +546,23 @@ } -static void test_url_canonicalize(int index, const char *szUrl, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl, BOOL todo) +static void test_url_canonicalize(int index, const char *szUrl, DWORD dwFlags, HRESULT dwExpectReturn, HRESULT dwExpectReturnAlt, const char *szExpectUrl, BOOL todo) { CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH]; WCHAR wszReturnUrl[INTERNET_MAX_URL_LENGTH]; LPWSTR wszUrl = GetWideString(szUrl); LPWSTR wszExpectUrl = GetWideString(szExpectUrl); LPWSTR wszConvertedUrl; + HRESULT ret; DWORD dwSize; dwSize = INTERNET_MAX_URL_LENGTH; ok(UrlCanonicalizeA(szUrl, NULL, &dwSize, dwFlags) != dwExpectReturn, "Unexpected return for NULL buffer, index %d\n", index); - ok(UrlCanonicalizeA(szUrl, szReturnUrl, &dwSize, dwFlags) == dwExpectReturn, "UrlCanonicalizeA didn't return 0x%08x, index %d\n", dwExpectReturn, index); + ret = UrlCanonicalizeA(szUrl, szReturnUrl, &dwSize, dwFlags); + ok(ret == dwExpectReturn || ret == dwExpectReturnAlt, + "UrlCanonicalizeA failed: expected=0x%08x or 0x%08x, got=0x%08x, index %d\n", + dwExpectReturn, dwExpectReturnAlt, ret, index); if (todo) todo_wine ok(strcmp(szReturnUrl,szExpectUrl)==0, "UrlCanonicalizeA dwFlags 0x%08x url '%s' Expected \"%s\", but got \"%s\", index %d\n", dwFlags, szUrl, szExpectUrl, szReturnUrl, index); @@ -562,11 +671,12 @@ "got 0x%x with %u and size %u for '%s' and %u (expected 'S_OK' and size %u)\n", hr, GetLastError(), dwSize, szReturnUrl, lstrlenA(szReturnUrl), urllen); + test_url_canonicalize(-1, "", 0, S_OK, S_FALSE /* Vista/win2k8 */, "", FALSE); /* test url-modification */ for(i=0; i<sizeof(TEST_CANONICALIZE)/sizeof(TEST_CANONICALIZE[0]); i++) { test_url_canonicalize(i, TEST_CANONICALIZE[i].url, TEST_CANONICALIZE[i].flags, - TEST_CANONICALIZE[i].expectret, TEST_CANONICALIZE[i].expecturl, + TEST_CANONICALIZE[i].expectret, TEST_CANONICALIZE[i].expectret, TEST_CANONICALIZE[i].expecturl, TEST_CANONICALIZE[i].todo); } } @@ -636,7 +746,7 @@ BOOL choped; int pos; - MultiByteToWideChar(CP_UTF8, 0, "
http://www.winehq.org/X
", -1, szUrl, 128); + MultiByteToWideChar(CP_ACP, 0, "
http://www.winehq.org/X
", -1, szUrl, 128); pos = lstrlenW(szUrl) - 1; szUrl[pos] = i; urllen = INTERNET_MAX_URL_LENGTH; @@ -801,13 +911,20 @@ DWORD dwEscaped; size_t i; static char inplace[] = "file:///C:/Program%20Files"; + static char another_inplace[] = "file:///C:/Program%20Files"; static const char expected[] = "file:///C:/Program Files"; static WCHAR inplaceW[] = {'f','i','l','e',':','/','/','/','C',':','/','P','r','o','g','r','a','m',' ','F','i','l','e','s',0}; + static WCHAR another_inplaceW[] = {'f','i','l','e',':','/','/','/','C',':','/','P','r','o','g','r','a','m','%','2','0','F','i','l','e','s',0}; for(i=0; i<sizeof(TEST_URL_UNESCAPE)/sizeof(TEST_URL_UNESCAPE[0]); i++) { dwEscaped=INTERNET_MAX_URL_LENGTH; ok(UrlUnescapeA(TEST_URL_UNESCAPE[i].url, szReturnUrl, &dwEscaped, 0) == S_OK, "UrlUnescapeA didn't return 0x%08x from \"%s\"\n", S_OK, TEST_URL_UNESCAPE[i].url); ok(strcmp(szReturnUrl,TEST_URL_UNESCAPE[i].expect)==0, "Expected \"%s\", but got \"%s\" from \"%s\"\n", TEST_URL_UNESCAPE[i].expect, szReturnUrl, TEST_URL_UNESCAPE[i].url); + + ZeroMemory(szReturnUrl, sizeof(szReturnUrl)); + /* if we set the bufferpointer to NULL here UrlUnescape fails and string gets not converted */ + ok(UrlUnescapeA(TEST_URL_UNESCAPE[i].url, szReturnUrl, NULL, 0) == E_INVALIDARG, "UrlUnescapeA didn't return 0x%08x from \"%s\"\n", E_INVALIDARG ,TEST_URL_UNESCAPE[i].url); + ok(strcmp(szReturnUrl,"")==0, "Expected empty string\n"); dwEscaped = INTERNET_MAX_URL_LENGTH; urlW = GetWideString(TEST_URL_UNESCAPE[i].url); @@ -824,9 +941,18 @@ ok(!strcmp(inplace, expected), "got %s expected %s\n", inplace, expected); ok(dwEscaped == 27, "got %d expected 27\n", dwEscaped); + /* if we set the bufferpointer to NULL, the string apparently still gets converted (Google Lively does this)) */ + ok(UrlUnescapeA(another_inplace, NULL, NULL, URL_UNESCAPE_INPLACE) == S_OK, "UrlUnescapeA failed unexpectedly\n"); + ok(!strcmp(another_inplace, expected), "got %s expected %s\n", another_inplace, expected); + dwEscaped = sizeof(inplaceW); ok(UrlUnescapeW(inplaceW, NULL, &dwEscaped, URL_UNESCAPE_INPLACE) == S_OK, "UrlUnescapeW failed unexpectedly\n"); ok(dwEscaped == 50, "got %d expected 50\n", dwEscaped); + + /* if we set the bufferpointer to NULL, the string apparently still gets converted (Google Lively does this)) */ + ok(UrlUnescapeW(another_inplaceW, NULL, NULL, URL_UNESCAPE_INPLACE) == S_OK, "UrlUnescapeW failed unexpectedly\n"); + ok(lstrlenW(another_inplaceW) == 24, "got %d expected 24\n", lstrlenW(another_inplaceW)); + } /* ########################### */ @@ -837,6 +963,7 @@ hShlwapi = GetModuleHandleA("shlwapi.dll"); pUrlCanonicalizeW = (void *) GetProcAddress(hShlwapi, "UrlCanonicalizeW"); + test_UrlApplyScheme(); test_UrlHash(); test_UrlGetPart(); test_UrlCanonicalizeA();
15 years, 10 months
1
0
0
0
[cwittich] 39238: sync shlwapi with wine 1.1.14
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 08:48:46 2009 New Revision: 39238 URL:
http://svn.reactos.org/svn/reactos?rev=39238&view=rev
Log: sync shlwapi with wine 1.1.14 Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc (with props) Modified: trunk/reactos/dll/win32/shlwapi/assoc.c trunk/reactos/dll/win32/shlwapi/msgbox.c trunk/reactos/dll/win32/shlwapi/ordinal.c trunk/reactos/dll/win32/shlwapi/reg.c trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild trunk/reactos/dll/win32/shlwapi/shlwapi.rc trunk/reactos/dll/win32/shlwapi/string.c 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 Jan 31 08:48:46 2009 @@ -455,7 +455,7 @@ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IQueryAssociations)) { - *ppvObj = (IQueryAssociations*)This; + *ppvObj = This; IQueryAssociations_AddRef((IQueryAssociations*)*ppvObj); TRACE("Returning IQueryAssociations (%p)\n", *ppvObj); @@ -594,9 +594,8 @@ return S_OK; } -static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This, - LPCWSTR pszExtra, LPWSTR path, - DWORD pathlen, DWORD *len) +static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, + LPCWSTR pszExtra, WCHAR **ppszCommand) { HKEY hkeyCommand; HKEY hkeyFile; @@ -604,15 +603,10 @@ HKEY hkeyVerb; HRESULT hr; LONG ret; - WCHAR * pszCommand; - WCHAR * pszEnd; WCHAR * pszExtraFromReg = NULL; WCHAR * pszFileType; - WCHAR * pszStart; static const WCHAR commandW[] = { 'c','o','m','m','a','n','d',0 }; static const WCHAR shellW[] = { 's','h','e','l','l',0 }; - - assert(len); hr = ASSOC_GetValue(This->hkeySource, &pszFileType); if (FAILED(hr)) @@ -672,8 +666,23 @@ RegCloseKey(hkeyVerb); if (ret != ERROR_SUCCESS) return HRESULT_FROM_WIN32(ret); - hr = ASSOC_GetValue(hkeyCommand, &pszCommand); + 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; @@ -763,6 +772,18 @@ 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); @@ -770,6 +791,38 @@ 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: @@ -825,6 +878,73 @@ 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; Modified: trunk/reactos/dll/win32/shlwapi/msgbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/msgbox.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/msgbox.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/msgbox.c [iso-8859-1] Sat Jan 31 08:48:46 2009 @@ -173,7 +173,7 @@ d.dlgProc = dlgProc; d.lParam = lParam; d.lpszId = lpszId; - return DialogBoxParamW(hInst, (LPCWSTR)lpszName, hWnd, SHDlgProcEx, (LPARAM)&d); + return DialogBoxParamW(hInst, lpszName, hWnd, SHDlgProcEx, (LPARAM)&d); } /* Data held by each shlwapi message box */ 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 Jan 31 08:48:46 2009 @@ -1250,12 +1250,10 @@ if (lpInt1 == lpInt2) return TRUE; - if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown, - (LPVOID *)&lpUnknown1))) + if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown, &lpUnknown1))) return FALSE; - if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown, - (LPVOID *)&lpUnknown2))) + if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown, &lpUnknown2))) return FALSE; if (lpUnknown1 == lpUnknown2) @@ -2236,7 +2234,7 @@ if (IsEqualIID(riid, xmove->refid)) { a_vtbl = (IUnknown*)(xmove->indx + (LPBYTE)w); TRACE("matched, returning (%p)\n", a_vtbl); - *ppv = (LPVOID)a_vtbl; + *ppv = a_vtbl; IUnknown_AddRef(a_vtbl); return S_OK; } @@ -2246,7 +2244,7 @@ if (IsEqualIID(riid, &IID_IUnknown)) { a_vtbl = (IUnknown*)(x->indx + (LPBYTE)w); TRACE("returning first for IUnknown (%p)\n", a_vtbl); - *ppv = (LPVOID)a_vtbl; + *ppv = a_vtbl; IUnknown_AddRef(a_vtbl); return S_OK; } @@ -2539,7 +2537,7 @@ if (retval != ERROR_SUCCESS) return 0; - SHGetValueW(hKey, lpSubName, lpValue, NULL, (LPBYTE)&retval, &datsize); + SHGetValueW(hKey, lpSubName, lpValue, NULL, &retval, &datsize); RegCloseKey(hKey); return retval; } @@ -2618,7 +2616,7 @@ *ppv = NULL; if(pUnk && pInner) { - hret = IUnknown_QueryInterface(pInner, riid, (LPVOID*)ppv); + hret = IUnknown_QueryInterface(pInner, riid, ppv); if (SUCCEEDED(hret)) IUnknown_Release(pUnk); } TRACE("-- 0x%08x\n", hret); @@ -4167,7 +4165,7 @@ { IUnknown* lpUnk; - if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, (LPOLESTR)szSkipBinding, &lpUnk))) + if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, szSkipBinding, &lpUnk))) { CLSID clsid; Modified: trunk/reactos/dll/win32/shlwapi/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/reg.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] Sat Jan 31 08:48:46 2009 @@ -190,7 +190,7 @@ LONG WINAPI SHRegCloseUSKey( HUSKEY hUSKey) /* [I] Key to close */ { - LPSHUSKEY hKey = (LPSHUSKEY)hUSKey; + LPSHUSKEY hKey = hUSKey; LONG ret = ERROR_SUCCESS; if (hKey->HKCUkey) @@ -393,8 +393,8 @@ if (ret != ERROR_SUCCESS) { if (pvDefaultData && (dwDefaultDataSize != 0)) { maxmove = (dwDefaultDataSize >= *pcbData) ? *pcbData : dwDefaultDataSize; - src = (CHAR*)pvDefaultData; - dst = (CHAR*)pvData; + src = pvDefaultData; + dst = pvData; for(i=0; i<maxmove; i++) *dst++ = *src++; *pcbData = maxmove; TRACE("setting default data\n"); @@ -444,8 +444,8 @@ if (ret != ERROR_SUCCESS) { if (pvDefaultData && (dwDefaultDataSize != 0)) { maxmove = (dwDefaultDataSize >= *pcbData) ? *pcbData : dwDefaultDataSize; - src = (CHAR*)pvDefaultData; - dst = (CHAR*)pvData; + src = pvDefaultData; + dst = pvData; for(i=0; i<maxmove; i++) *dst++ = *src++; *pcbData = maxmove; TRACE("setting default data\n"); @@ -934,7 +934,7 @@ LPVOID pvData, DWORD cbData, DWORD dwFlags) { DWORD dummy; - LPSHUSKEY hKey = (LPSHUSKEY)hUSKey; + LPSHUSKEY hKey = hUSKey; LONG ret = ERROR_SUCCESS; TRACE("(%p,%s,%d,%p,%d,%d)\n", hUSKey, debugstr_w(pszValue), @@ -2242,7 +2242,7 @@ DWORD dwKeyCount = 0, dwValueCount = 0, dwMaxKeyLen = 0; DWORD dwMaxValueLen = 0, dwMaxDataLen = 0, i; BYTE buff[1024]; - LPVOID lpBuff = (LPVOID)buff; + LPVOID lpBuff = buff; WCHAR szName[MAX_PATH], *lpszName = szName; DWORD dwRet = S_OK; Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] Sat Jan 31 08:48:46 2009 @@ -5,6 +5,7 @@ <importlibrary definition="shlwapi.spec" /> <include base="shlwapi">.</include> <include base="ReactOS">include/reactos/wine</include> + <define name="_WIN32_WINNT">0x600</define> <define name="__WINESRC__" /> <file>assoc.c</file> <file>clist.c</file> Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] Sat Jan 31 08:48:46 2009 @@ -43,7 +43,7 @@ #include "shlwapi_Ro.rc" #include "shlwapi_Ru.rc" #include "shlwapi_Si.rc" +#include "shlwapi_Sk.rc" #include "shlwapi_Sv.rc" #include "shlwapi_Tr.rc" -#include "shlwapi_Uk.rc" -#include "shlwapi_Zh.rc" +#include "shlwapi_Uk.rc"#include "shlwapi_Zh.rc" Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc (added) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc [iso-8859-1] Sat Jan 31 08:48:46 2009 @@ -1,0 +1,43 @@ +/* Slovak translation for shlwapi + * + * Copyright 2004 Jon Griffiths + * Copyright 2008 Mário Kaèmár (Mario Kacmar) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Chyba!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Nabudúce toto dialógové okno nezo&brazova", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&OK" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Zrui" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"Án&o" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Nie" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bajtov" + IDS_TIME_INTERVAL_HOURS " hod." + IDS_TIME_INTERVAL_MINUTES " min." + IDS_TIME_INTERVAL_SECONDS " s" +} Propchange: trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc ------------------------------------------------------------------------------ svn:eol-style = native 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 Jan 31 08:48:46 2009 @@ -1342,7 +1342,7 @@ break; case STRRET_CSTR: - lstrcpynA((LPSTR)dest, src->u.cStr, len); + lstrcpynA(dest, src->u.cStr, len); break; case STRRET_OFFSET: @@ -1381,7 +1381,7 @@ switch (src->uType) { case STRRET_WSTR: - lstrcpynW((LPWSTR)dest, src->u.pOleStr, len); + lstrcpynW(dest, src->u.pOleStr, len); CoTaskMemFree(src->u.pOleStr); break;
15 years, 10 months
1
0
0
0
[cwittich] 39237: sync crypt32_winetest with wine 1.1.14
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 08:31:11 2009 New Revision: 39237 URL:
http://svn.reactos.org/svn/reactos?rev=39237&view=rev
Log: sync crypt32_winetest with wine 1.1.14 Modified: trunk/rostests/winetests/crypt32/cert.c trunk/rostests/winetests/crypt32/encode.c trunk/rostests/winetests/crypt32/msg.c trunk/rostests/winetests/crypt32/protectdata.c trunk/rostests/winetests/crypt32/store.c trunk/rostests/winetests/crypt32/str.c Modified: trunk/rostests/winetests/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/cert.c?…
============================================================================== --- trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] Sat Jan 31 08:31:11 2009 @@ -662,6 +662,10 @@ CertFreeCertificateContext(context); } CertCloseStore(store, 0); + + SetLastError(0xdeadbeef); + context = CertDuplicateCertificateContext(NULL); + ok(context == NULL, "Expected context to be NULL\n"); } static BYTE subjectName3[] = { 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, Modified: trunk/rostests/winetests/crypt32/encode.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/encode.…
============================================================================== --- trunk/rostests/winetests/crypt32/encode.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/encode.c [iso-8859-1] Sat Jan 31 08:31:11 2009 @@ -808,7 +808,7 @@ attrs[0].pszObjId = "bogus"; attrs[0].dwValueType = CERT_RDN_PRINTABLE_STRING; attrs[0].Value.cbData = sizeof(commonName); - attrs[0].Value.pbData = (BYTE *)commonName; + attrs[0].Value.pbData = commonName; rdn.cRDNAttr = 1; rdn.rgRDNAttr = attrs; ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, &info, @@ -861,7 +861,7 @@ "Expected E_INVALIDARG, got %08x\n", GetLastError()); /* Test a more complex name */ rdn.cRDNAttr = sizeof(rdnAttrs) / sizeof(rdnAttrs[0]); - rdn.rgRDNAttr = (PCERT_RDN_ATTR)rdnAttrs; + rdn.rgRDNAttr = rdnAttrs; info.cRDN = 1; info.rgRDN = &rdn; buf = NULL; @@ -993,6 +993,13 @@ static void compareNameValues(const CERT_NAME_VALUE *expected, const CERT_NAME_VALUE *got) { + if (expected->dwValueType == CERT_RDN_UTF8_STRING && + got->dwValueType == CERT_RDN_ENCODED_BLOB) + { + win_skip("Can't handle CERT_RDN_UTF8_STRING\n"); + return; + } + ok(got->dwValueType == expected->dwValueType, "Expected string type %d, got %d\n", expected->dwValueType, got->dwValueType); @@ -1149,7 +1156,7 @@ if (ret) { rdn.cRDNAttr = sizeof(decodedRdnAttrs) / sizeof(decodedRdnAttrs[0]); - rdn.rgRDNAttr = (PCERT_RDN_ATTR)decodedRdnAttrs; + rdn.rgRDNAttr = decodedRdnAttrs; compareNames(&info, (CERT_NAME_INFO *)buf); LocalFree(buf); } @@ -1977,10 +1984,10 @@ if (buf) { ok(bufSize == bits[i].encoded[1] + 2, - "Got unexpected size %d, expected %d\n", bufSize, + "%d: Got unexpected size %d, expected %d\n", i, bufSize, bits[i].encoded[1] + 2); ok(!memcmp(buf, bits[i].encoded, bits[i].encoded[1] + 2), - "Unexpected value\n"); + "%d: Unexpected value\n", i); LocalFree(buf); } } @@ -2962,7 +2969,7 @@ ext.pszObjId = oid_subject_key_identifier; ext.fCritical = FALSE; ext.Value.cbData = sizeof(octetCommonNameValue); - ext.Value.pbData = (BYTE *)octetCommonNameValue; + ext.Value.pbData = octetCommonNameValue; info.cExtension = 1; info.rgExtension = &ext; ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, &info, Modified: trunk/rostests/winetests/crypt32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/msg.c?r…
============================================================================== --- trunk/rostests/winetests/crypt32/msg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/msg.c [iso-8859-1] Sat Jan 31 08:31:11 2009 @@ -182,7 +182,7 @@ ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, NULL, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); /* For this (empty) message, the type isn't set */ ok(value == 0, "Expected type 0, got %d\n", value); @@ -193,7 +193,7 @@ ok(msg != NULL, "CryptMsgOpenToDecode failed: %x\n", GetLastError()); /* For explicitly typed messages, the type is known. */ size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); ok(value == CMSG_DATA, "Expected CMSG_DATA, got %d\n", value); for (i = CMSG_CONTENT_PARAM; i <= CMSG_CMS_SIGNER_INFO_PARAM; i++) @@ -208,7 +208,7 @@ NULL); ok(msg != NULL, "CryptMsgOpenToDecode failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); ok(value == CMSG_ENVELOPED, "Expected CMSG_ENVELOPED, got %d\n", value); for (i = CMSG_CONTENT_PARAM; i <= CMSG_CMS_SIGNER_INFO_PARAM; i++) @@ -223,7 +223,7 @@ NULL); ok(msg != NULL, "CryptMsgOpenToDecode failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); ok(value == CMSG_HASHED, "Expected CMSG_HASHED, got %d\n", value); for (i = CMSG_CONTENT_PARAM; i <= CMSG_CMS_SIGNER_INFO_PARAM; i++) @@ -238,7 +238,7 @@ NULL); ok(msg != NULL, "CryptMsgOpenToDecode failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); ok(value == CMSG_SIGNED, "Expected CMSG_SIGNED, got %d\n", value); for (i = CMSG_CONTENT_PARAM; i <= CMSG_CMS_SIGNER_INFO_PARAM; i++) @@ -254,7 +254,7 @@ NULL); ok(msg != NULL, "CryptMsgOpenToDecode failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); ok(value == CMSG_ENCRYPTED, "Expected CMSG_ENCRYPTED, got %d\n", value); CryptMsgClose(msg); @@ -262,7 +262,7 @@ msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 1000, 0, NULL, NULL); ok(msg != NULL, "CryptMsgOpenToDecode failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %x\n", GetLastError()); ok(value == 1000, "Expected 1000, got %d\n", value); CryptMsgClose(msg); @@ -830,7 +830,7 @@ ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, NULL, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); ok(value == 0, "Expected version 0, got %d\n", value); /* As usual, the type isn't available. */ @@ -1116,11 +1116,10 @@ signer.SignerId.dwIdChoice = CERT_ID_ISSUER_SERIAL_NUMBER; U(signer.SignerId).IssuerSerialNumber.Issuer.cbData = sizeof(encodedCommonName); - U(signer.SignerId).IssuerSerialNumber.Issuer.pbData = - (BYTE *)encodedCommonName; + U(signer.SignerId).IssuerSerialNumber.Issuer.pbData = encodedCommonName; U(signer.SignerId).IssuerSerialNumber.SerialNumber.cbData = sizeof(serialNum); - U(signer.SignerId).IssuerSerialNumber.SerialNumber.pbData = (BYTE *)serialNum; + U(signer.SignerId).IssuerSerialNumber.SerialNumber.pbData = serialNum; msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_SIGNED, &signInfo, NULL, NULL); ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError()); @@ -1211,7 +1210,7 @@ ok(!ret && (GetLastError() == NTE_BAD_KEYSET || GetLastError() == NTE_NO_KEY), "Expected NTE_BAD_KEYSET or NTE_NO_KEY, got %x\n", GetLastError()); - ret = CryptImportKey(signer.hCryptProv, (LPBYTE)privKey, sizeof(privKey), + ret = CryptImportKey(signer.hCryptProv, privKey, sizeof(privKey), 0, 0, &key); ok(ret, "CryptImportKey failed: %08x\n", GetLastError()); /* The final update should be able to succeed now that a key exists, but @@ -1630,7 +1629,7 @@ return; } - ret = CryptImportKey(signer.hCryptProv, (LPBYTE)privKey, sizeof(privKey), + ret = CryptImportKey(signer.hCryptProv, privKey, sizeof(privKey), 0, 0, &key); ok(ret, "CryptImportKey failed: %08x\n", GetLastError()); @@ -1664,7 +1663,7 @@ certInfo.Issuer.cbData = 0; signer.SignerId.dwIdChoice = CERT_ID_KEY_IDENTIFIER; U(signer.SignerId).KeyId.cbData = sizeof(serialNum); - U(signer.SignerId).KeyId.pbData = (BYTE *)serialNum; + U(signer.SignerId).KeyId.pbData = serialNum; msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_SIGNED, &signInfo, NULL, NULL); ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError()); @@ -1814,7 +1813,7 @@ ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, NULL, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); ok(value == CMSG_SIGNED_DATA_V1, "Expected version 1, got %d\n", value); /* But for this message, with no signers, the hash and signer aren't @@ -1892,11 +1891,10 @@ signer.SignerId.dwIdChoice = CERT_ID_ISSUER_SERIAL_NUMBER; U(signer.SignerId).IssuerSerialNumber.Issuer.cbData = sizeof(encodedCommonName); - U(signer.SignerId).IssuerSerialNumber.Issuer.pbData = - (BYTE *)encodedCommonName; + U(signer.SignerId).IssuerSerialNumber.Issuer.pbData = encodedCommonName; U(signer.SignerId).IssuerSerialNumber.SerialNumber.cbData = sizeof(serialNum); - U(signer.SignerId).IssuerSerialNumber.SerialNumber.pbData = (BYTE *)serialNum; + U(signer.SignerId).IssuerSerialNumber.SerialNumber.pbData = serialNum; ret = pCryptAcquireContextA(&signer.hCryptProv, cspNameA, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); if (!ret && GetLastError() == NTE_EXISTS) @@ -1910,7 +1908,7 @@ * are used and no additional CMS fields are used. */ size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, &value, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); ok(value == CMSG_SIGNED_DATA_V1, "expected version 1, got %d\n", value); /* Apparently the encoded signer can be retrieved.. */ @@ -1936,7 +1934,7 @@ */ signer.SignerId.dwIdChoice = CERT_ID_KEY_IDENTIFIER; U(signer.SignerId).KeyId.cbData = sizeof(serialNum); - U(signer.SignerId).KeyId.pbData = (BYTE *)serialNum; + U(signer.SignerId).KeyId.pbData = serialNum; ret = pCryptAcquireContextA(&signer.hCryptProv, cspNameA, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); if (!ret && GetLastError() == NTE_EXISTS) @@ -1947,7 +1945,7 @@ CMSG_CRYPT_RELEASE_CONTEXT_FLAG, CMSG_SIGNED, &signInfo, NULL, NULL); ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError()); size = sizeof(value); - ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, (LPBYTE)&value, &size); + ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, &value, &size); ok(value == CMSG_SIGNED_DATA_V3, "expected version 3, got %d\n", value); /* Even for a CMS message, the signer can be retrieved.. */ ret = CryptMsgGetParam(msg, CMSG_ENCODED_SIGNER, 0, NULL, &size); @@ -2528,7 +2526,7 @@ signer.dwVersion = CMSG_SIGNED_DATA_V3; signer.SignerId.dwIdChoice = CERT_ID_KEY_IDENTIFIER; U(signer.SignerId).KeyId.cbData = sizeof(serialNum); - U(signer.SignerId).KeyId.pbData = (BYTE *)serialNum; + U(signer.SignerId).KeyId.pbData = serialNum; signer.HashAlgorithm.pszObjId = oid_rsa_md5; CryptMsgGetParam(msg, CMSG_CMS_SIGNER_INFO_PARAM, 0, buf, &size); compare_cms_signer_info((CMSG_CMS_SIGNER_INFO *)buf, &signer); Modified: trunk/rostests/winetests/crypt32/protectdata.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/protect…
============================================================================== --- trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] Sat Jan 31 08:31:11 2009 @@ -69,11 +69,16 @@ /* without entropy */ SetLastError(0xDEADBEEF); protected = pCryptProtectData(&plain,desc,NULL,NULL,NULL,0,&cipher); - ok(protected, "Encrypting without entropy.\n"); - r = GetLastError(); - ok(r == ERROR_SUCCESS || - r == ERROR_IO_PENDING, /* win2k */ - "Expected ERROR_SUCCESS or ERROR_IO_PENDING, got %d\n",r); + ok(protected || + broken(!protected), /* Win9x/NT4 */ + "Encrypting without entropy.\n"); + if (protected) + { + r = GetLastError(); + ok(r == ERROR_SUCCESS || + r == ERROR_IO_PENDING, /* win2k */ + "Expected ERROR_SUCCESS or ERROR_IO_PENDING, got %d\n",r); + } cipher_entropy.pbData=NULL; cipher_entropy.cbData=0; @@ -81,7 +86,9 @@ /* with entropy */ SetLastError(0xDEADBEEF); protected = pCryptProtectData(&plain,desc,&entropy,NULL,NULL,0,&cipher_entropy); - ok(protected, "Encrypting with entropy.\n"); + ok(protected || + broken(!protected), /* Win9x/NT4 */ + "Encrypting with entropy.\n"); cipher_no_desc.pbData=NULL; cipher_no_desc.cbData=0; Modified: trunk/rostests/winetests/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/store.c…
============================================================================== --- trunk/rostests/winetests/crypt32/store.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/store.c [iso-8859-1] Sat Jan 31 08:31:11 2009 @@ -1701,7 +1701,7 @@ static BOOL CALLBACK enumSystemStoreCB(const void *systemStore, DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved, void *pvArg) { - struct EnumSystemStoreInfo *info = (struct EnumSystemStoreInfo *)pvArg; + struct EnumSystemStoreInfo *info = pvArg; info->storeCount++; return info->goOn; Modified: trunk/rostests/winetests/crypt32/str.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/str.c?r…
============================================================================== --- trunk/rostests/winetests/crypt32/str.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/str.c [iso-8859-1] Sat Jan 31 08:31:11 2009 @@ -204,19 +204,19 @@ { CertRDNAttrEncoding attrs[] = { { "2.5.4.6", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin1), (PBYTE)bin1 }, "US" }, + { sizeof(bin1), bin1 }, "US" }, { "2.5.4.8", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin2), (PBYTE)bin2 }, "Minnesota" }, + { sizeof(bin2), bin2 }, "Minnesota" }, { "2.5.4.7", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin3), (PBYTE)bin3 }, "Minneapolis" }, + { sizeof(bin3), bin3 }, "Minneapolis" }, { "2.5.4.10", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin4), (PBYTE)bin4 }, "CodeWeavers" }, + { sizeof(bin4), bin4 }, "CodeWeavers" }, { "2.5.4.11", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin5), (PBYTE)bin5 }, "Wine Development" }, + { sizeof(bin5), bin5 }, "Wine Development" }, { "2.5.4.3", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin6), (PBYTE)bin6 }, "localhost" }, + { sizeof(bin6), bin6 }, "localhost" }, { "1.2.840.113549.1.9.1", CERT_RDN_IA5_STRING, - { sizeof(bin7), (PBYTE)bin7 }, "aric(a)codeweavers.com" }, + { sizeof(bin7), bin7 }, "aric(a)codeweavers.com" }, }; DWORD i, ret; char buffer[2000]; @@ -261,19 +261,19 @@ 'a','v','e','r','s','.','c','o','m',0 }; CertRDNAttrEncodingW attrs[] = { { "2.5.4.6", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin1), (PBYTE)bin1 }, usW }, + { sizeof(bin1), bin1 }, usW }, { "2.5.4.8", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin2), (PBYTE)bin2 }, minnesotaW }, + { sizeof(bin2), bin2 }, minnesotaW }, { "2.5.4.7", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin3), (PBYTE)bin3 }, minneapolisW }, + { sizeof(bin3), bin3 }, minneapolisW }, { "2.5.4.10", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin4), (PBYTE)bin4 }, codeweaversW }, + { sizeof(bin4), bin4 }, codeweaversW }, { "2.5.4.11", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin5), (PBYTE)bin5 }, wineDevW }, + { sizeof(bin5), bin5 }, wineDevW }, { "2.5.4.3", CERT_RDN_PRINTABLE_STRING, - { sizeof(bin6), (PBYTE)bin6 }, localhostW }, + { sizeof(bin6), bin6 }, localhostW }, { "1.2.840.113549.1.9.1", CERT_RDN_IA5_STRING, - { sizeof(bin7), (PBYTE)bin7 }, aricW }, + { sizeof(bin7), bin7 }, aricW }, }; DWORD i, ret; WCHAR buffer[2000];
15 years, 10 months
1
0
0
0
[cwittich] 39236: sync crypt32 with wine 1.1.14
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 08:28:46 2009 New Revision: 39236 URL:
http://svn.reactos.org/svn/reactos?rev=39236&view=rev
Log: sync crypt32 with wine 1.1.14 Modified: trunk/reactos/dll/win32/crypt32/cert.c trunk/reactos/dll/win32/crypt32/chain.c trunk/reactos/dll/win32/crypt32/collectionstore.c trunk/reactos/dll/win32/crypt32/context.c trunk/reactos/dll/win32/crypt32/crl.c trunk/reactos/dll/win32/crypt32/crypt32.spec trunk/reactos/dll/win32/crypt32/crypt32_En.rc trunk/reactos/dll/win32/crypt32/crypt32_Nl.rc trunk/reactos/dll/win32/crypt32/cryptres.h trunk/reactos/dll/win32/crypt32/ctl.c trunk/reactos/dll/win32/crypt32/decode.c trunk/reactos/dll/win32/crypt32/encode.c trunk/reactos/dll/win32/crypt32/filestore.c trunk/reactos/dll/win32/crypt32/msg.c trunk/reactos/dll/win32/crypt32/object.c trunk/reactos/dll/win32/crypt32/oid.c trunk/reactos/dll/win32/crypt32/provstore.c trunk/reactos/dll/win32/crypt32/regstore.c trunk/reactos/dll/win32/crypt32/rootstore.c trunk/reactos/dll/win32/crypt32/serialize.c trunk/reactos/dll/win32/crypt32/store.c trunk/reactos/include/psdk/wincrypt.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/cert.c?r…
Modified: trunk/reactos/dll/win32/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/chain.c?…
Modified: trunk/reactos/dll/win32/crypt32/collectionstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/collecti…
Modified: trunk/reactos/dll/win32/crypt32/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/context.…
Modified: trunk/reactos/dll/win32/crypt32/crl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crl.c?re…
Modified: trunk/reactos/dll/win32/crypt32/crypt32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32.…
Modified: trunk/reactos/dll/win32/crypt32/crypt32_En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32_…
Modified: trunk/reactos/dll/win32/crypt32/crypt32_Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32_…
Modified: trunk/reactos/dll/win32/crypt32/cryptres.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/cryptres…
Modified: trunk/reactos/dll/win32/crypt32/ctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/ctl.c?re…
Modified: trunk/reactos/dll/win32/crypt32/decode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/decode.c…
Modified: trunk/reactos/dll/win32/crypt32/encode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/encode.c…
Modified: trunk/reactos/dll/win32/crypt32/filestore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/filestor…
Modified: trunk/reactos/dll/win32/crypt32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/msg.c?re…
Modified: trunk/reactos/dll/win32/crypt32/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/object.c…
Modified: trunk/reactos/dll/win32/crypt32/oid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/oid.c?re…
Modified: trunk/reactos/dll/win32/crypt32/provstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/provstor…
Modified: trunk/reactos/dll/win32/crypt32/regstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/regstore…
Modified: trunk/reactos/dll/win32/crypt32/rootstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/rootstor…
Modified: trunk/reactos/dll/win32/crypt32/serialize.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/serializ…
Modified: trunk/reactos/dll/win32/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/store.c?…
Modified: trunk/reactos/include/psdk/wincrypt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wincrypt.h?re…
15 years, 10 months
1
0
0
0
[cwittich] 39235: sync msi_winetest with wine 1.1.14
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 08:17:07 2009 New Revision: 39235 URL:
http://svn.reactos.org/svn/reactos?rev=39235&view=rev
Log: sync msi_winetest with wine 1.1.14 Modified: trunk/rostests/winetests/msi/db.c trunk/rostests/winetests/msi/install.c trunk/rostests/winetests/msi/msi.c trunk/rostests/winetests/msi/package.c trunk/rostests/winetests/msi/source.c Modified: trunk/rostests/winetests/msi/db.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/db.c?rev=39…
============================================================================== --- trunk/rostests/winetests/msi/db.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/db.c [iso-8859-1] Sat Jan 31 08:17:07 2009 @@ -5153,7 +5153,7 @@ DeleteFileA(msifile); } -static void test_deleterow() +static void test_deleterow(void) { MSIHANDLE hdb, hview, hrec; const char *query; Modified: trunk/rostests/winetests/msi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/install.c?r…
============================================================================== --- trunk/rostests/winetests/msi/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/install.c [iso-8859-1] Sat Jan 31 08:17:07 2009 @@ -1365,6 +1365,7 @@ GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); } static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val) @@ -2394,6 +2395,41 @@ ok_(__FILE__, line)(val == expected, "Expected %d, got %d\n", expected, val); } +static void check_reg_dword2(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD line) +{ + DWORD val, size, type; + LONG res; + + size = sizeof(DWORD); + res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size); + + if (res != ERROR_SUCCESS || type != REG_DWORD) + { + ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n"); + return; + } + + ok_(__FILE__, line)(val == expected1 || val == expected2, "Expected %d or %d, got %d\n", expected1, expected2, val); +} + +static void check_reg_dword3(HKEY prodkey, LPCSTR name, DWORD expected1, DWORD expected2, DWORD expected3, DWORD line) +{ + DWORD val, size, type; + LONG res; + + size = sizeof(DWORD); + res = RegQueryValueExA(prodkey, name, NULL, &type, (LPBYTE)&val, &size); + + if (res != ERROR_SUCCESS || type != REG_DWORD) + { + ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n"); + return; + } + + ok_(__FILE__, line)(val == expected1 || val == expected2 || val == expected3, + "Expected %d, %d or %d, got %d\n", expected1, expected2, expected3, val); +} + #define CHECK_REG_STR(prodkey, name, expected) \ check_reg_str(prodkey, name, expected, TRUE, __LINE__); @@ -2413,6 +2449,20 @@ #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \ check_reg_dword(prodkey, name, expected, __LINE__); \ + RegDeleteValueA(prodkey, name); + +#define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \ + check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); + +#define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \ + check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \ + RegDeleteValueA(prodkey, name); + +#define CHECK_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \ + check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__); + +#define CHECK_DEL_REG_DWORD3(prodkey, name, expected1, expected2, expected3) \ + check_reg_dword3(prodkey, name, expected1, expected2, expected3, __LINE__); \ RegDeleteValueA(prodkey, name); static void get_date_str(LPSTR date) @@ -2497,7 +2547,7 @@ CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1); todo_wine { - CHECK_DEL_REG_DWORD(hkey, "EstimatedSize", 12); + CHECK_DEL_REG_DWORD3(hkey, "EstimatedSize", 12, -12, 4); } RegDeleteKeyA(hkey, ""); @@ -2535,7 +2585,7 @@ CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1); todo_wine { - CHECK_DEL_REG_DWORD(props, "EstimatedSize", 12); + CHECK_DEL_REG_DWORD3(props, "EstimatedSize", 12, -12, 4); } RegDeleteKeyA(props, ""); @@ -2596,7 +2646,7 @@ CHECK_DEL_REG_DWORD(hkey, "WindowsInstaller", 1); todo_wine { - CHECK_DEL_REG_DWORD(hkey, "EstimatedSize", 12); + CHECK_DEL_REG_DWORD3(hkey, "EstimatedSize", 12, -12, 4); } RegDeleteKeyA(hkey, ""); @@ -2634,7 +2684,7 @@ CHECK_DEL_REG_DWORD(props, "WindowsInstaller", 1); todo_wine { - CHECK_DEL_REG_DWORD(props, "EstimatedSize", 12); + CHECK_DEL_REG_DWORD3(props, "EstimatedSize", 12, -12, 4); } RegDeleteKeyA(props, ""); @@ -3359,7 +3409,7 @@ CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1); todo_wine { - CHECK_REG_DWORD(prodkey, "EstimatedSize", 12); + CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12); } RegCloseKey(prodkey); @@ -3433,7 +3483,7 @@ CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1); todo_wine { - CHECK_REG_DWORD(prodkey, "EstimatedSize", 12); + CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12); } RegCloseKey(prodkey); @@ -3511,7 +3561,7 @@ CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1); todo_wine { - CHECK_REG_DWORD(prodkey, "EstimatedSize", 12); + CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12); } RegCloseKey(prodkey); @@ -3563,7 +3613,7 @@ CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1); todo_wine { - CHECK_REG_DWORD(prodkey, "EstimatedSize", 12); + CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12); } RegCloseKey(prodkey); @@ -3615,7 +3665,7 @@ CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1); todo_wine { - CHECK_REG_DWORD(prodkey, "EstimatedSize", 12); + CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -20); } RegCloseKey(prodkey); @@ -3693,7 +3743,7 @@ CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1); todo_wine { - CHECK_REG_DWORD(prodkey, "EstimatedSize", 12); + CHECK_REG_DWORD2(prodkey, "EstimatedSize", 12, -12); } RegCloseKey(prodkey); @@ -3760,17 +3810,21 @@ ok(pf_exists("msitest"), "File not installed\n"); /* nothing published */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - - size = 0xdeadbeef; + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); + + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, NULL, &size); + MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -3778,17 +3832,21 @@ ok(pf_exists("msitest"), "File not installed\n"); /* after RegisterProduct */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - - size = 0xdeadbeef; + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); + + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, NULL, &size); + MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -3796,17 +3854,21 @@ ok(pf_exists("msitest"), "File not installed\n"); /* after ProcessComponents */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - - size = 0xdeadbeef; + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); + + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, NULL, &size); + MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -3814,17 +3876,21 @@ ok(pf_exists("msitest"), "File not installed\n"); /* after PublishFeatures */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - - size = 0xdeadbeef; + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); + + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, NULL, &size); + MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size); ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); Modified: trunk/rostests/winetests/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/msi.c?rev=3…
============================================================================== --- trunk/rostests/winetests/msi/msi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/msi.c [iso-8859-1] Sat Jan 31 08:17:07 2009 @@ -525,6 +525,7 @@ GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); } static void test_MsiQueryProductState(void) @@ -1274,7 +1275,14 @@ state = MAGIC_ERROR; r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(state == INSTALLSTATE_NOTUSED, "Expected INSTALLSTATE_NOTUSED, got %d\n", state); + ok(state == INSTALLSTATE_NOTUSED || state == INSTALLSTATE_LOCAL, + "Expected INSTALLSTATE_NOTUSED or INSTALLSTATE_LOCAL, got %d\n", state); + + /* NULL component, product exists */ + state = MAGIC_ERROR; + r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, NULL, &state); + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + ok(state == MAGIC_ERROR, "Expected state not changed, got %d\n", state); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"hi", 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -1389,7 +1397,8 @@ state = MAGIC_ERROR; r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(state == INSTALLSTATE_NOTUSED, "Expected INSTALLSTATE_NOTUSED, got %d\n", state); + ok(state == INSTALLSTATE_NOTUSED || state == INSTALLSTATE_LOCAL, + "Expected INSTALLSTATE_NOTUSED or INSTALLSTATE_LOCAL, got %d\n", state); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"hi", 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -4022,7 +4031,6 @@ INSTALLPROPERTY_HELPTELEPHONE, buf, &sz); ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); - ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf); ok(sz == 10, "Expected 10, got %d\n", sz); /* szValue is NULL, pcchValue is exactly 5 */ @@ -7778,9 +7786,10 @@ "Expected targetsid to be unchanged, got %s\n", targetsid); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + patch_squashed[lstrlenA(patch_squashed) + 1] = '\0'; res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, - lstrlenA(patch_squashed) + 1); + lstrlenA(patch_squashed) + 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* Patches value exists */ @@ -8779,9 +8788,10 @@ "Expected targetsid to be unchanged, got %s\n", targetsid); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + patch_squashed[lstrlenA(patch_squashed) + 1] = '\0'; res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, - lstrlenA(patch_squashed) + 1); + lstrlenA(patch_squashed) + 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* Patches value exists */ @@ -9256,9 +9266,10 @@ "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + patch_squashed[lstrlenA(patch_squashed) + 1] = '\0'; res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, - lstrlenA(patch_squashed) + 1); + lstrlenA(patch_squashed) + 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* Patches value exists */ @@ -9444,9 +9455,10 @@ "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + patch_squashed[lstrlenA(patch_squashed) + 1] = '\0'; res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, - lstrlenA(patch_squashed) + 1); + lstrlenA(patch_squashed) + 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* Patches value exists */ @@ -9588,9 +9600,10 @@ "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + patch_squashed[lstrlenA(patch_squashed) + 1] = '\0'; res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, - lstrlenA(patch_squashed) + 1); + lstrlenA(patch_squashed) + 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* Patches value exists */ Modified: trunk/rostests/winetests/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/package.c?r…
============================================================================== --- trunk/rostests/winetests/msi/package.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/package.c [iso-8859-1] Sat Jan 31 08:17:07 2009 @@ -51,6 +51,7 @@ GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); } /* RegDeleteTreeW from dlls/advapi32/registry.c */ Modified: trunk/rostests/winetests/msi/source.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/source.c?re…
============================================================================== --- trunk/rostests/winetests/msi/source.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/source.c [iso-8859-1] Sat Jan 31 08:17:07 2009 @@ -139,6 +139,7 @@ GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); return 1; } @@ -277,7 +278,8 @@ size = MAX_PATH; r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(r == ERROR_UNKNOWN_PRODUCT || ERROR_INVALID_PARAMETER, + "Expected ERROR_UNKNOWN_PRODUCT or ERROR_INVALID_PARAMETER, got %d\n", r); lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\"); lstrcatA(keypath, prod_squashed); @@ -287,19 +289,23 @@ /* user product key exists */ size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); res = RegCreateKeyA(userkey, "SourceList", &hkey); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* SourceList key exists */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(size == 0, "Expected 0, got %d\n", size); + ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value); data = "msitest.msi"; res = RegSetValueExA(hkey, "PackageName", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1); @@ -309,10 +315,12 @@ size = 0xdeadbeef; r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(size == 11, "Expected 11, got %d\n", size); + ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER, + "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r); + ok(size == 11 || r != ERROR_SUCCESS, "Expected 11, got %d\n", size); /* read the value, don't change size */ + size = 11; lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); @@ -329,34 +337,40 @@ ok(size == 11, "Expected 11, got %d\n", size); /* empty property now that product key exists */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, "", NULL, &size); + MSICODE_PRODUCT, "", value, &size); ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); /* nonexistent property now that product key exists */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, "nonexistent", NULL, &size); + MSICODE_PRODUCT, "nonexistent", value, &size); ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); data = "tester"; res = RegSetValueExA(hkey, "nonexistent", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* nonexistent property now that nonexistent value exists */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PRODUCT, "nonexistent", NULL, &size); + MSICODE_PRODUCT, "nonexistent", value, &size); ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); /* invalid option now that product key exists */ - size = 0xdeadbeef; + size = MAX_PATH; r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - 4, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + 4, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(size == 11, "Expected 11, got %d\n", size); @@ -568,11 +582,13 @@ RegCloseKey(userkey); /* try a patch */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Patches\\"); lstrcatA(keypath, prod_squashed); @@ -583,20 +599,24 @@ /* patch key exists * NOTE: using prodcode guid, but it really doesn't matter */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + ok(size == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, size); + ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value); res = RegCreateKeyA(userkey, "SourceList", &hkey); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* SourceList key exists */ - size = 0xdeadbeef; + size = MAX_PATH; + lstrcpyA(value, "aaa"); r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, - MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAME, value, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value); ok(size == 0, "Expected 0, got %d\n", size); RegDeleteKeyA(hkey, ""); @@ -2482,10 +2502,14 @@ r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, 1, &id, NULL, &labelsz, NULL, &promptsz); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(id == 2, "Expected 2, got %d\n", id); - ok(labelsz == 3, "Expected 3, got %d\n", labelsz); - ok(promptsz == 3, "Expected 3, got %d\n", promptsz); + ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER, + "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r); + if (r == ERROR_SUCCESS) + { + ok(id == 2, "Expected 2, got %d\n", id); + ok(labelsz == 3, "Expected 3, got %d\n", labelsz); + ok(promptsz == 3, "Expected 3, got %d\n", promptsz); + } /* now fill in the values */ id = 0xbeef; @@ -2496,13 +2520,24 @@ r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, 1, &id, label, &labelsz, prompt, &promptsz); - ok(r == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - ok(id == 0xbeef, "Expected 0xbeef, got %d\n", id); - ok(!lstrcmpA(label, "aaa"), "Expected \"aaa\", got \"%s\"\n", label); - ok(labelsz == MAX_PATH, "Expected MAX_PATH, got %d\n", labelsz); - ok(!lstrcmpA(prompt, "bbb"), "Expected \"bbb\", got \"%s\"\n", prompt); - ok(promptsz == MAX_PATH, "Expected MAX_PATH, got %d\n", promptsz); + ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER, + "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r); + if (r == ERROR_SUCCESS) + { + ok(id == 2, "Expected 2, got %d\n", id); + ok(!lstrcmpA(label, "one"), "Expected \"one\", got \"%s\"\n", label); + ok(labelsz == 3, "Expected 3, got %d\n", labelsz); + ok(!lstrcmpA(prompt, "two"), "Expected \"two\", got \"%s\"\n", prompt); + ok(promptsz == 3, "Expected 3, got %d\n", promptsz); + } + else if (r == ERROR_INVALID_PARAMETER) + { + ok(id == 0xbeef, "Expected 0xbeef, got %d\n", id); + ok(!lstrcmpA(label, "aaa"), "Expected \"aaa\", got \"%s\"\n", label); + ok(labelsz == MAX_PATH, "Expected MAX_PATH, got %d\n", labelsz); + ok(!lstrcmpA(prompt, "bbb"), "Expected \"bbb\", got \"%s\"\n", prompt); + ok(promptsz == MAX_PATH, "Expected MAX_PATH, got %d\n", promptsz); + } res = RegSetValueExA(media, "4", 0, REG_SZ, (LPBYTE)"three;four", 11); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -2674,11 +2709,15 @@ r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, 0, &id, NULL, &labelsz, prompt, &promptsz); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(id == 1, "Expected 1, got %d\n", id); - ok(labelsz == 5, "Expected 5, got %d\n", labelsz); - ok(!lstrcmpA(prompt, "prompt"), "Expected \"prompt\", got \"%s\"\n", prompt); - ok(promptsz == 6, "Expected 6, got %d\n", promptsz); + ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER, + "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r); + if (r == ERROR_SUCCESS) + { + ok(id == 1, "Expected 1, got %d\n", id); + ok(labelsz == 5, "Expected 5, got %d\n", labelsz); + ok(!lstrcmpA(prompt, "prompt"), "Expected \"prompt\", got \"%s\"\n", prompt); + ok(promptsz == 6, "Expected 6, got %d\n", promptsz); + } /* szVolumeLabel and pcchVolumeLabel are NULL */ id = 0; @@ -2700,11 +2739,15 @@ r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, 0, &id, label, NULL, prompt, &promptsz); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(id == 1, "Expected 1, got %d\n", id); - ok(!lstrcmpA(label, "aaa"), "Expected \"aaa\", got \"%s\"\n", label); - ok(!lstrcmpA(prompt, "prompt"), "Expected \"prompt\", got \"%s\"\n", prompt); - ok(promptsz == 6, "Expected 6, got %d\n", promptsz); + ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER, + "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r); + if (r == ERROR_SUCCESS) + { + ok(id == 1, "Expected 1, got %d\n", id); + ok(!lstrcmpA(label, "aaa"), "Expected \"aaa\", got \"%s\"\n", label); + ok(!lstrcmpA(prompt, "prompt"), "Expected \"prompt\", got \"%s\"\n", prompt); + ok(promptsz == 6, "Expected 6, got %d\n", promptsz); + } /* szDiskPrompt is NULL */ id = 0; @@ -2714,11 +2757,14 @@ r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, 0, &id, label, &labelsz, NULL, &promptsz); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(id == 1, "Expected 1, got %d\n", id); - ok(!lstrcmpA(label, "label"), "Expected \"label\", got \"%s\"\n", label); - ok(labelsz == 5, "Expected 5, got %d\n", labelsz); - ok(promptsz == 6, "Expected 6, got %d\n", promptsz); + ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER, "Expected ERROR_SUCCESS, got %d\n", r); + if (r == ERROR_SUCCESS) + { + ok(id == 1, "Expected 1, got %d\n", id); + ok(!lstrcmpA(label, "label"), "Expected \"label\", got \"%s\"\n", label); + ok(labelsz == 5, "Expected 5, got %d\n", labelsz); + ok(promptsz == 6, "Expected 6, got %d\n", promptsz); + } /* szDiskPrompt and pcchDiskPrompt are NULL */ id = 0;
15 years, 10 months
1
0
0
0
[cwittich] 39234: sync msi with wine 1.1.14
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Jan 31 08:13:20 2009 New Revision: 39234 URL:
http://svn.reactos.org/svn/reactos?rev=39234&view=rev
Log: sync msi with wine 1.1.14 Modified: trunk/reactos/dll/win32/msi/database.c trunk/reactos/dll/win32/msi/msi.c trunk/reactos/dll/win32/msi/msi.spec trunk/reactos/dll/win32/msi/registry.c trunk/reactos/dll/win32/msi/regsvr.c trunk/reactos/dll/win32/msi/source.c trunk/reactos/dll/win32/msi/storages.c trunk/reactos/dll/win32/msi/table.c Modified: trunk/reactos/dll/win32/msi/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/database.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/database.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -1206,7 +1206,7 @@ MERGETABLE *table = data->curtable; MERGEROW *mergerow; MSIQUERY *dbview; - MSIRECORD *row; + MSIRECORD *row = NULL; LPWSTR query; UINT r; Modified: trunk/reactos/dll/win32/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.c?rev=39…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -1553,7 +1553,7 @@ TRACE("(%s, %s, %d, %s, %p)\n", debugstr_w(szProductCode), debugstr_w(szUserSid), dwContext, debugstr_w(szComponent), pdwState); - if (!pdwState) + if (!pdwState || !szComponent) return ERROR_INVALID_PARAMETER; if (!szProductCode || !*szProductCode || lstrlenW(szProductCode) != GUID_SIZE - 1) Modified: trunk/reactos/dll/win32/msi/msi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -250,8 +250,8 @@ 254 stub MsiDeterminePatchSequenceW 255 stdcall MsiSourceListAddSourceExA(str str long long str long) 256 stdcall MsiSourceListAddSourceExW(wstr wstr long long wstr long) -257 stub MsiSourceListClearSourceA -258 stub MsiSourceListClearSourceW +257 stdcall MsiSourceListClearSourceA(str str long long str) +258 stdcall MsiSourceListClearSourceW(wstr wstr long long wstr) 259 stub MsiSourceListClearAllExA 260 stub MsiSourceListClearAllExW 261 stub MsiSourceListForceResolutionExA Modified: trunk/reactos/dll/win32/msi/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/registry.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -1894,7 +1894,7 @@ MSIINSTALLCONTEXT *pdwTargetProductContext, LPWSTR szTargetUserSid, LPDWORD pcchTargetUserSid, LPWSTR *szTransforms) { - UINT r; + UINT r = ERROR_INVALID_PARAMETER; if (dwContext & MSIINSTALLCONTEXT_USERMANAGED) { Modified: trunk/reactos/dll/win32/msi/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/regsvr.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/regsvr.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -42,7 +42,6 @@ #include "initguid.h" #include "msipriv.h" #include "msiserver.h" - WINE_DEFAULT_DEBUG_CHANNEL(msi); /* Modified: trunk/reactos/dll/win32/msi/source.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/source.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/source.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/source.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -1314,3 +1314,27 @@ FIXME("(%s %s %d)\n", debugstr_w(szProduct), debugstr_w(szUserName), dwReserved); return ERROR_SUCCESS; } + +/****************************************************************** + * MsiSourceListClearSourceA (MSI.@) + */ +UINT WINAPI MsiSourceListClearSourceA(LPCSTR szProductCodeOrPatchCode, LPCSTR szUserSid, + MSIINSTALLCONTEXT dwContext, DWORD dwOptions, + LPCSTR szSource) +{ + FIXME("(%s %s %x %x %s)\n", debugstr_a(szProductCodeOrPatchCode), debugstr_a(szUserSid), + dwContext, dwOptions, debugstr_a(szSource)); + return ERROR_SUCCESS; +} + +/****************************************************************** + * MsiSourceListClearSourceW (MSI.@) + */ +UINT WINAPI MsiSourceListClearSourceW(LPCWSTR szProductCodeOrPatchCode, LPCWSTR szUserSid, + MSIINSTALLCONTEXT dwContext, DWORD dwOptions, + LPCWSTR szSource) +{ + FIXME("(%s %s %x %x %s)\n", debugstr_w(szProductCodeOrPatchCode), debugstr_w(szUserSid), + dwContext, dwOptions, debugstr_w(szSource)); + return ERROR_SUCCESS; +} Modified: trunk/reactos/dll/win32/msi/storages.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/storages.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/storages.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/storages.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -134,7 +134,7 @@ static HRESULT stream_to_storage(IStream *stm, IStorage **stg) { - ILockBytes *lockbytes; + ILockBytes *lockbytes = NULL; STATSTG stat; LPVOID data; HRESULT hr; @@ -177,7 +177,7 @@ done: msi_free(data); - ILockBytes_Release(lockbytes); + if (lockbytes) ILockBytes_Release(lockbytes); return hr; } Modified: trunk/reactos/dll/win32/msi/table.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/table.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/table.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/table.c [iso-8859-1] Sat Jan 31 08:13:20 2009 @@ -1818,7 +1818,7 @@ done: msiobj_release(&rec->hdr); - if (columns) columns->ops->delete(columns); + columns->ops->delete(columns); return r; }
15 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
...
76
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Results per page:
10
25
50
100
200