Use C++ in Drivers

Using C++ in drivers are doable and quite easy actually, if you go with the approach of http://www.hollistech.com/. There is one catch through: you might run into following linking error:

warning LNK4254: section ‘.CRT’ (40000040) merged into ‘.data’ (C0000040) with different attributes

The workaround is change following line in htscppdata.cpp:

#pragma comment(linker, “/merge:.CRT=.data”)

to

#ifdef _WIN64
#pragma comment(linker, “/merge:.CRT=.data”)
#else
#pragma comment(linker, “/merge:.CRT=.rdata”)
#endif

The change is required with WDK 7600.16385.1.

Advertisements

Posted on April 27, 2011, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: