InsertHeadList(&DeviceListHead, &pNewEntry->ListEntry);
}
+LPCWSTR FsGetServiceName(ULONG FileId)
+{
+ if (FileId >= MAX_FDS || !FileData[FileId].FuncTable)
+ return NULL;
+ return FileData[FileId].FuncTable->ServiceName;
+}
+
VOID FsSetDeviceSpecific(ULONG FileId, VOID* Specific)
{
if (FileId >= MAX_FDS || !FileData[FileId].FuncTable)
ARC_OPEN Open;
ARC_READ Read;
ARC_SEEK Seek;
+ LPCWSTR ServiceName;
} DEVVTBL;
#define FS_FAT 1
#define PFILE ULONG
VOID FsRegisterDevice(CHAR* Prefix, const DEVVTBL* FuncTable);
+LPCWSTR FsGetServiceName(ULONG FileId);
VOID FsSetDeviceSpecific(ULONG FileId, VOID* Specific);
VOID* FsGetDeviceSpecific(ULONG FileId);
ULONG FsGetDeviceId(ULONG FileId);
ULONG_PTR HiveDataPhysical;
PVOID HiveDataVirtual;
ULONG BytesRead;
+ LPCWSTR FsService;
/* Concatenate path and filename to get the full name */
strcpy(FullHiveName, DirectoryPath);
/* Finally read from file to the memory */
Status = ArcRead(FileId, (PVOID)HiveDataPhysical, HiveFileSize, &BytesRead);
- ArcClose(FileId);
if (Status != ESUCCESS)
{
+ ArcClose(FileId);
UiMessageBox("Unable to read from hive file!");
return FALSE;
}
+ // Add boot filesystem driver to the list
+ FsService = FsGetServiceName(FileId);
+ if (FsService)
+ {
+ DPRINTM(DPRINT_WINDOWS, " Adding filesystem service %S\n", FsService);
+ Status = WinLdrAddDriverToList(&LoaderBlock->BootDriverListHead,
+ L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\",
+ NULL,
+ (LPWSTR)FsService);
+ if (!Status)
+ DPRINTM(DPRINT_WINDOWS, " Failed to add filesystem service\n");
+ }
+ else
+ {
+ DPRINTM(DPRINT_WINDOWS, " No required filesystem service\n");
+ }
+
+ ArcClose(FileId);
return TRUE;
}
// Scan registry and prepare boot drivers list
WinLdrScanRegistry(LoaderBlock, DirectoryPath);
- // Add boot filesystem driver to the list
- //FIXME: Use corresponding driver instead of hardcoding
- Status = WinLdrAddDriverToList(&LoaderBlock->BootDriverListHead,
- L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\",
- NULL,
- L"fastfat");
-
-
// Get names of NLS files
Status = WinLdrGetNLSNames(AnsiName, OemName, LangName);
if (!Status)