ReactOS  0.4.14-dev-854-gb9426a3
security.c File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <prsht.h>
#include "commctrl.h"
#include "ole2.h"
#include "urlmon.h"
#include "initguid.h"
#include "winreg.h"
#include "shlwapi.h"
#include "inetcpl.h"
#include "wine/debug.h"
#include "wine/heap.h"
Include dependency graph for security.c:

Go to the source code of this file.

Classes

struct  secdlg_data_s
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define NUM_TRACKBAR_POS   5
 

Typedefs

typedef struct secdlg_data_s secdlg_data
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (inetcpl)
 
static DWORD index_from_urltemplate (URLTEMPLATE value)
 
static void update_security_level (secdlg_data *sd, DWORD lv_index, DWORD tb_index)
 
static void update_zone_info (secdlg_data *sd, DWORD lv_index)
 
static void add_zone_to_listview (secdlg_data *sd, DWORD *pindex, DWORD zone)
 
static void security_cleanup_zones (secdlg_data *sd)
 
static HRESULT security_enum_zones (secdlg_data *sd)
 
static INT_PTR security_on_destroy (secdlg_data *sd)
 
static INT_PTR security_on_initdialog (HWND hsec)
 
static INT_PTR security_on_notify (secdlg_data *sd, WPARAM wparam, LPARAM lparam)
 
INT_PTR CALLBACK security_dlgproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 

Variables

static DWORD url_templates []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file security.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 23 of file security.c.

◆ NUM_TRACKBAR_POS

#define NUM_TRACKBAR_POS   5

Definition at line 60 of file security.c.

Typedef Documentation

◆ secdlg_data

Function Documentation

◆ add_zone_to_listview()

static void add_zone_to_listview ( secdlg_data sd,
DWORD pindex,
DWORD  zone 
)
static

Definition at line 151 of file security.c.

152 {
153  DWORD lv_index = *pindex;
154  ZONEATTRIBUTES *za = &sd->zone_attr[lv_index];
155  LVITEMW lvitem;
156  HRESULT hr;
157  INT iconid = 0;
158  HMODULE hdll = NULL;
159  WCHAR * ptr;
160  HICON icon;
161 
162  TRACE("item %d (zone %d)\n", lv_index, zone);
163 
164  sd->zones[lv_index] = zone;
165 
166  memset(&lvitem, 0, sizeof(LVITEMW));
167  memset(za, 0, sizeof(ZONEATTRIBUTES));
168  za->cbSize = sizeof(ZONEATTRIBUTES);
169  hr = IInternetZoneManager_GetZoneAttributes(sd->zone_mgr, zone, za);
170  if (SUCCEEDED(hr)) {
171  TRACE("displayname: %s\n", debugstr_w(za->szDisplayName));
172  TRACE("description: %s\n", debugstr_w(za->szDescription));
173  TRACE("minlevel: 0x%x, recommended: 0x%x, current: 0x%x (flags: 0x%x)\n", za->dwTemplateMinLevel,
174  za->dwTemplateRecommended, za->dwTemplateCurrentLevel, za->dwFlags);
175 
176  if (za->dwFlags & ZAFLAGS_NO_UI ) {
177  TRACE("item %d (zone %d): UI disabled for %s\n", lv_index, zone, debugstr_w(za->szDisplayName));
178  return;
179  }
180 
181  sd->levels[lv_index] = za->dwTemplateCurrentLevel;
182 
183  lvitem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
184  lvitem.iItem = lv_index;
185  lvitem.iSubItem = 0;
186  lvitem.pszText = za->szDisplayName;
187  lvitem.lParam = (LPARAM) zone;
188 
189  /* format is "filename.ext#iconid" */
190  ptr = StrChrW(za->szIconPath, '#');
191  if (ptr) {
192  *ptr = 0;
193  ptr++;
194  iconid = StrToIntW(ptr);
195  hdll = LoadLibraryExW(za->szIconPath, NULL, LOAD_LIBRARY_AS_DATAFILE);
196  TRACE("%p: icon #%d from %s\n", hdll, iconid, debugstr_w(za->szIconPath));
197 
200 
201  if (!icon) {
202  FIXME("item %d (zone %d): missing icon #%d in %s\n", lv_index, zone, iconid, debugstr_w(za->szIconPath));
203  }
204 
205  /* the failure result (NULL) from LoadImageW let ImageList_AddIcon fail
206  with -1, which is reused in ListView_InsertItemW to disable the image */
207  lvitem.iImage = ImageList_AddIcon(sd->himages, icon);
208  }
209  else
210  FIXME("item %d (zone %d): malformed szIconPath %s\n", lv_index, zone, debugstr_w(za->szIconPath));
211 
212  if (ListView_InsertItemW(sd->hlv, &lvitem) >= 0) {
213  /* activate first item in the listview */
214  if (! lv_index) {
215  lvitem.state = LVIS_FOCUSED | LVIS_SELECTED;
217  SendMessageW(sd->hlv, LVM_SETITEMSTATE, 0, (LPARAM) &lvitem);
218  sd->last_level = ~0;
219  update_zone_info(sd, lv_index);
220  }
221  (*pindex)++;
222  }
223  FreeLibrary(hdll);
224  }
225  else
226  FIXME("item %d (zone %d): GetZoneAttributes failed with 0x%x\n", lv_index, zone, hr);
227 }
static HICON
Definition: imagelist.c:84
int iImage
Definition: commctrl.h:2363
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
HRESULT hr
Definition: shlfolder.c:183
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
int32_t INT
Definition: typedefs.h:56
UINT stateMask
Definition: commctrl.h:2360
#define LVIF_TEXT
Definition: commctrl.h:2305
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
int iSubItem
Definition: commctrl.h:2358
#define debugstr_w
Definition: kernel32.h:32
LPARAM lParam
Definition: commctrl.h:2364
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
#define SM_CXICON
Definition: winuser.h:962
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2315
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:413
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
LPWSTR pszText
Definition: commctrl.h:2361
#define LVIF_IMAGE
Definition: commctrl.h:2306
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
UINT mask
Definition: commctrl.h:2356
static const WCHAR sd[]
Definition: suminfo.c:287
#define SM_CYICON
Definition: winuser.h:963
#define LVM_SETITEMSTATE
Definition: commctrl.h:2668
UINT state
Definition: commctrl.h:2359
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
DWORD zone
Definition: sec_mgr.c:1760
static void update_zone_info(secdlg_data *sd, DWORD lv_index)
Definition: security.c:129
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
static PVOID hdll
Definition: shimdbg.c:126
INT WINAPI StrToIntW(LPCWSTR lpString)
Definition: string.c:411
#define LVIF_PARAM
Definition: commctrl.h:2307
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define memset(x, y, z)
Definition: compat.h:39
#define ListView_InsertItemW(hwnd, pitem)
Definition: commctrl.h:38
#define LVIS_FOCUSED
Definition: commctrl.h:2314
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by security_on_initdialog().

