Find out running on XP embedded

ぐ巨炮叔叔 提交于 2019-12-11 08:31:04

问题


Is there a way to find out if my program is running on XP embedded? I've tried .NET System.Environment.OSVersion, but the version information looks like that of a "normal" Windows XP, except for the minor version number, and relying on that seems to fragile to me.


回答1:


A Microsoft eMVP (Bing Chen) on Egg Head Cafe suggests GetVersionEx and a particular version registry key...

1. Call API

BOOL GetVersionEx(LPOSVERSIONINFO lpVersionInfo);

OSVERSIONINFOEX structure (which is the output of this call)

One of the members is wSuiteMask (a WORD variable).

Check the VER_SUITE_EMBEDDEDNT (0x00000040) flag in this variable.

2. Query value in Registry

 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Product-Options]
Key Name:   ProductSuite Type:
MULTI_SZ Value: EmbeddedNT
(In XP Pro, it seems that no content in this key)

While Helen Elcock suggests looking for the FBA registry value:

I check for for the DWORD registery value

[HKEY_LOCAL_MACHINE\SYSTEM\FBA]

You only get first boot assistant on embedded.

GetVersionEx seems like the more stable approach, because someone might remove the FBA key in an effort to save another couple bytes, but I'm not sure if removing that key would cause the FBA to run again anyway. You'll probably be fine with either approach.



来源:https://stackoverflow.com/questions/1399022/find-out-running-on-xp-embedded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!