Hi,
I’ve been trying to compile a large set of driver code (the Infiniband
protocol and hardware drivers) using the 6000/6001 WDK and get a fatal
compiler exit when doing 32-bit checked builds. The same set of code builds
on the W2K3 SP1 32-bit compiler just fine, so it’s definitely a new bug in
the WDK compiler. It also is ok on the 32-bit free build and the amd64
builds.
I’ve isolated the problem down to the simple example of driver code below.
It basically looks like the __ptr64 attribute breaks the compiler if applied
to a function pointer in a structure. Using __ptr64 is desirable because it
causes the shape/offsets of structures to be the same between 32-bit and
64-bit code.
Has anybody else seen this? I’ve already searched MSDN and Google for
“__ptr64 c1001” and found no matches. It would be real nice if some
Microsoft folks could look at this and suggest a solution. I’ve already
looked into removing all the __ptr64’s, but believe it would take some real
work to change the sources and figure out the impact (the Infiniband stack
is about 250,000 line of code).
We use Infiniband as the communication fabric for our server I/O
virtualization product, and would like to shift to the 6001 WDK toolset for
everything.
Thanks.
Jan Bottorff
Windows Systems Architect
Xsigo Systems
#include <ntddk.h>
struct {
void (* __ptr64 funcPtr)(long val);
} *var1;
void test(long val)
{
if (val == 0)
return;
// the following line crashes the 6000/6001 WDK 32-bit compiler with
// error C1001: An internal error has occurred in the compiler.
var1->funcPtr(0);
}
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING
RegistryPath)
{
var1->funcPtr = &test;
test(1);
return STATUS_SUCCESS;
}</ntddk.h>