add NTLITE_DRIVE and NTLITE_NTPATH so i can work on my pc and my laptop, fix dynamic driver loading
This commit is contained in:
1 parent
4b57738fe3
commit
cbb9ff469c
9 files changed
+15
-16
No files matched your search
+6
-8
@@ -107,21 +107,19 @@ static void InitializeDrivers(BOOT_INFO* bootInfo, const HAL_API* hal) {
|
||||
|
||||
// Load the driver
|
||||
size_t len = strlen(runtimeKeys[i]);
|
||||
|
||||
// Assemble the path
|
||||
// "drivers\" is 8 chars; +1 for the NUL terminator already in len.
|
||||
size_t pathLen = 8 + len + 1; // len already includes the NUL from strlen+1 above
|
||||
char *path = MmAllocatePool(pathLen);
|
||||
char* path = MmAllocatePool(len + 10);
|
||||
if (!path) {
|
||||
DbgPrint("InitializeDrivers: OOM building driver path\n");
|
||||
DbgPrint("KernelMain: Failed to allocate memory for driver path. How?\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// memcpy manouvers
|
||||
memcpy(path, "drivers\\", 8);
|
||||
memcpy(path + 8, runtimeKeys[i], len); // len includes the NUL
|
||||
memcpy(path + 8, runtimeKeys[i], len + 1);
|
||||
|
||||
s = IoOpenFile(path, &f);
|
||||
if (s != STATUS_SUCCESS) {
|
||||
DbgPrint("InitializeDrivers: Failed to open runtime driver: %s\n", runtimeKeys[i]);
|
||||
DbgPrint("InitializeDrivers: Failed to open runtime driver: %s (%s)\n", runtimeKeys[i], path);
|
||||
continue; // Skip this driver but keep going with others
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user