473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Win32: Detect actual physical memory when /maxmem is present

3
Hi, this is my first post here. I tried to read the Posting Guidelines but the page was blank. I'll try to use basic common sense, but please forgive (and inform) me if I commit an error in my post.

My goal is to detect the total amount of physical memory in the system regardless of any value set via /maxmem in boot.ini. The principle behind this technique is that if maxmem is set in boot.ini, and the value it is set to is less than what the system actually reports, then the system's memory is being artificially crippled. I don't need help parsing boot.ini or comparing, just where to look to get the hardware-level memory size.

I am working in (Visual Studio 2005) C++ in the Win32 environment. My target platform is Windows XP Service Pack 2. I actually have a solution in C# using .NET, but this does not work since .NET is unlikely to be pre-Installed on machines the program is used on.

The following is a C# snippet which doesn't seem to be restricted by /maxmem.
Expand|Select|Wrap|Line Numbers
  1.             ManagementObjectSearcher searcher =
  2.                new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMemory");
  3.             foreach (ManagementObject bank in searcher.Get()) {
  4.                 MessageBox.Show(" size = " + bank["Capacity"].ToString());
  5.             } 
  6.  
I've been attempting to translate this into C++ (sans .NET) without much success.

I've tried GetMemoryStatusEx; unfortunately what it returns for "total memory" is still restricted by maxmem. If I find a solution before anyone responds I'll post back.
Jun 10 '09 #1
4 4318
Banfa
9,065 Expert Mod 8TB
I have an idea about how this may be done, however I can't remember it. I need to get to the computer where I have the information stored which will happen tomorrow. Let us know if you find the answer before then.
Jun 11 '09 #2
kihjin
3
Thanks Banfa. No solution found yet.
Jun 11 '09 #3
kihjin
3
I still haven't figured this out. If you know of a solution please assist.
Jun 15 '09 #4
ddougg
1
Have you seen this post?
Reading physical memory size from the registry
http://blog.delphi-jedi.net/2009/03/20/324/
Sep 2 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: MichaƂ Januszczyk | last post by:
Is there any _managed_ way of getting total physical memory installed in the machine Thanks in advanc MichaƂ Januszczyk
2
by: Steven | last post by:
I have a new db2 server and we are moving to V8. The box is running W2K and has 12 gig of memory. The operating system is only showing 4 gig of it and that is one thing but when I pulled up the...
9
by: Olumide | last post by:
Thats the question. I know about virtual memory, and the MMU. I just wonder if array members guaranteed to be contiguous in physical memory (and if so, why). Thanks, Olumide
0
by: Dmitri Shvetsov | last post by:
Hi, Can somebody show the code to get the amount of the physical memory? I found several calls but it doesn't show the physical memory, virtual, under process,... Thanks. Dmitri
4
by: Sharon | last post by:
I have an application that fails to allocate all its memory on physical memory. I have a Windows XP with 2 GByte RAM. Can anybody tell me how to configure the allowed physical memory for each...
2
by: Groenie | last post by:
Hi I am getting a blue screen when booting the pc up with error: "Beginning dump of physical memory". When I reboot the error is goes away only to appear again next time when booting up. Can...
2
by: doudehou | last post by:
Hi guys, I want to get the physical memory status, say, the total amount of physical memory, the free memory, and so on, from the javascript, is it a mission impossible? Thank you very much...
6
by: Grant | last post by:
I need to write data to a physical address between 0xD0000 and 0xDFFFF I have download the windows DDK but have no experience with this and would like to get up and running very quickly can any one...
3
by: john | last post by:
I would like to view physical memory that is mapped to a pci board. I am using a tool called WinIO to try to create a virtual address to that physical memory. It works for both read and write of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.