+ULONG_PTR KernelBase;
+ROS_KERNEL_ENTRY_POINT KernelEntryPoint;
+
+BOOLEAN
+FrLdrLoadDriver(PCHAR szFileName,
+ INT nPos)
+{
+ PFILE FilePointer;
+ CHAR value[256], *FinalSlash;
+ LPSTR p;
+
+ if (!_stricmp(szFileName, "hal.dll"))
+ {
+ /* Use the boot.ini name instead */
+ szFileName = szHalName;
+ }
+
+ FinalSlash = strrchr(szFileName, '\\');
+ if(FinalSlash)
+ szFileName = FinalSlash + 1;
+
+ /* Open the Driver */
+ FilePointer = FsOpenFile(szFileName);
+
+ /* Try under the system root in the main dir and drivers */
+ if (!FilePointer)
+ {
+ strcpy(value, SystemRoot);
+ if(value[strlen(value)-1] != '\\')
+ strcat(value, "\\");
+ strcat(value, szFileName);
+ FilePointer = FsOpenFile(value);
+ }
+
+ if (!FilePointer)
+ {
+ strcpy(value, SystemRoot);
+ if(value[strlen(value)-1] != '\\')
+ strcat(value, "\\");
+ strcat(value, "SYSTEM32\\");
+ strcat(value, szFileName);
+ FilePointer = FsOpenFile(value);
+ }
+
+ if (!FilePointer)
+ {
+ strcpy(value, SystemRoot);
+ if(value[strlen(value)-1] != '\\')
+ strcat(value, "\\");
+ strcat(value, "SYSTEM32\\DRIVERS\\");
+ strcat(value, szFileName);
+ FilePointer = FsOpenFile(value);
+ }
+
+ /* Make sure we did */
+ if (!FilePointer) {
+
+ /* Fail if file wasn't opened */
+ strcpy(value, szFileName);
+ strcat(value, " not found.");
+ return(FALSE);
+ }
+
+ /* Update the status bar with the current file */
+ strcpy(value, "Reading ");
+ p = strrchr(szFileName, '\\');
+ if (p == NULL) {
+
+ strcat(value, szFileName);
+
+ } else {
+
+ strcat(value, p + 1);
+
+ }
+ UiDrawStatusText(value);
+
+ /* Load the driver */
+ FrLdrReadAndMapImage(FilePointer, szFileName, 0);
+
+ /* Update status and return */
+ UiDrawProgressBarCenter(nPos, 100, szLoadingMsg);
+ return(TRUE);
+}