*/
#include <freeldr.h>
-#include <arch.h>
-#include <rtl.h>
-#include <debug.h>
-#include <mm.h>
-#include <portio.h>
-#include "../../reactos/registry.h"
-#include "hardware.h"
+#define NDEBUG
+#include <debug.h>
typedef struct _ROUTING_SLOT
{
DbgPrint((DPRINT_HWDETECT, "Table size: %u\n", Table->Size));
Error = RegCreateKey(BusKey,
- "RealModeIrqRoutingTable\\0",
+ L"RealModeIrqRoutingTable\\0",
&TableKey);
if (Error != ERROR_SUCCESS)
{
/* Set 'Identifier' value */
Error = RegSetValue(TableKey,
- "Identifier",
+ L"Identifier",
REG_SZ,
- "PCI Real-mode IRQ Routing Table",
- 32);
+ (PCHAR)L"PCI Real-mode IRQ Routing Table",
+ 32 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
PartialDescriptor->u.DeviceSpecificData.DataSize = Table->Size;
- memcpy(((PVOID)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR),
+ memcpy((PVOID)((ULONG_PTR)FullResourceDescriptor + sizeof(CM_FULL_RESOURCE_DESCRIPTOR)),
Table,
Table->Size);
/* Set 'Configuration Data' value */
Error = RegSetValue(TableKey,
- "Configuration Data",
+ L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
{
PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
CM_PCI_BUS_DATA BusData;
- char Buffer[80];
+ WCHAR Buffer[80];
FRLDRHKEY BiosKey;
ULONG Size;
LONG Error;
#if 0
FRLDRHKEY BusKey;
ULONG i;
+ WCHAR szPci[] = L"PCI";
#endif
/* Report the PCI BIOS */
if (FindPciBios(&BusData))
{
/* Create new bus key */
- sprintf(Buffer,
- "MultifunctionAdapter\\%u", *BusNumber);
+ swprintf(Buffer,
+ L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
&BiosKey);
/* Set 'Identifier' value */
Error = RegSetValue(BiosKey,
- "Identifier",
+ L"Identifier",
REG_SZ,
- "PCI BIOS",
- 9);
+ (PCHAR)L"PCI BIOS",
+ 9 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
/* Initialize resource descriptor */
memset(FullResourceDescriptor, 0, Size);
- FullResourceDescriptor->InterfaceType = Internal;
+ FullResourceDescriptor->InterfaceType = PCIBus;
FullResourceDescriptor->BusNumber = 0;
FullResourceDescriptor->PartialResourceList.Count = 0;
/* Set 'Configuration Data' value */
Error = RegSetValue(BiosKey,
- "Configuration Data",
+ L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
/* Report PCI buses */
for (i = 0; i < (ULONG)BusData.BusCount; i++)
{
- sprintf(Buffer,
- "MultifunctionAdapter\\%u", *BusNumber);
+ swprintf(Buffer,
+ L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
&BusKey);
/* Set 'Identifier' value */
Error = RegSetValue(BusKey,
- "Identifier",
+ L"Identifier",
REG_SZ,
- (PUCHAR)"PCI",
- 4);
+ (PCSTR)szPci,
+ sizeof(szPci));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));