◆ index_from_urltemplate()

static DWORD index_from_urltemplate ( URLTEMPLATE  value)
static

Definition at line 73 of file security.c.

74 {
75 
77 
78  while((index > 0) && (url_templates[index-1] != value))
79  index--;
80 
81  index--; /* table entries are 0 based */
82  if (!index && value)
83  FIXME("URLTEMPLATE 0x%x not supported\n", value);
84 
85  TRACE("URLTEMPLATE 0x%08x=> Level %d\n", value, index);
86  return index;
87 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
static DWORD url_templates[]
Definition: security.c:62
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by update_security_level().

◆ security_cleanup_zones()

static void security_cleanup_zones ( secdlg_data sd)
static

Definition at line 233 of file security.c.

234 {
235  if (sd->zone_enumerator) {
236  IInternetZoneManager_DestroyZoneEnumerator(sd->zone_mgr, sd->zone_enumerator);
237  }
238 
239  if (sd->zone_mgr) {
240  IInternetZoneManager_Release(sd->zone_mgr);
241  }
242 
243  if (sd->sec_mgr) {
244  IInternetSecurityManager_Release(sd->sec_mgr);
245  }
246 }
static const WCHAR sd[]
Definition: suminfo.c:287

Referenced by security_on_destroy().

◆ security_dlgproc()

INT_PTR CALLBACK security_dlgproc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 410 of file security.c.

411 {
412  secdlg_data *sd;
413 
414  if (msg == WM_INITDIALOG) {
416  }
417 
419  if (sd) {
420  switch (msg)
421  {
422  case WM_NOTIFY:
424 
425  case WM_NCDESTROY:
426  return security_on_destroy(sd);
427 
428  default:
429  /* do not flood the log */
430  if ((msg == WM_SETCURSOR) || (msg == WM_NCHITTEST) ||
432  return FALSE;
433 
434  TRACE("(%p, 0x%08x/%03d, 0x%08lx, 0x%08lx)\n", hwnd, msg, msg, wparam, lparam);
435  }
436  }
437  return FALSE;
438 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static INT_PTR security_on_destroy(secdlg_data *sd)
Definition: security.c:272
#define WM_NCHITTEST
Definition: winuser.h:1668
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define WM_PARENTNOTIFY
Definition: winuser.h:1785
#define WM_SETCURSOR
Definition: winuser.h:1618
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_MOUSEACTIVATE
Definition: winuser.h:1619
static INT_PTR security_on_notify(secdlg_data *sd, WPARAM wparam, LPARAM lparam)
Definition: security.c:378
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_NCDESTROY
Definition: winuser.h:1666
static const WCHAR sd[]
Definition: suminfo.c:287
#define DWLP_USER
Definition: winuser.h:866
static INT_PTR security_on_initdialog(HWND hsec)
Definition: security.c:295
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define msg(x)
Definition: auth_time.c:54
#define WM_INITDIALOG
Definition: winuser.h:1721
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by display_cpl_sheets().

◆ security_enum_zones()

static HRESULT security_enum_zones ( secdlg_data sd)
static

Definition at line 252 of file security.c.

253 {
254  HRESULT hr;
255 
256  hr = CoInternetCreateSecurityManager(NULL, &sd->sec_mgr, 0);
257  if (SUCCEEDED(hr)) {
258  hr = CoInternetCreateZoneManager(NULL, &sd->zone_mgr, 0);
259  if (SUCCEEDED(hr)) {
260  hr = IInternetZoneManager_CreateZoneEnumerator(sd->zone_mgr, &sd->zone_enumerator, &sd->num_zones, 0);
261  }
262  }
263  return hr;
264 }
HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider *pSP, IInternetZoneManager **ppZM, DWORD dwReserved)
Definition: sec_mgr.c:1855
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR sd[]
Definition: suminfo.c:287
HRESULT WINAPI CoInternetCreateSecurityManager(IServiceProvider *pSP, IInternetSecurityManager **ppSM, DWORD dwReserved)
Definition: sec_mgr.c:1841
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by security_on_initdialog().

◆ security_on_destroy()

static INT_PTR security_on_destroy ( secdlg_data sd)
static

Definition at line 272 of file security.c.

273 {
274  TRACE("(%p)\n", sd);
275 
276  heap_free(sd->zone_attr);
277  heap_free(sd->zones);
278  if (sd->himages) {
280  ImageList_Destroy(sd->himages);
281  }
282 
284  SetWindowLongPtrW(sd->hsec, DWLP_USER, 0);
285  heap_free(sd);
286  return TRUE;
287 }
#define TRUE
Definition: types.h:120
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define TRACE(s)
Definition: solgame.cpp:4
static void security_cleanup_zones(secdlg_data *sd)
Definition: security.c:233
static const WCHAR sd[]
Definition: suminfo.c:287
#define DWLP_USER
Definition: winuser.h:866
#define LVSIL_NORMAL
Definition: commctrl.h:2294
#define LVM_SETIMAGELIST
Definition: commctrl.h:2299
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SetWindowLongPtrW
Definition: winuser.h:5321
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by security_dlgproc(), and security_on_initdialog().

◆ security_on_initdialog()

static INT_PTR security_on_initdialog ( HWND  hsec)
static

Definition at line 295 of file security.c.

296 {
297  secdlg_data *sd;
298  HRESULT hr;
299  DWORD current_zone;
300  DWORD lv_index = 0;
301  DWORD i;
302 
303  sd = heap_alloc_zero(sizeof(secdlg_data));
305  if (!sd) {
306  return FALSE;
307  }
308 
309  sd->hsec = hsec;
310  sd->hlv = GetDlgItem(hsec, IDC_SEC_LISTVIEW);
311  sd->htb = GetDlgItem(hsec, IDC_SEC_TRACKBAR);
312 
313  EnableWindow(sd->htb, FALSE); /* not changeable yet */
314 
315  TRACE("(%p) (data: %p, listview: %p, trackbar: %p)\n", hsec, sd, sd->hlv, sd->htb);
316 
318  SendMessageW(sd->htb, TBM_SETTICFREQ, 1, 0 );
319 
320  /* Create the image lists for the listview */
322 
323  TRACE("using imagelist: %p\n", sd->himages);
324  if (!sd->himages) {
325  ERR("ImageList_Create failed!\n");
326  return FALSE;
327  }
329 
331  if (FAILED(hr)) {
332  ERR("got 0x%x\n", hr);
334  return FALSE;
335  }
336 
337  TRACE("found %d zones\n", sd->num_zones);
338 
339  /* remember ZONEATTRIBUTES for a listview entry */
340  sd->zone_attr = heap_alloc(sizeof(ZONEATTRIBUTES) * sd->num_zones);
341  if (!sd->zone_attr) {
343  return FALSE;
344  }
345 
346  /* remember zone number and current security level for a listview entry */
347  sd->zones = heap_alloc((sizeof(DWORD) + sizeof(DWORD)) * sd->num_zones);
348  if (!sd->zones) {
350  return FALSE;
351  }
352  sd->levels = &sd->zones[sd->num_zones];
353 
354  /* use the same order as visible with native inetcpl.cpl */
355  add_zone_to_listview(sd, &lv_index, URLZONE_INTERNET);
356  add_zone_to_listview(sd, &lv_index, URLZONE_INTRANET);
357  add_zone_to_listview(sd, &lv_index, URLZONE_TRUSTED);
358  add_zone_to_listview(sd, &lv_index, URLZONE_UNTRUSTED);
359 
360  for (i = 0; i < sd->num_zones; i++)
361  {
362  hr = IInternetZoneManager_GetZoneAt(sd->zone_mgr, sd->zone_enumerator, i, &current_zone);
363  if (SUCCEEDED(hr) && (current_zone != (DWORD)URLZONE_INVALID)) {
364  if (!current_zone || (current_zone > URLZONE_UNTRUSTED)) {
365  add_zone_to_listview(sd, &lv_index, current_zone);
366  }
367  }
368  }
369  return TRUE;
370 }
static INT_PTR security_on_destroy(secdlg_data *sd)
Definition: security.c:272
#define TRUE
Definition: types.h:120
static void add_zone_to_listview(secdlg_data *sd, DWORD *pindex, DWORD zone)
Definition: security.c:151
HRESULT hr
Definition: shlfolder.c:183
#define TBM_SETRANGE
Definition: commctrl.h:2033
#define IDC_SEC_TRACKBAR
Definition: inetcpl.h:87
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define ILC_COLOR32
Definition: commctrl.h:354
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
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define SM_CXICON
Definition: winuser.h:962
#define MAKELONG(a, b)
Definition: typedefs.h:248
LONG_PTR LPARAM
Definition: windef.h:208
#define TBM_SETTICFREQ
Definition: commctrl.h:2046
#define NUM_TRACKBAR_POS
Definition: security.c:60
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static HRESULT security_enum_zones(secdlg_data *sd)
Definition: security.c:252
LONG HRESULT
Definition: typedefs.h:77
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR sd[]
Definition: suminfo.c:287
#define SM_CYICON
Definition: winuser.h:963
#define DWLP_USER
Definition: winuser.h:866
#define ILC_MASK
Definition: commctrl.h:347
#define LVSIL_NORMAL
Definition: commctrl.h:2294
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ERR(fmt,...)
Definition: debug.h:109
#define LVM_SETIMAGELIST
Definition: commctrl.h:2299
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDC_SEC_LISTVIEW
Definition: inetcpl.h:84
#define SetWindowLongPtrW
Definition: winuser.h:5321
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by security_dlgproc().

◆ security_on_notify()

static INT_PTR security_on_notify ( secdlg_data sd,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 378 of file security.c.

379 {
380  NMLISTVIEW *nm;
381 
382  nm = (NMLISTVIEW *) lparam;
383  switch (nm->hdr.code)
384  {
385  case LVN_ITEMCHANGED:
386  TRACE("LVN_ITEMCHANGED (0x%lx, 0x%lx) from %p with code: %d (item: %d, uNewState: %u)\n",
387  wparam, lparam, nm->hdr.hwndFrom, nm->hdr.code, nm->iItem, nm->uNewState);
388  if ((nm->uNewState & LVIS_SELECTED) == LVIS_SELECTED) {
389  update_zone_info(sd, nm->iItem);
390  }
391  break;
392 
393  case PSN_APPLY:
394  TRACE("PSN_APPLY (0x%lx, 0x%lx) from %p with code: %d\n", wparam, lparam,
395  nm->hdr.hwndFrom, nm->hdr.code);
396  break;
397 
398  default:
399  TRACE("WM_NOTIFY (0x%lx, 0x%lx) from %p with code: %d\n", wparam, lparam,
400  nm->hdr.hwndFrom, nm->hdr.code);
401 
402  }
403  return FALSE;
404 }
UINT uNewState
Definition: commctrl.h:3032
#define LVN_ITEMCHANGED
Definition: commctrl.h:3127
#define PSN_APPLY
Definition: prsht.h:117
UINT code
Definition: winuser.h:3134
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define LVIS_SELECTED
Definition: commctrl.h:2315
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR sd[]
Definition: suminfo.c:287
HWND hwndFrom
Definition: winuser.h:3132
static void update_zone_info(secdlg_data *sd, DWORD lv_index)
Definition: security.c:129
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by security_dlgproc().

◆ update_security_level()

static void update_security_level ( secdlg_data sd,
DWORD  lv_index,
DWORD  tb_index 
)
static

Definition at line 93 of file security.c.

94 {
95  WCHAR name[512];
96  DWORD current_index;
97 
98  TRACE("(%p, lv_index: %u, tb_index: %u)\n", sd, lv_index, tb_index);
99 
100  if ((sd->levels[lv_index] != sd->last_level) || (tb_index > 0)) {
101  /* show or hide the trackbar */
102  if (!sd->levels[lv_index] || !sd->last_level)
103  ShowWindow(sd->htb, sd->levels[lv_index] ? SW_NORMAL : SW_HIDE);
104 
105  current_index = (tb_index > 0) ? tb_index : index_from_urltemplate(sd->levels[lv_index]);
106 
107  name[0] = 0;
108  LoadStringW(hcpl, IDS_SEC_LEVEL0 + current_index, name, ARRAY_SIZE(name));
109  TRACE("new level #%d: %s\n", current_index, debugstr_w(name));
111 
112  name[0] = 0;
113  LoadStringW(hcpl, IDS_SEC_LEVEL0_INFO + (current_index * 0x10), name, ARRAY_SIZE(name));
114  TRACE("new level info: %s\n", debugstr_w(name));
116 
117  if (current_index)
118  SendMessageW(sd->htb, TBM_SETPOS, TRUE, NUM_TRACKBAR_POS - current_index);
119 
120  sd->last_level = sd->levels[lv_index];
121 
122  }
123 }
#define SW_NORMAL
Definition: winuser.h:763
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define IDC_SEC_LEVEL
Definition: inetcpl.h:88
#define IDC_SEC_LEVEL_INFO
Definition: inetcpl.h:89
#define TBM_SETPOS
Definition: commctrl.h:2032
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define debugstr_w
Definition: kernel32.h:32
#define IDS_SEC_LEVEL0_INFO
Definition: inetcpl.h:58
#define NUM_TRACKBAR_POS
Definition: security.c:60
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR sd[]
Definition: suminfo.c:287
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: name.c:38
#define IDS_SEC_LEVEL0
Definition: inetcpl.h:52
static DWORD index_from_urltemplate(URLTEMPLATE value)
Definition: security.c:73
DECLSPEC_HIDDEN HMODULE hcpl
Definition: inetcpl.c:42

Referenced by update_zone_info().

◆ update_zone_info()

static void update_zone_info ( secdlg_data sd,
DWORD  lv_index 
)
static

Definition at line 129 of file security.c.

130 {
131  ZONEATTRIBUTES *za = &sd->zone_attr[lv_index];
133  DWORD len;
134 
135  SetWindowTextW(GetDlgItem(sd->hsec, IDC_SEC_ZONE_INFO), za->szDescription);
136 
138  lstrcpynW(&name[len], za->szDisplayName, ARRAY_SIZE(name) - len - 1);
139 
140  TRACE("new title: %s\n", debugstr_w(name));
142 
143  update_security_level(sd, lv_index, 0);
144  sd->last_lv_index = lv_index;
145 }
#define IDC_SEC_ZONE_INFO
Definition: inetcpl.h:85
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define lstrcpynW
Definition: compat.h:405
#define IDC_SEC_GROUP
Definition: inetcpl.h:86
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR sd[]
Definition: suminfo.c:287
#define IDS_SEC_SETTINGS
Definition: inetcpl.h:51
GLenum GLsizei len
Definition: glext.h:6722
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: name.c:38
static void update_security_level(secdlg_data *sd, DWORD lv_index, DWORD tb_index)
Definition: security.c:93
DECLSPEC_HIDDEN HMODULE hcpl
Definition: inetcpl.c:42

Referenced by add_zone_to_listview(), and security_on_notify().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inetcpl  )

Variable Documentation

◆ url_templates

DWORD url_templates[]
static
Initial value:
= {URLTEMPLATE_CUSTOM,
URLTEMPLATE_LOW,
URLTEMPLATE_MEDLOW,
URLTEMPLATE_MEDIUM,
URLTEMPLATE_MEDHIGH,
URLTEMPLATE_HIGH}

Definition at line 62 of file security.c.

Referenced by index_from_urltemplate().