ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
654 discussions
Start a n
N
ew thread
[fireball] 42876: - Create an XLATE for a mouse pointer. - Silence a dprint in RosGdiGetDIBits. - A step to fix an old issue nr. 20 from Arwinss wiki: "Fix mouse cursor being black problem"
by fireball@svn.reactos.org
Author: fireball Date: Sun Aug 23 11:55:10 2009 New Revision: 42876 URL:
http://svn.reactos.org/svn/reactos?rev=42876&view=rev
Log: - Create an XLATE for a mouse pointer. - Silence a dprint in RosGdiGetDIBits. - A step to fix an old issue nr. 20 from Arwinss wiki: "Fix mouse cursor being black problem" Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] Sun Aug 23 11:55:10 2009 @@ -357,8 +357,8 @@ /* Create a mask surface */ if (psoMask) { - //EXLATEOBJ exlo; - PPALETTE ppal; + XLATEOBJ *xlo; + //PPALETTE ppal; hbmp = EngCreateBitmap(psoMask->sizlBitmap, lDelta, @@ -369,25 +369,31 @@ if(pgp->psurfMask) { - ppal = PALETTE_LockPalette(ppdev->DevInfo.hpalDefault); + //ppal = PALETTE_LockPalette(ppdev->DevInfo.hpalDefault); /*EXLATEOBJ_vInitialize(&exlo, &gpalMono, ppal, 0, RGB(0xff,0xff,0xff), RGB(0,0,0));*/ + xlo = IntEngCreateSrcMonoXlate(ppdev->DevInfo.hpalDefault, + RGB(0xff,0xff,0xff), + RGB(0,0,0) + ); rcl.bottom = psoMask->sizlBitmap.cy; + GreCopyBits(&pgp->psurfMask->SurfObj, psoMask, NULL, - NULL,//&exlo.xlo, + xlo, &rcl, (POINTL*)&rcl); //EXLATEOBJ_vCleanup(&exlo); - if (ppal) - PALETTE_UnlockPalette(ppal); + EngDeleteXlate(xlo); + //if (ppal) + // PALETTE_UnlockPalette(ppal); } } else Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/bitmap.c [iso-8859-1] Sun Aug 23 11:55:10 2009 @@ -209,7 +209,7 @@ /* Get a pointer to the DCs */ pDC = DC_Lock(physDev); - DPRINT1("RosGdiGetDIBits for bitmap %x (user handle %x), StartScan %d, ScanLines %d, height %d\n", + DPRINT("RosGdiGetDIBits for bitmap %x (user handle %x), StartScan %d, ScanLines %d, height %d\n", hBitmap, hUserBitmap, StartScan, ScanLines, dib->dsBm.bmHeight); /* Set the bits */
15 years, 4 months
1
0
0
0
[hpoussin] 42875: [freeldr] When creating a component, provide at the same time its configuration data
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Aug 23 10:34:20 2009 New Revision: 42875 URL:
http://svn.reactos.org/svn/reactos?rev=42875&view=rev
Log: [freeldr] When creating a component, provide at the same time its configuration data Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h [iso-8859-1] Sun Aug 23 10:34:20 2009 @@ -54,17 +54,10 @@ IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey ); - -VOID -NTAPI -FldrSetConfigurationData( - IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PCM_PARTIAL_RESOURCE_LIST ResourceList, - IN ULONG Size -); - /* PROTOTYPES ***************************************************************/ Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h [iso-8859-1] Sun Aug 23 10:34:20 2009 @@ -74,15 +74,9 @@ IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey -); - -VOID -NTAPI -FldrSetConfigurationData( - IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PCM_PARTIAL_RESOURCE_LIST ResourceList, - IN ULONG Size ); VOID Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h [iso-8859-1] Sun Aug 23 10:34:20 2009 @@ -54,17 +54,10 @@ IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey ); - -VOID -NTAPI -FldrSetConfigurationData( - IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PCM_PARTIAL_RESOURCE_LIST ResourceList, - IN ULONG Size -); - /* PROTOTYPES ***************************************************************/ Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h [iso-8859-1] Sun Aug 23 10:34:20 2009 @@ -53,17 +53,10 @@ IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey ); - -VOID -NTAPI -FldrSetConfigurationData( - IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PCM_PARTIAL_RESOURCE_LIST ResourceList, - IN ULONG Size -); - /* PROTOTYPES ***************************************************************/
15 years, 4 months
1
0
0
0
[hpoussin] 42874: Limit usage of KEY_ALL_ACCESS when opening registry keys
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Aug 23 10:29:23 2009 New Revision: 42874 URL:
http://svn.reactos.org/svn/reactos?rev=42874&view=rev
Log: Limit usage of KEY_ALL_ACCESS when opening registry keys Modified: trunk/reactos/base/setup/usetup/interface/devinst.c trunk/reactos/base/setup/usetup/mui.c trunk/reactos/base/setup/usetup/settings.c trunk/reactos/dll/win32/shell32/shellpath.c Modified: trunk/reactos/base/setup/usetup/interface/devinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
============================================================================== --- trunk/reactos/base/setup/usetup/interface/devinst.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/interface/devinst.c [iso-8859-1] Sun Aug 23 10:29:23 2009 @@ -311,7 +311,7 @@ hInf = *(HINF *)lpParameter; InitializeObjectAttributes(&ObjectAttributes, &EnumU, OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = NtOpenKey(&hEnum, 0, &ObjectAttributes); + Status = NtOpenKey(&hEnum, KEY_QUERY_VALUE, &ObjectAttributes); if (!NT_SUCCESS(Status)) { DPRINT1("NtOpenKey('%wZ') failed with status 0x%08lx\n", &EnumU, Status); Modified: trunk/reactos/base/setup/usetup/mui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/mui.c?re…
============================================================================== --- trunk/reactos/base/setup/usetup/mui.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/mui.c [iso-8859-1] Sun Aug 23 10:29:23 2009 @@ -235,7 +235,7 @@ NULL); Status = NtCreateKey(&KeyHandle, - KEY_ALL_ACCESS, + KEY_SET_VALUE, &ObjectAttributes, 0, NULL, @@ -326,7 +326,7 @@ NULL); Status = NtCreateKey(&KeyHandle, - KEY_ALL_ACCESS, + KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, @@ -358,7 +358,7 @@ NULL); Status = NtCreateKey(&KeyHandle, - KEY_ALL_ACCESS, + KEY_SET_VALUE, &ObjectAttributes, 0, NULL, @@ -379,7 +379,7 @@ NULL); Status = NtCreateKey(&SubKeyHandle, - KEY_ALL_ACCESS, + KEY_SET_VALUE, &ObjectAttributes, 0, NULL, Modified: trunk/reactos/base/setup/usetup/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings…
============================================================================== --- trunk/reactos/base/setup/usetup/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/settings.c [iso-8859-1] Sun Aug 23 10:29:23 2009 @@ -241,7 +241,7 @@ NULL); Status = NtOpenKey(&BusKey, - KEY_ALL_ACCESS, + KEY_ENUMERATE_SUB_KEYS, &ObjectAttributes); if (!NT_SUCCESS(Status)) { @@ -262,7 +262,7 @@ NULL); Status = NtOpenKey(&BusInstanceKey, - KEY_ALL_ACCESS, + KEY_ENUMERATE_SUB_KEYS, &ObjectAttributes); if (!NT_SUCCESS(Status)) { @@ -281,7 +281,7 @@ NULL); Status = NtOpenKey(&ControllerKey, - KEY_ALL_ACCESS, + KEY_ENUMERATE_SUB_KEYS, &ObjectAttributes); if (NT_SUCCESS(Status)) { @@ -300,7 +300,7 @@ NULL); Status = NtOpenKey(&ControllerInstanceKey, - KEY_ALL_ACCESS, + KEY_QUERY_VALUE, &ObjectAttributes); if (!NT_SUCCESS(Status)) { @@ -648,7 +648,7 @@ NULL); Status = NtOpenKey(&KeyHandle, - KEY_ALL_ACCESS, + KEY_SET_VALUE, &ObjectAttributes); if (!NT_SUCCESS(Status)) @@ -976,7 +976,7 @@ NULL); Status = NtOpenKey(&KeyHandle, - KEY_ALL_ACCESS, + KEY_SET_VALUE, &ObjectAttributes); if(!NT_SUCCESS(Status)) { Modified: trunk/reactos/dll/win32/shell32/shellpath.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellpat…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellpath.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellpath.c [iso-8859-1] Sun Aug 23 10:29:23 2009 @@ -947,14 +947,14 @@ pShellFolderPath = szSHFolders; } - if (RegCreateKeyExW(rootKey, pShellFolderPath, 0, NULL, 0, KEY_ALL_ACCESS, + if (RegCreateKeyExW(rootKey, pShellFolderPath, 0, NULL, 0, KEY_SET_VALUE, NULL, &shellFolderKey, &dwDisp)) { TRACE("Failed to create %s\n", debugstr_w(pShellFolderPath)); return E_FAIL; } if (RegCreateKeyExW(rootKey, pUserShellFolderPath, 0, NULL, 0, - KEY_ALL_ACCESS, NULL, &userShellFolderKey, &dwDisp)) + KEY_QUERY_VALUE, NULL, &userShellFolderKey, &dwDisp)) { TRACE("Failed to create %s\n", debugstr_w(pUserShellFolderPath));
15 years, 4 months
1
0
0
0
[hpoussin] 42873: [freeldr] When creating a component, provide at the same time its configuration data
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Aug 23 10:25:52 2009 New Revision: 42873 URL:
http://svn.reactos.org/svn/reactos?rev=42873&view=rev
Log: [freeldr] When creating a component, provide at the same time its configuration data Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -236,6 +236,72 @@ DPRINTM(DPRINT_HWDETECT, "MaxNodeSize %u NodeCount %u\n", NodeSize, NodeCount); DPRINTM(DPRINT_HWDETECT, "Estimated buffer size %u\n", NodeSize * NodeCount); + /* Set 'Configuration Data' value */ + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount); + PartialResourceList = MmHeapAlloc(Size); + if (PartialResourceList == NULL) + { + DPRINTM(DPRINT_HWDETECT, + "Failed to allocate resource descriptor\n"); + return; + } + memset(PartialResourceList, 0, Size); + + /* Initialize resource descriptor */ + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + PartialResourceList->PartialDescriptors[0].Type = + CmResourceTypeDeviceSpecific; + PartialResourceList->PartialDescriptors[0].ShareDisposition = + CmResourceShareUndetermined; + + Ptr = (char *)(((ULONG_PTR)&PartialResourceList->PartialDescriptors[0]) + + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); + + /* Set instalation check data */ + memcpy (Ptr, InstData, sizeof(CM_PNP_BIOS_INSTALLATION_CHECK)); + Ptr += sizeof(CM_PNP_BIOS_INSTALLATION_CHECK); + + /* Copy device nodes */ + FoundNodeCount = 0; + PnpBufferSize = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK); + for (i = 0; i < 0xFF; i++) + { + NodeNumber = (UCHAR)i; + + x = PnpBiosGetDeviceNode(&NodeNumber, (PVOID)DISKREADBUFFER); + if (x == 0) + { + DeviceNode = (PCM_PNP_BIOS_DEVICE_NODE)DISKREADBUFFER; + + DPRINTM(DPRINT_HWDETECT, + "Node: %u Size %u (0x%x)\n", + DeviceNode->Node, + DeviceNode->Size, + DeviceNode->Size); + + memcpy (Ptr, + DeviceNode, + DeviceNode->Size); + + Ptr += DeviceNode->Size; + PnpBufferSize += DeviceNode->Size; + + FoundNodeCount++; + if (FoundNodeCount >= NodeCount) + break; + } + } + + /* Set real data size */ + PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = + PnpBufferSize; + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSize; + + DPRINTM(DPRINT_HWDETECT, "Real buffer size: %u\n", PnpBufferSize); + DPRINTM(DPRINT_HWDETECT, "Resource size: %u\n", Size); + /* Create component key */ FldrCreateComponentKey(SystemKey, AdapterClass, @@ -244,84 +310,19 @@ 0x0, 0xFFFFFFFF, "PNP BIOS", + PartialResourceList, + Size, &BusKey); + (*BusNumber)++; - /* Set 'Configuration Data' value */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DPRINTM(DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n"); - return; - } - memset(PartialResourceList, 0, Size); - - /* Initialize resource descriptor */ - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - PartialResourceList->PartialDescriptors[0].Type = - CmResourceTypeDeviceSpecific; - PartialResourceList->PartialDescriptors[0].ShareDisposition = - CmResourceShareUndetermined; - - Ptr = (char *)(((ULONG_PTR)&PartialResourceList->PartialDescriptors[0]) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - - /* Set instalation check data */ - memcpy (Ptr, InstData, sizeof(CM_PNP_BIOS_INSTALLATION_CHECK)); - Ptr += sizeof(CM_PNP_BIOS_INSTALLATION_CHECK); - - /* Copy device nodes */ - FoundNodeCount = 0; - PnpBufferSize = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK); - for (i = 0; i < 0xFF; i++) - { - NodeNumber = (UCHAR)i; - - x = PnpBiosGetDeviceNode(&NodeNumber, (PVOID)DISKREADBUFFER); - if (x == 0) - { - DeviceNode = (PCM_PNP_BIOS_DEVICE_NODE)DISKREADBUFFER; - - DPRINTM(DPRINT_HWDETECT, - "Node: %u Size %u (0x%x)\n", - DeviceNode->Node, - DeviceNode->Size, - DeviceNode->Size); - - memcpy (Ptr, - DeviceNode, - DeviceNode->Size); - - Ptr += DeviceNode->Size; - PnpBufferSize += DeviceNode->Size; - - FoundNodeCount++; - if (FoundNodeCount >= NodeCount) - break; - } - } - - /* Set real data size */ - PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = - PnpBufferSize; - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSize; - - DPRINTM(DPRINT_HWDETECT, "Real buffer size: %u\n", PnpBufferSize); - DPRINTM(DPRINT_HWDETECT, "Resource size: %u\n", Size); - - FldrSetConfigurationData(BusKey, PartialResourceList, Size); MmHeapFree(PartialResourceList); } -static VOID -SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey, - ULONG DriveNumber) +static PCM_PARTIAL_RESOURCE_LIST +GetHarddiskConfigurationData(ULONG DriveNumber, ULONG* pSize) { PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry; @@ -329,6 +330,11 @@ GEOMETRY Geometry; ULONG Size; + // + // Initialize returned size + // + *pSize = 0; + /* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_DISK_GEOMETRY_DEVICE_DATA); @@ -337,7 +343,7 @@ { DPRINTM(DPRINT_HWDETECT, "Failed to allocate a full resource descriptor\n"); - return; + return NULL; } memset(PartialResourceList, 0, Size); @@ -374,7 +380,7 @@ { DPRINTM(DPRINT_HWDETECT, "Reading disk geometry failed\n"); MmHeapFree(PartialResourceList); - return; + return NULL; } DPRINTM(DPRINT_HWDETECT, "Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n", @@ -384,8 +390,11 @@ DiskGeometry->SectorsPerTrack, DiskGeometry->BytesPerSector); - FldrSetConfigurationData(DiskKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); + // + // Return configuration data + // + *pSize = Size; + return PartialResourceList; } typedef struct tagDISKCONTEXT @@ -640,15 +649,6 @@ /* Set 'Identifier' value */ sprintf(Identifier, "FLOPPY%ld", FloppyNumber + 1); - FldrCreateComponentKey(ControllerKey, - PeripheralClass, - FloppyDiskPeripheral, - Input | Output, - FloppyNumber, - 0xFFFFFFFF, - Identifier, - &PeripheralKey); - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_FLOPPY_DEVICE_DATA); PartialResourceList = MmHeapAlloc(Size); @@ -680,17 +680,26 @@ FloppyData->MaximumTrackValue = (FloppyType == 1) ? 39 : 79; FloppyData->DataTransferRate = 0; - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size); + FldrCreateComponentKey(ControllerKey, + PeripheralClass, + FloppyDiskPeripheral, + Input | Output, + FloppyNumber, + 0xFFFFFFFF, + Identifier, + PartialResourceList, + Size, + &PeripheralKey); + MmHeapFree(PartialResourceList); } } static VOID -DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey, - PCONFIGURATION_COMPONENT_DATA ControllerKey) -{ +DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey) +{ + PCONFIGURATION_COMPONENT_DATA ControllerKey; PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; ULONG Size; @@ -743,26 +752,35 @@ PartialDescriptor->u.Dma.Channel = 2; PartialDescriptor->u.Dma.Port = 0; - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + /* Create floppy disk controller */ + FldrCreateComponentKey(BusKey, + ControllerClass, + DiskController, + Output | Input, + 0x0, + 0xFFFFFFFF, + NULL, + PartialResourceList, + Size, + &ControllerKey); + DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n"); + MmHeapFree(PartialResourceList); if (FloppyCount) DetectBiosFloppyPeripheral(ControllerKey); } -static VOID -DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, - PCONFIGURATION_COMPONENT_DATA BusKey) -{ +static PCONFIGURATION_COMPONENT_DATA +DetectSystem(VOID) +{ + PCONFIGURATION_COMPONENT_DATA SystemKey; PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_INT13_DRIVE_PARAMETER Int13Drives; GEOMETRY Geometry; - PCONFIGURATION_COMPONENT_DATA DiskKey, ControllerKey; ULONG DiskCount; ULONG Size; ULONG i; - BOOLEAN Changed, BootDriveReported = FALSE; - CHAR BootPath[512]; + BOOLEAN Changed; /* Count the number of visible drives */ DiskReportError(FALSE); @@ -794,18 +812,6 @@ DPRINTM(DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n", (int)DiskCount, (DiskCount == 1) ? "": "s"); - FldrCreateComponentKey(BusKey, - ControllerClass, - DiskController, - Output | Input | Removable, - 0x0, - 0xFFFFFFFF, - NULL, - &ControllerKey); - DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n"); - - DetectBiosFloppyController(BusKey, ControllerKey); - /* Allocate resource descriptor */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount; @@ -814,7 +820,7 @@ { DPRINTM(DPRINT_HWDETECT, "Failed to allocate resource descriptor\n"); - return; + return NULL; } /* Initialize resource descriptor */ @@ -832,9 +838,6 @@ Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); for (i = 0; i < DiskCount; i++) { - if (BootDrive == 0x80 + i) - BootDriveReported = TRUE; - if (MachDiskGetDriveGeometry(0x80 + i, &Geometry)) { Int13Drives[i].DriveSelect = 0x80 + i; @@ -852,17 +855,91 @@ Geometry.BytesPerSector); } } - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(SystemKey, PartialResourceList, Size); + + FldrCreateComponentKey(NULL, + SystemClass, + MaximumType, + 0x0, + 0x0, + 0xFFFFFFFF, + NULL, + PartialResourceList, + Size, + &SystemKey); + MmHeapFree(PartialResourceList); + + return SystemKey; +} + +static ULONG +GetDiskCount(PCONFIGURATION_COMPONENT_DATA BusKey) +{ + PCONFIGURATION_COMPONENT_DATA System; + ULONG ConfigurationDataLength; + ULONG DiskCount = 0; + + // + // Get root component + // + System = BusKey; + while (System->Parent) + System = System->Parent; + + // + // Get root configuration data length + // + ConfigurationDataLength = System->ComponentEntry.ConfigurationDataLength; + + // + // We assume that nothing wrong happened, and that configuration + // only consists of one CM_PARTIAL_RESOURCE_LIST entry, followed + // by n entries of CM_INT13_DRIVE_PARAMETER + // + if (ConfigurationDataLength > 0) + DiskCount = (ConfigurationDataLength - sizeof(CM_PARTIAL_RESOURCE_LIST)) + / sizeof(CM_INT13_DRIVE_PARAMETER); + + // + // Return number of disks + // + DPRINTM(DPRINT_HWDETECT, "Retrieving %lu INT13 disks\\0\n"); + return DiskCount; +}; + +static VOID +DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA BusKey) +{ + PCONFIGURATION_COMPONENT_DATA DiskKey, ControllerKey; + BOOLEAN BootDriveReported = FALSE; + ULONG i; + ULONG DiskCount = GetDiskCount(BusKey); + CHAR BootPath[512]; + + FldrCreateComponentKey(BusKey, + ControllerClass, + DiskController, + Output | Input, + 0x0, + 0xFFFFFFFF, + NULL, + NULL, + 0, + &ControllerKey); + DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n"); /* Create and fill subkey for each harddisk */ for (i = 0; i < DiskCount; i++) { + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + ULONG Size; CHAR Identifier[20]; + if (BootDrive == 0x80 + i) + BootDriveReported = TRUE; + /* Get disk values */ + PartialResourceList = GetHarddiskConfigurationData(0x80 + i, &Size); GetHarddiskIdentifier(Identifier, 0x80 + i); /* Create disk key */ @@ -873,10 +950,9 @@ 0x0, 0xFFFFFFFF, Identifier, + PartialResourceList, + Size, &DiskKey); - - /* Set disk values */ - SetHarddiskConfigurationData(DiskKey, 0x80 + i); } /* Get the drive we're booting from */ @@ -1202,6 +1278,12 @@ } } + /* Set 'Configuration Data' value */ + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 1; + PartialResourceList.Revision = 1; + PartialResourceList.Count = 0; + /* Create 'PointerPeripheral' key */ FldrCreateComponentKey(ControllerKey, PeripheralClass, @@ -1210,20 +1292,13 @@ 0x0, 0xFFFFFFFF, Identifier, + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), &PeripheralKey); + DPRINTM(DPRINT_HWDETECT, - "Created key: PointerPeripheral\\0\n"); - - /* Set 'Configuration Data' value */ - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - PartialResourceList.Version = 1; - PartialResourceList.Revision = 1; - PartialResourceList.Count = 0; - - FldrSetConfigurationData(PeripheralKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); + "Created key: PointerPeripheral\\0\n"); } } @@ -1260,16 +1335,6 @@ /* Set 'Identifier' value */ sprintf(Buffer, "COM%ld", i + 1); - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - ControllerClass, - SerialController, - Output | Input | ConsoleIn | ConsoleOut, - ControllerNumber, - 0xFFFFFFFF, - Buffer, - &ControllerKey); /* Build full device descriptor */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + @@ -1318,8 +1383,18 @@ (PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3]; SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */ - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + /* Create controller key */ + FldrCreateComponentKey(BusKey, + ControllerClass, + SerialController, + Output | Input | ConsoleIn | ConsoleOut, + ControllerNumber, + 0xFFFFFFFF, + Buffer, + PartialResourceList, + Size, + &ControllerKey); + MmHeapFree(PartialResourceList); if (!Rs232PortInUse(Base)) @@ -1364,16 +1439,6 @@ /* Set 'Identifier' value */ sprintf(Buffer, "PARALLEL%ld", i + 1); - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - ControllerClass, - ParallelController, - Output, - ControllerNumber, - 0xFFFFFFFF, - Buffer, - &ControllerKey); /* Build full device descriptor */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST); @@ -1415,8 +1480,18 @@ PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF; } - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + /* Create controller key */ + FldrCreateComponentKey(BusKey, + ControllerClass, + ParallelController, + Output, + ControllerNumber, + 0xFFFFFFFF, + Buffer, + PartialResourceList, + Size, + &ControllerKey); + MmHeapFree(PartialResourceList); ControllerNumber++; @@ -1509,17 +1584,6 @@ /* HACK: don't call DetectKeyboardDevice() as it fails in Qemu 0.8.2 */ if (TRUE || DetectKeyboardDevice()) { - /* Create controller key */ - FldrCreateComponentKey(ControllerKey, - PeripheralClass, - KeyboardPeripheral, - Input | ConsoleIn, - 0x0, - 0xFFFFFFFF, - "PCAT_ENHANCED", - &PeripheralKey); - DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n"); - /* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_KEYBOARD_DEVICE_DATA); @@ -1549,8 +1613,19 @@ KeyboardData->Subtype = 0; KeyboardData->KeyboardFlags = 0x20; - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size); + /* Create controller key */ + FldrCreateComponentKey(ControllerKey, + PeripheralClass, + KeyboardPeripheral, + Input | ConsoleIn, + 0x0, + 0xFFFFFFFF, + "PCAT_ENHANCED", + PartialResourceList, + Size, + &PeripheralKey); + DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n"); + MmHeapFree(PartialResourceList); } } @@ -1563,17 +1638,6 @@ PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCONFIGURATION_COMPONENT_DATA ControllerKey; ULONG Size; - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - ControllerClass, - KeyboardController, - Input | ConsoleIn, - 0x0, - 0xFFFFFFFF, - NULL, - &ControllerKey); - DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n"); /* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + @@ -1619,8 +1683,19 @@ PartialDescriptor->u.Port.Start.HighPart = 0x0; PartialDescriptor->u.Port.Length = 1; - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + /* Create controller key */ + FldrCreateComponentKey(BusKey, + ControllerClass, + KeyboardController, + Input | ConsoleIn, + 0x0, + 0xFFFFFFFF, + NULL, + PartialResourceList, + Size, + &ControllerKey); + DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n"); + MmHeapFree(PartialResourceList); DetectKeyboardPeripheral(ControllerKey); @@ -1747,6 +1822,21 @@ { DPRINTM(DPRINT_HWDETECT, "Detected PS2 port\n"); + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + + /* Initialize resource descriptor */ + PartialResourceList.Version = 1; + PartialResourceList.Revision = 1; + PartialResourceList.Count = 1; + + /* Set Interrupt */ + PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeInterrupt; + PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined; + PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED; + PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = 12; + PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0; + PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF; + /* Create controller key */ FldrCreateComponentKey(BusKey, ControllerClass, @@ -1755,32 +1845,20 @@ 0x0, 0xFFFFFFFF, NULL, + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST), &ControllerKey); DPRINTM(DPRINT_HWDETECT, "Created key: PointerController\\0\n"); - - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - - /* Initialize resource descriptor */ - PartialResourceList.Version = 1; - PartialResourceList.Revision = 1; - PartialResourceList.Count = 1; - - /* Set Interrupt */ - PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeInterrupt; - PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined; - PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED; - PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = 12; - PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0; - PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST)); if (DetectPS2AuxDevice()) { DPRINTM(DPRINT_HWDETECT, "Detected PS2 mouse\n"); + + /* Initialize resource descriptor */ + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 1; + PartialResourceList.Revision = 1; + PartialResourceList.Count = 0; /* Create peripheral key */ FldrCreateComponentKey(ControllerKey, @@ -1790,20 +1868,11 @@ 0x0, 0xFFFFFFFF, "MICROSOFT PS2 MOUSE", + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), &PeripheralKey); - DPRINTM(DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n"); - - /* Initialize resource descriptor */ - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - PartialResourceList.Version = 1; - PartialResourceList.Revision = 1; - PartialResourceList.Count = 0; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); + DPRINTM(DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n"); } } } @@ -1850,6 +1919,8 @@ 0x0, 0xFFFFFFFF, Buffer, + NULL, + 0, &ControllerKey); DPRINTM(DPRINT_HWDETECT, "Created key: DisplayController\\0\n"); @@ -1863,16 +1934,6 @@ PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCONFIGURATION_COMPONENT_DATA BusKey; ULONG Size; - - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - AdapterClass, - MultiFunctionAdapter, - 0x0, - 0x0, - 0xFFFFFFFF, - "ISA", - &BusKey); /* Increment bus number */ (*BusNumber)++; @@ -1894,12 +1955,24 @@ PartialResourceList->Revision = 1; PartialResourceList->Count = 0; - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); + /* Create new bus key */ + FldrCreateComponentKey(SystemKey, + AdapterClass, + MultiFunctionAdapter, + 0x0, + 0x0, + 0xFFFFFFFF, + "ISA", + PartialResourceList, + Size, + &BusKey); + MmHeapFree(PartialResourceList); /* Detect ISA/BIOS devices */ - DetectBiosDisks(SystemKey, BusKey); + DetectBiosDisks(BusKey); + + DetectBiosFloppyController(BusKey); DetectSerialPorts(BusKey); @@ -1924,7 +1997,7 @@ DPRINTM(DPRINT_HWDETECT, "DetectHardware()\n"); /* Create the 'System' key */ - FldrCreateSystemKey(&SystemKey); + SystemKey = DetectSystem(); /* Detect buses */ DetectPciBios(SystemKey, &BusNumber); Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -67,16 +67,6 @@ AcpiPresent = TRUE; LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE; - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - AdapterClass, - MultiFunctionAdapter, - 0x0, - 0x0, - 0xFFFFFFFF, - "ACPI BIOS", - &BiosKey); - /* Get BIOS memory map */ RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32); BiosMemoryMapEntryCount = PcMemGetMemoryMap(BiosMemoryMap, @@ -109,10 +99,17 @@ DPRINTM(DPRINT_HWDETECT, "RSDT %p, data size %x\n", Rsdp->rsdt_physical_address, TableSize); - FldrSetConfigurationData(BiosKey, - PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize - ); + /* Create new bus key */ + FldrCreateComponentKey(SystemKey, + AdapterClass, + MultiFunctionAdapter, + 0x0, + 0x0, + 0xFFFFFFFF, + "ACPI BIOS", + PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize, + &BiosKey); /* Increment bus number */ (*BusNumber)++; Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -61,6 +61,12 @@ if (FindApmBios()) { + /* Create 'Configuration Data' value */ + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 0; + PartialResourceList.Revision = 0; + PartialResourceList.Count = 0; + /* Create new bus key */ FldrCreateComponentKey(SystemKey, AdapterClass, @@ -69,17 +75,10 @@ 0x0, 0xFFFFFFFF, "APM", + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), &BiosKey); - - /* Set 'Configuration Data' value */ - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - PartialResourceList.Version = 0; - PartialResourceList.Revision = 0; - PartialResourceList.Count = 0; - FldrSetConfigurationData(BiosKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); /* Increment bus number */ (*BusNumber)++; Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -154,15 +154,6 @@ { DPRINTM(DPRINT_HWDETECT, "Table size: %u\n", Table->Size); - FldrCreateComponentKey(BusKey, - PeripheralClass, - RealModeIrqRoutingTable, - 0x0, - 0x0, - 0xFFFFFFFF, - "PCI Real-mode IRQ Routing Table", - &TableKey); - /* Set 'Configuration Data' value */ Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) + 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size; @@ -194,8 +185,17 @@ memcpy(&PartialResourceList->PartialDescriptors[2], Table, Table->Size); - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(TableKey, PartialResourceList, Size); + FldrCreateComponentKey(BusKey, + PeripheralClass, + RealModeIrqRoutingTable, + 0x0, + 0x0, + 0xFFFFFFFF, + "PCI Real-mode IRQ Routing Table", + PartialResourceList, + Size, + &TableKey); + MmHeapFree(PartialResourceList); } } @@ -215,19 +215,6 @@ /* Report the PCI BIOS */ if (FindPciBios(&BusData)) { - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - AdapterClass, - MultiFunctionAdapter, - 0x0, - 0x0, - 0xFFFFFFFF, - "PCI BIOS", - &BiosKey); - - /* Increment bus number */ - (*BusNumber)++; - /* Set 'Configuration Data' value */ Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors); @@ -242,8 +229,21 @@ /* Initialize resource descriptor */ memset(PartialResourceList, 0, Size); - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BiosKey, PartialResourceList, Size); + /* Create new bus key */ + FldrCreateComponentKey(SystemKey, + AdapterClass, + MultiFunctionAdapter, + 0x0, + 0x0, + 0xFFFFFFFF, + "PCI BIOS", + PartialResourceList, + Size, + &BiosKey); + + /* Increment bus number */ + (*BusNumber)++; + MmHeapFree(PartialResourceList); DetectPciIrqRoutingTable(BiosKey); @@ -251,16 +251,6 @@ /* Report PCI buses */ for (i = 0; i < (ULONG)BusData.NoBuses; i++) { - /* Create the bus key */ - FldrCreateComponentKey(SystemKey, - AdapterClass, - MultiFunctionAdapter, - 0x0, - 0x0, - 0xFFFFFFFF, - "PCI", - &BusKey); - /* Check if this is the first bus */ if (i == 0) { @@ -289,10 +279,6 @@ memcpy(&PartialResourceList->PartialDescriptors[1], &BusData, sizeof(PCI_REGISTRY_INFO)); - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); } else { @@ -309,11 +295,21 @@ /* Initialize resource descriptor */ memset(PartialResourceList, 0, Size); - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); } + + /* Create the bus key */ + FldrCreateComponentKey(SystemKey, + AdapterClass, + MultiFunctionAdapter, + 0x0, + 0x0, + 0xFFFFFFFF, + "PCI", + PartialResourceList, + Size, + &BusKey); + + MmHeapFree(PartialResourceList); /* Increment bus number */ (*BusNumber)++; Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -29,9 +29,8 @@ extern ARC_DISK_SIGNATURE reactos_arc_disk_info[]; extern char reactos_arc_strings[32][256]; -static VOID -SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey, - ULONG DriveNumber) +static PCM_PARTIAL_RESOURCE_LIST +GetHarddiskConfigurationData(ULONG DriveNumber, ULONG* pSize) { PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry; @@ -39,6 +38,11 @@ GEOMETRY Geometry; ULONG Size; + // + // Initialize returned size + // + *pSize = 0; + /* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_DISK_GEOMETRY_DEVICE_DATA); @@ -47,7 +51,7 @@ { DPRINTM(DPRINT_HWDETECT, "Failed to allocate a full resource descriptor\n"); - return; + return NULL; } memset(PartialResourceList, 0, Size); @@ -78,7 +82,7 @@ { DPRINTM(DPRINT_HWDETECT, "Reading disk geometry failed\n"); MmHeapFree(PartialResourceList); - return; + return NULL; } DPRINTM(DPRINT_HWDETECT, "Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n", @@ -88,8 +92,11 @@ DiskGeometry->SectorsPerTrack, DiskGeometry->BytesPerSector); - FldrSetConfigurationData(DiskKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); + // + // Return configuration data + // + *pSize = Size; + return PartialResourceList; } @@ -202,17 +209,7 @@ DPRINTM(DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n", (int)DiskCount, (DiskCount == 1) ? "": "s"); - FldrCreateComponentKey(BusKey, - ControllerClass, - DiskController, - Output | Input | Removable, - 0, - 0xFFFFFFFF, - NULL, - &ControllerKey); - DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n"); - - //DetectBiosFloppyController(BusKey, ControllerKey); + //DetectBiosFloppyController(BusKey); /* Allocate resource descriptor */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + @@ -258,16 +255,29 @@ } } - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(SystemKey, PartialResourceList, Size); + FldrCreateComponentKey(BusKey, + ControllerClass, + DiskController, + Output | Input, + 0, + 0xFFFFFFFF, + NULL, + PartialResourceList, + Size, + &ControllerKey); + DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n"); + MmHeapFree(PartialResourceList); /* Create and fill subkey for each harddisk */ for (i = 0; i < DiskCount; i++) { + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + ULONG Size; CHAR Identifier[20]; /* Get disk values */ + PartialResourceList = GetHarddiskConfigurationData(0x80 + i, &Size); GetHarddiskIdentifier(Identifier, 0x80 + i); /* Create disk key */ @@ -278,10 +288,12 @@ 0, 0xFFFFFFFF, Identifier, + PartialResourceList, + Size, &DiskKey); - - /* Set disk values */ - SetHarddiskConfigurationData(DiskKey, 0x80 + i); + + if (PartialResourceList) + MmHeapFree(PartialResourceList); } } @@ -291,19 +303,6 @@ PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCONFIGURATION_COMPONENT_DATA BusKey; ULONG Size; - - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - AdapterClass, - MultiFunctionAdapter, - 0x0, - 0x0, - 0xFFFFFFFF, - "ISA", - &BusKey); - - /* Increment bus number */ - (*BusNumber)++; /* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) - @@ -322,10 +321,22 @@ PartialResourceList->Revision = 1; PartialResourceList->Count = 0; - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); + /* Create new bus key */ + FldrCreateComponentKey(SystemKey, + AdapterClass, + MultiFunctionAdapter, + 0x0, + 0x0, + 0xFFFFFFFF, + "ISA", + PartialResourceList, + Size, + &BusKey); + + /* Increment bus number */ + (*BusNumber)++; + MmHeapFree(PartialResourceList); - /* Detect ISA/BIOS devices */ DetectBiosDisks(SystemKey, BusKey); Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -394,6 +394,8 @@ 0, (ULONG)-1, NULL, + NULL, + 0, &NewKey); /* Add properties */ Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] Sun Aug 23 10:25:52 2009 @@ -19,6 +19,12 @@ PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot; BOOLEAN UseRealHeap = FALSE; + +VOID +NTAPI +FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size); /* FUNCTIONS ******************************************************************/ @@ -139,6 +145,8 @@ IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey) { PCONFIGURATION_COMPONENT_DATA ComponentData; @@ -152,7 +160,8 @@ ComponentData->Parent = SystemNode; /* Link us to the parent */ - FldrLinkToParent(SystemNode, ComponentData); + if (SystemNode) + FldrLinkToParent(SystemNode, ComponentData); /* Set us up */ Component = &ComponentData->ComponentEntry; @@ -166,6 +175,10 @@ if (IdentifierString) FldrSetIdentifier(ComponentData, IdentifierString); + /* Set configuration data */ + if (ResourceList) + FldrSetConfigurationData(ComponentData, ResourceList, Size); + /* Return the child */ *ComponentKey = ComponentData; }
15 years, 4 months
1
0
0
0
[dchapyshev] 42872: - Add enumeration user keys
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Aug 23 09:40:23 2009 New Revision: 42872 URL:
http://svn.reactos.org/svn/reactos?rev=42872&view=rev
Log: - Add enumeration user keys Modified: trunk/reactos/base/applications/rapps/installed.c trunk/reactos/base/applications/rapps/rapps.h trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/installed.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/in…
============================================================================== --- trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] Sun Aug 23 09:40:23 2009 @@ -172,7 +172,7 @@ BOOL -EnumInstalledApplications(INT EnumType, APPENUMPROC lpEnumProc) +EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc) { DWORD dwSize = MAX_PATH, dwType, dwValue; BOOL bIsSystemComponent, bIsUpdate; @@ -182,7 +182,7 @@ HKEY hKey, hSubKey; LONG ItemIndex = 0; - if (RegOpenKeyW(HKEY_LOCAL_MACHINE, + if (RegOpenKeyW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", &hKey) != ERROR_SUCCESS) { Modified: trunk/reactos/base/applications/rapps/rapps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Sun Aug 23 09:40:23 2009 @@ -76,7 +76,7 @@ /* installed.c */ typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, LPWSTR lpKeyName, LPARAM lParam); -BOOL EnumInstalledApplications(INT EnumType, APPENUMPROC lpEnumProc); +BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc); BOOL GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString); BOOL ShowInstalledAppInfo(INT Index); BOOL UninstallApplication(INT Index, BOOL bModify); Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sun Aug 23 09:40:23 2009 @@ -101,7 +101,8 @@ if (IS_INSTALLED_ENUM(EnumType)) { /* Enum installed applications and updates */ - EnumInstalledApplications(EnumType, EnumInstalledAppProc); + EnumInstalledApplications(EnumType, TRUE, EnumInstalledAppProc); + EnumInstalledApplications(EnumType, FALSE, EnumInstalledAppProc); } else if (IS_AVAILABLE_ENUM(EnumType)) {
15 years, 4 months
1
0
0
0
[jimtabor] 42871: - Syncing up with current revision of Defdlg.c and Dialog.c from wine. Critical update for class rewrite.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Aug 23 09:12:58 2009 New Revision: 42871 URL:
http://svn.reactos.org/svn/reactos?rev=42871&view=rev
Log: - Syncing up with current revision of Defdlg.c and Dialog.c from wine. Critical update for class rewrite. Modified: trunk/reactos/dll/win32/user32/windows/dialog.c Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Sun Aug 23 09:12:58 2009 @@ -16,8 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ - * +/* * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/dialog.c * PURPOSE: Input @@ -275,6 +274,7 @@ if (GET_WORD(p) == 0xffff) /* Is it an integer id? */ { +//// ReactOS Rev 6478 info->windowName = HeapAlloc( GetProcessHeap(), 0, sizeof(L"#65535") ); if (info->windowName != NULL) { @@ -422,12 +422,16 @@ { while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL) { + PWND pWnd; HWND hParent = GetParent(hwndDlg); if (!hParent) break; - +// ReactOS if (!IsWindow(hParent)) break; - if (!GETDLGINFO(hParent)) /* TODO: Correct? */ + pWnd = ValidateHwnd(hParent); + if (!pWnd) break; + + if (!(pWnd->state & WNDS_DIALOGWINDOW)) { break; } @@ -649,13 +653,29 @@ { result->pointSize = GET_WORD(p); p++; - if (result->dialogEx) - { - result->weight = GET_WORD(p); p++; - result->italic = LOBYTE(GET_WORD(p)); p++; - } - result->faceName = (LPCWSTR)p; - p += wcslen( result->faceName ) + 1; + + /* If pointSize is 0x7fff, it means that we need to use the font + * in NONCLIENTMETRICSW.lfMessageFont, and NOT read the weight, + * italic, and facename from the dialog template. + */ + if (result->pointSize == 0x7fff) + { + /* We could call SystemParametersInfo here, but then we'd have + * to convert from pixel size to point size (which can be + * imprecise). + */ + TRACE(" FONT: Using message box font\n"); + } + else + { + if (result->dialogEx) + { + result->weight = GET_WORD(p); p++; + result->italic = LOBYTE(GET_WORD(p)); p++; + } + result->faceName = (LPCWSTR)p; + p += wcslen( result->faceName ) + 1; + } } /* First control is on dword boundary */ @@ -676,6 +696,8 @@ { HWND hwnd; RECT rect; + POINT pos; + SIZE size; DLG_TEMPLATE template; DIALOGINFO * dlgInfo = NULL; DWORD units = GetDialogBaseUnits(); @@ -699,16 +721,32 @@ if (template.style & DS_SETFONT) { + HDC dc = GetDC(0); + + if (template.pointSize == 0x7fff) + { + /* We get the message font from the non-client metrics */ + NONCLIENTMETRICSW ncMetrics; + + ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW); + if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, + sizeof(NONCLIENTMETRICSW), &ncMetrics, 0)) + { + hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont ); + } + } + else + { /* We convert the size to pixels and then make it -ve. This works * for both +ve and -ve template.pointSize */ - HDC dc; - int pixels; - dc = GetDC(0); - pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72); - hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight, + int pixels; + pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72); + hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight, template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, FF_DONTCARE, template.faceName ); + } + if (hUserFont) { SIZE charSize; @@ -737,26 +775,39 @@ if (template.style & DS_CONTROL) template.exStyle |= WS_EX_CONTROLPARENT; AdjustWindowRectEx( &rect, template.style, (hMenu != 0), template.exStyle ); - rect.right -= rect.left; - rect.bottom -= rect.top; + pos.x = rect.left; + pos.y = rect.top; + size.cx = rect.right - rect.left; + size.cy = rect.bottom - rect.top; if (template.x == CW_USEDEFAULT16) { - rect.left = rect.top = CW_USEDEFAULT; + pos.x = pos.y = CW_USEDEFAULT; } else { + HMONITOR monitor = 0; + MONITORINFO mon_info; + + mon_info.cbSize = sizeof(mon_info); if (template.style & DS_CENTER) { - rect.left = (GetSystemMetrics(SM_CXSCREEN) - rect.right) / 2; - rect.top = (GetSystemMetrics(SM_CYSCREEN) - rect.bottom) / 2; + monitor = MonitorFromWindow( owner ? owner : GetActiveWindow(), MONITOR_DEFAULTTOPRIMARY ); + GetMonitorInfoW( monitor, &mon_info ); + pos.x = (mon_info.rcWork.left + mon_info.rcWork.right - size.cx) / 2; + pos.y = (mon_info.rcWork.top + mon_info.rcWork.bottom - size.cy) / 2; + } + else if (template.style & DS_CENTERMOUSE) + { + GetCursorPos( &pos ); + monitor = MonitorFromPoint( pos, MONITOR_DEFAULTTOPRIMARY ); + GetMonitorInfoW( monitor, &mon_info ); } else { - rect.left += MulDiv(template.x, xBaseUnit, 4); - rect.top += MulDiv(template.y, yBaseUnit, 8); - if( !(template.style & (WS_CHILD|DS_ABSALIGN)) ) - ClientToScreen( owner, (POINT *)&rect ); + pos.x += MulDiv(template.x, xBaseUnit, 4); + pos.y += MulDiv(template.y, yBaseUnit, 8); + if (!(template.style & (WS_CHILD|DS_ABSALIGN))) ClientToScreen( owner, &pos ); } if ( !(template.style & WS_CHILD) ) { @@ -764,12 +815,18 @@ /* try to fit it into the desktop */ - if( (dX = rect.left + rect.right + GetSystemMetrics(SM_CXDLGFRAME) - - GetSystemMetrics(SM_CXSCREEN)) > 0 ) rect.left -= dX; - if( (dY = rect.top + rect.bottom + GetSystemMetrics(SM_CYDLGFRAME) - - GetSystemMetrics(SM_CYSCREEN)) > 0 ) rect.top -= dY; - if( rect.left < 0 ) rect.left = 0; - if( rect.top < 0 ) rect.top = 0; + if (!monitor) + { + SetRect( &rect, pos.x, pos.y, pos.x + size.cx, pos.y + size.cy ); + monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY ); + GetMonitorInfoW( monitor, &mon_info ); + } + if ((dX = pos.x + size.cx + GetSystemMetrics(SM_CXDLGFRAME) - mon_info.rcWork.right) > 0) + pos.x -= dX; + if ((dY = pos.y + size.cy + GetSystemMetrics(SM_CYDLGFRAME) - mon_info.rcWork.bottom) > 0) + pos.y -= dY; + if( pos.x < mon_info.rcWork.left ) pos.x = mon_info.rcWork.left; + if( pos.y < mon_info.rcWork.top ) pos.y = mon_info.rcWork.top; } } @@ -781,44 +838,36 @@ if (unicode) { - hwnd = User32CreateWindowEx(template.exStyle, (LPCSTR)template.className, (LPCSTR)template.caption, - template.style & ~WS_VISIBLE, - rect.left, rect.top, rect.right, rect.bottom, - owner, hMenu, hInst, NULL, - TRUE); + hwnd = CreateWindowExW(template.exStyle, template.className, template.caption, + template.style & ~WS_VISIBLE, pos.x, pos.y, size.cx, size.cy, + owner, hMenu, hInst, NULL ); } else { - LPSTR class = (LPSTR)template.className; - LPSTR caption = (LPSTR)template.caption; + LPCSTR class = (LPCSTR)template.className; + LPCSTR caption = (LPCSTR)template.caption; + LPSTR class_tmp = NULL; + LPSTR caption_tmp = NULL; if (HIWORD(class)) { DWORD len = WideCharToMultiByte( CP_ACP, 0, template.className, -1, NULL, 0, NULL, NULL ); - class = HeapAlloc( GetProcessHeap(), 0, len ); - if (class != NULL) - WideCharToMultiByte( CP_ACP, 0, template.className, -1, class, len, NULL, NULL ); + class_tmp = HeapAlloc( GetProcessHeap(), 0, len ); + WideCharToMultiByte( CP_ACP, 0, template.className, -1, class_tmp, len, NULL, NULL ); + class = class_tmp; } if (HIWORD(caption)) { DWORD len = WideCharToMultiByte( CP_ACP, 0, template.caption, -1, NULL, 0, NULL, NULL ); - caption = HeapAlloc( GetProcessHeap(), 0, len ); - if (caption != NULL) - WideCharToMultiByte( CP_ACP, 0, template.caption, -1, caption, len, NULL, NULL ); - } - - if (class != NULL && caption != NULL) - { - hwnd = User32CreateWindowEx(template.exStyle, class, caption, - template.style & ~WS_VISIBLE, - rect.left, rect.top, rect.right, rect.bottom, - owner, hMenu, hInst, NULL, - FALSE); - } - else - hwnd = NULL; - if (HIWORD(class)) HeapFree( GetProcessHeap(), 0, class ); - if (HIWORD(caption)) HeapFree( GetProcessHeap(), 0, caption ); + caption_tmp = HeapAlloc( GetProcessHeap(), 0, len ); + WideCharToMultiByte( CP_ACP, 0, template.caption, -1, caption_tmp, len, NULL, NULL ); + caption = caption_tmp; + } + hwnd = CreateWindowExA(template.exStyle, class, caption, + template.style & ~WS_VISIBLE, pos.x, pos.y, size.cx, size.cy, + owner, hMenu, hInst, NULL ); + HeapFree( GetProcessHeap(), 0, class_tmp ); + HeapFree( GetProcessHeap(), 0, caption_tmp ); } if (!hwnd) @@ -832,7 +881,6 @@ /* moved this from the top of the method to here as DIALOGINFO structure will be valid only after WM_CREATE message has been handled in DefDlgProc All the members of the structure get filled here using temp variables */ - dlgInfo = DIALOG_get_info( hwnd, TRUE ); if (dlgInfo == NULL) { @@ -876,9 +924,10 @@ SetFocus( dlgInfo->hwndFocus ); } } +//// ReactOS Rev 30613 & 30644 if (!(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_CHILD)) SendMessageW( hwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0); - +//// if (template.style & WS_VISIBLE && !(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_VISIBLE)) { ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ @@ -899,13 +948,6 @@ */ static void DEFDLG_SetFocus( HWND hwndDlg, HWND hwndCtrl ) { - HWND hwndPrev = GetFocus(); - - if (IsChild( hwndDlg, hwndPrev )) - { - if (SendMessageW( hwndPrev, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL) - SendMessageW( hwndPrev, EM_SETSEL, -1, 0 ); - } if (SendMessageW( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL) SendMessageW( hwndCtrl, EM_SETSEL, 0, -1 ); SetFocus( hwndCtrl ); @@ -944,7 +986,7 @@ infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE ); if (!IsWindow( infoPtr->hwndFocus )) return; } - SetFocus( infoPtr->hwndFocus ); + DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus ); /* This used to set infoPtr->hwndFocus to NULL for no apparent reason, sometimes losing focus when receiving WM_SETFOCUS messages. */ @@ -1077,6 +1119,7 @@ return 1; } case WM_NCDESTROY: +//// ReactOS if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_ROS_DIALOGINFO, 0 ))) { /* Free dialog heap (if created) */ @@ -1717,7 +1760,7 @@ HWND hwnd; HRSRC hrsrc; LPCDLGTEMPLATE ptr; - +//// ReactOS rev 33532 if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG )) || !(ptr = LoadResource(hInstance, hrsrc))) { @@ -1750,7 +1793,7 @@ HWND hwnd; HRSRC hrsrc; LPCDLGTEMPLATE ptr; - +//// ReactOS rev 33532 if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG )) || !(ptr = LoadResource(hInstance, hrsrc))) {
15 years, 4 months
1
0
0
0
[gschneider] 42870: Handle failed memory allocations
by gschneider@svn.reactos.org
Author: gschneider Date: Sat Aug 22 21:37:31 2009 New Revision: 42870 URL:
http://svn.reactos.org/svn/reactos?rev=42870&view=rev
Log: Handle failed memory allocations Modified: trunk/reactos/dll/win32/gdi32/objects/font.c Modified: trunk/reactos/dll/win32/gdi32/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fo…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Sat Aug 22 21:37:31 2009 @@ -118,6 +118,8 @@ if(count == -1) count = strlen(str); lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0); strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR)); + if (!strW) + return NULL; MultiByteToWideChar(cp, 0, str, count, strW, lenW); DPRINT("mapped %s -> %S\n", str, strW); if(plenW) *plenW = lenW; @@ -322,7 +324,13 @@ lpStringW = FONT_mbtowc(hdc, lpString, uCount, &uCountW, &font_cp); if(lpResults->lpOutString) + { resultsW.lpOutString = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*uCountW); + if (resultsW.lpOutString == NULL) + { + return 0; + } + } ret = GetCharacterPlacementW(hdc, lpStringW, uCountW, nMaxExtent, &resultsW, dwFlags); @@ -993,7 +1001,13 @@ if((ret = GetOutlineTextMetricsW(hdc, 0, NULL)) == 0) return 0; if(ret > sizeof(buf)) - lpOTMW = HeapAlloc(GetProcessHeap(), 0, ret); + { + lpOTMW = HeapAlloc(GetProcessHeap(), 0, ret); + if (lpOTMW == NULL) + { + return 0; + } + } GetOutlineTextMetricsW(hdc, ret, lpOTMW); needed = sizeof(OUTLINETEXTMETRICA); @@ -1021,10 +1035,16 @@ DPRINT("needed = %d\n", needed); if(needed > cbData) + { /* Since the supplied buffer isn't big enough, we'll alloc one that is and memcpy the first cbData bytes into the lpOTM at the end. */ output = HeapAlloc(GetProcessHeap(), 0, needed); + if (output == NULL) + { + goto end; + } + } ret = output->otmSize = min(needed, cbData); FONT_TextMetricWToA( &lpOTMW->otmTextMetrics, &output->otmTextMetrics ); @@ -1207,6 +1227,10 @@ if (!cPairs && !kern_pairA) return total_kern_pairs; kern_pairW = HeapAlloc(GetProcessHeap(), 0, total_kern_pairs * sizeof(*kern_pairW)); + if (kern_pairW == NULL) + { + return 0; + } GetKerningPairsW(hDC, total_kern_pairs, kern_pairW); for (i = 0; i < total_kern_pairs; i++)
15 years, 4 months
1
0
0
0
[dchapyshev] 42869: - Sync winemp3.acm and hhctrl.ocx with Wine 1.1.28 - Delete unneeded .diff file
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Aug 22 21:13:32 2009 New Revision: 42869 URL:
http://svn.reactos.org/svn/reactos?rev=42869&view=rev
Log: - Sync winemp3.acm and hhctrl.ocx with Wine 1.1.28 - Delete unneeded .diff file Removed: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff Modified: trunk/reactos/dll/win32/hhctrl.ocx/chm.c trunk/reactos/dll/win32/hhctrl.ocx/help.c trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c trunk/reactos/dll/win32/hhctrl.ocx/resource.h trunk/reactos/dll/win32/winemp3.acm/layer3.c Modified: trunk/reactos/dll/win32/hhctrl.ocx/chm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/chm.c…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/chm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/chm.c [iso-8859-1] Sat Aug 22 21:13:32 2009 @@ -362,15 +362,18 @@ /* Opens the CHM file for reading */ CHMInfo *OpenCHM(LPCWSTR szFile) { - WCHAR file[MAX_PATH] = {0}; HRESULT hres; + CHMInfo *ret; static const WCHAR wszSTRINGS[] = {'#','S','T','R','I','N','G','S',0}; - CHMInfo *ret = heap_alloc_zero(sizeof(CHMInfo)); - - GetFullPathNameW(szFile, sizeof(file)/sizeof(file[0]), file, NULL); - ret->szFile = strdupW(file); + if (!(ret = heap_alloc_zero(sizeof(CHMInfo)))) + return NULL; + + if (!(ret->szFile = strdupW(szFile))) { + heap_free(ret); + return NULL; + } hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER, &IID_IITStorage, (void **) &ret->pITStorage) ; @@ -423,6 +426,7 @@ heap_free(chm->defTitle); heap_free(chm->defTopic); heap_free(chm->defToc); + heap_free(chm->szFile); heap_free(chm); return NULL; Modified: trunk/reactos/dll/win32/hhctrl.ocx/help.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/help.…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/help.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/help.c [iso-8859-1] Sat Aug 22 21:13:32 2009 @@ -115,7 +115,9 @@ LPWSTR ptr; static const WCHAR url_format[] = - {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s',0}; + {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0}; + static const WCHAR slash[] = {'/',0}; + static const WCHAR empty[] = {0}; TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index)); @@ -127,7 +129,7 @@ return FALSE; } - wsprintfW(buf, url_format, full_path, index); + wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index); /* FIXME: HACK */ if((ptr = strchrW(buf, '#'))) Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] Sat Aug 22 21:13:32 2009 @@ -86,11 +86,27 @@ #undef X } +static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD buflen) +{ + static const WCHAR helpW[] = {'\\','h','e','l','p','\\',0}; + + GetFullPathNameW(filename, buflen, fullname, NULL); + if (GetFileAttributesW(fullname) == INVALID_FILE_ATTRIBUTES) + { + GetWindowsDirectoryW(fullname, buflen); + strcatW(fullname, helpW); + strcatW(fullname, filename); + } + return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES); +} + /****************************************************************** * HtmlHelpW (HHCTRL.OCX.15) */ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data) { + WCHAR fullname[MAX_PATH]; + TRACE("(%p, %s, command=%s, data=%lx)\n", caller, debugstr_w( filename ), command_to_string( command ), data); @@ -119,13 +135,14 @@ filename = chm_file; index += 2; /* advance beyond "::" for calling NavigateToChm() later */ } - else - { - if (command!=HH_DISPLAY_SEARCH) /* FIXME - use HH_FTS_QUERYW structure in data */ - index = (const WCHAR*)data; - } - - info = CreateHelpViewer(filename); + + if (!resolve_filename(filename, fullname, MAX_PATH)) + { + WARN("can't find %s\n", debugstr_w(filename)); + return 0; + } + + info = CreateHelpViewer(fullname); if(!info) return NULL; @@ -147,7 +164,13 @@ if (!filename) return NULL; - info = CreateHelpViewer(filename); + if (!resolve_filename(filename, fullname, MAX_PATH)) + { + WARN("can't find %s\n", debugstr_w(filename)); + return 0; + } + + info = CreateHelpViewer(fullname); if(!info) return NULL; Removed: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff (removed) @@ -1,16 +1,0 @@ -Index: hhctrl.ocx.rbuild -=================================================================== ---- hhctrl.ocx.rbuild (revision 32840) -+++ hhctrl.ocx.rbuild (working copy) -@@ -6,9 +6,11 @@ - <importlibrary definition="hhctrl.ocx.spec.def" /> - <include base="hhctrl">.</include> - <include base="ReactOS">include/reactos/wine</include> -+ <include base="ReactOS" root="intermediate">include/reactos</include> - <define name="__WINESRC__" /> - <define name="WINVER">0x600</define> - <define name="_WIN32_WINNT">0x600</define> -+ <dependency>wineheaders</dependency> - <file>chm.c</file> - <file>content.c</file> - <file>help.c</file> Modified: trunk/reactos/dll/win32/hhctrl.ocx/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/resou…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/resource.h [iso-8859-1] Sat Aug 22 21:13:32 2009 @@ -18,6 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <windef.h> +#include <winbase.h> +#include <wingdi.h> +#include <htmlhelp.h> + #define IDS_CONTENTS 1 #define IDS_INDEX 2 #define IDS_SEARCH 3 Modified: trunk/reactos/dll/win32/winemp3.acm/layer3.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winemp3.acm/laye…
============================================================================== --- trunk/reactos/dll/win32/winemp3.acm/layer3.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winemp3.acm/layer3.c [iso-8859-1] Sat Aug 22 21:13:32 2009 @@ -1061,8 +1061,9 @@ * and mode = mixed_mode */ int sfb = gr_info->maxbandl; - int idx = bi->longIdx[sfb]; - + int idx; + if(sfb > 21) return; /* similarity fix related to CVE-2006-1655 */ + idx = bi->longIdx[sfb]; for ( ; sfb<8; sfb++ ) { int sb = bi->longDiff[sfb]; @@ -1085,7 +1086,9 @@ else /* ((gr_info->block_type != 2)) */ { int sfb = gr_info->maxbandl; - int is_p,idx = bi->longIdx[sfb]; + int is_p,idx; + if (sfb > 21) return; /* tightened fix for CVE-2006-1655 */ + idx = bi->longIdx[sfb]; for ( ; sfb<21; sfb++) { int sb = bi->longDiff[sfb];
15 years, 4 months
1
0
0
0
[dchapyshev] 42868: - Fully sync oleaut32 with Wine 1.1.28
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Aug 22 21:07:35 2009 New Revision: 42868 URL:
http://svn.reactos.org/svn/reactos?rev=42868&view=rev
Log: - Fully sync oleaut32 with Wine 1.1.28 Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild trunk/reactos/dll/win32/oleaut32/olepicture.c trunk/reactos/dll/win32/oleaut32/regsvr.c Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut3…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild [iso-8859-1] Sat Aug 22 21:07:35 2009 @@ -39,6 +39,7 @@ <include base="oleaut32" root="intermediate">.</include> <library>oleaut32_proxy</library> <library>wine</library> + <library>windowscodecs</library> <library>wineldr</library> <library>ole32</library> <library>rpcrt4</library> Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepict…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Sat Aug 22 21:07:35 2009 @@ -82,11 +82,10 @@ #include "oleauto.h" #include "connpt.h" #include "urlmon.h" +#include "wincodec.h" #include "wine/debug.h" #include "wine/unicode.h" #include "wine/library.h" - -#include "ungif.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -1059,220 +1058,6 @@ static void _jpeg_term_source(j_decompress_ptr cinfo) { } #endif /* SONAME_LIBJPEG */ -struct gifdata { - unsigned char *data; - unsigned int curoff; - unsigned int len; -}; - -static int _gif_inputfunc(GifFileType *gif, GifByteType *data, int len) { - struct gifdata *gd = gif->UserData; - - if (len+gd->curoff > gd->len) { - ERR("Trying to read %d bytes, but only %d available.\n",len, gd->len-gd->curoff); - len = gd->len - gd->curoff; - } - memcpy(data, gd->data+gd->curoff, len); - gd->curoff += len; - return len; -} - - -static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xread) -{ - struct gifdata gd; - GifFileType *gif; - BITMAPINFO *bmi; - HDC hdcref; - LPBYTE bytes; - int i,j,ret; - GifImageDesc *gid; - SavedImage *si; - ColorMapObject *cm; - int transparent = -1; - ExtensionBlock *eb; - int padding; - - gd.data = xbuf; - gd.curoff = 0; - gd.len = xread; - gif = DGifOpen((void*)&gd, _gif_inputfunc); - ret = DGifSlurp(gif); - if (ret == GIF_ERROR) { - ERR("Failed reading GIF using libgif.\n"); - return E_FAIL; - } - TRACE("screen height %d, width %d\n", gif->SWidth, gif->SHeight); - TRACE("color res %d, backgcolor %d\n", gif->SColorResolution, gif->SBackGroundColor); - TRACE("imgcnt %d\n", gif->ImageCount); - if (gif->ImageCount<1) { - ERR("GIF stream does not have images inside?\n"); - return E_FAIL; - } - TRACE("curimage: %d x %d, on %dx%d, interlace %d\n", - gif->Image.Width, gif->Image.Height, - gif->Image.Left, gif->Image.Top, - gif->Image.Interlace - ); - /* */ - padding = (gif->SWidth+3) & ~3; - si = gif->SavedImages+0; - gid = &(si->ImageDesc); - cm = gid->ColorMap; - if (!cm) cm = gif->SColorMap; - bmi = HeapAlloc(GetProcessHeap(),0,sizeof(BITMAPINFOHEADER)+(cm->ColorCount)*sizeof(RGBQUAD)); - bytes= HeapAlloc(GetProcessHeap(),0,padding*gif->SHeight); - - /* look for the transparent color extension */ - for (i = 0; i < si->ExtensionBlockCount; ++i) { - eb = si->ExtensionBlocks + i; - if (eb->Function == 0xF9 && eb->ByteCount == 4) { - if ((eb->Bytes[0] & 1) == 1) { - transparent = (unsigned char)eb->Bytes[3]; - } - } - } - - for (i = 0; i < cm->ColorCount; i++) { - bmi->bmiColors[i].rgbRed = cm->Colors[i].Red; - bmi->bmiColors[i].rgbGreen = cm->Colors[i].Green; - bmi->bmiColors[i].rgbBlue = cm->Colors[i].Blue; - if (i == transparent) { - This->rgbTrans = RGB(bmi->bmiColors[i].rgbRed, - bmi->bmiColors[i].rgbGreen, - bmi->bmiColors[i].rgbBlue); - } - } - - /* Map to in picture coordinates */ - for (i = 0, j = 0; i < gid->Height; i++) { - if (gif->Image.Interlace) { - memcpy( - bytes + (gid->Top + j) * padding + gid->Left, - si->RasterBits + i * gid->Width, - gid->Width); - - /* Lower bits of interlaced counter encode current interlace */ - if (j & 1) j += 2; /* Currently filling odd rows */ - else if (j & 2) j += 4; /* Currently filling even rows not multiples of 4 */ - else j += 8; /* Currently filling every 8th row or 4th row in-between */ - - if (j >= gid->Height && i < gid->Height && (j & 1) == 0) { - /* End of current interlace, go to next interlace */ - if (j & 2) j = 1; /* Next iteration fills odd rows */ - else if (j & 4) j = 2; /* Next iteration fills even rows not mod 4 and not mod 8 */ - else j = 4; /* Next iteration fills rows in-between rows mod 6 */ - } - } else { - memcpy( - bytes + (gid->Top + i) * padding + gid->Left, - si->RasterBits + i * gid->Width, - gid->Width); - } - } - - bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi->bmiHeader.biWidth = gif->SWidth; - bmi->bmiHeader.biHeight = -gif->SHeight; - bmi->bmiHeader.biPlanes = 1; - bmi->bmiHeader.biBitCount = 8; - bmi->bmiHeader.biCompression = BI_RGB; - bmi->bmiHeader.biSizeImage = padding*gif->SHeight; - bmi->bmiHeader.biXPelsPerMeter = 0; - bmi->bmiHeader.biYPelsPerMeter = 0; - bmi->bmiHeader.biClrUsed = cm->ColorCount; - bmi->bmiHeader.biClrImportant = 0; - - hdcref = GetDC(0); - This->desc.u.bmp.hbitmap=CreateDIBitmap( - hdcref, - &bmi->bmiHeader, - CBM_INIT, - bytes, - bmi, - DIB_RGB_COLORS - ); - - if (transparent > -1) { - /* Create the Mask */ - HDC hdc = CreateCompatibleDC(0); - HDC hdcMask = CreateCompatibleDC(0); - HBITMAP hOldbitmap; - HBITMAP hOldbitmapmask; - - unsigned int monopadding = (((unsigned)(gif->SWidth + 31)) >> 5) << 2; - HBITMAP hTempMask; - - This->hbmXor = CreateDIBitmap( - hdcref, - &bmi->bmiHeader, - CBM_INIT, - bytes, - bmi, - DIB_RGB_COLORS - ); - - bmi->bmiColors[0].rgbRed = 0; - bmi->bmiColors[0].rgbGreen = 0; - bmi->bmiColors[0].rgbBlue = 0; - bmi->bmiColors[1].rgbRed = 255; - bmi->bmiColors[1].rgbGreen = 255; - bmi->bmiColors[1].rgbBlue = 255; - - bmi->bmiHeader.biBitCount = 1; - bmi->bmiHeader.biSizeImage = monopadding*gif->SHeight; - bmi->bmiHeader.biClrUsed = 2; - - for (i = 0; i < gif->SHeight; i++) { - unsigned char * colorPointer = bytes + padding * i; - unsigned char * monoPointer = bytes + monopadding * i; - for (j = 0; j < gif->SWidth; j++) { - unsigned char pixel = colorPointer[j]; - if ((j & 7) == 0) monoPointer[j >> 3] = 0; - if (pixel == (transparent & 0x000000FFU)) monoPointer[j >> 3] |= 1 << (7 - (j & 7)); - } - } - hTempMask = CreateDIBitmap( - hdcref, - &bmi->bmiHeader, - CBM_INIT, - bytes, - bmi, - DIB_RGB_COLORS - ); - - bmi->bmiHeader.biHeight = -bmi->bmiHeader.biHeight; - This->hbmMask = CreateBitmap(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, 1, 1, NULL); - hOldbitmap = SelectObject(hdc, hTempMask); - hOldbitmapmask = SelectObject(hdcMask, This->hbmMask); - - SetBkColor(hdc, RGB(255, 255, 255)); - BitBlt(hdcMask, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, hdc, 0, 0, SRCCOPY); - - /* We no longer need the original bitmap, so we apply the first - transformation with the mask to speed up the rendering */ - SelectObject(hdc, This->hbmXor); - SetBkColor(hdc, RGB(0,0,0)); - SetTextColor(hdc, RGB(255,255,255)); - BitBlt(hdc, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, - hdcMask, 0, 0, SRCAND); - - SelectObject(hdc, hOldbitmap); - SelectObject(hdcMask, hOldbitmapmask); - DeleteDC(hdcMask); - DeleteDC(hdc); - DeleteObject(hTempMask); - } - - ReleaseDC(0, hdcref); - This->desc.picType = PICTYPE_BITMAP; - OLEPictureImpl_SetBitmap(This); - DGifCloseFile(gif); - HeapFree(GetProcessHeap(),0,bmi); - HeapFree(GetProcessHeap(),0,bytes); - return S_OK; -} - static HRESULT OLEPictureImpl_LoadJpeg(OLEPictureImpl *This, BYTE *xbuf, ULONG xread) { #ifdef SONAME_LIBJPEG @@ -1402,6 +1187,182 @@ This->desc.picType = PICTYPE_BITMAP; OLEPictureImpl_SetBitmap(This); return S_OK; +} + +static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSource *src) +{ + HRESULT hr; + BITMAPINFOHEADER bih; + HDC hdcref; + UINT width, height; + UINT stride, buffersize; + LPBYTE bits=NULL; + WICRect rc; + IWICBitmapSource *real_source; + UINT x, y; + COLORREF white = RGB(255, 255, 255), black = RGB(0, 0, 0); + BOOL has_alpha=FALSE; + + hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, src, &real_source); + if (FAILED(hr)) return hr; + + hr = IWICBitmapSource_GetSize(real_source, &width, &height); + if (FAILED(hr)) goto end; + + bih.biSize = sizeof(bih); + bih.biWidth = width; + bih.biHeight = -height; + bih.biPlanes = 1; + bih.biBitCount = 32; + bih.biCompression = BI_RGB; + bih.biSizeImage = 0; + bih.biXPelsPerMeter = 4085; /* olepicture ignores the stored resolution */ + bih.biYPelsPerMeter = 4085; + bih.biClrUsed = 0; + bih.biClrImportant = 0; + + stride = 4 * width; + buffersize = stride * height; + + bits = HeapAlloc(GetProcessHeap(), 0, buffersize); + if (!bits) + { + hr = E_OUTOFMEMORY; + goto end; + } + + rc.X = 0; + rc.Y = 0; + rc.Width = width; + rc.Height = height; + hr = IWICBitmapSource_CopyPixels(real_source, &rc, stride, buffersize, bits); + if (FAILED(hr)) + goto end; + + hdcref = GetDC(0); + This->desc.u.bmp.hbitmap = CreateDIBitmap( + hdcref, + &bih, + CBM_INIT, + bits, + (BITMAPINFO*)&bih, + DIB_RGB_COLORS); + + if (This->desc.u.bmp.hbitmap == 0) + { + hr = E_FAIL; + ReleaseDC(0, hdcref); + goto end; + } + + This->desc.picType = PICTYPE_BITMAP; + OLEPictureImpl_SetBitmap(This); + + /* set transparent pixels to black, all others to white */ + for(y = 0; y < height; y++){ + for(x = 0; x < width; x++){ + DWORD *pixel = (DWORD*)(bits + stride*y + 4*x); + if((*pixel & 0x80000000) == 0) + { + has_alpha = TRUE; + *pixel = black; + } + else + *pixel = white; + } + } + + if (has_alpha) + { + HDC hdcBmp, hdcXor, hdcMask; + HBITMAP hbmoldBmp, hbmoldXor, hbmoldMask; + + This->hbmXor = CreateDIBitmap( + hdcref, + &bih, + CBM_INIT, + bits, + (BITMAPINFO*)&bih, + DIB_RGB_COLORS + ); + + This->hbmMask = CreateBitmap(width,-height,1,1,NULL); + hdcBmp = CreateCompatibleDC(NULL); + hdcXor = CreateCompatibleDC(NULL); + hdcMask = CreateCompatibleDC(NULL); + + hbmoldBmp = SelectObject(hdcBmp,This->desc.u.bmp.hbitmap); + hbmoldXor = SelectObject(hdcXor,This->hbmXor); + hbmoldMask = SelectObject(hdcMask,This->hbmMask); + + SetBkColor(hdcXor,black); + BitBlt(hdcMask,0,0,width,height,hdcXor,0,0,SRCCOPY); + BitBlt(hdcXor,0,0,width,height,hdcBmp,0,0,SRCAND); + + SelectObject(hdcBmp,hbmoldBmp); + SelectObject(hdcXor,hbmoldXor); + SelectObject(hdcMask,hbmoldMask); + + DeleteDC(hdcBmp); + DeleteDC(hdcXor); + DeleteDC(hdcMask); + } + + ReleaseDC(0, hdcref); + +end: + HeapFree(GetProcessHeap(), 0, bits); + IWICBitmapSource_Release(real_source); + return hr; +} + +static HRESULT OLEPictureImpl_LoadWICDecoder(OLEPictureImpl *This, REFCLSID decoder_clsid, BYTE *xbuf, ULONG xread) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *framedecode; + HRESULT initresult; + HGLOBAL hdata; + BYTE *data; + IStream *stream; + + hdata = GlobalAlloc(GMEM_MOVEABLE, xread); + if (!hdata) return E_OUTOFMEMORY; + + data = GlobalLock(hdata); + memcpy(data, xbuf, xread); + GlobalUnlock(hdata); + + hr = CreateStreamOnHGlobal(hdata, TRUE, &stream); + if (FAILED(hr)) + { + GlobalFree(hdata); + return hr; + } + + initresult = CoInitialize(NULL); + + hr = CoCreateInstance(decoder_clsid, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICBitmapDecoder, (void**)&decoder); + if (FAILED(hr)) goto end; + + hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad); + if (SUCCEEDED(hr)) + { + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode); + if (SUCCEEDED(hr)) + { + hr = OLEPictureImpl_LoadWICSource(This, (IWICBitmapSource*)framedecode); + IWICBitmapFrameDecode_Release(framedecode); + } + } + + IWICBitmapDecoder_Release(decoder); + +end: + IStream_Release(stream); + if (SUCCEEDED(initresult)) CoUninitialize(); + return hr; } /***************************************************** @@ -1925,7 +1886,7 @@ switch (magic) { case BITMAP_FORMAT_GIF: /* GIF */ - hr = OLEPictureImpl_LoadGif(This, xbuf, xread); + hr = OLEPictureImpl_LoadWICDecoder(This, &CLSID_WICGifDecoder, xbuf, xread); break; case BITMAP_FORMAT_JPEG: /* JPEG */ hr = OLEPictureImpl_LoadJpeg(This, xbuf, xread); Modified: trunk/reactos/dll/win32/oleaut32/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/regsvr.…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/regsvr.c [iso-8859-1] Sat Aug 22 21:07:35 2009 @@ -32,6 +32,7 @@ #include "oleauto.h" #include "initguid.h" #include "typelib.h" +#include "wincodec.h" #include "wine/debug.h" #include "wine/unicode.h"
15 years, 4 months
1
0
0
0
[dchapyshev] 42867: - Add windowscodecs.dll from Wine 1.1.28
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sat Aug 22 21:03:09 2009 New Revision: 42867 URL:
http://svn.reactos.org/svn/reactos?rev=42867&view=rev
Log: - Add windowscodecs.dll from Wine 1.1.28 Added: trunk/reactos/dll/win32/windowscodecs/ (with props) trunk/reactos/dll/win32/windowscodecs/bmpdecode.c (with props) trunk/reactos/dll/win32/windowscodecs/bmpencode.c (with props) trunk/reactos/dll/win32/windowscodecs/clsfactory.c (with props) trunk/reactos/dll/win32/windowscodecs/converter.c (with props) trunk/reactos/dll/win32/windowscodecs/gifformat.c (with props) trunk/reactos/dll/win32/windowscodecs/icoformat.c (with props) trunk/reactos/dll/win32/windowscodecs/imgfactory.c (with props) trunk/reactos/dll/win32/windowscodecs/info.c (with props) trunk/reactos/dll/win32/windowscodecs/main.c (with props) trunk/reactos/dll/win32/windowscodecs/palette.c (with props) trunk/reactos/dll/win32/windowscodecs/propertybag.c (with props) trunk/reactos/dll/win32/windowscodecs/regsvr.c (with props) trunk/reactos/dll/win32/windowscodecs/stream.c (with props) trunk/reactos/dll/win32/windowscodecs/ungif.c (with props) trunk/reactos/dll/win32/windowscodecs/ungif.h (with props) trunk/reactos/dll/win32/windowscodecs/version.rc (with props) trunk/reactos/dll/win32/windowscodecs/wincodecs_private.h (with props) trunk/reactos/dll/win32/windowscodecs/windowscodecs.rbuild (with props) trunk/reactos/dll/win32/windowscodecs/windowscodecs.spec (with props) trunk/reactos/include/psdk/wincodec.idl (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/win32.rbuild trunk/reactos/include/psdk/psdk.rbuild trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=428…
Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
Added: trunk/reactos/dll/win32/windowscodecs/bmpdecode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/bm…
Added: trunk/reactos/dll/win32/windowscodecs/bmpencode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/bm…
Added: trunk/reactos/dll/win32/windowscodecs/clsfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/cl…
Added: trunk/reactos/dll/win32/windowscodecs/converter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/co…
Added: trunk/reactos/dll/win32/windowscodecs/gifformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/gi…
Added: trunk/reactos/dll/win32/windowscodecs/icoformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/ic…
Added: trunk/reactos/dll/win32/windowscodecs/imgfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/im…
Added: trunk/reactos/dll/win32/windowscodecs/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/in…
Added: trunk/reactos/dll/win32/windowscodecs/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/ma…
Added: trunk/reactos/dll/win32/windowscodecs/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/pa…
Added: trunk/reactos/dll/win32/windowscodecs/propertybag.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/pr…
Added: trunk/reactos/dll/win32/windowscodecs/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/re…
Added: trunk/reactos/dll/win32/windowscodecs/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/st…
Added: trunk/reactos/dll/win32/windowscodecs/ungif.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/un…
Added: trunk/reactos/dll/win32/windowscodecs/ungif.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/un…
Added: trunk/reactos/dll/win32/windowscodecs/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/ve…
Added: trunk/reactos/dll/win32/windowscodecs/wincodecs_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
Added: trunk/reactos/dll/win32/windowscodecs/windowscodecs.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
Added: trunk/reactos/dll/win32/windowscodecs/windowscodecs.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
Modified: trunk/reactos/include/psdk/psdk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/psdk.rbuild?r…
Added: trunk/reactos/include/psdk/wincodec.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wincodec.idl?…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
15 years, 4 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
66
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
Results per page:
10
25
50
100
200