diff --git a/hal/halx86/include/hal.h b/hal/halx86/include/hal.h index 860651951c8..ec38e8c70ce 100644 --- a/hal/halx86/include/hal.h +++ b/hal/halx86/include/hal.h @@ -36,6 +36,11 @@ #include #include +/* For MSVC, this is required before using DATA_SEG (used in pcidata) */ +#ifdef _MSC_VER +# pragma section("INIT", read,execute,discard) +#endif + /* Internal shared PCI and ACPI header */ #include #include diff --git a/ntoskrnl/config/cmdata.c b/ntoskrnl/config/cmdata.c index eb1c39bf320..95fafb225c6 100644 --- a/ntoskrnl/config/cmdata.c +++ b/ntoskrnl/config/cmdata.c @@ -65,6 +65,11 @@ ULONG CmpTypeCount[MaximumType + 1]; HANDLE CmpRegistryRootHandle; +// for MSVC, this is required before using DATA_SEG +#ifdef _MSC_VER +# pragma section("INIT", read,execute,discard) +#endif + DATA_SEG("INIT") UNICODE_STRING CmClassName[MaximumClass + 1] = { RTL_CONSTANT_STRING(L"System"),