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
May 2021
----- 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
183 discussions
Start a n
N
ew thread
[reactos] 02/02: [FREELDR][HALXBOX] Initialize PCI bridge secondary & subordinate bus values
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dcc1506af5c90bbdfdc35…
commit dcc1506af5c90bbdfdc35b0726c54fcb96fb951b Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Mon May 24 18:06:17 2021 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon May 24 18:12:02 2021 +0300 [FREELDR][HALXBOX] Initialize PCI bridge secondary & subordinate bus values This fixes the recursion when pci.sys attempts to get PCI bridge children devices, which in fact are non-existing. Note that the problem in pci.sys itself also deserves a separate fix. CORE-16319 CORE-16216 --- boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c | 36 +++++++++++++++++++++++++++ hal/halx86/legacy/bus/pcibus.c | 7 ------ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c b/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c index 2f59f04278b..eb7ce22c232 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c @@ -54,6 +54,40 @@ extern ULONG PcMemFinalizeMemoryMap( PFREELDR_MEMORY_DESCRIPTOR MemoryMap); +static +VOID +XboxInitializePCI(VOID) +{ + PCI_TYPE1_CFG_BITS PciCfg1; + ULONG PciData; + + /* Select PCI to PCI bridge */ + PciCfg1.u.bits.Enable = 1; + PciCfg1.u.bits.BusNumber = 0; + PciCfg1.u.bits.DeviceNumber = 8; + PciCfg1.u.bits.FunctionNumber = 0; + /* Select register VendorID & DeviceID */ + PciCfg1.u.bits.RegisterNumber = 0x00; + PciCfg1.u.bits.Reserved = 0; + + WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG); + PciData = READ_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT); + + if (PciData == 0x01B810DE) + { + /* Select register PrimaryBus/SecondaryBus/SubordinateBus/SecondaryLatency */ + PciCfg1.u.bits.RegisterNumber = 0x18; + WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG); + + /* Link uninitialized PCI bridge to the empty PCI bus 2, + * it's not supposed to have any devices attached anyway */ + PciData = READ_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT); + PciData &= 0xFF0000FF; + PciData |= 0x00020200; + WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, PciData); + } +} + VOID XboxMemInit(VOID) { @@ -108,6 +142,8 @@ XboxMemInit(VOID) WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, InstalledMemoryMb * 1024 * 1024 - 1); AvailableMemoryMb = InstalledMemoryMb; + + XboxInitializePCI(); } memory_map_t * diff --git a/hal/halx86/legacy/bus/pcibus.c b/hal/halx86/legacy/bus/pcibus.c index ee5ff34a28c..b4c0bd070df 100644 --- a/hal/halx86/legacy/bus/pcibus.c +++ b/hal/halx86/legacy/bus/pcibus.c @@ -322,13 +322,6 @@ HalpXboxBlacklistedPCISlot(IN PBUS_HANDLER BusHandler, return TRUE; } - /* Temporary hack to avoid stack overflow in kernel, see CORE-16319 */ - if (BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 8 && Slot.u.bits.FunctionNumber == 0) - { - DPRINT("Blacklisted PCI-to-PCI bridge (00:08.0 - PCI\\VEN_10DE&DEV_01B8, see CORE-16319)\n"); - return TRUE; - } - return FALSE; } #endif
3 years, 7 months
1
0
0
0
[reactos] 01/02: [FREELDR] Replace CONFIG_CMD macro with a straightforward bitfield struct
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f1410d2b094f6452d0962…
commit f1410d2b094f6452d0962ef5060b9f65fe1def6c Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Mon May 24 18:02:16 2021 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon May 24 18:02:16 2021 +0300 [FREELDR] Replace CONFIG_CMD macro with a straightforward bitfield struct Also fix magic values related to PCI registers. --- boot/freeldr/freeldr/arch/i386/xbox/machxbox.c | 15 +++++++++++-- boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c | 19 +++++++++++----- boot/freeldr/freeldr/include/arch/pc/hardware.h | 26 +++++++++++++++++++--- .../freeldr/include/arch/powerpc/hardware.h | 3 --- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c b/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c index 1551c664c29..781c2e946fc 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c @@ -301,14 +301,25 @@ VOID XboxHwIdle(VOID) VOID MachInit(const char *CmdLine) { + PCI_TYPE1_CFG_BITS PciCfg1; ULONG PciId; memset(&MachVtbl, 0, sizeof(MACHVTBL)); /* Check for Xbox by identifying device at PCI 0:0:0, if it's * 0x10DE/0x02A5 then we're running on an Xbox */ - WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(0, 0, 0)); - PciId = READ_PORT_ULONG((PULONG)0xCFC); + + /* Select Host to PCI bridge */ + PciCfg1.u.bits.Enable = 1; + PciCfg1.u.bits.BusNumber = 0; + PciCfg1.u.bits.DeviceNumber = 0; + PciCfg1.u.bits.FunctionNumber = 0; + /* Select register VendorID & DeviceID */ + PciCfg1.u.bits.RegisterNumber = 0x00; + PciCfg1.u.bits.Reserved = 0; + + WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG); + PciId = READ_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT); if (PciId != 0x02A510DE) { ERR("This is not original Xbox!\n"); diff --git a/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c b/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c index 1990199d70b..2f59f04278b 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/xboxmem.c @@ -57,6 +57,7 @@ PcMemFinalizeMemoryMap( VOID XboxMemInit(VOID) { + PCI_TYPE1_CFG_BITS PciCfg1; UCHAR ControlRegion[TEST_SIZE]; PVOID MembaseTop = (PVOID)(64 * 1024 * 1024); PVOID MembaseLow = (PVOID)0; @@ -64,9 +65,17 @@ XboxMemInit(VOID) WRITE_REGISTER_ULONG((PULONG)(NvBase + NV2A_FB_CFG0), 0x03070103); WRITE_REGISTER_ULONG((PULONG)(NvBase + NV2A_FB_CFG0 + 4), 0x11448000); - /* Prep hardware for 128 Mb */ - WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(0, 0, 0x84)); - WRITE_PORT_ULONG((PULONG)0xCFC, 0x7FFFFFF); + /* Select Host to PCI bridge */ + PciCfg1.u.bits.Enable = 1; + PciCfg1.u.bits.BusNumber = 0; + PciCfg1.u.bits.DeviceNumber = 0; + PciCfg1.u.bits.FunctionNumber = 0; + PciCfg1.u.bits.Reserved = 0; + /* Prepare hardware for 128 MB */ + PciCfg1.u.bits.RegisterNumber = 0x84; + + WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG); + WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, 0x7FFFFFF); InstalledMemoryMb = 64; memset(ControlRegion, TEST_PATTERN1, TEST_SIZE); @@ -95,8 +104,8 @@ XboxMemInit(VOID) } /* Set hardware for amount of memory detected */ - WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(0, 0, 0x84)); - WRITE_PORT_ULONG((PULONG)0xCFC, InstalledMemoryMb * 1024 * 1024 - 1); + WRITE_PORT_ULONG(PCI_TYPE1_ADDRESS_PORT, PciCfg1.u.AsULONG); + WRITE_PORT_ULONG((PULONG)PCI_TYPE1_DATA_PORT, InstalledMemoryMb * 1024 * 1024 - 1); AvailableMemoryMb = InstalledMemoryMb; } diff --git a/boot/freeldr/freeldr/include/arch/pc/hardware.h b/boot/freeldr/freeldr/include/arch/pc/hardware.h index 56e6028ed06..fb547212ea8 100644 --- a/boot/freeldr/freeldr/include/arch/pc/hardware.h +++ b/boot/freeldr/freeldr/include/arch/pc/hardware.h @@ -20,9 +20,6 @@ #pragma once -#define CONFIG_CMD(bus, dev_fn, where) \ - (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3)) - #define TAG_HW_RESOURCE_LIST 'lRwH' #define TAG_HW_DISK_CONTEXT 'cDwH' @@ -32,6 +29,29 @@ VOID StallExecutionProcessor(ULONG Microseconds); VOID HalpCalibrateStallExecution(VOID); +/* PCI Type 1 Ports */ +#define PCI_TYPE1_ADDRESS_PORT (PULONG)0xCF8 +#define PCI_TYPE1_DATA_PORT 0xCFC + +/* PCI Type 1 Configuration Register */ +typedef struct _PCI_TYPE1_CFG_BITS +{ + union + { + struct + { + ULONG RegisterNumber:8; + ULONG FunctionNumber:3; + ULONG DeviceNumber:5; + ULONG BusNumber:8; + ULONG Reserved:7; + ULONG Enable:1; + } bits; + + ULONG AsULONG; + } u; +} PCI_TYPE1_CFG_BITS, *PPCI_TYPE1_CFG_BITS; + typedef PCM_PARTIAL_RESOURCE_LIST (*GET_HARDDISK_CONFIG_DATA)(UCHAR DriveNumber, ULONG* pSize); diff --git a/boot/freeldr/freeldr/include/arch/powerpc/hardware.h b/boot/freeldr/freeldr/include/arch/powerpc/hardware.h index faefe779684..fcf663ad50a 100644 --- a/boot/freeldr/freeldr/include/arch/powerpc/hardware.h +++ b/boot/freeldr/freeldr/include/arch/powerpc/hardware.h @@ -24,9 +24,6 @@ #include "../../reactos/registry.h" #endif -#define CONFIG_CMD(bus, dev_fn, where) \ - (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3)) - /* PROTOTYPES ***************************************************************/ /* hardware.c */
3 years, 7 months
1
0
0
0
[reactos] 01/01: [HAL] HalpDebugPciDumpBus: Fix parsing bugs
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5caa59b31abc86a481f49…
commit 5caa59b31abc86a481f495102cd83984b604bffc Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Mon May 24 17:24:24 2021 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon May 24 17:24:24 2021 +0300 [HAL] HalpDebugPciDumpBus: Fix parsing bugs - Bridge devices don't have Subsystem ID and Subsystem Vendor ID - Also they have only two BARs, don't parse data outside of bounds Addendum to b232efe1. CORE-16319 CORE-16216 --- hal/halx86/legacy/bussupp.c | 49 ++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/hal/halx86/legacy/bussupp.c b/hal/halx86/legacy/bussupp.c index 4b855ec596e..6e291d58479 100644 --- a/hal/halx86/legacy/bussupp.c +++ b/hal/halx86/legacy/bussupp.c @@ -791,6 +791,7 @@ HalpDebugPciDumpBus(IN ULONG i, IN PPCI_COMMON_CONFIG PciData) { PCHAR p, ClassName, Boundary, SubClassName, VendorName, ProductName, SubVendorName; + UCHAR HeaderType; ULONG Length; CHAR LookupString[16] = ""; CHAR bSubClassName[64] = "Unknown"; @@ -799,6 +800,8 @@ HalpDebugPciDumpBus(IN ULONG i, CHAR bSubVendorName[128] = "Unknown"; ULONG Size, Mem, b; + HeaderType = (PciData->HeaderType & ~PCI_MULTIFUNCTION); + /* Isolate the class name */ sprintf(LookupString, "C %02x ", PciData->BaseClass); ClassName = strstr((PCHAR)ClassTable, LookupString); @@ -872,16 +875,20 @@ HalpDebugPciDumpBus(IN ULONG i, p += strlen("\r\n"); } Boundary = p; + SubVendorName = NULL; - /* Isolate the subvendor and subsystem name */ - sprintf(LookupString, - "\t\t%04x %04x ", - PciData->u.type0.SubVendorID, - PciData->u.type0.SubSystemID); - SubVendorName = strstr(ProductName, LookupString); - if (Boundary && SubVendorName >= Boundary) + if (HeaderType == PCI_DEVICE_TYPE) { - SubVendorName = NULL; + /* Isolate the subvendor and subsystem name */ + sprintf(LookupString, + "\t\t%04x %04x ", + PciData->u.type0.SubVendorID, + PciData->u.type0.SubSystemID); + SubVendorName = strstr(ProductName, LookupString); + if (Boundary && SubVendorName >= Boundary) + { + SubVendorName = NULL; + } } if (SubVendorName) { @@ -897,8 +904,7 @@ HalpDebugPciDumpBus(IN ULONG i, } /* Print out the data */ - DbgPrint("%02x:%02x.%x %s [%02x%02x]: %s %s [%04x:%04x] (rev %02x)\n" - "\tSubsystem: %s [%04x:%04x]\n", + DbgPrint("%02x:%02x.%x %s [%02x%02x]: %s %s [%04x:%04x] (rev %02x)\n", i, j, k, @@ -909,10 +915,15 @@ HalpDebugPciDumpBus(IN ULONG i, bProductName, PciData->VendorID, PciData->DeviceID, - PciData->RevisionID, - bSubVendorName, - PciData->u.type0.SubVendorID, - PciData->u.type0.SubSystemID); + PciData->RevisionID); + + if (HeaderType == PCI_DEVICE_TYPE) + { + DbgPrint("\tSubsystem: %s [%04x:%04x]\n", + bSubVendorName, + PciData->u.type0.SubVendorID, + PciData->u.type0.SubSystemID); + } /* Print out and decode flags */ DbgPrint("\tFlags:"); @@ -929,8 +940,7 @@ HalpDebugPciDumpBus(IN ULONG i, else if (PciData->u.type0.InterruptPin != 0) DbgPrint(", IRQ assignment required"); DbgPrint("\n"); - if ((PciData->HeaderType & ~PCI_MULTIFUNCTION) == PCI_BRIDGE_TYPE && - PciData->BaseClass == PCI_CLASS_BRIDGE_DEV) + if (HeaderType == PCI_BRIDGE_TYPE) { DbgPrint("\tBridge:"); DbgPrint(" primary bus %d,", PciData->u.type1.PrimaryBus); @@ -942,10 +952,13 @@ HalpDebugPciDumpBus(IN ULONG i, /* Scan addresses */ Size = 0; - for (b = 0; b < PCI_TYPE0_ADDRESSES; b++) + for (b = 0; b < (HeaderType == PCI_DEVICE_TYPE ? PCI_TYPE0_ADDRESSES : PCI_TYPE1_ADDRESSES); b++) { /* Check for a BAR */ - Mem = PciData->u.type0.BaseAddresses[b]; + if (HeaderType != PCI_CARDBUS_BRIDGE_TYPE) + Mem = PciData->u.type0.BaseAddresses[b]; + else + Mem = 0; if (Mem) { /* Decode the address type */
3 years, 7 months
1
0
0
0
[reactos] 01/01: [DHCPCSRV] Send an ARP request to check if an automatic private address is available
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2047cf361327fe1efc46e…
commit 2047cf361327fe1efc46ef58e2ac0e8595d7d468 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon May 24 15:18:58 2021 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon May 24 15:18:58 2021 +0200 [DHCPCSRV] Send an ARP request to check if an automatic private address is available --- base/services/dhcpcsvc/dhcp/dhclient.c | 48 +++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/base/services/dhcpcsvc/dhcp/dhclient.c b/base/services/dhcpcsvc/dhcp/dhclient.c index 81fcd9c5000..f97a7ca83df 100644 --- a/base/services/dhcpcsvc/dhcp/dhclient.c +++ b/base/services/dhcpcsvc/dhcp/dhclient.c @@ -1071,26 +1071,50 @@ state_panic(void *ipp) struct interface_info *ip = ipp; uint16_t address_low; int i; - PDHCP_ADAPTER Adapter = AdapterFindInfo(ip); + IPAddr IpAddress; + ULONG Buffer[20]; + ULONG BufferSize; + DWORD ret; + PDHCP_ADAPTER Adapter = AdapterFindInfo(ip); note("No DHCPOFFERS received."); - if (!Adapter->NteContext) - { - /* Generate an automatic private address */ - DbgPrint("DHCPCSVC: Failed to receive a response from a DHCP server. An automatic private address will be assigned.\n"); + if (!Adapter->NteContext) + { + /* Generate an automatic private address */ + DbgPrint("DHCPCSVC: Failed to receive a response from a DHCP server. An automatic private address will be assigned.\n"); + + /* FIXME: The address generation code sucks */ + srand(0); - /* FIXME: The address generation code sucks */ - srand(0); + for (;;) + { address_low = rand(); for (i = 0; i < ip->hw_address.hlen; i++) address_low += ip->hw_address.haddr[i]; - AddIPAddress(htonl(0xA9FE0000 | address_low), //169.254.X.X - htonl(0xFFFF0000), //255.255.0.0 - Adapter->IfMib.dwIndex, - &Adapter->NteContext, - &Adapter->NteInstance); + + IpAddress = htonl(0xA9FE0000 | address_low); // 169.254.X.X + + /* Send an ARP request to check if the IP address is already in use */ + BufferSize = sizeof(Buffer); + ret = SendARP(IpAddress, + IpAddress, + Buffer, + &BufferSize); + DH_DbgPrint(MID_TRACE,("DHCPCSVC: SendARP returned %lu\n", ret)); + if (ret != 0) + { + /* The IP address is not in use */ + DH_DbgPrint(MID_TRACE,("DHCPCSVC: Using automatic private address\n")); + AddIPAddress(IpAddress, + htonl(0xFFFF0000), // 255.255.0.0 + Adapter->IfMib.dwIndex, + &Adapter->NteContext, + &Adapter->NteInstance); + return; + } } + } } void
3 years, 7 months
1
0
0
0
[reactos] 01/01: [dnsapi][dnsrslvr] Implement DnsFlushResolverCacheEntry_A/_UTF8/_W
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=894cc4ac0c9448d5502a3…
commit 894cc4ac0c9448d5502a3e8e7d37ff7a6512ea71 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon May 24 14:43:30 2021 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon May 24 14:43:30 2021 +0200 [dnsapi][dnsrslvr] Implement DnsFlushResolverCacheEntry_A/_UTF8/_W --- base/services/dnsrslvr/cache.c | 45 ++++++++++++++++ base/services/dnsrslvr/precomp.h | 5 ++ base/services/dnsrslvr/rpcserver.c | 22 +++++++- dll/win32/dnsapi/dnsapi.spec | 4 +- dll/win32/dnsapi/query.c | 99 ++++++++++++++++++++++++++++++++++++ dll/win32/dnsapi/stubs.c | 22 -------- sdk/include/reactos/idl/dnsrslvr.idl | 7 ++- 7 files changed, 177 insertions(+), 27 deletions(-) diff --git a/base/services/dnsrslvr/cache.c b/base/services/dnsrslvr/cache.c index b232989f372..c3be82ccde5 100644 --- a/base/services/dnsrslvr/cache.c +++ b/base/services/dnsrslvr/cache.c @@ -101,6 +101,51 @@ DnsIntCacheFlush( return ERROR_SUCCESS; } + +DNS_STATUS +DnsIntFlushCacheEntry( + _In_ LPCWSTR pszName, + _In_ WORD wType) +{ + PLIST_ENTRY Entry, NextEntry; + PRESOLVER_CACHE_ENTRY CacheEntry; + + DPRINT("DnsIntFlushCacheEntry(%S %x)\n", pszName, wType); + + /* Lock the cache */ + DnsCacheLock(); + + /* Loop every entry */ + Entry = DnsCache.RecordList.Flink; + while (Entry != &DnsCache.RecordList) + { + NextEntry = Entry->Flink; + + /* Get this entry */ + CacheEntry = CONTAINING_RECORD(Entry, RESOLVER_CACHE_ENTRY, CacheLink); + + /* Remove it from the list */ + if ((_wcsicmp(CacheEntry->Record->pName, pszName) == 0) && + (CacheEntry->bHostsFileEntry == FALSE)) + { + if ((wType == DNS_TYPE_ANY) || + (CacheEntry->Record->wType == wType)) + { + DnsIntCacheRemoveEntryItem(CacheEntry); + } + } + + /* Move to the next entry */ + Entry = NextEntry; + } + + /* Unlock the cache */ + DnsCacheUnlock(); + + return ERROR_SUCCESS; +} + + DNS_STATUS DnsIntCacheGetEntryByName( LPCWSTR Name, diff --git a/base/services/dnsrslvr/precomp.h b/base/services/dnsrslvr/precomp.h index 2b7e5f35dd6..ac355a9f06f 100644 --- a/base/services/dnsrslvr/precomp.h +++ b/base/services/dnsrslvr/precomp.h @@ -52,6 +52,11 @@ DNS_STATUS DnsIntCacheFlush( _In_ ULONG ulFlags); +DNS_STATUS +DnsIntFlushCacheEntry( + _In_ LPCWSTR pszName, + _In_ WORD wType); + DNS_STATUS DnsIntCacheGetEntryByName( LPCWSTR Name, diff --git a/base/services/dnsrslvr/rpcserver.c b/base/services/dnsrslvr/rpcserver.c index 59e91cb4791..550e98786b1 100644 --- a/base/services/dnsrslvr/rpcserver.c +++ b/base/services/dnsrslvr/rpcserver.c @@ -60,15 +60,33 @@ CRrReadCache( DWORD __stdcall R_ResolverFlushCache( - _In_ DNSRSLVR_HANDLE pwszServerName) + _In_ DNSRSLVR_HANDLE pszServerName) { DPRINT("R_ResolverFlushCache(%S)\n", - pwszServerName); + pszServerName); return DnsIntCacheFlush(CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES); } +/* Function: 0x05 */ +DWORD +__stdcall +R_ResolverFlushCacheEntry( + _In_ DNSRSLVR_HANDLE pszServerName, + _In_ LPCWSTR pszName, + _In_ WORD wType) +{ + DPRINT("R_ResolverFlushCacheEntry(%S %S %x)\n", + pszServerName, pszName, wType); + + if (pszName == NULL) + return ERROR_INVALID_PARAMETER; + + return DnsIntFlushCacheEntry(pszName, wType); +} + + /* Function: 0x07 */ DWORD __stdcall diff --git a/dll/win32/dnsapi/dnsapi.spec b/dll/win32/dnsapi/dnsapi.spec index afc309e83bc..1b72ea192ca 100644 --- a/dll/win32/dnsapi/dnsapi.spec +++ b/dll/win32/dnsapi/dnsapi.spec @@ -39,8 +39,8 @@ @ stdcall DnsFindAuthoritativeZone() @ stdcall DnsFlushResolverCache() @ stdcall DnsFlushResolverCacheEntry_A(str) -@ stdcall DnsFlushResolverCacheEntry_UTF8() -@ stdcall DnsFlushResolverCacheEntry_W() +@ stdcall DnsFlushResolverCacheEntry_UTF8(str) +@ stdcall DnsFlushResolverCacheEntry_W(wstr) @ stdcall DnsFree(ptr long) @ stdcall DnsFreeAdapterInformation() @ stub DnsFreeConfigStructure diff --git a/dll/win32/dnsapi/query.c b/dll/win32/dnsapi/query.c index 6dbe665473e..8006a3f60bd 100644 --- a/dll/win32/dnsapi/query.c +++ b/dll/win32/dnsapi/query.c @@ -951,6 +951,105 @@ DnsFlushResolverCache(VOID) return (Status == ERROR_SUCCESS); } + +BOOL +WINAPI +DnsFlushResolverCacheEntry_A( + _In_ LPCSTR pszEntry) +{ + DNS_STATUS Status = ERROR_SUCCESS; + LPWSTR pszUnicodeEntry; + + DPRINT1("DnsFlushResolverCacheEntry_A(%s)\n", pszEntry); + + if (pszEntry == NULL) + return FALSE; + + pszUnicodeEntry = DnsCToW(pszEntry); + if (pszUnicodeEntry == NULL) + return FALSE; + + RpcTryExcept + { + Status = R_ResolverFlushCacheEntry(NULL, pszUnicodeEntry, DNS_TYPE_ANY); + DPRINT("R_ResolverFlushCacheEntry() returned %lu\n", Status); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = RpcExceptionCode(); + DPRINT("Exception returned %lu\n", Status); + } + RpcEndExcept; + + RtlFreeHeap(RtlGetProcessHeap(), 0, pszUnicodeEntry); + + return (Status == ERROR_SUCCESS); +} + + +BOOL +WINAPI +DnsFlushResolverCacheEntry_UTF8( + _In_ LPCSTR pszEntry) +{ + DNS_STATUS Status = ERROR_SUCCESS; + LPWSTR pszUnicodeEntry; + + DPRINT1("DnsFlushResolverCacheEntry_UTF8(%s)\n", pszEntry); + + if (pszEntry == NULL) + return FALSE; + + pszUnicodeEntry = DnsCToW(pszEntry); + if (pszUnicodeEntry == NULL) + return FALSE; + + RpcTryExcept + { + Status = R_ResolverFlushCacheEntry(NULL, pszUnicodeEntry, DNS_TYPE_ANY); + DPRINT("R_ResolverFlushCacheEntry() returned %lu\n", Status); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = RpcExceptionCode(); + DPRINT("Exception returned %lu\n", Status); + } + RpcEndExcept; + + RtlFreeHeap(RtlGetProcessHeap(), 0, pszUnicodeEntry); + + return (Status == ERROR_SUCCESS); +} + + +BOOL +WINAPI +DnsFlushResolverCacheEntry_W( + _In_ LPCWSTR pszEntry) +{ + DNS_STATUS Status = ERROR_SUCCESS; + + DPRINT1("DnsFlushResolverCacheEntry_W(%S)\n", pszEntry); + + if (pszEntry == NULL) + return FALSE; + + RpcTryExcept + { + Status = R_ResolverFlushCacheEntry(NULL, pszEntry, DNS_TYPE_ANY); + DPRINT("R_ResolverFlushCacheEntry() returned %lu\n", Status); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = RpcExceptionCode(); + DPRINT("Exception returned %lu\n", Status); + } + RpcEndExcept; + + return (Status == ERROR_SUCCESS); +} + + BOOL WINAPI DnsGetCacheDataTable( diff --git a/dll/win32/dnsapi/stubs.c b/dll/win32/dnsapi/stubs.c index 7d946ababfa..313792facda 100644 --- a/dll/win32/dnsapi/stubs.c +++ b/dll/win32/dnsapi/stubs.c @@ -216,28 +216,6 @@ DnsFindAuthoritativeZone() return ERROR_OUTOFMEMORY; } -BOOL WINAPI -DnsFlushResolverCacheEntry_A(PCSTR entry) -{ - DPRINT1("DnsFlushResolverCacheEntry_A(%s) is stubplemented.\n", entry); - if (!entry) return FALSE; - return TRUE; -} - -DNS_STATUS WINAPI -DnsFlushResolverCacheEntry_UTF8() -{ - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI -DnsFlushResolverCacheEntry_W() -{ - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - DNS_STATUS WINAPI DnsFreeAdapterInformation() { diff --git a/sdk/include/reactos/idl/dnsrslvr.idl b/sdk/include/reactos/idl/dnsrslvr.idl index 91cad5a52eb..ce4d3af41ae 100644 --- a/sdk/include/reactos/idl/dnsrslvr.idl +++ b/sdk/include/reactos/idl/dnsrslvr.idl @@ -50,7 +50,12 @@ interface DnsResolver [in, unique, string] DNSRSLVR_HANDLE pwszServerName); /* Function: 0x05 */ - /* R_ResolverFlushCacheEntry */ + DWORD + __stdcall + R_ResolverFlushCacheEntry( + [in, unique, string] DNSRSLVR_HANDLE pwszServerName, + [in, string] LPCWSTR pszName, + [in] WORD wType); /* Function: 0x06 */ /* R_ResolverRegisterCluster */
3 years, 7 months
1
0
0
0
[reactos] 01/01: [HAL] HalpDebugPciDumpBus: Print details about PCI bridges
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b232efe12a41615c59232…
commit b232efe12a41615c59232aa14d2d3484ad1c2b04 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Sun May 23 15:48:21 2021 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sun May 23 15:48:21 2021 +0300 [HAL] HalpDebugPciDumpBus: Print details about PCI bridges CORE-16319 CORE-16216 --- hal/halx86/legacy/bussupp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hal/halx86/legacy/bussupp.c b/hal/halx86/legacy/bussupp.c index 65a9e5c8e1c..4b855ec596e 100644 --- a/hal/halx86/legacy/bussupp.c +++ b/hal/halx86/legacy/bussupp.c @@ -929,6 +929,17 @@ HalpDebugPciDumpBus(IN ULONG i, else if (PciData->u.type0.InterruptPin != 0) DbgPrint(", IRQ assignment required"); DbgPrint("\n"); + if ((PciData->HeaderType & ~PCI_MULTIFUNCTION) == PCI_BRIDGE_TYPE && + PciData->BaseClass == PCI_CLASS_BRIDGE_DEV) + { + DbgPrint("\tBridge:"); + DbgPrint(" primary bus %d,", PciData->u.type1.PrimaryBus); + DbgPrint(" secondary bus %d,", PciData->u.type1.SecondaryBus); + DbgPrint(" subordinate bus %d,", PciData->u.type1.SubordinateBus); + DbgPrint(" secondary latency %d", PciData->u.type1.SecondaryLatency); + DbgPrint("\n"); + } + /* Scan addresses */ Size = 0; for (b = 0; b < PCI_TYPE0_ADDRESSES; b++)
3 years, 7 months
1
0
0
0
[reactos] 01/01: [CMAKE] Store and re-use M4 and BISON_PKGDATADIR env variables
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=18e95f5a4e4e068b4fbd8…
commit 18e95f5a4e4e068b4fbd8627382a6ba97260fbf2 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Apr 3 15:10:38 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat May 22 16:38:17 2021 +0200 [CMAKE] Store and re-use M4 and BISON_PKGDATADIR env variables ROSBE-174 --- CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++++ sdk/cmake/host-tools.cmake | 2 ++ 2 files changed, 37 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1fe5f46462..b460c642887 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,41 @@ endif() find_package(BISON REQUIRED) find_package(FLEX REQUIRED) +if(MSVC_IDE) + # Bison needs M4 and BISON_PKGDATADIR set at build time, + # but visual studio is hardly ever opened from the configure-time environment. + # Since cmake does not support setting env variables for a custom command, + # we have to write a wrapper that sets the variables and then executes bison. + # Idea taken from
https://stackoverflow.com/a/35032051/4928207
+ if(DEFINED ENV{M4}) + # Store this environment variable for configure re-runs from withing visual studio. + SET(ROS_SAVED_M4 "$ENV{M4}" CACHE INTERNAL "") + endif() + if(DEFINED ENV{BISON_PKGDATADIR}) + SET(ROS_SAVED_BISON_PKGDATADIR "$ENV{BISON_PKGDATADIR}" CACHE INTERNAL "") + endif() + + # Tell the user about a misconfigured environment + if("x${ROS_SAVED_M4}x" STREQUAL "xx" OR "x${ROS_SAVED_BISON_PKGDATADIR}x" STREQUAL "xx") + message(FATAL_ERROR "\nM4 or BISON_PKGDATADIR environment variables not set, cannot continue!\n" + "See
https://reactos.org/wiki/Visual_Studio
for more information!") + endif() + + file(WRITE "${CMAKE_BINARY_DIR}/bison_wrapper.cmd" + "@ECHO OFF\n" + "set M4=${ROS_SAVED_M4}\n" + "set BISON_PKGDATADIR=${ROS_SAVED_BISON_PKGDATADIR}\n" + "${BISON_EXECUTABLE} %*\n") + set(BISON_EXECUTABLE "${CMAKE_BINARY_DIR}/bison_wrapper.cmd") + # And the same hacks for FLEX + file(WRITE "${CMAKE_BINARY_DIR}/flex_wrapper.cmd" + "@ECHO OFF\n" + "set M4=${ROS_SAVED_M4}\n" + "set BISON_PKGDATADIR=${ROS_SAVED_BISON_PKGDATADIR}\n" + "${FLEX_EXECUTABLE} %*\n") + set(FLEX_EXECUTABLE "${CMAKE_BINARY_DIR}/flex_wrapper.cmd") +endif() + if(NOT CMAKE_CROSSCOMPILING) set(TOOLS_FOLDER ${CMAKE_CURRENT_BINARY_DIR}) add_definitions(-DTARGET_${ARCH}) diff --git a/sdk/cmake/host-tools.cmake b/sdk/cmake/host-tools.cmake index 0c2b77d63c8..6c550c57d4a 100644 --- a/sdk/cmake/host-tools.cmake +++ b/sdk/cmake/host-tools.cmake @@ -45,6 +45,8 @@ function(setup_host_tools) -DARCH:STRING=${ARCH} -DCMAKE_INSTALL_PREFIX=${REACTOS_BINARY_DIR}/host-tools -DTOOLS_FOLDER=${REACTOS_BINARY_DIR}/host-tools/bin + -DROS_SAVED_M4=${ROS_SAVED_M4} + -DROS_SAVED_BISON_PKGDATADIR=${ROS_SAVED_BISON_PKGDATADIR} -DTARGET_COMPILER_ID=${CMAKE_C_COMPILER_ID} ${CMAKE_HOST_TOOLS_EXTRA_ARGS} BUILD_ALWAYS TRUE
3 years, 7 months
1
0
0
0
[reactos] 01/01: [SHELL32] Include the folder path in logging
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9fcdc68182b9414131f16…
commit 9fcdc68182b9414131f1697b303152c57b2db0bf Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat May 22 16:34:54 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat May 22 16:34:54 2021 +0200 [SHELL32] Include the folder path in logging --- dll/win32/shell32/folders/CFSFolder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/shell32/folders/CFSFolder.cpp b/dll/win32/shell32/folders/CFSFolder.cpp index 6adaba0d47c..d713680dfba 100644 --- a/dll/win32/shell32/folders/CFSFolder.cpp +++ b/dll/win32/shell32/folders/CFSFolder.cpp @@ -389,7 +389,7 @@ private: hr = SHELL32_GetCLSIDForDirectory(Tmp, L"CLSID", &clsidFolder); if (SUCCEEDED(hr)) { - ERR("SHOULD DO SOMETHING WITH CLSID?\n"); + ERR("Got CLSID override for '%S'\n", Tmp); } } }
3 years, 7 months
1
0
0
0
[reactos] 01/01: [RTL][KERNEL32] Move the STUB printing code to a place where it's actually called
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b58c3d73ca71f0b9c38e1…
commit b58c3d73ca71f0b9c38e1006ac40cf588cd560a7 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat May 22 16:33:19 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat May 22 16:33:19 2021 +0200 [RTL][KERNEL32] Move the STUB printing code to a place where it's actually called --- dll/win32/kernel32/client/except.c | 18 +++++++----------- sdk/lib/rtl/exception.c | 7 +++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/dll/win32/kernel32/client/except.c b/dll/win32/kernel32/client/except.c index 36fab314f49..38ac16fb8c3 100644 --- a/dll/win32/kernel32/client/except.c +++ b/dll/win32/kernel32/client/except.c @@ -107,6 +107,13 @@ PrintStackTrace(IN PEXCEPTION_POINTERS ExceptionInfo) DbgPrint("Faulting Address: %8x\n", ExceptionRecord->ExceptionInformation[1]); } + /* Trace the wine special error and show the modulename and functionname */ + if (ExceptionRecord->ExceptionCode == 0x80000100 /* EXCEPTION_WINE_STUB */ && + ExceptionRecord->NumberParameters == 2) + { + DbgPrint("Missing function: %s!%s\n", (PSZ)ExceptionRecord->ExceptionInformation[0], (PSZ)ExceptionRecord->ExceptionInformation[1]); + } + _dump_context(ContextRecord); _module_name_from_addr(ExceptionRecord->ExceptionAddress, &StartAddr, szMod, sizeof(szMod), &szModFile); DbgPrint("Address:\n<%s:%x> (%s@%x)\n", @@ -730,17 +737,6 @@ RaiseException(IN DWORD dwExceptionCode, DPRINT1("Exception text: %lx\n", ExceptionRecord.ExceptionInformation[2]); } - /* Trace the wine special error and show the modulename and functionname */ - if (dwExceptionCode == 0x80000100 /* EXCEPTION_WINE_STUB */) - { - /* Numbers of parameter must be equal to two */ - if (ExceptionRecord.NumberParameters == 2) - { - DPRINT1("Missing function in : %s\n", ExceptionRecord.ExceptionInformation[0]); - DPRINT1("with the functionname : %s\n", ExceptionRecord.ExceptionInformation[1]); - } - } - /* Raise the exception */ RtlRaiseException(&ExceptionRecord); } diff --git a/sdk/lib/rtl/exception.c b/sdk/lib/rtl/exception.c index 0abbcc53055..e90b28fac46 100644 --- a/sdk/lib/rtl/exception.c +++ b/sdk/lib/rtl/exception.c @@ -251,6 +251,13 @@ static VOID DbgPrint("Faulting Address: %8x\n", ExceptionRecord->ExceptionInformation[1]); } + /* Trace the wine special error and show the modulename and functionname */ + if (ExceptionRecord->ExceptionCode == 0x80000100 /* EXCEPTION_WINE_STUB */ && + ExceptionRecord->NumberParameters == 2) + { + DbgPrint("Missing function: %s!%s\n", (PSZ)ExceptionRecord->ExceptionInformation[0], (PSZ)ExceptionRecord->ExceptionInformation[1]); + } + _dump_context(ContextRecord); _module_name_from_addr(ExceptionRecord->ExceptionAddress, &StartAddr, szMod, sizeof(szMod)); DbgPrint("Address:\n %8x+%-8x %s\n",
3 years, 7 months
1
0
0
0
[reactos] 01/01: [WIN32SS] Skip . and .. when enumerating fonts
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1c97b84600096f775faef…
commit 1c97b84600096f775faefb9244faacebb3c54616 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat May 22 16:31:31 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat May 22 16:31:31 2021 +0200 [WIN32SS] Skip . and .. when enumerating fonts --- win32ss/gdi/ntgdi/freetype.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 79c825f0170..efcb2c2c477 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -960,6 +960,11 @@ IntLoadSystemFonts(VOID) RTL_CONSTANT_STRING(L"*.fon"), RTL_CONSTANT_STRING(L"*.fnt") }; + static UNICODE_STRING IgnoreFiles[] = + { + RTL_CONSTANT_STRING(L"."), + RTL_CONSTANT_STRING(L".."), + }; RtlInitUnicodeString(&Directory, L"\\SystemRoot\\Fonts\\"); @@ -1022,14 +1027,33 @@ IntLoadSystemFonts(VOID) DirInfo = (PFILE_DIRECTORY_INFORMATION)DirInfoBuffer; while (1) { + SIZE_T ign; + TempString.Buffer = DirInfo->FileName; - TempString.Length = - TempString.MaximumLength = DirInfo->FileNameLength; - RtlCopyUnicodeString(&FileName, &Directory); - RtlAppendUnicodeStringToString(&FileName, &TempString); - IntGdiAddFontResourceEx(&FileName, 0, AFRX_WRITE_REGISTRY); + TempString.Length = TempString.MaximumLength = DirInfo->FileNameLength; + + /* Should we ignore this file? */ + for (ign = 0; ign < _countof(IgnoreFiles); ++ign) + { + /* Yes.. */ + if (RtlEqualUnicodeString(IgnoreFiles + ign, &TempString, FALSE)) + break; + } + + /* If we tried all Ignore patterns and there was no match, try to create a font */ + if (ign == _countof(IgnoreFiles)) + { + RtlCopyUnicodeString(&FileName, &Directory); + RtlAppendUnicodeStringToString(&FileName, &TempString); + if (!IntGdiAddFontResourceEx(&FileName, 0, AFRX_WRITE_REGISTRY)) + { + DPRINT1("ERR: Failed to load %wZ\n", &FileName); + } + } + if (DirInfo->NextEntryOffset == 0) break; + DirInfo = (PFILE_DIRECTORY_INFORMATION)((ULONG_PTR)DirInfo + DirInfo->NextEntryOffset); }
3 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
19
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Results per page:
10
25
50
100
200