Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Can I determine CPU type and Video Ram amount with a call to a .dll file?

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 26th Jan 2008 18:31
I have written a small function to detail the spec of the PC it's running on and to output it to a file to help me with debugging and also to help judge the minimum spec needed.

It happily tells me the RAM, Graphics card type and shader versions, but I haven't been able to work out how to tell what CPU the pc has, (Name and speed), and also the System Dram command (the one to show you how much video memory the graphics card has) seems to take an absolute age to return a value.

Is there anyway I can find out these two things by calling a windows dll?

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 26th Jan 2008 19:52
Does it have to be a call to a dll? I found this a while back:

I can't remember who posted it, but it works fine on my systems. I hope it works for you.


Whatever...
Jrock
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Riven
Posted: 26th Jan 2008 22:00
You could always purchase the enhancement pack. I believe that it comes with commands to profile the user's system.

http://darkbasicpro.thegamecreators.com/?f=enhancementpack


Practice makes perfect. But if nobody is perfect, why practice?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 26th Jan 2008 22:44
@Dabbler
Thanks, that works amazingly well. Just what I was after. Is there another registry key which could report the video ram without a 48 second pause and also perhaps the network name of the pc?

@Jrock
Yeah, thank you; I have read up about the enhancement pack and i'm not sure its worth buying just for the cpu commands.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 27th Jan 2008 04:05
@=PRoF= :
I wish someone would tell me a better way of polling the various parts of system memory without using the DBP system *mem available commands. They are slow and I don't know why any of them would have to spin up my hard drives, but at least one of them does.
Maybe someone else knows the answer.

Good luck.


Whatever...
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 27th Jan 2008 15:56
I sent my little program out to a few friends last nite, and got various reports back and I've noticed one or two little problems.

Firstly, the SYSTEM TMEM AVAILABLE() command returns incorrect values if the PC has more than 4Gb of RAM. I know this is due to 32bit limitations but is there a better way of finding it out?

Secondly, on the same PC (Its quite nice, 64bit dual core, 6gb ram etc.) the SYSTEM DMEM AVAILABLE() command took an astounding 103seconds to complete. Thats nearly 2 minutes? and a lot longer than it took to run on any of my more lowly pc's

Does anyone have any other suggestions as to how to find out these values more quickly and accurately?

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 28th Jan 2008 09:27
Those registry calls are dependent on operating system and processor type. I don't think you can assume that each of them will return something on every PC - they are usually uses in combination to return at least something from most PC's.



Visit www.andromedus.com today!
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 28th Jan 2008 16:19
Now I rember where I found that:

http://forum.thegamecreators.com/?m=forum_view&t=101792&b=1

Thanks Ric.


Whatever...
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 28th Jan 2008 16:43
Quote: "Though no one would seriously try to get the available system memory that way...
"

This is Lee we are talking about.



NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 28th Jan 2008 17:22
Indeed.

Rapid texture streaming, Pixel shaders gleamin',
Cooling fans a screaming, And power bills a reaming.
darkSMASH: http://forum.thegamecreators.com/?m=forum_view&t=121881&b=8
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 28th Jan 2008 20:36
Quote: "Now I rember where I found that"


Oh yes - now so do I! I thought they looked familiar!



Visit www.andromedus.com today!
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 29th Jan 2008 10:54
In the forum entry that Dabbler link'd to, Batvink was saying about either the expansion pack or calling the relevent windows .dll file to find out.

Please, does any one know which .dll I need to be looking at? I have tried searching but to no avail.

And as for the registry entries not working on all OS's, which ones are we talking about? I have tried my program on Vista and XP Pro, both return the correct information. I can't get Win2k3server to update to DirectX 9.0c, so that can't run my program, and I doubt Windows '95 & '98 have DX9 support either?

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 29th Jan 2008 16:59
I believe DX9.0c is supported by 98 onwards.

Rapid texture streaming, Pixel shaders gleamin',
Cooling fans a screaming, And power bills a reaming.
darkSMASH: http://forum.thegamecreators.com/?m=forum_view&t=121881&b=8
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Jan 2008 00:27
@NeX
Ok dude, thats fair enough. My mistake

Does anyone have a PC running Windows '98 who can test the code snippet above from Dabbler?

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 30th Jan 2008 04:03
I just fired up my very old Acer Aspire. I has onboard graphics with insufficient memory to support DBPro, I don't know about DX9.0c. The thing is so slow I hate to mess with it.

I checked the registry. It has "VendorIdentifier" and "Identifier", but not the others. This may be an Acer modification to 98, but I can't say for sure.

Anyone else?


