ReactOS  0.4.14-dev-41-g31d7680
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

PIMGINFO pImgInfo = NULL
 
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 624 of file general.c.

625 {
628 
629  switch (uMsg)
630  {
631  case WM_INITDIALOG:
633  if (pImgInfo == NULL)
634  {
635  EndDialog(hwndDlg, 0);
636  return FALSE;
637  }
638 
639  InitLogo(hwndDlg);
641  GetSystemInformation(hwndDlg);
642  GetSystemVersion(hwndDlg);
643  GetSystemUptime(hwndDlg);
644  break;
645 
646  case WM_DESTROY:
648  break;
649 
650  case WM_COMMAND:
651  if (LOWORD(wParam) == IDC_LICENCE)
652  {
654 
655  return TRUE;
656  }
657  break;
658 
659  case WM_DRAWITEM:
660  {
662 
663  if (lpDrawItem->CtlID == IDC_ROSIMG)
664  {
665  HDC hdcMem;
666  LONG left;
667 
668  /* Position image in centre of dialog */
669  left = (lpDrawItem->rcItem.right - pImgInfo->cxSource) / 2;
670 
671  hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
672  if (hdcMem != NULL)
673  {
675  BitBlt(lpDrawItem->hDC,
676  left,
677  lpDrawItem->rcItem.top,
678  lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
679  lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
680  hdcMem,
681  0,
682  0,
683  SRCCOPY);
684  DeleteDC(hdcMem);
685  }
686  }
687  return TRUE;
688  }
689 
690  case WM_NOTIFY:
691  {
692  NMHDR *nmhdr = (NMHDR *)lParam;
693 
694  if (nmhdr->idFrom == IDC_ROSHOMEPAGE_LINK && nmhdr->code == NM_CLICK)
695  {
696  PNMLINK nml = (PNMLINK)nmhdr;
697 
698  ShellExecuteW(hwndDlg, L"open", nml->item.szUrl, NULL, NULL, SW_SHOWNORMAL);
699  }
700  break;
701  }
702 
703  }
704 
705  return FALSE;
706 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:292
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
static VOID GetSystemInformation(HWND hwnd)
Definition: general.c:428
#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:73
static VOID GetSystemVersion(HWND hwnd)
Definition: general.c:521
UINT code
Definition: winuser.h:3133
#define DialogBox
Definition: winuser.h:5662
#define IDC_ROSIMG
Definition: resource.h:74
long LONG
Definition: pedump.c:60
UINT_PTR idFrom
Definition: winuser.h:3132
INT_PTR CALLBACK LicenceDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: licence.c:63
smooth NULL
Definition: ftsmooth.c:416
struct tagNMLINK * PNMLINK
#define IDC_ROSHOMEPAGE_LINK
Definition: resource.h:75
WCHAR szUrl[L_MAX_URL_LENGTH]
Definition: commctrl.h:4728
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
GLint left
Definition: glext.h:7726
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:207
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
LRESULT CALLBACK RosImageProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.c:135
#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:2208
LONG bottom
Definition: windef.h:294
#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:394
#define SRCCOPY
Definition: wingdi.h:332
HDC hdcMem
Definition: welcome.c:104
#define WM_NOTIFY
Definition: richedit.h:61
VOID GetSystemUptime(HWND hwnd)
Definition: general.c:598

◆ GetSeconds()

ULONGLONG GetSeconds ( VOID  )

Definition at line 564 of file general.c.

565 {
566  ULONGLONG (WINAPI * pGetTickCount64)(VOID);
567  ULONGLONG Ticks64;
568  HMODULE hModule = GetModuleHandleW(L"kernel32.dll");
569 
570  pGetTickCount64 = (PVOID)GetProcAddress(hModule, "GetTickCount64");
571  if (pGetTickCount64)
572  {
573  return pGetTickCount64() / 1000;
574  }
575 
576  hModule = LoadLibraryW(L"kernel32_vista.dll");
577 
578  if (!hModule)
579  {
580  return GetSecondsQPC();
581  }
582 
583  pGetTickCount64 = (PVOID)GetProcAddress(hModule, "GetTickCount64");
584 
585  if (pGetTickCount64)
586  {
587  Ticks64 = pGetTickCount64() / 1000;
588  }
589  else
590  {
591  Ticks64 = GetSecondsQPC();
592  }
593 
595  return Ticks64;
596 }
#define LoadLibraryW(x)
Definition: compat.h:404
void * PVOID
Definition: retypes.h:9
#define FreeLibrary(x)
Definition: compat.h:405
uint64_t ULONGLONG
Definition: typedefs.h:65
#define WINAPI
Definition: msvc.h:8
static const WCHAR L[]
Definition: oid.c:1250
ULONGLONG GetSecondsQPC(VOID)
Definition: general.c:554
#define VOID
Definition: acefi.h:82
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define GetProcAddress(x, y)
Definition: compat.h:410
HMODULE hModule
Definition: animate.c:44

Referenced by GetSystemUptime().

◆ GetSecondsQPC()

ULONGLONG GetSecondsQPC ( VOID  )

Definition at line 554 of file general.c.

555 {
557 
560 
562 }
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:112

Referenced by GetSeconds().

◆ GetSystemInformation()

static VOID GetSystemInformation ( HWND  hwnd)
static

Definition at line 428 of file general.c.

429 {
430  HKEY hKey;
431  TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
432  MEMORYSTATUSEX MemStat;
433  TCHAR Buf[32];
434  WCHAR SMBiosName[96];
435  INT CurMachineLine = IDC_MACHINELINE1;
436 
437  /*
438  * Get hardware device name or motherboard name
439  * using information from raw SMBIOS data
440  */
441  if (GetSystemName(SMBiosName, _countof(SMBiosName)))
442  {
443  SetDlgItemText(hwnd, CurMachineLine, SMBiosName);
444  CurMachineLine++;
445  }
446  /*
447  * Get Processor information
448  * although undocumented, this information is being pulled
449  * directly out of the registry instead of via setupapi as it
450  * contains all the info we need, and should remain static
451  */
452  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, ProcKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
453  {
454  SetRegTextData(hwnd, hKey, _T("VendorIdentifier"), CurMachineLine);
455  CurMachineLine++;
456 
457  CurMachineLine += SetProcNameString(hwnd,
458  hKey,
459  _T("ProcessorNameString"),
460  CurMachineLine,
461  CurMachineLine + 1);
462 
463  SetProcSpeed(hwnd, hKey, _T("~MHz"), CurMachineLine);
464  CurMachineLine++;
465  }
466 
467  /* Get total physical RAM */
468  MemStat.dwLength = sizeof(MemStat);
469 
470  if (GlobalMemoryStatusEx(&MemStat))
471  {
472  TCHAR szStr[32];
473  double dTotalPhys;
474 
475  if (MemStat.ullTotalPhys > 1024 * 1024 * 1024)
476  {
477  UINT i = 0;
478  static const UINT uStrId[] = { IDS_GIGABYTE, IDS_TERABYTE, IDS_PETABYTE};
479 
480  // We're dealing with GBs or more
481  MemStat.ullTotalPhys /= 1024 * 1024;
482 
483  if (MemStat.ullTotalPhys > 1024 * 1024)
484  {
485  // We're dealing with TBs or more
486  MemStat.ullTotalPhys /= 1024;
487  i++;
488 
489  if (MemStat.ullTotalPhys > 1024 * 1024)
490  {
491  // We're dealing with PBs or more
492  MemStat.ullTotalPhys /= 1024;
493  i++;
494 
495  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
496  }
497  else
498  {
499  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
500  }
501  }
502  else
503  {
504  dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
505  }
506 
507  LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(TCHAR));
508  MakeFloatValueString(&dTotalPhys, Buf, szStr);
509  }
510  else
511  {
512  // We're dealing with MBs, don't show any decimals
513  LoadString(hApplet, IDS_MEGABYTE, szStr, sizeof(szStr) / sizeof(TCHAR));
514  wsprintf(Buf, _T("%u %s"), (UINT)MemStat.ullTotalPhys / 1024 / 1024, szStr);
515  }
516 
517  SetDlgItemText(hwnd, CurMachineLine, Buf);
518  }
519 }
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
#define _countof(array)
Definition: fontsub.cpp:30
static VOID MakeFloatValueString(DOUBLE *dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
Definition: general.c:372
#define IDS_MEGABYTE
Definition: resource.h:19
HINSTANCE hApplet
Definition: access.c:17
int32_t INT
Definition: typedefs.h:56
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
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:67
static INT SetProcNameString(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID1, UINT uID2)
Definition: general.c:308
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 SetDlgItemText
Definition: winuser.h:5750
#define IDS_PETABYTE
Definition: resource.h:22
#define RegOpenKeyEx
Definition: winreg.h:520
unsigned int UINT
Definition: ndis.h:50
BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf)
Definition: smbios.c:433
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
static VOID SetRegTextData(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
Definition: general.c:288
#define wsprintf
Definition: winuser.h:5766
#define LoadString
Definition: winuser.h:5720
static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
Definition: general.c:390
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by GeneralPageProc().

◆ GetSystemUptime()

VOID GetSystemUptime ( HWND  hwnd)

Definition at line 598 of file general.c.

599 {
600  HWND hRosUptime;
601  WCHAR szBuf[64], szStr[64];
602  ULONG cSeconds;
603 
604  hRosUptime = GetDlgItem(hwnd, IDC_UPTIME);
605  if (!hRosUptime)
606  {
607  return;
608  }
609  if (!LoadStringW(hApplet, IDS_UPTIME_FORMAT, szStr, _countof(szStr)))
610  {
611  return;
612  }
613  cSeconds = GetSeconds();
614  StringCchPrintfW(szBuf, _countof(szBuf), szStr,
615  cSeconds / (60*60*24),
616  (cSeconds / (60*60)) % 24,
617  (cSeconds / 60) % 60,
618  cSeconds % 60);
619 
620  SetWindowTextW(hRosUptime, szBuf);
621 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define _countof(array)
Definition: fontsub.cpp:30
#define IDS_UPTIME_FORMAT
Definition: resource.h:63
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:77
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONGLONG GetSeconds(VOID)
Definition: general.c:564
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 521 of file general.c.

522 {
523  HWND hRosVersion;
524  SIZE_T lenStr, lenVersion;
525  PCWSTR pwszVersion = L" " TEXT(KERNEL_VERSION_RC);
526  PWSTR pwszStr;
527 
528  lenVersion = wcslen(pwszVersion);
529  if (lenVersion == 0)
530  {
531  return;
532  }
533 
534  hRosVersion = GetDlgItem(hwnd, IDC_ROSVERSION);
535  if (!hRosVersion)
536  {
537  return;
538  }
539  lenStr = GetWindowTextLengthW(hRosVersion);
540  lenStr += lenVersion + 1;
541  pwszStr = HeapAlloc(GetProcessHeap(), 0, lenStr * sizeof(WCHAR));
542  if (!pwszStr)
543  {
544  return;
545  }
546  GetWindowText(hRosVersion, pwszStr, lenStr);
547 
548  StringCchCatW(pwszStr, lenStr, pwszVersion);
549  SetWindowText(hRosVersion, pwszStr);
550 
551  HeapFree(GetProcessHeap(), 0, pwszStr);
552 }
#define IDC_ROSVERSION
Definition: resource.h:76
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const uint16_t * PCWSTR
Definition: typedefs.h:55
uint16_t * PWSTR
Definition: typedefs.h:54
#define GetWindowText
Definition: winuser.h:5699
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
#define GetProcessHeap()
Definition: compat.h:395
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:78
#define TEXT(s)
Definition: k32.h:26
#define SetWindowText
Definition: winuser.h:5758
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by 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 = GetDC(hwndDlg);
66  HDC hDCLogo = CreateCompatibleDC(NULL);
67  HDC hDCMask = CreateCompatibleDC(NULL);
68  HBITMAP hMask, hLogo, hAlphaLogo = NULL;
69  COLORREF *pBits;
70  INT line, column;
71 
72  ZeroMemory(pImgInfo, sizeof(*pImgInfo));
73  ZeroMemory(&bmpi, sizeof(bmpi));
74 
77 
78  if (hLogo != NULL && hMask != NULL)
79  {
80  GetObject(hLogo, sizeof(BITMAP), &logoBitmap);
81  GetObject(hMask, sizeof(BITMAP), &maskBitmap);
82 
83  if(logoBitmap.bmHeight != maskBitmap.bmHeight || logoBitmap.bmWidth != maskBitmap.bmWidth)
84  return;
85 
86  pImgInfo->cxSource = logoBitmap.bmWidth;
87  pImgInfo->cySource = logoBitmap.bmHeight;
88 
89  bmpi.bmiHeader.biSize = sizeof(BITMAPINFO);
90  bmpi.bmiHeader.biWidth = logoBitmap.bmWidth;
91  bmpi.bmiHeader.biHeight = logoBitmap.bmHeight;
95  bmpi.bmiHeader.biSizeImage = 4 * logoBitmap.bmWidth * logoBitmap.bmHeight;
96 
97  hAlphaLogo = CreateDIBSection(hDC, &bmpi, DIB_RGB_COLORS, (PVOID*)&pBits, 0, 0);
98 
99  if(!hAlphaLogo)
100  return;
101 
102  SelectObject(hDCLogo, hLogo);
103  SelectObject(hDCMask, hMask);
104 
105  for(line = logoBitmap.bmHeight - 1; line >= 0; line--)
106  {
107  for(column = 0; column < logoBitmap.bmWidth; column++)
108  {
109  COLORREF alpha = GetPixel(hDCMask, column, line) & 0xFF;
110  COLORREF Color = GetPixel(hDCLogo, column, line);
111  DWORD r, g, b;
112 
113  r = GetRValue(Color) * alpha / 255;
114  g = GetGValue(Color) * alpha / 255;
115  b = GetBValue(Color) * alpha / 255;
116 
117  *pBits++ = b | g << 8 | r << 16 | alpha << 24;
118  }
119  }
120  }
121 
122  pImgInfo->hBitmap = hAlphaLogo;
123  pImgInfo->cxSource = logoBitmap.bmWidth;
124  pImgInfo->cySource = logoBitmap.bmHeight;
125  pImgInfo->iBits = logoBitmap.bmBitsPixel;
126  pImgInfo->iPLanes = logoBitmap.bmPlanes;
127 
128  DeleteObject(hLogo);
129  DeleteObject(hMask);
130  DeleteDC(hDCLogo);
131  DeleteDC(hDCMask);
132 
133 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1471
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
#define GetRValue(rgb)
Definition: wingdi.h:2930
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define ZeroMemory
Definition: winbase.h:1635
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:56
#define GetGValue(rgb)
Definition: wingdi.h:2931
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
INT cySource
Definition: userinit.h:51
#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:285
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
#define GetObject
Definition: wingdi.h:4463
#define IDB_ROSMASK
Definition: resource.h:7
PIMGINFO pImgInfo
Definition: general.c:31
char line[200]
Definition: main.c:97
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:197
Definition: bl.h:1331
HBITMAP hBitmap
Definition: userinit.h:49
#define IMAGE_BITMAP
Definition: winuser.h:211
INT iPLanes
Definition: general.c:27
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
#define GetBValue(rgb)
Definition: wingdi.h:2932
#define LoadImage
Definition: winuser.h:5716
static HBITMAP
Definition: button.c:44
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:34
struct tagBITMAPINFO BITMAPINFO

Referenced by GeneralPageProc().

◆ MakeFloatValueString()

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

Definition at line 372 of file general.c.

373 {
374  TCHAR szDecimalSeparator[4];
375 
376  /* Get the decimal separator for the current locale */
377  if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0)
378  {
379  UCHAR uDecimals;
380  UINT uIntegral;
381 
382  /* Show the value with two decimals */
383  uIntegral = (UINT)*dFloatValue;
384  uDecimals = (UCHAR)((UINT)(*dFloatValue * 100) - uIntegral * 100);
385 
386  wsprintf(szOutput, _T("%u%s%02u %s"), uIntegral, szDecimalSeparator, uDecimals, szAppend);
387  }
388 }
#define LOCALE_USER_DEFAULT
#define GetLocaleInfo
Definition: winnls.h:1183
#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:5766

Referenced by GetSystemInformation(), and SetProcSpeed().

◆ RosImageProc()

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

Definition at line 135 of file general.c.

136 {
137  static UINT timerid = 0, top = 0, offset;
138  static HBITMAP hCreditsBitmap;
139 
140  switch (uMsg)
141  {
142  case WM_LBUTTONDBLCLK:
143  if (wParam & (MK_CONTROL | MK_SHIFT))
144  {
145  if (timerid == 0)
146  {
147  HDC hCreditsDC, hLogoDC;
148  HFONT hFont;
149  NONCLIENTMETRICS ncm;
150  RECT rcCredits;
151  TCHAR szCredits[2048];
152  INT iDevsHeight;
153 
154  top = 0;
155  offset = 0;
156  hCreditsDC = CreateCompatibleDC(GetDC(NULL));
157  hLogoDC = CreateCompatibleDC(hCreditsDC);
158 
159  if (hCreditsDC == NULL || hLogoDC == NULL)
160  break;
161 
162  SetRect(&rcCredits, 0, 0, 0, 0);
163 
164  ncm.cbSize = sizeof(NONCLIENTMETRICS);
165  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
166 
167  hFont = CreateFontIndirect(&ncm.lfMessageFont);
168  SelectObject(hCreditsDC, hFont);
169 
170  LoadString(hApplet, IDS_DEVS, szCredits, sizeof(szCredits) / sizeof(TCHAR));
171  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CALCRECT);
172 
173  iDevsHeight = rcCredits.bottom - rcCredits.top;
174 
175  hCreditsBitmap = CreateBitmap(pImgInfo->cxSource, (2 * pImgInfo->cySource) + iDevsHeight + 1, pImgInfo->iPLanes, pImgInfo->iBits, NULL);
176 
177  if(!hCreditsBitmap)
178  break;
179 
180  SelectObject(hLogoDC, pImgInfo->hBitmap);
181  SelectObject(hCreditsDC, hCreditsBitmap);
182 
184 
185  SetRect(&rcCredits, 0, 0, pImgInfo->cxSource, (2 * pImgInfo->cySource) + iDevsHeight + 1);
186  FillRect(hCreditsDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
187 
188  SetRect(&rcCredits, 0, offset, pImgInfo->cxSource, offset + iDevsHeight + 1);
189  SetBkMode(hCreditsDC, TRANSPARENT);
190 
191  OffsetRect(&rcCredits, 1, 1);
193  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CENTER);
194 
195  OffsetRect(&rcCredits, -1, -1);
197  DrawText(hCreditsDC, szCredits, -1, &rcCredits, DT_CENTER);
198 
199  offset += iDevsHeight;
200 
201  AlphaBlend(hCreditsDC, 0, 0, pImgInfo->cxSource, pImgInfo->cySource, hLogoDC, 0, 0, pImgInfo->cxSource, pImgInfo->cySource, BlendFunc);
203 
204  DeleteDC(hLogoDC);
205  DeleteDC(hCreditsDC);
206 
207  timerid = SetTimer(hwnd, 1, ANIM_TIME, NULL);
208  }
209  }
210  break;
211  case WM_LBUTTONDOWN:
212  if (timerid)
213  {
214  RECT rcCredits;
215  HDC hDC = GetDC(hwnd);
216 
217  GetClientRect(hwnd, &rcCredits);
218  SetRect(&rcCredits, 0, 0, rcCredits.right, pImgInfo->cySource);
219  FillRect(hDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
220 
221  KillTimer(hwnd, timerid);
222  DeleteObject(hCreditsBitmap);
224 
225  top = 0;
226  timerid = 0;
227  }
228  break;
229  case WM_TIMER:
230  top += ANIM_STEP;
231 
232  if (top > offset)
233  {
234  RECT rcCredits;
235  HDC hDC = GetDC(hwnd);
236 
237  GetClientRect(hwnd, &rcCredits);
238  SetRect(&rcCredits, 0, 0, rcCredits.right, pImgInfo->cySource);
239  FillRect(hDC, &rcCredits, GetSysColorBrush(COLOR_3DFACE));
240 
241  KillTimer(hwnd, timerid);
242  DeleteObject(hCreditsBitmap);
243 
244  top = 0;
245  timerid = 0;
246  }
247 
249  break;
250  case WM_PAINT:
251  {
252  PAINTSTRUCT PS;
253  HDC hdcMem, hdc;
254  LONG left;
255 
256  hdc = wParam != 0 ? (HDC)wParam : BeginPaint(hwnd, &PS);
257 
258  GetClientRect(hwnd, &PS.rcPaint);
259 
260  /* Position image in center of dialog */
261  left = (PS.rcPaint.right - pImgInfo->cxSource) / 2;
263 
264  if (hdcMem != NULL)
265  {
266  if(timerid != 0)
267  {
268  SelectObject(hdcMem, hCreditsBitmap);
269  BitBlt(hdc, left, PS.rcPaint.top, PS.rcPaint.right - PS.rcPaint.left, PS.rcPaint.top + pImgInfo->cySource, hdcMem, 0, top, SRCCOPY);
270  }
271  else
272  {
275  }
276 
277  DeleteDC(hdcMem);
278  }
279 
280  if (wParam == 0)
281  EndPaint(hwnd,&PS);
282  break;
283  }
284  }
285  return TRUE;
286 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#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)
static HDC
Definition: imagelist.c:92
GLintptr offset
Definition: glext.h:5920
#define SystemParametersInfo
Definition: winuser.h:5759
LONG top
Definition: windef.h:292
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
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:293
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
int32_t INT
Definition: typedefs.h:56
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
HFONT hFont
Definition: main.c:53
#define DrawText
Definition: winuser.h:5672
#define IDS_DEVS
Definition: resource.h:212
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
#define COLOR_3DFACE
Definition: winuser.h:919
#define DT_CALCRECT
Definition: winuser.h:526
long LONG
Definition: pedump.c:60
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define TRANSPARENT
Definition: wingdi.h:949
smooth NULL
Definition: ftsmooth.c:416
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
#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)
GLint left
Definition: glext.h:7726
#define WM_PAINT
Definition: winuser.h:1602
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
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:4439
unsigned int UINT
Definition: ndis.h:50
#define MK_CONTROL
Definition: winuser.h:2345
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT iPLanes
Definition: general.c:27
#define AlphaBlend
Definition: misc.c:293
LONG bottom
Definition: windef.h:294
#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)
BLENDFUNCTION BlendFunc
Definition: general.c:32
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SRCCOPY
Definition: wingdi.h:332
#define LoadString
Definition: winuser.h:5720
HDC hdcMem
Definition: welcome.c:104
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 308 of file general.c.

309 {
310  LPTSTR lpBuf = NULL;
311  DWORD BufSize = 0;
312  DWORD Type;
313  INT Ret = 0;
314  TCHAR szBuf[31];
315  TCHAR* szLastSpace;
316  INT LastSpace = 0;
317 
319  {
320  lpBuf = HeapAlloc(GetProcessHeap(), 0, BufSize);
321 
322  if (!lpBuf)
323  return 0;
324 
325  if (RegQueryValueEx(hKey, Value, NULL, &Type, (PBYTE)lpBuf, &BufSize) == ERROR_SUCCESS)
326  {
327  if (BufSize > ((30 + 1) * sizeof(TCHAR)))
328  {
329  /* Wrap the Processor Name String like XP does: *
330  * - Take the first 30 characters and look for the last space. *
331  * Then wrap the string after this space. *
332  * - If no space is found, wrap the string after character 30. *
333  * *
334  * For example the Processor Name String of a Pentium 4 is right-aligned. *
335  * With this wrapping the first line looks centered. */
336 
337  _tcsncpy(szBuf, lpBuf, 30);
338  szBuf[30] = 0;
339  szLastSpace = _tcsrchr(szBuf, ' ');
340 
341  if (szLastSpace == 0)
342  {
343  LastSpace = 30;
344  }
345  else
346  {
347  LastSpace = (szLastSpace - szBuf);
348  szBuf[LastSpace] = 0;
349  }
350 
351  _tcsncpy(szBuf, lpBuf, LastSpace);
352 
353  SetDlgItemText(hwnd, uID1, szBuf);
354  SetDlgItemText(hwnd, uID2, lpBuf+LastSpace+1);
355 
356  /* Return the number of used lines */
357  Ret = 2;
358  }
359  else
360  {
361  SetDlgItemText(hwnd, uID1, lpBuf);
362  Ret = 1;
363  }
364  }
365 
366  HeapFree(GetProcessHeap(), 0, lpBuf);
367  }
368 
369  return Ret;
370 }
#define RegQueryValueEx
Definition: winreg.h:524
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Type
Definition: Type.h:6
#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:56
CHAR * LPTSTR
Definition: xmlstorage.h:192
smooth NULL
Definition: ftsmooth.c:416
#define BufSize
Definition: FsRtlTunnel.c:28
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5750
_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:394

Referenced by GetSystemInformation().

◆ SetProcSpeed()

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

Definition at line 390 of file general.c.

391 {
392  TCHAR szBuf[64], szHz[16];
393  DWORD BufSize = sizeof(DWORD);
394  DWORD Type = REG_SZ;
396 
397  ZeroMemory(&ppi, sizeof(ppi));
398 
400  NULL,
401  0,
402  (PVOID)&ppi,
403  sizeof(ppi)) == STATUS_SUCCESS &&
404  ppi.CurrentMhz != 0) || RegQueryValueEx(hKey, Value, NULL, &Type, (PBYTE)&ppi.CurrentMhz, &BufSize) == ERROR_SUCCESS)
405  {
406  if (ppi.CurrentMhz < 1000)
407  {
408  if (!LoadString(hApplet, IDS_MEGAHERTZ, szHz, _countof(szHz)))
409  {
410  return;
411  }
412  StringCchPrintf(szBuf, _countof(szBuf), _T("%lu %s"), ppi.CurrentMhz, szHz);
413  }
414  else
415  {
416  double flt = ppi.CurrentMhz / 1000.0;
417  if (!LoadString(hApplet, IDS_GIGAHERTZ, szHz, _countof(szHz)))
418  {
419  return;
420  }
421  MakeFloatValueString(&flt, szBuf, szHz);
422  }
423 
424  SetDlgItemText(hwnd, uID, szBuf);
425  }
426 }
#define RegQueryValueEx
Definition: winreg.h:524
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDS_MEGAHERTZ
Definition: resource.h:60
#define _countof(array)
Definition: fontsub.cpp:30
static VOID MakeFloatValueString(DOUBLE *dFloatValue, LPTSTR szOutput, LPTSTR szAppend)
Definition: general.c:372
#define ZeroMemory
Definition: winbase.h:1635
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
smooth NULL
Definition: ftsmooth.c:416
#define BufSize
Definition: FsRtlTunnel.c:28
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5750
#define IDS_GIGAHERTZ
Definition: resource.h:61
return STATUS_SUCCESS
Definition: btrfs.c:2966
BYTE * PBYTE
Definition: pedump.c:66
#define LoadString
Definition: winuser.h:5720
#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 288 of file general.c.

289 {
290  LPTSTR lpBuf = NULL;
291  DWORD BufSize = 0;
292  DWORD Type;
293 
295  {
296  lpBuf = HeapAlloc(GetProcessHeap(), 0, BufSize);
297 
298  if (!lpBuf)
299  return;
300 
301  if (RegQueryValueEx(hKey, Value, NULL, &Type, (PBYTE)lpBuf, &BufSize) == ERROR_SUCCESS)
302  SetDlgItemText(hwnd, uID, lpBuf);
303 
304  HeapFree(GetProcessHeap(), 0, lpBuf);
305  }
306 }
#define RegQueryValueEx
Definition: winreg.h:524
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
CHAR * LPTSTR
Definition: xmlstorage.h:192
smooth NULL
Definition: ftsmooth.c:416
#define BufSize
Definition: FsRtlTunnel.c:28
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5750
BYTE * PBYTE
Definition: pedump.c:66
#define HeapFree(x, y, z)
Definition: compat.h:394

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:1059
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FormatMessage
Definition: winbase.h:3612
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5723
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define MB_OK
Definition: winuser.h:784
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Variable Documentation

◆ BlendFunc

◆ pImgInfo

PIMGINFO pImgInfo = NULL

Definition at line 31 of file general.c.

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