ReactOS  0.4.13-dev-52-g0efcfec
precomp.h File Reference
#include <stdarg.h>
#include <ntstatus.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <wincon.h>
#include <windowsx.h>
#include <tchar.h>
#include <shellapi.h>
#include <shlobj.h>
#include "resource.h"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 
struct  _PAGEFILE
 
struct  _VIRTMEM
 
struct  _BOOTRECORD
 

Macros

#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define WIN32_NO_STATUS
 
#define NUM_APPLETS   (1)
 

Typedefs

typedef LONG(CALLBACKAPPLET_INITPROC) (VOID)
 
typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 
typedef struct _PAGEFILE PAGEFILE
 
typedef struct _PAGEFILEPPAGEFILE
 
typedef struct _VIRTMEM VIRTMEM
 
typedef struct _VIRTMEMPVIRTMEM
 
typedef struct _BOOTRECORD BOOTRECORD
 
typedef struct _BOOTRECORDPBOOTRECORD
 

Functions

void ShowLastWin32Error (HWND hWndOwner)
 
INT_PTR CALLBACK GeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK HardwarePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AdvancedPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK HardProfDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK UserProfileDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK EnvironmentDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK StartRecDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK VirtMemDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK LicenceDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
BOOL GetSystemName (PWSTR pBuf, SIZE_T cchBuf)
 
INT ResourceMessageBox (IN HINSTANCE hInstance, IN HWND hwnd, IN UINT uType, IN UINT uCaption, IN UINT uText)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 6 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 7 of file precomp.h.

◆ NUM_APPLETS

#define NUM_APPLETS   (1)

Definition at line 23 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file precomp.h.

Typedef Documentation

◆ APPLET

◆ APPLET_INITPROC

typedef LONG(CALLBACK * APPLET_INITPROC) (VOID)

Definition at line 25 of file precomp.h.

◆ BOOTRECORD

◆ PAGEFILE

◆ PAPPLET

typedef struct _APPLET * PAPPLET

◆ PBOOTRECORD

◆ PPAGEFILE

◆ PVIRTMEM

◆ VIRTMEM

Function Documentation

◆ AdvancedPageProc()

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

Definition at line 423 of file advanced.c.

