i use GetNativeSystemInfo from windows api but when i use structure like microsoft i can not get parameter correctly
at the first i use this structure:
struct _SYSTEM_INFO {
union DUMMYUNIONNAME {
int dwOemId;
struct DUMMYSTRUCTNAME {
int wProcessorArchitecture;
int wReserved;
};
};
int dwPageSize;
int lpMinimumApplicationAddress;
int lpMaximumApplicationAddress;
int dwActiveProcessorMask;
int dwNumberOfProcessors;
int dwProcessorType;
int dwAllocationGranularity;
int wProcessorLevel;
int wProcessorRevision;
};
but i can not access to wProcessorArchitecture parameter.
also i have trying to edit structucture like this :
struct _SYSTEM_INFO
{
int dwOemId;
uint wProcessorArchitecture;
ulong wReserved;
int dwPageSize;
ulong lpMinimumApplicationAddress;
ulong lpMaximumApplicationAddress;
ulong dwActiveProcessorMask;
int dwNumberOfProcessors;
int dwProcessorType;
int dwAllocationGranularity;
ulong wProcessorLevel;
ulong wProcessorRevision;
};
now, when i get wProcessorArchitecture parameter, it return 4096, but microsoft msdn says that it return parameter like this :
9 5 12 6 0
can anyone help me?
this is my entire code in MQL5:
struct _SYSTEM_INFO
{
uint dwOemId;
uint wProcessorArchitecture;
ulong wReserved;
uint dwPageSize;
ulong lpMinimumApplicationAddress;
ulong lpMaximumApplicationAddress;
ulong dwActiveProcessorMask;
uint dwNumberOfProcessors;
uint dwProcessorType;
uint dwAllocationGranularity;
ulong wProcessorLevel;
ulong wProcessorRevision;
};
#import "kernel32.dll"
void GetNativeSystemInfo(_SYSTEM_INFO &lpSystemInfo);
#import
int OnInit()
{
_SYSTEM_INFO hos;
GetNativeSystemInfo(hos);
Alert(hos.wProcessorArchitecture);
}
Try the following: