/* INCLUDES ******************************************************************/
-#include <w32k.h>
+#include <win32k.h>
#define NDEBUG
#include <debug.h>
FASTCALL
InitMetrics(VOID)
{
- INT *piSysMet;
+ INT *piSysMet = gpsi->aiSysMet;
+ ULONG Width, Height;
- ULONG Width = pPrimarySurface->gdiinfo.ulHorzRes;
- ULONG Height = pPrimarySurface->gdiinfo.ulVertRes;
+ /* note: used for the SM_CLEANBOOT metric */
+ DWORD dwValue = 0;
+ HKEY hKey = 0;
- piSysMet = gpsi->aiSysMet;
+ /* Clean boot */
+ piSysMet[SM_CLEANBOOT] = 0; // fallback value of 0 (normal mode)
+ if(NT_SUCCESS(RegOpenKey(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Option", &hKey)))
+ {
+ if(RegReadDWORD(hKey, L"OptionValue", &dwValue)) piSysMet[SM_CLEANBOOT] = (INT)dwValue;
+ ZwClose(hKey);
+ }
+
+ /* FIXME: HACK, due to missing PDEV on first init */
+ if (!pPrimarySurface)
+ {
+ Width = 640;
+ Height = 480;
+ }
+ else
+ {
+ Width = pPrimarySurface->gdiinfo.ulHorzRes;
+ Height = pPrimarySurface->gdiinfo.ulVertRes;
+ }
/* Screen sizes */
piSysMet[SM_CXSCREEN] = Width;
piSysMet[SM_SLOWMACHINE] = 0;
piSysMet[SM_SECURE] = 0;
piSysMet[SM_DBCSENABLED] = 0;
- piSysMet[SM_CLEANBOOT] = 0;
piSysMet[SM_SHOWSOUNDS] = gspv.bShowSounds;
piSysMet[SM_MIDEASTENABLED] = 0;
piSysMet[SM_CMONITORS] = 1;