Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F629904
SystemInformation.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
SystemInformation.cpp
View Options
#include
"SystemInformation.h"
OPERATING_SYSTEM
SystemInformation
::
currenOS
=
UNKNOWN_OS
;
bool
SystemInformation
::
getSystemInformation
()
{
OSVERSIONINFOEX
osvi
=
{
0
};
SYSTEM_INFO
si
=
{
0
};
def_GetNativeSystemInfo
_GetNativeSystemInfo
=
0
;
osvi
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOEX
);
if
(
!
GetVersionEx
((
OSVERSIONINFO
*
)
&
osvi
))
{
return
false
;
}
if
((
osvi
.
dwMajorVersion
<
5
)
||
((
osvi
.
dwMajorVersion
==
5
)
&&
(
osvi
.
dwMinorVersion
==
0
)))
{
return
false
;
}
_GetNativeSystemInfo
=
(
def_GetNativeSystemInfo
)
GetProcAddress
(
GetModuleHandle
(
L
"kernel32.dll"
),
"GetNativeSystemInfo"
);
if
(
_GetNativeSystemInfo
)
{
_GetNativeSystemInfo
(
&
si
);
}
else
{
GetSystemInfo
(
&
si
);
}
if
(
si
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
&&
osvi
.
dwMajorVersion
==
6
&&
osvi
.
dwMinorVersion
==
0
)
{
currenOS
=
WIN_VISTA_64
;
}
else
if
(
si
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
&&
osvi
.
dwMajorVersion
==
6
&&
osvi
.
dwMinorVersion
==
0
)
{
currenOS
=
WIN_VISTA_32
;
}
else
if
(
si
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
&&
osvi
.
dwMajorVersion
==
6
&&
osvi
.
dwMinorVersion
==
1
)
{
currenOS
=
WIN_7_64
;
}
else
if
(
si
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
&&
osvi
.
dwMajorVersion
==
6
&&
osvi
.
dwMinorVersion
==
1
)
{
currenOS
=
WIN_7_32
;
}
else
if
(
si
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
&&
osvi
.
dwMajorVersion
==
5
&&
osvi
.
dwMinorVersion
==
2
)
{
currenOS
=
WIN_XP_64
;
}
else
if
(
osvi
.
dwMajorVersion
==
5
&&
osvi
.
dwMinorVersion
==
1
)
{
currenOS
=
WIN_XP_32
;
}
else
{
currenOS
=
UNKNOWN_OS
;
}
return
(
currenOS
!=
UNKNOWN_OS
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Apr 25, 9:46 PM (1 d, 18 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1c/f2/ab0641a28725b8b079d8f988d127
Attached To
rSCY Scylla
Event Timeline
Log In to Comment