return FALSE;
}
- DbgPrint((DPRINT_WINDOWS, "NLS data %s %s %s\n", AnsiName, OemName, LangName));
+ DPRINTM(DPRINT_WINDOWS, "NLS data %s %s %s\n", AnsiName, OemName, LangName);
// Load NLS data
strcpy(SearchPath, DirectoryPath);
strcat(SearchPath, "SYSTEM32\\");
Status = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
- DbgPrint((DPRINT_WINDOWS, "NLS data loaded with status %d\n", Status));
+ DPRINTM(DPRINT_WINDOWS, "NLS data loaded with status %d\n", Status);
/* TODO: Load OEM HAL font */
goto Failure;
AnsiFileSize = FsGetFileSize(AnsiFileHandle);
- DbgPrint((DPRINT_WINDOWS, "AnsiFileSize: %d\n", AnsiFileSize));
+ DPRINTM(DPRINT_WINDOWS, "AnsiFileSize: %d\n", AnsiFileSize);
FsCloseFile(AnsiFileHandle);
/* Open OEM file and store its length */
OemFileSize = FsGetFileSize(OemFileHandle);
FsCloseFile(OemFileHandle);
}
- DbgPrint((DPRINT_WINDOWS, "OemFileSize: %d\n", OemFileSize));
+ DPRINTM(DPRINT_WINDOWS, "OemFileSize: %d\n", OemFileSize);
/* And finally open the language codepage file and store its length */
//Print(L"Loading %s...\n", Filename);
LanguageFileSize = FsGetFileSize(LanguageFileHandle);
FsCloseFile(LanguageFileHandle);
- DbgPrint((DPRINT_WINDOWS, "LanguageFileSize: %d\n", LanguageFileSize));
+ DPRINTM(DPRINT_WINDOWS, "LanguageFileSize: %d\n", LanguageFileSize);
/* Sum up all three length, having in mind that every one of them
must start at a page boundary => thus round up each file to a page */
&hGroupKey);
if (rc != ERROR_SUCCESS) {
- DbgPrint((DPRINT_REACTOS, "Failed to open the 'ServiceGroupOrder' key (rc %d)\n", (int)rc));
+ DPRINTM(DPRINT_REACTOS, "Failed to open the 'ServiceGroupOrder' key (rc %d)\n", (int)rc);
return;
}
&hOrderKey);
if (rc != ERROR_SUCCESS) {
- DbgPrint((DPRINT_REACTOS, "Failed to open the 'GroupOrderList' key (rc %d)\n", (int)rc));
+ DPRINTM(DPRINT_REACTOS, "Failed to open the 'GroupOrderList' key (rc %d)\n", (int)rc);
return;
}
&hServiceKey);
if (rc != ERROR_SUCCESS) {
- DbgPrint((DPRINT_REACTOS, "Failed to open the 'Services' key (rc %d)\n", (int)rc));
+ DPRINTM(DPRINT_REACTOS, "Failed to open the 'Services' key (rc %d)\n", (int)rc);
return;
}
BufferSize = 4096;
GroupNameBuffer = MmHeapAlloc(BufferSize);
rc = RegQueryValue(hGroupKey, L"List", NULL, (PUCHAR)GroupNameBuffer, &BufferSize);
- DbgPrint((DPRINT_REACTOS, "RegQueryValue(): rc %d\n", (int)rc));
+ DPRINTM(DPRINT_REACTOS, "RegQueryValue(): rc %d\n", (int)rc);
if (rc != ERROR_SUCCESS)
return;
- DbgPrint((DPRINT_REACTOS, "BufferSize: %d \n", (int)BufferSize));
- DbgPrint((DPRINT_REACTOS, "GroupNameBuffer: '%S' \n", GroupNameBuffer));
+ DPRINTM(DPRINT_REACTOS, "BufferSize: %d \n", (int)BufferSize);
+ DPRINTM(DPRINT_REACTOS, "GroupNameBuffer: '%S' \n", GroupNameBuffer);
/* Loop through each group */
GroupName = GroupNameBuffer;
while (*GroupName)
{
- DbgPrint((DPRINT_WINDOWS, "Driver group: '%S'\n", GroupName));
+ DPRINTM(DPRINT_WINDOWS, "Driver group: '%S'\n", GroupName);
/* Query the Order */
BufferSize = sizeof(OrderList);
/* Get the Driver's Name */
ValueSize = sizeof(ServiceName);
rc = RegEnumKey(hServiceKey, Index, ServiceName, &ValueSize);
- //DbgPrint((DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc));
+ //DPRINTM(DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc);
/* Makre sure it's valid, and check if we're done */
if (rc == ERROR_NO_MORE_ITEMS)
MmHeapFree(GroupNameBuffer);
return;
}
- //DbgPrint((DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName));
+ //DPRINTM(DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName);
/* open driver Key */
rc = RegOpenKey(hServiceKey, ServiceName, &hDriverKey);
ValueSize = sizeof(ULONG);
rc = RegQueryValue(hDriverKey, L"Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
if (rc != ERROR_SUCCESS) StartValue = (ULONG)-1;
- //DbgPrint((DPRINT_REACTOS, " Start: %x \n", (int)StartValue));
+ //DPRINTM(DPRINT_REACTOS, " Start: %x \n", (int)StartValue);
/* Read the Tag */
ValueSize = sizeof(ULONG);
rc = RegQueryValue(hDriverKey, L"Tag", &ValueType, (PUCHAR)&TagValue, &ValueSize);
if (rc != ERROR_SUCCESS) TagValue = (ULONG)-1;
- //DbgPrint((DPRINT_REACTOS, " Tag: %x \n", (int)TagValue));
+ //DPRINTM(DPRINT_REACTOS, " Tag: %x \n", (int)TagValue);
/* Read the driver's group */
DriverGroupSize = sizeof(DriverGroup);
rc = RegQueryValue(hDriverKey, L"Group", NULL, (PUCHAR)DriverGroup, &DriverGroupSize);
- //DbgPrint((DPRINT_REACTOS, " Group: '%S' \n", DriverGroup));
+ //DPRINTM(DPRINT_REACTOS, " Group: '%S' \n", DriverGroup);
/* Make sure it should be started */
if ((StartValue == 0) &&
/* Write the whole path if it suceeded, else prepare to fail */
if (rc != ERROR_SUCCESS) {
- DbgPrint((DPRINT_REACTOS, " ImagePath: not found\n"));
+ DPRINTM(DPRINT_REACTOS, " ImagePath: not found\n");
TempImagePath[0] = 0;
sprintf(ImagePath, "%s\\system32\\drivers\\%S.sys", DirectoryPath, ServiceName);
} else if (TempImagePath[0] != L'\\') {
sprintf(ImagePath, "%s%S", DirectoryPath, TempImagePath);
} else {
sprintf(ImagePath, "%S", TempImagePath);
- DbgPrint((DPRINT_REACTOS, " ImagePath: '%s'\n", ImagePath));
+ DPRINTM(DPRINT_REACTOS, " ImagePath: '%s'\n", ImagePath);
}
- DbgPrint((DPRINT_WINDOWS, " Adding boot driver: '%s'\n", ImagePath));
+ DPRINTM(DPRINT_WINDOWS, " Adding boot driver: '%s'\n", ImagePath);
Status = WinLdrAddDriverToList(&LoaderBlock->BootDriverListHead,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\",
ServiceName);
if (!Status)
- DbgPrint((DPRINT_WINDOWS, " Failed to add boot driver\n"));
+ DPRINTM(DPRINT_WINDOWS, " Failed to add boot driver\n");
} else
{
- //DbgPrint((DPRINT_WINDOWS, " Skipping driver '%S' with Start %d, Tag %d and Group '%S' (Current Tag %d, current group '%S')\n",
- // ServiceName, StartValue, TagValue, DriverGroup, OrderList[TagIndex], GroupName));
+ //DPRINTM(DPRINT_WINDOWS, " Skipping driver '%S' with Start %d, Tag %d and Group '%S' (Current Tag %d, current group '%S')\n",
+ // ServiceName, StartValue, TagValue, DriverGroup, OrderList[TagIndex], GroupName);
}
}
ValueSize = sizeof(ServiceName);
rc = RegEnumKey(hServiceKey, Index, ServiceName, &ValueSize);
- //DbgPrint((DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc));
+ //DPRINTM(DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc);
if (rc == ERROR_NO_MORE_ITEMS)
break;
if (rc != ERROR_SUCCESS)
MmHeapFree(GroupNameBuffer);
return;
}
- //DbgPrint((DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName));
+ //DPRINTM(DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName);
/* open driver Key */
rc = RegOpenKey(hServiceKey, ServiceName, &hDriverKey);
ValueSize = sizeof(ULONG);
rc = RegQueryValue(hDriverKey, L"Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
if (rc != ERROR_SUCCESS) StartValue = (ULONG)-1;
- //DbgPrint((DPRINT_REACTOS, " Start: %x \n", (int)StartValue));
+ //DPRINTM(DPRINT_REACTOS, " Start: %x \n", (int)StartValue);
/* Read the Tag */
ValueSize = sizeof(ULONG);
rc = RegQueryValue(hDriverKey, L"Tag", &ValueType, (PUCHAR)&TagValue, &ValueSize);
if (rc != ERROR_SUCCESS) TagValue = (ULONG)-1;
- //DbgPrint((DPRINT_REACTOS, " Tag: %x \n", (int)TagValue));
+ //DPRINTM(DPRINT_REACTOS, " Tag: %x \n", (int)TagValue);
/* Read the driver's group */
DriverGroupSize = sizeof(DriverGroup);
rc = RegQueryValue(hDriverKey, L"Group", NULL, (PUCHAR)DriverGroup, &DriverGroupSize);
- //DbgPrint((DPRINT_REACTOS, " Group: '%S' \n", DriverGroup));
+ //DPRINTM(DPRINT_REACTOS, " Group: '%S' \n", DriverGroup);
for (TagIndex = 1; TagIndex <= OrderList[0]; TagIndex++) {
if (TagValue == OrderList[TagIndex]) break;
ValueSize = sizeof(TempImagePath);
rc = RegQueryValue(hDriverKey, L"ImagePath", NULL, (PUCHAR)TempImagePath, &ValueSize);
if (rc != ERROR_SUCCESS) {
- DbgPrint((DPRINT_REACTOS, " ImagePath: not found\n"));
+ DPRINTM(DPRINT_REACTOS, " ImagePath: not found\n");
TempImagePath[0] = 0;
sprintf(ImagePath, "%ssystem32\\drivers\\%S.sys", DirectoryPath, ServiceName);
} else if (TempImagePath[0] != L'\\') {
sprintf(ImagePath, "%s%S", DirectoryPath, TempImagePath);
} else {
sprintf(ImagePath, "%S", TempImagePath);
- DbgPrint((DPRINT_REACTOS, " ImagePath: '%s'\n", ImagePath));
+ DPRINTM(DPRINT_REACTOS, " ImagePath: '%s'\n", ImagePath);
}
- DbgPrint((DPRINT_WINDOWS, " Adding boot driver: '%s'\n", ImagePath));
+ DPRINTM(DPRINT_WINDOWS, " Adding boot driver: '%s'\n", ImagePath);
Status = WinLdrAddDriverToList(&LoaderBlock->BootDriverListHead,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\",
ServiceName);
if (!Status)
- DbgPrint((DPRINT_WINDOWS, " Failed to add boot driver\n"));
+ DPRINTM(DPRINT_WINDOWS, " Failed to add boot driver\n");
} else
{
- //DbgPrint((DPRINT_WINDOWS, " Skipping driver '%S' with Start %d, Tag %d and Group '%S' (Current group '%S')\n",
- // ServiceName, StartValue, TagValue, DriverGroup, GroupName));
+ //DPRINTM(DPRINT_WINDOWS, " Skipping driver '%S' with Start %d, Tag %d and Group '%S' (Current group '%S')\n",
+ // ServiceName, StartValue, TagValue, DriverGroup, GroupName);
}
}
return FALSE;
// DTE will be filled during actual load of the driver
- BootDriverEntry->DataTableEntry = NULL;
+ BootDriverEntry->LdrEntry = NULL;
// Check - if we have a valid ImagePath, if not - we need to build it
// like "System32\\Drivers\\blah.sys"
else
{
// we have to construct ImagePath ourselves
- PathLength = wcslen(ServiceName)*sizeof(WCHAR) + sizeof(L"system32\\drivers\\.sys");;
+ PathLength = wcslen(ServiceName)*sizeof(WCHAR) + sizeof(L"system32\\drivers\\.sys");
BootDriverEntry->FilePath.Length = 0;
BootDriverEntry->FilePath.MaximumLength = PathLength+sizeof(WCHAR);
BootDriverEntry->FilePath.Buffer = MmHeapAlloc(PathLength);
return FALSE;
// Insert entry at top of the list
- InsertTailList(BootDriverListHead, &BootDriverEntry->ListEntry);
+ InsertTailList(BootDriverListHead, &BootDriverEntry->Link);
return TRUE;
}