ReactOS  0.4.15-dev-2972-gda2a567
general.c File Reference
#include "precomp.h"
#include <winnls.h>
#include <powrprof.h>
#include <buildno.h>
#include <strsafe.h>
Include dependency graph for general.c:

Go to the source code of this file.

Classes

struct  _IMGINFO
 

Macros

#define ANIM_STEP   2
 
#define ANIM_TIME   50
 

Typedefs

typedef struct _IMGINFO IMGINFO
 
typedef struct _IMGINFOPIMGINFO
 

Functions

VOID ShowLastWin32Error (HWND hWndOwner)
 
static VOID InitLogo (HWND hwndDlg)
 
LRESULT CALLBACK RosImageProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetRegTextData (HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
 
static INT SetProcNameString (HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID1, UINT uID2)
 
static VOID MakeFloatValueString (DOUBLE *dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
 
static VOID SetProcSpeed (HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
 
static VOID GetSystemInformation (HWND hwnd)
 
static VOID GetSystemVersion (HWND hwnd)
 
ULONGLONG GetSecondsQPC (VOID)
 
ULONGLONG GetSeconds (VOID)
 
VOID GetSystemUptime (HWND hwnd)
 
INT_PTR CALLBACK GeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static PIMGINFO pImgInfo
 
static const BLENDFUNCTION BlendFunc = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA}
 

Macro Definition Documentation

◆ ANIM_STEP

#define ANIM_STEP   2

Definition at line 19 of file general.c.

◆ ANIM_TIME

#define ANIM_TIME   50

Definition at line 20 of file general.c.

Typedef Documentation

◆ IMGINFO

◆ PIMGINFO

Function Documentation

◆ GeneralPageProc()

INT_PTR CALLBACK GeneralPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 671 of file general.c.

672 {
675 
676  switch (uMsg)
677  {
678  case WM_INITDIALOG:
680  if (pImgInfo == NULL)
681  {
682  EndDialog(hwndDlg, 0);
683  return FALSE;
684  }
685 
686  InitLogo(hwndDlg);
688  GetSystemInformation(hwndDlg);
689  GetSystemVersion(hwndDlg);
690  GetSystemUptime(hwndDlg);
691  break;
692 
693  case WM_DESTROY:
695  break;
696 
697  case WM_COMMAND:
698  if (LOWORD(wParam) == IDC_LICENCE)
699  {
701 
702  return TRUE;
703  }
704  break;
705 
706  case WM_DRAWITEM:
707  {
709 
710  if (lpDrawItem->CtlID == IDC_ROSIMG)
711  {
712  HDC hdcMem;
713  LONG left;
714 
715  /* Position image in centre of dialog */
716  left = (lpDrawItem->rcItem.right - pImgInfo->cxSource) / 2;
717 
718  hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
719  if (hdcMem != NULL)
720  {
722  BitBlt(lpDrawItem->hDC,
723  left,
724  lpDrawItem->rcItem.top,
725  lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
726  lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
727  hdcMem,
728  0,
729  0,
730  SRCCOPY);
731  DeleteDC(hdcMem);
732  }
733  }
734  return TRUE;
735  }
736 
737  case WM_NOTIFY:
738  {
739  NMHDR *nmhdr = (NMHDR *)lParam;
740 
741  if (nmhdr->idFrom == IDC_ROSHOMEPAGE_LINK && nmhdr->code == NM_CLICK)
742  {
743  PNMLINK nml = (PNMLINK)nmhdr;
744 
745  ShellExecuteW(hwndDlg, L"open", nml->item.szUrl, NULL, NULL, SW_SHOWNORMAL);
746  }
747  break;
748  }
749 
750  }
751 
752  return FALSE;
753 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
static VOID GetSystemInformation(HWND hwnd)
Definition: general.c:448
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDC_LICENCE
Definition: resource.h:74
static VOID GetSystemVersion(HWND hwnd)
Definition: general.c:568
UINT code
Definition: winuser.h:3134
#define DialogBox
Definition: winuser.h:5736
#define IDC_ROSIMG
Definition: resource.h:75
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
UINT_PTR idFrom
Definition: winuser.h:3133
INT_PTR CALLBACK LicenceDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: licence.c:63
struct tagNMLINK * PNMLINK
#define IDC_ROSHOMEPAGE_LINK
Definition: resource.h:76
WCHAR szUrl[L_MAX_URL_LENGTH]
Definition: commctrl.h:4757
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
GLint left
Definition: glext.h:7726
static PIMGINFO pImgInfo
Definition: general.c:31
static const WCHAR L[]
Definition: oid.c:1250
#define WM_COMMAND
Definition: winuser.h:1722
#define NM_CLICK
Definition: commctrl.h:130
static VOID InitLogo(HWND hwndDlg)
Definition: general.c:60
#define GWLP_WNDPROC
Definition: treelist.c:66
INT cxSource
Definition: userinit.h:50
#define SW_SHOWNORMAL
Definition: winuser.h:764
BOOL WINAPI DeleteDC(_In_ HDC)
HBITMAP hBitmap
Definition: userinit.h:49
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDD_LICENCE
Definition: resource.h:208
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
LRESULT CALLBACK RosImageProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.c:139
#define WM_DRAWITEM
Definition: winuser.h:1627
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2274
LONG bottom
Definition: windef.h:309
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define SRCCOPY
Definition: wingdi.h:332
HDC hdcMem
Definition: welcome.c:104
#define WM_NOTIFY
Definition: richedit.h:61
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
VOID GetSystemUptime(HWND hwnd)
Definition: general.c:645

◆ GetSeconds()

ULONGLONG GetSeconds ( VOID  )

Definition at line 611 of file general.c.

612 {
613  ULONGLONG (WINAPI * pGetTickCount64)(VOID);
614  ULONGLONG Ticks64;
615  HMODULE hModule = GetModuleHandleW(L"kernel32.dll");
616 
617  pGetTickCount64 = (PVOID)GetProcAddress(hModule, "GetTickCount64");
618  if (pGetTickCount64)
619  {
620  return pGetTickCount64() / 1000;
621  }
622 
623  hModule = LoadLibraryW(L"kernel32_vista.dll");
624 
625  if (!hModule)
626  {
627  return GetSecondsQPC();
628  }
629 
630  pGetTickCount64 = (PVOID)GetProcAddress(hModule, "GetTickCount64");
631 
632  if (pGetTickCount64)
633  {
634  Ticks64 = pGetTickCount64() / 1000;
635  }
636  else
637  {
638  Ticks64 = GetSecondsQPC();
639  }
640 
642  return Ticks64;
643 }
#define LoadLibraryW(x)
Definition: compat.h:606
void * PVOID
Definition: retypes.h:9
#define FreeLibrary(x)
Definition: compat.h:607
uint64_t ULONGLONG
Definition: typedefs.h:67
#define WINAPI
Definition: msvc.h:6
static const WCHAR L[]
Definition: oid.c:1250
ULONGLONG GetSecondsQPC(VOID)
Definition: general.c:601
#define VOID
Definition: acefi.h:82
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define GetProcAddress(x, y)
Definition: compat.h:612
HMODULE hModule
Definition: animate.c:44

Referenced by GetSystemUptime().

◆ GetSecondsQPC()

ULONGLONG GetSecondsQPC ( VOID  )

Definition at line 601 of file general.c.

602 {
604 
607 
609 }
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
static LARGE_INTEGER Frequency
Definition: clock.c:41
static LARGE_INTEGER Counter
Definition: clock.c:43
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by GetSeconds().

◆ GetSystemInformation()

static VOID GetSystemInformation ( HWND  hwnd)
static

Definition at line 448 of file general.c.

449 {
450  HKEY hKey;
451  TCHAR SysKey[] = _T("HARDWARE\\DESCRIPTION\\System");
452  TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
453  MEMORYSTATUSEX MemStat;
454  TCHAR Buf[32];
455  WCHAR SMBiosName[96];
456  INT CurMachineLine = IDC_MACHINELINE1;
457 
458  /*
459  * Get hardware device name or motherboard name
460  * using information from raw SMBIOS data
461  */
462  if (GetSystemName(SMBiosName, _countof(SMBiosName)))
463  {
464  SetDlgItemText(hwnd, CurMachineLine, SMBiosName);
465  CurMachineLine++;
466  }
467  else
468  {
469  /* If SMBIOS is not available, use System Identifier */
471  {
472  SetRegTextData(hwnd, hKey, _T("Identifier"), CurMachineLine);
473  CurMachineLine++;
474  RegCloseKey(hKey);
475  }
476  }
477  /*
478  * Get Processor information
479  * although undocumented, this information is being pulled
480  * directly out of the registry instead of via setupapi as it
481  * contains all the info we need, and should remain static
482  */
484  {
485  INT PrevMachineLine;
486 
487  SetRegTextData(hwnd, hKey, _T("VendorIdentifier"), CurMachineLine);
488  CurMachineLine++;
489 
490  PrevMachineLine = CurMachineLine;
491  CurMachineLine += SetProcNameString(hwnd,
492  hKey,
493  _T("ProcessorNameString"),
494  CurMachineLine,
495  CurMachineLine + 1);
496 
497  if (CurMachineLine == PrevMachineLine)
498  {
499  /* TODO: Try obtaining CPU name from WMI (i.e. CIM_Processor) */
500 
501  /* Brand String is not available, use Identifier instead */
502  CurMachineLine += SetProcNameString(hwnd,
503  hKey,
504  _T("Identifier"),
505  CurMachineLine,
506  CurMachineLine + 1);
507  }
508 
509  SetProcSpeed(hwnd, hKey, _T("~MHz"), CurMachineLine);
510  CurMachineLine++;
511  RegCloseKey(hKey);
512  }
513 
514  /* Get total physical RAM */
515  MemStat.dwLength = sizeof(MemStat);
516 
517  if (GlobalMemoryStatusEx(&MemStat))
518  {
519  TCHAR szStr[32];
520  double dTotalPhys;
521 
522  if (MemStat.ullTotalPhys > 1024 * 1024 * 1024)
523  {
524  UINT i = 0;
525  static const UINT uStrId[] = { IDS_GIGABYTE, IDS_TERABYTE, IDS_PETABYTE};
526 
527  // We're dealing with GBs or more
528  MemStat.ullTotalPhys /= 1024 * 1024;
529 
530  if (MemStat.ullTotalPhys > 1024 * 1024)
531  {
532  // We're dealing with TBs or more
533  MemStat.ullTotalPhys /= 1024;
534  i++;
535 
536  if (MemStat.ullTotalPhys > 1024 * 1024)
537  {
538  // We're dealing with PBs or more
539  MemStat.ullTotalPhys /= 1024;
540  i++;
541 
542  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
543  }
544  else
545  {
546  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
547  }
548  }
549  else
550  {
551  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
552  }
553 
554  LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(TCHAR));
555  MakeFloatValueString(&dTotalPhys, Buf, szStr);
556  }
557  else
558  {
559  // We're dealing with MBs, don't show any decimals
560  LoadString(hApplet, IDS_MEGABYTE, szStr, sizeof(szStr) / sizeof(TCHAR));
561  wsprintf(Buf, _T("%u %s"), (UINT)MemStat.ullTotalPhys / 1024 / 1024, szStr);
562  }
563 
564  SetDlgItemText(hwnd, CurMachineLine, Buf);
565  }
566 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDS_GIGABYTE
Definition: resource.h:20
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
static VOID MakeFloatValueString(DOUBLE *dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
Definition: general.c:392
#define IDS_MEGABYTE
Definition: resource.h:19
HINSTANCE hApplet
Definition: access.c:17
int32_t INT
Definition: typedefs.h:58
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
#define IDC_MACHINELINE1
Definition: resource.h:68
static INT SetProcNameString(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID1, UINT uID2)
Definition: general.c:328
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDS_TERABYTE
Definition: resource.h:21
#define _countof(array)
Definition: sndvol32.h:68
#define SetDlgItemText
Definition: winuser.h:5824
#define IDS_PETABYTE
Definition: resource.h:22
#define RegOpenKeyEx
Definition: winreg.h:520
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
FxAutoRegKey hKey
unsigned int UINT
Definition: ndis.h:50
BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf)
Definition: smbios.c:491
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
static VOID SetRegTextData(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
Definition: general.c:308
#define wsprintf
Definition: winuser.h:5840
#define LoadString
Definition: winuser.h:5794
static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
Definition: general.c:410
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by GeneralPageProc().

◆ GetSystemUptime()

VOID GetSystemUptime ( HWND  hwnd)

Definition at line 645 of file general.c.

646 {
647  HWND hRosUptime;
648  WCHAR szBuf[64], szStr[64];
649  ULONG cSeconds;
650 
651  hRosUptime = GetDlgItem(hwnd, IDC_UPTIME);
652  if (!hRosUptime)
653  {
654  return;
655  }
656  if (!LoadStringW(hApplet, IDS_UPTIME_FORMAT, szStr, _countof(szStr)))
657  {
658  return;
659  }
660  cSeconds = GetSeconds();
661  StringCchPrintfW(szBuf, _countof(szBuf), szStr,
662  cSeconds / (60*60*24),
663  (cSeconds / (60*60)) % 24,
664  (cSeconds / 60) % 60,
665  cSeconds % 60);
666 
667  SetWindowTextW(hRosUptime, szBuf);
668 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDS_UPTIME_FORMAT
Definition: resource.h:64
HINSTANCE hApplet
Definition: access.c:17
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define IDC_UPTIME
Definition: resource.h:78
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
ULONGLONG GetSeconds(VOID)
Definition: general.c:611
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
unsigned int ULONG
Definition: retypes.h:1

Referenced by GeneralPageProc().

◆ GetSystemVersion()

static VOID GetSystemVersion ( HWND  hwnd)
static

Definition at line 568 of file general.c.

569 {
570  HWND hRosVersion;
571  SIZE_T lenStr, lenVersion;
572  PCWSTR pwszVersion = L" " TEXT(KERNEL_VERSION_RC);
573  PWSTR pwszStr;
574 
575  lenVersion = wcslen(pwszVersion);
576  if (lenVersion == 0)
577  {
578  return;
579  }
580 
581  hRosVersion = GetDlgItem(hwnd, IDC_ROSVERSION);
582  if (!hRosVersion)
583  {
584  return;
585  }
586  lenStr = GetWindowTextLengthW(hRosVersion);
587  lenStr += lenVersion + 1;
588  pwszStr = HeapAlloc(GetProcessHeap(), 0, lenStr * sizeof(WCHAR));
589  if (!pwszStr)
590  {
591  return;
592  }
593  GetWindowText(hRosVersion, pwszStr, lenStr);
594 
595  StringCchCatW(pwszStr, lenStr, pwszVersion);
596  SetWindowText(hRosVersion, pwszStr);
597 
598  HeapFree(GetProcessHeap(), 0, pwszStr);
599 }
#define IDC_ROSVERSION
Definition: resource.h:77
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint16_t * PWSTR
Definition: typedefs.h:56
#define GetWindowText
Definition: winuser.h:5773
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int WINAPI GetWindowTextLengthW(_In_ HWND)
static const WCHAR L[]
Definition: oid.c:1250
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define TEXT(s)
Definition: k32.h:26
#define SetWindowText
Definition: winuser.h:5832
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by DECLARE_INTERFACE_(), and GeneralPageProc().

◆ InitLogo()

static VOID InitLogo ( HWND  hwndDlg)
static

Definition at line 60 of file general.c.

61 {
62  BITMAP logoBitmap;
63  BITMAP maskBitmap;
65  HDC hDC, hDCLogo, hDCMask;
66  HBITMAP hMask = NULL, hLogo = NULL;
67  HBITMAP hAlphaLogo = NULL;
68  COLORREF *pBits;
69  INT line, column;
70 
71  hDC = GetDC(hwndDlg);
72  hDCLogo = CreateCompatibleDC(NULL);
73  hDCMask = CreateCompatibleDC(NULL);
74 
75  if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
76  goto Cleanup;
77 
78  ZeroMemory(pImgInfo, sizeof(*pImgInfo));
79  ZeroMemory(&bmpi, sizeof(bmpi));
80 
83 
84  if (hLogo == NULL || hMask == NULL)
85  goto Cleanup;
86 
87  GetObject(hLogo, sizeof(logoBitmap), &logoBitmap);
88  GetObject(hMask, sizeof(maskBitmap), &maskBitmap);
89 
90  if (logoBitmap.bmHeight != maskBitmap.bmHeight || logoBitmap.bmWidth != maskBitmap.bmWidth)
91  goto Cleanup;
92 
93  bmpi.bmiHeader.biSize = sizeof(BITMAPINFO);
94  bmpi.bmiHeader.biWidth = logoBitmap.bmWidth;
95  bmpi.bmiHeader.biHeight = logoBitmap.bmHeight;
99  bmpi.bmiHeader.biSizeImage = 4 * logoBitmap.bmWidth * logoBitmap.bmHeight;
100 
101  /* Create a premultiplied bitmap */
102  hAlphaLogo = CreateDIBSection(hDC, &bmpi, DIB_RGB_COLORS, (PVOID*)&pBits, 0, 0);
103  if (!hAlphaLogo)
104  goto Cleanup;
105 
106  SelectObject(hDCLogo, hLogo);
107  SelectObject(hDCMask, hMask);
108 
109  for (line = logoBitmap.bmHeight - 1; line >= 0; line--)
110  {
111  for (column = 0; column < logoBitmap.bmWidth; column++)
112  {
113  COLORREF alpha = GetPixel(hDCMask, column, line) & 0xFF;
114  COLORREF Color = GetPixel(hDCLogo, column, line);
115  DWORD r, g, b;
116 
117  r = GetRValue(Color) * alpha / 255;
118  g = GetGValue(Color) * alpha / 255;
119  b = GetBValue(Color) * alpha / 255;
120 
121  *pBits++ = b | (g << 8) | (r << 16) | (alpha << 24);
122  }
123  }
124 
125  pImgInfo->hBitmap = hAlphaLogo;
126  pImgInfo->cxSource = logoBitmap.bmWidth;
127  pImgInfo->cySource = logoBitmap.bmHeight;
128  pImgInfo->iBits = logoBitmap.bmBitsPixel;
129  pImgInfo->iPlanes = logoBitmap.bmPlanes;
130 
131 Cleanup:
132  if (hMask != NULL) DeleteObject(hMask);
133  if (hLogo != NULL) DeleteObject(hLogo);
134  if (hDCMask != NULL) DeleteDC(hDCMask);
135  if (hDCLogo != NULL) DeleteDC(hDCLogo);
136  if (hDC != NULL) ReleaseDC(hwndDlg, hDC);
137 }
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1475
INT iBits
Definition: userinit.h:53
HDC WINAPI GetDC(_In_opt_ HWND)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define GetRValue(quad)
Definition: precomp.h:64
#define ZeroMemory
Definition: winbase.h:1664
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
#define IDB_ROSBMP
Definition: resource.h:13
int32_t INT
Definition: typedefs.h:58
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD biCompression
Definition: amvideo.idl:35
Definition: parser.c:48
#define GetBValue(quad)
Definition: precomp.h:66
INT cySource
Definition: userinit.h:51
#define GetGValue(quad)
Definition: precomp.h:65
#define b
Definition: ke_i.h:79
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
DWORD COLORREF
Definition: windef.h:300
unsigned long DWORD
Definition: ntddk_ex.h:95
INT iPlanes
Definition: userinit.h:52
DWORD biSizeImage
Definition: amvideo.idl:36
#define GetObject
Definition: wingdi.h:4467
#define IDB_ROSMASK
Definition: resource.h:7
static PIMGINFO pImgInfo
Definition: general.c:31
IN PCTCH line
Definition: pager.h:36
static const WCHAR Cleanup[]
Definition: register.c:80
INT cxSource
Definition: userinit.h:50
static HDC hDC
Definition: 3dtext.c:33
BITMAPINFO bmpi
Definition: alphablend.c:68
BOOL WINAPI DeleteDC(_In_ HDC)
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:199
Definition: bl.h:1331
HBITMAP hBitmap
Definition: userinit.h:49
#define NULL
Definition: types.h:112
#define IMAGE_BITMAP
Definition: winuser.h:211
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define DIB_RGB_COLORS
Definition: wingdi.h:366
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define BI_RGB
Definition: precomp.h:47
struct tagBITMAPINFO BITMAPINFO

Referenced by GeneralPageProc().

◆ MakeFloatValueString()

static VOID MakeFloatValueString ( DOUBLE dFloatValue,
LPTSTR  szOutput,
LPTSTR  szAppend 
)
static

Definition at line 392 of file general.c.

393 {
394  TCHAR szDecimalSeparator[4];
395 
396  /* Get the decimal separator for the current locale */
397  if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0)
398  {
399  UCHAR uDecimals;
400  UINT uIntegral;
401 
402  /* Show the value with two decimals */
403  uIntegral = (UINT)*dFloatValue;
404  uDecimals = (UCHAR)((UINT)(*dFloatValue * 100) - uIntegral * 100);
405 
406  wsprintf(szOutput, _T("%u%s%02u %s"), uIntegral, szDecimalSeparator, uDecimals, szAppend);
407  }
408 }
#define LOCALE_USER_DEFAULT
#define GetLocaleInfo
Definition: winnls.h:1186
#define LOCALE_SDECIMAL
Definition: winnls.h:42
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned int UINT
Definition: ndis.h:50
#define wsprintf
Definition: winuser.h:5840

Referenced by GetSystemInformation(), and SetProcSpeed().

◆ RosImageProc()

LRESULT CALLBACK RosImageProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 139 of file general.c.

140 {
141  static UINT timerid = 0, top = 0, offset;
142  static HBITMAP hCreditsBitmap;
143 
144  switch (uMsg)
145  {
146  case WM_LBUTTONDBLCLK:
147  if (wParam & (MK_CONTROL | MK_SHIFT))
148  {
149  if (timerid == 0)
150  {
151  HDC hDC;
152  HDC hCreditsDC = NULL, hLogoDC = NULL;
153  HFONT hFont = NULL;
154  NONCLIENTMETRICS ncm;
155  RECT rcCredits;
156  TCHAR szCredits[2048];
157  INT iDevsHeight;
158 
159  hDC = GetDC(NULL);
160  if (hDC == NULL)
161  goto Cleanup;
162 
163  top = 0;
164  offset = 0;
165 
166  hCreditsDC = CreateCompatibleDC(hDC);
167  hLogoDC = CreateCompatibleDC(hCreditsDC);
168 
169  if (hCreditsDC == NULL || hLogoDC == NULL)
170  goto Cleanup;
171 
172  SetRect(&rcCredits, 0, 0, 0, 0);
173 
174  ncm.cbSize = sizeof(NONCLIENTMETRICS);
175  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
176 
177  hFont = CreateFontIndirect(&ncm.lfMessageFont);
178  if (!hFont)
179  goto Cleanup;
180  SelectObject(hCreditsDC, hFont);
181 
182  LoadString(hApplet, IDS_DEVS, szCredits, sizeof(szCredits) / sizeof(TCHAR));
183  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CALCRECT);
184 
185  iDevsHeight = rcCredits.bottom - rcCredits.top;
186 
187  hCreditsBitmap = CreateBitmap(pImgInfo->cxSource, (2 * pImgInfo->cySource) + iDevsHeight + 1, pImgInfo->iPlanes, pImgInfo->iBits, NULL);
188  if (!hCreditsBitmap)
189  goto Cleanup;
190 
191  SelectObject(hLogoDC, pImgInfo->hBitmap);
192  SelectObject(hCreditsDC, hCreditsBitmap);
193 
195 
196  SetRect(&rcCredits, 0, 0, pImgInfo->cxSource, (2 * pImgInfo->cySource) + iDevsHeight + 1);
197  FillRect(hCreditsDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
198 
199  SetRect(&rcCredits, 0, offset, pImgInfo->cxSource, offset + iDevsHeight + 1);
200  SetBkMode(hCreditsDC, TRANSPARENT);
201 
202  OffsetRect(&rcCredits, 1, 1);
204  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CENTER);
205 
206  OffsetRect(&rcCredits, -1, -1);
208  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CENTER);
209 
210  offset += iDevsHeight;
211 
212  AlphaBlend(hCreditsDC, 0, 0, pImgInfo->cxSource, pImgInfo->cySource, hLogoDC, 0, 0, pImgInfo->cxSource, pImgInfo->cySource, BlendFunc);
214 
215  timerid = SetTimer(hwnd, 1, ANIM_TIME, NULL);
216 
217 Cleanup:
218  if (hFont != NULL) DeleteObject(hFont);
219  if (hLogoDC != NULL) DeleteDC(hLogoDC);
220  if (hCreditsDC != NULL) DeleteDC(hCreditsDC);
221  if (hDC != NULL) ReleaseDC(NULL, hDC);
222  }
223  }
224  break;
225  case WM_LBUTTONDOWN:
226  if (timerid)
227  {
228  RECT rcCredits;
229  HDC hDC = GetDC(hwnd);
230  if (hDC != NULL)
231  {
232  GetClientRect(hwnd, &rcCredits);
233  SetRect(&rcCredits, 0, 0, rcCredits.right, pImgInfo->cySource);
234  FillRect(hDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
235  ReleaseDC(hwnd, hDC);
236  }
237  KillTimer(hwnd, timerid);
238  if (hCreditsBitmap != NULL)
239  DeleteObject(hCreditsBitmap);
240 
242  top = 0;
243  timerid = 0;
244  }
245  break;
246  case WM_TIMER:
247  top += ANIM_STEP;
248 
249  if (top > offset)
250  {
251  RECT rcCredits;
252  HDC hDC = GetDC(hwnd);
253  if (hDC != NULL)
254  {
255  GetClientRect(hwnd, &rcCredits);
256  SetRect(&rcCredits, 0, 0, rcCredits.right, pImgInfo->cySource);
257  FillRect(hDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
258  ReleaseDC(hwnd, hDC);
259  }
260  KillTimer(hwnd, timerid);
261  if (hCreditsBitmap != NULL)
262  DeleteObject(hCreditsBitmap);
263 
264  top = 0;
265  timerid = 0;
266  }
267 
269  break;
270  case WM_PAINT:
271  {
272  PAINTSTRUCT PS;
273  HDC hdcMem, hdc;
274  LONG left;
275 
276  hdc = wParam != 0 ? (HDC)wParam : BeginPaint(hwnd, &PS);
277 
278  GetClientRect(hwnd, &PS.rcPaint);
279 
280  /* Position image in center of dialog */
281  left = (PS.rcPaint.right - pImgInfo->cxSource) / 2;
283 
284  if (hdcMem != NULL)
285  {
286  if(timerid != 0)
287  {
288  SelectObject(hdcMem, hCreditsBitmap);
289  BitBlt(hdc, left, PS.rcPaint.top, PS.rcPaint.right - PS.rcPaint.left, PS.rcPaint.top + pImgInfo->cySource, hdcMem, 0, top, SRCCOPY);
290  }
291  else
292  {
295  }
296 
297  DeleteDC(hdcMem);
298  }
299 
300  if (wParam == 0)
301  EndPaint(hwnd,&PS);
302  break;
303  }
304  }
305  return TRUE;
306 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MK_SHIFT
Definition: winuser.h:2344
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
INT iBits
Definition: userinit.h:53
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
HDC WINAPI GetDC(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
static HDC
Definition: imagelist.c:92
#define SystemParametersInfo
Definition: winuser.h:5833
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
HFONT hFont
Definition: main.c:53
#define DrawText
Definition: winuser.h:5746
#define IDS_DEVS
Definition: resource.h:213
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1034
#define COLOR_3DFACE
Definition: winuser.h:919
#define FALSE
Definition: types.h:117
#define DT_CALCRECT
Definition: winuser.h:526
long LONG
Definition: pedump.c:60
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define TRANSPARENT
Definition: wingdi.h:949
static const BLENDFUNCTION BlendFunc
Definition: general.c:32
INT cySource
Definition: userinit.h:51
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
char TCHAR
Definition: xmlstorage.h:189
#define ANIM_TIME
Definition: general.c:20
#define ANIM_STEP
Definition: general.c:19
GLintptr offset
Definition: glext.h:5920
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
#define WM_TIMER
Definition: winuser.h:1724
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
INT iPlanes
Definition: userinit.h:52
GLint left
Definition: glext.h:7726
#define WM_PAINT
Definition: winuser.h:1602
static PIMGINFO pImgInfo
Definition: general.c:31
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
HDC hdc
Definition: main.c:9
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
static const WCHAR Cleanup[]
Definition: register.c:80
INT cxSource
Definition: userinit.h:50
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
#define COLOR_BTNSHADOW
Definition: winuser.h:920
HBITMAP hBitmap
Definition: userinit.h:49
#define CreateFontIndirect
Definition: wingdi.h:4443
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MK_CONTROL
Definition: winuser.h:2345
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define AlphaBlend
Definition: misc.c:293
LONG bottom
Definition: windef.h:309
#define DT_CENTER
Definition: winuser.h:527
static HBITMAP
Definition: button.c:44
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SRCCOPY
Definition: wingdi.h:332
#define LoadString
Definition: winuser.h:5794
HDC hdcMem
Definition: welcome.c:104
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by GeneralPageProc().

◆ SetProcNameString()

static INT SetProcNameString ( HWND  hwnd,
HKEY  hKey,
LPTSTR  Value,
UINT  uID1,
UINT  uID2 
)
static

Definition at line 328 of file general.c.

329 {
330  LPTSTR lpBuf = NULL;
331  DWORD BufSize = 0;
332  DWORD Type;
333  INT Ret = 0;
334  TCHAR szBuf[31];
335  TCHAR* szLastSpace;
336  INT LastSpace = 0;
337 
339  {
340  lpBuf = HeapAlloc(GetProcessHeap(), 0, BufSize);
341 
342  if (!lpBuf)
343  return 0;
344 
346  {
347  if (BufSize > ((30 + 1) * sizeof(TCHAR)))
348  {
349  /* Wrap the Processor Name String like XP does: *
350  * - Take the first 30 characters and look for the last space. *
351  * Then wrap the string after this space. *
352  * - If no space is found, wrap the string after character 30. *
353  * *
354  * For example the Processor Name String of a Pentium 4 is right-aligned. *
355  * With this wrapping the first line looks centered. */
356 
357  _tcsncpy(szBuf, lpBuf, 30);
358  szBuf[30] = 0;
359  szLastSpace = _tcsrchr(szBuf, ' ');
360 
361  if (szLastSpace == 0)
362  {
363  LastSpace = 30;
364  }
365  else
366  {
367  LastSpace = (szLastSpace - szBuf);
368  szBuf[LastSpace] = 0;
369  }
370 
371  _tcsncpy(szBuf, lpBuf, LastSpace);
372 
373  SetDlgItemText(hwnd, uID1, szBuf);
374  SetDlgItemText(hwnd, uID2, lpBuf+LastSpace+1);
375 
376  /* Return the number of used lines */
377  Ret = 2;
378  }
379  else
380  {
381  SetDlgItemText(hwnd, uID1, lpBuf);
382  Ret = 1;
383  }
384  }
385 
386  HeapFree(GetProcessHeap(), 0, lpBuf);
387  }
388 
389  return Ret;
390 }
#define RegQueryValueEx
Definition: winreg.h:524
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ERROR_SUCCESS
Definition: deptool.c:10
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
int32_t INT
Definition: typedefs.h:58
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define BufSize
Definition: FsRtlTunnel.c:28
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
Type
Definition: Type.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5824
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
Definition: tcsrchr.h:4
BYTE * PBYTE
Definition: pedump.c:66
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by GetSystemInformation().

◆ SetProcSpeed()

static VOID SetProcSpeed ( HWND  hwnd,
HKEY  hKey,
LPTSTR  Value,
UINT  uID 
)
static

Definition at line 410 of file general.c.

411 {
412  TCHAR szBuf[64], szHz[16];
413  DWORD BufSize = sizeof(DWORD);
414  DWORD Type = REG_SZ;
416 
417  ZeroMemory(&ppi, sizeof(ppi));
418 
420  NULL,
421  0,
422  (PVOID)&ppi,
423  sizeof(ppi)) == STATUS_SUCCESS &&
424  ppi.CurrentMhz != 0) || RegQueryValueEx(hKey, Value, NULL, &Type, (PBYTE)&ppi.CurrentMhz, &BufSize) == ERROR_SUCCESS)
425  {
426  if (ppi.CurrentMhz < 1000)
427  {
428  if (!LoadString(hApplet, IDS_MEGAHERTZ, szHz, _countof(szHz)))
429  {
430  return;
431  }
432  StringCchPrintf(szBuf, _countof(szBuf), _T("%lu %s"), ppi.CurrentMhz, szHz);
433  }
434  else
435  {
436  double flt = ppi.CurrentMhz / 1000.0;
437  if (!LoadString(hApplet, IDS_GIGAHERTZ, szHz, _countof(szHz)))
438  {
439  return;
440  }
441  MakeFloatValueString(&flt, szBuf, szHz);
442  }
443 
444  SetDlgItemText(hwnd, uID, szBuf);
445  }
446 }
#define RegQueryValueEx
Definition: winreg.h:524
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDS_MEGAHERTZ
Definition: resource.h:61
static VOID MakeFloatValueString(DOUBLE *dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
Definition: general.c:392
#define ZeroMemory
Definition: winbase.h:1664
HINSTANCE hApplet
Definition: access.c:17
#define DWORD
Definition: nt_native.h:44
#define StringCchPrintf
Definition: strsafe.h:517
NTSTATUS WINAPI CallNtPowerInformation(POWER_INFORMATION_LEVEL InformationLevel, PVOID lpInputBuffer, ULONG nInputBufferSize, PVOID lpOutputBuffer, ULONG nOutputBufferSize)
Definition: powrprof.c:59
#define BufSize
Definition: FsRtlTunnel.c:28
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define _countof(array)
Definition: sndvol32.h:68
Type
Definition: Type.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5824
#define IDS_GIGAHERTZ
Definition: resource.h:62
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
BYTE * PBYTE
Definition: pedump.c:66
#define LoadString
Definition: winuser.h:5794
#define REG_SZ
Definition: layer.c:22

Referenced by GetSystemInformation().

◆ SetRegTextData()

static VOID SetRegTextData ( HWND  hwnd,
HKEY  hKey,
LPTSTR  Value,
UINT  uID 
)
static

Definition at line 308 of file general.c.

309 {
310  LPTSTR lpBuf = NULL;
311  DWORD BufSize = 0;
312  DWORD Type;
313 
315  {
316  lpBuf = HeapAlloc(GetProcessHeap(), 0, BufSize);
317 
318  if (!lpBuf)
319  return;
320 
322  SetDlgItemText(hwnd, uID, lpBuf);
323 
324  HeapFree(GetProcessHeap(), 0, lpBuf);
325  }
326 }
#define RegQueryValueEx
Definition: winreg.h:524
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ERROR_SUCCESS
Definition: deptool.c:10
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define BufSize
Definition: FsRtlTunnel.c:28
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
Type
Definition: Type.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5824
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
BYTE * PBYTE
Definition: pedump.c:66
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by GetSystemInformation().

◆ ShowLastWin32Error()

VOID ShowLastWin32Error ( HWND  hWndOwner)

Definition at line 34 of file general.c.

35 {
36  LPTSTR lpMsg;
37  DWORD LastError;
38 
39  LastError = GetLastError();
40  if (LastError == ERROR_SUCCESS)
41  return;
42 
46  NULL,
47  LastError,
49  (LPTSTR)&lpMsg,
50  0, NULL))
51  {
52  return;
53  }
54 
55  MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
56  LocalFree(lpMsg);
57 }
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FormatMessage
Definition: winbase.h:3651
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:417
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Variable Documentation

◆ BlendFunc

◆ pImgInfo

PIMGINFO pImgInfo
static

Definition at line 31 of file general.c.

Referenced by GeneralPageProc(), InitLogo(), and RosImageProc().