Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to test a windows dll to determine if it is 32bit or 64bit?



How to test a windows dll to determine if it is 32bit or 64bit?..

Answer / Ankit Agrawal

To check whether a Windows DLL is 32-bit or 64-bit, you can use the `IMAGE_FILE_MACHINE` structure defined in the WinNT.h header file. Here's an example code snippet using Visual C++:
```cpp
#include <windows.h>
#include <stdio.h>

BOOL Is32BitDll(const char *dllPath) {
IMAGE_FILE_HEADER imageFileHeader;
HANDLE file = CreateFileA(dllPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

if (file == INVALID_HANDLE_VALUE) {
return false;
}

DWORD fileSize = GetFileSize(file, NULL);
ReadFile(file, &imageFileHeader, sizeof(IMAGE_FILE_HEADER), NULL, NULL);

CloseHandle(file);

return (imageFileHeader.Machine == IMAGE_FILE_MACHINE_I386); // returns true for 32-bit DLL
}
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Windows General Interview Questions

What is an application error?

1 Answers  


Can a pentium 4 run windows 10?

1 Answers  


How do I find windows server version?

1 Answers  


What is the best email program for windows 7?

1 Answers  


What is a code migration?

1 Answers  


How do you solve windows cannot install required files?

1 Answers  


What is offline defragmentation in AD and how do we do it?

2 Answers   Accenture,


Does windows 10 defender scan automatically?

1 Answers  


How do I find missing dll files in windows 7?

1 Answers  


Who created windows?

1 Answers  


How do I run a script in windows?

1 Answers  


What is my windows version?

1 Answers  


Categories