PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How to get WCE OS version without GetVersionEx function?

Broken Sword · 15 Mar 2006, 20:29 UTC
OS version info is hardcoded into the GetVersionEx function (it just places constants to OSVERSIONINFO structure). Is there another way to retrive OS version? (maybe from some system structure?).
I had been looking for a way to see if a device has a touchscreen or not and ran across this:
http://msdn.microsoft.com/library/defau ... sngbin.asp

Doesn't help me determine if the touchscreen exists, but it appears to be using a combination of GetVersionEx and SystemParametersInfo(SPI_GETPLATFORMTYPE, ... ) as a runtime check for the device type.
Broken Sword · 20 Mar 2006, 10:12 UTC
SPI_GETPLATFORMTYPE returns "PocketPC" on PPC 2003 device and "PocketPC SSDK" on WM 5.0 emulator. There is no version number yet. I had tried SPI_GETPLATFORMVERSION, it returns 4,0,4,2 on WM 5.0 emulator and empty string on PPC 2003 device :(
(btw, why?)

Maybe anybody knows another methods?
You can check the version of coredll.dll in its PE-header in ROM (e32_rom.e32_subsysmajor and e32_subsysminor). It is 5.0 for WM5, 4.21 for WM2003SE, 4.20 for 2003 first edition. I have not checked older OSes.
But module structure has changed in WM5 and e32 field is 4 bytes shifted. For some hell MS added "calledfunc" field in its middle. Good programmers never do such things.
It is easy to determine whether you need to shift or not. For example by checking "baseptr", or "startip" field positions, if it is shifted - you have WM5. Or you can use any other heuristic.
The other method is checking for presence of some functions in coredll. For example "GetDllVersion" appeared in 5.0.
Broken Sword · 21 Mar 2006, 10:12 UTC
But module structure has changed in WM5

This is the reason I need to get OS version :)

The other method is checking for presence of some functions in coredll. For example "GetDllVersion" appeared in 5.0.

I think I need more precise result... :(
Broken Sword · 23 Mar 2006, 00:07 UTC
thx mamaich, I've used such code:

Code:
ldr R0, [R4, #0x7C] ; R0 -> coredll base old
cmp R0, #0x100000
ldrlt R0, [R4, #0x78] ; WCE500 case
ldr R1, [R4, #0x8C]


It works well.