winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
947 discussions
Start a n
N
ew thread
Vijay Kiran Kamuju : mscms: Add stub for WcsGetDefaultRenderingIntent.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: 797c80adfffd6d654f0de590f7702a4a9d6a5b41 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=797c80adfffd6d654f0de590…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Fri Jan 31 02:00:28 2020 +0100 mscms: Add stub for WcsGetDefaultRenderingIntent. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48541
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit a0e4dbcfd5d46e325a0811aac4d85ab1ec4ca30e) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/mscms/mscms.spec | 2 +- dlls/mscms/profile.c | 10 ++++++++++ include/icm.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/mscms/mscms.spec b/dlls/mscms/mscms.spec index c535d4c88e..cfe32a826e 100644 --- a/dlls/mscms/mscms.spec +++ b/dlls/mscms/mscms.spec @@ -93,7 +93,7 @@ @ stub WcsGetCalibrationManagementState @ stub WcsGetDefaultColorProfile @ stdcall WcsGetDefaultColorProfileSize(long wstr long long long ptr) -@ stub WcsGetDefaultRenderingIntent +@ stdcall WcsGetDefaultRenderingIntent(long ptr) @ stdcall WcsGetUsePerUserProfiles(wstr long ptr) @ stub WcsGpCanInstallOrUninstallProfiles @ stdcall WcsOpenColorProfileA(ptr ptr ptr long long long long) diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index efc0e4b416..ed0ed53158 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -1564,6 +1564,16 @@ BOOL WINAPI WcsGetDefaultColorProfileSize( WCS_PROFILE_MANAGEMENT_SCOPE scope, P return FALSE; } +/****************************************************************************** + * WcsGetDefaultRednderingIntent [MSCMS.@] + */ +BOOL WINAPI WcsGetDefaultRenderingIntent( WCS_PROFILE_MANAGEMENT_SCOPE scope, PDWORD intent) +{ + FIXME( "%d %p\n", scope, intent ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + /****************************************************************************** * WcsOpenColorProfileA [MSCMS.@] */ diff --git a/include/icm.h b/include/icm.h index dab0b5f2e5..cd0e2c0c2a 100644 --- a/include/icm.h +++ b/include/icm.h @@ -500,6 +500,7 @@ BOOL WINAPI UnregisterCMMW(PCWSTR,DWORD); #define UnregisterCMM WINELIB_NAME_AW(UnregisterCMM) BOOL WINAPI WcsEnumColorProfilesSize(WCS_PROFILE_MANAGEMENT_SCOPE,ENUMTYPEW*,DWORD*); BOOL WINAPI WcsGetDefaultColorProfileSize(WCS_PROFILE_MANAGEMENT_SCOPE,const WCHAR*,COLORPROFILETYPE,COLORPROFILESUBTYPE,DWORD,DWORD*); +BOOL WINAPI WcsGetDefaultRenderingIntent(WCS_PROFILE_MANAGEMENT_SCOPE,DWORD*); BOOL WINAPI WcsGetUsePerUserProfiles(const WCHAR*,DWORD,BOOL*); HPROFILE WINAPI WcsOpenColorProfileA(PROFILE*,PROFILE*,PROFILE*,DWORD,DWORD,DWORD,DWORD); HPROFILE WINAPI WcsOpenColorProfileW(PROFILE*,PROFILE*,PROFILE*,DWORD,DWORD,DWORD,DWORD);
1
0
0
0
Vijay Kiran Kamuju : mscms: Add stub for WcsGetDefaultColorProfileSize.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: 4227dcb721981c73120b375c9f702c53fdf36421 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4227dcb721981c73120b375c…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Fri Jan 31 01:50:01 2020 +0100 mscms: Add stub for WcsGetDefaultColorProfileSize. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48541
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 87e14f61027eef63cea7bcf68727454c482fa1f9) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/mscms/mscms.spec | 2 +- dlls/mscms/profile.c | 12 ++++++++++++ include/icm.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/mscms/mscms.spec b/dlls/mscms/mscms.spec index fec0af571d..c535d4c88e 100644 --- a/dlls/mscms/mscms.spec +++ b/dlls/mscms/mscms.spec @@ -92,7 +92,7 @@ @ stdcall WcsEnumColorProfilesSize(long ptr ptr) @ stub WcsGetCalibrationManagementState @ stub WcsGetDefaultColorProfile -@ stub WcsGetDefaultColorProfileSize +@ stdcall WcsGetDefaultColorProfileSize(long wstr long long long ptr) @ stub WcsGetDefaultRenderingIntent @ stdcall WcsGetUsePerUserProfiles(wstr long ptr) @ stub WcsGpCanInstallOrUninstallProfiles diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index d45ac4af12..efc0e4b416 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -1552,6 +1552,18 @@ BOOL WINAPI WcsEnumColorProfilesSize( WCS_PROFILE_MANAGEMENT_SCOPE scope, ENUMTY return FALSE; } +/****************************************************************************** + * WcsGetDefaultColorProfileSize [MSCMS.@] + */ +BOOL WINAPI WcsGetDefaultColorProfileSize( WCS_PROFILE_MANAGEMENT_SCOPE scope, PCWSTR device_name, + COLORPROFILETYPE type, COLORPROFILESUBTYPE subtype, + DWORD profile_id, PDWORD profile_size) +{ + FIXME( "%d %s %d %d %d %p\n", scope, debugstr_w(device_name), type, subtype, profile_id, profile_size ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + /****************************************************************************** * WcsOpenColorProfileA [MSCMS.@] */ diff --git a/include/icm.h b/include/icm.h index 67bfcc89fd..dab0b5f2e5 100644 --- a/include/icm.h +++ b/include/icm.h @@ -499,6 +499,7 @@ BOOL WINAPI UnregisterCMMA(PCSTR,DWORD); BOOL WINAPI UnregisterCMMW(PCWSTR,DWORD); #define UnregisterCMM WINELIB_NAME_AW(UnregisterCMM) BOOL WINAPI WcsEnumColorProfilesSize(WCS_PROFILE_MANAGEMENT_SCOPE,ENUMTYPEW*,DWORD*); +BOOL WINAPI WcsGetDefaultColorProfileSize(WCS_PROFILE_MANAGEMENT_SCOPE,const WCHAR*,COLORPROFILETYPE,COLORPROFILESUBTYPE,DWORD,DWORD*); BOOL WINAPI WcsGetUsePerUserProfiles(const WCHAR*,DWORD,BOOL*); HPROFILE WINAPI WcsOpenColorProfileA(PROFILE*,PROFILE*,PROFILE*,DWORD,DWORD,DWORD,DWORD); HPROFILE WINAPI WcsOpenColorProfileW(PROFILE*,PROFILE*,PROFILE*,DWORD,DWORD,DWORD,DWORD);
1
0
0
0
Vijay Kiran Kamuju : include: Add missing defines to icm.h.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: 4b7e8339b262c55e3b387b90c3881481e498c40e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b7e8339b262c55e3b387b90…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Fri Jan 31 01:43:13 2020 +0100 include: Add missing defines to icm.h. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit b4db9884c396b22f78e357c01fa77ebac58d2422) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- include/icm.h | 168 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 137 insertions(+), 31 deletions(-) diff --git a/include/icm.h b/include/icm.h index de5bf2626e..67bfcc89fd 100644 --- a/include/icm.h +++ b/include/icm.h @@ -137,20 +137,20 @@ typedef enum typedef enum { - BM_x555RGB = 0x00, - BM_565RGB = 0x01, - BM_RGBTRIPLETS = 0x02, - BM_BGRTRIPLETS = 0x04, - BM_xRGBQUADS = 0x08, - BM_10b_RGB = 0x09, - BM_16b_RGB = 0x0a, - BM_xBGRQUADS = 0x10, - BM_CMYKQUADS = 0x20, - BM_x555XYZ = 0x101, + BM_x555RGB = 0x0000, + BM_565RGB = 0x0001, + BM_RGBTRIPLETS = 0x0002, + BM_BGRTRIPLETS = 0x0004, + BM_xRGBQUADS = 0x0008, + BM_10b_RGB = 0x0009, + BM_16b_RGB = 0x000a, + BM_xBGRQUADS = 0x0010, + BM_CMYKQUADS = 0x0020, + BM_x555XYZ = 0x0101, BM_x555Yxz, BM_x555Lab, BM_x555G3CH, - BM_XYZTRIPLETS = 0x201, + BM_XYZTRIPLETS = 0x0201, BM_YxyTRIPLETS, BM_LabTRIPLETS, BM_G3CHTRIPLETS, @@ -159,21 +159,28 @@ typedef enum BM_7CHANNEL, BM_8CHANNEL, BM_GRAY, - BM_xXYZQUADS = 0x301, + BM_xXYZQUADS = 0x0301, BM_xYxyQUADS, BM_xLabQUADS, BM_xG3CHQUADS, BM_KYMCQUADS, - BM_10b_XYZ = 0x401, + BM_10b_XYZ = 0x0401, BM_10b_Yxy, BM_10b_Lab, BM_10b_G3CH, BM_NAMED_INDEX, - BM_16b_XYZ = 0x501, + BM_16b_XYZ = 0x0501, BM_16b_Yxy, BM_16b_Lab, BM_16b_G3CH, BM_16b_GRAY, + BM_32b_scRGB = 0x0601, + BM_32b_scARGB, + BM_S2DOT13FIXED_scRGB, + BM_S2DOT13FIXED_scARGB, + BM_R10G10B10A2 = 0x0701, + BM_R10G10B10A2_XR, + BM_R16G16B16A16_FLOAT } BMFORMAT, *PBMFORMAT, *LPBMFORMAT; typedef enum @@ -182,6 +189,36 @@ typedef enum WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER } WCS_PROFILE_MANAGEMENT_SCOPE; +#define DONT_USE_EMBEDDED_WCS_PROFILES 0x00000001 + +#define PROOF_MODE 0x00000001 +#define NORMAL_MODE 0x00000002 +#define BEST_MODE 0x00000003 +#define ENABLE_GAMUT_CHECKING 0x00010000 +#define USE_RELATIVE_COLORIMETRIC 0x00020000 +#define FAST_TRANSLATE 0x00040000 +#define PRESERVEBLACK 0x00100000 +#define WCS_ALWAYS 0x00200000 +#define RESERVED 0x80000000 +#define SEQUENTIAL_TRANSFORM 0x80800000 + +#define CSA_A 1 +#define CSA_ABC 2 +#define CSA_DEF 3 +#define CSA_DEFG 4 +#define CSA_GRAY 5 +#define CSA_RGB 6 +#define CSA_CMYK 7 +#define CSA_Lab 8 + +#define CMM_WIN_VERSION 0 +#define CMM_IDENT 1 +#define CMM_DRIVER_VERSION 2 +#define CMM_DLL_VERSION 3 +#define CMM_VERSION 4 +#define CMM_DESCRIPTION 5 +#define CMM_LOGOICON 6 + typedef BOOL (CALLBACK *PBMCALLBACKFN)(ULONG,ULONG,LPARAM); typedef PBMCALLBACKFN LPPBMCALLBACKFN; @@ -190,6 +227,38 @@ typedef PBMCALLBACKFN LPPBMCALLBACKFN; #define INTENT_SATURATION 2 #define INTENT_ABSOLUTE_COLORIMETRIC 3 +typedef enum +{ + CPT_ICC, + CPT_DMP, + CPT_CAMP, + CPT_GMMP +} COLORPROFILETYPE, *PCOLORPROFILETYPE, *LPCOLORPROFILETYPE; + +typedef enum +{ + CPST_PERCEPTUAL = INTENT_PERCEPTUAL, + CPST_RELATIVE_COLORIMETRIC = INTENT_RELATIVE_COLORIMETRIC, + CPST_SATURATION = INTENT_SATURATION, + CPST_ABSOLUTE_COLORIMETRIC = INTENT_ABSOLUTE_COLORIMETRIC, + CPST_NONE, + CPST_RGB_WORKING_SPACE, + CPST_CUSTOM_WORKING_SPACE, + CPST_STANDARD_DISPLAY_COLOR_MODE, + CPST_EXTENDED_DISPLAY_COLOR_MODE +} COLORPROFILESUBTYPE, *PCOLORPROFILESUBTYPE, *LPCOLORPROFILESUBTYPE; + +typedef enum +{ + COLOR_BYTE = 1, + COLOR_WORD, + COLOR_FLOAT, + COLOR_S2DOT13FIXED, + COLOR_10b_R10G10B10A2, + COLOR_10b_R10G10B10A2_XR, + COLOR_FLOAT16 +} COLORDATATYPE, *PCOLORDATATYPE, *LPCOLORDATATYPE; + typedef struct tagPROFILEHEADER { DWORD phSize; @@ -268,23 +337,43 @@ typedef struct tagENUMTYPEW DWORD dwDeviceClass; } ENUMTYPEW, *PENUMTYPEW, *LPENUMTYPEW; -#define ET_DEVICENAME 0x00000001 -#define ET_MEDIATYPE 0x00000002 -#define ET_DITHERMODE 0x00000004 -#define ET_RESOLUTION 0x00000008 -#define ET_CMMTYPE 0x00000010 -#define ET_CLASS 0x00000020 -#define ET_DATACOLORSPACE 0x00000040 -#define ET_CONNECTIONSPACE 0x00000080 -#define ET_SIGNATURE 0x00000100 -#define ET_PLATFORM 0x00000200 -#define ET_PROFILEFLAGS 0x00000400 -#define ET_MANUFACTURER 0x00000800 -#define ET_MODEL 0x00001000 -#define ET_ATTRIBUTES 0x00002000 -#define ET_RENDERINGINTENT 0x00004000 -#define ET_CREATOR 0x00008000 -#define ET_DEVICECLASS 0x00010000 +#define ET_DEVICENAME 0x00000001 +#define ET_MEDIATYPE 0x00000002 +#define ET_DITHERMODE 0x00000004 +#define ET_RESOLUTION 0x00000008 +#define ET_CMMTYPE 0x00000010 +#define ET_CLASS 0x00000020 +#define ET_DATACOLORSPACE 0x00000040 +#define ET_CONNECTIONSPACE 0x00000080 +#define ET_SIGNATURE 0x00000100 +#define ET_PLATFORM 0x00000200 +#define ET_PROFILEFLAGS 0x00000400 +#define ET_MANUFACTURER 0x00000800 +#define ET_MODEL 0x00001000 +#define ET_ATTRIBUTES 0x00002000 +#define ET_RENDERINGINTENT 0x00004000 +#define ET_CREATOR 0x00008000 +#define ET_DEVICECLASS 0x00010000 +#define ET_STANDARDDISPLAYCOLOR 0x00020000 +#define ET_EXTENDEDDISPLAYCOLOR 0x00040000 + +#define COLOR_MATCH_VERSION 0x0200 + +#define CMS_DISABLEICM 0x00000001 +#define CMS_ENABLEPROOFING 0x00000002 +#define CMS_SETRENDERINTENT 0x00000004 +#define CMS_SETPROOFINTENT 0x00000008 +#define CMS_SETMONITORPROFILE 0x00000010 +#define CMS_SETPRINTERPROFILE 0x00000020 +#define CMS_SETTARGETPROFILE 0x00000040 +#define CMS_USEHOOK 0x00000080 +#define CMS_USEAPPLYCALLBACK 0x00000100 +#define CMS_USEDESCRIPTION 0x00000200 +#define CMS_DISABLEINTENT 0x00000400 +#define CMS_DISABLERENDERINTENT 0x00000800 +#define CMS_TARGETOVERFLOW 0x20000000 +#define CMS_PRINTERROVERFLOW 0x40000000 +#define CMS_MONITOROVERFLOW 0x80000000 struct _tagCOLORMATCHSETUPA; struct _tagCOLORMATCHSETUPW; @@ -420,6 +509,23 @@ HPROFILE WINAPI WcsOpenColorProfileW(PROFILE*,PROFILE*,PROFILE*,DWORD,DWORD,DW #define PROFILE_READ 1 #define PROFILE_READWRITE 2 +#define FLAG_EMBEDDEDPROFILE 0x00000001 +#define FLAG_DEPENDENTONDATA 0x00000002 +#define FLAG_ENABLE_CHROMATIC_ADAPTATION 0x02000000 + +#define ATTRIB_TRANSPARENCY 0x00000001 +#define ATTRIB_MATTE 0x00000002 + +#define CLASS_MONITOR 0x6D6E7472 /* 'mntr' */ +#define CLASS_PRINTER 0x70727472 /* 'prtr' */ +#define CLASS_SCANNER 0x73636E72 /* 'scnr' */ +#define CLASS_LINK 0x6C696E6B /* 'link' */ +#define CLASS_ABSTRACT 0x61627374 /* 'abst' */ +#define CLASS_COLORSPACE 0x73617063 /* 'spac' */ +#define CLASS_NAMED 0x6E6D636C /* 'nmcl' */ +#define CLASS_CAMP 0x63616D70 /* 'camp' */ +#define CLASS_GMMP 0x676D6D70 /* 'gmmp' */ + #define SPACE_XYZ 0x58595A20 /* 'XYZ ' */ #define SPACE_Lab 0x4C616220 /* 'Lab ' */ #define SPACE_Luv 0x4C757620 /* 'Luv ' */
1
0
0
0
Dirk Niggemann : krnl386.exe: Make CallProcEx32W16 clear CPEX_DEST_CDECL flag before looping over arguments.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: c7befdbcc764b61ebb469849c10d690d9cb24971 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c7befdbcc764b61ebb469849…
Author: Dirk Niggemann <dirk.niggemann(a)gmail.com> Date: Tue Feb 4 22:42:50 2020 +0000 krnl386.exe: Make CallProcEx32W16 clear CPEX_DEST_CDECL flag before looping over arguments. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48480
Signed-off-by: Dirk Niggemann <dirk.niggemann(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit c57483ba4d77d04a7af120a6e016b53c5596fe81) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/krnl386.exe16/thunk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/krnl386.exe16/thunk.c b/dlls/krnl386.exe16/thunk.c index c8ad3824c0..91a24f19c4 100644 --- a/dlls/krnl386.exe16/thunk.c +++ b/dlls/krnl386.exe16/thunk.c @@ -2475,11 +2475,12 @@ DWORD WINAPIV CallProc32W16( DWORD nrofargs, DWORD argconvmask, FARPROC proc32, DWORD WINAPIV CallProcEx32W16( DWORD nrofargs, DWORD argconvmask, FARPROC proc32, VA_LIST16 valist ) { DWORD args[32]; - unsigned int i; + unsigned int i, count = min( 32, nrofargs & ~CPEX_DEST_CDECL ); - TRACE("(%d,%d,%p args[",nrofargs,argconvmask,proc32); + TRACE("(%s,%d,%d,%p args[", nrofargs & CPEX_DEST_CDECL ? "cdecl": "stdcall", + nrofargs & ~CPEX_DEST_CDECL, argconvmask, proc32); - for (i=0;i<nrofargs;i++) + for (i = 0; i < count; i++) { if (argconvmask & (1<<i)) {
1
0
0
0
Zebediah Figura : d3d9: Return a stub interface from Direct3DShaderValidatorCreate9().
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: 09e9cf281c4577c146eb3649f62e961244b954bf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=09e9cf281c4577c146eb3649…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 10 18:44:31 2020 +0330 d3d9: Return a stub interface from Direct3DShaderValidatorCreate9(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46735
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 2a4a8a5cf34e9697a976a8272a1c93e5660cbea6) Conflicts: dlls/d3d9/tests/device.c Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/d3d9/d3d9_main.c | 124 +++++++++++++++++++++++++++++++++++++++++++---- dlls/d3d9/tests/device.c | 66 +++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 9 deletions(-) diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c index 21df2a34cd..75e627dd76 100644 --- a/dlls/d3d9/d3d9_main.c +++ b/dlls/d3d9/d3d9_main.c @@ -75,18 +75,124 @@ HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT sdk_version, IDirect3D9E return D3D_OK; } -/******************************************************************* - * Direct3DShaderValidatorCreate9 (D3D9.@) +/* The callback is called on any error encountered during validation, including + * improper IDirect3DShaderValidator9 method calls. + * - "file" and "line" are passed through directly from Instruction(). "line" + * is provably 32-bit, as 64-bit values passed to Instruction() will be + * truncated. + * - "arg3" has been observed to be at least 0, 2, and 6. The integer size is + * not known. + * - "message_id" is a numeric error code. fxc.exe adds 5000 before printing + * it. The integer size is not known. + * - "context" is passed through directly from Begin(). * - * No documentation available for this function. - * SDK only says it is internal and shouldn't be used. - */ -void* WINAPI Direct3DShaderValidatorCreate9(void) + * Improper calls to IDirect3DShaderValidator9 methods, or other errors not + * generated by specific Instruction() calls, yield NULL as the file, and + * either 0 or -1 as the line. + * + * The callback return type is not known, but programs (fxc.exe, The Sims 2) + * seem to consistently return 0. + * + * The interface and method names below are derived from the messages that + * native d3d9 prints on said improper method calls. + * + * Calls to Begin(), Instruction(), End() have been observed to return S_OK and + * E_FAIL. E_FAIL is not always returned if an error message is handed to the + * callback. */ + +typedef HRESULT (WINAPI *shader_validator_cb)(const char *file, int line, + DWORD_PTR arg3, DWORD_PTR message_id, const char *message, void *context); + +typedef struct IDirect3DShaderValidator9 IDirect3DShaderValidator9; + +struct IDirect3DShaderValidator9Vtbl +{ + HRESULT (WINAPI *QueryInterface)(IDirect3DShaderValidator9 *iface, REFIID iid, void **out); + ULONG (WINAPI *AddRef)(IDirect3DShaderValidator9 *iface); + ULONG (WINAPI *Release)(IDirect3DShaderValidator9 *iface); + HRESULT (WINAPI *Begin)(IDirect3DShaderValidator9 *iface, + shader_validator_cb callback, void *context, DWORD_PTR arg3); + HRESULT (WINAPI *Instruction)(IDirect3DShaderValidator9 *iface, + const char *file, int line, const DWORD *tokens, DWORD token_count); + HRESULT (WINAPI *End)(IDirect3DShaderValidator9 *iface); +}; + +struct IDirect3DShaderValidator9 +{ + const struct IDirect3DShaderValidator9Vtbl *vtbl; +}; + +static HRESULT WINAPI shader_validator_QueryInterface(IDirect3DShaderValidator9 *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + + return E_NOINTERFACE; +} + +static ULONG WINAPI shader_validator_AddRef(IDirect3DShaderValidator9 *iface) +{ + TRACE("iface %p.\n", iface); + + return 2; +} + +static ULONG WINAPI shader_validator_Release(IDirect3DShaderValidator9 *iface) +{ + TRACE("iface %p.\n", iface); + + return 1; +} + +/* The size and type of the third argument is not known. The Sims 2 passes 0; + * fxc.exe passes 1. */ +static HRESULT WINAPI shader_validator_Begin(IDirect3DShaderValidator9 *iface, + shader_validator_cb callback, void *context, DWORD_PTR arg3) +{ + FIXME("iface %p, callback %p, context %p, arg3 %#Ix, stub!\n", iface, callback, context, arg3); + + return S_OK; +} + +/* - "file" and "line" are passed directly through to the callback. + * - "tokens" comprises a single instruction; the caller must determine its + * length. + * - "token_count" is in DWORDs. */ +static HRESULT WINAPI shader_validator_Instruction(IDirect3DShaderValidator9 *iface, + const char *file, int line, const DWORD *tokens, DWORD token_count) +{ + FIXME("iface %p, file %s, line %u, tokens %p, token_count %u, stub!\n", + iface, debugstr_a(file), line, tokens, token_count); + + return S_OK; +} + +static HRESULT WINAPI shader_validator_End(IDirect3DShaderValidator9 *iface) +{ + FIXME("iface %p, stub!\n", iface); + + return S_OK; +} + +static const struct IDirect3DShaderValidator9Vtbl shader_validator_vtbl = +{ + shader_validator_QueryInterface, + shader_validator_AddRef, + shader_validator_Release, + shader_validator_Begin, + shader_validator_Instruction, + shader_validator_End, +}; + +static IDirect3DShaderValidator9 shader_validator = {&shader_validator_vtbl}; + +IDirect3DShaderValidator9 * WINAPI Direct3DShaderValidatorCreate9(void) { - static int once; + TRACE("Returning validator %p.\n", &shader_validator); - if (!once++) FIXME("stub\n"); - return NULL; + return &shader_validator; } /*********************************************************************** diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 03ebe242e9..d2142e3d27 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -53,6 +53,8 @@ struct device_desc static DEVMODEW registry_mode; +static void *(WINAPI *Direct3DShaderValidatorCreate9)(void); + static const DWORD simple_vs[] = { 0xfffe0101, /* vs_1_1 */ @@ -13405,8 +13407,69 @@ static void test_get_display_mode(void) DestroyWindow(window); } +typedef HRESULT (WINAPI *shader_validator_cb)(const char *file, int line, + DWORD_PTR arg3, DWORD_PTR message_id, const char *message, void *context); + +typedef struct IDirect3DShaderValidator9 IDirect3DShaderValidator9; + +struct IDirect3DShaderValidator9Vtbl +{ + HRESULT (WINAPI *QueryInterface)(IDirect3DShaderValidator9 *iface, REFIID iid, void **out); + ULONG (WINAPI *AddRef)(IDirect3DShaderValidator9 *iface); + ULONG (WINAPI *Release)(IDirect3DShaderValidator9 *iface); + HRESULT (WINAPI *Begin)(IDirect3DShaderValidator9 *iface, + shader_validator_cb callback, void *context, DWORD_PTR arg3); + HRESULT (WINAPI *Instruction)(IDirect3DShaderValidator9 *iface, + const char *file, int line, const DWORD *tokens, DWORD token_count); + HRESULT (WINAPI *End)(IDirect3DShaderValidator9 *iface); +}; + +struct IDirect3DShaderValidator9 +{ + const struct IDirect3DShaderValidator9Vtbl *vtbl; +}; + +HRESULT WINAPI test_shader_validator_cb(const char *file, int line, DWORD_PTR arg3, + DWORD_PTR message_id, const char *message, void *context) +{ + ok(0, "Unexpected call.\n"); + return S_OK; +} + +static void test_shader_validator(void) +{ + IDirect3DShaderValidator9 *validator; + ULONG refcount; + HRESULT hr; + + validator = Direct3DShaderValidatorCreate9(); + + hr = validator->vtbl->Begin(validator, test_shader_validator_cb, NULL, 0); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[0], 1); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[1], 3); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[4], 4); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[8], 4); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[12], 4); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[16], 4); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->Instruction(validator, NULL, 0, &simple_vs[20], 1); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = validator->vtbl->End(validator); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + refcount = validator->vtbl->Release(validator); + todo_wine ok(!refcount, "Validator has %u references left.\n", refcount); +} + START_TEST(device) { + HMODULE d3d9_handle = GetModuleHandleA("d3d9.dll"); WNDCLASSA wc = {0}; IDirect3D9 *d3d9; DEVMODEW current_mode; @@ -13434,6 +13497,8 @@ START_TEST(device) wc.lpszClassName = "d3d9_test_wc"; RegisterClassA(&wc); + Direct3DShaderValidatorCreate9 = (void *)GetProcAddress(d3d9_handle, "Direct3DShaderValidatorCreate9"); + test_get_set_vertex_declaration(); test_get_declaration(); test_fvf_decl_conversion(); @@ -13532,6 +13597,7 @@ START_TEST(device) test_multiply_transform(); test_vertex_buffer_read_write(); test_get_display_mode(); + test_shader_validator(); UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL)); }
1
0
0
0
Alistair Leslie-Hughes : d3dx9: Implement D3DXCreateKeyframedAnimationSet.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: c8044aef1f1a7eab9b190c08621628a31445204d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c8044aef1f1a7eab9b190c08…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Feb 11 18:36:46 2020 +0100 d3dx9: Implement D3DXCreateKeyframedAnimationSet. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45481
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 0854a7eab7ac69057a3bf8c44ef90ce18497d964) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/d3dx9_36/animation.c | 419 ++++++++++++++++++++++++++++++++++++++++++++- dlls/d3dx9_36/tests/mesh.c | 27 +++ 2 files changed, 443 insertions(+), 3 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c8044aef1f1a7eab9b19…
1
0
0
0
Michael Müller : setupapi: Implement SP_COPY_IN_USE_NEEDS_REBOOT.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: b7958fb0a88d77e31c9d16e98cc7eebd245255b0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b7958fb0a88d77e31c9d16e9…
Author: Michael Müller <michael(a)fds-team.de> Date: Thu Feb 13 03:11:22 2020 +0000 setupapi: Implement SP_COPY_IN_USE_NEEDS_REBOOT. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=36059
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 87b2af73baf3cc26fe5ed135cbd6ed494a9003be) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/setupapi/queue.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index 2d2c833474..0fbcac965b 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -1132,7 +1132,7 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style, } } if (style & (SP_COPY_NODECOMP | SP_COPY_LANGUAGEAWARE | SP_COPY_FORCE_IN_USE | - SP_COPY_IN_USE_NEEDS_REBOOT | SP_COPY_NOSKIP | SP_COPY_WARNIFSKIP)) + SP_COPY_NOSKIP | SP_COPY_WARNIFSKIP)) { ERR("Unsupported style(s) 0x%x\n",style); } @@ -1140,6 +1140,22 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style, if (docopy) { rc = CopyFileW(source,target,FALSE); + if (!rc && GetLastError() == ERROR_SHARING_VIOLATION && + (style & SP_COPY_IN_USE_NEEDS_REBOOT)) + { + WCHAR temp_file[MAX_PATH]; + WCHAR temp[MAX_PATH]; + + if (GetTempPathW(MAX_PATH, temp) && + GetTempFileNameW(temp, L"SET", 0, temp_file)) + { + rc = CopyFileW(source, temp_file, FALSE); + if (rc) + rc = MoveFileExW(temp_file, target, MOVEFILE_DELAY_UNTIL_REBOOT); + else + DeleteFileW(temp_file); + } + } if (!rc) WARN( "failed to copy, err %u\n", GetLastError() ); } else
1
0
0
0
Piotr Caban : msvcrt: Don't duplicate _wsearchenv_s code in _wsearchenv.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: 446daec1f5261af01ac49c78f9f6537aa53f3c0a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=446daec1f5261af01ac49c78…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jan 29 13:42:23 2020 +0100 msvcrt: Don't duplicate _wsearchenv_s code in _wsearchenv. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 1b5a551324e113afefd247e703cc59c03ad80a9d) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcrt/dir.c | 66 +++++++------------------------------------------------ 1 file changed, 8 insertions(+), 58 deletions(-) diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index 5bd8fb1b15..5e84e38a00 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -1733,64 +1733,6 @@ void CDECL MSVCRT__searchenv(const char* file, const char* env, char *buf) MSVCRT__searchenv_s(file, env, buf, MAX_PATH); } -/********************************************************************* - * _wsearchenv (MSVCRT.@) - * - * Unicode version of _searchenv - */ -void CDECL MSVCRT__wsearchenv(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* env, MSVCRT_wchar_t *buf) -{ - MSVCRT_wchar_t *envVal, *penv, *end; - MSVCRT_wchar_t path[MAX_PATH]; - MSVCRT_size_t path_len, fname_len = strlenW(file); - - *buf = '\0'; - - /* Try CWD first */ - if (GetFileAttributesW( file ) != INVALID_FILE_ATTRIBUTES) - { - GetFullPathNameW( file, MAX_PATH, buf, NULL ); - return; - } - - /* Search given environment variable */ - envVal = MSVCRT__wgetenv(env); - if (!envVal) - { - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; - } - - penv = envVal; - TRACE(":searching for %s in paths %s\n", debugstr_w(file), debugstr_w(envVal)); - - for(; *penv; penv = (*end ? end + 1 : end)) - { - end = penv; - while(*end && *end != ';') end++; /* Find end of next path */ - path_len = end - penv; - if (!path_len || path_len >= MAX_PATH) - continue; - - memcpy(path, penv, path_len * sizeof(MSVCRT_wchar_t)); - if (path[path_len - 1] != '/' && path[path_len - 1] != '\\') - path[path_len++] = '\\'; - if (path_len + fname_len >= MAX_PATH) - continue; - - memcpy(path + path_len, file, (fname_len + 1) * sizeof(MSVCRT_wchar_t)); - TRACE("Checking for file %s\n", debugstr_w(path)); - if (GetFileAttributesW( path ) != INVALID_FILE_ATTRIBUTES) - { - memcpy(buf, path, (path_len + fname_len + 1) * sizeof(MSVCRT_wchar_t)); - return; - } - } - - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; -} - /********************************************************************* * _wsearchenv_s (MSVCRT.@) */ @@ -1876,3 +1818,11 @@ int CDECL MSVCRT__wsearchenv_s(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* *MSVCRT__errno() = MSVCRT_ENOENT; return MSVCRT_ENOENT; } + +/********************************************************************* + * _wsearchenv (MSVCRT.@) + */ +void CDECL MSVCRT__wsearchenv(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* env, MSVCRT_wchar_t *buf) +{ + MSVCRT__wsearchenv_s(file, env, buf, MAX_PATH); +}
1
0
0
0
Piotr Caban : msvcrt: Add support for quoted paths in _wsearchenv_s.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: 99c683af96bc5a098b1c1478d33b6971db4ed6e5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=99c683af96bc5a098b1c1478…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jan 29 13:42:19 2020 +0100 msvcrt: Add support for quoted paths in _wsearchenv_s. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit f05549b7f71740362ae5ef6dc8d5e846f8c41f0b) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcrt/dir.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index 83aff8bcb5..5bd8fb1b15 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -1833,12 +1833,27 @@ int CDECL MSVCRT__wsearchenv_s(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* for(; *penv; penv = (*end ? end + 1 : end)) { end = penv; - while(*end && *end != ';') end++; /* Find end of next path */ - path_len = end - penv; + path_len = 0; + while(*end && *end != ';' && path_len < MAX_PATH) + { + if (*end == '"') + { + end++; + while(*end && *end != '"' && path_len < MAX_PATH) + { + path[path_len++] = *end; + end++; + } + if (*end == '"') end++; + continue; + } + + path[path_len++] = *end; + end++; + } if (!path_len || path_len >= MAX_PATH) continue; - memcpy(path, penv, path_len * sizeof(MSVCRT_wchar_t)); if (path[path_len - 1] != '/' && path[path_len - 1] != '\\') path[path_len++] = '\\'; if (path_len + fname_len >= MAX_PATH)
1
0
0
0
Piotr Caban : msvcrt: Don't duplicate _searchenv_s code in _searchenv.
by Alexandre Julliard
02 Jun '20
02 Jun '20
Module: wine Branch: stable Commit: ea66b05c2b2a5c51f274360aa241779b2f0ce56f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea66b05c2b2a5c51f274360a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jan 29 13:42:15 2020 +0100 msvcrt: Don't duplicate _searchenv_s code in _searchenv. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 98c554ac0617c642bc4481e6f56e0d66adec660a) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcrt/dir.c | 90 +++++-------------------------------------------------- 1 file changed, 8 insertions(+), 82 deletions(-) diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index 806a2b0c85..83aff8bcb5 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -1640,88 +1640,6 @@ range: return MSVCRT_ERANGE; } -/********************************************************************* - * _searchenv (MSVCRT.@) - * - * Search for a file in a list of paths from an environment variable. - * - * PARAMS - * file [I] Name of the file to search for. - * env [I] Name of the environment variable containing a list of paths. - * buf [O] Destination for the found file path. - * - * RETURNS - * Nothing. If the file is not found, buf will contain an empty string - * and errno is set. - */ -void CDECL MSVCRT__searchenv(const char* file, const char* env, char *buf) -{ - char*envVal, *penv, *end; - char path[MAX_PATH]; - MSVCRT_size_t path_len, fname_len = strlen(file); - - *buf = '\0'; - - /* Try CWD first */ - if (GetFileAttributesA( file ) != INVALID_FILE_ATTRIBUTES) - { - GetFullPathNameA( file, MAX_PATH, buf, NULL ); - return; - } - - /* Search given environment variable */ - envVal = MSVCRT_getenv(env); - if (!envVal) - { - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; - } - - penv = envVal; - TRACE(":searching for %s in paths %s\n", file, envVal); - - for(; *penv; penv = (*end ? end + 1 : end)) - { - end = penv; - path_len = 0; - while(*end && *end != ';' && path_len < MAX_PATH) - { - if (*end == '"') - { - end++; - while(*end && *end != '"' && path_len < MAX_PATH) - { - path[path_len++] = *end; - end++; - } - if (*end == '"') end++; - continue; - } - - path[path_len++] = *end; - end++; - } - if (!path_len || path_len >= MAX_PATH) - continue; - - if (path[path_len - 1] != '/' && path[path_len - 1] != '\\') - path[path_len++] = '\\'; - if (path_len + fname_len >= MAX_PATH) - continue; - - memcpy(path + path_len, file, fname_len + 1); - TRACE("Checking for file %s\n", path); - if (GetFileAttributesA( path ) != INVALID_FILE_ATTRIBUTES) - { - memcpy(buf, path, path_len + fname_len + 1); - return; - } - } - - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; -} - /********************************************************************* * _searchenv_s (MSVCRT.@) */ @@ -1807,6 +1725,14 @@ int CDECL MSVCRT__searchenv_s(const char* file, const char* env, char *buf, MSVC return MSVCRT_ENOENT; } +/********************************************************************* + * _searchenv (MSVCRT.@) + */ +void CDECL MSVCRT__searchenv(const char* file, const char* env, char *buf) +{ + MSVCRT__searchenv_s(file, env, buf, MAX_PATH); +} + /********************************************************************* * _wsearchenv (MSVCRT.@) *
1
0
0
0
← Newer
1
...
85
86
87
88
89
90
91
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200