427 {
428  PGLOBALDATA pGlobalData;
429 
430  pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
431 
432  switch (uMsg)
433  {
434  case WM_INITDIALOG:
435  pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
436  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
437 
438  InitLanguagesList(hwndDlg, pGlobalData);
439  InitCodePagesList(hwndDlg);
440  break;
441 
442  case WM_COMMAND:
443  switch (LOWORD(wParam))
444  {
445  case IDC_LANGUAGE_COMBO:
446  if (HIWORD(wParam) == CBN_SELCHANGE)
447  {
448  LCID lcid;
449  INT iIndex;
450 
451  iIndex = SendMessage(hLangList, CB_GETCURSEL, 0, 0);
452  if (iIndex == CB_ERR)
453  break;
454 
455  lcid = SendMessage(hLangList, CB_GETITEMDATA, iIndex, 0);
456  if (lcid == (LCID)CB_ERR)
457  break;
458 
459  pGlobalData->SystemLCID = lcid;
460 
461  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
462  }
463  break;
464 
466  if (HIWORD(wParam) == BN_CLICKED)
467  {
469  {
470  ResourceMessageBox(hwndDlg,
474  pGlobalData->bApplyToDefaultUser = TRUE;
475  }
476  else
477  {
478  pGlobalData->bApplyToDefaultUser = FALSE;
479  }
480 
481  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
482  }
483  break;
484  }
485  break;
486 
487  case WM_NOTIFY:
488  if (((LPNMHDR)lParam)->code == PSN_APPLY)
489  {
490  PropSheet_UnChanged(GetParent(hwndDlg), hwndDlg);
491 
492  SaveSystemSettings(pGlobalData);
493  SaveFontSubstitutionSettings(hwndDlg, pGlobalData);
494  SaveFontLinkingSettings(hwndDlg, pGlobalData);
495  }
496  else if (((LPNMHDR)lParam)->idFrom == IDC_CONV_TABLES &&
498  {
499  SetWindowLongPtr(hwndDlg,
502  return TRUE;
503  }
504  break;
505  }
506 
507  return FALSE;
508 }
struct _GLOBALDATA * PGLOBALDATA
#define TRUE
Definition: types.h:120
static VOID SaveFontSubstitutionSettings(HWND hwnd, PGLOBALDATA pGlobalData)
Definition: advanced.c:289
#define CB_GETITEMDATA
Definition: winuser.h:1911
#define IDC_CONV_TABLES
Definition: resource.h:69
DWORD LCID
Definition: nls.h:13
#define PSN_APPLY
Definition: prsht.h:117
static VOID InitLanguagesList(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: advanced.c:237
static VOID SaveFontLinkingSettings(HWND hwnd, PGLOBALDATA pGlobalData)
Definition: advanced.c:329
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1904
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define MB_ICONWARNING
Definition: winuser.h:780
#define IDC_APPLY_CUR_USER_DEF_PROFILE
Definition: resource.h:68
#define IDC_LANGUAGE_COMBO
Definition: resource.h:53
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define BM_GETCHECK
Definition: winuser.h:1879
static VOID InitCodePagesList(HWND hwndDlg)
Definition: advanced.c:114
#define CB_ERR
Definition: winuser.h:2389
#define IDS_APPLY_DEFAULT_TEXT
Definition: resource.h:94
LCID SystemLCID
Definition: intl.h:114
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
Definition: misc.c:283
#define IDS_APPLY_DEFAULT_TITLE
Definition: resource.h:93
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:340
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define BN_CLICKED
Definition: winuser.h:1886
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HWND hLangList
Definition: advanced.c:21
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
BOOL bApplyToDefaultUser
Definition: intl.h:116
HWND WINAPI GetParent(_In_ HWND)
static VOID SaveSystemSettings(PGLOBALDATA pGlobalData)
Definition: advanced.c:339
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define SendMessage
Definition: winuser.h:5709
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
LRESULT ListViewCustomDraw(LPARAM lParam)
Definition: advanced.c:394
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by Applet(), MainPageProc(), and SystemApplet().

◆ EnvironmentDlgProc()

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

Definition at line 685 of file environment.c.

689 {
690  switch (uMsg)
691  {
692  case WM_INITDIALOG:
693  OnInitEnvironmentDialog(hwndDlg);
694  break;
695 
696  case WM_COMMAND:
697  switch (LOWORD(wParam))
698  {
701  return TRUE;
702 
705  return TRUE;
706 
709  return TRUE;
710 
713  return TRUE;
714 
717  return TRUE;
718 
721  return TRUE;
722 
723  case IDOK:
727  0, (LPARAM)_T("Environment"));
728  EndDialog(hwndDlg, 0);
729  return TRUE;
730 
731  case IDCANCEL:
732  EndDialog(hwndDlg, 0);
733  return TRUE;
734  }
735  break;
736 
737  case WM_DESTROY:
740  break;
741 
742  case WM_NOTIFY:
743  return OnNotify(hwndDlg, (NMHDR*)lParam);
744  }
745 
746  return FALSE;
747 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_USER_VARIABLE_LIST
Definition: resource.h:123
static VOID ReleaseListViewItems(HWND hwndDlg, INT iDlgItem)
Definition: environment.c:477
static BOOL OnNotify(HWND hwndDlg, NMHDR *phdr)
Definition: environment.c:655
#define IDC_SYSTEM_VARIABLE_NEW
Definition: resource.h:128
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static VOID OnNewVariable(HWND hwndDlg, INT iDlgItem)
Definition: environment.c:344
static VOID OnEditVariable(HWND hwndDlg, INT iDlgItem)
Definition: environment.c:391
#define WM_WININICHANGE
Definition: winuser.h:1612
LONG_PTR LPARAM
Definition: windef.h:208
static VOID OnInitEnvironmentDialog(HWND hwndDlg)
Definition: environment.c:299
#define IDC_USER_VARIABLE_EDIT
Definition: resource.h:125
#define WM_DESTROY
Definition: winuser.h:1591
#define _T(x)
Definition: vfdio.h:22
static VOID SetAllVars(HWND hwndDlg, INT iDlgItem)
Definition: environment.c:519
#define IDC_SYSTEM_VARIABLE_DELETE
Definition: resource.h:130
#define IDC_SYSTEM_VARIABLE_EDIT
Definition: resource.h:129
#define IDC_USER_VARIABLE_NEW
Definition: resource.h:124
#define WM_COMMAND
Definition: winuser.h:1716
#define IDC_USER_VARIABLE_DELETE
Definition: resource.h:126
#define SendMessage
Definition: winuser.h:5709
#define IDCANCEL
Definition: winuser.h:825
#define HWND_BROADCAST
Definition: winuser.h:1190
static VOID OnDeleteVariable(HWND hwndDlg, INT iDlgItem)
Definition: environment.c:427
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_SYSTEM_VARIABLE_LIST
Definition: resource.h:127
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by AdvancedPageProc().

◆ GeneralPageProc()

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

Definition at line 327 of file propsheet_general.c.

331 {
332  PPAGEDATA pPageData;
333 
334  /* Get the window context */
335  pPageData = (PPAGEDATA)GetWindowLongPtr(hwndDlg,
336  GWLP_USERDATA);
337  if (pPageData == NULL && uMsg != WM_INITDIALOG)
338  {
339  return FALSE;
340  }
341 
342  switch (uMsg)
343  {
344  case WM_INITDIALOG:
345  pPageData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PAGEDATA));
346  if (pPageData != NULL)
347  {
348  SetWindowLongPtr(hwndDlg,
350  (LONG_PTR)pPageData);
351 
352  pPageData->dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam);
353  if (pPageData->dlgInfo != NULL)
354  {
355  InitGeneralPage(pPageData->dlgInfo, hwndDlg);
356  SetButtonStates(pPageData->dlgInfo, hwndDlg);
357  }
358  }
359  break;
360 
361  case WM_DESTROY:
362  HeapFree(GetProcessHeap(), 0, pPageData);
363  break;
364 
365  case WM_COMMAND:
366  switch(LOWORD(wParam))
367  {
368  case IDC_START_TYPE:
369  if (HIWORD(wParam) == CBN_SELCHANGE)
370  {
371  pPageData->bStartTypeChanged = TRUE;
372  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
373  }
374  break;
375 
376  case IDC_DISP_NAME:
377  if (HIWORD(wParam) == EN_CHANGE)
378  {
379  pPageData->bDisplayNameChanged = TRUE;
380  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
381  }
382  break;
383 
384  case IDC_DESCRIPTION:
385  if (HIWORD(wParam) == EN_CHANGE)
386  {
387  pPageData->bDescriptionChanged = TRUE;
388  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
389  }
390  break;
391 
392  case IDC_EXEPATH:
393  if (HIWORD(wParam) == EN_CHANGE)
394  {
395  pPageData->bBinaryPathChanged = TRUE;
396  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
397  }
398  break;
399 
400  case IDC_START:
401  {
402  WCHAR szStartParams[256];
403  LPWSTR lpStartParams = NULL;
404 
405  if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) > 0)
406  lpStartParams = szStartParams;
407 
409 
410  RunActionWithProgress(hwndDlg,
411  pPageData->dlgInfo->pService->lpServiceName,
412  pPageData->dlgInfo->pService->lpDisplayName,
413  ACTION_START,
414  lpStartParams);
415 
416  UpdateServiceStatus(pPageData->dlgInfo->pService);
417  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
418  SetButtonStates(pPageData->dlgInfo, hwndDlg);
419  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
420  break;
421  }
422 
423  case IDC_STOP:
424  RunActionWithProgress(hwndDlg,
425  pPageData->dlgInfo->pService->lpServiceName,
426  pPageData->dlgInfo->pService->lpDisplayName,
427  ACTION_STOP,
428  NULL);
429 
430  UpdateServiceStatus(pPageData->dlgInfo->pService);
431  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
432  SetButtonStates(pPageData->dlgInfo, hwndDlg);
433  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
434  break;
435 
436  case IDC_PAUSE:
437  RunActionWithProgress(hwndDlg,
438  pPageData->dlgInfo->pService->lpServiceName,
439  pPageData->dlgInfo->pService->lpDisplayName,
440  ACTION_PAUSE,
441  NULL);
442 
443  UpdateServiceStatus(pPageData->dlgInfo->pService);
444  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
445  SetButtonStates(pPageData->dlgInfo, hwndDlg);
446  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
447  break;
448 
449  case IDC_RESUME:
450  RunActionWithProgress(hwndDlg,
451  pPageData->dlgInfo->pService->lpServiceName,
452  pPageData->dlgInfo->pService->lpDisplayName,
454  NULL);
455 
456  UpdateServiceStatus(pPageData->dlgInfo->pService);
457  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
458  SetButtonStates(pPageData->dlgInfo, hwndDlg);
459  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
460  break;
461 
462  case IDC_EDIT:
467  break;
468  }
469  break;
470 
471  case WM_NOTIFY:
472  switch (((LPNMHDR)lParam)->code)
473  {
474  case PSN_APPLY:
475  if (pPageData->bDisplayNameChanged ||
476  pPageData->bDescriptionChanged ||
477  pPageData->bBinaryPathChanged ||
478  pPageData->bStartTypeChanged)
479  {
480  SaveDlgInfo(pPageData, hwndDlg);
481  SetButtonStates(pPageData->dlgInfo, hwndDlg);
482  pPageData->bDisplayNameChanged = FALSE;
483  pPageData->bDescriptionChanged = FALSE;
484  pPageData->bBinaryPathChanged = FALSE;
485  pPageData->bStartTypeChanged = FALSE;
486  }
487  break;
488  }
489  break;
490  }
491 
492  return FALSE;
493 }
#define IDC_START_TYPE
Definition: resource.h:133
struct _PAGEDATA * PPAGEDATA
#define TRUE
Definition: types.h:120
#define ACTION_START
Definition: precomp.h:37
#define EM_SETREADONLY
Definition: winuser.h:1976
static VOID SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
#define ACTION_STOP
Definition: precomp.h:38
BOOL bDescriptionChanged
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:322
PSERVICEPROPSHEET dlgInfo
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
BOOL bDisplayNameChanged
#define IDC_PAUSE
Definition: resource.h:75
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_START
Definition: resource.h:137
#define LVSTATUS
Definition: precomp.h:29
#define IDC_STOP
Definition: resource.h:69
#define GWLP_USERDATA
Definition: treelist.c:63
BOOL bBinaryPathChanged
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define ACTION_RESUME
Definition: precomp.h:40
#define WM_DESTROY
Definition: winuser.h:1591
#define GetDlgItemText
Definition: winuser.h:5651
#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
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define IDC_DISP_NAME
Definition: resource.h:130
#define IDC_DESCRIPTION
Definition: resource.h:131
static VOID SetButtonStates(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
BOOL bStartTypeChanged
#define WM_COMMAND
Definition: winuser.h:1716
#define IDC_START_PARAM
Definition: resource.h:135
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ACTION_PAUSE
Definition: precomp.h:39
HWND WINAPI GetParent(_In_ HWND)
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:130
#define IDC_RESUME
Definition: resource.h:140
#define IDC_EDIT
Definition: resource.h:136
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_EXEPATH
Definition: resource.h:132
#define GetWindowLongPtr
Definition: treelist.c:73
WCHAR * LPWSTR
Definition: xmlstorage.h:184
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
#define WM_INITDIALOG
Definition: winuser.h:1715
static VOID InitGeneralPage(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
PMAIN_WND_INFO Info
Definition: precomp.h:129
#define HeapFree(x, y, z)
Definition: compat.h:394
VOID SaveDlgInfo(PPAGEDATA pPageData, HWND hwndDlg)
#define WM_NOTIFY
Definition: richedit.h:61
#define EN_CHANGE
Definition: winuser.h:1983

◆ GetSystemName()

BOOL GetSystemName ( PWSTR  pBuf,
SIZE_T  cchBuf 
)

Definition at line 433 of file smbios.c.

434 {
435  static const VENDOR_LONG_NAME LongNames[] =
436  {
437  { L"ASUSTeK", L"ASUS" },
438  { L"First International Computer", L"FIC" },
439  { L"Hewlett-Packard", L"HP" },
440  { L"MICRO-STAR", L"MSI" },
441  { L"SGI.COM", L"SGI" },
442  { L"Silicon Graphics International", L"SGI" },
443  { L"Intel(R) Client Systems", L"Intel" },
444  { L"InformationComputerSystems", L"ICS" },
445  { L"CHUWI INNOVATION AND TECHNOLOGY", L"CHUWI" },
446  { L"http://www.abit.com.tw/", L"ABIT" },
447  { L"www.abit.com.tw", L"ABIT" },
448  { L"CASPER BILGISAYAR SISTEMLERI A.S", L"Casper" },
449  { L"Colorful Technology And Development", L"Colorful" },
450  { L"Colorful Yu Gong Technology And Development", L"Colorful Yu Gong" },
451  { L"HaierComputer", L"Haier" },
452  { L"HELIOS BUSINESS COMPUTER", L"HELIOS" },
453  { L"Shanghai Zongzhi InfoTech", L"Zongzhi" },
454  { L"TSING HUA TONGFANG CO.,LTD", L"TSINGHUA TONGFANG" },
455  { L"Yeston Digital Technology Co.,LTD", L"Yeston" },
456  };
457  static const REDUNDANT_WORD RedundantWords[] =
458  {
459  { L"Corporation", FALSE },
460  { L"Communication", FALSE },
461  { L"Computer", FALSE },
462  { L"Computers", FALSE },
463  { L"Group", FALSE },
464  { L"Cloud", FALSE },
465  { L"Center", FALSE },
466  { L"Systems", FALSE },
467  { L"Microsystems", FALSE },
468  { L"Infosystems", FALSE },
469  { L"Electronics", FALSE },
470  { L"Electric", FALSE },
471  { L"Software", FALSE },
472  { L"Foundation", FALSE },
473  { L"International", FALSE },
474  { L"Interantonal", FALSE }, // on purpose (some MSI boards)
475  { L"INTERANTIONAL", FALSE }, // on purpose (some MSI boards)
476  { L"Industrial", FALSE },
477  { L"Information", FALSE },
478  { L"Informatica", FALSE },
479  { L"Technology", FALSE },
480  { L"Tecohnology", FALSE }, // on purpose (some Gigabyte boards)
481  { L"Technologies", FALSE },
482  { L"Tecnologia", FALSE },
483  { L"Limited", FALSE },
484  { L"Int", FALSE },
485  { L"Inc", FALSE },
486  { L"Co", FALSE },
487  { L"Corp", FALSE },
488  { L"Crop", FALSE },
489  { L"Ltd", FALSE },
490  { L"LTDA", FALSE },
491  { L"GmbH", FALSE },
492  { L"S.p.A", FALSE },
493  { L"A.S.", FALSE },
494  { L"S.A", FALSE },
495  { L"S.A.S", FALSE },
496  { L"S/A", FALSE },
497  { L"SA", FALSE },
498  { L"SAS", FALSE },
499  { L"BV", FALSE },
500  { L"AG", FALSE },
501  { L"OOO", TRUE },
502  { L"CJSC", FALSE },
503  { L"INT'L", FALSE },
504  { L"plc", FALSE },
505  };
506  PVOID SMBiosBuf;
507  PCHAR DmiStrings[ID_STRINGS_MAX] = { 0 };
508  WCHAR ven[512], dev[512];
509  CHAR tmpstr[512];
510  BOOL bTrimProduct, bTrimFamily, bGenericName, bRemove;
511  UINT i;
512  PWCHAR j;
513 
514  SMBiosBuf = LoadSMBiosData(DmiStrings);
515  if (!SMBiosBuf)
516  {
517  return FALSE;
518  }
519 
520  TrimNonPrintable(DmiStrings[SYS_VENDOR]);
521  bTrimProduct = TrimNonPrintable(DmiStrings[SYS_PRODUCT]);
522  TrimNonPrintable(DmiStrings[SYS_VERSION]);
523  bTrimFamily = TrimNonPrintable(DmiStrings[SYS_FAMILY]);
524  TrimNonPrintable(DmiStrings[BOARD_VENDOR]);
525  TrimNonPrintable(DmiStrings[BOARD_NAME]);
526  TrimNonPrintable(DmiStrings[BOARD_VERSION]);
527 
528  if (bTrimProduct)
529  {
530  if (DmiStrings[SYS_FAMILY] && !bTrimFamily)
531  {
532  DmiStrings[SYS_PRODUCT] = DmiStrings[SYS_FAMILY];
533  bTrimProduct = FALSE;
534  }
535  }
536 
537  GetSMBiosStringW(DmiStrings[SYS_VENDOR], ven, _countof(ven), TRUE);
538  GetSMBiosStringW(DmiStrings[SYS_PRODUCT], dev, _countof(dev), TRUE);
539  bGenericName = IsGenericSystemName(ven, dev, NULL) || bTrimProduct;
540 
541  if (wcslen(dev) == 0 ||
542  !wcscmp(dev, ven) ||
543  bGenericName)
544  {
545  BOOL bGenericVen = FALSE, bGenericDev = (wcslen(dev) == 0 || !wcscmp(dev, ven) || bTrimProduct);
546 
547  if (bGenericName && IsGenericSystemName(ven, NULL, &bRemove))
548  {
549  if (bRemove)
550  {
551  *ven = 0;
552  }
553  bGenericVen = TRUE;
554  }
555  if (bGenericName && IsGenericSystemName(NULL, dev, &bRemove))
556  {
557  if (bRemove)
558  {
559  *dev = 0;
560  }
561  bGenericDev = TRUE;
562  }
563  // system strings are unusable, use board strings
564  if (DmiStrings[BOARD_VENDOR] != NULL || !bGenericName)
565  {
566  if ((DmiStrings[BOARD_VENDOR] &&
567  strlen(DmiStrings[BOARD_VENDOR]) >= 2 &&
568  strstr(DmiStrings[BOARD_VENDOR], " ") != DmiStrings[BOARD_VENDOR]) ||
569  bGenericVen)
570  {
571  GetSMBiosStringW(DmiStrings[BOARD_VENDOR], ven, _countof(ven), TRUE);
572  }
573  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
574 
575  if (IsGenericSystemName(ven, NULL, &bRemove) && bRemove)
576  {
577  *ven = 0;
578  }
579  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
580  {
581  *dev = 0;
582 
583  if (!bGenericDev)
584  {
585  GetSMBiosStringW(DmiStrings[SYS_PRODUCT], dev, _countof(dev), TRUE);
586  }
587  }
588  if (wcslen(dev) == 0 &&
589  DmiStrings[SYS_VERSION] != NULL)
590  {
591  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
592 
593  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
594  {
595  *dev = 0;
596  }
597  }
598  if (wcslen(dev) == 0 &&
599  DmiStrings[BOARD_VERSION] != NULL)
600  {
602 
603  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
604  {
605  *dev = 0;
606  }
607  }
608  }
609 
610  if (wcslen(ven) == 0 && wcslen(dev) == 0)
611  {
612  // board strings are empty, use BIOS vendor string
613  GetSMBiosStringW(DmiStrings[BIOS_VENDOR], ven, _countof(ven), TRUE);
614  }
615  }
616  else
617  {
618  if (wcslen(ven) < 2)
619  {
620  GetSMBiosStringW(DmiStrings[BOARD_VENDOR], ven, _countof(ven), TRUE);
621 
622  if (IsGenericSystemName(ven, NULL, &bRemove) && bRemove)
623  {
624  *ven = 0;
625  }
626  }
627  }
628 
629  // workaround for LORD ELECTRONICS
630  if (((j = wcsstr(ven, L" ")) != NULL) && (j - ven > 2))
631  {
632  i = j - ven;
633  if (!wcsncmp(ven + wcslen(ven) - i, ven, i))
634  {
635  ven[wcslen(ven) - i] = L'\0';
636  }
637  }
638 
639  // make vendor strings shorter
640  for (i = 0; i < _countof(LongNames); i++)
641  {
642  if (wcsstr(dev, LongNames[i].pwLongName) == dev)
643  {
644  // swap ven and dev
645  StringCchCopyW(pBuf, cchBuf, ven);
646  StringCchCopyW(ven, _countof(ven), dev);
647  StringCchCopyW(dev, _countof(dev), pBuf);
648  }
649  wcsrep(ven, LongNames[i].pwLongName, LongNames[i].pwShortName, TRUE);
650  }
651 
652  // remove redundant words
653  for (i = 0; i < _countof(RedundantWords); i++)
654  {
655  wcsrep(ven, RedundantWords[i].pwStr, L"", RedundantWords[i].bReplaceFirstWord);
656  }
657  for (i = 0; i < _countof(RedundantWords); i++)
658  {
659  StringCchCopyW(pBuf, cchBuf, RedundantWords[i].pwStr);
660  StringCchCatW(pBuf, cchBuf, L".");
661  wcsrep(ven, pBuf, L"", RedundantWords[i].bReplaceFirstWord);
662  }
663 
664  // workaround for LENOVO notebooks
665  if (!wcsicmp(ven, L"LENOVO"))
666  {
667  StringCchCopyW(ven, _countof(ven), L"Lenovo");
668 
669  if (DmiStrings[SYS_VERSION] != NULL)
670  {
671  if (!strncmp(DmiStrings[SYS_VERSION], "ThinkPad ", 11))
672  {
673  DmiStrings[SYS_VERSION][8] = L'\0';
674  }
675  if (wcslen(dev) > 0 &&
676  (!strcmp(DmiStrings[SYS_VERSION], "IdeaCentre") ||
677  !strcmp(DmiStrings[SYS_VERSION], "ThinkPad")))
678  {
679  DmiStrings[SYS_FAMILY] = DmiStrings[SYS_VERSION];
680  DmiStrings[SYS_VERSION] = NULL;
681  }
682  else
683  {
684  StringCchCopyA(tmpstr, _countof(tmpstr), DmiStrings[SYS_VERSION]);
685  _strupr(tmpstr);
686  }
687  }
688 
689  if (DmiStrings[SYS_VERSION] != NULL &&
690  strcmp(tmpstr, " ") &&
691  strcmp(tmpstr, "LENOVO") &&
692  strstr(tmpstr, "LENOVO ") == NULL &&
693  strstr(tmpstr, "LENOVO PRODUCT") == NULL &&
694  strstr(tmpstr, "INVALID") == NULL &&
695  strncmp(tmpstr, " ", 3) &&
696  strstr(DmiStrings[SYS_VERSION], "Rev ") == NULL &&
697  strstr(DmiStrings[SYS_VERSION], "1.") == NULL &&
698  wcsistr(dev, L"System ") == NULL && // includes System x and ThinkSystem
699  wcsistr(dev, L"IdeaPad ") == NULL &&
700  wcsistr(dev, L"ThinkServer ") == NULL)
701  {
702  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
703  }
704 
705  if (wcsstr(dev, L"Lenovo-") == dev)
706  {
707  // replace "-" with space
708  dev[6] = L' ';
709  }
710 
711  if (!wcscmp(dev, L"Lenovo"))
712  {
713  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
714  }
715  }
716  if (!wcscmp(ven, L"IBM") &&
717  DmiStrings[SYS_VERSION] != NULL &&
718  (strstr(DmiStrings[SYS_VERSION], "ThinkPad ") != NULL ||
719  strstr(DmiStrings[SYS_VERSION], "ThinkCentre ") != NULL))
720  {
721  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
722  }
723 
724  // workaround for DEXP
725  if (!wcscmp(ven, L"DEXP"))
726  {
727  if (DmiStrings[SYS_PRODUCT] != NULL &&
728  DmiStrings[SYS_VERSION] != NULL &&
729  (!stricmp(DmiStrings[SYS_PRODUCT], "Tablet PC") ||
730  !stricmp(DmiStrings[SYS_PRODUCT], "Notebook") ||
731  !stricmp(DmiStrings[SYS_PRODUCT], "Decktop")))
732  {
733  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
734  }
735  }
736 
737  // workaround for Razer Blade
738  if (!wcscmp(ven, L"Razer") && !wcscmp(dev, L"Blade"))
739  {
740  if (DmiStrings[SYS_VERSION] != NULL)
741  {
742  StringCchCopyW(ven, _countof(ven), L"Razer Blade");
743  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
744  }
745  }
746 
747  // workaround for MSI motherboards
748  if (!wcscmp(ven, L"MSI") &&
749  wcsstr(dev, L"MS-") != NULL &&
750  DmiStrings[BOARD_NAME] != NULL &&
751  strstr(DmiStrings[BOARD_NAME], "(MS-") != NULL)
752  {
753  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
754  }
755  if (wcslen(ven) == 0 &&
756  wcsstr(dev, L"MS-") == dev)
757  {
758  StringCchCopyW(ven, _countof(ven), L"MSI");
759  }
760 
761  // trim redundant characters
762  TrimPunctuation(ven);
764 
765  if (wcsistr(dev, ven) == dev ||
766  (!wcscmp(ven, L"ASUS") && wcsstr(dev, L"ASUS") != NULL) ||
767  (!wcscmp(ven, L"HP") && wcsstr(dev, L" by HP") != NULL) ||
768  (!wcscmp(ven, L"INTEL") && wcsstr(dev, L" INTEL") != NULL))
769  {
770  // device string contains vendor string, use second only
771  StringCchCopyW(pBuf, cchBuf, dev);
772  }
773  else
774  {
775  if (wcslen(ven) > 0 && wcslen(dev) > 0 && (j = wcschr(dev, L' ')))
776  {
777  // check if vendor string ends with first word of device string
778  i = j - dev;
779  if (wcslen(ven) > i && !_wcsnicmp(ven + wcslen(ven) - i, dev, i))
780  {
781  ven[wcslen(ven) - i] = L'\0';
782  TrimPunctuation(ven);
783  }
784  }
785  StringCchCopyW(pBuf, cchBuf, ven);
786  AppendSystemFamily(pBuf, cchBuf, DmiStrings, dev);
787  if (wcslen(pBuf) > 0 && wcslen(dev) > 0)
788  {
789  StringCchCatW(pBuf, cchBuf, L" ");
790  }
791  StringCchCatW(pBuf, cchBuf, dev);
792  }
793 
794  FreeSMBiosData(SMBiosBuf);
795 
796  return (wcslen(pBuf) > 0);
797 }
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define _countof(array)
Definition: fontsub.cpp:30
char CHAR
Definition: xmlstorage.h:175
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
static VOID TrimPunctuation(_Inout_ PWSTR pStr)
Definition: smbios.c:47
uint16_t * PWCHAR
Definition: typedefs.h:54
SIZE_T GetSMBiosStringW(_In_ PCSTR DmiString, _Out_ PWSTR pBuf, _In_ DWORD cchBuf, _In_ BOOL bTrim)
Definition: udmihelp.c:145
static int dev
Definition: mkdosfs.c:536
static void AppendSystemFamily(PWSTR pBuf, SIZE_T cchBuf, PCHAR *DmiStrings, PWSTR dev)
Definition: smbios.c:373
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
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
unsigned int BOOL
Definition: ntddk_ex.h:94
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
static VOID wcsrep(_Inout_ PWSTR pwStr, _In_ PCWSTR pwFind, _In_ PCWSTR pwReplace, _In_ BOOL bReplaceFirstWord)
Definition: smbios.c:158
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl stricmp(_In_z_ const char *_Str1, _In_z_ const char *_Str2)
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 GLint GLint j
Definition: glfuncs.h:250
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
static BOOL TrimNonPrintable(PCHAR DmiString)
Definition: smbios.c:411
static const WCHAR L[]
Definition: oid.c:1250
static wchar_t * wcsistr(const wchar_t *s, const wchar_t *b)
Definition: smbios.c:84
#define wcsicmp
Definition: string.h:1152
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
VOID FreeSMBiosData(_In_ PVOID Buffer)
Definition: udmihelp.c:177
unsigned int UINT
Definition: ndis.h:50
static BOOL IsGenericSystemName(PCWSTR ven, PCWSTR dev, BOOL *bRemove)
Definition: smbios.c:236
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
PVOID LoadSMBiosData(_Inout_updates_(ID_STRINGS_MAX) PCHAR *Strings)
Definition: udmihelp.c:30
PWSTR LongNames[LONG_NAMES_COUNT]
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by GetSystemInformation().

◆ HardProfDlgProc()

INT_PTR CALLBACK HardProfDlgProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 735 of file hardprof.c.

739 {
740  PPROFILEDATA pProfileData;
741 
744  UNREFERENCED_PARAMETER(hwndDlg);
745 
746  pProfileData = (PPROFILEDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
747 
748  switch (uMsg)
749  {
750  case WM_INITDIALOG:
751  return OnInitHardProfDialog(hwndDlg);
752 
753  case WM_DESTROY:
754  if (pProfileData != NULL)
755  {
756  if (pProfileData->pProfiles != NULL)
757  HeapFree(GetProcessHeap(), 0, pProfileData->pProfiles);
758  HeapFree(GetProcessHeap(), 0, pProfileData);
759  }
760  break;
761 
762  case WM_COMMAND:
763  switch (LOWORD(wParam))
764  {
765  case IDC_HRDPROFPROP:
766  HardwareProfileProperties(hwndDlg, pProfileData);
767  break;
768 
769  case IDC_HRDPROFCOPY:
770  CopyHardwareProfile(hwndDlg, pProfileData);
771  break;
772 
773  case IDC_HRDPROFRENAME:
774  RenameHardwareProfile(hwndDlg, pProfileData);
775  break;
776 
777  case IDC_HRDPROFDEL:
778  DeleteHardwareProfile(hwndDlg, pProfileData);
779  break;
780 
781  case IDC_HRDPROFUP:
782  MoveHardwareProfile(hwndDlg, pProfileData, TRUE);
783  break;
784 
785  case IDC_HRDPROFDWN:
786  MoveHardwareProfile(hwndDlg, pProfileData, FALSE);
787  break;
788 
789  case IDC_HRDPROFWAIT:
791  return TRUE;
792 
793  case IDC_HRDPROFSELECT:
795  return TRUE;
796 
797  case IDC_HRDPROFLSTBOX:
798  if (HIWORD(wParam) == LBN_SELCHANGE)
799  {
801  UpdateButtons(hwndDlg, pProfileData);
802  }
803  return TRUE;
804 
805  case IDOK:
806  OnOk(hwndDlg);
807 
808  case IDCANCEL:
809  EndDialog(hwndDlg, LOWORD(wParam));
810  return TRUE;
811  }
812  break;
813  }
814 
815  return FALSE;
816 }
static BOOL OnInitHardProfDialog(HWND hwndDlg)
Definition: hardprof.c:678
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
DWORD dwSelectedProfileIndex
Definition: hardprof.c:29
#define IDC_HRDPROFLSTBOX
Definition: resource.h:173
#define IDC_HRDPROFCOPY
Definition: resource.h:177
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define SendDlgItemMessage
Definition: winuser.h:5708
#define LBN_SELCHANGE
Definition: winuser.h:2036
#define DWORD
Definition: nt_native.h:44
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static VOID OnOk(HWND hwndDlg)
Definition: hardprof.c:715
#define IDC_HRDPROFDEL
Definition: resource.h:179
static VOID RenameHardwareProfile(HWND hwndDlg, PPROFILEDATA pProfileData)
Definition: hardprof.c:263
#define IDC_HRDPROFUP
Definition: resource.h:174
smooth NULL
Definition: ftsmooth.c:416
#define IDC_HRDPROFDWN
Definition: resource.h:175
#define WM_DESTROY
Definition: winuser.h:1591
struct _PROFILEDATA * PPROFILEDATA
#define IDC_HRDPROFSELECT
Definition: resource.h:181
#define GetProcessHeap()
Definition: compat.h:395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define DWLP_USER
Definition: winuser.h:866
#define IDC_HRDPROFWAIT
Definition: resource.h:180
#define WM_COMMAND
Definition: winuser.h:1716
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
static VOID DeleteHardwareProfile(HWND hwndDlg, PPROFILEDATA pProfileData)
Definition: hardprof.c:302
PPROFILE pProfiles
Definition: hardprof.c:30
#define IDC_HRDPROFPROP
Definition: resource.h:176
static VOID CopyHardwareProfile(HWND hwndDlg, PPROFILEDATA pProfileData)
Definition: hardprof.c:146
static VOID HardwareProfileProperties(HWND hwndDlg, PPROFILEDATA pProfileData)
Definition: hardprof.c:429
#define LB_GETCURSEL
Definition: winuser.h:2000
#define IDC_HRDPROFRENAME
Definition: resource.h:178
#define IDC_HRDPROFEDIT
Definition: resource.h:182
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
static VOID UpdateButtons(HWND hwndDlg, PPROFILEDATA pProfileData)
Definition: hardprof.c:43
static VOID MoveHardwareProfile(HWND hwndDlg, PPROFILEDATA pProfileData, BOOL bMoveUp)
Definition: hardprof.c:358
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by HardwarePageProc().

◆ HardwarePageProc()

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

Definition at line 68 of file hardware.c.

72 {
74 
75  switch (uMsg)
76  {
77  case WM_INITDIALOG:
78  break;
79 
80  case WM_COMMAND:
81  switch (LOWORD(wParam))
82  {
84  if (!LaunchDeviceManager(hwndDlg))
85  {
86  /* FIXME */
87  }
88  return TRUE;
89 
91  LaunchHardwareWizard(hwndDlg);
92  return TRUE;
93 
97  hwndDlg,
99  return TRUE;
100  }
101  break;
102  }
103 
104  return FALSE;
105 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
static VOID LaunchHardwareWizard(HWND hWndParent)
Definition: hardware.c:45
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
HINSTANCE hApplet
Definition: access.c:17
WPARAM wParam
Definition: combotst.c:138
#define DialogBox
Definition: winuser.h:5627
#define IDC_HARDWARE_DEVICE_MANAGER
Definition: resource.h:84
#define IDC_HARDWARE_WIZARD
Definition: resource.h:81
#define WM_COMMAND
Definition: winuser.h:1716
INT_PTR CALLBACK HardProfDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hardprof.c:735
#define IDC_HARDWARE_PROFILE
Definition: resource.h:82
#define IDD_HARDWAREPROFILES
Definition: resource.h:172
static BOOL LaunchDeviceManager(HWND hWndParent)
Definition: hardware.c:16
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by SystemApplet().

◆ LicenceDlgProc()

INT_PTR CALLBACK LicenceDlgProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 63 of file licence.c.

67 {
68  PLIC_CONTEXT pLicInfo;
69 
71 
72  pLicInfo = (PLIC_CONTEXT)GetWindowLongPtr(hDlg, DWLP_USER);
73 
74  switch (uMsg)
75  {
76  case WM_INITDIALOG:
77  pLicInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LIC_CONTEXT));
78  if (pLicInfo == NULL)
79  {
80  EndDialog(hDlg, 0);
81  return FALSE;
82  }
83  SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pLicInfo);
84  return OnInitDialog(hDlg, pLicInfo);
85 
86  case WM_DESTROY:
87  if (pLicInfo)
88  {
89  DestroyIcon(pLicInfo->hIcon);
90  HeapFree(GetProcessHeap(), 0, pLicInfo);
91  }
92  break;
93 
94  case WM_COMMAND:
95  if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
96  {
97  EndDialog(hDlg,
98  LOWORD(wParam));
99  return TRUE;
100  }
101  break;
102  }
103 
104  return FALSE;
105 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static BOOL OnInitDialog(HWND hDlg, PLIC_CONTEXT pLicInfo)
Definition: licence.c:19
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
struct _LIC_CONTEXT * PLIC_CONTEXT
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
HICON hIcon
Definition: licence.c:14

Referenced by GeneralPageProc().

◆ ResourceMessageBox()

INT ResourceMessageBox ( IN HINSTANCE  hInstance,
IN HWND  hwnd,
IN UINT  uType,
IN UINT  uCaption,
IN UINT  uText 
)

Definition at line 29 of file sysdm.c.

35 {
36  WCHAR szCaption[256];
37  WCHAR szText[256];
38 
39  LoadStringW(hInstance, uCaption, szCaption, 256);
40  LoadStringW(hInstance, uText, szText, 256);
41 
42  return MessageBoxW(hwnd,
43  szText,
44  szCaption,
45  uType);
46 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE hInstance
Definition: charmap.c:20
static const WCHAR szText[]
Definition: dialog.c:139
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ShowLastWin32Error()

void ShowLastWin32Error ( HWND  hWndOwner)

Definition at line 11 of file winutils.c.

12 {
13  DWORD dwError;
14  LPWSTR lpMsgBuf = NULL;
15 
16  dwError = GetLastError();
17  if (dwError == ERROR_SUCCESS)
18  return;
19 
23  NULL,
24  dwError,
26  (LPWSTR)&lpMsgBuf,
27  0, NULL))
28  {
29  return;
30  }
31 
33  LocalFree(lpMsgBuf);
34 }
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MB_ICONERROR
Definition: winuser.h:781
#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
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by DeleteClipboardContent(), LoadClipboardDataFromFile(), LoadRecoveryOptions(), OnInitDialog(), ReadClipboardFile(), ReadPageFileSettings(), SaveClipboardToFile(), WriteClipboardFile(), WritePageFileSettings(), WriteStartupRecoveryOptions(), and wWinMain().

◆ StartRecDlgProc()

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

Definition at line 688 of file startrec.c.

692 {
693  PSTARTINFO pStartInfo;
694  PBOOTRECORD pRecord;
695  int iTimeout;
696  LRESULT lResult;
697  WCHAR szTimeout[10];
698 
700 
701  pStartInfo = (PSTARTINFO)GetWindowLongPtr(hwndDlg, DWLP_USER);
702 
703  switch(uMsg)
704  {
705  case WM_INITDIALOG:
706  pStartInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(STARTINFO));
707  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pStartInfo);
708 
709  LoadRecoveryOptions(hwndDlg, pStartInfo);
710  SetRecoveryTimeout(hwndDlg, 0);
711  return LoadOSList(hwndDlg, pStartInfo);
712 
713  case WM_DESTROY:
714  DeleteBootRecords(hwndDlg);
715  HeapFree(GetProcessHeap(), 0, pStartInfo);
716  break;
717 
718  case WM_COMMAND:
719  switch(LOWORD(wParam))
720  {
721  case IDC_STRRECEDIT:
722  ShellExecuteW(0, L"open", L"notepad", pStartInfo->szFreeldrIni, NULL, SW_SHOWNORMAL);
723  // FIXME: Use CreateProcess and wait untill finished
724  // DeleteBootRecords(hwndDlg);
725  // LoadOSList(hwndDlg);
726  break;
727 
728  case IDOK:
729  /* Save timeout */
731  iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_GETPOS, (WPARAM)0, (LPARAM)0);
732  else
733  iTimeout = 0;
734  swprintf(szTimeout, L"%i", iTimeout);
735 
736  lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
737  if (lResult == CB_ERR)
738  {
739  /* ? */
740  DeleteBootRecords(hwndDlg);
741  return TRUE;
742  }
743 
744  pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0);
745 
746  if ((INT_PTR)pRecord != CB_ERR)
747  {
748  if (pStartInfo->iFreeLdrIni == 1) // FreeLdrIni style
749  {
750  /* Set default timeout */
751  WritePrivateProfileStringW(L"FREELOADER",
752  L"TimeOut",
753  szTimeout,
754  pStartInfo->szFreeldrIni);
755  /* Set default OS */
756  WritePrivateProfileStringW(L"FREELOADER",
757  L"DefaultOS",
758  pRecord->szSectionName,
759  pStartInfo->szFreeldrIni);
760 
761  }
762  else if (pStartInfo->iFreeLdrIni == 2) // BootIni style
763  {
764  /* Set default timeout */
765  WritePrivateProfileStringW(L"boot loader",
766  L"timeout",
767  szTimeout,
768  pStartInfo->szFreeldrIni);
769  /* Set default OS */
770  WritePrivateProfileStringW(L"boot loader",
771  L"default",
772  pRecord->szBootPath,
773  pStartInfo->szFreeldrIni);
774 
775  }
776  }
777 
779  {
780  WriteStartupRecoveryOptions(hwndDlg, pStartInfo);
781  }
782 
783  EndDialog(hwndDlg,
784  LOWORD(wParam));
785  return TRUE;
786 
787  case IDCANCEL:
788  EndDialog(hwndDlg,
789  LOWORD(wParam));
790  return TRUE;
791 
792  case IDC_STRECLIST:
794  SetTimeout(hwndDlg, 30);
795  else
796  SetTimeout(hwndDlg, 0);
797  break;
798 
799  case IDC_STRRECREC:
801  SetRecoveryTimeout(hwndDlg, 30);
802  else
803  SetRecoveryTimeout(hwndDlg, 0);
804  break;
805 
807  if (HIWORD(wParam) == CBN_SELCHANGE)
808  {
809  LRESULT lResult;
810 
812  if (lResult != CB_ERR && lResult != (LRESULT)pStartInfo->dwCrashDumpEnabled)
813  {
814  if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
815  {
816  SendDlgItemMessageW(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
817  }
818  else if (pStartInfo->dwCrashDumpEnabled == 3)
819  {
820  SendDlgItemMessageW(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szMinidumpDir) / sizeof(WCHAR), (LPARAM)pStartInfo->szMinidumpDir);
821  }
822 
823  pStartInfo->dwCrashDumpEnabled = (DWORD)lResult;
824  SetCrashDlgItems(hwndDlg, pStartInfo);
825  }
826  }
827  break;
828  }
829  break;
830  }
831 
832  return FALSE;
833 }
WCHAR szBootPath[MAX_PATH]
Definition: precomp.h:82
#define TRUE
Definition: types.h:120
#define UDM_GETPOS
Definition: commctrl.h:2116
#define IDOK
Definition: winuser.h:824
WCHAR szDumpFile[MAX_PATH]
Definition: startrec.c:19
#define IDC_STRRECLISTUPDWN
Definition: resource.h:159
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CB_GETITEMDATA
Definition: winuser.h:1911
#define WM_GETTEXT
Definition: winuser.h:1600
#define IDC_STRRECDEBUGCOMBO
Definition: resource.h:167
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
int32_t INT_PTR
Definition: typedefs.h:62
#define DWORD
Definition: nt_native.h:44
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1904
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDC_STRRECEDIT
Definition: resource.h:163
static VOID DeleteBootRecords(HWND hwndDlg)
Definition: startrec.c:431
smooth NULL
Definition: ftsmooth.c:416
struct _BOOTRECORD * PBOOTRECORD
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1879
#define CB_ERR
Definition: winuser.h:2389
#define WM_DESTROY
Definition: winuser.h:1591
INT iFreeLdrIni
Definition: startrec.c:22
#define IDC_STRRECDUMPFILE
Definition: resource.h:168
#define IDC_STRRECREC
Definition: resource.h:160
DWORD dwCrashDumpEnabled
Definition: startrec.c:21
#define IDC_STRECLIST
Definition: resource.h:157
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static VOID SetRecoveryTimeout(HWND hwndDlg, INT Timeout)
Definition: startrec.c:45
static VOID WriteStartupRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
Definition: startrec.c:543
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
WCHAR szSectionName[128]
Definition: precomp.h:81
static VOID SetCrashDlgItems(HWND hwnd, PSTARTINFO pStartInfo)
Definition: startrec.c:517
static LRESULT LoadOSList(HWND hwndDlg, PSTARTINFO pStartInfo)
Definition: startrec.c:454
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static VOID SetTimeout(HWND hwndDlg, INT Timeout)
Definition: startrec.c:28
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
WCHAR szFreeldrIni[MAX_PATH+15]
Definition: startrec.c:18
#define SW_SHOWNORMAL
Definition: winuser.h:764
static VOID LoadRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
Definition: startrec.c:595
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define IDC_STRECOSCOMBO
Definition: resource.h:156
#define BST_CHECKED
Definition: winuser.h:197
BOOL SaveRecoveryOptions
Definition: startrec.c:25
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2236
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
WCHAR szMinidumpDir[MAX_PATH]
Definition: startrec.c:20
struct _STARTINFO * PSTARTINFO

