How to retrieve total amount of system RAM?

Steven Schveighoffer schveiguy at yahoo.com
Wed Aug 13 13:35:10 PDT 2008


"Benji Smith" wrote
> Wyverex wrote:
>> Id default to NT version since its Win 2000+,
>> Then force version flag for non-NT,  or dont support 95, 98, ME
>>
>> version(WIN_NO_NT)
>>   alias GlobalMemoryStatus GlobalMemoryStat;
>> else
>>   alias GlobalMemoryStatusEx GlobalMemoryStat;
>
> For this project, I'm trying to support all versions of windows, even 
> those old beasties 95, 98, and ME.
>
> (The project is a library for reporting anonymous statistics about user 
> behavior. Failing to support the older operating systems would create a 
> bias in the reporting that I'd rather avoid.)
>
> And, if at all possible, I'd rather just compile a single binary, even if 
> it means jumping through some weird hoops in writing my code. Is there any 
> feasible solution?

Usually, the non-EX versions of MS functions work fine on the newer 
platforms, they are just not preferred.

Unless, of course, there is some resolution issue :)

In that case, you can call the GetVersion function. 
http://msdn.microsoft.com/en-us/library/ms724439.aspx

-Steve 




More information about the Digitalmars-d-learn mailing list