Whatever...
Jagulaar
17
Years of Service
User Offline
Joined: 24th Nov 2006
Location: RF, Moscow
Posted: 30th Jan 2008 08:16
Windows-98SE (+ fixes, updates, patches and other bugs)...
98SE does have "Identifier" and "Vendor Identifier", but does not have "ProcessorNameString" and "~MHz"...
Actually, more info about hardware can be found in "HKEY_LOCAL_MACHINE\Enum" branch of registry... "Root" is about CPU, AFAIR... (In 98SE, at least... Don't have xp to test...) But this branch can be quite different on different computers...

98SE supports DX9.0c_Dec_2006, newer DX do not install new d3dx_??.dll files, d3dx_31.dll is the latest working... Besides, that must be the reason why 6.4 and 6.5 DBP updates failed to work on my 98SE...

~~~/\==/\-
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 30th Jan 2008 15:03
Quote: "But who's still using Windows 98 these days anyway? Man, it's ten years old!"


I have 2 computers using Win95 at work

There is always one more imbecile than you counted on.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th Jan 2008 15:09
I seem to remember someone saying support for 98 was dropped, I can't remember who it was though.

Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 30th Jan 2008 15:24
Yeah, I read in a magazine a few months ago, (September 2007 roughly) that support for 98 had been dropped as well.


=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Jan 2008 15:46
My friend sent me this, which I have had running successfully on several Windows XP machines now. On my fastest one It dropped the time from 28 secs to 0.006 secs over the SYSTEM DMEM AVAILABLE() command.



I'd like to know if this is compatable with Vista as well, or if there is an equivilent registry key for vista.

I've found out why I can't install DirectX 9.0c on my server as well, its coz I hadn't installed the GFX drivers and it was running on the default vga ones! (D'oh!!!)

I'm definately getting there people, Thank you for your help and I hope the above helps others too

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th Jan 2008 16:02
Quote: "Yeah, I read in a magazine a few months ago, (September 2007 roughly) that support for 98 had been dropped as well."

I'm not talking about Microsoft dropping support for 98, I mean DBP.

Jagulaar
17
Years of Service
User Offline
Joined: 24th Nov 2006
Location: RF, Moscow
Posted: 30th Jan 2008 16:03
Quote: "Which is the one used by DBPro 6.6b. So it should work."

It does! Moreover, I really hope that DBP-6.7 or whatever-it'll-be-named will use d3dx_31.dll too, because there are some annoying bugs in buglist that I hope will be fixed!
Quote: "But who's still using Windows 98 these days anyway? Man, it's ten years old!"

SE-edition (the working one) of win98 is less then ten years old! And it's just 1.5 years older that xp... And why not use it? It's more finalized than xp (xp is still at beta-stage, IMO)... It's compatible with DOS, win16 and even with win-98 (unlike xp)! There are lots of working projects to make it compatible with artificial xp-only limitations like non-working installers and drivers for USB-junk... (Example: http://www.msfn.org/board/Windows-9x-Member-Projects-f91.html)
Besides, there are not so many people among my friends who use xp or (yack!) vista... Only those who were stupid enough to buy a new computer without asking for a good advice about hardware-compatibility!

But, I went off-topic... Back to Computer_Might-detection...
IMHO, checking of users CPU and it's MHz-speed is useless... Because of different CPU-architectures MHz-speed may not show the real power of the system... For example, in most tests my P-III-1266 with win98SE is as fast as P-IV-2000 with xp... Besides, games or 3D-demos usually require more GPU-power than CPU! I think that it's better to measure power of PC with FPS-count test with some sort of heavy 3D-demo... Such test will be compatible with any win32-OS and will not scare users... IMNSHO, of course...

~~~/\==/\-
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 30th Jan 2008 17:17
Quote: "CPU-architectures"


We all use x86, right?

