ReactOS  0.4.15-dev-5142-g967f5b9
general.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS System Control Panel Applet
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: dll/cpl/sysdm/general.c
5  * PURPOSE: General System Information
6  * COPYRIGHT: Copyright Thomas Weidenmueller <w3seek@reactos.org>
7  * Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
8  * Copyright 2006-2007 Colin Finck <mail@colinfinck.de>
9  *
10  */
11 
12 #include "precomp.h"
13 
14 #include <winnls.h>
15 #include <powrprof.h>
16 #include <buildno.h>
17 #include <strsafe.h>
18 
19 #define ANIM_STEP 2
20 #define ANIM_TIME 50
21 #define ID_SYSUPTIME_UPDATE_TIMER 1
22 
23 typedef struct _IMGINFO
24 {
26  INT cxSource;
27  INT cySource;
28  INT iPlanes;
29  INT iBits;
30 } IMGINFO, *PIMGINFO;
31 
33 
35 static const BLENDFUNCTION BlendFunc = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
38 static WCHAR szUptimeFormat[64];
39 
41 {
42  LPTSTR lpMsg;
43  DWORD LastError;
44 
45  LastError = GetLastError();
46  if (LastError == ERROR_SUCCESS)
47  return;
48 
52  NULL,
53  LastError,
55  (LPTSTR)&lpMsg,
56  0, NULL))
57  {
58  return;
59  }
60 
61  MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
62  LocalFree(lpMsg);
63 }
64 
65 
66 static VOID InitLogo(HWND hwndDlg)
67 {
68  BITMAP logoBitmap;
69  BITMAP maskBitmap;
71  HDC hDC, hDCLogo, hDCMask;
72  HBITMAP hMask = NULL, hLogo = NULL;
73  HBITMAP hAlphaLogo = NULL;
74  COLORREF *pBits;
75  INT line, column;
76 
77  hDC = GetDC(hwndDlg);
78  hDCLogo = CreateCompatibleDC(NULL);
79  hDCMask = CreateCompatibleDC(NULL);
80 
81  if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
82  goto Cleanup;
83 
84  ZeroMemory(pImgInfo, sizeof(*pImgInfo));
85  ZeroMemory(&bmpi, sizeof(bmpi));
86 
89 
90  if (hLogo == NULL || hMask == NULL)
91  goto Cleanup;
92 
93  GetObject(hLogo, sizeof(logoBitmap), &logoBitmap);
94  GetObject(hMask, sizeof(maskBitmap), &maskBitmap);
95 
96  if (logoBitmap.bmHeight != maskBitmap.bmHeight || logoBitmap.bmWidth != maskBitmap.bmWidth)
97  goto Cleanup;
98 
99  bmpi.bmiHeader.biSize = sizeof(BITMAPINFO);
100  bmpi.bmiHeader.biWidth = logoBitmap.bmWidth;
101  bmpi.bmiHeader.biHeight = logoBitmap.bmHeight;
102  bmpi.bmiHeader.biPlanes = 1;
105  bmpi.bmiHeader.biSizeImage = 4 * logoBitmap.bmWidth * logoBitmap.bmHeight;
106 
107  /* Create a premultiplied bitmap */
108  hAlphaLogo = CreateDIBSection(hDC, &bmpi, DIB_RGB_COLORS, (PVOID*)&pBits, 0, 0);
109  if (!hAlphaLogo)
110  goto Cleanup;
111 
112  SelectObject(hDCLogo, hLogo);
113  SelectObject(hDCMask, hMask);
114 
115  for (line = logoBitmap.bmHeight - 1; line >= 0; line--)
116  {
117  for (column = 0; column < logoBitmap.bmWidth; column++)
118  {
119  COLORREF alpha = GetPixel(hDCMask, column, line) & 0xFF;
120  COLORREF Color = GetPixel(hDCLogo, column, line);
121  DWORD r, g, b;
122 
123  r = GetRValue(Color) * alpha / 255;
124  g = GetGValue(Color) * alpha / 255;
125  b = GetBValue(Color) * alpha / 255;
126 
127  *pBits++ = b | (g << 8) | (r << 16) | (alpha << 24);
128  }
129  }
130 
131  pImgInfo->hBitmap = hAlphaLogo;
132  pImgInfo->cxSource = logoBitmap.bmWidth;
133  pImgInfo->cySource = logoBitmap.bmHeight;
134  pImgInfo->iBits = logoBitmap.bmBitsPixel;
135  pImgInfo->iPlanes = logoBitmap.bmPlanes;
136 
137 Cleanup:
138  if (hMask != NULL) DeleteObject(hMask);
139  if (hLogo != NULL) DeleteObject(hLogo);
140  if (hDCMask != NULL) DeleteDC(hDCMask);
141  if (hDCLogo != NULL) DeleteDC(hDCLogo);
142  if (hDC != NULL) ReleaseDC(hwndDlg, hDC);
143 }
144 
146 {
147  static UINT timerid = 0, top = 0, offset;
148  static HBITMAP hCreditsBitmap;
149 
150  switch (uMsg)
151  {
152  case WM_LBUTTONDBLCLK:
153  if (wParam & (MK_CONTROL | MK_SHIFT))
154  {
155  if (timerid == 0)
156  {
157  HDC hDC;
158  HDC hCreditsDC = NULL, hLogoDC = NULL;
159  HFONT hFont = NULL;
160  NONCLIENTMETRICS ncm;
161  RECT rcCredits;
162  TCHAR szCredits[2048];
163  INT iDevsHeight;
164 
165  hDC = GetDC(NULL);
166  if (hDC == NULL)
167  goto Cleanup;
168 
169  top = 0;
170  offset = 0;
171 
172  hCreditsDC = CreateCompatibleDC(hDC);
173  hLogoDC = CreateCompatibleDC(hCreditsDC);
174 
175  if (hCreditsDC == NULL || hLogoDC == NULL)
176  goto Cleanup;
177 
178  SetRect(&rcCredits, 0, 0, 0, 0);
179 
180  ncm.cbSize = sizeof(NONCLIENTMETRICS);
181  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
182 
183  hFont = CreateFontIndirect(&ncm.lfMessageFont);
184  if (!hFont)
185  goto Cleanup;
186  SelectObject(hCreditsDC, hFont);
187 
188  LoadString(hApplet, IDS_DEVS, szCredits, sizeof(szCredits) / sizeof(TCHAR));
189  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CALCRECT);
190 
191  iDevsHeight = rcCredits.bottom - rcCredits.top;
192 
193  hCreditsBitmap = CreateBitmap(pImgInfo->cxSource, (2 * pImgInfo->cySource) + iDevsHeight + 1, pImgInfo->iPlanes, pImgInfo->iBits, NULL);
194  if (!hCreditsBitmap)
195  goto Cleanup;
196 
197  SelectObject(hLogoDC, pImgInfo->hBitmap);
198  SelectObject(hCreditsDC, hCreditsBitmap);
199 
201 
202  SetRect(&rcCredits, 0, 0, pImgInfo->cxSource, (2 * pImgInfo->cySource) + iDevsHeight + 1);
203  FillRect(hCreditsDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
204 
205  SetRect(&rcCredits, 0, offset, pImgInfo->cxSource, offset + iDevsHeight + 1);
206  SetBkMode(hCreditsDC, TRANSPARENT);
207 
208  OffsetRect(&rcCredits, 1, 1);
210  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CENTER);
211 
212  OffsetRect(&rcCredits, -1, -1);
214  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CENTER);
215 
216  offset += iDevsHeight;
217 
218  AlphaBlend(hCreditsDC, 0, 0, pImgInfo->cxSource, pImgInfo->cySource, hLogoDC, 0, 0, pImgInfo->cxSource, pImgInfo->cySource, BlendFunc);
220 
221  timerid = SetTimer(hwnd, 1, ANIM_TIME, NULL);
222 
223 Cleanup:
224  if (hFont != NULL) DeleteObject(hFont);
225  if (hLogoDC != NULL) DeleteDC(hLogoDC);
226  if (hCreditsDC != NULL) DeleteDC(hCreditsDC);
227  if (hDC != NULL) ReleaseDC(NULL, hDC);
228  }
229  }
230  break;
231  case WM_LBUTTONDOWN:
232  if (timerid)
233  {
234  RECT rcCredits;
235  HDC hDC = GetDC(hwnd);
236  if (hDC != NULL)
237  {
238  GetClientRect(hwnd, &rcCredits);
239  SetRect(&rcCredits, 0, 0, rcCredits.right, pImgInfo->cySource);
240  FillRect(hDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
241  ReleaseDC(hwnd, hDC);
242  }
243  KillTimer(hwnd, timerid);
244  if (hCreditsBitmap != NULL)
245  DeleteObject(hCreditsBitmap);
246 
248  top = 0;
249  timerid = 0;
250  }
251  break;
252  case WM_TIMER:
253  top += ANIM_STEP;
254 
255  if (top > offset)
256  {
257  RECT rcCredits;
258  HDC hDC = GetDC(hwnd);
259  if (hDC != NULL)
260  {
261  GetClientRect(hwnd, &rcCredits);
262  SetRect(&rcCredits, 0, 0, rcCredits.right, pImgInfo->cySource);
263  FillRect(hDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
264  ReleaseDC(hwnd, hDC);
265  }
266  KillTimer(hwnd, timerid);
267  if (hCreditsBitmap != NULL)
268  DeleteObject(hCreditsBitmap);
269 
270  top = 0;
271  timerid = 0;
272  }
273 
275  break;
276  case WM_PAINT:
277  {
278  PAINTSTRUCT PS;
279  HDC hdcMem, hdc;
280  LONG left;
281 
282  hdc = wParam != 0 ? (HDC)wParam : BeginPaint(hwnd, &PS);
283 
284  GetClientRect(hwnd, &PS.rcPaint);
285 
286  /* Position image in center of dialog */
287  left = (PS.rcPaint.right - pImgInfo->cxSource) / 2;
289 
290  if (hdcMem != NULL)
291  {
292  if(timerid != 0)
293  {
294  SelectObject(hdcMem, hCreditsBitmap);
295  BitBlt(hdc, left, PS.rcPaint.top, PS.rcPaint.right - PS.rcPaint.left, PS.rcPaint.top + pImgInfo->cySource, hdcMem, 0, top, SRCCOPY);
296  }
297  else
298  {
301  }
302 
303  DeleteDC(hdcMem);
304  }
305 
306  if (wParam == 0)
307  EndPaint(hwnd,&PS);
308  break;
309  }
310  }
311  return TRUE;
312 }
313 
315 {
316  LPTSTR lpBuf = NULL;
317  DWORD BufSize = 0;
318  DWORD Type;
319 
321  {
322  lpBuf = HeapAlloc(GetProcessHeap(), 0, BufSize);
323 
324  if (!lpBuf)
325  return;
326 
328  SetDlgItemText(hwnd, uID, lpBuf);
329 
330  HeapFree(GetProcessHeap(), 0, lpBuf);
331  }
332 }
333 
335 {
336  LPTSTR lpBuf = NULL;
337  DWORD BufSize = 0;
338  DWORD Type;
339  INT Ret = 0;
340  TCHAR szBuf[31];
341  TCHAR* szLastSpace;
342  INT LastSpace = 0;
343 
345  {
346  lpBuf = HeapAlloc(GetProcessHeap(), 0, BufSize);
347 
348  if (!lpBuf)
349  return 0;
350 
352  {
353  if (BufSize > ((30 + 1) * sizeof(TCHAR)))
354  {
355  /* Wrap the Processor Name String like XP does: *
356  * - Take the first 30 characters and look for the last space. *
357  * Then wrap the string after this space. *
358  * - If no space is found, wrap the string after character 30. *
359  * *
360  * For example the Processor Name String of a Pentium 4 is right-aligned. *
361  * With this wrapping the first line looks centered. */
362 
363  _tcsncpy(szBuf, lpBuf, 30);
364  szBuf[30] = 0;
365  szLastSpace = _tcsrchr(szBuf, ' ');
366 
367  if (szLastSpace == 0)
368  {
369  LastSpace = 30;
370  }
371  else
372  {
373  LastSpace = (szLastSpace - szBuf);
374  szBuf[LastSpace] = 0;
375  }
376 
377  _tcsncpy(szBuf, lpBuf, LastSpace);
378 
379  SetDlgItemText(hwnd, uID1, szBuf);
380  SetDlgItemText(hwnd, uID2, lpBuf+LastSpace+1);
381 
382  /* Return the number of used lines */
383  Ret = 2;
384  }
385  else
386  {
387  SetDlgItemText(hwnd, uID1, lpBuf);
388  Ret = 1;
389  }
390  }
391 
392  HeapFree(GetProcessHeap(), 0, lpBuf);
393  }
394 
395  return Ret;
396 }
397 
398 static VOID MakeFloatValueString(DOUBLE* dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
399 {
400  TCHAR szDecimalSeparator[4];
401 
402  /* Get the decimal separator for the current locale */
403  if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0)
404  {
405  UCHAR uDecimals;
406  UINT uIntegral;
407 
408  /* Show the value with two decimals */
409  uIntegral = (UINT)*dFloatValue;
410  uDecimals = (UCHAR)((UINT)(*dFloatValue * 100) - uIntegral * 100);
411 
412  wsprintf(szOutput, _T("%u%s%02u %s"), uIntegral, szDecimalSeparator, uDecimals, szAppend);
413  }
414 }
415 
417 {
418  TCHAR szBuf[64], szHz[16];
419  DWORD BufSize = sizeof(DWORD);
420  DWORD Type = REG_SZ;
422 
423  ZeroMemory(&ppi, sizeof(ppi));
424 
426  NULL,
427  0,
428  (PVOID)&ppi,
429  sizeof(ppi)) == STATUS_SUCCESS &&
430  ppi.CurrentMhz != 0) || RegQueryValueEx(hKey, Value, NULL, &Type, (PBYTE)&ppi.CurrentMhz, &BufSize) == ERROR_SUCCESS)
431  {
432  if (ppi.CurrentMhz < 1000)
433  {
434  if (!LoadString(hApplet, IDS_MEGAHERTZ, szHz, _countof(szHz)))
435  {
436  return;
437  }
438  StringCchPrintf(szBuf, _countof(szBuf), _T("%lu %s"), ppi.CurrentMhz, szHz);
439  }
440  else
441  {
442  double flt = ppi.CurrentMhz / 1000.0;
443  if (!LoadString(hApplet, IDS_GIGAHERTZ, szHz, _countof(szHz)))
444  {
445  return;
446  }
447  MakeFloatValueString(&flt, szBuf, szHz);
448  }
449 
450  SetDlgItemText(hwnd, uID, szBuf);
451  }
452 }
453 
455 {
456  HKEY hKey;
457  TCHAR SysKey[] = _T("HARDWARE\\DESCRIPTION\\System");
458  TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
459  MEMORYSTATUSEX MemStat;
460  TCHAR Buf[32];
461  WCHAR SMBiosName[96];
462  INT CurMachineLine = IDC_MACHINELINE1;
463 
464  /*
465  * Get hardware device name or motherboard name
466  * using information from raw SMBIOS data
467  */
468  if (GetSystemName(SMBiosName, _countof(SMBiosName)))
469  {
470  SetDlgItemText(hwnd, CurMachineLine, SMBiosName);
471  CurMachineLine++;
472  }
473  else
474  {
475  /* If SMBIOS is not available, use System Identifier */
477  {
478  SetRegTextData(hwnd, hKey, _T("Identifier"), CurMachineLine);
479  CurMachineLine++;
480  RegCloseKey(hKey);
481  }
482  }
483  /*
484  * Get Processor information
485  * although undocumented, this information is being pulled
486  * directly out of the registry instead of via setupapi as it
487  * contains all the info we need, and should remain static
488  */
490  {
491  INT PrevMachineLine;
492 
493  SetRegTextData(hwnd, hKey, _T("VendorIdentifier"), CurMachineLine);
494  CurMachineLine++;
495 
496  PrevMachineLine = CurMachineLine;
497  CurMachineLine += SetProcNameString(hwnd,
498  hKey,
499  _T("ProcessorNameString"),
500  CurMachineLine,
501  CurMachineLine + 1);
502 
503  if (CurMachineLine == PrevMachineLine)
504  {
505  /* TODO: Try obtaining CPU name from WMI (i.e. CIM_Processor) */
506 
507  /* Brand String is not available, use Identifier instead */
508  CurMachineLine += SetProcNameString(hwnd,
509  hKey,
510  _T("Identifier"),
511  CurMachineLine,
512  CurMachineLine + 1);
513  }
514 
515  SetProcSpeed(hwnd, hKey, _T("~MHz"), CurMachineLine);
516  CurMachineLine++;
517  RegCloseKey(hKey);
518  }
519 
520  /* Get total physical RAM */
521  MemStat.dwLength = sizeof(MemStat);
522 
523  if (GlobalMemoryStatusEx(&MemStat))
524  {
525  TCHAR szStr[32];
526  double dTotalPhys;
527 
528  if (MemStat.ullTotalPhys > 1024 * 1024 * 1024)
529  {
530  UINT i = 0;
531  static const UINT uStrId[] = { IDS_GIGABYTE, IDS_TERABYTE, IDS_PETABYTE};
532 
533  // We're dealing with GBs or more
534  MemStat.ullTotalPhys /= 1024 * 1024;
535 
536  if (MemStat.ullTotalPhys > 1024 * 1024)
537  {
538  // We're dealing with TBs or more
539  MemStat.ullTotalPhys /= 1024;
540  i++;
541 
542  if (MemStat.ullTotalPhys > 1024 * 1024)
543  {
544  // We're dealing with PBs or more
545  MemStat.ullTotalPhys /= 1024;
546  i++;
547 
548  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
549  }
550  else
551  {
552  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
553  }
554  }
555  else
556  {
557  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
558  }
559 
560  LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(TCHAR));
561  MakeFloatValueString(&dTotalPhys, Buf, szStr);
562  }
563  else
564  {
565  // We're dealing with MBs, don't show any decimals
566  LoadString(hApplet, IDS_MEGABYTE, szStr, sizeof(szStr) / sizeof(TCHAR));
567  wsprintf(Buf, _T("%u %s"), (UINT)MemStat.ullTotalPhys / 1024 / 1024, szStr);
568  }
569 
570  SetDlgItemText(hwnd, CurMachineLine, Buf);
571  }
572 }
573 
575 {
576  HWND hRosVersion;
577  SIZE_T lenStr, lenVersion;
578  PCWSTR pwszVersion = L" " TEXT(KERNEL_VERSION_RC);
579  PWSTR pwszStr;
580 
581  lenVersion = wcslen(pwszVersion);
582  if (lenVersion == 0)
583  {
584  return;
585  }
586 
587  hRosVersion = GetDlgItem(hwnd, IDC_ROSVERSION);
588  if (!hRosVersion)
589  {
590  return;
591  }
592  lenStr = GetWindowTextLengthW(hRosVersion);
593  lenStr += lenVersion + 1;
594  pwszStr = HeapAlloc(GetProcessHeap(), 0, lenStr * sizeof(WCHAR));
595  if (!pwszStr)
596  {
597  return;
598  }
599  GetWindowText(hRosVersion, pwszStr, lenStr);
600 
601  StringCchCatW(pwszStr, lenStr, pwszVersion);
602  SetWindowText(hRosVersion, pwszStr);
603 
604  HeapFree(GetProcessHeap(), 0, pwszStr);
605 }
606 
615 {
617 
620 
621  return (Counter.QuadPart * 1000) / Frequency.QuadPart;
622 }
623 
624 static VOID GetSystemUptime(HWND hwndDlg)
625 {
626  HWND hUptimeLabel;
627  ULONGLONG cMilliseconds;
628  ULONG cSeconds;
629  WCHAR szBuf[64];
630 
631  hUptimeLabel = GetDlgItem(hwndDlg, IDC_UPTIME);
632  if (!hUptimeLabel)
633  {
634  return;
635  }
636 
637  if (pGetTickCount64)
638  {
639  cMilliseconds = pGetTickCount64();
640  }
641  else
642  {
643  cMilliseconds = GetTickCountQPC();
644  }
645 
646  cSeconds = cMilliseconds / 1000;
648  cSeconds / (60*60*24), // Days
649  (cSeconds / (60*60)) % 24, // Hours
650  (cSeconds / 60) % 60, // Minutes
651  cSeconds % 60); // Seconds
652 
653  SetWindowTextW(hUptimeLabel, szBuf);
654 
655  /* Set update timer (reset timeout if the timer exists) */
656  SetTimer(hwndDlg, ID_SYSUPTIME_UPDATE_TIMER, 1000 - (cMilliseconds % 1000), NULL);
657 }
658 
659 static VOID InitSystemUptime(HWND hwndDlg)
660 {
662 
663  /* Load time format string */
665  {
666  return;
667  }
668 
669  /* Load required DLLs */
670  hKernel32 = GetModuleHandleW(L"kernel32.dll");
671  if (hKernel32)
672  {
674  if (!pGetTickCount64)
675  {
676  hKernel32Vista = LoadLibraryW(L"kernel32_vista.dll");
677  if (hKernel32Vista)
678  {
680  }
681  }
682  }
683 
684  /* Show system uptime and set update timer */
685  GetSystemUptime(hwndDlg);
686 }
687 
688 /* Property page dialog callback */
690 {
693 
694  switch (uMsg)
695  {
696  case WM_INITDIALOG:
697  {
699  if (pImgInfo == NULL)
700  {
701  EndDialog(hwndDlg, 0);
702  return FALSE;
703  }
704 
705  InitLogo(hwndDlg);
707  GetSystemInformation(hwndDlg);
708  GetSystemVersion(hwndDlg);
709  InitSystemUptime(hwndDlg);
710  break;
711  }
712 
713  case WM_DESTROY:
714  {
716 
717  if (hKernel32Vista)
718  {
720  }
721 
723  break;
724  }
725 
726  case WM_TIMER:
727  {
729  {
730  /* Update system uptime */
731  GetSystemUptime(hwndDlg);
732  }
733 
734  break;
735  }
736 
737  case WM_COMMAND:
738  {
739  if (LOWORD(wParam) == IDC_LICENCE)
740  {
742 
743  return TRUE;
744  }
745  break;
746  }
747 
748  case WM_DRAWITEM:
749  {
751 
752  if (lpDrawItem->CtlID == IDC_ROSIMG)
753  {
754  HDC hdcMem;
755  LONG left;
756 
757  /* Position image in centre of dialog */
758  left = (lpDrawItem->rcItem.right - pImgInfo->cxSource) / 2;
759 
760  hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
761  if (hdcMem != NULL)
762  {
764  BitBlt(lpDrawItem->hDC,
765  left,
766  lpDrawItem->rcItem.top,
767  lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
768  lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
769  hdcMem,
770  0,
771  0,
772  SRCCOPY);
773  DeleteDC(hdcMem);
774  }
775  }
776  return TRUE;
777  }
778 
779  case WM_NOTIFY:
780  {
781  NMHDR *nmhdr = (NMHDR *)lParam;
782 
783  if (nmhdr->idFrom == IDC_ROSHOMEPAGE_LINK && nmhdr->code == NM_CLICK)
784  {
785  PNMLINK nml = (PNMLINK)nmhdr;
786 
787  ShellExecuteW(hwndDlg, L"open", nml->item.szUrl, NULL, NULL, SW_SHOWNORMAL);
788  }
789  break;
790  }
791 
792  }
793 
794  return FALSE;
795 }
static VOID GetSystemUptime(HWND hwndDlg)
Definition: general.c:624
#define RegQueryValueEx
Definition: winreg.h:524
#define IDC_ROSVERSION
Definition: resource.h:81
#define MAKEINTRESOURCE
Definition: winuser.h:591
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IDS_GIGABYTE
Definition: resource.h:20
#define MK_SHIFT
Definition: winuser.h:2359
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
INT iBits
Definition: userinit.h:53
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
HDC WINAPI GetDC(_In_opt_ HWND)
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
uint16_t * PWSTR
Definition: typedefs.h:56
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define IDS_MEGAHERTZ
Definition: resource.h:61
struct _IMGINFO * PIMGINFO
#define LOCALE_USER_DEFAULT
VOID ShowLastWin32Error(HWND hWndOwner)
Definition: general.c:40
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
static HDC
Definition: imagelist.c:92
static VOID MakeFloatValueString(DOUBLE *dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
Definition: general.c:398
#define CALLBACK
Definition: compat.h:35
#define IDS_UPTIME_FORMAT
Definition: resource.h:64
#define GetLocaleInfo
Definition: winnls.h:1186
#define SystemParametersInfo
Definition: winuser.h:5848
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define GetRValue(quad)
Definition: precomp.h:64
#define ZeroMemory
Definition: winbase.h:1667
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDS_MEGABYTE
Definition: resource.h:19
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
LONG left
Definition: windef.h:306
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int32_t INT_PTR
Definition: typedefs.h:64
#define AC_SRC_ALPHA
Definition: alphablend.c:9
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
LONG right
Definition: windef.h:308
#define IDB_ROSBMP
Definition: resource.h:13
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DWORD
Definition: nt_native.h:44
static VOID GetSystemInformation(HWND hwnd)
Definition: general.c:454
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
HFONT hFont
Definition: main.c:53
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define DrawText
Definition: winuser.h:5761
#define IDS_DEVS
Definition: resource.h:229
#define GetWindowText
Definition: winuser.h:5788
HANDLE hKernel32
Definition: locale.c:13
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
#define IDC_UPTIME
Definition: resource.h:82
#define IDC_LICENCE
Definition: resource.h:78
static VOID GetSystemVersion(HWND hwnd)
Definition: general.c:574
UINT code
Definition: winuser.h:3149
#define DialogBox
Definition: winuser.h:5751
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define L(x)
Definition: ntvdm.h:50
#define COLOR_3DFACE
Definition: winuser.h:923
#define IDC_ROSIMG
Definition: resource.h:79
#define StringCchPrintf
Definition: strsafe.h:517
#define FALSE
Definition: types.h:117
#define DT_CALCRECT
Definition: winuser.h:526
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
long LONG
Definition: pedump.c:60
static PFGETTICKCOUNT64 pGetTickCount64
Definition: general.c:37
NTSTATUS WINAPI CallNtPowerInformation(POWER_INFORMATION_LEVEL InformationLevel, PVOID lpInputBuffer, ULONG nInputBufferSize, PVOID lpOutputBuffer, ULONG nOutputBufferSize)
Definition: powrprof.c:59
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
UINT_PTR idFrom
Definition: winuser.h:3148
static HMODULE hKernel32Vista
Definition: general.c:36
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD biCompression
Definition: amvideo.idl:35
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416
static WCHAR szUptimeFormat[64]
Definition: general.c:38
#define TRANSPARENT
Definition: wingdi.h:950
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:72
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
INT_PTR CALLBACK LicenceDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: licence.c:63
struct _IMGINFO IMGINFO
#define LoadLibraryW(x)
Definition: compat.h:606
struct tagNMLINK * PNMLINK
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_ROSHOMEPAGE_LINK
Definition: resource.h:80
Definition: parser.c:48
#define GetBValue(quad)
Definition: precomp.h:66
#define LOCALE_SDECIMAL
Definition: winnls.h:42
static const BLENDFUNCTION BlendFunc
Definition: general.c:35
WCHAR szUrl[L_MAX_URL_LENGTH]
Definition: commctrl.h:4757
#define BufSize
Definition: FsRtlTunnel.c:28
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.c:173
INT cySource
Definition: userinit.h:51
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
#define GetGValue(quad)
Definition: precomp.h:65
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define b
Definition: ke_i.h:79
#define WM_DESTROY
Definition: winuser.h:1599
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
static INT SetProcNameString(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID1, UINT uID2)
Definition: general.c:334
char TCHAR
Definition: xmlstorage.h:189
#define ANIM_TIME
Definition: general.c:20
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ANIM_STEP
Definition: general.c:19
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLintptr offset
Definition: glext.h:5920
#define IDS_TERABYTE
Definition: resource.h:21
DWORD COLORREF
Definition: windef.h:300
#define COLOR_WINDOWTEXT
Definition: winuser.h:915
uint64_t ULONGLONG
Definition: typedefs.h:67
#define _countof(array)
Definition: sndvol32.h:68
#define WM_TIMER
Definition: winuser.h:1732
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
Type
Definition: Type.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
INT iPlanes
Definition: userinit.h:52
GLint left
Definition: glext.h:7726
DWORD biSizeImage
Definition: amvideo.idl:36
static VOID InitSystemUptime(HWND hwndDlg)
Definition: general.c:659
#define GetObject
Definition: wingdi.h:4468
#define SetDlgItemText
Definition: winuser.h:5839
#define IDB_ROSMASK
Definition: resource.h:7
#define WM_PAINT
Definition: winuser.h:1610
static PIMGINFO pImgInfo
Definition: general.c:34
#define FormatMessage
Definition: winbase.h:3656
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
HDC hdc
Definition: main.c:9
#define IDS_GIGAHERTZ
Definition: resource.h:62
#define AC_SRC_OVER
Definition: wingdi.h:1369
#define MB_ICONERROR
Definition: winuser.h:781
#define VOID
Definition: acefi.h:82
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1768
#define MessageBox
Definition: winuser.h:5812
#define WM_COMMAND
Definition: winuser.h:1730
IN PCTCH line
Definition: pager.h:36
static const WCHAR Cleanup[]
Definition: register.c:80
#define NM_CLICK
Definition: commctrl.h:130
#define IDS_PETABYTE
Definition: resource.h:22
static VOID InitLogo(HWND hwndDlg)
Definition: general.c:66
#define GWLP_WNDPROC
Definition: treelist.c:66
INT cxSource
Definition: userinit.h:50
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:417
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:80
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define RegOpenKeyEx
Definition: winreg.h:520
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define TEXT(s)
Definition: k32.h:26
#define ID_SYSUPTIME_UPDATE_TIMER
Definition: general.c:21
BITMAPINFO bmpi
Definition: alphablend.c:68
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
BOOL WINAPI DeleteDC(_In_ HDC)
FxAutoRegKey hKey
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:199
#define COLOR_BTNSHADOW
Definition: winuser.h:924
Definition: bl.h:1330
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
HBITMAP hBitmap
Definition: userinit.h:49
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SetWindowText
Definition: winuser.h:5847
#define CreateFontIndirect
Definition: wingdi.h:4444
unsigned int UINT
Definition: ndis.h:50
#define IDD_LICENCE
Definition: resource.h:224
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define IMAGE_BITMAP
Definition: winuser.h:211
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
LRESULT CALLBACK RosImageProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.c:145
#define MK_CONTROL
Definition: winuser.h:2360
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static LARGE_INTEGER Frequency
Definition: clock.c:41
static LARGE_INTEGER Counter
Definition: clock.c:43
#define WM_DRAWITEM
Definition: winuser.h:1635
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define AlphaBlend
Definition: misc.c:293
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
Definition: tcsrchr.h:4
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2354
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
unsigned int ULONG
Definition: retypes.h:1
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
double DOUBLE
Definition: typedefs.h:70
LONG bottom
Definition: windef.h:309
#define DT_CENTER
Definition: winuser.h:527
#define GetProcAddress(x, y)
Definition: compat.h:612
ULONGLONG(WINAPI * PFGETTICKCOUNT64)(VOID)
Definition: general.c:32
BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf)
Definition: smbios.c:491
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define STATUS_SUCCESS
Definition: shellext.h:65
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
static VOID SetRegTextData(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
Definition: general.c:314
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
#define wsprintf
Definition: winuser.h:5855
#define DIB_RGB_COLORS
Definition: wingdi.h:367
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081
static ULONGLONG GetTickCountQPC(VOID)
An equivalent of GetTickCount64, implemented using QueryPerformanceCounter.
Definition: general.c:614
HBRUSH WINAPI GetSysColorBrush(_In_ int)
BYTE * PBYTE
Definition: pedump.c:66
#define WM_INITDIALOG
Definition: winuser.h:1729
#define BI_RGB
Definition: precomp.h:47
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define RegCloseKey(hKey)
Definition: registry.h:47
#define SRCCOPY
Definition: wingdi.h:333
#define LoadString
Definition: winuser.h:5809
static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
Definition: general.c:416
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
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
LONGLONG QuadPart
Definition: typedefs.h:114
struct tagBITMAPINFO BITMAPINFO
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
#define REG_SZ
Definition: layer.c:22