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
2025
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2005
----- 2025 -----
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
814 discussions
Start a n
N
ew thread
[ion] 15540: Create new headers branch
by ion@svn.reactos.com
Create new headers branch Added: branches/new_headers/ _____ Copied: branches/new_headers (from rev 15539, trunk)
19 years, 11 months
1
0
0
0
[ion] 15539: Starting over properly like Casper recommended
by ion@svn.reactos.com
Starting over properly like Casper recommended Deleted: branches/new_headers/
19 years, 11 months
1
0
0
0
[greatlrd] 15538: partially implemented fullscreen in changedisplay setting
by greatlrd@svn.reactos.com
partially implemented fullscreen in changedisplay setting I can play winquake in fullscreen now :) Modified: trunk/reactos/subsys/win32k/objects/dc.c _____ Modified: trunk/reactos/subsys/win32k/objects/dc.c --- trunk/reactos/subsys/win32k/objects/dc.c 2005-05-26 21:55:34 UTC (rev 15537) +++ trunk/reactos/subsys/win32k/objects/dc.c 2005-05-26 22:41:31 UTC (rev 15538) @@ -2507,6 +2507,7 @@ BOOLEAN Reset = FALSE; BOOLEAN SetPrimary = FALSE; LONG Ret; + NTSTATUS Status; DPRINT1("display flag : %x\n",dwflags); @@ -2545,10 +2546,29 @@ if ((dwflags & CDS_FULLSCREEN) == CDS_FULLSCREEN) { + DEVMODE lpDevMode; /* Full Screen */ dwflags &= ~CDS_FULLSCREEN; - DPRINT1("flag CDS_FULLSCREEN UNIMPLEMENT"); + DPRINT1("flag CDS_FULLSCREEN partially implemented"); Ret = DISP_CHANGE_FAILED; + + lpDevMode.dmBitsPerPel =0; + lpDevMode.dmPelsWidth =0; + lpDevMode.dmPelsHeight =0; + lpDevMode.dmDriverExtra =0; + + lpDevMode.dmSize = sizeof(DEVMODE); + Status = IntEnumDisplaySettings(pDeviceName, ENUM_CURRENT_SETTINGS, &lpDevMode, 0); + if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; + + DPRINT1("Req Mode : %d x %d x %d\n", DevMode->dmPelsWidth,DevMode->dmPelsHeight,DevMode->dmBitsPerPel); + DPRINT1("Current Mode : %d x %d x %d\n", lpDevMode.dmPelsWidth,lpDevMode.dmPelsHeight, lpDevMode.dmBitsPerPel); + + + if ((lpDevMode.dmBitsPerPel == DevMode->dmBitsPerPel) && + (lpDevMode.dmPelsWidth == DevMode->dmPelsWidth) && + (lpDevMode.dmPelsHeight == DevMode->dmPelsHeight)) + Ret = DISP_CHANGE_SUCCESSFUL; } if ((dwflags & CDS_VIDEOPARAMETERS) == CDS_VIDEOPARAMETERS) @@ -2571,8 +2591,7 @@ WCHAR KernelModeNameBuffer[256]; UNICODE_STRING RegistryKey; WCHAR RegistryKeyBuffer[512]; - PDEVICE_OBJECT DeviceObject; - NTSTATUS Status; + PDEVICE_OBJECT DeviceObject; ULONG LastSlash; OBJECT_ATTRIBUTES ObjectAttributes; HANDLE DevInstRegKey;
19 years, 11 months
1
0
0
0
[gvg] 15537: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexander Julliard <julliard(a)winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Aric Stewart <aric(a)codeweavers.com> - Fix a few leaking object handles. - Correct user component publication. - Implement MsiEnumComponentQualifiers. - Implement Publish Components in order for MsiGetQualifiedComponent apis to work. Also implement MsiGetQualifiedComponent, or at least some of the functionality as it is supposed to install stuff if it is absent, which it does not do yet. - Correct query quoting based on Mike's patch. Also more error messages about return codes from custom actions and ignore an error that we should be ignoring. - Double terminate SZ_MULTI properly. - ClassInfo and ExtensionInfo are also written for ADVERTISED components. - Write the RegOwner and RegCompany keys as blank if they do not exist when doing the RegisterUser action. - Fix quoting on queries. - Respect '+' and '*' in WriteRegistryValues to only create the key if it does not already exist. Prevents overwriting values with NULL. - We cannot internally load the files in FileCost because that action may be skipped or not called. So do it in CostInitialize. - Quote the file path in SelfRegModules. - Do not write squished null guids to the feature registration. - Correctly use short filenames from uncompressed file sources. Also default feature and component install states to ABSENT instead of UNKNOWN. - Correct a problem with parse_data if binary data was not in full bytes. - More properly handle uncompressed file sources, fix the creating and parsing of Source Directories. - ExecuteAction runs the whole Execute table and not just from InstallValidate onward. To do this make sure we do not do the costing initialization work again if it is already done (by checking the CostingComplete Property). - A lot of work to refine feature states, setting the state affects the state of all child features and also respect features that want to default to something other than LOCAL. - Fix a few leaking object handles. - Correct user component publication. - Implement MsiEnumComponentQualifiers. - We have a stub for MsiGetUserInfoA we should use it. - A few small fixes. - Add a missing msiobj_release that was resulting in a leaked object with each MsiCreateRecord call. - Fix a leaking handle. - Make MsiCollectUserInfo more internally consistent. Thanks to Mike McCormack. - Fix a leaking handle in MsiConfigureProductExW. - Implement MsiGetProductCodeW. - Implement MsiGetUserInfoW. - Implement MsiCollectUserInfoA/W. - Implement MsiQueryFeatureStateW. - Correct a leaking hkey handle. - Expand some handling of special properties in MsiGetProductInfo. - Fix for the return codes for the Qualified component calls. They are not INSTALLSTATEs but rather success values. - Quoting fixes. Mike McCormack <mike(a)codeweavers.com> - Make sure that dialogs are only created and destroyed in a single thread. - Track memory allocations in the SQL parser. - Create the ORDER BY view in a single call. - Simplify parsing of the FROM keyword. - Improve parser error checking. - Simplify parsing of select query. - remove the unused utf8 field of an expression - make the parse result a single assignment at top level of parsing - abort parsing on a memory allocation failure - Only tables can be backquoted, strings must be single quoted. - Declare MsiExportDatabase* in the spec file, and fix a typo. - make sure to free the string table when closing the database - don't free szPersist in MsiOpenDatabase if it's not a string - Avoid some non-standard str functions. Francois Gouget <fgouget(a)free.fr> - Tweak the documentation to make winapi_check happy. Juan Lang <juan_lang(a)yahoo.com> - Don't fail in RegisterFonts if the Fonts table is missing. - Partially implement AppSearch for RegLocator-type searches. - Turn handled errors from ERRs to WARNs or TRACEs. Vincent Beron <vberon(a)mecano.gme.usherb.ca> - Use SUBLANG_NEUTRAL for French resources. Stefan Leichter <Stefan.Leichter(a)camLine.com> - Update version resource of msi.dll to current version shipped from windows update. - Added minimal implementation of MsiCreateAndVerifyInstallerDirectory. Marcus Meissner <marcus(a)jet.franken.de> - Set PhysicalMemory property from system data. Modified: trunk/reactos/include/wine/msidefs.h Modified: trunk/reactos/lib/msi/Makefile.in Modified: trunk/reactos/lib/msi/action.c Modified: trunk/reactos/lib/msi/action.h Modified: trunk/reactos/lib/msi/appsearch.c Modified: trunk/reactos/lib/msi/cond.tab.c Modified: trunk/reactos/lib/msi/cond.y Modified: trunk/reactos/lib/msi/create.c Modified: trunk/reactos/lib/msi/custom.c Modified: trunk/reactos/lib/msi/database.c Modified: trunk/reactos/lib/msi/dialog.c Modified: trunk/reactos/lib/msi/insert.c Modified: trunk/reactos/lib/msi/msi.c Modified: trunk/reactos/lib/msi/msi.spec Modified: trunk/reactos/lib/msi/msi_Fr.rc Modified: trunk/reactos/lib/msi/msipriv.h Modified: trunk/reactos/lib/msi/msiquery.c Modified: trunk/reactos/lib/msi/order.c Modified: trunk/reactos/lib/msi/package.c Modified: trunk/reactos/lib/msi/query.h Modified: trunk/reactos/lib/msi/record.c Modified: trunk/reactos/lib/msi/registry.c Modified: trunk/reactos/lib/msi/sql.tab.c Modified: trunk/reactos/lib/msi/sql.y Modified: trunk/reactos/lib/msi/suminfo.c Modified: trunk/reactos/lib/msi/table.c Modified: trunk/reactos/lib/msi/tokenize.c Modified: trunk/reactos/lib/msi/update.c Modified: trunk/reactos/lib/msi/version.rc Modified: trunk/reactos/lib/msi/where.c _____ Modified: trunk/reactos/include/wine/msidefs.h --- trunk/reactos/include/wine/msidefs.h 2005-05-26 21:15:58 UTC (rev 15536) +++ trunk/reactos/include/wine/msidefs.h 2005-05-26 21:55:34 UTC (rev 15537) @@ -23,6 +23,17 @@ extern "C" { #endif +enum msidbFileAttributes { + msidbFileAttributesReadOnly = 0x00000001, + msidbFileAttributesHidden = 0x00000002, + msidbFileAttributesSystem = 0x00000004, + msidbFileAttributesVital = 0x00000200, + msidbFileAttributesChecksum = 0x00000400, + msidbFileAttributesPatchAdded = 0x00001000, + msidbFileAttributesNoncompressed = 0x00002000, + msidbFileAttributesCompressed = 0x00004000 +}; + enum msidbDialogAttributes { msidbDialogAttributesVisible = 0x00000001, msidbDialogAttributesModal = 0x00000002, @@ -103,6 +114,22 @@ msidbComponentAttributes64bit = 0x00000100 }; +enum msidbRegistryRoot +{ + msidbRegistryRootClassesRoot = 0, + msidbRegistryRootCurrentUser = 1, + msidbRegistryRootLocalMachine = 2, + msidbRegistryRootUsers = 3, +}; + +enum msidbLocatorType +{ + msidbLocatorTypeDirectory = 0x000, + msidbLocatorTypeFileName = 0x001, + msidbLocatorTypeRawValue = 0x002, + msidbLocatorType64bit = 0x010, +}; + /* * Windows SDK braindamage alert * _____ Modified: trunk/reactos/lib/msi/Makefile.in --- trunk/reactos/lib/msi/Makefile.in 2005-05-26 21:15:58 UTC (rev 15536) +++ trunk/reactos/lib/msi/Makefile.in 2005-05-26 21:55:34 UTC (rev 15537) @@ -3,6 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = msi.dll +IMPORTLIB = libmsi.$(IMPLIBEXT) IMPORTS = shell32 cabinet oleaut32 ole32 version user32 gdi32 advapi32 kernel32 EXTRALIBS = -luuid $(LIBUNICODE) _____ Modified: trunk/reactos/lib/msi/action.c --- trunk/reactos/lib/msi/action.c 2005-05-26 21:15:58 UTC (rev 15536) +++ trunk/reactos/lib/msi/action.c 2005-05-26 21:55:34 UTC (rev 15537) @@ -99,6 +99,7 @@ static UINT ACTION_ResolveSource(MSIPACKAGE *package); static UINT ACTION_ExecuteAction(MSIPACKAGE *package); static UINT ACTION_RegisterFonts(MSIPACKAGE *package); +static UINT ACTION_PublishComponents(MSIPACKAGE *package); /* @@ -324,7 +325,7 @@ { szInstallServices, NULL}, { szPatchFiles, NULL}, { szProcessComponents, ACTION_ProcessComponents }, - { szPublishComponents, NULL}, + { szPublishComponents, ACTION_PublishComponents }, { szPublishFeatures, ACTION_PublishFeatures }, { szPublishProduct, ACTION_PublishProduct }, { szRegisterClassInfo, ACTION_RegisterClassInfo }, @@ -380,6 +381,13 @@ memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR)); } +inline static void reduce_to_shortfilename(WCHAR* filename) +{ + LPWSTR p = strchrW(filename,'|'); + if (p) + *p = 0; +} + WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index) { UINT rc; @@ -598,6 +606,7 @@ { HeapFree(GetProcessHeap(),0,package->files[i].File); HeapFree(GetProcessHeap(),0,package->files[i].FileName); + HeapFree(GetProcessHeap(),0,package->files[i].ShortName); HeapFree(GetProcessHeap(),0,package->files[i].Version); HeapFree(GetProcessHeap(),0,package->files[i].Language); HeapFree(GetProcessHeap(),0,package->files[i].SourcePath); @@ -630,15 +639,16 @@ MSI_ProcessMessage(package, INSTALLMESSAGE_PROGRESS, row); msiobj_release(&row->hdr); - msi_dialog_check_messages(package->dialog, NULL); + msi_dialog_check_messages(NULL); } static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record) { static const WCHAR Query_t[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'A','c','t','i','o', 'n','T','e','x','t',' ','W','H','E','R','E',' ', - 'A','c','t','i','o','n',' ','=', ' ','\'','%','s','\'',0}; + '`','A','c','t','i','o', 'n','T','e','x','t','`',' ', + 'W','H','E','R','E',' ', '`','A','c','t','i','o','n','`',' ','=', + ' ','\'','%','s','\'',0}; WCHAR message[1024]; UINT rc; MSIQUERY * view; @@ -655,12 +665,14 @@ if (rc != ERROR_SUCCESS) { MSI_ViewClose(view); + msiobj_release(&view->hdr); return; } rc = MSI_ViewFetch(view,&row); if (rc != ERROR_SUCCESS) { MSI_ViewClose(view); + msiobj_release(&view->hdr); return; } @@ -705,8 +717,9 @@ {'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0}; static const WCHAR Query_t[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'A','c','t','i','o', 'n','T','e','x','t',' ','W','H','E','R','E', ' ', - 'A','c','t','i','o','n',' ','=', ' ','\'','%','s','\'',0}; + '`','A','c','t','i','o', 'n','T','e','x','t','`',' ', + 'W','H','E','R','E', ' ','`','A','c','t','i','o','n','`',' ','=', + ' ','\'','%','s','\'',0}; WCHAR message[1024]; WCHAR timet[0x100]; UINT rc; @@ -1005,14 +1018,14 @@ MSIRECORD * row = 0; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'I','n','s','t','a','l','l','E','x','e','c','u','t','e', - 'S','e','q','u','e','n','c','e',' ', 'W','H','E','R','E',' ', - 'S','e','q','u','e','n','c','e',' ', '=',' ','%','i',0}; + '`','I','n','s','t','a','l','l','E','x','e','c','u','t','e', + 'S','e','q','u','e','n','c','e','`',' ', 'W','H','E','R','E',' ', + '`','S','e','q','u','e','n','c','e','`',' ', '=',' ','%','i',0}; static const WCHAR UISeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e', - ' ', 'W','H','E','R','E',' ', 'S','e','q','u','e','n','c','e', + '`','I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e', + '`', ' ', 'W','H','E','R','E',' ','`','S','e','q','u','e','n','c','e','`', ' ', '=',' ','%','i',0}; if (UI) @@ -1090,18 +1103,19 @@ UINT rc; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', - 'I','n','s','t','a','l','l','E','x','e','c','u','t','e', - 'S','e','q','u','e','n','c','e',' ', 'W','H','E','R','E',' ', - 'S','e','q','u','e','n','c','e',' ', '>',' ','%','i',' ', + '`','I','n','s','t','a','l','l','E','x','e','c','u','t','e', + 'S','e','q','u','e','n','c','e','`',' ', 'W','H','E','R','E',' ', + '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','%','i',' ', 'O','R','D','E','R',' ', 'B','Y',' ', - 'S','e','q','u','e','n','c','e',0 }; + '`','S','e','q','u','e','n','c','e','`',0 }; MSIRECORD * row = 0; static const WCHAR IVQuery[] = - {'S','E','L','E','C','T',' ','S','e','q','u','e','n','c','e',' ', - 'F','R','O','M',' ','I','n','s','t','a','l','l', - 'E','x','e','c','u','t','e','S','e','q','u','e','n','c','e',' ', - 'W','H','E','R','E',' ','A','c','t','i','o','n',' ','=',' ','`', - 'I','n','s','t','a','l','l','V','a','l','i','d','a','t','e','`', 0}; + {'S','E','L','E','C','T',' ','`','S','e','q','u','e','n','c','e','`', + ' ', 'F','R','O','M',' ','`','I','n','s','t','a','l','l', + 'E','x','e','c','u','t','e','S','e','q','u','e','n','c','e','`',' ', + 'W','H','E','R','E',' ','`','A','c','t','i','o','n','`',' ','=', + ' ','\'', 'I','n','s','t','a','l','l', + 'V','a','l','i','d','a','t','e','\'', 0}; INT seq = 0; @@ -1225,10 +1239,12 @@ UINT rc; static const WCHAR ExecSeqQuery [] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e', - ' ','W','H','E','R','E',' ', 'S','e','q','u','e','n','c','e',' ', + '`','I','n','s','t','a','l','l', + 'U','I','S','e','q','u','e','n','c','e','`', + ' ','W','H','E','R','E',' ', + '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','0',' ','O','R','D','E','R',' ','B','Y',' ', - 'S','e','q','u','e','n','c','e',0}; + '`','S','e','q','u','e','n','c','e','`',0}; rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); @@ -1420,7 +1436,7 @@ if (!handled) handled = ACTION_HandleDialogBox(package, action, &rc); - msi_dialog_check_messages( package->dialog, NULL ); + msi_dialog_check_messages( NULL ); if (!handled) { @@ -1493,9 +1509,10 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package) { static const WCHAR ExecSeqQuery[] = - {'S','E','L','E','C','T',' ','D','i','r','e','c','t','o','r','y','_', + {'S','E','L','E','C','T',' ', + '`','D','i','r','e','c','t','o','r','y','_','`', ' ','F','R','O','M',' ', - 'C','r','e','a','t','e','F','o','l','d','e','r',0 }; + '`','C','r','e','a','t','e','F','o','l','d','e','r','`',0 }; UINT rc; MSIQUERY *view; MSIFOLDER *folder; @@ -1606,7 +1623,7 @@ sz = 96; MSI_RecordGetStringW(row,6,package->components[index].KeyPath,&sz); - package->components[index].Installed = INSTALLSTATE_UNKNOWN; + package->components[index].Installed = INSTALLSTATE_ABSENT; package->components[index].Action = INSTALLSTATE_UNKNOWN; package->components[index].ActionRequest = INSTALLSTATE_UNKNOWN; @@ -1620,14 +1637,18 @@ int index = package->loaded_features; DWORD sz; static const WCHAR Query1[] = - {'S','E','L','E','C','T',' ','C','o','m','p','o','n','e','n','t','_', - ' ','F','R','O','M',' ','F','e','a','t','u','r','e', - 'C','o','m','p','o','n','e','n','t','s',' ','W','H','E','R','E',' ', - 'F','e', 'a','t','u','r','e','_','=','\'','%','s','\'',0}; + {'S','E','L','E','C','T',' ', + '`','C','o','m','p','o','n','e','n','t','_','`', + ' ','F','R','O','M',' ','`','F','e','a','t','u','r','e', + 'C','o','m','p','o','n','e','n','t','s','`',' ', + 'W','H','E','R','E',' ', + '`','F','e', 'a','t','u','r','e','_','`',' ','=','\'','%','s','\'',0}; static const WCHAR Query2[] = {'S','E','L','E','C','T',' ','*',' ','F','R', 'O','M',' ', - 'C','o','m','p','o','n','e','n','t',' ','W','H','E','R','E',' ', - 'C','o','m','p','o','n','e','n','t','=','\'','%','s','\'',0}; + '`','C','o','m','p','o','n','e','n','t','`',' ', + 'W','H','E','R','E',' ', + '`','C','o','m','p','o','n','e','n','t','`',' ', + '=','\'','%','s','\'',0}; MSIQUERY * view; MSIQUERY * view2; MSIRECORD * row2; @@ -1673,7 +1694,7 @@ package->features[index].Attributes= MSI_RecordGetInteger(row,8); - package->features[index].Installed = INSTALLSTATE_UNKNOWN; + package->features[index].Installed = INSTALLSTATE_ABSENT; package->features[index].Action = INSTALLSTATE_UNKNOWN; package->features[index].ActionRequest = INSTALLSTATE_UNKNOWN; @@ -1712,6 +1733,7 @@ c_indx); package->features[index].Components[cnt] = c_indx; package->features[index].ComponentCount ++; + msiobj_release( &row2->hdr ); continue; } @@ -1751,61 +1773,6 @@ msiobj_release(&view->hdr); } -/* - * I am not doing any of the costing functionality yet. - * Mostly looking at doing the Component and Feature loading - * - * The native MSI does A LOT of modification to tables here. Mostly adding - * a lot of temporary columns to the Feature and Component tables. - * - * note: Native msi also tracks the short filename. But I am only going to - * track the long ones. Also looking at this directory table - * it appears that the directory table does not get the parents - * resolved base on property only based on their entries in the - * directory table. - */ -static UINT ACTION_CostInitialize(MSIPACKAGE *package) -{ - MSIQUERY * view; - MSIRECORD * row; - UINT rc; - static const WCHAR Query_all[] = - {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', - 'F','e','a','t','u','r','e',0}; - static const WCHAR szCosting[] = - {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0 }; - static const WCHAR szZero[] = { '0', 0 }; - - MSI_SetPropertyW(package, szCosting, szZero); - MSI_SetPropertyW(package, cszRootDrive , c_colon); - - rc = MSI_DatabaseOpenViewW(package->db,Query_all,&view); - if (rc != ERROR_SUCCESS) - return rc; - rc = MSI_ViewExecute(view,0); - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - msiobj_release(&view->hdr); - return rc; - } - while (1) - { - DWORD rc; - - rc = MSI_ViewFetch(view,&row); - if (rc != ERROR_SUCCESS) - break; - - load_feature(package,row); - msiobj_release(&row->hdr); - } - MSI_ViewClose(view); - msiobj_release(&view->hdr); - - return ERROR_SUCCESS; -} - static UINT load_file(MSIPACKAGE* package, MSIRECORD * row) { DWORD index = package->loaded_files; @@ -1838,8 +1805,10 @@ HeapFree(GetProcessHeap(), 0, buffer); package->files[index].FileName = load_dynamic_stringW(row,3); + reduce_to_longfilename(package->files[index].FileName); - reduce_to_longfilename(package->files[index].FileName); + package->files[index].ShortName = load_dynamic_stringW(row,3); + reduce_to_shortfilename(package->files[index].ShortName); package->files[index].FileSize = MSI_RecordGetInteger(row,4); package->files[index].Version = load_dynamic_stringW(row, 5); @@ -1855,15 +1824,15 @@ return ERROR_SUCCESS; } -static UINT ACTION_FileCost(MSIPACKAGE *package) +static UINT load_all_files(MSIPACKAGE *package) { MSIQUERY * view; MSIRECORD * row; UINT rc; static const WCHAR Query[] = {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', - 'F','i','l','e',' ', 'O','R','D','E','R',' ','B','Y',' ', - 'S','e','q','u','e','n','c','e', 0}; + '`','F','i','l','e','`',' ', 'O','R','D','E','R',' ','B','Y',' ', + '`','S','e','q','u','e','n','c','e','`', 0}; if (!package) return ERROR_INVALID_HANDLE; @@ -1897,16 +1866,88 @@ return ERROR_SUCCESS; } + +/* + * I am not doing any of the costing functionality yet. + * Mostly looking at doing the Component and Feature loading + * + * The native MSI does A LOT of modification to tables here. Mostly adding + * a lot of temporary columns to the Feature and Component tables. + * + * note: Native msi also tracks the short filename. But I am only going to + * track the long ones. Also looking at this directory table + * it appears that the directory table does not get the parents + * resolved base on property only based on their entries in the + * directory table. + */ +static UINT ACTION_CostInitialize(MSIPACKAGE *package) +{ + MSIQUERY * view; + MSIRECORD * row; + UINT rc; + static const WCHAR Query_all[] = + {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', + '`','F','e','a','t','u','r','e','`',0}; + static const WCHAR szCosting[] = + {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0 }; + static const WCHAR szZero[] = { '0', 0 }; + WCHAR buffer[3]; + DWORD sz = 3; + + MSI_GetPropertyW(package, szCosting, buffer, &sz); + if (buffer[0]=='1') + return ERROR_SUCCESS; + + MSI_SetPropertyW(package, szCosting, szZero); + MSI_SetPropertyW(package, cszRootDrive , c_colon); + + rc = MSI_DatabaseOpenViewW(package->db,Query_all,&view); + if (rc != ERROR_SUCCESS) + return rc; + rc = MSI_ViewExecute(view,0); + if (rc != ERROR_SUCCESS) + { + MSI_ViewClose(view); + msiobj_release(&view->hdr); + return rc; + } + while (1) + { + DWORD rc; + + rc = MSI_ViewFetch(view,&row); + if (rc != ERROR_SUCCESS) + break; + + load_feature(package,row); + msiobj_release(&row->hdr); + } + MSI_ViewClose(view); + msiobj_release(&view->hdr); + + load_all_files(package); + + return ERROR_SUCCESS; +} + +static UINT ACTION_FileCost(MSIPACKAGE *package) +{ + return ERROR_SUCCESS; +} + + static INT load_folder(MSIPACKAGE *package, const WCHAR* dir) { static const WCHAR Query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'D','i','r','e','c', 't','o','r','y',' ','W','H','E','R','E',' ','`', - 'D','i','r','e','c','t', 'o','r','y','`',' ','=',' ','`','%','s','`', + '`','D','i','r','e','c', 't','o','r','y','`',' ', + 'W','H','E','R','E',' ', '`', 'D','i','r','e','c','t', 'o','r','y','`', + ' ','=',' ','\'','%','s','\'', 0}; UINT rc; MSIQUERY * view; LPWSTR ptargetdir, targetdir, parent, srcdir; + LPWSTR shortname = NULL; MSIRECORD * row = 0; INT index = -1; DWORD i; @@ -1972,15 +2013,16 @@ /* for now only pick long filename versions */ if (strchrW(targetdir,'|')) { + shortname = targetdir; targetdir = strchrW(targetdir,'|'); *targetdir = 0; targetdir ++; } + /* for the sourcedir pick the short filename */ if (srcdir && strchrW(srcdir,'|')) { - srcdir= strchrW(srcdir,'|'); - *srcdir= 0; - srcdir ++; + LPWSTR p = strchrW(srcdir,'|'); + *p = 0; } /* now check for root dirs */ @@ -1999,9 +2041,12 @@ if (srcdir) package->folders[index].SourceDefault = strdupW(srcdir); + else if (shortname) + package->folders[index].SourceDefault = strdupW(shortname); else if (targetdir) package->folders[index].SourceDefault = strdupW(targetdir); HeapFree(GetProcessHeap(), 0, ptargetdir); + TRACE(" SourceDefault = %s\n",debugstr_w(package->folders[index].SourceDefault)); parent = load_dynamic_stringW(row,2); if (parent) @@ -2105,6 +2150,7 @@ else if (source && package->folders[i].ResolvedSource) { path = strdupW(package->folders[i].ResolvedSource); + TRACE(" (source)already resolved to %s\n",debugstr_w(path)); return path; } else if (!source && package->folders[i].Property) @@ -2136,6 +2182,7 @@ else { path = build_directory_name(3, p, package->folders[i].SourceDefault, NULL); + TRACE(" (source)resolved into %s\n",debugstr_w(path)); package->folders[i].ResolvedSource = strdupW(path); } HeapFree(GetProcessHeap(),0,p); @@ -2201,17 +2248,25 @@ { MSICOMPONENT* component = &package->components[feature->Components[i]]; + TRACE("MODIFYING(%i): Component %s (Installed %i, Action %i, Request %i)\n", + newstate, debugstr_w(component->Component), component->Installed, + component->Action, component->ActionRequest); + if (!component->Enabled) continue; else { if (newstate == INSTALLSTATE_LOCAL) + { component->ActionRequest = INSTALLSTATE_LOCAL; + component->Action = INSTALLSTATE_LOCAL; + } else { int j,k; component->ActionRequest = newstate; + component->Action = newstate; /*if any other feature wants is local we need to set it local*/ for (j = 0; @@ -2225,12 +2280,19 @@ { if (package->features[j].ActionRequest == INSTALLSTATE_LOCAL) + { + TRACE("Saved by %s\n", debugstr_w(package->features[j].Feature)); component->ActionRequest = INSTALLSTATE_LOCAL; + component->Action = INSTALLSTATE_LOCAL; + } break; } } } } + TRACE("Result (%i): Component %s (Installed %i, Action %i, Request %i)\n", + newstate, debugstr_w(component->Component), component->Installed, + component->Action, component->ActionRequest); } } @@ -2344,10 +2406,26 @@ BOOL feature_state = ((package->features[i].Level > 0) && (package->features[i].Level <= install_level)); - if (feature_state) + if ((feature_state) && + (package->features[i].Action == INSTALLSTATE_UNKNOWN)) { - package->features[i].ActionRequest = INSTALLSTATE_LOCAL; - package->features[i].Action = INSTALLSTATE_LOCAL; + if (package->features[i].Attributes & + msidbFeatureAttributesFavorSource) + { + package->features[i].ActionRequest = INSTALLSTATE_SOURCE; + package->features[i].Action = INSTALLSTATE_SOURCE; + } + else if (package->features[i].Attributes & + msidbFeatureAttributesFavorAdvertise) + { + package->features[i].ActionRequest =INSTALLSTATE_ADVERTISED; + package->features[i].Action =INSTALLSTATE_ADVERTISED; + } + else + { + package->features[i].ActionRequest = INSTALLSTATE_LOCAL; + package->features[i].Action = INSTALLSTATE_LOCAL; + } } } } @@ -2380,6 +2458,27 @@ component->Action = INSTALLSTATE_LOCAL; component->ActionRequest = INSTALLSTATE_LOCAL; } + else if (feature->ActionRequest == INSTALLSTATE_SOURCE) + { + if ((component->Action == INSTALLSTATE_UNKNOWN) || + (component->Action == INSTALLSTATE_ABSENT) || + (component->Action == INSTALLSTATE_ADVERTISED)) + + { + component->Action = INSTALLSTATE_SOURCE; + component->ActionRequest = INSTALLSTATE_SOURCE; + } + } + else if (feature->ActionRequest == INSTALLSTATE_ADVERTISED) + { + if ((component->Action == INSTALLSTATE_UNKNOWN) || + (component->Action == INSTALLSTATE_ABSENT)) + + { + component->Action = INSTALLSTATE_ADVERTISED; + component->ActionRequest = INSTALLSTATE_ADVERTISED; + } + } else if (feature->ActionRequest == INSTALLSTATE_ABSENT) { if (component->Action == INSTALLSTATE_UNKNOWN) @@ -2415,10 +2514,10 @@ { static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'D','i','r','e','c','t','o','r','y',0}; + '`','D','i','r','e','c','t','o','r','y','`',0}; static const WCHAR ConditionQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'C','o','n','d','i','t','i','o','n',0}; + '`','C','o','n','d','i','t','i','o','n','`',0}; static const WCHAR szCosting[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0 }; static const WCHAR szlevel[] = @@ -2428,7 +2527,13 @@ MSIQUERY * view; DWORD i; LPWSTR level; + DWORD sz = 3; + WCHAR buffer[3]; + MSI_GetPropertyW(package, szCosting, buffer, &sz); + if (buffer[0]=='1') + return ERROR_SUCCESS; + TRACE("Building Directory properties\n"); rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); @@ -2669,6 +2774,7 @@ if (the_file == INVALID_HANDLE_VALUE) { + ERR("Unable to create file %s\n",debugstr_w(source)); rc = ERROR_FUNCTION_FAILED; goto end; } @@ -2771,7 +2877,7 @@ LPWSTR tracknametmp; static const WCHAR tmpprefix[] = {'C','A','B','T','M','P','_',0}; - if (data->file_name && strcmp(data->file_name,pfdin->psz1)) + if (data->file_name && lstrcmpiA(data->file_name,pfdin->psz1)) return 0; file = cabinet_alloc((len+1)*sizeof(char)); @@ -2884,8 +2990,8 @@ return ret; } -static UINT ready_media_for_file(MSIPACKAGE *package, UINT sequence, - WCHAR* path, WCHAR* file) +static UINT ready_media_for_file(MSIPACKAGE *package, WCHAR* path, + MSIFILE* file) { UINT rc; MSIQUERY * view; @@ -2893,25 +2999,31 @@ static WCHAR source[MAX_PATH]; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', - 'M','e','d','i','a',' ','W','H','E','R','E',' ', - 'L','a','s','t','S','e','q','u','e','n','c','e',' ','>','=',' ','%', - 'i',' ','O','R','D','E','R',' ','B','Y',' ', - 'L','a','s','t','S','e','q','u','e','n','c','e',0}; + '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ', + '`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ','>','=', + ' ','%', 'i',' ','O','R','D','E','R',' ','B','Y',' ', + '`','L','a','s','t','S','e','q','u','e','n','c','e','`',0}; WCHAR Query[1024]; WCHAR cab[0x100]; DWORD sz=0x100; INT seq; static UINT last_sequence = 0; - if (sequence <= last_sequence) + if (file->Attributes & msidbFileAttributesNoncompressed) { - TRACE("Media already ready (%u, %u)\n",sequence,last_sequence); - /*extract_a_cabinet_file(package, source,path,file); */ + TRACE("Uncompressed File, no media to ready.\n"); return ERROR_SUCCESS; } - sprintfW(Query,ExecSeqQuery,sequence); + if (file->Sequence <= last_sequence) + { + TRACE("Media already ready (%u, %u)\n",file->Sequence,last_sequence); + /*extract_a_cabinet_file(package, source,path,file->File); */ + return ERROR_SUCCESS; + } + sprintfW(Query,ExecSeqQuery,file->Sequence); + rc = MSI_DatabaseOpenViewW(package->db, Query, &view); if (rc != ERROR_SUCCESS) return rc; @@ -3038,12 +3150,10 @@ if ((file->State == 1) || (file->State == 2)) { LPWSTR p; - INT len; MSICOMPONENT* comp = NULL; TRACE("Installing %s\n",debugstr_w(file->File)); - rc = ready_media_for_file(package,file->Sequence,path_to_source, - file->File); + rc = ready_media_for_file(package, path_to_source, file); /* * WARNING! * our file table could change here because a new temp file @@ -3068,12 +3178,19 @@ HeapFree(GetProcessHeap(),0,file->TargetPath); file->TargetPath = build_directory_name(2, p, file->FileName); + HeapFree(GetProcessHeap(),0,p); - len = strlenW(path_to_source) + strlenW(file->File) + 2; - file->SourcePath = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); - strcpyW(file->SourcePath, path_to_source); - strcatW(file->SourcePath, file->File); + if (file->Attributes & msidbFileAttributesNoncompressed) + { + p = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL); + file->SourcePath = build_directory_name(2, p, file->ShortName); + HeapFree(GetProcessHeap(),0,p); + } + else + file->SourcePath = build_directory_name(2, path_to_source, + file->File); + TRACE("file paths %s to %s\n",debugstr_w(file->SourcePath), debugstr_w(file->TargetPath)); @@ -3088,16 +3205,26 @@ msiobj_release( &uirow->hdr ); ui_progress(package,2,file->FileSize,0,0); - if (!MoveFileW(file->SourcePath,file->TargetPath)) + + if (file->Attributes & msidbFileAttributesNoncompressed) + rc = CopyFileW(file->SourcePath,file->TargetPath,FALSE); + else + rc = MoveFileW(file->SourcePath, file->TargetPath); + + if (!rc) { rc = GetLastError(); - ERR("Unable to move file (%s -> %s) (error %d)\n", + ERR("Unable to move/copy file (%s -> %s) (error %d)\n", debugstr_w(file->SourcePath), debugstr_w(file->TargetPath), rc); if (rc == ERROR_ALREADY_EXISTS && file->State == 2) { - CopyFileW(file->SourcePath,file->TargetPath,FALSE); - DeleteFileW(file->SourcePath); + if (!CopyFileW(file->SourcePath,file->TargetPath,FALSE)) + ERR("Unable to copy file (%s -> %s) (error %ld)\n", + debugstr_w(file->SourcePath), + debugstr_w(file->TargetPath), GetLastError()); + if (!(file->Attributes & msidbFileAttributesNoncompressed)) + DeleteFileW(file->SourcePath); rc = 0; } else if (rc == ERROR_FILE_NOT_FOUND) @@ -3105,14 +3232,17 @@ ERR("Source File Not Found! Continuing\n"); rc = 0; } - else + else if (file->Attributes & msidbFileAttributesVital) { - ERR("Ignoring Error and continuing...\n"); + ERR("Ignoring Error and continuing (nonvital file)...\n"); rc = 0; } } else + { file->State = 4; + rc = ERROR_SUCCESS; + } } } @@ -3151,7 +3281,7 @@ MSIRECORD * row = 0; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'D','u','p','l','i','c','a','t','e','F','i','l','e',0}; + '`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0}; if (!package) return ERROR_INVALID_HANDLE; @@ -3304,21 +3434,35 @@ { LPWSTR ptr; CHAR byte[5]; - LPWSTR deformated; + LPWSTR deformated = NULL; int count; deformat_string(package, &value[2], &deformated); /* binary value type */ - ptr = deformated; - *type=REG_BINARY; - *size = strlenW(ptr)/2; + ptr = deformated; + *type = REG_BINARY; + if (strlenW(ptr)%2) + *size = (strlenW(ptr)/2)+1; + else + *size = strlenW(ptr)/2; + data = HeapAlloc(GetProcessHeap(),0,*size); - + byte[0] = '0'; byte[1] = 'x'; byte[4] = 0; count = 0; + /* if uneven pad with a zero in front */ + if (strlenW(ptr)%2) + { + byte[2]= '0'; + byte[3]= *ptr; + ptr++; + data[count] = (BYTE)strtol(byte,NULL,0); + count ++; + TRACE("Uneven byte count\n"); + } while (*ptr) { byte[2]= *ptr; @@ -3395,7 +3539,7 @@ MSIRECORD * row = 0; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'R','e','g','i','s','t','r','y',0 }; + '`','R','e','g','i','s','t','r','y','`',0 }; if (!package) return ERROR_INVALID_HANDLE; @@ -3438,6 +3582,7 @@ MSIRECORD * uirow; LPWSTR uikey; INT root; + BOOL check_first = FALSE; rc = MSI_ViewFetch(view,&row); if (rc != ERROR_SUCCESS) @@ -3483,6 +3628,7 @@ { HeapFree(GetProcessHeap(),0,name); name = NULL; + check_first = TRUE; } } @@ -3545,9 +3691,33 @@ deformat_string(package, name, &deformated); - TRACE("Setting value %s\n",debugstr_w(deformated)); - RegSetValueExW(hkey, deformated, 0, type, value_data, size); + /* get the double nulls to terminate SZ_MULTI */ + if (type == REG_MULTI_SZ) + size +=sizeof(WCHAR); + if (!check_first) + { + TRACE("Setting value %s of %s\n",debugstr_w(deformated), + debugstr_w(uikey)); + RegSetValueExW(hkey, deformated, 0, type, value_data, size); + } + else + { + DWORD sz = 0; + rc = RegQueryValueExW(hkey, deformated, NULL, NULL, NULL, &sz); + if (rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) + { + TRACE("value %s of %s checked already exists\n", + debugstr_w(deformated), debugstr_w(uikey)); + } + else + { + TRACE("Checked and setting value %s of %s\n", + debugstr_w(deformated), debugstr_w(uikey)); + RegSetValueExW(hkey, deformated, 0, type, value_data, size); + } + } + uirow = MSI_CreateRecord(3); MSI_RecordSetStringW(uirow,2,deformated); MSI_RecordSetStringW(uirow,1,uikey); @@ -3589,7 +3759,7 @@ DWORD total = 0; static const WCHAR q1[]= {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', - 'R','e','g','i','s','t','r','y',0}; + '`','R','e','g','i','s','t','r','y','`',0}; UINT rc; MSIQUERY * view; MSIRECORD * row = 0; @@ -3629,6 +3799,14 @@ total += package->files[i].FileSize; ui_progress(package,0,total,0,0); + for(i = 0; i < package->loaded_features; i++) + { + MSIFEATURE* feature = &package->features[i]; + TRACE("Feature: %s; Installed: %i; Action %i; Request %i\n", + debugstr_w(feature->Feature), feature->Installed, feature->Action, + feature->ActionRequest); + } + return ERROR_SUCCESS; } @@ -3639,7 +3817,7 @@ MSIRECORD * row = 0; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'L','a','u','n','c','h','C','o','n','d','i','t','i','o','n',0}; + '`','L','a','u','n','c','h','C','o','n','d','i','t','i','o','n','`',0}; static const WCHAR title[]= {'I','n','s','t','a','l','l',' ','F','a', 'i','l','e','d',0}; @@ -3708,8 +3886,9 @@ LPWSTR key,deformated,buffer,name,deformated_name; static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - 'R','e','g','i','s','t','r','y',' ','W','H','E','R','E',' ', - 'R','e','g','i','s','t','r','y',' ','=',' ' ,'`','%','s','`',0 }; + '`','R','e','g','i','s','t','r','y','`',' ', + 'W','H','E','R','E',' ', '`','R','e','g','i','s','t','r','y','`', + ' ','=',' ' ,'\'','%','s','\'',0 }; static const WCHAR fmt[]={'%','0','2','i',':','\\','%','s','\\',0}; static const WCHAR fmt2[]= {'%','0','2','i',':','\\','%','s','\\','%','s',0}; @@ -3941,9 +4120,6 @@ MSIRECORD * uirow; squash_guid(package->components[i].ComponentId,squished_cc); - rc = RegCreateKeyW(hkey,squished_cc,&hkey2); - if (rc != ERROR_SUCCESS) - continue; keypath = resolve_keypath(package,i); package->components[i].FullKeypath = keypath; @@ -3951,8 +4127,9 @@ /* do the refcounting */ ACTION_RefCountComponent( package, i); - TRACE("Component %s, Keypath=%s, RefCount=%i\n", - debugstr_w(package->components[i].Component), + TRACE("Component %s (%s), Keypath=%s, RefCount=%i\n", + debugstr_w(package->components[i].Component), + debugstr_w(squished_cc), debugstr_w(package->components[i].FullKeypath), package->components[i].RefCount); /* @@ -3962,6 +4139,10 @@ if (ACTION_VerifyComponentForAction(package, i, INSTALLSTATE_LOCAL)) { + rc = RegCreateKeyW(hkey,squished_cc,&hkey2); + if (rc != ERROR_SUCCESS) + continue; + if (keypath) { RegSetValueExW(hkey2,squished_pc,0,REG_SZ,(LPVOID)keypath, @@ -3996,6 +4177,11 @@ INSTALLSTATE_ABSENT)) { DWORD res; + [truncated at 1000 lines; 12545 more skipped]
19 years, 11 months
1
0
0
0
[gvg] 15536: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexander Julliard <julliard(a)winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Modified: trunk/reactos/lib/msimg32/Makefile.in _____ Modified: trunk/reactos/lib/msimg32/Makefile.in --- trunk/reactos/lib/msimg32/Makefile.in 2005-05-26 21:09:49 UTC (rev 15535) +++ trunk/reactos/lib/msimg32/Makefile.in 2005-05-26 21:15:58 UTC (rev 15536) @@ -3,6 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = msimg32.dll +IMPORTLIB = libmsimg32.$(IMPLIBEXT) IMPORTS = gdi32 kernel32 C_SRCS = msimg32_main.c
19 years, 11 months
1
0
0
0
[gvg] 15535: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexander Julliard <julliard(a)winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Modified: trunk/reactos/lib/mpr/Makefile.in _____ Modified: trunk/reactos/lib/mpr/Makefile.in --- trunk/reactos/lib/mpr/Makefile.in 2005-05-26 21:07:55 UTC (rev 15534) +++ trunk/reactos/lib/mpr/Makefile.in 2005-05-26 21:09:49 UTC (rev 15535) @@ -3,6 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = mpr.dll +IMPORTLIB = libmpr.$(IMPLIBEXT) IMPORTS = user32 advapi32 kernel32 EXTRALIBS = $(LIBUNICODE)
19 years, 11 months
1
0
0
0
[gvg] 15534: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexander Julliard <julliard(a)winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Modified: trunk/reactos/lib/icmp/Makefile.in _____ Modified: trunk/reactos/lib/icmp/Makefile.in --- trunk/reactos/lib/icmp/Makefile.in 2005-05-26 21:06:20 UTC (rev 15533) +++ trunk/reactos/lib/icmp/Makefile.in 2005-05-26 21:07:55 UTC (rev 15534) @@ -3,6 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = icmp.dll +IMPORTLIB = libicmp.$(IMPLIBEXT) IMPORTS = kernel32 EXTRALIBS = @SOCKETLIBS@
19 years, 11 months
1
0
0
0
[gvg] 15533: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexander Julliard <julliard(a)winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Modified: trunk/reactos/lib/dinput8/Makefile.in _____ Modified: trunk/reactos/lib/dinput8/Makefile.in --- trunk/reactos/lib/dinput8/Makefile.in 2005-05-26 21:02:35 UTC (rev 15532) +++ trunk/reactos/lib/dinput8/Makefile.in 2005-05-26 21:06:20 UTC (rev 15533) @@ -3,6 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dinput8.dll +IMPORTLIB = libdinput8.$(IMPLIBEXT) IMPORTS = dinput EXTRALIBS = -luuid
19 years, 11 months
1
0
0
0
[gvg] 15532: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexandre Julliard <julliard(a)winehq.org> - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Don't convert the template name to Unicode, it's not used by the dialog anyway. Clear the window property on WM_DESTROY. Michael Jung <mjung(a)iss.tu-darmstadt.de> - Use IShellFolder::GetDisplayNameOf instead of SHGetPathFromIDList to be able to browse shell namespace extensions. Modified: trunk/reactos/lib/comdlg32/Makefile.in Modified: trunk/reactos/lib/comdlg32/commdlg.spec Modified: trunk/reactos/lib/comdlg32/filedlg.c Modified: trunk/reactos/lib/comdlg32/filedlgbrowser.c Modified: trunk/reactos/lib/comdlg32/fontdlg.c Deleted: trunk/reactos/lib/comdlg32/generic.c _____ Modified: trunk/reactos/lib/comdlg32/Makefile.in --- trunk/reactos/lib/comdlg32/Makefile.in 2005-05-26 20:52:12 UTC (rev 15531) +++ trunk/reactos/lib/comdlg32/Makefile.in 2005-05-26 21:02:35 UTC (rev 15532) @@ -3,6 +3,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = comdlg32.dll +IMPORTLIB = libcomdlg32.$(IMPLIBEXT) IMPORTS = shell32 shlwapi comctl32 winspool user32 gdi32 kernel32 ntdll EXTRALIBS = -luuid @@ -22,7 +23,6 @@ filedlg16.c \ finddlg.c \ fontdlg16.c \ - generic.c \ printdlg16.c SPEC_SRCS16 = commdlg.spec _____ Modified: trunk/reactos/lib/comdlg32/commdlg.spec --- trunk/reactos/lib/comdlg32/commdlg.spec 2005-05-26 20:52:12 UTC (rev 15531) +++ trunk/reactos/lib/comdlg32/commdlg.spec 2005-05-26 21:02:35 UTC (rev 15532) @@ -24,4 +24,3 @@ #29 pascal DWLBSUBCLASS exported, shared data #30 pascal DWUPARROWHACK exported, shared data #31 pascal DWOKSUBCLASS exported, shared data -32 pascal DllEntryPoint(long word word word long word) COMMDLG_DllEntryPoint _____ Modified: trunk/reactos/lib/comdlg32/filedlg.c --- trunk/reactos/lib/comdlg32/filedlg.c 2005-05-26 20:52:12 UTC (rev 15531) +++ trunk/reactos/lib/comdlg32/filedlg.c 2005-05-26 21:02:35 UTC (rev 15532) @@ -1835,7 +1835,13 @@ TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_w(lpszTemp), lpsf); - if(lstrlenW(lpwstrTemp)==2) PathAddBackslashW(lpwstrTemp); + /* append a backslash to drive letters */ + if(lstrlenW(lpwstrTemp)==2 && lpwstrTemp[1] == ':' && + ((lpwstrTemp[0] >= 'a' && lpwstrTemp[0] <= 'z') || + (lpwstrTemp[0] >= 'A' && lpwstrTemp[0] <= 'Z'))) + { + PathAddBackslashW(lpwstrTemp); + } dwAttributes = SFGAO_FOLDER; if(SUCCEEDED(IShellFolder_ParseDisplayName(lpsf, hwnd, NULL, lpwstrTemp, &dwEaten, &pidl, &dwAttributes))) _____ Modified: trunk/reactos/lib/comdlg32/filedlgbrowser.c --- trunk/reactos/lib/comdlg32/filedlgbrowser.c 2005-05-26 20:52:12 UTC (rev 15531) +++ trunk/reactos/lib/comdlg32/filedlgbrowser.c 2005-05-26 21:02:35 UTC (rev 15532) @@ -776,7 +776,8 @@ else { /* Tell the dialog that the user selected a file */ - hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L); + PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L); + hRes = S_OK; } /* Free memory used by pidl */ _____ Modified: trunk/reactos/lib/comdlg32/fontdlg.c --- trunk/reactos/lib/comdlg32/fontdlg.c 2005-05-26 20:52:12 UTC (rev 15531) +++ trunk/reactos/lib/comdlg32/fontdlg.c 2005-05-26 21:02:35 UTC (rev 15532) @@ -1024,18 +1024,15 @@ LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcfw) { LPCHOOSEFONTA lpcfa; - LPCSTR lpTemplateName; LPSTR lpszStyle; LPLOGFONTA lpLogFonta; int len; lpcfa = GetPropW(hwnd, strWineFontData_a); lpLogFonta = lpcfa->lpLogFont; - lpTemplateName = lpcfa->lpTemplateName; lpszStyle = lpcfa->lpszStyle; memcpy(lpcfa, lpcfw, sizeof(CHOOSEFONTA)); lpcfa->lpLogFont = lpLogFonta; - lpcfa->lpTemplateName = lpTemplateName; lpcfa->lpszStyle = lpszStyle; memcpy(lpcfa->lpLogFont, lpcfw->lpLogFont, sizeof(LOGFONTA)); WideCharToMultiByte(CP_ACP, 0, lpcfw->lpLogFont->lfFaceName, @@ -1047,9 +1044,9 @@ HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle); } - HeapFree(GetProcessHeap(), 0, (LPBYTE)lpcfw->lpTemplateName); HeapFree(GetProcessHeap(), 0, lpcfw->lpLogFont); HeapFree(GetProcessHeap(), 0, lpcfw); + SetPropW(hwnd, strWineFontData, 0); return TRUE; } @@ -1141,13 +1138,6 @@ MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, lpcfw->lpszStyle, len); } - if((lpcfa->Flags & CF_ENABLETEMPLATE) && lpcfa->lpTemplateName) { - len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, -1, NULL, 0); - lpcfw->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, - -1, (LPWSTR)lpcfw->lpTemplateName, len); - } - if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcfw)) { TRACE("CFn_WMInitDialog returned FALSE\n"); _____ Deleted: trunk/reactos/lib/comdlg32/generic.c --- trunk/reactos/lib/comdlg32/generic.c 2005-05-26 20:52:12 UTC (rev 15531) +++ trunk/reactos/lib/comdlg32/generic.c 2005-05-26 21:02:35 UTC (rev 15532) @@ -1,63 +0,0 @@ -/* - * COMMDLG/COMDLG32 functions - * - * Copyright 1994 Martin Ayotte - * Copyright 1996 Albrecht Kleine - * Copyright 1998,1999 Bertho Stultiens - * Copyright 1999 Klaas van Gend - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <stdarg.h> - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "commdlg.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(commdlg); - -#include "cdlg.h" -#include "cdlg16.h" - -/********************************************************************** * - * DllEntryPoint [COMMDLG.32] - * - * Initialization code for the COMMDLG DLL - * - * RETURNS: - */ -BOOL WINAPI COMMDLG_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2) -{ - TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2); - return TRUE; -} - - -/********************************************************************** * - * CommDlgExtendedError16 [COMMDLG.26] - * - * Get the last error value if a commdlg function fails. - * RETURNS - * Current error value which might not be valid - * if a previous call succeeded. - */ -DWORD WINAPI CommDlgExtendedError16(void) -{ - return CommDlgExtendedError(); -}
19 years, 11 months
1
0
0
0
[gvg] 15531: Sync to Wine-20050524:
by gvg@svn.reactos.com
Sync to Wine-20050524: Alexandre Julliard <julliard(a)winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Francois Gouget <fgouget(a)free.fr> - Assorted spelling fixes. Kouji Sasaki <taro-x(a)justsystem.co.jp> - Added handling of WM_ENABLE message. James Hawkins <truiken(a)gmail.com> - Audit the List-View control. - Select the item under the point (x,y) in MouseHover. - Store the click point in LISTVIEW_INFO. - Move mouse tracking to MouseMove. - Use DragDetect instead of TrackMouse. - Remove the unused TrackMouse function. - Fixed centering of tab text. Dimi Paun <dimi(a)lattica.com> - Do not compute the hit test if we don't really need it. - Make it more explicit how we deal with WS_DISABLED. Felix Nawothnig <felix.nawothnig(a)t-online.de> - Resize listview column to autofit on a doubleclick on the header-divider. - Implemented WM_ENABLE. - Rewrote item layouting - new code fixes bitmap/image position for non-left-aligned text, prevents jumping when resizing non-left-aligned text, implements clipping for images and correctly aligns bitmaps when an image is already there. - Set iItem to index before notifying callback items. Duane Clark <dclark(a)akamail.com> - Misc rectangle fixes. - The date should be initialized from local time. Aric Stewart <aric(a)codeweavers.com> - Handle WM_NCCALCSIZE in the tab control. Hans Leidekker <hans(a)it.vu.nl> - Fix uninitialized warnings. Modified: trunk/reactos/lib/comctl32/Makefile.in Modified: trunk/reactos/lib/comctl32/comboex.c Modified: trunk/reactos/lib/comctl32/comctl32undoc.c Modified: trunk/reactos/lib/comctl32/datetime.c Modified: trunk/reactos/lib/comctl32/header.c Modified: trunk/reactos/lib/comctl32/hotkey.c Modified: trunk/reactos/lib/comctl32/imagelist.c Modified: trunk/reactos/lib/comctl32/ipaddress.c Modified: trunk/reactos/lib/comctl32/listview.c Modified: trunk/reactos/lib/comctl32/monthcal.c Modified: trunk/reactos/lib/comctl32/tab.c Modified: trunk/reactos/lib/comctl32/toolbar.c Modified: trunk/reactos/lib/comctl32/updown.c _____ Modified: trunk/reactos/lib/comctl32/Makefile.in --- trunk/reactos/lib/comctl32/Makefile.in 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/Makefile.in 2005-05-26 20:52:12 UTC (rev 15531) @@ -4,6 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = comctl32.dll +IMPORTLIB = libcomctl32.$(IMPLIBEXT) IMPORTS = user32 gdi32 advapi32 kernel32 DELAYIMPORTS = winmm EXTRALIBS = $(LIBUNICODE) _____ Modified: trunk/reactos/lib/comctl32/comboex.c --- trunk/reactos/lib/comctl32/comboex.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/comboex.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -283,6 +283,26 @@ } +static INT COMBOEX_GetIndex(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) +{ + CBE_ITEMDATA *moving; + INT index; + + moving = infoPtr->items; + index = infoPtr->nb_items - 1; + + while (moving && (moving != item)) { + moving = moving->next; + index--; + } + if (!moving || (index < 0)) { + ERR("COMBOBOXEX item structures broken. Please report!\n"); + return -1; + } + return index; +} + + static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) { NMCOMBOBOXEXW nmce; @@ -295,6 +315,7 @@ ZeroMemory(&nmce, sizeof(nmce)); nmce.ceItem.mask = CBEIF_TEXT; nmce.ceItem.lParam = item->lParam; + nmce.ceItem.iItem = COMBOEX_GetIndex(infoPtr, item); COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce); if (is_textW(nmce.ceItem.pszText)) { @@ -1389,6 +1410,7 @@ ZeroMemory(&nmce, sizeof(nmce)); nmce.ceItem.mask = CBEIF_INDENT; nmce.ceItem.lParam = item->lParam; + nmce.ceItem.iItem = dis->itemID; COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce); if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iIndent = nmce.ceItem.iIndent; @@ -1453,6 +1475,7 @@ ZeroMemory(&nmce, sizeof(nmce)); nmce.ceItem.mask = (drawstate == ILD_NORMAL) ? CBEIF_IMAGE : CBEIF_SELECTEDIMAGE; nmce.ceItem.lParam = item->lParam; + nmce.ceItem.iItem = dis->itemID; COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce); if (drawstate == ILD_NORMAL) { if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iImage = nmce.ceItem.iImage; @@ -1468,6 +1491,7 @@ ZeroMemory(&nmce, sizeof(nmce)); nmce.ceItem.mask = CBEIF_OVERLAY; nmce.ceItem.lParam = item->lParam; + nmce.ceItem.iItem = dis->itemID; COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce); if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iOverlay = nmce.ceItem.iOverlay; _____ Modified: trunk/reactos/lib/comctl32/comctl32undoc.c --- trunk/reactos/lib/comctl32/comctl32undoc.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/comctl32undoc.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -588,7 +588,7 @@ if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 0, KEY_WRITE, &newkey))) { /* not present - what to do ??? */ - ERR("Can not open key, error=%d, attempting to create\n", + ERR("Could not open key, error=%d, attempting to create\n", err); if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 0, @@ -980,7 +980,7 @@ &newkey, &dwdisp))) { /* error - what to do ??? */ - ERR("(%lu %lu %lx %lx \"%s\" %p): Can not open key, error=%d\n", + ERR("(%lu %lu %lx %lx \"%s\" %p): Could not open key, error=%d\n", mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags, (DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey), mp->extview.lpfnCompare, err); _____ Modified: trunk/reactos/lib/comctl32/datetime.c --- trunk/reactos/lib/comctl32/datetime.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/datetime.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -607,7 +607,7 @@ RECT *checkbox = &infoPtr->checkbox; SIZE size; COLORREF oldTextColor; - SHORT fieldWidth; + SHORT fieldWidth = 0; /* draw control edge */ TRACE("\n"); _____ Modified: trunk/reactos/lib/comctl32/header.c --- trunk/reactos/lib/comctl32/header.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/header.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -163,7 +163,7 @@ HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_ITEM *phdi = &infoPtr->items[iItem]; RECT r; - INT oldBkMode; + INT oldBkMode, cxEdge = GetSystemMetrics(SM_CXEDGE); TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, infoPtr->bUnicode); @@ -188,6 +188,9 @@ else DrawEdge (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST); + r.left -= cxEdge; + r.right += cxEdge; + if (phdi->fmt & HDF_OWNERDRAW) { DRAWITEMSTRUCT dis; dis.CtlType = ODT_HEADER; @@ -206,149 +209,117 @@ SetBkMode(hdc, oldBkMode); } else { - UINT uTextJustify = DT_LEFT; + UINT rw, rh, /* width and height of r */ + *x = NULL, *w = NULL; /* x and width of the pic (bmp or img) which is part of cnt */ + /* cnt,txt,img,bmp */ + UINT cx, tx, ix, bx, + cw, tw, iw, bw; + BITMAP bmp; - if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_CENTER) - uTextJustify = DT_CENTER; - else if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_RIGHT) - uTextJustify = DT_RIGHT; + cw = tw = iw = bw = 0; + rw = r.right - r.left; + rh = r.bottom - r.top; - if ((phdi->fmt & HDF_BITMAP) && !(phdi->fmt & HDF_BITMAP_ON_RIGHT) && (phdi->hbm)) { - BITMAP bmp; - HDC hdcBitmap; - INT yD, yS, cx, cy, rx, ry; + if (phdi->fmt & HDF_STRING) { + RECT textRect; - GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp); + DrawTextW (hdc, phdi->pszText, -1, + &textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT); + cw = textRect.right - textRect.left + 2 * infoPtr->iMargin; + } - ry = r.bottom - r.top; - rx = r.right - r.left; - - if (ry >= bmp.bmHeight) { - cy = bmp.bmHeight; - yD = r.top + (ry - bmp.bmHeight) / 2; - yS = 0; - } - else { - cy = ry; - yD = r.top; - yS = (bmp.bmHeight - ry) / 2; - - } - - if (rx >= bmp.bmWidth + infoPtr->iMargin) { - cx = bmp.bmWidth; - } - else { - cx = rx - infoPtr->iMargin; - } - - hdcBitmap = CreateCompatibleDC (hdc); - SelectObject (hdcBitmap, phdi->hbm); - BitBlt (hdc, r.left + infoPtr->iMargin, yD, cx, cy, hdcBitmap, 0, yS, SRCCOPY); - DeleteDC (hdcBitmap); - - r.left += (bmp.bmWidth + infoPtr->iMargin); + if ((phdi->fmt & HDF_IMAGE) && (infoPtr->himl)) { + iw = infoPtr->himl->cx + 2 * infoPtr->iMargin; + x = &ix; + w = &iw; } - - if ((phdi->fmt & HDF_BITMAP) && (phdi->fmt & HDF_BITMAP_ON_RIGHT) && (phdi->hbm)) { - BITMAP bmp; - HDC hdcBitmap; - INT xD, yD, yS, cx, cy, rx, ry, tx; - RECT textRect; - + if ((phdi->fmt & HDF_BITMAP) && (phdi->hbm)) { GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp); - - textRect = r; - if (phdi->fmt & HDF_STRING) { - DrawTextW (hdc, phdi->pszText, -1, - &textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT); - tx = textRect.right - textRect.left; + bw = bmp.bmWidth + 2 * infoPtr->iMargin; + if (!iw) { + x = &bx; + w = &bw; } - else - tx = 0; - ry = r.bottom - r.top; - rx = r.right - r.left; + } - if (ry >= bmp.bmHeight) { - cy = bmp.bmHeight; - yD = r.top + (ry - bmp.bmHeight) / 2; - yS = 0; - } - else { - cy = ry; - yD = r.top; - yS = (bmp.bmHeight - ry) / 2; + if (bw || iw) + cw += *w; + /* align cx using the unclipped cw */ + if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_LEFT) + cx = r.left; + else if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_CENTER) + cx = r.left + rw / 2 - cw / 2; + else /* HDF_RIGHT */ + cx = r.right - cw; + + /* clip cx & cw */ + if (cx < r.left) + cx = r.left; + if (cx + cw > r.right) + cw = r.right - cx; + + tx = cx + infoPtr->iMargin; + /* since cw might have changed we have to recalculate tw */ + tw = cw - infoPtr->iMargin * 2; + + if (iw || bw) { + tw -= *w; + if (phdi->fmt & HDF_BITMAP_ON_RIGHT) { + /* put pic behind text */ + *x = cx + tw + infoPtr->iMargin * 3; + } else { + *x = cx + infoPtr->iMargin; + /* move text behind pic */ + tx += *w; } - - if (r.left + tx + bmp.bmWidth + 2*infoPtr->iMargin <= r.right) { - cx = bmp.bmWidth; - xD = r.left + tx + infoPtr->iMargin; - } - else { - if (rx >= bmp.bmWidth + infoPtr->iMargin ) { - cx = bmp.bmWidth; - xD = r.right - bmp.bmWidth - infoPtr->iMargin; - r.right = xD - infoPtr->iMargin; - } - else { - cx = rx - infoPtr->iMargin; - xD = r.left; - r.right = r.left; - } - } - - hdcBitmap = CreateCompatibleDC (hdc); - SelectObject (hdcBitmap, phdi->hbm); - BitBlt (hdc, xD, yD, cx, cy, hdcBitmap, 0, yS, SRCCOPY); - DeleteDC (hdcBitmap); } - if ((phdi->fmt & HDF_IMAGE) && !(phdi->fmt & HDF_BITMAP_ON_RIGHT) && (infoPtr->himl)) { - r.left += infoPtr->iMargin; - ImageList_DrawEx(infoPtr->himl, phdi->iImage, hdc, r.left, r.top + (r.bottom-r.top- infoPtr->himl->cy)/2, - infoPtr->himl->cx, r.bottom-r.top, CLR_DEFAULT, CLR_DEFAULT, 0); - r.left += infoPtr->himl->cx; + if (iw && bw) { + /* since we're done with the layout we can + now calculate the position of bmp which + has no influence on alignment and layout + because of img */ + if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_RIGHT) + bx = cx - bw + infoPtr->iMargin; + else + bx = cx + cw + infoPtr->iMargin; } - if ((phdi->fmt & HDF_IMAGE) && (phdi->fmt & HDF_BITMAP_ON_RIGHT) && (infoPtr->himl)) { - RECT textRect; - INT tx; + if (iw || bw) { + HDC hClipDC = GetDC(hwnd); + HRGN hClipRgn = CreateRectRgn(r.left, r.top, r.right, r.bottom); + SelectClipRgn(hClipDC, hClipRgn); + + if (bw) { + HDC hdcBitmap = CreateCompatibleDC (hClipDC); + SelectObject (hdcBitmap, phdi->hbm); + BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2, + bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY); + DeleteDC (hdcBitmap); + } - textRect = r; - if (phdi->fmt & HDF_STRING) { - DrawTextW (hdc, phdi->pszText, -1, - &textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT); - tx = textRect.right - textRect.left; - } - else - tx = 0; - - if (tx < (r.right-r.left - infoPtr->himl->cx - GetSystemMetrics(SM_CXEDGE))) - ImageList_DrawEx(infoPtr->himl, phdi->iImage, hdc, r.left + tx + 2*infoPtr->iMargin, - r.top + (r.bottom-r.top-infoPtr->himl->cy)/2, infoPtr->himl->cx, r.bottom-r.top, - CLR_DEFAULT, CLR_DEFAULT, 0); - else { - INT x = max(r.right - infoPtr->iMargin - infoPtr->himl->cx, r.left); - INT cx = min(infoPtr->himl->cx, r.right-r.left - GetSystemMetrics(SM_CXEDGE)); - ImageList_DrawEx(infoPtr->himl, phdi->iImage, hdc, x , - r.top + (r.bottom-r.top-infoPtr->himl->cy)/2, cx, r.bottom-r.top, - CLR_DEFAULT, CLR_DEFAULT, 0); - r.right -= infoPtr->himl->cx - infoPtr->iMargin; + if (iw) { + ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC, + ix, r.top + ((INT)rh - infoPtr->himl->cy) / 2, + infoPtr->himl->cx, infoPtr->himl->cy, CLR_DEFAULT, CLR_DEFAULT, 0); } - } - if (((phdi->fmt & HDF_STRING) + DeleteObject(hClipRgn); + DeleteDC(hClipDC); + } + + if (((phdi->fmt & HDF_STRING) || (!(phdi->fmt & (HDF_OWNERDRAW|HDF_STRING|HDF_BITMAP| HDF_BITMAP_ON_RIGHT|HDF_IMAGE)))) /* no explicit format specified? */ && (phdi->pszText)) { - oldBkMode = SetBkMode(hdc, TRANSPARENT); - r.left += infoPtr->iMargin; - r.right -= infoPtr->iMargin; + oldBkMode = SetBkMode(hdc, TRANSPARENT); SetTextColor (hdc, (bHotTrack) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT); + r.left = tx; + r.right = tx + tw; DrawTextW (hdc, phdi->pszText, -1, - &r, uTextJustify|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE); + &r, DT_LEFT|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE); if (oldBkMode != TRANSPARENT) SetBkMode(hdc, oldBkMode); } _____ Modified: trunk/reactos/lib/comctl32/hotkey.c --- trunk/reactos/lib/comctl32/hotkey.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/hotkey.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -54,7 +54,7 @@ BYTE CurrMod; INT CaretPos; DWORD ScanCode; - WCHAR strNone[15]; /* hope its long enough ... */ + WCHAR strNone[15]; /* hope it's long enough ... */ } HOTKEY_INFO; static const WCHAR HOTKEY_plussep[] = { ' ', '+', ' ' }; _____ Modified: trunk/reactos/lib/comctl32/imagelist.c --- trunk/reactos/lib/comctl32/imagelist.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/imagelist.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -98,7 +98,7 @@ * nothing * * NOTES - * This function can NOT be used to reduce the number of images. + * This function CANNOT be used to reduce the number of images. */ static void IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT cy) _____ Modified: trunk/reactos/lib/comctl32/ipaddress.c --- trunk/reactos/lib/comctl32/ipaddress.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/ipaddress.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -62,6 +62,7 @@ { HWND Self; HWND Notify; + BOOL Enabled; IPPART_INFO Part[4]; } IPADDRESS_INFO; @@ -127,12 +128,26 @@ static const WCHAR dotW[] = { '.', 0 }; RECT rect, rcPart; POINT pt; + COLORREF bgCol, fgCol; int i; TRACE("\n"); GetClientRect (infoPtr->Self, &rect); + + if (infoPtr->Enabled) { + bgCol = COLOR_WINDOW; + fgCol = COLOR_WINDOWTEXT; + } else { + bgCol = COLOR_3DFACE; + fgCol = COLOR_GRAYTEXT; + } + + FillRect (hdc, &rect, (HBRUSH) (bgCol+1)); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); + + SetBkColor (hdc, GetSysColor(bgCol)); + SetTextColor(hdc, GetSysColor(fgCol)); for (i = 0; i < 3; i++) { GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart); @@ -174,6 +189,7 @@ edit.bottom = rcClient.bottom - 2; infoPtr->Self = hwnd; + infoPtr->Enabled = FALSE; infoPtr->Notify = lpCreate->hwndParent; for (i = 0; i < 4; i++) { @@ -215,6 +231,20 @@ } +static LRESULT IPADDRESS_Enable (IPADDRESS_INFO *infoPtr, BOOL enabled) +{ + int i; + + infoPtr->Enabled = enabled; + + for (i = 0; i < 4; i++) + EnableWindow(infoPtr->Part[i].EditHwnd, enabled); + + InvalidateRgn(infoPtr->Self, NULL, FALSE); + return 0; +} + + static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc) { PAINTSTRUCT ps; @@ -517,6 +547,10 @@ case WM_DESTROY: return IPADDRESS_Destroy (infoPtr); + case WM_ENABLE: + return IPADDRESS_Enable (infoPtr, (BOOL)wParam); + break; + case WM_PAINT: return IPADDRESS_Paint (infoPtr, (HDC)wParam); _____ Modified: trunk/reactos/lib/comctl32/listview.c --- trunk/reactos/lib/comctl32/listview.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/listview.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -24,7 +24,7 @@ * NOTES * * This code was audited for completeness against the documented features - * of Comctl32.dll version 6.0 on Oct. 21, 2002, by Dimitrie O. Paun. + * of Comctl32.dll version 6.0 on May. 20, 2005, by James Hawkins. * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. @@ -32,6 +32,17 @@ * * TODO: * + * Default Message Processing + * -- EN_KILLFOCUS should be handled in WM_COMMAND + * -- WM_CREATE: create the icon and small icon image lists at this point only if + * the LVS_SHAREIMAGELISTS style is not specified. + * -- WM_ERASEBKGND: forward this message to the parent window if the bkgnd + * color is CLR_NONE. + * -- WM_WINDOWPOSCHANGED: arrange the list items if the current view is icon + * or small icon and the LVS_AUTOARRANGE style is specified. + * -- WM_TIMER + * -- WM_WININICHANGE + * * Features * -- Hot item handling, mouse hovering * -- Workareas support @@ -74,6 +85,8 @@ * -- LVS_NOLABELWRAP * -- LVS_NOSCROLL (see Q137520) * -- LVS_SORTASCENDING, LVS_SORTDESCENDING + * -- LVS_ALIGNTOP + * -- LVS_TYPESTYLEMASK * * Extended Styles * -- LVS_EX_BORDERSELECT @@ -99,6 +112,7 @@ * -- LVN_ODFINDITEM * -- LVN_SETDISPINFO * -- NM_HOVER + * -- LVN_BEGINRDRAG * * Messages: * -- LVM_CANCELEDITLABEL @@ -130,6 +144,20 @@ * -- LVM_SORTGROUPS * -- LVM_SORTITEMSEX * + * Macros: + * -- ListView_GetCheckSate, ListView_SetCheckState + * -- ListView_GetHoverTime, ListView_SetHoverTime + * -- ListView_GetISearchString + * -- ListView_GetNumberOfWorkAreas + * -- ListView_GetOrigin + * -- ListView_GetTextBkColor + * -- ListView_GetUnicodeFormat, ListView_SetUnicodeFormat + * -- ListView_GetWorkAreas, ListView_SetWorkAreas + * -- ListView_SortItemsEx + * + * Functions: + * -- LVGroupComparE + * * Known differences in message stream from native control (not known if * these differences cause problems): * LVM_INSERTITEM issues LVM_SETITEMSTATE and LVM_SETITEM in certain cases. @@ -225,6 +253,7 @@ HIMAGELIST himlState; BOOL bLButtonDown; BOOL bRButtonDown; + POINT ptClickPos; /* point where the user clicked */ BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */ INT nItemHeight; INT nItemWidth; @@ -394,6 +423,7 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL); static HWND CreateEditLabelT(LISTVIEW_INFO *, LPCWSTR, DWORD, INT, INT, INT, INT, BOOL); static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST); +static INT LISTVIEW_HitTest(LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL); /******** Text handling functions *************************************/ @@ -3143,7 +3173,23 @@ return bResult; } +static BOOL LISTVIEW_GetItemAtPt(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, POINT pt) +{ + LVHITTESTINFO lvHitTestInfo; + ZeroMemory(&lvHitTestInfo, sizeof(lvHitTestInfo)); + lvHitTestInfo.pt.x = pt.x; + lvHitTestInfo.pt.y = pt.y; + + LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE); + + lpLVItem->mask = LVIF_PARAM; + lpLVItem->iItem = lvHitTestInfo.iItem; + lpLVItem->iSubItem = 0; + + return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE); +} + /*** * DESCRIPTION: * Called when the mouse is being actively tracked and has hovered for a specified @@ -3164,10 +3210,18 @@ */ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, INT x, INT y) { - if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) - /* FIXME: select the item!!! */ - /*LISTVIEW_GetItemAtPt(infoPtr, pt)*/; + if (infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) + { + LVITEMW item; + POINT pt; + pt.x = x; + pt.y = y; + + if (LISTVIEW_GetItemAtPt(infoPtr, &item, pt)) + LISTVIEW_SetSelection(infoPtr, item.iItem); + } + return 0; } @@ -3185,8 +3239,25 @@ */ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y) { - TRACKMOUSEEVENT trackinfo; + TRACKMOUSEEVENT trackinfo; + if (infoPtr->bLButtonDown && DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos)) + { + LVHITTESTINFO lvHitTestInfo; + NMLISTVIEW nmlv; + + lvHitTestInfo.pt = infoPtr->ptClickPos; + LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); + + ZeroMemory(&nmlv, sizeof(nmlv)); + nmlv.iItem = lvHitTestInfo.iItem; + nmlv.ptAction = infoPtr->ptClickPos; + + notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv); + + return 0; + } + /* see if we are supposed to be tracking mouse hovering */ if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) { /* fill in the trackinfo struct */ @@ -7492,6 +7563,25 @@ /*** * DESCRIPTION: + * Enables the listview control. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * [I] bEnable : specifies whether to enable or disable the window + * + * RETURN: + * SUCCESS : TRUE + * FAILURE : FALSE + */ +static BOOL LISTVIEW_Enable(LISTVIEW_INFO *infoPtr, BOOL bEnable) +{ + if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED) + InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); + return TRUE; +} + +/*** + * DESCRIPTION: * Erases the background of the listview control. * * PARAMETER(S): @@ -7905,70 +7995,8 @@ return 0; } - /*** * DESCRIPTION: - * Track mouse/dragging - * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * [I] pt : mouse coordinate - * - * RETURN: - * Zero - */ -static LRESULT LISTVIEW_TrackMouse(LISTVIEW_INFO *infoPtr, POINT pt) -{ - INT cxDrag = GetSystemMetrics(SM_CXDRAG); - INT cyDrag = GetSystemMetrics(SM_CYDRAG); - RECT r; - MSG msg; - - TRACE("\n"); - - r.top = pt.y - cyDrag; - r.left = pt.x - cxDrag; - r.bottom = pt.y + cyDrag; - r.right = pt.x + cxDrag; - - SetCapture(infoPtr->hwndSelf); - - while (1) - { - if (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) - { - if (msg.message == WM_MOUSEMOVE) - { - pt.x = (short)LOWORD(msg.lParam); - pt.y = (short)HIWORD(msg.lParam); - if (PtInRect(&r, pt)) - continue; - else - { - ReleaseCapture(); - return 1; - } - } - else if (msg.message >= WM_LBUTTONDOWN && - msg.message <= WM_RBUTTONDBLCLK) - { - break; - } - - DispatchMessageW(&msg); - } - - if (GetCapture() != infoPtr->hwndSelf) - return 0; - } - - ReleaseCapture(); - return 0; -} - - -/*** - * DESCRIPTION: * Processes double click messages (left mouse button). * * PARAMETER(S): @@ -8027,8 +8055,9 @@ if (!infoPtr->bFocus) SetFocus(infoPtr->hwndSelf); - /* set left button down flag */ + /* set left button down flag and record the click position */ infoPtr->bLButtonDown = TRUE; + infoPtr->ptClickPos = pt; lvHitTestInfo.pt.x = x; lvHitTestInfo.pt.y = y; @@ -8051,20 +8080,7 @@ } return 0; } - if (LISTVIEW_TrackMouse(infoPtr, lvHitTestInfo.pt)) - { - NMLISTVIEW nmlv; - ZeroMemory(&nmlv, sizeof(nmlv)); - nmlv.iItem = nItem; - nmlv.ptAction.x = lvHitTestInfo.pt.x; - nmlv.ptAction.y = lvHitTestInfo.pt.y; - - notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv); - - return 0; - } - if (infoPtr->dwStyle & LVS_SINGLESEL) { if (LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED)) @@ -8292,6 +8308,11 @@ notify_listview(infoPtr, LVN_COLUMNCLICK, &nmlv); } break; + + case HDN_DIVIDERDBLCLICKW: + case HDN_DIVIDERDBLCLICKA: + LISTVIEW_SetColumnWidth(infoPtr, lpnmh->iItem, LVSCW_AUTOSIZE); + break; } return 0; @@ -8621,7 +8642,7 @@ { TRACE("infoPtr->bRedraw=%d, bRedraw=%d\n", infoPtr->bRedraw, bRedraw); - /* we can not use straight equality here because _any_ non-zero value is TRUE */ + /* we cannot use straight equality here because _any_ non-zero value is TRUE */ if ((infoPtr->bRedraw && bRedraw) || (!infoPtr->bRedraw && !bRedraw)) return 0; infoPtr->bRedraw = bRedraw; @@ -9194,6 +9215,9 @@ case WM_CREATE: return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam); + case WM_ENABLE: + return LISTVIEW_Enable(infoPtr, (BOOL)wParam); + case WM_ERASEBKGND: return LISTVIEW_EraseBkgnd(infoPtr, (HDC)wParam); _____ Modified: trunk/reactos/lib/comctl32/monthcal.c --- trunk/reactos/lib/comctl32/monthcal.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/monthcal.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -473,29 +473,23 @@ SetTextColor(hdc, infoPtr->titletxt); currentFont = SelectObject(hdc, infoPtr->hBoldFont); - /* titlemonth->left and right are set in MONTHCAL_UpdateSize */ - titlemonth->left = title->left; - titlemonth->right = title->right; - GetLocaleInfoW( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+infoPtr->currentMonth -1, buf1,countof(buf1)); wsprintfW(buf, fmt1W, buf1, infoPtr->currentYear); - if(IntersectRect(&rcTemp, &(ps->rcPaint), titlemonth)) + if(IntersectRect(&rcTemp, &(ps->rcPaint), title)) { - DrawTextW(hdc, buf, strlenW(buf), titlemonth, + DrawTextW(hdc, buf, strlenW(buf), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE); } - SelectObject(hdc, infoPtr->hFont); - /* titlemonth left/right contained rect for whole titletxt('June 1999') * MCM_HitTestInfo wants month & year rects, so prepare these now. *(no, we can't draw them separately; the whole text is centered) */ GetTextExtentPoint32W(hdc, buf, strlenW(buf), &size); - titlemonth->left = title->right / 2 - size.cx / 2; - titleyear->right = title->right / 2 + size.cx / 2; + titlemonth->left = title->right / 2 + title->left / 2 - size.cx / 2; + titleyear->right = title->right / 2 + title->left / 2 + size.cx / 2; GetTextExtentPoint32W(hdc, buf1, strlenW(buf1), &size); titlemonth->right = titlemonth->left + size.cx; titleyear->left = titlemonth->right; @@ -524,6 +518,7 @@ infoPtr->wdays.left = infoPtr->days.left = infoPtr->weeknums.right; /* draw day abbreviations */ + SelectObject(hdc, infoPtr->hFont); SetBkColor(hdc, infoPtr->monthbk); SetTextColor(hdc, infoPtr->trailingtxt); @@ -673,9 +668,9 @@ wsprintfW(buf, fmt2W, buf1, buf2); SelectObject(hdc, infoPtr->hBoldFont); + DrawTextW(hdc, buf, -1, &rtoday, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE); if(IntersectRect(&rcTemp, &(ps->rcPaint), &rtoday)) { - DrawTextW(hdc, buf, -1, &rtoday, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE); DrawTextW(hdc, buf, -1, &rtoday, DT_LEFT | DT_VCENTER | DT_SINGLELINE); } SelectObject(hdc, infoPtr->hFont); @@ -1424,18 +1419,19 @@ 0, WS_VISIBLE | WS_CHILD |UDS_SETBUDDYINT, infoPtr->titleyear.left+3,infoPtr->titlebtnnext.top, - infoPtr->titleyear.right-infoPtr->titleyear.left, + infoPtr->titleyear.right-infoPtr->titleyear.left+4, infoPtr->textHeight, infoPtr->hwndSelf, NULL, NULL, NULL); + SendMessageW( infoPtr->hWndYearEdit, WM_SETFONT, (WPARAM) infoPtr->hBoldFont, (LPARAM)TRUE); infoPtr->hWndYearUpDown=CreateWindowExW(0, UPDOWN_CLASSW, 0, WS_VISIBLE | WS_CHILD |UDS_SETBUDDYINT|UDS_NOTHOUSANDS|UDS_ARROWKEYS, - infoPtr->titleyear.right+6,infoPtr->titlebtnnext.top, - 20, + infoPtr->titleyear.right+7,infoPtr->titlebtnnext.top, + 18, infoPtr->textHeight, infoPtr->hwndSelf, NULL, @@ -1733,7 +1729,7 @@ xdiv = (dwStyle & MCS_WEEKNUMBERS) ? 8 : 7; - infoPtr->width_increment = size.cx * 2; + infoPtr->width_increment = size.cx * 2 + 4; infoPtr->height_increment = infoPtr->textHeight; left_offset = (rcClient.right - rcClient.left) - (infoPtr->width_increment * xdiv); @@ -1852,7 +1848,7 @@ /* initialize info structure */ /* FIXME: calculate systemtime ->> localtime(substract timezoneinfo) */ - GetSystemTime(&infoPtr->todaysDate); + GetLocalTime(&infoPtr->todaysDate); MONTHCAL_SetFirstDayOfWeek(infoPtr, (LPARAM)-1); infoPtr->currentMonth = infoPtr->todaysDate.wMonth; infoPtr->currentYear = infoPtr->todaysDate.wYear; _____ Modified: trunk/reactos/lib/comctl32/tab.c --- trunk/reactos/lib/comctl32/tab.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/tab.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -1727,12 +1727,12 @@ else drawRect->bottom-=center_offset_h; - center_offset_v = ((drawRect->right - drawRect->left) - ((rcText.bottom - rcText.top) + infoPtr->uVItemPadding)) / 2; + center_offset_v = ((drawRect->right - drawRect->left) - (rcText.bottom - rcText.top) + infoPtr->uVItemPadding) / 2; } else { drawRect->left += center_offset_h; - center_offset_v = ((drawRect->bottom - drawRect->top) - ((rcText.bottom - rcText.top) + infoPtr->uVItemPadding)) / 2; + center_offset_v = ((drawRect->bottom - drawRect->top) - (rcText.bottom - rcText.top) + infoPtr->uVItemPadding) / 2; } if (center_offset_v < 0) @@ -2961,9 +2961,16 @@ return 0; } +static LRESULT TAB_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + if (!wParam) + return 0; + return WVR_ALIGNTOP; +} + static inline LRESULT TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo) -{ +{ if (!infoPtr || cbInfo <= 0) return FALSE; @@ -3143,6 +3150,9 @@ case WM_NCHITTEST: return TAB_NCHitTest(infoPtr, lParam); + case WM_NCCALCSIZE: + return TAB_NCCalcSize(hwnd, wParam, lParam); + default: if (uMsg >= WM_USER && uMsg < WM_APP) WARN("unknown msg %04x wp=%08x lp=%08lx\n", _____ Modified: trunk/reactos/lib/comctl32/toolbar.c --- trunk/reactos/lib/comctl32/toolbar.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/toolbar.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -6233,7 +6233,7 @@ * forgets to specify TBSTYLE_TRANSPARENT but does specify either * CCS_TOP or CCS_BOTTOM (_NOMOVEY and _TOP), then the control * does *not* set TBSTYLE_TRANSPARENT even though it should!!!! - * Some how, the only cases of this seem to be MFC programs. + * Somehow, the only cases of this seem to be MFC programs. * * Note also that the addition of _TRANSPARENT occurs *only* here. It * does not occur in the WM_STYLECHANGING routine. _____ Modified: trunk/reactos/lib/comctl32/updown.c --- trunk/reactos/lib/comctl32/updown.c 2005-05-26 20:39:17 UTC (rev 15530) +++ trunk/reactos/lib/comctl32/updown.c 2005-05-26 20:52:12 UTC (rev 15531) @@ -775,9 +775,12 @@ break; case WM_ENABLE: - infoPtr->dwStyle &= ~WS_DISABLED; - infoPtr->dwStyle |= (wParam ? 0 : WS_DISABLED); - if (infoPtr->dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr); + if (wParam) { + infoPtr->dwStyle &= ~WS_DISABLED; + } else { + infoPtr->dwStyle |= WS_DISABLED; + UPDOWN_CancelMode (infoPtr); + } InvalidateRect (infoPtr->Self, NULL, FALSE); break;
19 years, 11 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
82
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
Results per page:
10
25
50
100
200