ReactOS  0.4.15-dev-3451-gf606fec
propertypage.c File Reference
#include "precomp.h"
Include dependency graph for propertypage.c:

Go to the source code of this file.

Classes

struct  _ENUM_OPTION
 
struct  _PARAMETER
 
struct  _PARAMETER_ARRAY
 

Typedefs

typedef enum _PARAM_TYPE PARAM_TYPE
 
typedef enum _PARAM_TYPEPPARAM_TYPE
 
typedef struct _ENUM_OPTION ENUM_OPTION
 
typedef struct _ENUM_OPTIONPENUM_OPTION
 
typedef struct _PARAMETER PARAMETER
 
typedef struct _PARAMETERPPARAMETER
 
typedef struct _PARAMETER_ARRAY PARAMETER_ARRAY
 
typedef struct _PARAMETER_ARRAYPPARAMETER_ARRAY
 

Enumerations

enum  _PARAM_TYPE {
  NO_TYPE, INT_TYPE, LONG_TYPE, WORD_TYPE,
  DWORD_TYPE, EDIT_TYPE, ENUM_TYPE
}
 

Functions

static VOID FreeParameterArray (_In_ PPARAMETER_ARRAY ParamArray)
 
static DWORD GetStringValue (_In_ HKEY hKey, _In_ PWSTR pValueName, _Out_ PWSTR *pString, _Out_opt_ PDWORD pdwStringLength)
 
static DWORD GetBooleanValue (_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ BOOL bDefault, _Out_ PBOOL pValue)
 
static DWORD GetIntValue (_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ INT iDefault, _Out_ PINT pValue)
 
static DWORD GetLongValue (_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ LONG lDefault, _Out_ PLONG pValue)
 
static DWORD GetDWordValue (_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ DWORD dwDefault, _Out_ PDWORD pValue)
 
static DWORD GetEnumOptions (_In_ HKEY hKey, _In_ PPARAMETER pParameter)
 
static INT FindEnumOption (_In_ PPARAMETER pParameter, _In_ PWSTR pszValue)
 
static BOOL BuildParameterArray (_In_ HDEVINFO DeviceInfoSet, _In_ PSP_DEVINFO_DATA DeviceInfoData, _Out_ PPARAMETER_ARRAY *ParameterArray)
 
static VOID ReadParameterValue (HWND hwnd, PPARAMETER pParam)
 
static VOID WriteParameterArray (_In_ HWND hwnd, _In_ PPARAMETER_ARRAY ParamArray)
 
static VOID DisplayParameter (_In_ HWND hwnd, _In_ PPARAMETER Parameter)
 
