Check if unmanaged DLL is 32-bit or 64-bit?

Refer to the specifications. Here’s a basic implementation: public static MachineType GetDllMachineType (string dllPath) { // See http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx // Offset to PE header is always at 0x3C. // The PE header starts with “PE\0\0” = 0x50 0x45 0x00 0x00, // followed by a 2-byte machine type field (see the document above for the enum). // … Read more

How do I detect which kind of JRE is installed — 32bit vs. 64bit

The JVM architecture in use can be retrieved using the “os.arch” property: System.getProperty(“os.arch”); The “os” part seems to be a bit of a misnomer, or perhaps the original designers did not expect JVMs to be running on architectures they weren’t written for. Return values seem to be inconsistent. The NetBeans Installer team are tackling the … Read more

what is the performance impact of using int64_t instead of int32_t on 32-bit systems?

which factors influence performance of these operations? Probably the compiler and compiler version; but does the operating system or the CPU make/model influence this as well? Mostly the processor architecture (and model – please read model where I mention processor architecture in this section). The compiler may have some influence, but most compilers do pretty … Read more

What is the difference between a 32-bit and 64-bit processor?

All calculations take place in the registers. When you’re adding (or subtracting, or whatever) variables together in your code, they get loaded from memory into the registers (if they’re not already there, but while you can declare an infinite number of variables, the number of registers is limited). So, having larger registers allows you to … Read more

How to Compile 32-bit Apps on 64-bit Ubuntu?

This is known to work on Ubuntu 16.04 through 22.04: sudo apt install gcc-multilib g++-multilib Then a minimal hello world: main.c #include <stdio.h> int main(void) { puts(“hello world”); return 0; } compiles without warning with: gcc -m32 -ggdb3 -O0 -pedantic-errors -std=c89 \ -Wall -Wextra -pedantic -o main.out main.c And ./main.out outputs: hello world And: file … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)