https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3e1697c2b96e77b670f2…
commit f3e1697c2b96e77b670f2ae19260091028e82f95
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Fri Apr 9 04:38:35 2021 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Fri Apr 9 04:38:35 2021 +0300
[NDK] DATA_SEG requires an extra #pragma on MSVC
---
hal/halx86/include/hal.h | 5 +++++
ntoskrnl/config/cmdata.c | 5 +++++
2 files changed, 10 insertions(+)
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 <ndk/kefuncs.h>
#include <ndk/rtlfuncs.h>
+/* 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 <drivers/pci/pci.h>
#include <drivers/acpi/acpi.h>
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"),