Referenced by AdvancedPageProc().

◆ UserProfileDlgProc()

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

Definition at line 602 of file userprofile.c.

606 {
607  switch (uMsg)
608  {
609  case WM_INITDIALOG:
610  OnInitUserProfileDialog(hwndDlg);
611  return TRUE;
612 
613  case WM_DESTROY:
614  OnDestroy(hwndDlg);
615  break;
616 
617  case WM_COMMAND:
618  switch (LOWORD(wParam))
619  {
620  case IDOK:
621  case IDCANCEL:
622  EndDialog(hwndDlg,
623  LOWORD(wParam));
624  return TRUE;
625 
627  ChangeUserProfileType(hwndDlg);
628  break;
629 
631  DeleteUserProfile(hwndDlg);
632  break;
633 
635  CopyUserProfile(hwndDlg);
636  break;
637  }
638  break;
639 
640  case WM_NOTIFY:
641  OnNotify(hwndDlg, (NMHDR *)lParam);
642  break;
643  }
644 
645  return FALSE;
646 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
static VOID OnInitUserProfileDialog(HWND hwndDlg)
Definition: userprofile.c:549
#define IDC_USERPROFILE_CHANGE
Definition: resource.h:102
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static BOOL CopyUserProfile(_In_ HWND hwndDlg)
Definition: userprofile.c:233
#define IDC_USERPROFILE_DELETE
Definition: resource.h:103
static BOOL ChangeUserProfileType(_In_ HWND hwndDlg)
Definition: userprofile.c:105
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_COMMAND
Definition: winuser.h:1716
static VOID OnDestroy(_In_ HWND hwndDlg)
Definition: userprofile.c:560
#define IDC_USERPROFILE_COPY
Definition: resource.h:104
static VOID OnNotify(_In_ HWND hwndDlg, _In_ NMHDR *nmhdr)
Definition: userprofile.c:585
static BOOL DeleteUserProfile(_In_ HWND hwndDlg)
Definition: userprofile.c:148
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by AdvancedPageProc().

◆ VirtMemDlgProc()

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

Definition at line 664 of file virtmem.c.

668 {
669  PVIRTMEM pVirtMem;
670 
672 
673  pVirtMem = (PVIRTMEM)GetWindowLongPtr(hwndDlg, DWLP_USER);
674 
675  switch (uMsg)
676  {
677  case WM_INITDIALOG:
678  pVirtMem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VIRTMEM));
679  if (pVirtMem == NULL)
680  {
681  EndDialog(hwndDlg, 0);
682  return FALSE;
683  }
684 
685  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pVirtMem);
686 
687  OnInitVirtMemDialog(hwndDlg, pVirtMem);
688  break;
689 
690  case WM_DESTROY:
691  OnDestroy(pVirtMem);
692  break;
693 
694  case WM_COMMAND:
695  switch (LOWORD(wParam))
696  {
697  case IDCANCEL:
698  EndDialog(hwndDlg, 0);
699  return TRUE;
700 
701  case IDOK:
702  OnVirtMemDialogOk(pVirtMem);
703  EndDialog(hwndDlg, pVirtMem->bModified);
704  return TRUE;
705 
706  case IDC_NOPAGEFILE:
707  OnNoPagingFile(pVirtMem);
708  return TRUE;
709 
710  case IDC_SYSMANSIZE:
711  OnSysManSize(pVirtMem);
712  return TRUE;
713 
714  case IDC_CUSTOM:
715  OnCustom(pVirtMem);
716  return TRUE;
717 
718  case IDC_SET:
719  OnSet(pVirtMem);
720  return TRUE;
721 
722  case IDC_PAGEFILELIST:
723  switch (HIWORD(wParam))
724  {
725  case LBN_SELCHANGE:
726  OnSelChange(hwndDlg, pVirtMem);
727  return TRUE;
728  }
729  break;
730  }
731  break;
732  }
733 
734  return FALSE;
735 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_SYSMANSIZE
Definition: resource.h:146
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static VOID OnNoPagingFile(PVIRTMEM pVirtMem)
Definition: virtmem.c:268
#define IDC_CUSTOM
Definition: resource.h:143
#define IDC_PAGEFILELIST
Definition: resource.h:139
#define LBN_SELCHANGE
Definition: winuser.h:2036
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static VOID OnVirtMemDialogOk(PVIRTMEM pVirtMem)
Definition: virtmem.c:600
smooth NULL
Definition: ftsmooth.c:416
#define IDC_NOPAGEFILE
Definition: resource.h:147
static VOID OnSysManSize(PVIRTMEM pVirtMem)
Definition: virtmem.c:277
#define WM_DESTROY
Definition: winuser.h:1591
struct _VIRTMEM * PVIRTMEM
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL bModified
Definition: precomp.h:74
static BOOL OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
Definition: virtmem.c:500
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
static VOID OnInitVirtMemDialog(HWND hwnd, PVIRTMEM pVirtMem)
Definition: virtmem.c:616
static VOID OnCustom(PVIRTMEM pVirtMem)
Definition: virtmem.c:286
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_SET
Definition: resource.h:148
static VOID OnSet(PVIRTMEM pVirtMem)
Definition: virtmem.c:391
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static VOID OnDestroy(PVIRTMEM pVirtMem)
Definition: virtmem.c:646

Referenced by AdvancedPageProc().

Variable Documentation

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.