Skip to content

Commit

Permalink
[GreenPad] add a way to detect KernelEx
Browse files Browse the repository at this point in the history
  • Loading branch information
roytam1 committed Jun 30, 2024
1 parent d6edc56 commit 0066039
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GreenPad/GpMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ void GreenPadWnd::on_helpabout()
+ String().SetInt( LOBYTE(sver) ) + TEXT(".")
+ String().SetInt( app().getOSBuild() );

WORD wDetType = app().getDetectType();
if( wDetType & MVI_KERNELEX )
s+= TEXT(" (KEx)");

SendMsgToItem(IDC_ABOUTSTR, WM_SETTEXT, s.c_str());
SendMsgToItem(IDC_ABOUTURL, WM_SETTEXT, TEXT("https://github.com/roytam1/rtoss/tree/master/GreenPad"));
SetCenter(hwnd(), parent_);
Expand Down
14 changes: 14 additions & 0 deletions GreenPad/kilib/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,27 @@ void App::init_osver()

}
}
// check system32
if(mvi_.wPlatform == VER_PLATFORM_WIN32_NT) {
char cSysDir[256];
int iSysDirLen = 0;
iSysDirLen = GetSystemDirectoryA(cSysDir, 256);
if(iSysDirLen && cSysDir[iSysDirLen-1] != '2') {
mvi_.wType |= MVI_KERNELEX;
}
}
}

WORD App::getOSVer()
{
return mvi_.MVI_VER;
}

WORD App::getDetectType()
{
return mvi_.wType;
}

WORD App::getOSBuild()
{
return mvi_.MVI_BUILD;
Expand Down
3 changes: 3 additions & 0 deletions GreenPad/kilib/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ typedef struct _MYVERINFO_PV {
} MYVERINFO_PV;
#pragma pack(pop)

#define MVI_KERNELEX 0x8000

#define MVI_MAJOR verbuild.vb.ver.u.cMajor
#define MVI_MINOR verbuild.vb.ver.u.cMinor
#define MVI_VER verbuild.vb.ver.wVer
Expand Down Expand Up @@ -151,6 +153,7 @@ class App
void init_osver();
WORD getOSVer();
WORD getOSBuild();
WORD getDetectType();
bool isBuildEqual(DWORD dwTarget);
bool isBuildGreater(DWORD dwTarget);
bool isWin95();
Expand Down

0 comments on commit 0066039

Please sign in to comment.