Author: fireball Date: Fri Jan 25 19:35:34 2008 New Revision: 31999
URL: http://svn.reactos.org/svn/reactos?rev=31999&view=rev Log: - Make identifiers in configuration trees ASCII-strings, as they are in real NT. - NB: Don't forget to update the bootloader in your installation.
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/include/arch/i386/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c trunk/reactos/ntoskrnl/config/cmconfig.c trunk/reactos/ntoskrnl/config/cmdata.c trunk/reactos/ntoskrnl/include/internal/cm.h
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c Fri Jan 25 19:35:34 2008 @@ -79,7 +79,7 @@ /* Timeout in ms for sending to keyboard controller. */ #define CONTROLLER_TIMEOUT 250
-static WCHAR Hex[] = L"0123456789ABCDEF"; +static CHAR Hex[] = "0123456789ABCDEF"; static unsigned int delay_count = 1;
extern ULONG reactos_disk_count; @@ -252,7 +252,7 @@ 0xFFFFFFFF);
/* Set the identifier */ - FldrSetIdentifier(BusKey, L"PNP BIOS"); + FldrSetIdentifier(BusKey, "PNP BIOS");
/* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount); @@ -405,7 +405,7 @@ ULONG i; ULONG Checksum; ULONG Signature; - WCHAR Identifier[20]; + CHAR Identifier[20]; CHAR ArcName[256];
/* Read the MBR */ @@ -448,7 +448,7 @@ Identifier[5] = Hex[(Checksum >> 8) & 0x0F]; Identifier[6] = Hex[(Checksum >> 4) & 0x0F]; Identifier[7] = Hex[Checksum & 0x0F]; - Identifier[8] = L'-'; + Identifier[8] = '-'; Identifier[9] = Hex[(Signature >> 28) & 0x0F]; Identifier[10] = Hex[(Signature >> 24) & 0x0F]; Identifier[11] = Hex[(Signature >> 20) & 0x0F]; @@ -457,10 +457,10 @@ Identifier[14] = Hex[(Signature >> 8) & 0x0F]; Identifier[15] = Hex[(Signature >> 4) & 0x0F]; Identifier[16] = Hex[Signature & 0x0F]; - Identifier[17] = L'-'; - Identifier[18] = L'A'; + Identifier[17] = '-'; + Identifier[18] = 'A'; Identifier[19] = 0; - DbgPrint((DPRINT_HWDETECT, "Identifier: %S\n", Identifier)); + DbgPrint((DPRINT_HWDETECT, "Identifier: %s\n", Identifier));
/* Set identifier */ FldrSetIdentifier(DiskKey, Identifier); @@ -511,7 +511,7 @@ PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCM_FLOPPY_DEVICE_DATA FloppyData; - WCHAR Identifier[20]; + CHAR Identifier[20]; PCONFIGURATION_COMPONENT_DATA PeripheralKey; ULONG Size; ULONG FloppyNumber; @@ -579,7 +579,7 @@ MmHeapFree(PartialResourceList);
/* Set 'Identifier' value */ - swprintf(Identifier, L"FLOPPY%u", FloppyNumber + 1); + sprintf(Identifier, "FLOPPY%u", FloppyNumber + 1); FldrSetIdentifier(PeripheralKey, Identifier); } } @@ -956,7 +956,7 @@ { CM_PARTIAL_RESOURCE_LIST PartialResourceList; char Buffer[256]; - WCHAR Identifier[256]; + CHAR Identifier[256]; PCONFIGURATION_COMPONENT_DATA PeripheralKey; ULONG MouseType; ULONG Length; @@ -1063,28 +1063,28 @@ }
DbgPrint((DPRINT_HWDETECT, - "Identifier string: %S\n", + "Identifier string: %s\n", Identifier)); }
- if (Length == 0 || wcslen(Identifier) < 11) + if (Length == 0 || strlen(Identifier) < 11) { switch (MouseType) { case MOUSE_TYPE_LOGITECH: - wcscpy (Identifier, - L"LOGITECH SERIAL MOUSE"); + strcpy (Identifier, + "LOGITECH SERIAL MOUSE"); break;
case MOUSE_TYPE_WHEELZ: - wcscpy (Identifier, - L"MICROSOFT SERIAL MOUSE WITH WHEEL"); + strcpy (Identifier, + "MICROSOFT SERIAL MOUSE WITH WHEEL"); break;
case MOUSE_TYPE_MICROSOFT: default: - wcscpy (Identifier, - L"MICROSOFT SERIAL MOUSE"); + strcpy (Identifier, + "MICROSOFT SERIAL MOUSE"); break; } } @@ -1130,7 +1130,7 @@ PCM_SERIAL_DEVICE_DATA SerialDeviceData; ULONG Irq[4] = {4, 3, 4, 3}; ULONG Base; - WCHAR Buffer[80]; + CHAR Buffer[80]; PUSHORT BasePtr; ULONG ControllerNumber = 0; PCONFIGURATION_COMPONENT_DATA ControllerKey; @@ -1218,7 +1218,7 @@ MmHeapFree(PartialResourceList);
/* Set 'Identifier' value */ - swprintf(Buffer, L"COM%u", i + 1); + sprintf(Buffer, "COM%u", i + 1); FldrSetIdentifier(ControllerKey, Buffer); DbgPrint((DPRINT_HWDETECT, "Created value: Identifier %s\n", @@ -1241,7 +1241,7 @@ PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; ULONG Irq[3] = {7, 5, (ULONG)-1}; - WCHAR Buffer[80]; + CHAR Buffer[80]; PCONFIGURATION_COMPONENT_DATA ControllerKey; PUSHORT BasePtr; ULONG Base; @@ -1323,7 +1323,7 @@ MmHeapFree(PartialResourceList);
/* Set 'Identifier' value */ - swprintf(Buffer, L"PARALLEL%u", i + 1); + sprintf(Buffer, "PARALLEL%u", i + 1); FldrSetIdentifier(ControllerKey, Buffer); DbgPrint((DPRINT_HWDETECT, "Created value: Identifier %s\n", @@ -1468,7 +1468,7 @@ MmHeapFree(PartialResourceList);
/* Set 'Identifier' value */ - FldrSetIdentifier(PeripheralKey, L"PCAT_ENHANCED"); + FldrSetIdentifier(PeripheralKey, "PCAT_ENHANCED"); } }
@@ -1735,7 +1735,7 @@ sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
/* Set 'Identifier' value */ - FldrSetIdentifier(PeripheralKey, L"MICROSOFT PS2 MOUSE"); + FldrSetIdentifier(PeripheralKey, "MICROSOFT PS2 MOUSE"); } } } @@ -1744,7 +1744,7 @@ static VOID DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey) { - WCHAR Buffer[80]; + CHAR Buffer[80]; PCONFIGURATION_COMPONENT_DATA ControllerKey; USHORT VesaVersion;
@@ -1780,13 +1780,13 @@
if (VesaVersion >= 0x0200) { - wcscpy(Buffer, - L"VBE Display"); + strcpy(Buffer, + "VBE Display"); } else { - wcscpy(Buffer, - L"VGA Display"); + strcpy(Buffer, + "VGA Display"); }
/* Set 'Identifier' value */ @@ -1821,7 +1821,7 @@ (*BusNumber)++;
/* Set 'Identifier' value */ - FldrSetIdentifier(BusKey, L"ISA"); + FldrSetIdentifier(BusKey, "ISA");
/* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c Fri Jan 25 19:35:34 2008 @@ -86,7 +86,7 @@ (*BusNumber)++;
/* Set 'Identifier' value */ - FldrSetIdentifier(BiosKey, L"ACPI BIOS"); + FldrSetIdentifier(BiosKey, "ACPI BIOS"); }
/* FIXME: Add congiguration data */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c Fri Jan 25 19:35:34 2008 @@ -89,7 +89,7 @@ (*BusNumber)++;
/* Set 'Identifier' value */ - FldrSetIdentifier(BiosKey, L"APM"); + FldrSetIdentifier(BiosKey, "APM"); }
/* FIXME: Add configuration data */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c Fri Jan 25 19:35:34 2008 @@ -168,7 +168,7 @@ 0xFFFFFFFF);
/* Set 'Identifier' value */ - FldrSetIdentifier(TableKey, L"PCI Real-mode IRQ Routing Table"); + FldrSetIdentifier(TableKey, "PCI Real-mode IRQ Routing Table");
/* Set 'Configuration Data' value */ Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) + @@ -218,7 +218,7 @@ ULONG Size; PCONFIGURATION_COMPONENT_DATA BusKey; ULONG i; - WCHAR szPci[] = L"PCI"; + CHAR szPci[] = "PCI";
/* Report the PCI BIOS */ if (FindPciBios(&BusData)) @@ -241,7 +241,7 @@ (*BusNumber)++;
/* Set 'Identifier' value */ - FldrSetIdentifier(BiosKey, L"PCI BIOS"); + FldrSetIdentifier(BiosKey, "PCI BIOS");
/* Set 'Configuration Data' value */ Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c Fri Jan 25 19:35:34 2008 @@ -22,7 +22,7 @@ #define NDEBUG #include <debug.h>
-static WCHAR Hex[] = L"0123456789ABCDEF"; +static CHAR Hex[] = "0123456789ABCDEF"; //static unsigned int delay_count = 1;
extern ULONG reactos_disk_count; @@ -102,7 +102,7 @@ ULONG i; ULONG Checksum; ULONG Signature; - WCHAR Identifier[20]; + CHAR Identifier[20]; CHAR ArcName[256];
/* Read the MBR */ @@ -145,7 +145,7 @@ Identifier[5] = Hex[(Checksum >> 8) & 0x0F]; Identifier[6] = Hex[(Checksum >> 4) & 0x0F]; Identifier[7] = Hex[Checksum & 0x0F]; - Identifier[8] = L'-'; + Identifier[8] = '-'; Identifier[9] = Hex[(Signature >> 28) & 0x0F]; Identifier[10] = Hex[(Signature >> 24) & 0x0F]; Identifier[11] = Hex[(Signature >> 20) & 0x0F]; @@ -154,10 +154,10 @@ Identifier[14] = Hex[(Signature >> 8) & 0x0F]; Identifier[15] = Hex[(Signature >> 4) & 0x0F]; Identifier[16] = Hex[Signature & 0x0F]; - Identifier[17] = L'-'; - Identifier[18] = L'A'; + Identifier[17] = '-'; + Identifier[18] = 'A'; Identifier[19] = 0; - DbgPrint((DPRINT_HWDETECT, "Identifier: %S\n", Identifier)); + DbgPrint((DPRINT_HWDETECT, "Identifier: %s\n", Identifier));
/* Set identifier */ FldrSetIdentifier(DiskKey, Identifier); @@ -318,7 +318,7 @@ (*BusNumber)++;
/* Set 'Identifier' value */ - FldrSetIdentifier(BusKey, L"ISA"); + FldrSetIdentifier(BusKey, "ISA");
/* Set 'Configuration Data' value */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h Fri Jan 25 19:35:34 2008 @@ -51,7 +51,7 @@ NTAPI FldrSetIdentifier( IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PWCHAR Identifier + IN PCHAR Identifier );
VOID
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h Fri Jan 25 19:35:34 2008 @@ -50,7 +50,7 @@ NTAPI FldrSetIdentifier( IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PWCHAR Identifier + IN PCHAR Identifier );
VOID
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/reacto... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c Fri Jan 25 19:35:34 2008 @@ -71,21 +71,20 @@ VOID NTAPI FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, - IN PWCHAR IdentifierString) + IN PCHAR IdentifierString) { ULONG IdentifierLength; PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; PCHAR Identifier;
/* Allocate memory for the identifier */ - /* WARNING: This should be ASCII data */ - IdentifierLength = (wcslen(IdentifierString) + 1) * sizeof(WCHAR); + IdentifierLength = strlen(IdentifierString) + 1; Identifier = FldrpHwHeapAlloc(IdentifierLength); if (!Identifier) return; - + /* Copy the identifier */ RtlCopyMemory(Identifier, IdentifierString, IdentifierLength); - + /* Set component information */ Component->IdentifierLength = IdentifierLength; Component->Identifier = Identifier;
Modified: trunk/reactos/ntoskrnl/config/cmconfig.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmconfig.c?... ============================================================================== --- trunk/reactos/ntoskrnl/config/cmconfig.c (original) +++ trunk/reactos/ntoskrnl/config/cmconfig.c Fri Jan 25 19:35:34 2008 @@ -115,7 +115,6 @@ Status = RtlAnsiStringToUnicodeString(&ValueData, &TempString, TRUE); - RtlCreateUnicodeString(&ValueData, (PWCHAR)Component->Identifier); if (NT_SUCCESS(Status)) { /* Save the identifier in the registry */ @@ -244,8 +243,8 @@ for (i = 0; CmpMultifunctionTypes[i].Identifier; i++) { /* Check for a name match */ - if (!_wcsicmp(CmpMultifunctionTypes[i].Identifier, - (PWCHAR)Component->Identifier)) + if (!_stricmp(CmpMultifunctionTypes[i].Identifier, + Component->Identifier)) { /* Match found */ break;
Modified: trunk/reactos/ntoskrnl/config/cmdata.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmdata.c?re... ============================================================================== --- trunk/reactos/ntoskrnl/config/cmdata.c (original) +++ trunk/reactos/ntoskrnl/config/cmdata.c Fri Jan 25 19:35:34 2008 @@ -124,14 +124,14 @@
CMP_MF_TYPE CmpMultifunctionTypes[] = { - {L"ISA", Isa, 0}, - {L"MCA", MicroChannel, 0}, - {L"PCI", PCIBus, 0}, - {L"VME", VMEBus, 0}, - {L"PCMCIA", PCMCIABus, 0}, - {L"CBUS", CBus, 0}, - {L"MPIPI", MPIBus, 0}, - {L"MPSA", MPSABus, 0}, + {"ISA", Isa, 0}, + {"MCA", MicroChannel, 0}, + {"PCI", PCIBus, 0}, + {"VME", VMEBus, 0}, + {"PCMCIA", PCMCIABus, 0}, + {"CBUS", CBus, 0}, + {"MPIPI", MPIBus, 0}, + {"MPSA", MPSABus, 0}, {NULL, Internal, 0} };
Modified: trunk/reactos/ntoskrnl/include/internal/cm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/c... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/cm.h (original) +++ trunk/reactos/ntoskrnl/include/internal/cm.h Fri Jan 25 19:35:34 2008 @@ -472,9 +472,9 @@ // typedef struct _CMP_MF_TYPE { - PWCHAR Identifier; + PCHAR Identifier; USHORT InterfaceType; - USHORT Count; + USHORT Count; } CMP_MF_TYPE, *PCMP_MF_TYPE;
//