static BOOL OnInitDialog (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
static VOID OnCommand (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
static VOID OnNotify (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
static VOID OnDestroy (HWND hwnd)
 
static INT_PTR CALLBACK NetPropertyPageDlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI NetPropPageProvider (PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, LPARAM lParam)
 

Typedef Documentation

◆ ENUM_OPTION

◆ PARAM_TYPE

◆ PARAMETER

◆ PARAMETER_ARRAY

◆ PENUM_OPTION

◆ PPARAM_TYPE

◆ PPARAMETER

◆ PPARAMETER_ARRAY

Enumeration Type Documentation

◆ _PARAM_TYPE

Enumerator
NO_TYPE 
INT_TYPE 
LONG_TYPE 
WORD_TYPE 
DWORD_TYPE 
EDIT_TYPE 
ENUM_TYPE 

Definition at line 10 of file propertypage.c.

11 {
12  NO_TYPE,
13  INT_TYPE,
14  LONG_TYPE,
15  WORD_TYPE,
16  DWORD_TYPE,
17  EDIT_TYPE,
18  ENUM_TYPE,
enum _PARAM_TYPE PARAM_TYPE
enum _PARAM_TYPE * PPARAM_TYPE

Function Documentation

◆ BuildParameterArray()

static BOOL BuildParameterArray ( _In_ HDEVINFO  DeviceInfoSet,
_In_ PSP_DEVINFO_DATA  DeviceInfoData,
_Out_ PPARAMETER_ARRAY ParameterArray 
)
static

Definition at line 425 of file propertypage.c.

429 {
430  HKEY hDriverKey = INVALID_HANDLE_VALUE;
431  HKEY hParamsKey = INVALID_HANDLE_VALUE;
432  HKEY hParamKey;
433  PPARAMETER_ARRAY ParamArray = NULL;
434  DWORD dwSubKeys, dwMaxSubKeyLen, dwKeyLen, dwIndex;
435  PWSTR pszType = NULL;
436  LONG lError;
437  LONG lDefaultMin, lDefaultMax;
438  DWORD dwDefaultMin, dwDefaultMax;
439  BOOL ret = FALSE;
440 
441  hDriverKey = SetupDiOpenDevRegKey(DeviceInfoSet,
444  0,
445  DIREG_DRV,
446  KEY_READ);
447  if (hDriverKey == INVALID_HANDLE_VALUE)
448  {
449  ERR("SetupDiOpenDevRegKey() failed\n");
450  return FALSE;
451  }
452 
453  lError = RegOpenKeyExW(hDriverKey,
454  L"Ndi\\Params",
455  0,
456  KEY_READ,
457  &hParamsKey);
458  if (lError != ERROR_SUCCESS)
459  {
460  ERR("RegOpenKeyExW failed (Error %lu)\n", lError);
461  goto done;
462  }
463 
464  lError = RegQueryInfoKeyW(hParamsKey,
465  NULL,
466  NULL,
467  NULL,
468  &dwSubKeys,
469  &dwMaxSubKeyLen,
470  NULL,
471  NULL,
472  NULL,
473  NULL,
474  NULL,
475  NULL);
476  if (lError != ERROR_SUCCESS)
477  {
478  ERR("RegOpenKeyExW failed (Error %lu)\n", lError);
479  goto done;
480  }
481 
482  TRACE("Sub keys: %lu\n", dwSubKeys);
483 
484  if (dwSubKeys == 0)
485  {
486  TRACE("No sub keys. Done!\n");
487  goto done;
488  }
489 
490  ParamArray = HeapAlloc(GetProcessHeap(),
492  sizeof(PARAMETER_ARRAY) + (dwSubKeys * sizeof(PARAMETER)));
493  if (ParamArray == NULL)
494  {
495  ERR("Parameter array allocation failed!\n");
496  goto done;
497  }
498 
499  ParamArray->DeviceInfoSet = DeviceInfoSet;
500  ParamArray->DeviceInfoData = DeviceInfoData;
501  ParamArray->dwCount = dwSubKeys;
502 
503  dwMaxSubKeyLen++;
504 
505  for (dwIndex = 0; dwIndex < dwSubKeys; dwIndex++)
506  {
507  ParamArray->Array[dwIndex].pszName = HeapAlloc(GetProcessHeap(),
508  0,
509  dwMaxSubKeyLen * sizeof(WCHAR));
510  if (ParamArray->Array[dwIndex].pszName == NULL)
511  {
512  ERR("Parameter array allocation failed!\n");
513  goto done;
514  }
515 
516  dwKeyLen = dwMaxSubKeyLen;
517  lError = RegEnumKeyExW(hParamsKey,
518  dwIndex,
519  ParamArray->Array[dwIndex].pszName,
520  &dwKeyLen,
521  NULL,
522  NULL,
523  NULL,
524  NULL);
525  if (lError != ERROR_SUCCESS)
526  break;
527 
528  TRACE("Sub key '%S'\n", ParamArray->Array[dwIndex].pszName);
529 
530  lError = RegOpenKeyExW(hParamsKey,
531  ParamArray->Array[dwIndex].pszName,
532  0,
533  KEY_READ,
534  &hParamKey);
535  if (lError == ERROR_SUCCESS)
536  {
537  GetStringValue(hParamKey,
538  L"ParamDesc",
539  &ParamArray->Array[dwIndex].pszDescription,
540  NULL);
541 
542  GetStringValue(hParamKey,
543  L"Type",
544  &pszType,
545  NULL);
546  if (pszType != NULL)
547  {
548  if (_wcsicmp(pszType, L"int") == 0)
549  ParamArray->Array[dwIndex].Type = INT_TYPE;
550  else if (_wcsicmp(pszType, L"long") == 0)
551  ParamArray->Array[dwIndex].Type = LONG_TYPE;
552  else if (_wcsicmp(pszType, L"word") == 0)
553  ParamArray->Array[dwIndex].Type = WORD_TYPE;
554  else if (_wcsicmp(pszType, L"dword") == 0)
555  ParamArray->Array[dwIndex].Type = DWORD_TYPE;
556  else if (_wcsicmp(pszType, L"edit") == 0)
557  ParamArray->Array[dwIndex].Type = EDIT_TYPE;
558  else if (_wcsicmp(pszType, L"enum") == 0)
559  ParamArray->Array[dwIndex].Type = ENUM_TYPE;
560  else
561  ParamArray->Array[dwIndex].Type = NO_TYPE;
562 
563  HeapFree(GetProcessHeap(), 0, pszType);
564  pszType = NULL;
565  }
566 
567  GetStringValue(hParamKey,
568  L"Default",
569  &ParamArray->Array[dwIndex].pszDefault,
570  NULL);
571 
572  GetBooleanValue(hParamKey,
573  L"Optional",
574  FALSE,
575  &ParamArray->Array[dwIndex].bOptional);
576 
577  if (ParamArray->Array[dwIndex].Type == INT_TYPE ||
578  ParamArray->Array[dwIndex].Type == LONG_TYPE ||
579  ParamArray->Array[dwIndex].Type == WORD_TYPE ||
580  ParamArray->Array[dwIndex].Type == DWORD_TYPE)
581  {
582  if (ParamArray->Array[dwIndex].Type == INT_TYPE)
583  {
584  lDefaultMin = -32768L; //MIN_SHORT;
585  lDefaultMax = 32767L; //MAX_SHORT;
586  }
587  else if (ParamArray->Array[dwIndex].Type == LONG_TYPE)
588  {
589  lDefaultMin = (-2147483647L - 1); // MIN_LONG;
590  lDefaultMax = 2147483647L; // MAX_LONG;
591  }
592  else if (ParamArray->Array[dwIndex].Type == WORD_TYPE)
593  {
594  dwDefaultMin = 0UL;
595  dwDefaultMax = 65535UL; // MAX_WORD;
596  }
597 #if 0
598  else if (ParamArray->Array[dwIndex].Type == DWORD_TYPE)
599  {
600  dwDefaultMin = 0UL;
601  dwDefaultMax = 4294967295UL; //MAX_DWORD;
602  }
603 #endif
604 
605  if (ParamArray->Array[dwIndex].Type == INT_TYPE ||
606  ParamArray->Array[dwIndex].Type == LONG_TYPE)
607  {
608  GetLongValue(hParamKey,
609  L"Min",
610  lDefaultMin,
611  &ParamArray->Array[dwIndex].u.l.lMin);
612 
613  GetLongValue(hParamKey,
614  L"Max",
615  lDefaultMax,
616  &ParamArray->Array[dwIndex].u.l.lMax);
617  }
618  else if (ParamArray->Array[dwIndex].Type == WORD_TYPE ||
619  ParamArray->Array[dwIndex].Type == DWORD_TYPE)
620  {
621  GetDWordValue(hParamKey,
622  L"Min",
623  dwDefaultMin,
624  &ParamArray->Array[dwIndex].u.dw.dwMin);
625 
626  GetDWordValue(hParamKey,
627  L"Max",
628  dwDefaultMax,
629  &ParamArray->Array[dwIndex].u.dw.dwMax);
630  }
631 
632  GetIntValue(hParamKey,
633  L"Base",
634  10,
635  &ParamArray->Array[dwIndex].iBase);
636 
637  GetIntValue(hParamKey,
638  L"Step",
639  1,
640  &ParamArray->Array[dwIndex].iStep);
641  }
642  else if (ParamArray->Array[dwIndex].Type == EDIT_TYPE)
643  {
644  GetBooleanValue(hParamKey,
645  L"UpperCase",
646  FALSE,
647  &ParamArray->Array[dwIndex].bUpperCase);
648 
649  GetIntValue(hParamKey,
650  L"TextLimit",
651  0,
652  &ParamArray->Array[dwIndex].iTextLimit);
653  }
654  else if (ParamArray->Array[dwIndex].Type == ENUM_TYPE)
655  {
656  GetEnumOptions(hParamKey,
657  &ParamArray->Array[dwIndex]);
658  }
659 
660  RegCloseKey(hParamKey);
661  }
662 
663  lError = GetStringValue(hDriverKey,
664  ParamArray->Array[dwIndex].pszName,
665  &ParamArray->Array[dwIndex].pszValue,
666  &ParamArray->Array[dwIndex].cchValueLength);
667  if ((lError == ERROR_SUCCESS) ||
668  (ParamArray->Array[dwIndex].pszDefault != NULL))
669  {
670  ParamArray->Array[dwIndex].bPresent = TRUE;
671  }
672  }
673 
674  *ParameterArray = ParamArray;
675  ret = TRUE;
676 
677 done:
678  if (ret == FALSE && ParamArray != NULL)
679  FreeParameterArray(ParamArray);
680 
681  if (hParamsKey != INVALID_HANDLE_VALUE)
682  RegCloseKey(hParamsKey);
683 
684  if (hDriverKey != INVALID_HANDLE_VALUE)
685  RegCloseKey(hDriverKey);
686 
687  return ret;
688 }
PSP_DEVINFO_DATA DeviceInfoData
Definition: propertypage.c:65
PWSTR pszName
Definition: propertypage.c:29
PARAM_TYPE Type
Definition: propertypage.c:36
static DWORD GetLongValue(_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ LONG lDefault, _Out_ PLONG pValue)
Definition: propertypage.c:217
static DWORD GetDWordValue(_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ DWORD dwDefault, _Out_ PDWORD pValue)
Definition: propertypage.c:252
#define ERROR_SUCCESS
Definition: deptool.c:10
HDEVINFO DeviceInfoSet
Definition: propertypage.c:64
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
uint16_t * PWSTR
Definition: typedefs.h:56
BOOL bUpperCase
Definition: propertypage.c:41
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
static DWORD GetBooleanValue(_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ BOOL bDefault, _Out_ PBOOL pValue)
Definition: propertypage.c:154
#define L(x)
Definition: ntvdm.h:50
static DWORD GetStringValue(_In_ HKEY hKey, _In_ PWSTR pValueName, _Out_ PWSTR *pString, _Out_opt_ PDWORD pdwStringLength)
Definition: propertypage.c:114
#define FALSE
Definition: types.h:117
struct _PARAMETER::@502::@504 dw
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
INT iTextLimit
Definition: propertypage.c:42
struct _PARAMETER::@502::@503 l
#define TRACE(s)
Definition: solgame.cpp:4
union _PARAMETER::@502 u
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL bPresent
Definition: propertypage.c:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
static VOID FreeParameterArray(_In_ PPARAMETER_ARRAY ParamArray)
Definition: propertypage.c:74
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1528
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD GetEnumOptions(_In_ HKEY hKey, _In_ PPARAMETER pParameter)
Definition: propertypage.c:288
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3690
int ret
PARAMETER Array[0]
Definition: propertypage.c:68
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
Definition: devinst.c:5930
DWORD cchValueLength
Definition: propertypage.c:32
#define ERR(fmt,...)
Definition: debug.h:110
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
static DWORD GetIntValue(_In_ HKEY hKey, _In_ PWSTR pValueName, _In_ INT iDefault, _Out_ PINT pValue)
Definition: propertypage.c:187
PWSTR pszDescription
Definition: propertypage.c:30
#define NULL
Definition: types.h:112
BOOL bOptional
Definition: propertypage.c:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define DIREG_DRV
Definition: setupapi.h:182
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
PWSTR pszValue
Definition: propertypage.c:31
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
PWSTR pszDefault
Definition: propertypage.c:33
#define UL
Definition: tui.h:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define RegCloseKey(hKey)
Definition: registry.h:40
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by NetPropPageProvider().

◆ DisplayParameter()

static VOID DisplayParameter ( _In_ HWND  hwnd,
_In_ PPARAMETER  Parameter 
)
static

Definition at line 815 of file propertypage.c.

818 {
819  HWND hwndControl;
820  LONG_PTR Style;
821  INT idx;
822  DWORD i;
823 
826  if (Parameter->bOptional)
827  {
828  if (Parameter->bPresent)
830  else
832  }
833 
834  switch (Parameter->Type)
835  {
836  case INT_TYPE:
837  case LONG_TYPE:
838  case WORD_TYPE:
839  case DWORD_TYPE:
841 
842  hwndControl = GetDlgItem(hwnd, IDC_PROPERTY_VALUE_UPDN);
843 
844  if (Parameter->Type != DWORD_TYPE)
845  {
846  EnableWindow(hwndControl, Parameter->bPresent);
847  ShowWindow(hwndControl, SW_SHOW);
848  }
849 
850  if (Parameter->Type == WORD_TYPE || Parameter->Type == DWORD_TYPE)
851  SendMessage(hwndControl, UDM_SETBASE, Parameter->iBase, 0);
852  else
853  SendMessage(hwndControl, UDM_SETBASE, 10, 0);
854 
855  if (Parameter->Type == INT_TYPE || Parameter->Type == LONG_TYPE)
856  {
857  TRACE("SetMin %ld SetMax %ld\n", Parameter->u.l.lMin, Parameter->u.l.lMax);
858  SendMessage(hwndControl, UDM_SETRANGE32, Parameter->u.l.lMin, Parameter->u.l.lMax);
859  }
860  else if (Parameter->Type == WORD_TYPE)
861  {
862  TRACE("SetMin %lu SetMax %lu\n", Parameter->u.dw.dwMin, Parameter->u.dw.dwMax);
863  SendMessage(hwndControl, UDM_SETRANGE32, (INT)Parameter->u.dw.dwMin, (INT)Parameter->u.dw.dwMax);
864  }
865 
866  hwndControl = GetDlgItem(hwnd, IDC_PROPERTY_VALUE_EDIT);
867  EnableWindow(hwndControl, Parameter->bPresent);
868  ShowWindow(hwndControl, SW_SHOW);
869 
870  Style = GetWindowLongPtr(hwndControl, GWL_STYLE);
871  Style |= ES_NUMBER;
872  SetWindowLongPtr(hwndControl, GWL_STYLE, Style);
873 
874  Edit_LimitText(hwndControl, 0);
875 
876  if (Parameter->pszValue)
877  Edit_SetText(hwndControl, Parameter->pszValue);
878  else if (Parameter->pszDefault)
879  Edit_SetText(hwndControl, Parameter->pszDefault);
880  break;
881 
882  case EDIT_TYPE:
885 
886  hwndControl = GetDlgItem(hwnd, IDC_PROPERTY_VALUE_EDIT);
887  EnableWindow(hwndControl, Parameter->bPresent);
888  ShowWindow(hwndControl, SW_SHOW);
889 
890  Style = GetWindowLongPtr(hwndControl, GWL_STYLE);
891  Style &= ~ES_NUMBER;
892  if (Parameter->bUpperCase)
893  Style |= ES_UPPERCASE;
894  else
895  Style &= ~ES_UPPERCASE;
896  SetWindowLongPtr(hwndControl, GWL_STYLE, Style);
897 
898  Edit_LimitText(hwndControl, Parameter->iTextLimit);
899 
900  if (Parameter->pszValue)
901  Edit_SetText(hwndControl, Parameter->pszValue);
902  else if (Parameter->pszDefault)
903  Edit_SetText(hwndControl, Parameter->pszDefault);
904  break;
905 
906  case ENUM_TYPE:
909 
910  hwndControl = GetDlgItem(hwnd, IDC_PROPERTY_VALUE_LIST);
911  EnableWindow(hwndControl, Parameter->bPresent);
912  ShowWindow(hwndControl, SW_SHOW);
913 
914  ComboBox_ResetContent(hwndControl);
915 
916  if (Parameter->pEnumOptions != NULL && Parameter->dwEnumOptions != 0)
917  {
918  for (i = 0; i < Parameter->dwEnumOptions; i++)
919  {
920  ComboBox_AddString(hwndControl, Parameter->pEnumOptions[i].pszName);
921  }
922  }
923 
924  if (Parameter->pszValue)
925  {
926  idx = FindEnumOption(Parameter, Parameter->pszValue);
927  if (idx != CB_ERR)
928  ComboBox_SetCurSel(hwndControl, idx);
929  }
930  else if (Parameter->pszDefault)
931  {
932  idx = FindEnumOption(Parameter, Parameter->pszDefault);
933  if (idx != CB_ERR)
934  ComboBox_SetCurSel(hwndControl, idx);
935  }
936  break;
937 
938  default:
939  break;
940  }
941 }
#define IDC_PROPERTY_VALUE_EDIT
Definition: resource.h:91
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:16
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
_In_ PVOID Parameter
Definition: ldrtypes.h:241
#define IDC_PROPERTY_VALUE_LIST
Definition: resource.h:93
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
unsigned int idx
Definition: utils.c:41
#define ES_UPPERCASE
Definition: pedump.c:668
#define UDM_SETRANGE32
Definition: commctrl.h:2151
#define SW_SHOW
Definition: winuser.h:769
#define CB_ERR
Definition: winuser.h:2415
#define IDC_PROPERTY_NOT_PRESENT
Definition: resource.h:95
#define TRACE(s)
Definition: solgame.cpp:4
const DWORD Style
Definition: appswitch.c:71
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define Edit_LimitText(hwndCtl, cchMax)
Definition: windowsx.h:72
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:41
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:846
#define ComboBox_ResetContent(hwndCtl)
Definition: windowsx.h:38
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
#define ES_NUMBER
Definition: winuser.h:301
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static INT FindEnumOption(_In_ PPARAMETER pParameter, _In_ PWSTR pszValue)
Definition: propertypage.c:403
#define NULL
Definition: types.h:112
#define BST_CHECKED
Definition: winuser.h:197
#define Button_SetCheck(hwndCtl, check)
Definition: windowsx.h:10
#define IDC_PROPERTY_PRESENT
Definition: resource.h:94
#define SendMessage
Definition: winuser.h:5823
#define IDC_PROPERTY_VALUE_UPDN
Definition: resource.h:92
#define GetWindowLongPtr
Definition: treelist.c:73
#define Edit_SetText(hwndCtl, lpsz)
Definition: windowsx.h:87
#define UDM_SETBASE
Definition: commctrl.h:2149

Referenced by OnCommand(), and OnInitDialog().

◆ FindEnumOption()

static INT FindEnumOption ( _In_ PPARAMETER  pParameter,
_In_ PWSTR  pszValue 
)
static

Definition at line 403 of file propertypage.c.

406 {
407  INT i;
408 
409  if ((pParameter->pEnumOptions == NULL) ||
410  (pParameter->dwEnumOptions == 0))
411  return -1;
412 
413  for (i = 0; i < pParameter->dwEnumOptions; i++)
414  {
415  if (_wcsicmp(pParameter->pEnumOptions[i].pszValue, pszValue) == 0)
416  return i;
417  }
418 
419  return -1;
420 }
int32_t INT
Definition: typedefs.h:58
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
#define NULL
Definition: types.h:112
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by DisplayParameter().

◆ FreeParameterArray()

static VOID FreeParameterArray ( _In_ PPARAMETER_ARRAY  ParamArray)
static

Definition at line 74 of file propertypage.c.

76 {
77  INT i, j;
78 
79  if (ParamArray == NULL)
80  return;
81 
82  for (i = 0; i < ParamArray->dwCount; i++)
83  {
84  if (ParamArray->Array[i].pszName != NULL)
85  HeapFree(GetProcessHeap(), 0, ParamArray->Array[i].pszName);
86 
87  if (ParamArray->Array[i].pszDescription != NULL)
88  HeapFree(GetProcessHeap(), 0, ParamArray->Array[i].pszDescription);
89 
90  if (ParamArray->Array[i].pszDefault != NULL)
91  HeapFree(GetProcessHeap(), 0, ParamArray->Array[i].pszDefault);
92 
93 
94  if (ParamArray->Array[i].pEnumOptions != NULL)
95  {
96  for (j = 0; j < ParamArray->Array[i].dwEnumOptions; j++)
97  {
98  if (ParamArray->Array[i].pEnumOptions[j].pszValue != NULL)
99  HeapFree(GetProcessHeap(), 0, ParamArray->Array[i].pEnumOptions[j].pszValue);
100 
101  if (ParamArray->Array[i].pEnumOptions[j].pszName != NULL)
102  HeapFree(GetProcessHeap(), 0, ParamArray->Array[i].pEnumOptions[j].pszName);
103  }
104 
105  HeapFree(GetProcessHeap(), 0, ParamArray->Array[i].pEnumOptions);
106  }
107  }
108 
109  HeapFree(GetProcessHeap(), 0, ParamArray);
110 }
int32_t INT
Definition: typedefs.h:58
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
#define GetProcessHeap()
Definition: compat.h:595
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
#define NULL
Definition: types.h:112
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by BuildParameterArray(), and OnDestroy().

◆ GetBooleanValue()

static DWORD GetBooleanValue ( _In_ HKEY  hKey,
_In_ PWSTR  pValueName,
_In_ BOOL  bDefault,
_Out_ PBOOL  pValue 
)
static

Definition at line 154 of file propertypage.c.

159 {
160  WCHAR szBuffer[16];
161  DWORD dwLength = 0;
162  DWORD dwRegType;
163 
164  *pValue = bDefault;
165 
166  dwLength = sizeof(szBuffer);
168  pValueName,
169  NULL,
170  &dwRegType,
171  (LPBYTE)szBuffer,
172  &dwLength);
173 
174  if (dwRegType == REG_SZ && dwLength >= sizeof(WCHAR))
175  {
176  if (szBuffer[0] == L'0')
177  *pValue = FALSE;
178  else
179  *pValue = TRUE;
180  }
181 
182  return ERROR_SUCCESS;
183 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
PWCHAR pValue
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define REG_SZ
Definition: layer.c:22

Referenced by BuildParameterArray().

◆ GetDWordValue()

static DWORD GetDWordValue ( _In_ HKEY  hKey,
_In_ PWSTR  pValueName,
_In_ DWORD  dwDefault,
_Out_ PDWORD  pValue 
)
static

Definition at line 252 of file propertypage.c.

257 {
258  WCHAR szBuffer[24];
259  DWORD dwLength = 0;
260  DWORD dwRegType;
261  PWSTR ptr = NULL;
262 
263  dwLength = sizeof(szBuffer);
265  pValueName,
266  NULL,
267  &dwRegType,
268  (LPBYTE)szBuffer,
269  &dwLength);
270 
271  if (dwRegType == REG_SZ && dwLength >= sizeof(WCHAR))
272  {
273  *pValue = wcstoul(szBuffer, &ptr, 10);
274  if (*pValue == 0 && ptr != NULL)
275  *pValue = dwDefault;
276  }
277  else
278  {
279  *pValue = dwDefault;
280  }
281 
282  return ERROR_SUCCESS;
283 }
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:56
PWCHAR pValue
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
unsigned char * LPBYTE
Definition: typedefs.h:53
static PVOID ptr
Definition: dispmode.c:27
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define REG_SZ
Definition: layer.c:22

Referenced by BuildParameterArray().

◆ GetEnumOptions()

static DWORD GetEnumOptions ( _In_ HKEY  hKey,
_In_ PPARAMETER  pParameter 
)
static

Definition at line 288 of file propertypage.c.

291 {
292  HKEY hEnumKey = NULL;
293  PENUM_OPTION pOptions = NULL;
294  DWORD dwValues, dwMaxValueNameLen, dwMaxValueLen;
295  DWORD dwValueNameLength, dwValueLength;
296  DWORD i;
297  DWORD dwError;
298 
299  dwError = RegOpenKeyExW(hKey,
300  L"enum",
301  0,
302  KEY_READ,
303  &hEnumKey);
304  if (dwError != ERROR_SUCCESS)
305  return dwError;
306 
307  dwError = RegQueryInfoKeyW(hEnumKey,
308  NULL,
309  NULL,
310  NULL,
311  NULL,
312  NULL,
313  NULL,
314  &dwValues,
315  &dwMaxValueNameLen,
316  &dwMaxValueLen,
317  NULL,
318  NULL);
319  if (dwError != ERROR_SUCCESS)
320  {
321  ERR("RegQueryInfoKeyW failed (Error %lu)\n", dwError);
322  goto done;
323  }
324 
325  pOptions = HeapAlloc(GetProcessHeap(),
327  dwValues * sizeof(ENUM_OPTION));
328  if (pOptions == NULL)
329  {
330  dwError = ERROR_OUTOFMEMORY;
331  goto done;
332  }
333 
334  for (i = 0; i < dwValues; i++)
335  {
336  dwValueNameLength = dwMaxValueNameLen + sizeof(WCHAR);
337  pOptions[i].pszValue = HeapAlloc(GetProcessHeap(),
338  0,
339  dwValueNameLength * sizeof(WCHAR));
340  if (pOptions[i].pszValue == NULL)
341  {
342  dwError = ERROR_OUTOFMEMORY;
343  goto done;
344  }
345 
346  dwValueLength = dwMaxValueLen;
347  pOptions[i].pszName = HeapAlloc(GetProcessHeap(),
348  0,
349  dwValueLength);
350  if (pOptions[i].pszName == NULL)
351  {
352  dwError = ERROR_OUTOFMEMORY;
353  goto done;
354  }
355 
356  dwError = RegEnumValueW(hEnumKey,
357  i,
358  pOptions[i].pszValue,
359  &dwValueNameLength,
360  NULL,
361  NULL,
362  (PBYTE)pOptions[i].pszName,
363  &dwValueLength);
364  if (dwError == ERROR_NO_MORE_ITEMS)
365  {
366  dwError = ERROR_SUCCESS;
367  goto done;
368  }
369  else if (dwError != ERROR_SUCCESS)
370  {
371  goto done;
372  }
373  }
374 
375  pParameter->pEnumOptions = pOptions;
376  pParameter->dwEnumOptions = dwValues;
377  pOptions = NULL;
378 
379 done:
380  if (pOptions != NULL)
381  {
382  for (i = 0; i < dwValues; i++)
383  {
384  if (pOptions[i].pszValue != NULL)
385  HeapFree(GetProcessHeap(), 0, pOptions[i].pszValue);
386 
387  if (pOptions[i].pszName != NULL)
388  HeapFree(GetProcessHeap(), 0, pOptions[i].pszName);
389  }
390 
391  HeapFree(GetProcessHeap(), 0, pOptions);
392  }
393 
394  if (hEnumKey != NULL)
396 
397  return dwError;
398 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define KEY_READ
Definition: nt_native.h:1023
PWSTR pszValue
Definition: propertypage.c:23
#define L(x)
Definition: ntvdm.h:50
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2853
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3690
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
BYTE * PBYTE
Definition: pedump.c:66
#define HeapFree(x, y, z)
Definition: compat.h:594
#define RegCloseKey(hKey)
Definition: registry.h:40
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by BuildParameterArray().

◆ GetIntValue()

static DWORD GetIntValue ( _In_ HKEY  hKey,
_In_ PWSTR  pValueName,
_In_ INT  iDefault,
_Out_ PINT  pValue 
)
static

Definition at line 187 of file propertypage.c.

192 {
193  WCHAR szBuffer[24];
194  DWORD dwLength = 0;
195  DWORD dwRegType;
196 
197  *pValue = iDefault;
198 
199  dwLength = sizeof(szBuffer);
201  pValueName,
202  NULL,
203  &dwRegType,
204  (LPBYTE)szBuffer,
205  &dwLength);
206 
207  if (dwRegType == REG_SZ && dwLength >= sizeof(WCHAR))
208  {
209  *pValue = _wtoi(szBuffer);
210  }
211 
212  return ERROR_SUCCESS;
213 }
#define ERROR_SUCCESS
Definition: deptool.c:10
PWCHAR pValue
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
unsigned char * LPBYTE
Definition: typedefs.h:53
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define REG_SZ
Definition: layer.c:22

Referenced by BuildParameterArray().

◆ GetLongValue()

static DWORD GetLongValue ( _In_ HKEY  hKey,
_In_ PWSTR  pValueName,
_In_ LONG  lDefault,
_Out_ PLONG  pValue 
)
static

Definition at line 217 of file propertypage.c.

222 {
223  WCHAR szBuffer[24];
224  DWORD dwLength = 0;
225  DWORD dwRegType;
226  PWSTR ptr = NULL;
227 
228  dwLength = sizeof(szBuffer);
230  pValueName,
231  NULL,
232  &dwRegType,
233  (LPBYTE)szBuffer,
234  &dwLength);
235 
236  if (dwRegType == REG_SZ && dwLength >= sizeof(WCHAR))
237  {
238  *pValue = wcstol(szBuffer, &ptr, 10);
239  if (*pValue == 0 && ptr != NULL)
240  *pValue = lDefault;
241  }
242  else
243  {
244  *pValue = lDefault;
245  }
246 
247  return ERROR_SUCCESS;
248 }
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:56
PWCHAR pValue
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
unsigned char * LPBYTE
Definition: typedefs.h:53
static PVOID ptr
Definition: dispmode.c:27
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define REG_SZ
Definition: layer.c:22

Referenced by BuildParameterArray().

◆ GetStringValue()

static DWORD GetStringValue ( _In_ HKEY  hKey,
_In_ PWSTR  pValueName,
_Out_ PWSTR pString,
_Out_opt_ PDWORD  pdwStringLength 
)
static

Definition at line 114 of file propertypage.c.

119 {
120  PWSTR pBuffer;
121  DWORD dwLength = 0;
122  DWORD dwRegType;
123  DWORD dwError;
124 
125  *pString = NULL;
126 
127  RegQueryValueExW(hKey, pValueName, NULL, &dwRegType, NULL, &dwLength);
128 
129  if (dwLength == 0 || dwRegType != REG_SZ)
130  return ERROR_FILE_NOT_FOUND;
131 
132  pBuffer = HeapAlloc(GetProcessHeap(), 0, dwLength + sizeof(WCHAR));
133  if (pBuffer == NULL)
135 
136  dwError = RegQueryValueExW(hKey, pValueName, NULL, NULL, (LPBYTE)pBuffer, &dwLength);
137  if (dwError != ERROR_SUCCESS)
138  {
140  return dwError;
141  }
142 
143  pBuffer[dwLength / sizeof(WCHAR)] = UNICODE_NULL;
144 
145  *pString = pBuffer;
146  if (pdwStringLength)
147  *pdwStringLength = dwLength;
148 
149  return ERROR_SUCCESS;
150 }
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:56
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
unsigned char * LPBYTE
Definition: typedefs.h:53
#define UNICODE_NULL
PVOID pBuffer
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
FxString * pString
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define HeapFree(x, y, z)
Definition: compat.h:594
#define REG_SZ
Definition: layer.c:22

Referenced by BuildParameterArray().

◆ NetPropertyPageDlgProc()

static INT_PTR CALLBACK NetPropertyPageDlgProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1100 of file propertypage.c.

1105 {
1106  switch (uMsg)
1107  {
1108  case WM_INITDIALOG:
1109  return OnInitDialog(hwnd, wParam, lParam);
1110 
1111  case WM_COMMAND:
1113  break;
1114 
1115  case WM_NOTIFY:
1117  break;
1118 
1119  case WM_DESTROY:
1120  OnDestroy(hwnd);
1121  break;
1122 
1123  default:
1124  break;
1125  }
1126 
1127  return FALSE;
1128 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WPARAM wParam
Definition: combotst.c:138
static VOID OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
#define FALSE
Definition: types.h:117
static VOID OnDestroy(HWND hwnd)
#define WM_DESTROY
Definition: winuser.h:1596
static BOOL OnInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: propertypage.c:946
#define WM_COMMAND
Definition: winuser.h:1727
static VOID OnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: propertypage.c:997
#define WM_INITDIALOG
Definition: winuser.h:1726
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by NetPropPageProvider().

◆ NetPropPageProvider()

BOOL WINAPI NetPropPageProvider ( PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
LPARAM  lParam 
)

Definition at line 1133 of file propertypage.c.

1137 {
1139  HPROPSHEETPAGE hPropSheetPage;
1140  PPARAMETER_ARRAY ParameterArray = NULL;
1141 
1142  TRACE("NetPropPageProvider(%p %p %lx)\n",
1143  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
1144 
1145  if (!BuildParameterArray(lpPropSheetPageRequest->DeviceInfoSet,
1146  lpPropSheetPageRequest->DeviceInfoData,
1147  &ParameterArray))
1148  return FALSE;
1149 
1150  if (lpPropSheetPageRequest->PageRequested == SPPSR_ENUM_ADV_DEVICE_PROPERTIES)
1151  {
1152  TRACE("SPPSR_ENUM_ADV_DEVICE_PROPERTIES\n");
1153 
1154  PropSheetPage.dwSize = sizeof(PROPSHEETPAGEW);
1155  PropSheetPage.dwFlags = 0;
1156  PropSheetPage.hInstance = netcfgx_hInstance;
1159  PropSheetPage.lParam = (LPARAM)ParameterArray;
1160  PropSheetPage.pfnCallback = NULL;
1161 
1162  hPropSheetPage = CreatePropertySheetPageW(&PropSheetPage);
1163  if (hPropSheetPage == NULL)
1164  {
1165  ERR("CreatePropertySheetPageW() failed!\n");
1166  return FALSE;
1167  }
1168 
1169  if (!(*lpfnAddPropSheetPageProc)(hPropSheetPage, lParam))
1170  {
1171  ERR("lpfnAddPropSheetPageProc() failed!\n");
1172  DestroyPropertySheetPage(hPropSheetPage);
1173  return FALSE;
1174  }
1175  }
1176 
1177  TRACE("Done!\n");
1178 
1179  return TRUE;
1180 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_NET_PROPERTY_DLG
Definition: resource.h:19
#define TRUE
Definition: types.h:120
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3144
static INT_PTR CALLBACK NetPropertyPageDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1104
#define FALSE
Definition: types.h:117
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
struct _PROPSHEETPAGEW PROPSHEETPAGEW
LONG_PTR LPARAM
Definition: windef.h:208
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3075
HINSTANCE netcfgx_hInstance
Definition: netcfgx.c:15
#define TRACE(s)
Definition: solgame.cpp:4
#define SPPSR_ENUM_ADV_DEVICE_PROPERTIES
Definition: setupapi.h:615
#define ERR(fmt,...)
Definition: debug.h:110
static BOOL BuildParameterArray(_In_ HDEVINFO DeviceInfoSet, _In_ PSP_DEVINFO_DATA DeviceInfoData, _Out_ PPARAMETER_ARRAY *ParameterArray)
Definition: propertypage.c:425
#define NULL
Definition: types.h:112
LPARAM lParam
Definition: combotst.c:139

◆ OnCommand()

static VOID OnCommand ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 997 of file propertypage.c.

1001 {
1002  PPARAMETER_ARRAY pParamArray;
1003  INT iIndex;
1004 
1005  TRACE("OnCommand()\n");
1006 
1008  if (pParamArray == NULL)
1009  {
1010  ERR("pParamArray is NULL\n");
1011  return;
1012  }
1013 
1015  {
1016  if (pParamArray->pCurrentParam != NULL)
1017  {
1018  ReadParameterValue(hwnd, pParamArray->pCurrentParam);
1019  }
1020 
1021  iIndex = ListBox_GetCurSel((HWND)lParam);
1022  if (iIndex != LB_ERR && iIndex < pParamArray->dwCount)
1023  {
1024  pParamArray->pCurrentParam = (PPARAMETER)ListBox_GetItemData((HWND)lParam, iIndex);
1025  DisplayParameter(hwnd, pParamArray->pCurrentParam);
1026  }
1027  }
1028  else if ((LOWORD(wParam) == IDC_PROPERTY_PRESENT) && (HIWORD(wParam) == BN_CLICKED))
1029  {
1033  pParamArray->pCurrentParam->bPresent = TRUE;
1034  }
1036  {
1040  pParamArray->pCurrentParam->bPresent = FALSE;
1041  }
1042 }
#define IDC_PROPERTY_VALUE_EDIT
Definition: resource.h:91
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ListBox_GetCurSel(hwndCtl)
Definition: windowsx.h:456
#define IDC_PROPERTY_NAME
Definition: resource.h:90
struct _PARAMETER_ARRAY * PPARAMETER_ARRAY
#define TRUE
Definition: types.h:120
PPARAMETER pCurrentParam
Definition: propertypage.c:66
#define IDC_PROPERTY_VALUE_LIST
Definition: resource.h:93
#define LBN_SELCHANGE
Definition: winuser.h:2062
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
static VOID DisplayParameter(_In_ HWND hwnd, _In_ PPARAMETER Parameter)
Definition: propertypage.c:815
#define FALSE
Definition: types.h:117
#define LB_ERR
Definition: winuser.h:2412
#define ListBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:458
#define IDC_PROPERTY_NOT_PRESENT
Definition: resource.h:95
#define TRACE(s)
Definition: solgame.cpp:4
static VOID ReadParameterValue(HWND hwnd, PPARAMETER pParam)
Definition: propertypage.c:693
BOOL bPresent
Definition: propertypage.c:35
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1912
#define DWLP_USER
Definition: winuser.h:866
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define IDC_PROPERTY_PRESENT
Definition: resource.h:94
struct _PARAMETER * PPARAMETER
#define HIWORD(l)
Definition: typedefs.h:247
#define IDC_PROPERTY_VALUE_UPDN
Definition: resource.h:92
#define GetWindowLongPtr
Definition: treelist.c:73
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by NetPropertyPageDlgProc().

◆ OnDestroy()

static VOID OnDestroy ( HWND  hwnd)
static

Definition at line 1078 of file propertypage.c.

1080 {
1081  PPARAMETER_ARRAY pParamArray;
1082 
1083  TRACE("OnDestroy()\n");
1084 
1086  if (pParamArray == NULL)
1087  {
1088  ERR("pParamArray is NULL\n");
1089  return;
1090  }
1091 
1092  FreeParameterArray(pParamArray);
1094 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _PARAMETER_ARRAY * PPARAMETER_ARRAY
#define SetWindowLongPtr
Definition: treelist.c:70
#define TRACE(s)
Definition: solgame.cpp:4
static VOID FreeParameterArray(_In_ PPARAMETER_ARRAY ParamArray)
Definition: propertypage.c:74
#define DWLP_USER
Definition: winuser.h:866
#define ERR(fmt,...)
Definition: debug.h:110
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
#define GetWindowLongPtr
Definition: treelist.c:73

Referenced by NetPropertyPageDlgProc().

◆ OnInitDialog()

static BOOL OnInitDialog ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 946 of file propertypage.c.

950 {
951  PPARAMETER_ARRAY pParamArray;
952  HWND hwndControl;
953  PWSTR pszText;
954  DWORD i;
955  INT idx;
956 
957  TRACE("OnInitDialog()\n");
958 
959  pParamArray = (PPARAMETER_ARRAY)((LPPROPSHEETPAGEW)lParam)->lParam;
960  if (pParamArray == NULL)
961  {
962  ERR("pParamArray is NULL\n");
963  return FALSE;
964  }
965 
966  SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)pParamArray);
967 
968  hwndControl = GetDlgItem(hwnd, IDC_PROPERTY_NAME);
969  if (hwndControl)
970  {
971  for (i = 0; i < pParamArray->dwCount; i++)
972  {
973  if (pParamArray->Array[i].pszDescription != NULL)
974  pszText = pParamArray->Array[i].pszDescription;
975  else
976  pszText = pParamArray->Array[i].pszName;
977 
978  idx = ListBox_AddString(hwndControl, pszText);
979  if (idx != LB_ERR)
980  ListBox_SetItemData(hwndControl, idx, (LPARAM)&pParamArray->Array[i]);
981  }
982 
983  if (pParamArray->dwCount > 0)
984  {
985  ListBox_SetCurSel(hwndControl, 0);
986  pParamArray->pCurrentParam = (PPARAMETER)ListBox_GetItemData(hwndControl, 0);
987  DisplayParameter(hwnd, pParamArray->pCurrentParam);
988  }
989  }
990 
991  return TRUE;
992 }
PWSTR pszName
Definition: propertypage.c:29
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_PROPERTY_NAME
Definition: resource.h:90
struct _PARAMETER_ARRAY * PPARAMETER_ARRAY
#define TRUE
Definition: types.h:120
uint16_t * PWSTR
Definition: typedefs.h:56
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:447
PPARAMETER pCurrentParam
Definition: propertypage.c:66
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
#define ListBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:475
static VOID DisplayParameter(_In_ HWND hwnd, _In_ PPARAMETER Parameter)
Definition: propertypage.c:815
#define FALSE
Definition: types.h:117
#define LB_ERR
Definition: winuser.h:2412
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
#define ListBox_SetItemData(hwndCtl, index, data)
Definition: windowsx.h:477
#define ListBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:458
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
PARAMETER Array[0]
Definition: propertypage.c:68
#define DWLP_USER
Definition: winuser.h:866
#define ERR(fmt,...)
Definition: debug.h:110
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
PWSTR pszDescription
Definition: propertypage.c:30
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
struct _PARAMETER * PPARAMETER
LPARAM lParam
Definition: combotst.c:139

Referenced by NetPropertyPageDlgProc().

◆ OnNotify()

static VOID OnNotify ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1047 of file propertypage.c.

1051 {
1052  PPARAMETER_ARRAY pParamArray;
1053 
1054  TRACE("OnNotify()\n");
1055 
1057  if (pParamArray == NULL)
1058  {
1059  ERR("pParamArray is NULL\n");
1060  return;
1061  }
1062 
1063  if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
1064  {
1065  TRACE("PSN_APPLY!\n");
1066  WriteParameterArray(hwnd, pParamArray);
1067  }
1068  else if (((LPNMHDR)lParam)->code == (UINT)UDN_DELTAPOS)
1069  {
1070  LPNMUPDOWN pUpDown = (LPNMUPDOWN)lParam;
1071  pUpDown->iDelta *= pParamArray->pCurrentParam->iStep;
1072  }
1073 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _PARAMETER_ARRAY * PPARAMETER_ARRAY
struct _NM_UPDOWN * LPNMUPDOWN
PPARAMETER pCurrentParam
Definition: propertypage.c:66
#define PSN_APPLY
Definition: prsht.h:117
static VOID WriteParameterArray(_In_ HWND hwnd, _In_ PPARAMETER_ARRAY ParamArray)
Definition: propertypage.c:745
#define TRACE(s)
Definition: solgame.cpp:4
#define UDN_DELTAPOS
Definition: commctrl.h:2169
#define DWLP_USER
Definition: winuser.h:866
Definition: inflate.c:139
#define ERR(fmt,...)
Definition: debug.h:110
int iDelta
Definition: commctrl.h:2166
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GetWindowLongPtr
Definition: treelist.c:73
LPARAM lParam
Definition: combotst.c:139

Referenced by NetPropertyPageDlgProc().

◆ ReadParameterValue()

static VOID ReadParameterValue ( HWND  hwnd,
PPARAMETER  pParam 
)
static

Definition at line 693 of file propertypage.c.

696 {
697  INT iIndex, iLength;
698 
699  if (pParam->Type == ENUM_TYPE)
700  {
702  if (iIndex != CB_ERR && iIndex < pParam->dwEnumOptions)
703  {
704  iLength = wcslen(pParam->pEnumOptions[iIndex].pszValue);
705  if (iLength > pParam->cchValueLength)
706  {
707  if (pParam->pszValue != NULL)
708  HeapFree(GetProcessHeap(), 0, pParam->pszValue);
709 
710  pParam->pszValue = HeapAlloc(GetProcessHeap(), 0, (iLength + 1) * sizeof(WCHAR));
711  }
712 
713  if (pParam->pszValue != NULL)
714  {
715  wcscpy(pParam->pszValue,
716  pParam->pEnumOptions[iIndex].pszValue);
717  pParam->cchValueLength = iLength;
718  }
719  }
720  }
721  else
722  {
724  if (iLength > pParam->cchValueLength)
725  {
726  if (pParam->pszValue != NULL)
727  HeapFree(GetProcessHeap(), 0, pParam->pszValue);
728 
729  pParam->pszValue = HeapAlloc(GetProcessHeap(), 0, (iLength + 1) * sizeof(WCHAR));
730  }
731 
732  if (pParam->pszValue != NULL)
733  {
735  pParam->pszValue,
736  iLength + 1);
737  pParam->cchValueLength = iLength;
738  }
739  }
740 }
#define Edit_GetText(hwndCtl, lpch, cchMax)
Definition: windowsx.h:69
#define IDC_PROPERTY_VALUE_EDIT
Definition: resource.h:91
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
PARAM_TYPE Type
Definition: propertypage.c:36
PWSTR pszValue
Definition: propertypage.c:23
PENUM_OPTION pEnumOptions
Definition: propertypage.c:39
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:24
#define IDC_PROPERTY_VALUE_LIST
Definition: resource.h:93
int32_t INT
Definition: typedefs.h:58
#define CB_ERR
Definition: winuser.h:2415
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
DWORD cchValueLength
Definition: propertypage.c:32
#define Edit_GetTextLength(hwndCtl)
Definition: windowsx.h:70
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PWSTR pszValue
Definition: propertypage.c:31
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by OnCommand(), and WriteParameterArray().

◆ WriteParameterArray()

static VOID WriteParameterArray ( _In_ HWND  hwnd,
_In_ PPARAMETER_ARRAY  ParamArray 
)
static

Definition at line 745 of file propertypage.c.

748 {
749  SP_DEVINSTALL_PARAMS_W InstallParams;
750  PPARAMETER Param;
751  HKEY hDriverKey;
752  INT i;
753 
754  if (ParamArray == NULL)
755  return;
756 
757  hDriverKey = SetupDiOpenDevRegKey(ParamArray->DeviceInfoSet,
758  ParamArray->DeviceInfoData,
760  0,
761  DIREG_DRV,
762  KEY_WRITE);
763  if (hDriverKey == INVALID_HANDLE_VALUE)
764  {
765  ERR("SetupDiOpenDevRegKey() failed\n");
766  return;
767  }
768 
769  for (i = 0; i < ParamArray->dwCount; i++)
770  {
771  Param = &ParamArray->Array[i];
772 
773  if (Param == ParamArray->pCurrentParam)
774  {
775  ReadParameterValue(hwnd, Param);
776  }
777 
778  if (Param->bPresent)
779  {
780  TRACE("Set '%S' --> '%S'\n", Param->pszName, Param->pszValue);
781  RegSetValueExW(hDriverKey,
782  Param->pszName,
783  0,
784  REG_SZ,
785  (LPBYTE)Param->pszValue,
786  (wcslen(Param->pszValue) + 1) * sizeof(WCHAR));
787  }
788  else
789  {
790  TRACE("Delete '%S'\n", Param->pszName);
791  RegDeleteValueW(hDriverKey,
792  Param->pszName);
793  }
794  }
795 
796  RegCloseKey(hDriverKey);
797 
798  /* Notify the installer of changes to the properties */
799  InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
800  if (SetupDiGetDeviceInstallParamsW(ParamArray->DeviceInfoSet,
801  ParamArray->DeviceInfoData,
802  &InstallParams))
803  {
804  InstallParams.FlagsEx |= DI_FLAGSEX_PROPCHANGE_PENDING;
805 
806  SetupDiSetDeviceInstallParamsW(ParamArray->DeviceInfoSet,
807  ParamArray->DeviceInfoData,
808  &InstallParams);
809  }
810 }
PWSTR pszName
Definition: propertypage.c:29
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4554
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
int32_t INT
Definition: typedefs.h:58
unsigned char * LPBYTE
Definition: typedefs.h:53
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4447
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4899
#define TRACE(s)
Definition: solgame.cpp:4
static VOID ReadParameterValue(HWND hwnd, PPARAMETER pParam)
Definition: propertypage.c:693
BOOL bPresent
Definition: propertypage.c:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
Definition: devinst.c:5930
#define ERR(fmt,...)
Definition: debug.h:110
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
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
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2355
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
struct _SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS_W
#define DIREG_DRV
Definition: setupapi.h:182
PWSTR pszValue
Definition: propertypage.c:31
#define DI_FLAGSEX_PROPCHANGE_PENDING
Definition: setupapi.h:86
#define RegCloseKey(hKey)
Definition: registry.h:40
#define REG_SZ
Definition: layer.c:22

Referenced by OnNotify().