X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=boot%2Ffreeldr%2Ffreeldr%2Fntldr%2Fwlregistry.c;h=8c78e60608c11843d4854ebb802520346fbacc40;hp=641b13f69e21dadb86252deced9fb82a3a69c18d;hb=304e2810995da20d53b5acf8f0b664274d0b895b;hpb=0b2b53b9c3e002276c6c034c8d43b9e7d8453d92 diff --git a/boot/freeldr/freeldr/ntldr/wlregistry.c b/boot/freeldr/freeldr/ntldr/wlregistry.c index 641b13f69e2..8c78e60608c 100644 --- a/boot/freeldr/freeldr/ntldr/wlregistry.c +++ b/boot/freeldr/freeldr/ntldr/wlregistry.c @@ -49,10 +49,11 @@ WinLdrLoadSystemHive( /* Concatenate path and filename to get the full name */ strcpy(FullHiveName, DirectoryPath); strcat(FullHiveName, HiveName); - //Print(L"Loading %s...\n", FullHiveName); + Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId); if (Status != ESUCCESS) { + WARN("Error while opening '%s', Status: %u\n", FullHiveName, Status); UiMessageBox("Opening hive file failed!"); return FALSE; } @@ -91,6 +92,7 @@ WinLdrLoadSystemHive( if (Status != ESUCCESS) { ArcClose(FileId); + WARN("Error while reading '%s', Status: %u\n", FullHiveName, Status); UiMessageBox("Unable to read from hive file!"); return FALSE; } @@ -143,7 +145,7 @@ WinLdrInitSystemHive( HiveName = "SYSTEM"; } - ERR("WinLdrInitSystemHive: try to load hive %s%s\n", SearchPath, HiveName); + TRACE("WinLdrInitSystemHive: loading hive %s%s\n", SearchPath, HiveName); Success = WinLdrLoadSystemHive(LoaderBlock, SearchPath, HiveName); /* Fail if failed... */ @@ -320,12 +322,14 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, AnsiEqualsOem = TRUE; /* Open file with ANSI and store its size */ - //Print(L"Loading %s...\n", Filename); strcpy(FileName, DirectoryPath); strcat(FileName, AnsiFileName); Status = ArcOpen(FileName, OpenReadOnly, &AnsiFileId); if (Status != ESUCCESS) + { + WARN("Error while opening '%s', Status: %u\n", FileName, Status); goto Failure; + } Status = ArcGetFileInformation(AnsiFileId, &FileInfo); if (Status != ESUCCESS) @@ -346,7 +350,10 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, strcat(FileName, OemFileName); Status = ArcOpen(FileName, OpenReadOnly, &OemFileId); if (Status != ESUCCESS) + { + WARN("Error while opening '%s', Status: %u\n", FileName, Status); goto Failure; + } Status = ArcGetFileInformation(OemFileId, &FileInfo); if (Status != ESUCCESS) @@ -362,7 +369,10 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, strcat(FileName, LanguageFileName); Status = ArcOpen(FileName, OpenReadOnly, &LanguageFileId); if (Status != ESUCCESS) + { + WARN("Error while opening '%s', Status: %u\n", FileName, Status); goto Failure; + } Status = ArcGetFileInformation(LanguageFileId, &FileInfo); if (Status != ESUCCESS) @@ -403,11 +413,17 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, strcat(FileName, AnsiFileName); Status = ArcOpen(FileName, OpenReadOnly, &AnsiFileId); if (Status != ESUCCESS) + { + WARN("Error while opening '%s', Status: %u\n", FileName, Status); goto Failure; + } Status = ArcRead(AnsiFileId, VaToPa(LoaderBlock->NlsData->AnsiCodePageData), AnsiFileSize, &BytesRead); if (Status != ESUCCESS) + { + WARN("Error while reading '%s', Status: %u\n", FileName, Status); goto Failure; + } ArcClose(AnsiFileId); @@ -418,11 +434,17 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, strcat(FileName, OemFileName); Status = ArcOpen(FileName, OpenReadOnly, &OemFileId); if (Status != ESUCCESS) + { + WARN("Error while opening '%s', Status: %u\n", FileName, Status); goto Failure; + } Status = ArcRead(OemFileId, VaToPa(LoaderBlock->NlsData->OemCodePageData), OemFileSize, &BytesRead); if (Status != ESUCCESS) + { + WARN("Error while reading '%s', Status: %u\n", FileName, Status); goto Failure; + } ArcClose(OemFileId); } @@ -432,11 +454,17 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, strcat(FileName, LanguageFileName); Status = ArcOpen(FileName, OpenReadOnly, &LanguageFileId); if (Status != ESUCCESS) + { + WARN("Error while opening '%s', Status: %u\n", FileName, Status); goto Failure; + } Status = ArcRead(LanguageFileId, VaToPa(LoaderBlock->NlsData->UnicodeCodePageData), LanguageFileSize, &BytesRead); if (Status != ESUCCESS) + { + WARN("Error while reading '%s', Status: %u\n", FileName, Status); goto Failure; + } ArcClose(LanguageFileId); @@ -586,15 +614,15 @@ WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead, { TRACE_CH(REACTOS, "ImagePath: not found\n"); TempImagePath[0] = 0; - sprintf(ImagePath, "%s\\system32\\drivers\\%S.sys", DirectoryPath, ServiceName); + RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s\\system32\\drivers\\%S.sys", DirectoryPath, ServiceName); } else if (TempImagePath[0] != L'\\') { - sprintf(ImagePath, "%s%S", DirectoryPath, TempImagePath); + RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s%S", DirectoryPath, TempImagePath); } else { - sprintf(ImagePath, "%S", TempImagePath); + RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%S", TempImagePath); TRACE_CH(REACTOS, "ImagePath: '%s'\n", ImagePath); } @@ -666,15 +694,15 @@ WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead, { TRACE_CH(REACTOS, "ImagePath: not found\n"); TempImagePath[0] = 0; - sprintf(ImagePath, "%ssystem32\\drivers\\%S.sys", DirectoryPath, ServiceName); + RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%ssystem32\\drivers\\%S.sys", DirectoryPath, ServiceName); } else if (TempImagePath[0] != L'\\') { - sprintf(ImagePath, "%s%S", DirectoryPath, TempImagePath); + RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s%S", DirectoryPath, TempImagePath); } else { - sprintf(ImagePath, "%S", TempImagePath); + RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%S", TempImagePath); TRACE_CH(REACTOS, "ImagePath: '%s'\n", ImagePath); } TRACE(" Adding boot driver: '%s'\n", ImagePath); @@ -841,7 +869,7 @@ WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead, if (!NT_SUCCESS(Status)) return FALSE; - // Insert entry into the list + // Insert entry into the list if (!InsertInBootDriverList(BootDriverListHead, BootDriverEntry)) { // It was already there, so delete our entry