[NDK] DATA_SEG requires an extra #pragma on MSVC

This commit is contained in:
Victor Perevertkin 2021-04-09 04:38:35 +03:00
parent 6645227270
commit f3e1697c2b
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
2 changed files with 10 additions and 0 deletions

View file

@ -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>

View file

@ -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"),