ReactOS  0.4.15-dev-506-ga3ec01c
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 <setupapi.h>
#include <cpl.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 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 25 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file precomp.h.

Typedef Documentation

◆ APPLET

◆ 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 422 of file advanced.c.

426 {
427  PGLOBALDATA pGlobalData;
428 
429  pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
430 
431  switch (uMsg)
432  {
433  case WM_INITDIALOG:
434  pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
435  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
436 
437  InitLanguagesList(hwndDlg, pGlobalData);
438  InitCodePagesList(hwndDlg);
439  break;
440 
441  case WM_COMMAND:
442  switch (LOWORD(wParam))
443  {
444  case IDC_LANGUAGE_COMBO:
445  if (HIWORD(wParam) == CBN_SELCHANGE)
446  {
447  LCID lcid;
448  INT iIndex;
449 
450  iIndex = SendMessage(hLangList, CB_GETCURSEL, 0, 0);
451  if (iIndex == CB_ERR)
452  break;
453 
454  lcid = SendMessage(hLangList, CB_GETITEMDATA, iIndex, 0);
455  if (lcid == (LCID)CB_ERR)
456  break;
457 
458  pGlobalData->SystemLCID = lcid;
459 
460  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
461  }
462  break;
463 
465  if (HIWORD(wParam) == BN_CLICKED)
466  {
468  {
469  ResourceMessageBox(hwndDlg,
473  pGlobalData->bApplyToDefaultUser = TRUE;
474  }
475  else
476  {
477  pGlobalData->bApplyToDefaultUser = FALSE;
478  }
479 
480  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
481  }
482  break;
483  }
484  break;
485 
486  case WM_NOTIFY:
487  if (((LPNMHDR)lParam)->code == PSN_APPLY)
488  {
489  PropSheet_UnChanged(GetParent(hwndDlg), hwndDlg);
490 
491  SaveSystemSettings(pGlobalData);
492  SaveFontSubstitutionSettings(hwndDlg, pGlobalData);
493  SaveFontLinkingSettings(hwndDlg, pGlobalData);
494  }
495  else if (((LPNMHDR)lParam)->idFrom == IDC_CONV_TABLES &&
497  {
498  SetWindowLongPtr(hwndDlg,
501  return TRUE;
502  }
503  break;
504  }
505 
506  return FALSE;
507 }
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:1932
#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:328
int32_t INT
Definition: typedefs.h:57
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1925
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:390
#define BM_GETCHECK
Definition: winuser.h:1900
static VOID InitCodePagesList(HWND hwndDlg)
Definition: advanced.c:114
#define CB_ERR
Definition: winuser.h:2410
#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:358
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define BN_CLICKED
Definition: winuser.h:1907
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:1722
BOOL bApplyToDefaultUser
Definition: intl.h:116
HWND WINAPI GetParent(_In_ HWND)
static VOID SaveSystemSettings(PGLOBALDATA pGlobalData)
Definition: advanced.c:338
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define SendMessage
Definition: winuser.h:5818
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
LRESULT ListViewCustomDraw(LPARAM lParam)
Definition: advanced.c:393
#define WM_INITDIALOG
Definition: winuser.h:1721
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:1722
#define IDC_USER_VARIABLE_DELETE
Definition: resource.h:126
#define SendMessage
Definition: winuser.h:5818
#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:1721
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:131
struct _PAGEDATA * PPAGEDATA
#define TRUE
Definition: types.h:120
#define ACTION_START
Definition: precomp.h:39
#define EM_SETREADONLY
Definition: winuser.h:1997
static VOID SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
#define ACTION_STOP
Definition: precomp.h:40
BOOL bDescriptionChanged
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:372
PSERVICEPROPSHEET dlgInfo
#define SendDlgItemMessage
Definition: winuser.h:5817
#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:135
#define LVSTATUS
Definition: precomp.h:31
#define IDC_STOP
Definition: resource.h:69
#define GWLP_USERDATA
Definition: treelist.c:63
BOOL bBinaryPathChanged
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define ACTION_RESUME
Definition: precomp.h:42
#define WM_DESTROY
Definition: winuser.h:1591
#define GetDlgItemText
Definition: winuser.h:5760
#define GetProcessHeap()
Definition: compat.h:404
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:344
#define IDC_DISP_NAME
Definition: resource.h:128
#define IDC_DESCRIPTION
Definition: resource.h:129
static VOID SetButtonStates(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
BOOL bStartTypeChanged
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_START_PARAM
Definition: resource.h:133
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ACTION_PAUSE
Definition: precomp.h:41
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:131
#define IDC_RESUME
Definition: resource.h:138
#define IDC_EDIT
Definition: resource.h:134
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_EXEPATH
Definition: resource.h:130
#define GetWindowLongPtr
Definition: treelist.c:73
WCHAR * LPWSTR
Definition: xmlstorage.h:184
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
#define WM_INITDIALOG
Definition: winuser.h:1721
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:130
#define HeapFree(x, y, z)
Definition: compat.h:403
VOID SaveDlgInfo(PPAGEDATA pPageData, HWND hwndDlg)
#define WM_NOTIFY
Definition: richedit.h:61
#define EN_CHANGE
Definition: winuser.h:2004

◆ GetSystemName()

BOOL GetSystemName ( PWSTR  pBuf,
SIZE_T  cchBuf 
)

Definition at line 491 of file smbios.c.

492 {
493  static const VENDOR_LONG_NAME LongNames[] =
494  {
495  { L"ASUSTeK", L"ASUS" },
496  { L"First International Computer", L"FIC" },
497  { L"Hewlett-Packard", L"HP" },
498  { L"MICRO-STAR", L"MSI" },
499  { L"SGI.COM", L"SGI" },
500  { L"Silicon Graphics International", L"SGI" },
501  { L"Intel(R) Client Systems", L"Intel" },
502  { L"InformationComputerSystems", L"ICS" },
503  { L"Bernecker + Rainer Industrie-Elektronik", L"Bernecker & Rainer" },
504  { L"CHUWI INNOVATION AND TECHNOLOGY", L"CHUWI" },
505  { L"CHUWI INNOVATION LIMITED", L"CHUWI" },
506  { L"CHUWI INNOVATION LIMITED", L"CHUWI" },
507  { L"http://www.abit.com.tw/", L"ABIT" },
508  { L"http:\\\\www.abit.com.tw", L"ABIT" },
509  { L"www.abit.com.tw", L"ABIT" },
510  { L"CASPER BILGISAYAR SISTEMLERI A.S", L"Casper" },
511  { L"Colorful Technology And Development", L"Colorful" },
512  { L"Colorful Yu Gong Technology And Development", L"Colorful Yu Gong" },
513  { L"HaierComputer", L"Haier" },
514  { L"Haier Information Technology (Shen Zhen)", L"Haier" },
515  { L"HASEECOMPUTERS", L"Hasee" },
516  { L"HELIOS BUSINESS COMPUTER", L"HELIOS" },
517  { L"Shanghai Zongzhi InfoTech", L"Zongzhi" },
518  { L"TSING HUA TONGFANG CO.,LTD", L"TSINGHUA TONGFANG" },
519  { L"Yeston Digital Technology Co.,LTD", L"Yeston" },
520  };
521  static const REDUNDANT_WORD RedundantWords[] =
522  {
523  { L"Corporation", FALSE },
524  { L"Communication", FALSE },
525  { L"Computer", FALSE },
526  { L"Computers", FALSE },
527  { L"Group", FALSE },
528  { L"Cloud", FALSE },
529  { L"Center", FALSE },
530  { L"Systems", FALSE },
531  { L"Microsystems", FALSE },
532  { L"Infosystems", FALSE },
533  { L"Digital", FALSE },
534  { L"Electronics", FALSE },
535  { L"Electric", FALSE },
536  { L"Elektronik", FALSE },
537  { L"Software", FALSE },
538  { L"Foundation", FALSE },
539  { L"International", FALSE },
540  { L"Interantonal", FALSE }, // on purpose (some MSI boards)
541  { L"INTERANTIONAL", FALSE }, // on purpose (some MSI boards)
542  { L"Industrial", FALSE },
543  { L"Industrie", FALSE },
544  { L"Information", FALSE },
545  { L"Informatica", FALSE },
546  { L"Produkte", FALSE },
547  { L"Technology", FALSE },
548  { L"Tecohnology", FALSE }, // on purpose (some Gigabyte boards)
549  { L"Technologies", FALSE },
550  { L"Tecnologia", FALSE },
551  { L"Limited", FALSE },
552  { L"Int", FALSE },
553  { L"Inc", FALSE },
554  { L"Co", FALSE },
555  { L"Corp", FALSE },
556  { L"Crop", FALSE },
557  { L"LLC", FALSE },
558  { L"Ltd", FALSE },
559  { L"LTDA", FALSE },
560  { L"GmbH", FALSE },
561  { L"S.p.A", FALSE },
562  { L"A.S.", FALSE },
563  { L"S.A", FALSE },
564  { L"S.A.S", FALSE },
565  { L"S/A", FALSE },
566  { L"SA", FALSE },
567  { L"SAS", FALSE },
568  { L"BV", FALSE },
569  { L"AG", FALSE },
570  { L"OOO", TRUE },
571  { L"CJSC", FALSE },
572  { L"INT'L", FALSE },
573  { L"INTL", FALSE },
574  { L"plc", FALSE },
575  };
576  PVOID SMBiosBuf;
577  PCHAR DmiStrings[ID_STRINGS_MAX] = { 0 };
578  WCHAR ven[512], dev[512];
579  CHAR tmpstr[512];
580  BOOL bTrimProduct, bTrimFamily, bGenericName, bRemove;
581  UINT i;
582  PWCHAR j;
583 
584  SMBiosBuf = LoadSMBiosData(DmiStrings);
585  if (!SMBiosBuf)
586  {
587  return FALSE;
588  }
589 
590  TrimNonPrintable(DmiStrings[SYS_VENDOR]);
591  bTrimProduct = TrimNonPrintableProd(DmiStrings[SYS_PRODUCT]);
592  TrimNonPrintable(DmiStrings[SYS_VERSION]);
593  bTrimFamily = TrimNonPrintable(DmiStrings[SYS_FAMILY]);
594  TrimNonPrintable(DmiStrings[BOARD_VENDOR]);
595  TrimNonPrintable(DmiStrings[BOARD_NAME]);
596  TrimNonPrintable(DmiStrings[BOARD_VERSION]);
597 
598  if (bTrimProduct)
599  {
600  if (DmiStrings[SYS_FAMILY] && !bTrimFamily)
601  {
602  DmiStrings[SYS_PRODUCT] = DmiStrings[SYS_FAMILY];
603  bTrimProduct = FALSE;
604  }
605  }
606 
607  GetSMBiosStringW(DmiStrings[SYS_VENDOR], ven, _countof(ven), TRUE);
608  GetSMBiosStringW(DmiStrings[SYS_PRODUCT], dev, _countof(dev), TRUE);
609  bGenericName = IsGenericSystemName(ven, dev, NULL) || bTrimProduct;
610 
611  if (wcslen(dev) == 0 ||
612  !wcscmp(dev, ven) ||
613  bGenericName)
614  {
615  BOOL bGenericVen = FALSE, bRemoveVen = FALSE, bGenericDev = (wcslen(dev) == 0 || !wcscmp(dev, ven) || bTrimProduct);
616 
617  if (bGenericName && IsGenericSystemName(ven, NULL, &bRemove))
618  {
619  if (bRemove)
620  {
621  *ven = 0;
622  }
623  bGenericVen = TRUE;
624  bRemoveVen = bRemove;
625  }
626  if (bGenericName && IsGenericSystemName(NULL, dev, &bRemove))
627  {
628  if (bRemove)
629  {
630  *dev = 0;
631  }
632  bGenericDev = TRUE;
633  }
634  // system strings are unusable, use board strings
635  if (DmiStrings[BOARD_VENDOR] != NULL || !bGenericName)
636  {
637  if ((DmiStrings[BOARD_VENDOR] &&
638  strlen(DmiStrings[BOARD_VENDOR]) >= 2 &&
639  strstr(DmiStrings[BOARD_VENDOR], " ") != DmiStrings[BOARD_VENDOR]) ||
640  bGenericVen)
641  {
642  GetSMBiosStringW(DmiStrings[BOARD_VENDOR], ven, _countof(ven), TRUE);
643  }
644  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
645 
646  if (IsGenericSystemName(ven, NULL, &bRemove) && bRemove)
647  {
648  *ven = 0;
649 
650  if (bGenericVen && !bRemoveVen)
651  {
652  GetSMBiosStringW(DmiStrings[SYS_VENDOR], ven, _countof(ven), TRUE);
653  }
654  }
655  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
656  {
657  *dev = 0;
658 
659  if (!bGenericDev)
660  {
661  GetSMBiosStringW(DmiStrings[SYS_PRODUCT], dev, _countof(dev), TRUE);
662  }
663  }
664  if (wcslen(dev) == 0 &&
665  DmiStrings[SYS_VERSION] != NULL)
666  {
667  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
668 
669  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
670  {
671  *dev = 0;
672  }
673  }
674  if (wcslen(dev) == 0 &&
675  DmiStrings[BOARD_VERSION] != NULL)
676  {
678 
679  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
680  {
681  *dev = 0;
682  }
683  }
684  }
685  else if (DmiStrings[BOARD_NAME] != NULL)
686  {
687  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
688 
689  if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove)
690  {
691  *dev = 0;
692  }
693  }
694 
695  if (wcslen(ven) == 0 && wcslen(dev) == 0)
696  {
697  // board strings are empty, use BIOS vendor string
698  GetSMBiosStringW(DmiStrings[BIOS_VENDOR], ven, _countof(ven), TRUE);
699  }
700  }
701  else
702  {
703  if (wcslen(ven) < 2)
704  {
705  GetSMBiosStringW(DmiStrings[BOARD_VENDOR], ven, _countof(ven), TRUE);
706 
707  if (IsGenericSystemName(ven, NULL, &bRemove) && bRemove)
708  {
709  *ven = 0;
710  }
711  }
712  }
713 
714  // workaround for LORD ELECTRONICS
715  if (((j = wcsstr(ven, L" ")) != NULL) && (j - ven > 2))
716  {
717  i = j - ven;
718  if (!wcsncmp(ven + wcslen(ven) - i, ven, i))
719  {
720  ven[wcslen(ven) - i] = L'\0';
721  }
722  }
723 
724  // make vendor strings shorter
725  for (i = 0; i < _countof(LongNames); i++)
726  {
727  if (wcsstr(dev, LongNames[i].pwLongName) == dev)
728  {
729  // swap ven and dev
730  StringCchCopyW(pBuf, cchBuf, ven);
731  StringCchCopyW(ven, _countof(ven), dev);
732  StringCchCopyW(dev, _countof(dev), pBuf);
733  }
734  wcsrep(ven, LongNames[i].pwLongName, LongNames[i].pwShortName, TRUE);
735  }
736 
737  // remove redundant words
738  for (i = 0; i < _countof(RedundantWords); i++)
739  {
740  wcsrep(ven, RedundantWords[i].pwStr, L"", RedundantWords[i].bReplaceFirstWord);
741  }
742  for (i = 0; i < _countof(RedundantWords); i++)
743  {
744  StringCchCopyW(pBuf, cchBuf, RedundantWords[i].pwStr);
745  StringCchCatW(pBuf, cchBuf, L".");
746  wcsrep(ven, pBuf, L"", RedundantWords[i].bReplaceFirstWord);
747  }
748 
749  // workaround for LENOVO notebooks
750  if (!wcsicmp(ven, L"LENOVO"))
751  {
752  StringCchCopyW(ven, _countof(ven), L"Lenovo");
753 
754  if (DmiStrings[SYS_VERSION] != NULL)
755  {
756  if (!strncmp(DmiStrings[SYS_VERSION], "ThinkPad ", 11))
757  {
758  DmiStrings[SYS_VERSION][8] = L'\0';
759  }
760  if (wcslen(dev) > 0 &&
761  (!strcmp(DmiStrings[SYS_VERSION], "IdeaCentre") ||
762  !strcmp(DmiStrings[SYS_VERSION], "ThinkPad")))
763  {
764  DmiStrings[SYS_FAMILY] = DmiStrings[SYS_VERSION];
765  DmiStrings[SYS_VERSION] = NULL;
766  }
767  else
768  {
769  StringCchCopyA(tmpstr, _countof(tmpstr), DmiStrings[SYS_VERSION]);
770  _strupr(tmpstr);
771  }
772  }
773 
774  if (DmiStrings[SYS_VERSION] != NULL &&
775  strcmp(tmpstr, " ") &&
776  strcmp(tmpstr, "LENOVO") &&
777  strstr(tmpstr, "LENOVO ") == NULL &&
778  strstr(tmpstr, "LENOVO PRODUCT") == NULL &&
779  strstr(tmpstr, "LENOVOPRODUCT") == NULL &&
780  strstr(tmpstr, "INVALID") == NULL &&
781  strncmp(tmpstr, " ", 3) &&
782  (strlen(tmpstr) >= 3 || !IsDigitStrA(tmpstr)) &&
783  strstr(DmiStrings[SYS_VERSION], "Rev ") == NULL &&
784  strstr(DmiStrings[SYS_VERSION], "1.") == NULL &&
785  wcsistr(dev, L"System ") == NULL && // includes System x and ThinkSystem
786  wcsistr(dev, L"IdeaPad ") == NULL &&
787  wcsistr(dev, L"ThinkServer ") == NULL)
788  {
789  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
790  }
791 
792  if (wcsstr(dev, L"Lenovo-") == dev)
793  {
794  // replace "-" with space
795  dev[6] = L' ';
796  }
797 
798  if (!wcscmp(dev, L"Lenovo"))
799  {
800  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
801  }
802  }
803  if (!wcscmp(ven, L"IBM") &&
804  DmiStrings[SYS_VERSION] != NULL &&
805  (strstr(DmiStrings[SYS_VERSION], "ThinkPad ") != NULL ||
806  strstr(DmiStrings[SYS_VERSION], "ThinkCentre ") != NULL))
807  {
808  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
809  }
810 
811  // workaround for DEXP
812  if (!wcscmp(ven, L"DEXP"))
813  {
814  if (DmiStrings[SYS_PRODUCT] != NULL &&
815  DmiStrings[SYS_VERSION] != NULL &&
816  (!stricmp(DmiStrings[SYS_PRODUCT], "Tablet PC") ||
817  !stricmp(DmiStrings[SYS_PRODUCT], "Notebook") ||
818  !stricmp(DmiStrings[SYS_PRODUCT], "Decktop")))
819  {
820  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
821  }
822  }
823 
824  // workaround for Razer Blade
825  if (!wcscmp(ven, L"Razer") && !wcscmp(dev, L"Blade"))
826  {
827  if (DmiStrings[SYS_VERSION] != NULL)
828  {
829  StringCchCopyW(ven, _countof(ven), L"Razer Blade");
830  GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE);
831  }
832  }
833 
834  // workaround for MSI motherboards
835  if (!wcscmp(ven, L"MSI") &&
836  wcsstr(dev, L"MS-") != NULL &&
837  DmiStrings[BOARD_NAME] != NULL &&
838  strstr(DmiStrings[BOARD_NAME], "(MS-") != NULL)
839  {
840  GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE);
841  }
842  if (wcslen(ven) == 0 &&
843  wcsstr(dev, L"MS-") == dev)
844  {
845  StringCchCopyW(ven, _countof(ven), L"MSI");
846  }
847 
848  // trim redundant characters
849  TrimPunctuation(ven);
851 
852  if (wcsistr(dev, ven) == dev ||
853  (!wcscmp(ven, L"ASUS") && wcsstr(dev, L"ASUS") != NULL) ||
854  (!wcscmp(ven, L"HP") && wcsstr(dev, L" by HP") != NULL) ||
855  (!wcscmp(ven, L"INTEL") && wcsstr(dev, L" INTEL") != NULL))
856  {
857  // device string contains vendor string, use second only
858  StringCchCopyW(pBuf, cchBuf, dev);
859  }
860  else
861  {
862  if (wcslen(ven) > 0 && wcslen(dev) > 0 && (j = wcschr(dev, L' ')))
863  {
864  // check if vendor string ends with first word of device string
865  i = j - dev;
866  if (wcslen(ven) > i && !_wcsnicmp(ven + wcslen(ven) - i, dev, i))
867  {
868  ven[wcslen(ven) - i] = L'\0';
869  TrimPunctuation(ven);
870  }
871  }
872  StringCchCopyW(pBuf, cchBuf, ven);
873  AppendSystemFamily(pBuf, cchBuf, DmiStrings, dev);
874  if (wcslen(pBuf) > 0 && wcslen(dev) > 0)
875  {
876  StringCchCatW(pBuf, cchBuf, L" ");
877  }
878  StringCchCatW(pBuf, cchBuf, dev);
879  }
880 
881  FreeSMBiosData(SMBiosBuf);
882 
883  return (wcslen(pBuf) > 0);
884 }
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
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:69
uint16_t * PWCHAR
Definition: typedefs.h:55
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:408
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:180
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
#define _countof(array)
Definition: sndvol32.h:68
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:446
static const WCHAR L[]
Definition: oid.c:1250
static wchar_t * wcsistr(const wchar_t *s, const wchar_t *b)
Definition: smbios.c:106
#define wcsicmp
Definition: string.h:1152
static BOOL IsDigitStrA(PCHAR DmiString)
Definition: smbios.c:43
_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:258
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
static BOOL TrimNonPrintableProd(PCHAR DmiString)
Definition: smbios.c:472
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:5817
#define LBN_SELCHANGE
Definition: winuser.h:2057
#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:404
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:1722
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:2021
#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:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:403

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:5736
#define IDC_HARDWARE_DEVICE_MANAGER
Definition: resource.h:84
#define IDC_HARDWARE_WIZARD
Definition: resource.h:81
#define WM_COMMAND
Definition: winuser.h:1722
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:1721
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:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
__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:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:403
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 27 of file sysdm.c.

33 {
34  WCHAR szCaption[256];
35  WCHAR szText[256];
36 
37  LoadStringW(hInstance, uCaption, szCaption, 256);
38  LoadStringW(hInstance, uText, szText, 256);
39 
40  return MessageBoxW(hwnd,
41  szText,
42  szCaption,
43  uType);
44 }
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 687 of file startrec.c.

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

Referenced by AdvancedPageProc().

◆ UserProfileDlgProc()

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

Definition at line 842 of file userprofile.c.

846 {
847  switch (uMsg)
848  {
849  case WM_INITDIALOG:
850  OnInitUserProfileDialog(hwndDlg);
851  return TRUE;
852 
853  case WM_COMMAND:
854  switch (LOWORD(wParam))
855  {
856  case IDOK:
857  case IDCANCEL:
858  EndDialog(hwndDlg,
859  LOWORD(wParam));
860  return TRUE;
861 
863  ChangeUserProfileType(hwndDlg);
864  break;
865 
867  DeleteUserProfile(hwndDlg);
868  break;
869 
871  CopyUserProfile(hwndDlg);
872  break;
873  }
874  break;
875 
876  case WM_NOTIFY:
877  OnNotify(hwndDlg, (NMHDR *)lParam);
878  break;
879  }
880 
881  return FALSE;
882 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
static VOID OnInitUserProfileDialog(HWND hwndDlg)
Definition: userprofile.c:789
#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:234
#define IDC_USERPROFILE_DELETE
Definition: resource.h:103
static BOOL ChangeUserProfileType(_In_ HWND hwndDlg)
Definition: userprofile.c:108
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_USERPROFILE_COPY
Definition: resource.h:104
static VOID OnNotify(_In_ HWND hwndDlg, _In_ NMHDR *nmhdr)
Definition: userprofile.c:808
static BOOL DeleteUserProfile(_In_ HWND hwndDlg)
Definition: userprofile.c:150
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
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 690 of file virtmem.c.

694 {
695  PVIRTMEM pVirtMem;
696 
698 
699  pVirtMem = (PVIRTMEM)GetWindowLongPtr(hwndDlg, DWLP_USER);
700 
701  switch (uMsg)
702  {
703  case WM_INITDIALOG:
704  pVirtMem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VIRTMEM));
705  if (pVirtMem == NULL)
706  {
707  EndDialog(hwndDlg, 0);
708  return FALSE;
709  }
710 
711  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pVirtMem);
712 
713  OnInitVirtMemDialog(hwndDlg, pVirtMem);
714  break;
715 
716  case WM_DESTROY:
717  OnDestroy(pVirtMem);
718  break;
719 
720  case WM_COMMAND:
721  switch (LOWORD(wParam))
722  {
723  case IDCANCEL:
724  EndDialog(hwndDlg, 0);
725  return TRUE;
726 
727  case IDOK:
728  OnVirtMemDialogOk(pVirtMem);
729  EndDialog(hwndDlg, pVirtMem->bModified);
730  return TRUE;
731 
732  case IDC_NOPAGEFILE:
733  OnNoPagingFile(pVirtMem);
734  return TRUE;
735 
736  case IDC_SYSMANSIZE:
737  OnSysManSize(pVirtMem);
738  return TRUE;
739 
740  case IDC_CUSTOM:
741  OnCustom(pVirtMem);
742  return TRUE;
743 
744  case IDC_SET:
745  OnSet(pVirtMem);
746  return TRUE;
747 
748  case IDC_PAGEFILELIST:
749  switch (HIWORD(wParam))
750  {
751  case LBN_SELCHANGE:
752  OnSelChange(hwndDlg, pVirtMem);
753  return TRUE;
754  }
755  break;
756  }
757  break;
758  }
759 
760  return FALSE;
761 }
#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:271
#define IDC_CUSTOM
Definition: resource.h:143
#define IDC_PAGEFILELIST
Definition: resource.h:139
#define LBN_SELCHANGE
Definition: winuser.h:2057
#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:626
smooth NULL
Definition: ftsmooth.c:416
#define IDC_NOPAGEFILE
Definition: resource.h:147
static VOID OnSysManSize(PVIRTMEM pVirtMem)
Definition: virtmem.c:280
#define WM_DESTROY
Definition: winuser.h:1591
struct _VIRTMEM * PVIRTMEM
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL bModified
Definition: precomp.h:74
static BOOL OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
Definition: virtmem.c:504
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
static VOID OnInitVirtMemDialog(HWND hwnd, PVIRTMEM pVirtMem)
Definition: virtmem.c:642
static VOID OnCustom(PVIRTMEM pVirtMem)
Definition: virtmem.c:289
__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:394
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static VOID OnDestroy(PVIRTMEM pVirtMem)
Definition: virtmem.c:672

Referenced by AdvancedPageProc().

Variable Documentation

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.