Will Being
Will Being

Reputation: 57

Is it possible to make a DLL that is both 32-bit and 64-bit?

I'm thinking like Apple did with their universal binaries containing both x86 and ppc code

Upvotes: 0

Views: 195

Answers (2)

MSalters
MSalters

Reputation: 179809

No. The IMAGE_FILE_HEADER.Machine field determines whether a DLL is x86 or x64. One field cannot hold two different values simultaneously, and there's only one IMAGE_FILE_HEADER in a DLL.

That said, a pure .Net DLL contains IL instructions, and they can be compiled to either 32 bits or 64 bits.

Upvotes: 1

Ahmed
Ahmed

Reputation: 7238

You can build the dll as 32Bit and it can work in both 64 and 32 environment, but it will be 32 bit dll

Upvotes: 0

Related Questions