d = (k4_ids_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
if (HIWORD(wParam) == BN_CLICKED) {
k4_ids_check_mod(hwnd, d);
}
d = (k4_ids_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
if (HIWORD(wParam) == WMCFG_APPLY) {
k4_ids_write_params(hwnd, d);
}
d = (k4_ids_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
- PFREE(d);
+ if (d) {
+ PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) 0);
+ }
+
break;
}
d = (k4_id_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
if (wParam == MAKEWPARAM(IDC_CFG_GETTIX,
BN_CLICKED)) {
int gettix = 0;
d = (k4_id_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
- if (!d)
+ if (d == NULL)
break;
if (HIWORD(wParam) == WMCFG_APPLY) {
d = (k4_id_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
- if (!d)
+ if (d == NULL)
break;
PFREE(d);
+
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
break;
}
if (d) {
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) 0);
}
break;
d = (k4_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
k4_update_data(d);
if (LOWORD(wParam) == IDC_NCK4_OBTAIN) {
{
d = (k4_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+
+ if (d == NULL)
+ break;
+
k4_handle_wmnc_notify(d, wParam, lParam);
}
break;
d = (k4_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
d->nct->aux = 0;
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
break;
}
case WM_COMMAND:
d = (k5_ccc_dlg_data *) (DWORD_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+
+ if (d == NULL)
+ break;
+
switch(wParam) {
case MAKEWPARAM(IDC_CFG_ADD, BN_CLICKED):
{
d = (k5_ccc_dlg_data *) (DWORD_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
k5_free_file_ccs(&d->work);
k5_free_file_ccs(&d->save);
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
return TRUE;
case KHUI_WM_CFG_NOTIFY:
d = (k5_ccc_dlg_data *) (DWORD_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
switch(HIWORD(wParam)) {
case WMCFG_APPLY:
if (k5_ccc_get_mod(d)) {
d = (k5_id_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
if (HIWORD(wParam) == EN_CHANGE ||
HIWORD(wParam) == BN_CLICKED)
k5_id_check_mod(hwnd, d);
d = (k5_id_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
if (HIWORD(wParam) == WMCFG_APPLY) {
k5_id_write_params(hwnd, d);
}
d = (k5_id_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
khui_tracker_kill_controls(&d->tc_life);
khui_tracker_kill_controls(&d->tc_renew);
kcdb_identity_release(d->ident);
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
break;
}
return FALSE;
d = (k5_ids_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
if (HIWORD(wParam) == EN_CHANGE) {
k5_ids_check_mod(d);
} else if (HIWORD(wParam) == BN_CLICKED) {
case KHUI_WM_CFG_NOTIFY:
d = (k5_ids_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+
+ if (d == NULL)
+ break;
+
if (HIWORD(wParam) == WMCFG_APPLY) {
k5_ids_write_params(d);
}
d = (k5_ids_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
+
khui_tracker_kill_controls(&d->tc_life);
khui_tracker_kill_controls(&d->tc_renew);
khui_tracker_kill_controls(&d->tc_life_min);
khui_tracker_kill_controls(&d->tc_renew_max);
PFREE(d);
+
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
+
break;
}
return FALSE;
}
+
}
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
return TRUE;
}
d = (k5_dlg_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return TRUE;
+
if (d->nc->subtype == KMSG_CRED_NEW_CREDS) {
khui_tracker_reposition(&d->tc_lifetime);
khui_tracker_reposition(&d->tc_renew);
d = (k5_dlg_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return TRUE;
+
if (d->nc->subtype == KMSG_CRED_PASSWORD)
return TRUE;
d = (k5_dlg_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+
+ if (d == NULL)
+ return TRUE;
+
nc = d->nc;
l = (khui_htwnd_link *) lParam;
d = (k5_dlg_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return TRUE;
+
nc = d->nc;
khui_cw_find_type(nc, credtype_id_krb5, &nct);
d = (k5_dlg_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
kmq_post_sub_msg(k5_sub, KMSG_CRED,
KMSG_CRED_DIALOG_NEW_IDENTITY,
d = (k5_dlg_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
if(!d->sync && d->nc->result == KHUI_NC_RESULT_PROCESS) {
kmq_post_sub_msg(k5_sub, KMSG_CRED,
d = (k5_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
msg = (wchar_t *) lParam;
pnmh->code == IPN_FIELDCHANGED) {
d = (k5_dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return 0;
SendDlgItemMessage(hwnd, IDC_NCK5_PUBLICIP,
IPM_GETADDRESS,
k5_dlg_data * d;
d = (k5_dlg_data *)(LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
cid = LOWORD(wParam);
notif = HIWORD(wParam);
case KHUI_WM_CFG_NOTIFY:
d = (config_id_dlg_data *)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
if (HIWORD(wParam) == WMCFG_APPLY) {
/* TODO: apply changes */
/* TODO: perform any other required uninitialization */
free(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
}
break;
case KHUI_WM_CFG_NOTIFY:
d = (config_ids_dlg_data *)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
if (HIWORD(wParam) == WMCFG_APPLY) {
/* TODO: apply changes */
/* TODO: Perform any additional uninitialization */
free (d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
break;
}
{
d = (config_main_dlg_data *)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
/* WMCFG_APPLY is the only notification we care about */
/* TODO: perform any other required uninitialization here */
- if (d)
+ if (d) {
free(d);
+ SetWindowLongPtr(hwnd, DWLP_USER);
+ }
break;
}
struct nc_dialog_data * d;
d = (struct nc_dialog_data *) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
/* TODO: handle WM_COMMAND */
return FALSE;
d->nct = NULL;
free(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
/* TODO: Perform any additional uninitialization */
case WM_COMMAND:
d = (dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (wParam == MAKEWPARAM(IDC_CFG_FONTS, CBN_SELCHANGE)) {
LRESULT idx;
DeleteObject(d->c_font_normal);
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
return TRUE;
case KHUI_WM_CFG_NOTIFY:
d = (dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (HIWORD(wParam) == WMCFG_APPLY) {
write_params(d);
d = (dlg_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
if (d) {
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
}
return TRUE;
case WM_COMMAND:
d = (dlg_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (HIWORD(wParam) == BN_CLICKED) {
if (LOWORD(wParam) == IDC_CFG_SHOWLOG) {
case KHUI_WM_CFG_NOTIFY:
d = (dlg_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (HIWORD(wParam) == WMCFG_APPLY) {
write_params(d);
HWND hw;
node = get_window_node(hwnd);
+ if (node == NULL)
+ return TRUE;
if (HIWORD(wParam) == WMCFG_APPLY) {
lpnm = (LPNMHDR) lParam;
node = get_window_node(hwnd);
+ if (node == NULL)
+ return FALSE;
if (lpnm->idFrom == IDC_CFG_TAB) {
switch(lpnm->code) {
khui_cw_destroy_cred_blob(d->nc);
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
break;
case KHUI_WM_NC_NOTIFY:
d = (add_ident_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
switch(HIWORD(wParam)) {
case WMNC_ADD_CONTROL_ROW:
case WM_COMMAND: {
d = (notif_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (HIWORD(wParam) == BN_CLICKED) {
refresh_data(hwnd, d);
case WM_TIMER: {
d = (notif_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
+
KillTimer(hwnd, 1);
check_for_modification(d);
case WM_DESTROY: {
d = (notif_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
khui_tracker_kill_controls(&d->tc_renew);
khui_tracker_kill_controls(&d->tc_warn1);
case KHUI_WM_CFG_NOTIFY: {
d = (notif_data *) (DWORD_PTR) GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (HIWORD(wParam) == WMCFG_APPLY) {
write_params(d);
d = (plugin_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
if (wParam == IDC_CFG_PLUGINS &&
(lpnm = (LPNMHDR) lParam) &&
d = (plugin_dlg_data *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ return FALSE;
switch (wParam) {
case MAKEWPARAM(IDC_CFG_ENABLE, BN_CLICKED):
#ifdef DEBUG
assert(d);
#endif
+ if (d == NULL)
+ return TRUE;
+
for (i=0; i<d->n_info; i++) {
#ifdef DEBUG
assert(d->info[i]);
}
PFREE(d);
+ SetWindowLongPtr(hwnd, DWLP_USER, 0);
khm_set_dialog_result(hwnd, 0);
}
HICON hicon;
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ return;
/* create and fill the image list for the treeview */
HWND hwtv;
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ return;
hwtv = GetDlgItem(hwnd, IDC_CFG_NODELIST);
HWND hwtv;
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ return;
+
hwtv = GetDlgItem(hwnd, IDC_CFG_NODELIST);
hItem = (HTREEITEM) khui_cfg_get_param(node);
int idx;
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ return;
+
hwtv = GetDlgItem(hwnd, IDC_CFG_NODELIST);
hItem = (HTREEITEM) khui_cfg_get_param(node);
case WM_CTLCOLORSTATIC:
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ break;
+
return (BOOL)(DWORD_PTR) d->hbr_white;
case WM_ERASEBKGND:
RECT r_fill;
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ break;
GetClientRect(hwnd, &r_client);
SetRectEmpty(&r_logo);
cfgui_uninitialize_dialog(hwnd);
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ break;
+
khui_delete_bitmap(&d->kbmp_logo);
DeleteObject(d->hbr_white);
case WM_CTLCOLORSTATIC:
{
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ break;
+
return (BOOL)(DWORD_PTR) d->hbr_white;
}
/* implicit break */
case WMCFG_SYNC_NODE_LIST:
d = cfgui_get_wnd_data(hwnd);
+ if (d == NULL)
+ break;
+
cfgui_sync_node_list(d, hwnd);
break;
}
KillTimer(hwnd, idEvent);
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
- r = (khui_credwnd_row *) idEvent;
- r->flags &= ~KHUI_CW_ROW_TIMERSET;
+ if (tbl == NULL)
+ return;
+ r = (khui_credwnd_row *) idEvent;
nr = (int)(r - tbl->rows);
if(nr < 0 || nr >= tbl->n_rows)
return;
+ r->flags &= ~KHUI_CW_ROW_TIMERSET;
+
if(r->flags & KHUI_CW_ROW_CRED) {
nflags = cw_get_buf_exp_flags(tbl, (khm_handle) r->data);
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
- cw_save_view(tbl, NULL);
+ if (tbl) {
+ cw_save_view(tbl, NULL);
- cw_unload_view(tbl);
+ cw_unload_view(tbl);
- PFREE(tbl);
+ PFREE(tbl);
+ SetWindowLongPtr(hwnd, 0, 0);
+ }
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
BOOL has_dc = FALSE;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ goto _exit;
if (wParam != 0) {
/* we assume that if wParam != 0, then that contains a device
khui_credwnd_tbl * tbl;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl) {
+ cw_update_extents(tbl, TRUE);
- cw_update_extents(tbl, TRUE);
-
- GetClientRect(hwnd, &rect);
+ GetClientRect(hwnd, &rect);
- if(tbl->hwnd_notif) {
- SetWindowPos(
- tbl->hwnd_notif,
- tbl->hwnd_header,
- rect.left,
- tbl->header_height,
- rect.right - rect.left,
- tbl->cell_height * 4,
- 0);
+ if(tbl->hwnd_notif) {
+ SetWindowPos(tbl->hwnd_notif,
+ tbl->hwnd_header,
+ rect.left,
+ tbl->header_height,
+ rect.right - rect.left,
+ tbl->cell_height * 4,
+ 0);
+ }
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
khui_credwnd_tbl * tbl;
LPNMHDR pnmh;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
+
pnmh = (LPNMHDR) lParam;
if(pnmh->hwndFrom == tbl->hwnd_header) {
LPNMHEADER ph;
kmq_wm_begin(lParam, &m);
+ if (tbl == NULL)
+ goto _skip_message;
+
if(m->type == KMSG_CRED) {
switch (m->subtype) {
case KMSG_CRED_ROOTDELTA:
;
}
+ _skip_message:
+
return kmq_wm_end(m, rv);
}
int nm_state,nm_row,nm_col;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
/* we are basically trying to capture events where the mouse is
hovering over one of the 'hotspots'. There are two kinds of
int newpos;
tbl = (khui_credwnd_tbl *) (LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
+
GetClientRect(hwnd, &cr);
dx = tbl->scr_left;
RECT cr;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
GetClientRect(hwnd, &cr);
cr.top += tbl->header_height;
case WM_COMMAND:
s = (khui_property_sheet *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (s == NULL)
+ return 0;
switch(wParam) {
case MAKEWPARAM(IDC_PP_IDDEF, BN_CLICKED):
lpp = (LPPSHNOTIFY) lParam;
s = (khui_property_sheet *) (LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (s == NULL)
+ return 0;
switch(lpp->hdr.code) {
case PSN_APPLY:
khui_context_get(&ctx);
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
if(ctx.scope == KHUI_SCOPE_NONE) {
khui_context_release(&ctx);
khui_credwnd_tbl * tbl;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
if(HIWORD(wParam) == BN_CLICKED &&
LOWORD(wParam) == KHUI_HTWND_CTLID) {
khui_credwnd_tbl * tbl;
tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (tbl == NULL)
+ return 0;
GetWindowRect(hwnd, &r);
int ext_height = 0;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ return 0;
if(!GetUpdateRect(hwnd, &r, !(d->flags & KHUI_HTWND_TRANSPARENT)))
return 0;
BOOL rv;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ return 0;
+
newtext = (wchar_t *) lParam;
if(d->text) {
int i;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
- if(d->text)
- PFREE(d->text);
- d->text = 0;
-
- if(d->links) {
- for(i=0;i<d->max_links;i++) {
- if(d->links[i])
- PFREE(d->links[i]);
+ if (d) {
+ if(d->text)
+ PFREE(d->text);
+ d->text = 0;
+
+ if(d->links) {
+ for(i=0;i<d->max_links;i++) {
+ if(d->links[i])
+ PFREE(d->links[i]);
+ }
+ PFREE(d->links);
}
- PFREE(d->links);
- }
- clear_styles(d);
+ clear_styles(d);
- PFREE(d);
+ PFREE(d);
+ SetWindowLongPtr(hwnd, 0, 0);
+ }
}
break;
RECT r;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ return FALSE;
GetClientRect(hwnd, &r);
hbr = GetSysColorBrush(COLOR_WINDOW);
break;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
if(d->active_link >= 0) {
SetCursor(d->hc_hand);
khui_htwnd_data * d;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
d->flags |= KHUI_HTWND_FOCUS;
khui_htwnd_data * d;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
d->flags &= ~KHUI_HTWND_FOCUS;
khui_htwnd_data * d;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
d->md_link = d->active_link;
khui_htwnd_data * d;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
if(d->md_link == d->active_link && d->md_link >= 0) {
/* clicked */
RECT r;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
old_pos = new_pos = d->scroll_left;
ext = d->ext_width;
int nl;
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (d == NULL)
+ break;
+
p.x = GET_X_LPARAM(lParam) + d->scroll_left;
p.y = GET_Y_LPARAM(lParam) + d->scroll_top;
khui_nc_wnd_data * d;
d = (khui_nc_wnd_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, DWLP_USER);
+ if (d == NULL)
+ break;
/* message sent by parent to notify us of something */
switch(HIWORD(wParam)) {
khm_del_dialog(hwnd);
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return TRUE;
d->nc->ident_cb(d->nc, WMNC_IDENT_EXIT, NULL, 0, 0, 0);
d->dlg_main = NULL;
PFREE(d);
+ SetWindowLongPtr(hwnd, CW_PARAM, 0);
return TRUE;
}
khui_nc_wnd_data * d;
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return 0;
switch(HIWORD(wParam)) {
case BN_CLICKED:
khui_nc_wnd_data * d;
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return FALSE;
nc_notify_types(d->nc, KHUI_WM_NC_NOTIFY,
MAKEWPARAM(0, WMNC_DIALOG_MOVE), (LPARAM) d->nc, TRUE);
int id;
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return FALSE;
switch(HIWORD(wParam)) {
khui_nc_wnd_data * d;
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return FALSE;
if (wParam == NC_TIMER_SIZER) {
khui_nc_wnd_data * d;
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return FALSE;
+
nmhdr = (LPNMHDR) lParam;
if (nmhdr->code == TCN_SELCHANGE) {
khui_nc_wnd_data * d;
d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);
+ if (d == NULL)
+ return FALSE;
hlp = (HELPINFO *) lParam;
d = (alerter_wnd_data *)(LONG_PTR)
GetWindowLongPtr(hwnd, NTF_PARAM);
- destroy_alerter_wnd_data(d);
+ if (d) {
+ destroy_alerter_wnd_data(d);
+ SetWindowLongPtr(hwnd, NTF_PARAM, 0);
+ }
return TRUE;
}
#ifdef DEBUG
assert(d);
#endif
+ if (d == NULL)
+ break;
if (in_printclient) {
hdc = (HDC) wParam;
case WM_DESTROY:
{
/* nothing needs to be done here */
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
}
return 0;
}
case PW_WM_SET_RECORD:
{
child = (pw_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
+ if (child == NULL)
+ break;
+
kcdb_buf_release(child->record);
child->record = (khm_handle) lParam;
kcdb_buf_hold(child->record);
case WM_DESTROY:
{
child = (pw_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);
- kcdb_buf_release(child->record);
- PFREE(child);
+ if (child) {
+ kcdb_buf_release(child->record);
+ PFREE(child);
+ SetWindowLongPtr(hwnd, 0, 0);
+ }
}
break;
if (d) {
PFREE(d);
+ SetWindowLongPtr(hwnd_dlg, DWLP_USER, 0);
}
return (d)?KHM_ERROR_SUCCESS: KHM_ERROR_NOT_FOUND;