// JP opened flex table

Click to See Complete Forum and Search --> : Determine whether dll is 32 or 64 bit


ic3m4n2005
July 9th, 2008, 09:39 AM
Hello,

i need to determine whether a dll is 32 or 64 bit.
Is there any function that gives me this information before the dll is loaded ?

I hope someone has a solution :)

VladimirF
July 9th, 2008, 01:54 PM
Don't know if there is a function that does that, but you can read that dll file and look at IMAGE_FILE_HEADER, WORD Machine. I guess it will be either
#define IMAGE_FILE_MACHINE_I386 0x014c // Intel 386.
or
#define IMAGE_FILE_MACHINE_IA64 0x0200 // Intel 64

kirants
July 9th, 2008, 03:45 PM
Check out the first part of this article (http://www.codeguru.com/cpp/w-p/dll/openfaq/article.php/c14001__1/). There is code to get to the IMAGE_NT_HEADERS and from there , the IMAGE_FILE_HEADER is reachable.

VladimirF
July 9th, 2008, 06:12 PM
Check out the first part of this article (http://www.codeguru.com/cpp/w-p/dll/openfaq/article.php/c14001__1/). There is code to get to the IMAGE_NT_HEADERS and from there , the IMAGE_FILE_HEADER is reachable.I think I saw a similar code published by Matt Pietrek in 1994 here (http://msdn.microsoft.com/en-us/library/ms809762.aspx) (of course, he was not looking for .NET framework version :) )

Laurentis
July 10th, 2008, 03:15 AM
Of course there are native win32 apis !
You don't need at all to read the PE !
You can ask on advanced win32 api newsgroup :
(news://194.177.96.26/comp.os.ms-windows.programmer.win32)
where all apis have been given... for 20 years.
(even with source code, as some pros worked on Wine...)

//JP added flex table