It is currently April 27th, 2024, 12:48 am

Feature Request - SysInfo PAGESIZE

Report bugs with the Rainmeter application and suggest features.
TGonZo
Posts: 68
Joined: April 25th, 2015, 8:19 pm
Location: Virginia

Feature Request - SysInfo PAGESIZE

Post by TGonZo »

Hi developers,

I'd like to request that PAGESIZE be added to the SysInfo plugin. I am not an official developer with you, but I made the changes to the 3.2.1 code I downloaded and compiled it, and it works. Basically I mimicked the OS_BITS part of the plugin, as it also pulls from the Windows SysInfo structure as well.

I'm not sure how you want to do this, so I'll put the code I added here. That should make it pretty easy for someone to add it to the latest code base. I guess I should get he Latest 3.3 code if I'm going to keep playing around, but my guess is, not that much has changed in this plugin. So, this should be close enough for this request.


SysInfo.cpp file, line 50, I added MEASURE_PAGESIZE above the MEASURE_OS_BITS line.

Code: Select all

	MEASURE_OS_VERSION,
	MEASURE_PAGESIZE,
	MEASURE_OS_BITS,

SysInfo.cpp file, line 146, I added MEASURE_PAGESIZE above the MEASURE_OS_BITS as well.

Code: Select all

	else if (_wcsicmp(L"OS_VERSION", type) == 0)
	{
		measure->type = MEASURE_OS_VERSION;
	}
	else if (_wcsicmp(L"PAGESIZE", type) == 0)
	{
		measure->type = MEASURE_PAGESIZE;
	}
	else if (_wcsicmp(L"OS_BITS", type) == 0)
	{
		measure->type = MEASURE_OS_BITS;
	}

Finally, in SysInfo.cpp, line 503, I added the case MEASURE_PAGESIZE above MEASURE_OS_BITS here.

Code: Select all

	case MEASURE_PAGESIZE:
	{
		SYSTEM_INFO si = { 0 };
		GetNativeSystemInfo(&si);
		return (si.dwPageSize);
	}

	case MEASURE_OS_BITS:
	{
		SYSTEM_INFO si = { 0 };
		GetNativeSystemInfo(&si);
		return (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
			si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) ? 64.0 : 32.0;
	}
That compiled and worked for me.

Here is the skin code to make it work. And it shows 4096 as expected.

Code: Select all

[measurePageSize]
Measure=Plugin
Plugin=SysInfo
SysInfoType=PAGESIZE
UpdateDivider=-1

[meterPageSize]
Meter=String
MeterStyle=styleCenterText
MeasureName=measurePageSize
X=10
Y=60
W=190
H=14
Text=PageSize: %1


Hopefully this can be added to the next version. It shouldn't take but 5 or 10 minutes to add it in.

I know not too many people use this, but I have recently, and it would be nice to have it officially in the plugin. It's useful in calculating pagefile usage.

Let me know what you think.

Thanks.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Feature Request - SysInfo PAGESIZE

Post by jsmorley »

This will be in the next beta release of Rainmeter. Thanks for the submission.

Not sure I see much value for 99.9% of users, but it certainly does no harm, and all things being equal, more information is better than less.

When would this ever be other than 4096 in Windows?
User avatar
SilverAzide
Rainmeter Sage
Posts: 2611
Joined: March 23rd, 2015, 5:26 pm

Re: Feature Request - SysInfo PAGESIZE

Post by SilverAzide »

I've googled this to death (or to the limit of my interest) and as best as I can tell the page size value is determined by the processor architecture. Assuming we are only interested in Windows, then it seems that we are talking 3 architectures: x86, x64, and ia64 (Intel Itanium). x86 and x64 use 4K a page size, and I can't find any reference that this value can be changed in Windows. I've seen references that ia64 uses an 8K page size. ia64 is supported by Windows XP 64-bit, Windows Server 2003, and Windows Server 2008 and 2008 R2. Microsoft discontinued support of ia64 after 2008 R2.

So, to answer your question when would the page size ever be different than 4096, it would seem to be only when running 64-bit XP/2003/2008 on an Intel ia64 processor.
:)
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Feature Request - SysInfo PAGESIZE

Post by jsmorley »

SilverAzide wrote:I've googled this to death (or to the limit of my interest) and as best as I can tell the page size value is determined by the processor architecture. Assuming we are only interested in Windows, then it seems that we are talking 3 architectures: x86, x64, and ia64 (Intel Itanium). x86 and x64 use 4K a page size, and I can't find any reference that this value can be changed in Windows. I've seen references that ia64 uses an 8K page size. ia64 is supported by Windows XP 64-bit, Windows Server 2003, and Windows Server 2008 and 2008 R2. Microsoft discontinued support of ia64 after 2008 R2.

So, to answer your question when would the page size ever be different than 4096, it would seem to be only when running 64-bit XP/2003/2008 on an Intel ia64 processor.
:)
Right, so never...
TGonZo
Posts: 68
Joined: April 25th, 2015, 8:19 pm
Location: Virginia

Re: Feature Request - SysInfo PAGESIZE

Post by TGonZo »

Fair enough. Thanks for checking it out. It doesn't sound like it is worth it.
Thanks.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Feature Request - SysInfo PAGESIZE

Post by jsmorley »

TGonZo wrote:Fair enough. Thanks for checking it out. It doesn't sound like it is worth it.
Thanks.
It's done. Be in the next beta.

Sent from my Kindle Fire HDX
TGonZo
Posts: 68
Joined: April 25th, 2015, 8:19 pm
Location: Virginia

Re: Feature Request - SysInfo PAGESIZE

Post by TGonZo »

Ok, thanks.