From df5138e0a0aa318c8cc9525d012bdbefd19882d4 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 13 Nov 2005 06:05:06 +0000 Subject: [PATCH] - Remove duplicated code in "rtl" and use libstring and librtl instead (their code is safe for freeldr). - Fix a PCH bug. svn path=/trunk/; revision=19192 --- .../boot/freeldr/freeldr/arch/i386/i386disk.c | 4 +- .../boot/freeldr/freeldr/arch/i386/pcvideo.c | 4 +- reactos/boot/freeldr/freeldr/bootmgr.c | 12 +- reactos/boot/freeldr/freeldr/cmdline.c | 4 +- reactos/boot/freeldr/freeldr/drivemap.c | 2 +- reactos/boot/freeldr/freeldr/freeldr.xml | 2 + reactos/boot/freeldr/freeldr/freeldr_base.xml | 8 - .../boot/freeldr/freeldr/freeldr_base64k.xml | 1 - reactos/boot/freeldr/freeldr/freeldr_main.xml | 2 - .../boot/freeldr/freeldr/freeldr_startup.xml | 1 - reactos/boot/freeldr/freeldr/fs/ext2.c | 2 +- reactos/boot/freeldr/freeldr/fs/fat.c | 6 +- reactos/boot/freeldr/freeldr/fs/iso.c | 2 +- .../boot/freeldr/freeldr/inffile/inffile.c | 12 +- .../boot/freeldr/freeldr/inifile/inifile.c | 4 +- .../boot/freeldr/freeldr/reactos/arcname.c | 16 +- reactos/boot/freeldr/freeldr/reactos/loader.c | 4 +- .../boot/freeldr/freeldr/reactos/reactos.c | 6 +- .../boot/freeldr/freeldr/reactos/registry.c | 10 +- reactos/boot/freeldr/freeldr/rtl/list.c | 1 + reactos/boot/freeldr/freeldr/rtl/memcmp.c | 37 ---- reactos/boot/freeldr/freeldr/rtl/memcpy.c | 50 ----- reactos/boot/freeldr/freeldr/rtl/memmove.c | 54 ----- reactos/boot/freeldr/freeldr/rtl/memset.c | 49 ----- reactos/boot/freeldr/freeldr/rtl/print.c | 182 ----------------- reactos/boot/freeldr/freeldr/rtl/stdlib.c | 192 ------------------ reactos/boot/freeldr/freeldr/rtl/string.c | 176 ---------------- reactos/boot/freeldr/freeldr/ui/tui.c | 104 +++++++--- reactos/boot/freeldr/freeldr/ui/tuimenu.c | 10 +- reactos/boot/freeldr/freeldr/ui/ui.c | 4 +- 30 files changed, 134 insertions(+), 827 deletions(-) delete mode 100644 reactos/boot/freeldr/freeldr/rtl/memcmp.c delete mode 100644 reactos/boot/freeldr/freeldr/rtl/memcpy.c delete mode 100644 reactos/boot/freeldr/freeldr/rtl/memmove.c delete mode 100644 reactos/boot/freeldr/freeldr/rtl/memset.c delete mode 100644 reactos/boot/freeldr/freeldr/rtl/print.c delete mode 100644 reactos/boot/freeldr/freeldr/rtl/stdlib.c delete mode 100644 reactos/boot/freeldr/freeldr/rtl/string.c diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c b/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c index d2bc5dec820..c1c0c5abb96 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c @@ -451,7 +451,7 @@ i386DiskGetBootPath(char *BootPath, unsigned Size) static char Path[] = "multi(0)disk(0)"; char Device[4]; - itoa(i386BootDrive, Device, 10); + _itoa(i386BootDrive, Device, 10); if (Size <= sizeof(Path) + 6 + strlen(Device)) { return FALSE; @@ -491,7 +491,7 @@ i386DiskNormalizeSystemPath(char *SystemPath, unsigned Size) } p = SystemPath; - while ('\0' != *p && 0 != strnicmp(p, "partition(", 10)) { + while ('\0' != *p && 0 != _strnicmp(p, "partition(", 10)) { p++; } p = strchr(p, ')'); diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c index 9087472f99f..c64f12cf404 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c @@ -895,11 +895,11 @@ PcVideoSetDisplayMode(char *DisplayModeName, BOOL Init) { DbgPrint((DPRINT_UI, "VGA display adapter detected.\n")); - if (0 == stricmp(DisplayModeName, "NORMAL_VGA")) + if (0 == _stricmp(DisplayModeName, "NORMAL_VGA")) { VideoMode = VIDEOMODE_NORMAL_TEXT; } - else if (0 == stricmp(DisplayModeName, "EXTENDED_VGA")) + else if (0 == _stricmp(DisplayModeName, "EXTENDED_VGA")) { VideoMode = VIDEOMODE_EXTENDED_TEXT; } diff --git a/reactos/boot/freeldr/freeldr/bootmgr.c b/reactos/boot/freeldr/freeldr/bootmgr.c index 069fb1e9d40..a191b184d28 100644 --- a/reactos/boot/freeldr/freeldr/bootmgr.c +++ b/reactos/boot/freeldr/freeldr/bootmgr.c @@ -120,23 +120,23 @@ NoGui: // Install the drive mapper according to this sections drive mappings DriveMapMapDrivesInSection(OperatingSystemSectionNames[SelectedOperatingSystem]); - if (stricmp(SettingValue, "ReactOS") == 0) + if (_stricmp(SettingValue, "ReactOS") == 0) { LoadAndBootReactOS(OperatingSystemSectionNames[SelectedOperatingSystem]); } - else if (stricmp(SettingValue, "Linux") == 0) + else if (_stricmp(SettingValue, "Linux") == 0) { LoadAndBootLinux(OperatingSystemSectionNames[SelectedOperatingSystem], OperatingSystemDisplayNames[SelectedOperatingSystem]); } - else if (stricmp(SettingValue, "BootSector") == 0) + else if (_stricmp(SettingValue, "BootSector") == 0) { LoadAndBootBootSector(OperatingSystemSectionNames[SelectedOperatingSystem]); } - else if (stricmp(SettingValue, "Partition") == 0) + else if (_stricmp(SettingValue, "Partition") == 0) { LoadAndBootPartition(OperatingSystemSectionNames[SelectedOperatingSystem]); } - else if (stricmp(SettingValue, "Drive") == 0) + else if (_stricmp(SettingValue, "Drive") == 0) { LoadAndBootDrive(OperatingSystemSectionNames[SelectedOperatingSystem]); } @@ -174,7 +174,7 @@ ULONG GetDefaultOperatingSystem(PCSTR OperatingSystemList[], ULONG OperatingSy { for (Idx=0; Idx= 4) diff --git a/reactos/boot/freeldr/freeldr/freeldr.xml b/reactos/boot/freeldr/freeldr/freeldr.xml index f83a20fcd32..85a6556fd59 100644 --- a/reactos/boot/freeldr/freeldr/freeldr.xml +++ b/reactos/boot/freeldr/freeldr/freeldr.xml @@ -5,4 +5,6 @@ freeldr_base freeldr_main rossym + string + rtl diff --git a/reactos/boot/freeldr/freeldr/freeldr_base.xml b/reactos/boot/freeldr/freeldr/freeldr_base.xml index f20a5a5a63a..ab8277bce4d 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_base.xml +++ b/reactos/boot/freeldr/freeldr/freeldr_base.xml @@ -3,7 +3,6 @@ cache include - -nostdlib -ffreestanding -fno-builtin -fno-inline @@ -80,13 +79,6 @@ list.c - memcmp.c - memcpy.c - memmove.c - memset.c - print.c - stdlib.c - string.c gui.c diff --git a/reactos/boot/freeldr/freeldr/freeldr_base64k.xml b/reactos/boot/freeldr/freeldr/freeldr_base64k.xml index da6aad5508b..f7f774d60d7 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_base64k.xml +++ b/reactos/boot/freeldr/freeldr/freeldr_base64k.xml @@ -2,7 +2,6 @@ include include - -nostdlib -ffreestanding -fno-builtin -fno-inline diff --git a/reactos/boot/freeldr/freeldr/freeldr_main.xml b/reactos/boot/freeldr/freeldr/freeldr_main.xml index 4c8c6f581a6..b6e54cdb417 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_main.xml +++ b/reactos/boot/freeldr/freeldr/freeldr_main.xml @@ -2,7 +2,6 @@ include include - -nostdlib -ffreestanding -fno-builtin -fno-inline @@ -15,5 +14,4 @@ linuxboot.c oslist.c custom.c - include/freeldr.h diff --git a/reactos/boot/freeldr/freeldr/freeldr_startup.xml b/reactos/boot/freeldr/freeldr/freeldr_startup.xml index b6c9d5a48fd..815201a88a2 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_startup.xml +++ b/reactos/boot/freeldr/freeldr/freeldr_startup.xml @@ -2,7 +2,6 @@ include include - -nostdlib -ffreestanding -fno-builtin -fno-inline diff --git a/reactos/boot/freeldr/freeldr/fs/ext2.c b/reactos/boot/freeldr/freeldr/fs/ext2.c index 18c5442f86e..50c798871ba 100644 --- a/reactos/boot/freeldr/freeldr/fs/ext2.c +++ b/reactos/boot/freeldr/freeldr/fs/ext2.c @@ -306,7 +306,7 @@ BOOL Ext2SearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize DbgPrint((DPRINT_FILESYSTEM, "Dumping directory entry at offset %d:\n", CurrentOffset)); DbgDumpBuffer(DPRINT_FILESYSTEM, CurrentDirectoryEntry, CurrentDirectoryEntry->rec_len); - if ((strnicmp(FileName, CurrentDirectoryEntry->name, CurrentDirectoryEntry->name_len) == 0) && + if ((_strnicmp(FileName, CurrentDirectoryEntry->name, CurrentDirectoryEntry->name_len) == 0) && (strlen(FileName) == CurrentDirectoryEntry->name_len)) { RtlCopyMemory(DirectoryEntry, CurrentDirectoryEntry, sizeof(EXT2_DIR_ENTRY)); diff --git a/reactos/boot/freeldr/freeldr/fs/fat.c b/reactos/boot/freeldr/freeldr/fs/fat.c index 0b9265c6773..b068641d57a 100644 --- a/reactos/boot/freeldr/freeldr/fs/fat.c +++ b/reactos/boot/freeldr/freeldr/fs/fat.c @@ -558,8 +558,8 @@ BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, // // See if the file name matches either the short or long name // - if (((strlen(FileName) == strlen(LfnNameBuffer)) && (stricmp(FileName, LfnNameBuffer) == 0)) || - ((strlen(FileName) == strlen(ShortNameBuffer)) && (stricmp(FileName, ShortNameBuffer) == 0))) { + if (((strlen(FileName) == strlen(LfnNameBuffer)) && (_stricmp(FileName, LfnNameBuffer) == 0)) || + ((strlen(FileName) == strlen(ShortNameBuffer)) && (_stricmp(FileName, ShortNameBuffer) == 0))) { // // We found the entry, now fill in the FAT_FILE_INFO struct // @@ -633,7 +633,7 @@ static BOOL FatXSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG Direct continue; } if (FileNameLen == DirEntry->FileNameSize && - 0 == strnicmp(FileName, DirEntry->FileName, FileNameLen)) + 0 == _strnicmp(FileName, DirEntry->FileName, FileNameLen)) { /* * We found the entry, now fill in the FAT_FILE_INFO struct diff --git a/reactos/boot/freeldr/freeldr/fs/iso.c b/reactos/boot/freeldr/freeldr/fs/iso.c index 4eb9478b2a3..f21b7a27563 100644 --- a/reactos/boot/freeldr/freeldr/fs/iso.c +++ b/reactos/boot/freeldr/freeldr/fs/iso.c @@ -99,7 +99,7 @@ static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG Directo Name[i] = 0; DbgPrint((DPRINT_FILESYSTEM, "Name '%s'\n", Name)); - if (strlen(FileName) == strlen(Name) && stricmp(FileName, Name) == 0) + if (strlen(FileName) == strlen(Name) && _stricmp(FileName, Name) == 0) { IsoFileInfoPointer->FileStart = Record->ExtentLocationL; IsoFileInfoPointer->FileSize = Record->DataLengthL; diff --git a/reactos/boot/freeldr/freeldr/inffile/inffile.c b/reactos/boot/freeldr/freeldr/inffile/inffile.c index 2d2f86ba2f8..414186ded37 100644 --- a/reactos/boot/freeldr/freeldr/inffile/inffile.c +++ b/reactos/boot/freeldr/freeldr/inffile/inffile.c @@ -217,7 +217,7 @@ InfpCacheFindSection (PINFCACHE Cache, Section = Cache->FirstSection; while (Section != NULL) { - if (stricmp (Section->Name, Name) == 0) + if (_stricmp (Section->Name, Name) == 0) { return Section; } @@ -374,7 +374,7 @@ InfpCacheFindKeyLine (PINFCACHESECTION Section, Line = Section->FirstLine; while (Line != NULL) { - if (Line->Key != NULL && stricmp (Line->Key, Key) == 0) + if (Line->Key != NULL && _stricmp (Line->Key, Key) == 0) { return Line; } @@ -1008,7 +1008,7 @@ InfFindFirstLine (HINF InfHandle, // DPRINT("Comparing '%S' and '%S'\n", CacheSection->Name, Section); /* Are the section names the same? */ - if (stricmp(CacheSection->Name, Section) == 0) + if (_stricmp(CacheSection->Name, Section) == 0) { if (Key != NULL) { @@ -1082,7 +1082,7 @@ InfFindFirstMatchLine (PINFCONTEXT ContextIn, CacheLine = ((PINFCACHESECTION)(ContextIn->Section))->FirstLine; while (CacheLine != NULL) { - if (CacheLine->Key != NULL && stricmp (CacheLine->Key, Key) == 0) + if (CacheLine->Key != NULL && _stricmp (CacheLine->Key, Key) == 0) { if (ContextIn != ContextOut) @@ -1118,7 +1118,7 @@ InfFindNextMatchLine (PINFCONTEXT ContextIn, CacheLine = (PINFCACHELINE)ContextIn->Line; while (CacheLine != NULL) { - if (CacheLine->Key != NULL && stricmp (CacheLine->Key, Key) == 0) + if (CacheLine->Key != NULL && _stricmp (CacheLine->Key, Key) == 0) { if (ContextIn != ContextOut) @@ -1160,7 +1160,7 @@ InfGetLineCount(HINF InfHandle, // DPRINT("Comparing '%S' and '%S'\n", CacheSection->Name, Section); /* Are the section names the same? */ - if (stricmp(CacheSection->Name, Section) == 0) + if (_stricmp(CacheSection->Name, Section) == 0) { return CacheSection->LineCount; } diff --git a/reactos/boot/freeldr/freeldr/inifile/inifile.c b/reactos/boot/freeldr/freeldr/inifile/inifile.c index 18adad729aa..66e738cd711 100644 --- a/reactos/boot/freeldr/freeldr/inifile/inifile.c +++ b/reactos/boot/freeldr/freeldr/inifile/inifile.c @@ -36,7 +36,7 @@ BOOL IniOpenSection(PCSTR SectionName, ULONG* SectionId) while (Section != NULL) { // Compare against the section name - if (stricmp(SectionName, Section->SectionName) == 0) + if (_stricmp(SectionName, Section->SectionName) == 0) { // We found it *SectionId = (ULONG)Section; @@ -141,7 +141,7 @@ BOOL IniReadSettingByName(ULONG SectionId, PCSTR SettingName, PCHAR Buffer, ULON while (SectionItem != NULL) { // Check to see if this is the setting they want - if (stricmp(SettingName, SectionItem->ItemName) == 0) + if (_stricmp(SettingName, SectionItem->ItemName) == 0) { DbgPrint((DPRINT_INIFILE, "IniReadSettingByName() Setting \'%s\' found.\n", SettingName)); DbgPrint((DPRINT_INIFILE, "IniReadSettingByName() Setting value = %s\n", SectionItem->ItemValue)); diff --git a/reactos/boot/freeldr/freeldr/reactos/arcname.c b/reactos/boot/freeldr/freeldr/reactos/arcname.c index b81757ef0fb..26f57548756 100644 --- a/reactos/boot/freeldr/freeldr/reactos/arcname.c +++ b/reactos/boot/freeldr/freeldr/reactos/arcname.c @@ -25,11 +25,11 @@ BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* Boot { char *p; - if (strnicmp(ArcPath, "multi(0)disk(0)", 15) != 0) + if (_strnicmp(ArcPath, "multi(0)disk(0)", 15) != 0) return FALSE; p = ArcPath + 15; - if (strnicmp(p, "fdisk(", 6) == 0) + if (_strnicmp(p, "fdisk(", 6) == 0) { /* * floppy disk path: @@ -43,7 +43,7 @@ BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* Boot p++; *BootPartition = 0xff; } - else if (strnicmp(p, "cdrom(", 6) == 0) + else if (_strnicmp(p, "cdrom(", 6) == 0) { /* * cdrom path: @@ -57,7 +57,7 @@ BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* Boot p++; *BootPartition = 0xff; } - else if (strnicmp(p, "rdisk(", 6) == 0) + else if (_strnicmp(p, "rdisk(", 6) == 0) { /* * hard disk path: @@ -66,7 +66,7 @@ BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* Boot p = p + 6; *BootDrive = atoi(p) + 0x80; p = strchr(p, ')'); - if ((p == NULL) || (strnicmp(p, ")partition(", 11) != 0)) + if ((p == NULL) || (_strnicmp(p, ")partition(", 11) != 0)) return FALSE; p = p + 11; *BootPartition = atoi(p); @@ -126,11 +126,11 @@ ULONG ConvertArcNameToBiosDriveNumber(PCHAR ArcPath) char * p; ULONG DriveNumber = 0; - if (strnicmp(ArcPath, "multi(0)disk(0)", 15) != 0) + if (_strnicmp(ArcPath, "multi(0)disk(0)", 15) != 0) return 0; p = ArcPath + 15; - if (strnicmp(p, "fdisk(", 6) == 0) + if (_strnicmp(p, "fdisk(", 6) == 0) { /* * floppy disk path: @@ -139,7 +139,7 @@ ULONG ConvertArcNameToBiosDriveNumber(PCHAR ArcPath) p = p + 6; DriveNumber = atoi(p); } - else if (strnicmp(p, "rdisk(", 6) == 0) + else if (_strnicmp(p, "rdisk(", 6) == 0) { /* * hard disk path: diff --git a/reactos/boot/freeldr/freeldr/reactos/loader.c b/reactos/boot/freeldr/freeldr/reactos/loader.c index 2d3fa5a95d3..334a2c6b548 100644 --- a/reactos/boot/freeldr/freeldr/reactos/loader.c +++ b/reactos/boot/freeldr/freeldr/reactos/loader.c @@ -243,7 +243,7 @@ FrLdrGetKernelBase(VOID) while ((p = strchr(p, '/')) != NULL) { /* Find "/3GB" */ - if (!strnicmp(p + 1, "3GB", 3)) { + if (!_strnicmp(p + 1, "3GB", 3)) { /* Make sure there's nothing following it */ if (p[4] == ' ' || p[4] == 0) { @@ -303,7 +303,7 @@ FrLdrGetPaeMode(VOID) p++; /* Find "PAE" */ - if (!strnicmp(p, "PAE", 3)) { + if (!_strnicmp(p, "PAE", 3)) { /* Make sure there's nothing following it */ if (p[3] == ' ' || p[3] == 0) { diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index 5a33f525c94..d5b3d719461 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -453,7 +453,7 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot, /* Make sure it should be started */ if ((StartValue == 0) && (TagValue == OrderList[TagIndex]) && - (stricmp(DriverGroup, GroupName) == 0)) { + (_stricmp(DriverGroup, GroupName) == 0)) { /* Get the Driver's Location */ ValueSize = 256; @@ -529,7 +529,7 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot, if ((StartValue == 0) && (TagIndex > OrderList[0]) && - (stricmp(DriverGroup, GroupName) == 0)) { + (_stricmp(DriverGroup, GroupName) == 0)) { ValueSize = 256; rc = RegQueryValue(hDriverKey, "ImagePath", NULL, (PUCHAR)TempImagePath, &ValueSize); @@ -660,7 +660,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) /* * Special case for Live CD. */ - if (!stricmp(SystemPath, "LiveCD")) + if (!_stricmp(SystemPath, "LiveCD")) { /* Normalize */ MachDiskGetBootPath(SystemPath, sizeof(SystemPath)); diff --git a/reactos/boot/freeldr/freeldr/reactos/registry.c b/reactos/boot/freeldr/freeldr/reactos/registry.c index 151ac7f45e9..060fab58897 100644 --- a/reactos/boot/freeldr/freeldr/reactos/registry.c +++ b/reactos/boot/freeldr/freeldr/reactos/registry.c @@ -267,7 +267,7 @@ RegCreateKey(FRLDRHKEY ParentKey, KeyList); DbgPrint((DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey)); DbgPrint((DPRINT_REGISTRY, "Searching '%s'\n", SearchKey->Name)); - if (strnicmp(SearchKey->Name, name, subkeyLength) == 0) + if (_strnicmp(SearchKey->Name, name, subkeyLength) == 0) break; Ptr = Ptr->Flink; @@ -448,7 +448,7 @@ RegOpenKey(FRLDRHKEY ParentKey, DbgPrint((DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey)); DbgPrint((DPRINT_REGISTRY, "Searching '%s'\n", SearchKey->Name)); - if (strnicmp(SearchKey->Name, name, subkeyLength) == 0) + if (_strnicmp(SearchKey->Name, name, subkeyLength) == 0) break; Ptr = Ptr->Flink; @@ -526,7 +526,7 @@ RegSetValue(FRLDRHKEY Key, DbgPrint((DPRINT_REGISTRY, "Value->Name '%s'\n", Value->Name)); - if (stricmp(Value->Name, ValueName) == 0) + if (_stricmp(Value->Name, ValueName) == 0) break; Ptr = Ptr->Flink; @@ -631,7 +631,7 @@ RegQueryValue(FRLDRHKEY Key, DbgPrint((DPRINT_REGISTRY, "Searching for '%s'. Value name '%s'\n", ValueName, Value->Name)); - if (stricmp(Value->Name, ValueName) == 0) + if (_stricmp(Value->Name, ValueName) == 0) break; Ptr = Ptr->Flink; @@ -692,7 +692,7 @@ RegDeleteValue(FRLDRHKEY Key, Value = CONTAINING_RECORD(Ptr, VALUE, ValueList); - if (stricmp(Value->Name, ValueName) == 0) + if (_stricmp(Value->Name, ValueName) == 0) break; Ptr = Ptr->Flink; diff --git a/reactos/boot/freeldr/freeldr/rtl/list.c b/reactos/boot/freeldr/freeldr/rtl/list.c index 8f1d97cb45c..9ccd29c5b00 100644 --- a/reactos/boot/freeldr/freeldr/rtl/list.c +++ b/reactos/boot/freeldr/freeldr/rtl/list.c @@ -173,3 +173,4 @@ VOID RtlListMoveEntryNext(PLIST_ITEM ListEntry) RtlListRemoveEntry(ListEntry); RtlListInsertEntry(ListNext, ListEntry); } + diff --git a/reactos/boot/freeldr/freeldr/rtl/memcmp.c b/reactos/boot/freeldr/freeldr/rtl/memcmp.c deleted file mode 100644 index 1adbf9bce61..00000000000 --- a/reactos/boot/freeldr/freeldr/rtl/memcmp.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -int memcmp(const void *buf1, const void *buf2, size_t count) -{ - unsigned int i; - const char* buffer1 = buf1; - const char* buffer2 = buf2; - - for (i=0; i - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -#ifdef __i386__ -void *memcpy(void *to, const void *from, size_t count) -{ - __asm__( \ - "or %%ecx,%%ecx\n\t"\ - "jz .L1\n\t" \ - "cld\n\t" \ - "rep\n\t" \ - "movsb\n\t" \ - ".L1:\n\t" - : - : "D" (to), "S" (from), "c" (count)); - return to; -} -#else -void *memcpy(void *to, const void *from, size_t count) -{ - unsigned int i; - char* buf1 = to; - const char* buf2 = from; - - for (i=0; i - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -void *memmove(void *dest, const void *src, size_t count) -{ - char *char_dest = (char *)dest; - char *char_src = (char *)src; - - if ((char_dest <= char_src) || (char_dest >= (char_src+count))) - { - /* non-overlapping buffers */ - while(count > 0) - { - *char_dest = *char_src; - char_dest++; - char_src++; - count--; - } - } - else - { - /* overlaping buffers */ - char_dest = (char *)dest + count - 1; - char_src = (char *)src + count - 1; - - while(count > 0) - { - *char_dest = *char_src; - char_dest--; - char_src--; - count--; - } - } - - return dest; -} diff --git a/reactos/boot/freeldr/freeldr/rtl/memset.c b/reactos/boot/freeldr/freeldr/rtl/memset.c deleted file mode 100644 index ac265b88bfa..00000000000 --- a/reactos/boot/freeldr/freeldr/rtl/memset.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -#ifdef __i386__ -void *memset(void *src, int val, size_t count) -{ - __asm__( \ - "or %%ecx,%%ecx\n\t"\ - "jz .L1\n\t" \ - "cld\t\n" \ - "rep\t\n" \ - "stosb\t\n" \ - ".L1:\n\t" - : - : "D" (src), "c" (count), "a" (val)); - return src; -} -#else -void *memset(void *src, int val, size_t count) -{ - unsigned int i; - unsigned char* buf1 = src; - - for (i=0; i - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -/* - * print() - prints unformatted text to stdout - */ -void print(char *str) -{ - size_t i; - - for (i = 0; i < strlen(str); i++) - MachConsPutChar(str[i]); -} - -/* - * printf() - prints formatted text to stdout - * originally from GRUB - */ -int printf(const char *format, ... ) -{ - va_list ap; - va_start(ap,format); - char c, *ptr, str[16]; - int ll; - - while ((c = *(format++))) - { - if (c != '%') - { - MachConsPutChar(c); - } - else - { - if (*format == 'I' && *(format+1) == '6' && *(format+2) == '4') - { - ll = 1; - format += 3; - } - else - { - ll = 0; - } - switch (c = *(format++)) - { - case 'd': case 'u': case 'x': - if (ll) - { - *convert_i64_to_ascii(str, c, va_arg(ap, unsigned long long)) = 0; - } - else - { - *convert_to_ascii(str, c, va_arg(ap, unsigned long)) = 0; - } - - ptr = str; - - while (*ptr) - { - MachConsPutChar(*(ptr++)); - } - break; - - case 'c': MachConsPutChar((va_arg(ap,int))&0xff); break; - - case 's': - ptr = va_arg(ap,char *); - - while ((c = *(ptr++))) - { - MachConsPutChar(c); - } - break; - case '%': - MachConsPutChar(c); - break; - default: - printf("\nprintf() invalid format specifier - %%%c\n", c); - break; - } - } - } - - va_end(ap); - - return 0; -} - -int sprintf(char *buffer, const char *format, ... ) -{ - va_list ap; - char c, *ptr, str[16]; - char *p = buffer; - int ll; - - va_start(ap,format); - - while ((c = *(format++))) - { - if (c != '%') - { - *p = c; - p++; - } - else - { - if (*format == 'I' && *(format+1) == '6' && *(format+2) == '4') - { - ll = 1; - format += 3; - } - else - { - ll = 0; - } - switch (c = *(format++)) - { - case 'd': case 'u': case 'x': - if (ll) - { - *convert_i64_to_ascii(str, c, va_arg(ap, unsigned long long)) = 0; - } - else - { - *convert_to_ascii(str, c, va_arg(ap, unsigned long)) = 0; - } - - ptr = str; - - while (*ptr) - { - *p = *(ptr++); - p++; - } - break; - - case 'c': - *p = va_arg(ap,int)&0xff; - p++; - break; - - case 's': - ptr = va_arg(ap,char *); - - while ((c = *(ptr++))) - { - *p = c; - p++; - } - break; - case '%': - *p = c; - p++; - break; - default: - printf("\nsprintf() invalid format specifier - %%%c\n", c); - break; - } - } - } - va_end(ap); - *p=0; - - return 0; -} diff --git a/reactos/boot/freeldr/freeldr/rtl/stdlib.c b/reactos/boot/freeldr/freeldr/rtl/stdlib.c deleted file mode 100644 index 0176bdbca10..00000000000 --- a/reactos/boot/freeldr/freeldr/rtl/stdlib.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -/* - * convert_to_ascii() - converts a number to it's ascii equivalent - * from: - * GRUB -- GRand Unified Bootloader - * Copyright (C) 1996 Erich Boleyn - */ -char *convert_to_ascii(char *buf, int c, int num) -{ - unsigned long mult = 10; - char *ptr = buf; - - if (c == 'x') - mult = 16; - - if ((num & 0x80000000uL) && c == 'd') - { - num = (~num)+1; - *(ptr++) = '-'; - buf++; - } - - do - { - int dig = num % mult; - *(ptr++) = ( (dig > 9) ? dig + 'a' - 10 : '0' + dig ); - } - while (num /= mult); - - /* reorder to correct direction!! */ - { - char *ptr1 = ptr-1; - char *ptr2 = buf; - while (ptr1 > ptr2) - { - int c = *ptr1; - *ptr1 = *ptr2; - *ptr2 = c; - ptr1--; - ptr2++; - } - } - - return ptr; -} - -char *convert_i64_to_ascii(char *buf, int c, unsigned long long num) -{ - int mult = 10; - char *ptr = buf; - - if (c == 'x') - mult = 16; - - if ((num & 0x8000000000000000uLL) && c == 'd') - { - num = (~num)+1; - *(ptr++) = '-'; - buf++; - } - - do - { - int dig = num % mult; - *(ptr++) = ( (dig > 9) ? dig + 'a' - 10 : '0' + dig ); - } - while (num /= mult); - - /* reorder to correct direction!! */ - { - char *ptr1 = ptr-1; - char *ptr2 = buf; - while (ptr1 > ptr2) - { - int c = *ptr1; - *ptr1 = *ptr2; - *ptr2 = c; - ptr1--; - ptr2++; - } - } - - return ptr; -} - -char *itoa(int value, char *string, int radix) -{ - if(radix == 16) - *convert_to_ascii(string, 'x', value) = 0; - else - *convert_to_ascii(string, 'd', value) = 0; - - return string; -} - -int toupper(int c) -{ - if((c >= 'a') && (c <= 'z')) - c -= 32; - - return c; -} - -int tolower(int c) -{ - if((c >= 'A') && (c <= 'Z')) - c += 32; - - return c; -} - -int atoi(const char *string) -{ - int base; - int result = 0; - const char *str; - - if((string[0] == '0') && (string[1] == 'x')) - { - base = 16; - str = string + 2; - } - else - { - base = 10; - str = string; - } - - while(1) - { - if(base == 16) - { - if(((*str < '0') || (*str > '9')) && ((*str < 'a') || (*str > 'f')) && ((*str < 'A') || (*str > 'F'))) - break; - - result *= base; - if((*str >= '0') && (*str <= '9')) - result += (*str - '0'); - if((*str >= 'a') && (*str <= 'f')) - result += (*str - 'a') + 10; - if((*str >= 'A') && (*str <= 'F')) - result += (*str - 'A') + 10; - str++; - } - else //if(base == 10) - { - if((*str < '0') || (*str > '9')) - break; - - result *= base; - result += (*str - '0'); - str++; - } - } - - return result; -} - -int isspace(int c) -{ - return(c == ' ' || (c >= 0x09 && c <= 0x0D)); -} - -int isdigit(int c) -{ - return(c >= '0' && c <= '9'); -} - -int isxdigit(int c) -{ - return((c >= '0' && c <= '9')||(c >= 'a' && c <= 'f')||(c >= 'A' && c <= 'F')); -} diff --git a/reactos/boot/freeldr/freeldr/rtl/string.c b/reactos/boot/freeldr/freeldr/rtl/string.c deleted file mode 100644 index 741455b94b2..00000000000 --- a/reactos/boot/freeldr/freeldr/rtl/string.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -size_t strlen(const char *str) -{ - int len; - - for(len=0; str[len] != '\0'; len++); - - return len; -} - -char *strcpy(char *dest, const char *src) -{ - char *ret = dest; - - while(*src) - *dest++ = *src++; - *dest = 0; - - return ret; -} - -char *strncpy(char *dest, const char *src, size_t count) -{ - char *ret = dest; - - while((*src) && (count--)) - *dest++ = *src++; - - if (count) - *dest = 0; - - return ret; -} - -char *strcat(char *dest, const char *src) -{ - char *ret = dest; - - while(*dest) - dest++; - - while(*src) - *dest++ = *src++; - *dest = 0; - - return ret; -} - -char *strncat(char *dst, const char *src, size_t n) -{ - if (n != 0) - { - char *d = dst; - const char *s = src; - - while (*d != 0) - d++; - do - { - if ((*d = *s++) == 0) - break; - d++; - } - while (--n != 0); - *d = 0; - } - - return dst; -} - -char *strchr(const char *s, int c) -{ - char cc = c; - while (*s) - { - if (*s == cc) - return (char *)s; - s++; - } - if (cc == 0) - return (char *)s; - return 0; -} - -char *strrchr(const char *s, int c) -{ - char cc = c; - const char *sp=(char *)0; - while (*s) - { - if (*s == cc) - sp = s; - s++; - } - if (cc == 0) - sp = s; - return (char *)sp; -} - -int strcmp(const char *string1, const char *string2) -{ - while(*string1 == *string2) - { - if(*string1 == 0) - return 0; - - string1++; - string2++; - } - - return *(unsigned const char *)string1 - *(unsigned const char *)(string2); -} - -int stricmp(const char *string1, const char *string2) -{ - while(tolower(*string1) == tolower(*string2)) - { - if(*string1 == 0) - return 0; - - string1++; - string2++; - } - - return (int)tolower(*string1) - (int)tolower(*string2); -} - -int strnicmp(const char *string1, const char *string2, size_t length) -{ - if (length == 0) - return 0; - do - { - if (toupper(*string1) != toupper(*string2++)) - return toupper(*(unsigned const char *)string1) - toupper(*(unsigned const char *)--string2); - if (*string1++ == 0) - break; - } - while (--length != 0); - return 0; -} - -int strncmp(const char *string1, const char *string2, size_t length) -{ - if (length == 0) - return 0; - do - { - if (*string1 != *string2++) - return *(unsigned const char *)string1 - *(unsigned const char *)--string2; - if (*string1++ == 0) - break; - } - while (--length != 0); - return 0; -} diff --git a/reactos/boot/freeldr/freeldr/ui/tui.c b/reactos/boot/freeldr/freeldr/ui/tui.c index f123685c246..04ef9dfcdbe 100644 --- a/reactos/boot/freeldr/freeldr/ui/tui.c +++ b/reactos/boot/freeldr/freeldr/ui/tui.c @@ -21,6 +21,62 @@ PVOID TextVideoBuffer = NULL; +/* + * printf() - prints formatted text to stdout + * originally from GRUB + */ +int printf(const char *format, ... ) +{ + va_list ap; + va_start(ap,format); + char c, *ptr, str[16]; + + while ((c = *(format++))) + { + if (c != '%') + { + MachConsPutChar(c); + } + else + { + switch (c = *(format++)) + { + case 'd': case 'u': case 'x': + *_itoa(va_arg(ap, unsigned long), str, 10) = 0; + + ptr = str; + + while (*ptr) + { + MachConsPutChar(*(ptr++)); + } + break; + + case 'c': MachConsPutChar((va_arg(ap,int))&0xff); break; + + case 's': + ptr = va_arg(ap,char *); + + while ((c = *(ptr++))) + { + MachConsPutChar(c); + } + break; + case '%': + MachConsPutChar(c); + break; + default: + printf("\nprintf() invalid format specifier - %%%c\n", c); + break; + } + } + } + + va_end(ap); + + return 0; +} + BOOL TuiInitialize(VOID) { MachVideoClearScreen(ATTR(COLOR_WHITE, COLOR_BLACK)); @@ -401,7 +457,7 @@ VOID TuiUpdateDateTime(VOID) // Get the month name strcpy(DateString, UiMonthNames[Month - 1]); // Get the day - itoa(Day, TempString, 10); + _itoa(Day, TempString, 10); // Get the day postfix if (1 == Day || 21 == Day || 31 == Day) { @@ -425,7 +481,7 @@ VOID TuiUpdateDateTime(VOID) strcat(DateString, " "); // Get the year and add it to the date - itoa(Year, TempString, 10); + _itoa(Year, TempString, 10); strcat(DateString, TempString); // Draw the date @@ -441,18 +497,18 @@ VOID TuiUpdateDateTime(VOID) { Hour = 12; } - itoa(Hour, TempString, 10); + _itoa(Hour, TempString, 10); strcpy(TimeString, " "); strcat(TimeString, TempString); strcat(TimeString, ":"); - itoa(Minute, TempString, 10); + _itoa(Minute, TempString, 10); if (Minute < 10) { strcat(TimeString, "0"); } strcat(TimeString, TempString); strcat(TimeString, ":"); - itoa(Second, TempString, 10); + _itoa(Second, TempString, 10); if (Second < 10) { strcat(TimeString, "0"); @@ -653,37 +709,37 @@ VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG UCHAR TuiTextToColor(PCSTR ColorText) { - if (stricmp(ColorText, "Black") == 0) + if (_stricmp(ColorText, "Black") == 0) return COLOR_BLACK; - else if (stricmp(ColorText, "Blue") == 0) + else if (_stricmp(ColorText, "Blue") == 0) return COLOR_BLUE; - else if (stricmp(ColorText, "Green") == 0) + else if (_stricmp(ColorText, "Green") == 0) return COLOR_GREEN; - else if (stricmp(ColorText, "Cyan") == 0) + else if (_stricmp(ColorText, "Cyan") == 0) return COLOR_CYAN; - else if (stricmp(ColorText, "Red") == 0) + else if (_stricmp(ColorText, "Red") == 0) return COLOR_RED; - else if (stricmp(ColorText, "Magenta") == 0) + else if (_stricmp(ColorText, "Magenta") == 0) return COLOR_MAGENTA; - else if (stricmp(ColorText, "Brown") == 0) + else if (_stricmp(ColorText, "Brown") == 0) return COLOR_BROWN; - else if (stricmp(ColorText, "Gray") == 0) + else if (_stricmp(ColorText, "Gray") == 0) return COLOR_GRAY; - else if (stricmp(ColorText, "DarkGray") == 0) + else if (_stricmp(ColorText, "DarkGray") == 0) return COLOR_DARKGRAY; - else if (stricmp(ColorText, "LightBlue") == 0) + else if (_stricmp(ColorText, "LightBlue") == 0) return COLOR_LIGHTBLUE; - else if (stricmp(ColorText, "LightGreen") == 0) + else if (_stricmp(ColorText, "LightGreen") == 0) return COLOR_LIGHTGREEN; - else if (stricmp(ColorText, "LightCyan") == 0) + else if (_stricmp(ColorText, "LightCyan") == 0) return COLOR_LIGHTCYAN; - else if (stricmp(ColorText, "LightRed") == 0) + else if (_stricmp(ColorText, "LightRed") == 0) return COLOR_LIGHTRED; - else if (stricmp(ColorText, "LightMagenta") == 0) + else if (_stricmp(ColorText, "LightMagenta") == 0) return COLOR_LIGHTMAGENTA; - else if (stricmp(ColorText, "Yellow") == 0) + else if (_stricmp(ColorText, "Yellow") == 0) return COLOR_YELLOW; - else if (stricmp(ColorText, "White") == 0) + else if (_stricmp(ColorText, "White") == 0) return COLOR_WHITE; return COLOR_BLACK; @@ -691,15 +747,15 @@ UCHAR TuiTextToColor(PCSTR ColorText) UCHAR TuiTextToFillStyle(PCSTR FillStyleText) { - if (stricmp(FillStyleText, "Light") == 0) + if (_stricmp(FillStyleText, "Light") == 0) { return LIGHT_FILL; } - else if (stricmp(FillStyleText, "Medium") == 0) + else if (_stricmp(FillStyleText, "Medium") == 0) { return MEDIUM_FILL; } - else if (stricmp(FillStyleText, "Dark") == 0) + else if (_stricmp(FillStyleText, "Dark") == 0) { return DARK_FILL; } diff --git a/reactos/boot/freeldr/freeldr/ui/tuimenu.c b/reactos/boot/freeldr/freeldr/ui/tuimenu.c index f0b9c998933..188d4eb856c 100644 --- a/reactos/boot/freeldr/freeldr/ui/tuimenu.c +++ b/reactos/boot/freeldr/freeldr/ui/tuimenu.c @@ -230,7 +230,7 @@ VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo) if (MenuInfo->MenuTimeRemaining >= 0) { strcpy(MenuLineText, "[ Time Remaining: "); - itoa(MenuInfo->MenuTimeRemaining, TempString, 10); + _itoa(MenuInfo->MenuTimeRemaining, TempString, 10); strcat(MenuLineText, TempString); strcat(MenuLineText, " ]"); @@ -245,7 +245,7 @@ VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo) // for (Idx=0; IdxMenuItemCount; Idx++) { - if (stricmp(MenuInfo->MenuItemList[Idx], "SEPARATOR") == 0) + if (_stricmp(MenuInfo->MenuItemList[Idx], "SEPARATOR") == 0) { UiDrawText(MenuInfo->Left, MenuInfo->Top + Idx + 1, "\xC7", ATTR(UiMenuFgColor, UiMenuBgColor)); UiDrawText(MenuInfo->Right, MenuInfo->Top + Idx + 1, "\xB6", ATTR(UiMenuFgColor, UiMenuBgColor)); @@ -295,7 +295,7 @@ VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, ULONG MenuItemNumber) // // If it is a separator then adjust the text accordingly // - if (stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR") == 0) + if (_stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR") == 0) { memset(MenuLineText, 0, 80); memset(MenuLineText, 0xC4, (MenuInfo->Right - MenuInfo->Left - 1)); @@ -387,7 +387,7 @@ ULONG TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterC TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem + 1); // Deselect previous item // Skip past any separators - if (MenuInfo->SelectedMenuItem > 0 && stricmp(MenuInfo->MenuItemList[MenuInfo->SelectedMenuItem], "SEPARATOR") == 0) + if (MenuInfo->SelectedMenuItem > 0 && _stricmp(MenuInfo->MenuItemList[MenuInfo->SelectedMenuItem], "SEPARATOR") == 0) { MenuInfo->SelectedMenuItem--; } @@ -409,7 +409,7 @@ ULONG TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterC TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem - 1); // Deselect previous item // Skip past any separators - if (MenuInfo->SelectedMenuItem < (MenuInfo->MenuItemCount - 1) && stricmp(MenuInfo->MenuItemList[MenuInfo->SelectedMenuItem], "SEPARATOR") == 0) + if (MenuInfo->SelectedMenuItem < (MenuInfo->MenuItemCount - 1) && _stricmp(MenuInfo->MenuItemList[MenuInfo->SelectedMenuItem], "SEPARATOR") == 0) { MenuInfo->SelectedMenuItem++; } diff --git a/reactos/boot/freeldr/freeldr/ui/ui.c b/reactos/boot/freeldr/freeldr/ui/ui.c index 945609c515d..93ccd69aca8 100644 --- a/reactos/boot/freeldr/freeldr/ui/ui.c +++ b/reactos/boot/freeldr/freeldr/ui/ui.c @@ -153,7 +153,7 @@ BOOL UiInitialize(BOOLEAN ShowGui) } if (IniReadSettingByName(SectionId, "SpecialEffects", SettingText, 260)) { - if (stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3) + if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3) { UiUseSpecialEffects = TRUE; } @@ -544,7 +544,7 @@ VOID UiShowMessageBoxesInSection(PCSTR SectionName) { IniReadSettingByNumber(SectionId, Idx, SettingName, 79, SettingValue, 79); - if (stricmp(SettingName, "MessageBox") == 0) + if (_stricmp(SettingName, "MessageBox") == 0) { // Get the real length of the MessageBox text MessageBoxTextSize = IniGetSectionSettingValueSize(SectionId, Idx);