[href: http://forum.thegamecreators.com/?m=forum_view&t=121881&b=8]Test[/href]
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Jan 2008 17:25 Edited at: 30th Jan 2008 17:30
@Jagulaar:
I just wanted to check the spec to make debugging easier. My program also reports on other stuff. I have included the report.txt file so you can see for yourself.
Its quite handy knowing what gfx card, memory and shader versions someones pc is using.

And I don't think I know anyone who still uses '98 so I may have issues getting software to be fully compatible. But the inputs handy. Thank you.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@

Attachments

Login to view attachments
Jagulaar
17
Years of Service
User Offline
Joined: 24th Nov 2006
Location: RF, Moscow
Posted: 30th Jan 2008 18:11
2=PRoF=:
Oh! I see... Well, glad to be useful anyhow... The idea came from DxDiag-utility from DirectX distributive (Display-tab)...
Quote: "And I don't think I know anyone who still uses '98 so I may have issues getting software to be fully compatible."

The only problem I've met with DBP-compatibility was v6.4 and v6.5 DX-dll problems, so you'll hardly get any problem at all if you use v6.6b! It works fine for me and I didn't get any problems with clients with this version...

2NeX the Fairly Fast Ferret:
Yes, you're absolutely right, if you mean CPU's backward-compatibility with the 32-bit instruction set of the 80386 (most usual use of x86 term)... But not exactly, if you look at CPUs with a microscope... They all are quite different and handle code in their own personal way... For example (continuing earlier mentioned example), P-III can work slowly with many instructions, while P-IV can work fast with just a few of them... See? P-IV works faster with stream data, while P-III is great for complex calculations... They are compatible, but they are different... Sorry, if I was not understandable for the first time (looks like second too)!

~~~/\==/\-
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 30th Jan 2008 18:52
you could use this function to retrieve the NETBIOS name



ps its not my function cant give credit its been on my drive for ages .
If you change the dll to advapi32.dll and change the call to GetUserNameA
it will return the current user name.

chunks...
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Jan 2008 21:00
@Chunks:
Thanks for that, I'm assuming that a call to a dll like that will work better on various os's? altho what about 64bit OS's? Would it still work for those?

Apparantly my "improved" display memory bit doesn't work with Vista, so I've had to still use the SYSTEM DMEM AVAILABLE() command if the registry key returns as 0.

Is there a .dll which I could call that would give me these values quickly and on a broader spectrum of OS's? I'd like to use a windows .dll if possible? but a 3rd party one would be just as cool I spose.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 30th Jan 2008 22:14 Edited at: 30th Jan 2008 22:34
Hi ive made a plugin which returns total physical mem and available mem plus some other things

also the dll uses pure win api calls so it should be fine on any os , just test it and let me know in this thread.

Is dmem graphics card mem

if graphics card mem is what your after i will try to add that..


ps its supposed to report large amounts of ram cant test it ive only got 2 gig

thanks chunks

Attachments

Login to view attachments
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 31st Jan 2008 17:00
@Chunks:
Thanks dude, I tried your plug-in after I eventually figured out where to put the .dll and the .ini files.

It seemed to work ok, altho reported my battery to be 255% full on my desktop pc

I can't get the file to work on other pc's tho? It just sez it can't find the .dll file and I'm not really sure where it wants it to be.

Yes, Graphics card memory is what I'm after. Try running the SYSTEM DMEM AVAILABLE() command on u'r pc and seeing how long it takes



Tell me where the .dll needs to be and i'll send it to my 6gb buddy to test u'r large amounts of ram test as well

Thanks

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 31st Jan 2008 17:04
Quote: "255% full"

I think it's supposed to. 255 is all bits set in a byte, so that probably means "power supply" or "no battery".

[href: http://forum.thegamecreators.com/?m=forum_view&t=121881&b=8]Test[/href]
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 31st Jan 2008 17:41 Edited at: 31st Jan 2008 22:45
Tried running the command took about 6 to 10 sec plus my hard drive spins up.


Ive been trying to return the dmem all night but cant get it to work.

The function GetAvailableTextureMem in direct 3d is supposed to return the availble dmem but it keeps crashing ..
plus its not super accurate

Anyways heres my c++ exported function see if anyone can help



I`ve attached another one with some more commands

Hey we could write a full diagnostic type app with all this info lol.

Thanks Chunks

Attachments

Login to view attachments
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 31st Jan 2008 23:31 Edited at: 31st Jan 2008 23:33
@Chunks:

I meant on a PC which doesn't have DBPro installed on it, I was hoping it'd just run from the same folder as the .exe

I'd worked out where to put the files for the compiler to compile and execute the source code.

Your new revision of the .dll reports my Athlon XP 3000+ as an Intel Pentium

And yeah, if you wanted to make one, I'll publish the whole source of my checker program on here when its finished and working


@NeX:

Yeah, I'd figured that :p I was just pointing it out to Chunks that it said 255%

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 1st Feb 2008 00:05
Im on a mission now to return the dmem ..

the function which reports the cpu type only returns an int and the msdn only gave the few flags that i have in my source.
It reports my dual core as a single pentium lol .
was just trying stuff , damn microsoft dont make things easy .

did you try average cpu speed just wondered if it worked with amd too ..

thanks chunks
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 1st Feb 2008 00:13
@Chunks:

Lol, Yeah, me to

The CPU speed thing seemed to work ok, I'm using the registry keys that someone suggested earlier on in the post to check the processor type and speed (Unless your running win '98 lol)

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 5th Feb 2008 22:00
any luck on the dmem thing yet ive given up all hope now

continued with my plugin im gonna retreive as much info about the system as i can...

probably no good for games but it gives me somthing to do . lol



thanks chunks
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 5th Feb 2008 22:22
@Chunks:

No luck as yet at all.

I think you can do it with the WDDM thing on Vista, but I have no idea how you'd go about it in DBPro, nor do I have a Vista PC to write it on.

I've modified my program to use the registry key method, and if it returns 0mb then it reverts back to checking with the DBPro command.

Good luck with the plug in

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@

Login to post a reply

Server time is: 2024-04-23 06:30:25
Your offset time is: 2024-04-23 06:30:25