mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Adopt C99 <stdbool.h>'s true/false.
This commit includes <stdbool.h> from defs.h and deletes my traditional definitions of TRUE and FALSE, but other than that, it's a 100% mechanical search-and-replace transforming all uses of TRUE and FALSE into the C99-standardised lowercase spellings. No actual types are changed in this commit; that will come next. This is just getting the noise out of the way, so that subsequent commits can have a higher proportion of signal.
This commit is contained in:
@ -20,7 +20,7 @@ static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg,
|
||||
|
||||
switch (nMsg) {
|
||||
case WM_ERASEBKGND:
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case WM_PAINT:
|
||||
{
|
||||
@ -80,7 +80,7 @@ static LRESULT CALLBACK SizeTipWndProc(HWND hWnd, UINT nMsg,
|
||||
|
||||
SetWindowPos(hWnd, NULL, 0, 0, sz.cx + 6, sz.cy + 6,
|
||||
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
|
||||
InvalidateRect(hWnd, NULL, FALSE);
|
||||
InvalidateRect(hWnd, NULL, false);
|
||||
|
||||
DeleteDC(hdc);
|
||||
}
|
||||
|
@ -11,12 +11,12 @@
|
||||
|
||||
int got_crypt(void)
|
||||
{
|
||||
static int attempted = FALSE;
|
||||
static int attempted = false;
|
||||
static int successful;
|
||||
static HMODULE crypt;
|
||||
|
||||
if (!attempted) {
|
||||
attempted = TRUE;
|
||||
attempted = true;
|
||||
crypt = load_system32_dll("crypt32.dll");
|
||||
successful = crypt &&
|
||||
#ifdef COVERITY
|
||||
|
@ -157,7 +157,7 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
|
||||
}
|
||||
}
|
||||
ctrl_filesel(s, "Custom sound file to play as a bell:", NO_SHORTCUT,
|
||||
FILTER_WAVE_FILES, FALSE, "Select bell sound file",
|
||||
FILTER_WAVE_FILES, false, "Select bell sound file",
|
||||
HELPCTX(bell_style),
|
||||
conf_filesel_handler, I(CONF_bell_wavefile));
|
||||
|
||||
@ -396,7 +396,7 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
|
||||
if (!midsession && backend_vt_from_proto(PROT_SSH)) {
|
||||
s = ctrl_getset(b, "Connection/SSH/X11", "x11", "X11 forwarding");
|
||||
ctrl_filesel(s, "X authority file for local display", 't',
|
||||
NULL, FALSE, "Select X authority file",
|
||||
NULL, false, "Select X authority file",
|
||||
HELPCTX(ssh_tunnels_xauthority),
|
||||
conf_filesel_handler, I(CONF_xauthfile));
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "storage.h"
|
||||
#include "ssh.h"
|
||||
|
||||
int console_batch_mode = FALSE;
|
||||
int console_batch_mode = false;
|
||||
|
||||
/*
|
||||
* Clean up and exit.
|
||||
|
@ -92,7 +92,7 @@ HWND doctl(struct ctlpos *cp, RECT r,
|
||||
ctl = CreateWindowEx(exstyle, wclass, wtext, wstyle,
|
||||
r.left, r.top, r.right, r.bottom,
|
||||
cp->hwnd, (HMENU)(ULONG_PTR)wid, hinst, NULL);
|
||||
SendMessage(ctl, WM_SETFONT, cp->font, MAKELPARAM(TRUE, 0));
|
||||
SendMessage(ctl, WM_SETFONT, cp->font, MAKELPARAM(true, 0));
|
||||
|
||||
if (!strcmp(wclass, "LISTBOX")) {
|
||||
/*
|
||||
@ -981,7 +981,7 @@ static void pl_moveitem(HWND hwnd, int listid, int src, int dst)
|
||||
SendDlgItemMessage (hwnd, listid, LB_GETTEXT, src, (LPARAM) txt);
|
||||
val = SendDlgItemMessage (hwnd, listid, LB_GETITEMDATA, src, 0);
|
||||
/* Deselect old location. */
|
||||
SendDlgItemMessage (hwnd, listid, LB_SETSEL, FALSE, src);
|
||||
SendDlgItemMessage (hwnd, listid, LB_SETSEL, false, src);
|
||||
/* Delete it at the old location. */
|
||||
SendDlgItemMessage (hwnd, listid, LB_DELETESTRING, src, 0);
|
||||
/* Insert it at new location. */
|
||||
@ -1014,14 +1014,14 @@ int pl_itemfrompt(HWND hwnd, POINT cursor, BOOL scroll)
|
||||
ret = p_LBItemFromPt(hwnd, cursor, scroll);
|
||||
if (ret == -1)
|
||||
return ret;
|
||||
ret = p_LBItemFromPt(hwnd, cursor, FALSE);
|
||||
ret = p_LBItemFromPt(hwnd, cursor, false);
|
||||
updist = downdist = 0;
|
||||
for (i = 1; i < 4096 && (!updist || !downdist); i++) {
|
||||
uppoint = downpoint = cursor;
|
||||
uppoint.y -= i;
|
||||
downpoint.y += i;
|
||||
upitem = p_LBItemFromPt(hwnd, uppoint, FALSE);
|
||||
downitem = p_LBItemFromPt(hwnd, downpoint, FALSE);
|
||||
upitem = p_LBItemFromPt(hwnd, uppoint, false);
|
||||
downitem = p_LBItemFromPt(hwnd, downpoint, false);
|
||||
if (!updist && upitem != ret)
|
||||
updist = i;
|
||||
if (!downdist && downitem != ret)
|
||||
@ -1036,7 +1036,7 @@ int pl_itemfrompt(HWND hwnd, POINT cursor, BOOL scroll)
|
||||
* Handler for prefslist above.
|
||||
*
|
||||
* Return value has bit 0 set if the dialog box procedure needs to
|
||||
* return TRUE from handling this message; it has bit 1 set if a
|
||||
* return true from handling this message; it has bit 1 set if a
|
||||
* change may have been made in the contents of the list.
|
||||
*/
|
||||
int handle_prefslist(struct prefslist *hdl,
|
||||
@ -1062,10 +1062,10 @@ int handle_prefslist(struct prefslist *hdl,
|
||||
SendDlgItemMessage(hwnd, hdl->listid,
|
||||
LB_ADDSTRING, 0, (LPARAM) "");
|
||||
|
||||
hdl->srcitem = p_LBItemFromPt(dlm->hWnd, dlm->ptCursor, TRUE);
|
||||
hdl->srcitem = p_LBItemFromPt(dlm->hWnd, dlm->ptCursor, true);
|
||||
hdl->dragging = 0;
|
||||
/* XXX hack Q183115 */
|
||||
SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE);
|
||||
SetWindowLongPtr(hwnd, DWLP_MSGRESULT, true);
|
||||
ret |= 1; break;
|
||||
case DL_CANCELDRAG:
|
||||
p_DrawInsert(hwnd, dlm->hWnd, -1); /* Clear arrow */
|
||||
@ -1075,7 +1075,7 @@ int handle_prefslist(struct prefslist *hdl,
|
||||
ret |= 1; break;
|
||||
case DL_DRAGGING:
|
||||
hdl->dragging = 1;
|
||||
dest = pl_itemfrompt(dlm->hWnd, dlm->ptCursor, TRUE);
|
||||
dest = pl_itemfrompt(dlm->hWnd, dlm->ptCursor, true);
|
||||
if (dest > hdl->dummyitem) dest = hdl->dummyitem;
|
||||
p_DrawInsert (hwnd, dlm->hWnd, dest);
|
||||
if (dest >= 0)
|
||||
@ -1085,7 +1085,7 @@ int handle_prefslist(struct prefslist *hdl,
|
||||
ret |= 1; break;
|
||||
case DL_DROPPED:
|
||||
if (hdl->dragging) {
|
||||
dest = pl_itemfrompt(dlm->hWnd, dlm->ptCursor, TRUE);
|
||||
dest = pl_itemfrompt(dlm->hWnd, dlm->ptCursor, true);
|
||||
if (dest > hdl->dummyitem) dest = hdl->dummyitem;
|
||||
p_DrawInsert (hwnd, dlm->hWnd, -1);
|
||||
}
|
||||
@ -1211,7 +1211,7 @@ void winctrl_add_shortcuts(struct dlgparam *dp, struct winctrl *c)
|
||||
if (c->shortcuts[i] != NO_SHORTCUT) {
|
||||
unsigned char s = tolower((unsigned char)c->shortcuts[i]);
|
||||
assert(!dp->shortcuts[s]);
|
||||
dp->shortcuts[s] = TRUE;
|
||||
dp->shortcuts[s] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1222,7 +1222,7 @@ void winctrl_rem_shortcuts(struct dlgparam *dp, struct winctrl *c)
|
||||
if (c->shortcuts[i] != NO_SHORTCUT) {
|
||||
unsigned char s = tolower((unsigned char)c->shortcuts[i]);
|
||||
assert(dp->shortcuts[s]);
|
||||
dp->shortcuts[s] = FALSE;
|
||||
dp->shortcuts[s] = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1780,7 +1780,7 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
||||
r.top + (r.bottom-r.top-s.cy)/2,
|
||||
(char *)c->data, strlen((char *)c->data));
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
ctrl = c->ctrl;
|
||||
@ -1797,7 +1797,7 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
||||
* subsequent code can test dp->coloursel_wanted().
|
||||
*/
|
||||
ret = 0;
|
||||
dp->coloursel_wanted = FALSE;
|
||||
dp->coloursel_wanted = false;
|
||||
|
||||
/*
|
||||
* Now switch on the control type and the message.
|
||||
@ -1933,7 +1933,7 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
||||
of.lpstrFileTitle = NULL;
|
||||
of.lpstrTitle = ctrl->fileselect.title;
|
||||
of.Flags = 0;
|
||||
if (request_file(NULL, &of, FALSE, ctrl->fileselect.for_writing)) {
|
||||
if (request_file(NULL, &of, false, ctrl->fileselect.for_writing)) {
|
||||
SetDlgItemText(dp->hwnd, c->base_id + 1, filename);
|
||||
ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE);
|
||||
}
|
||||
@ -2008,9 +2008,9 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
||||
(unsigned char) (cc.rgbResult >> 8) & 0xFF;
|
||||
dp->coloursel_result.b =
|
||||
(unsigned char) (cc.rgbResult >> 16) & 0xFF;
|
||||
dp->coloursel_result.ok = TRUE;
|
||||
dp->coloursel_result.ok = true;
|
||||
} else
|
||||
dp->coloursel_result.ok = FALSE;
|
||||
dp->coloursel_result.ok = false;
|
||||
ctrl->generic.handler(ctrl, dp, dp->data, EVENT_CALLBACK);
|
||||
}
|
||||
|
||||
@ -2019,7 +2019,7 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
||||
|
||||
/*
|
||||
* This function can be called to produce context help on a
|
||||
* control. Returns TRUE if it has actually launched some help.
|
||||
* control. Returns true if it has actually launched some help.
|
||||
*/
|
||||
int winctrl_context_help(struct dlgparam *dp, HWND hwnd, int id)
|
||||
{
|
||||
@ -2340,7 +2340,7 @@ void dlg_update_start(union control *ctrl, dlgparam *dp)
|
||||
{
|
||||
struct winctrl *c = dlg_findbyctrl(dp, ctrl);
|
||||
if (c && c->ctrl->generic.type == CTRL_LISTBOX) {
|
||||
SendDlgItemMessage(dp->hwnd, c->base_id+1, WM_SETREDRAW, FALSE, 0);
|
||||
SendDlgItemMessage(dp->hwnd, c->base_id+1, WM_SETREDRAW, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2349,8 +2349,8 @@ void dlg_update_done(union control *ctrl, dlgparam *dp)
|
||||
struct winctrl *c = dlg_findbyctrl(dp, ctrl);
|
||||
if (c && c->ctrl->generic.type == CTRL_LISTBOX) {
|
||||
HWND hw = GetDlgItem(dp->hwnd, c->base_id+1);
|
||||
SendMessage(hw, WM_SETREDRAW, TRUE, 0);
|
||||
InvalidateRect(hw, NULL, TRUE);
|
||||
SendMessage(hw, WM_SETREDRAW, true, 0);
|
||||
InvalidateRect(hw, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2408,7 +2408,7 @@ void dlg_error_msg(dlgparam *dp, const char *msg)
|
||||
*/
|
||||
void dlg_end(dlgparam *dp, int value)
|
||||
{
|
||||
dp->ended = TRUE;
|
||||
dp->ended = true;
|
||||
dp->endresult = value;
|
||||
}
|
||||
|
||||
@ -2441,7 +2441,7 @@ void dlg_refresh(union control *ctrl, dlgparam *dp)
|
||||
|
||||
void dlg_coloursel_start(union control *ctrl, dlgparam *dp, int r, int g, int b)
|
||||
{
|
||||
dp->coloursel_wanted = TRUE;
|
||||
dp->coloursel_wanted = true;
|
||||
dp->coloursel_result.r = r;
|
||||
dp->coloursel_result.g = g;
|
||||
dp->coloursel_result.b = b;
|
||||
@ -2482,7 +2482,7 @@ void dlg_auto_set_fixed_pitch_flag(dlgparam *dp)
|
||||
quality = conf_get_int(conf, CONF_font_quality);
|
||||
fs = conf_get_fontspec(conf, CONF_font);
|
||||
|
||||
hfont = CreateFont(0, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
|
||||
hfont = CreateFont(0, 0, 0, 0, FW_DONTCARE, false, false, false,
|
||||
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
|
||||
CLIP_DEFAULT_PRECIS, FONT_QUALITY(quality),
|
||||
FIXED_PITCH | FF_DONTCARE, fs->name);
|
||||
@ -2491,7 +2491,7 @@ void dlg_auto_set_fixed_pitch_flag(dlgparam *dp)
|
||||
/* Note that the TMPF_FIXED_PITCH bit is defined upside down :-( */
|
||||
is_var = (tm.tmPitchAndFamily & TMPF_FIXED_PITCH);
|
||||
} else {
|
||||
is_var = FALSE; /* assume it's basically normal */
|
||||
is_var = false; /* assume it's basically normal */
|
||||
}
|
||||
if (hdc)
|
||||
ReleaseDC(NULL, hdc);
|
||||
@ -2499,7 +2499,7 @@ void dlg_auto_set_fixed_pitch_flag(dlgparam *dp)
|
||||
DeleteObject(hfont);
|
||||
|
||||
if (is_var)
|
||||
dp->fixed_pitch_fonts = FALSE;
|
||||
dp->fixed_pitch_fonts = false;
|
||||
}
|
||||
|
||||
int dlg_get_fixed_pitch_flag(dlgparam *dp)
|
||||
@ -2516,12 +2516,12 @@ void dp_init(struct dlgparam *dp)
|
||||
{
|
||||
dp->nctrltrees = 0;
|
||||
dp->data = NULL;
|
||||
dp->ended = FALSE;
|
||||
dp->ended = false;
|
||||
dp->focused = dp->lastfocused = NULL;
|
||||
memset(dp->shortcuts, 0, sizeof(dp->shortcuts));
|
||||
dp->hwnd = NULL;
|
||||
dp->wintitle = dp->errtitle = NULL;
|
||||
dp->fixed_pitch_fonts = TRUE;
|
||||
dp->fixed_pitch_fonts = true;
|
||||
}
|
||||
|
||||
void dp_add_tree(struct dlgparam *dp, struct winctrls *wc)
|
||||
|
@ -156,14 +156,14 @@ static INT_PTR CALLBACK LogProc(HWND hwnd, UINT msg,
|
||||
memcpy(p, sel_nl, sizeof(sel_nl));
|
||||
p += sizeof(sel_nl);
|
||||
}
|
||||
write_aclip(CLIP_SYSTEM, clipdata, size, TRUE);
|
||||
write_aclip(CLIP_SYSTEM, clipdata, size, true);
|
||||
sfree(clipdata);
|
||||
}
|
||||
sfree(selitems);
|
||||
|
||||
for (i = 0; i < (ninitial + ncircular); i++)
|
||||
SendDlgItemMessage(hwnd, IDN_LIST, LB_SETSEL,
|
||||
FALSE, i);
|
||||
false, i);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -230,7 +230,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hwnd, TRUE);
|
||||
EndDialog(hwnd, true);
|
||||
return 0;
|
||||
case IDA_LICENCE:
|
||||
EnableWindow(hwnd, 0);
|
||||
@ -249,7 +249,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
|
||||
}
|
||||
return 0;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, TRUE);
|
||||
EndDialog(hwnd, true);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
@ -428,7 +428,7 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -451,7 +451,7 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
hwnd, (HMENU) IDCX_TVSTATIC, hinst,
|
||||
NULL);
|
||||
font = SendMessage(hwnd, WM_GETFONT, 0, 0);
|
||||
SendMessage(tvstatic, WM_SETFONT, font, MAKELPARAM(TRUE, 0));
|
||||
SendMessage(tvstatic, WM_SETFONT, font, MAKELPARAM(true, 0));
|
||||
|
||||
r.left = 3;
|
||||
r.right = r.left + 95;
|
||||
@ -468,7 +468,7 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
hwnd, (HMENU) IDCX_TREEVIEW, hinst,
|
||||
NULL);
|
||||
font = SendMessage(hwnd, WM_GETFONT, 0, 0);
|
||||
SendMessage(treeview, WM_SETFONT, font, MAKELPARAM(TRUE, 0));
|
||||
SendMessage(treeview, WM_SETFONT, font, MAKELPARAM(true, 0));
|
||||
tvfaff.treeview = treeview;
|
||||
memset(tvfaff.lastat, 0, sizeof(tvfaff.lastat));
|
||||
}
|
||||
@ -594,7 +594,7 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
|
||||
i = TreeView_GetSelection(((LPNMHDR) lParam)->hwndFrom);
|
||||
|
||||
SendMessage (hwnd, WM_SETREDRAW, FALSE, 0);
|
||||
SendMessage (hwnd, WM_SETREDRAW, false, 0);
|
||||
|
||||
item.hItem = i;
|
||||
item.pszText = buffer;
|
||||
@ -623,8 +623,8 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
|
||||
dlg_refresh(NULL, &dp); /* set up control values */
|
||||
|
||||
SendMessage (hwnd, WM_SETREDRAW, TRUE, 0);
|
||||
InvalidateRect (hwnd, NULL, TRUE);
|
||||
SendMessage (hwnd, WM_SETREDRAW, true, 0);
|
||||
InvalidateRect (hwnd, NULL, true);
|
||||
|
||||
SetFocus(((LPNMHDR) lParam)->hwndFrom); /* ensure focus stays */
|
||||
return 0;
|
||||
@ -698,8 +698,8 @@ int do_config(void)
|
||||
int ret;
|
||||
|
||||
ctrlbox = ctrl_new_box();
|
||||
setup_config_box(ctrlbox, FALSE, 0, 0);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), FALSE, 0);
|
||||
setup_config_box(ctrlbox, false, 0, 0);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), false, 0);
|
||||
dp_init(&dp);
|
||||
winctrl_init(&ctrls_base);
|
||||
winctrl_init(&ctrls_panel);
|
||||
@ -709,7 +709,7 @@ int do_config(void)
|
||||
dp.errtitle = dupprintf("%s Error", appname);
|
||||
dp.data = conf;
|
||||
dlg_auto_set_fixed_pitch_flag(&dp);
|
||||
dp.shortcuts['g'] = TRUE; /* the treeview: `Cate&gory' */
|
||||
dp.shortcuts['g'] = true; /* the treeview: `Cate&gory' */
|
||||
|
||||
ret =
|
||||
SaneDialogBox(hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL,
|
||||
@ -732,8 +732,8 @@ int do_reconfig(HWND hwnd, int protcfginfo)
|
||||
|
||||
ctrlbox = ctrl_new_box();
|
||||
protocol = conf_get_int(conf, CONF_protocol);
|
||||
setup_config_box(ctrlbox, TRUE, protocol, protcfginfo);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), TRUE, protocol);
|
||||
setup_config_box(ctrlbox, true, protocol, protcfginfo);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), true, protocol);
|
||||
dp_init(&dp);
|
||||
winctrl_init(&ctrls_base);
|
||||
winctrl_init(&ctrls_panel);
|
||||
@ -743,7 +743,7 @@ int do_reconfig(HWND hwnd, int protcfginfo)
|
||||
dp.errtitle = dupprintf("%s Error", appname);
|
||||
dp.data = conf;
|
||||
dlg_auto_set_fixed_pitch_flag(&dp);
|
||||
dp.shortcuts['g'] = TRUE; /* the treeview: `Cate&gory' */
|
||||
dp.shortcuts['g'] = true; /* the treeview: `Cate&gory' */
|
||||
|
||||
ret = SaneDialogBox(hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL,
|
||||
GenericMainDlgProc);
|
||||
|
222
windows/window.c
222
windows/window.c
@ -130,7 +130,7 @@ static Backend *backend;
|
||||
|
||||
static struct unicode_data ucsdata;
|
||||
static int session_closed;
|
||||
static int reconfiguring = FALSE;
|
||||
static int reconfiguring = false;
|
||||
|
||||
static const SessionSpecial *specials = NULL;
|
||||
static HMENU specials_menu = NULL;
|
||||
@ -292,8 +292,8 @@ static const TermWinVtable windows_termwin_vt = {
|
||||
static TermWin wintw[1];
|
||||
static HDC wintw_hdc;
|
||||
|
||||
const int share_can_be_downstream = TRUE;
|
||||
const int share_can_be_upstream = TRUE;
|
||||
const int share_can_be_downstream = true;
|
||||
const int share_can_be_upstream = true;
|
||||
|
||||
static int is_utf8(void)
|
||||
{
|
||||
@ -318,7 +318,7 @@ char *win_seat_get_ttymode(Seat *seat, const char *mode)
|
||||
int win_seat_get_window_pixel_size(Seat *seat, int *x, int *y)
|
||||
{
|
||||
win_get_pixels(wintw, x, y);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int win_seat_output(Seat *seat, int is_stderr, const void *, int);
|
||||
@ -416,7 +416,7 @@ static void start_backend(void)
|
||||
DeleteMenu(popup_menus[i].menu, IDM_RESTART, MF_BYCOMMAND);
|
||||
}
|
||||
|
||||
session_closed = FALSE;
|
||||
session_closed = false;
|
||||
}
|
||||
|
||||
static void close_session(void *ignored_context)
|
||||
@ -424,7 +424,7 @@ static void close_session(void *ignored_context)
|
||||
char morestuff[100];
|
||||
int i;
|
||||
|
||||
session_closed = TRUE;
|
||||
session_closed = true;
|
||||
sprintf(morestuff, "%.70s (inactive)", appname);
|
||||
win_set_icon_title(wintw, morestuff);
|
||||
win_set_title(wintw, morestuff);
|
||||
@ -511,7 +511,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
*/
|
||||
{
|
||||
char *p;
|
||||
int special_launchable_argument = FALSE;
|
||||
int special_launchable_argument = false;
|
||||
|
||||
default_protocol = be_default_protocol;
|
||||
/* Find the appropriate default port. */
|
||||
@ -542,7 +542,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
(!p[2] || p[2] == '@' || p[2] == '&')) {
|
||||
/* &R restrict-acl prefix */
|
||||
restrict_process_acl();
|
||||
restricted_acl = TRUE;
|
||||
restricted_acl = true;
|
||||
p += 2;
|
||||
}
|
||||
|
||||
@ -562,7 +562,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
if (!conf_launchable(conf) && !do_config()) {
|
||||
cleanup_exit(0);
|
||||
}
|
||||
special_launchable_argument = TRUE;
|
||||
special_launchable_argument = true;
|
||||
} else if (*p == '&') {
|
||||
/*
|
||||
* An initial & means we've been given a command line
|
||||
@ -585,7 +585,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
} else if (!do_config()) {
|
||||
cleanup_exit(0);
|
||||
}
|
||||
special_launchable_argument = TRUE;
|
||||
special_launchable_argument = true;
|
||||
} else if (!*p) {
|
||||
/* Do-nothing case for an empty command line - or rather,
|
||||
* for a command line that's empty _after_ we strip off
|
||||
@ -792,7 +792,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
si.nMax = term->rows - 1;
|
||||
si.nPage = term->rows;
|
||||
si.nPos = 0;
|
||||
SetScrollInfo(hwnd, SB_VERT, &si, FALSE);
|
||||
SetScrollInfo(hwnd, SB_VERT, &si, false);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -810,13 +810,13 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
int j;
|
||||
char *str;
|
||||
|
||||
popup_menus[SYSMENU].menu = GetSystemMenu(hwnd, FALSE);
|
||||
popup_menus[SYSMENU].menu = GetSystemMenu(hwnd, false);
|
||||
popup_menus[CTXMENU].menu = CreatePopupMenu();
|
||||
AppendMenu(popup_menus[CTXMENU].menu, MF_ENABLED, IDM_COPY, "&Copy");
|
||||
AppendMenu(popup_menus[CTXMENU].menu, MF_ENABLED, IDM_PASTE, "&Paste");
|
||||
|
||||
savedsess_menu = CreateMenu();
|
||||
get_sesslist(&sesslist, TRUE);
|
||||
get_sesslist(&sesslist, true);
|
||||
update_savedsess_menu();
|
||||
|
||||
for (j = 0; j < lenof(popup_menus); j++) {
|
||||
@ -907,7 +907,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
|
||||
handles = handle_get_events(&nhandles);
|
||||
|
||||
n = MsgWaitForMultipleObjects(nhandles, handles, FALSE,
|
||||
n = MsgWaitForMultipleObjects(nhandles, handles, false,
|
||||
timeout, QS_ALLINPUT);
|
||||
|
||||
if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
|
||||
@ -1122,8 +1122,8 @@ static void win_seat_update_specials_menu(Seat *seat)
|
||||
static void update_mouse_pointer(void)
|
||||
{
|
||||
LPTSTR curstype = NULL;
|
||||
int force_visible = FALSE;
|
||||
static int forced_visible = FALSE;
|
||||
int force_visible = false;
|
||||
static int forced_visible = false;
|
||||
switch (busy_status) {
|
||||
case BUSY_NOT:
|
||||
if (send_raw_mouse)
|
||||
@ -1133,11 +1133,11 @@ static void update_mouse_pointer(void)
|
||||
break;
|
||||
case BUSY_WAITING:
|
||||
curstype = IDC_APPSTARTING; /* this may be an abuse */
|
||||
force_visible = TRUE;
|
||||
force_visible = true;
|
||||
break;
|
||||
case BUSY_CPU:
|
||||
curstype = IDC_WAIT;
|
||||
force_visible = TRUE;
|
||||
force_visible = true;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
@ -1323,9 +1323,9 @@ static void init_palette(void)
|
||||
}
|
||||
pal = CreatePalette(logpal);
|
||||
if (pal) {
|
||||
SelectPalette(hdc, pal, FALSE);
|
||||
SelectPalette(hdc, pal, false);
|
||||
RealizePalette(hdc);
|
||||
SelectPalette(hdc, GetStockObject(DEFAULT_PALETTE), FALSE);
|
||||
SelectPalette(hdc, GetStockObject(DEFAULT_PALETTE), false);
|
||||
}
|
||||
}
|
||||
ReleaseDC(hwnd, hdc);
|
||||
@ -1388,7 +1388,7 @@ static void general_textout(HDC hdc, int x, int y, CONST RECT *lprc,
|
||||
CONST INT *lpDx, int opaque)
|
||||
{
|
||||
int i, j, xp, xn;
|
||||
int bkmode = 0, got_bkmode = FALSE;
|
||||
int bkmode = 0, got_bkmode = false;
|
||||
|
||||
xp = xn = x;
|
||||
|
||||
@ -1421,9 +1421,9 @@ static void general_textout(HDC hdc, int x, int y, CONST RECT *lprc,
|
||||
xp = xn;
|
||||
|
||||
bkmode = GetBkMode(hdc);
|
||||
got_bkmode = TRUE;
|
||||
got_bkmode = true;
|
||||
SetBkMode(hdc, TRANSPARENT);
|
||||
opaque = FALSE;
|
||||
opaque = false;
|
||||
}
|
||||
|
||||
if (got_bkmode)
|
||||
@ -1442,8 +1442,8 @@ static int get_font_width(HDC hdc, const TEXTMETRIC *tm)
|
||||
ABCFLOAT widths[LAST-FIRST + 1];
|
||||
int j;
|
||||
|
||||
font_varpitch = TRUE;
|
||||
font_dualwidth = TRUE;
|
||||
font_varpitch = true;
|
||||
font_dualwidth = true;
|
||||
if (GetCharABCWidthsFloat(hdc, FIRST, LAST, widths)) {
|
||||
ret = 0;
|
||||
for (j = 0; j < lenof(widths); j++) {
|
||||
@ -1494,7 +1494,7 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
|
||||
bold_font_mode = conf_get_int(conf, CONF_bold_style) & 1 ?
|
||||
BOLD_FONT : BOLD_NONE;
|
||||
bold_colours = conf_get_int(conf, CONF_bold_style) & 2 ? TRUE : FALSE;
|
||||
bold_colours = conf_get_int(conf, CONF_bold_style) & 2 ? true : false;
|
||||
und_mode = UND_FONT;
|
||||
|
||||
font = conf_get_fontspec(conf, CONF_font);
|
||||
@ -1521,12 +1521,12 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
|
||||
quality = conf_get_int(conf, CONF_font_quality);
|
||||
#define f(i,c,w,u) \
|
||||
fonts[i] = CreateFont (font_height, font_width, 0, 0, w, FALSE, u, FALSE, \
|
||||
fonts[i] = CreateFont (font_height, font_width, 0, 0, w, false, u, false, \
|
||||
c, OUT_DEFAULT_PRECIS, \
|
||||
CLIP_DEFAULT_PRECIS, FONT_QUALITY(quality), \
|
||||
FIXED_PITCH | FF_DONTCARE, font->name)
|
||||
|
||||
f(FONT_NORMAL, font->charset, fw_dontcare, FALSE);
|
||||
f(FONT_NORMAL, font->charset, fw_dontcare, false);
|
||||
|
||||
SelectObject(hdc, fonts[FONT_NORMAL]);
|
||||
GetTextMetrics(hdc, &tm);
|
||||
@ -1535,11 +1535,11 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
|
||||
/* Note that the TMPF_FIXED_PITCH bit is defined upside down :-( */
|
||||
if (!(tm.tmPitchAndFamily & TMPF_FIXED_PITCH)) {
|
||||
font_varpitch = FALSE;
|
||||
font_varpitch = false;
|
||||
font_dualwidth = (tm.tmAveCharWidth != tm.tmMaxCharWidth);
|
||||
} else {
|
||||
font_varpitch = TRUE;
|
||||
font_dualwidth = TRUE;
|
||||
font_varpitch = true;
|
||||
font_dualwidth = true;
|
||||
}
|
||||
if (pick_width == 0 || pick_height == 0) {
|
||||
font_height = tm.tmHeight;
|
||||
@ -1570,7 +1570,7 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
ucsdata.dbcs_screenfont = (cpinfo.MaxCharSize > 1);
|
||||
}
|
||||
|
||||
f(FONT_UNDERLINE, font->charset, fw_dontcare, TRUE);
|
||||
f(FONT_UNDERLINE, font->charset, fw_dontcare, true);
|
||||
|
||||
/*
|
||||
* Some fonts, e.g. 9-pt Courier, draw their underlines
|
||||
@ -1604,11 +1604,11 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
SetBkColor(und_dc, RGB(0, 0, 0));
|
||||
SetBkMode(und_dc, OPAQUE);
|
||||
ExtTextOut(und_dc, 0, 0, ETO_OPAQUE, NULL, " ", 1, NULL);
|
||||
gotit = FALSE;
|
||||
gotit = false;
|
||||
for (i = 0; i < font_height; i++) {
|
||||
c = GetPixel(und_dc, font_width / 2, i);
|
||||
if (c != RGB(0, 0, 0))
|
||||
gotit = TRUE;
|
||||
gotit = true;
|
||||
}
|
||||
SelectObject(und_dc, und_oldbm);
|
||||
DeleteObject(und_bm);
|
||||
@ -1621,7 +1621,7 @@ static void init_fonts(int pick_width, int pick_height)
|
||||
}
|
||||
|
||||
if (bold_font_mode == BOLD_FONT) {
|
||||
f(FONT_BOLD, font->charset, fw_bold, FALSE);
|
||||
f(FONT_BOLD, font->charset, fw_bold, false);
|
||||
}
|
||||
#undef f
|
||||
|
||||
@ -1685,7 +1685,7 @@ static void another_font(int fontno)
|
||||
|
||||
c = font->charset;
|
||||
w = fw_dontcare;
|
||||
u = FALSE;
|
||||
u = false;
|
||||
s = font->name;
|
||||
x = font_width;
|
||||
|
||||
@ -1698,13 +1698,13 @@ static void another_font(int fontno)
|
||||
if (fontno & FONT_BOLD)
|
||||
w = fw_bold;
|
||||
if (fontno & FONT_UNDERLINE)
|
||||
u = TRUE;
|
||||
u = true;
|
||||
|
||||
quality = conf_get_int(conf, CONF_font_quality);
|
||||
|
||||
fonts[fontno] =
|
||||
CreateFont(font_height * (1 + !!(fontno & FONT_HIGH)), x, 0, 0, w,
|
||||
FALSE, u, FALSE, c, OUT_DEFAULT_PRECIS,
|
||||
false, u, false, c, OUT_DEFAULT_PRECIS,
|
||||
CLIP_DEFAULT_PRECIS, FONT_QUALITY(quality),
|
||||
DEFAULT_PITCH | FF_DONTCARE, s);
|
||||
|
||||
@ -1776,7 +1776,7 @@ static void wintw_request_resize(TermWin *tw, int w, int h)
|
||||
} else
|
||||
reset_window(0);
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
}
|
||||
|
||||
static void reset_window(int reinit) {
|
||||
@ -1826,7 +1826,7 @@ static void reset_window(int reinit) {
|
||||
offset_height != (win_height-font_height*term->rows)/2) ){
|
||||
offset_width = (win_width-font_width*term->cols)/2;
|
||||
offset_height = (win_height-font_height*term->rows)/2;
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
#ifdef RDB_DEBUG_PATCH
|
||||
debug((27, "reset_window() -> Reposition terminal"));
|
||||
#endif
|
||||
@ -1847,7 +1847,7 @@ static void reset_window(int reinit) {
|
||||
init_fonts(win_width/term->cols, win_height/term->rows);
|
||||
offset_width = (win_width-font_width*term->cols)/2;
|
||||
offset_height = (win_height-font_height*term->rows)/2;
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
#ifdef RDB_DEBUG_PATCH
|
||||
debug((25, "reset_window() -> Z font resize to (%d, %d)",
|
||||
font_width, font_height));
|
||||
@ -1863,7 +1863,7 @@ static void reset_window(int reinit) {
|
||||
conf_get_int(conf, CONF_savelines));
|
||||
offset_width = (win_width-font_width*term->cols)/2;
|
||||
offset_height = (win_height-font_height*term->rows)/2;
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
#ifdef RDB_DEBUG_PATCH
|
||||
debug((27, "reset_window() -> Zoomed term_size"));
|
||||
#endif
|
||||
@ -1897,7 +1897,7 @@ static void reset_window(int reinit) {
|
||||
SWP_NOMOVE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1956,7 +1956,7 @@ static void reset_window(int reinit) {
|
||||
font_height*term->rows + extra_height,
|
||||
SWP_NOMOVE | SWP_NOZORDER);
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
#ifdef RDB_DEBUG_PATCH
|
||||
debug((27, "reset_window() -> window resize to (%d,%d)",
|
||||
font_width*term->cols + extra_width,
|
||||
@ -1980,7 +1980,7 @@ static void reset_window(int reinit) {
|
||||
extra_width = wr.right - wr.left - cr.right + cr.left +offset_width*2;
|
||||
extra_height = wr.bottom - wr.top - cr.bottom + cr.top+offset_height*2;
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
#ifdef RDB_DEBUG_PATCH
|
||||
debug((25, "reset_window() -> font resize to (%d,%d)",
|
||||
font_width, font_height));
|
||||
@ -2049,9 +2049,9 @@ static void show_mouseptr(int show)
|
||||
if (!conf_get_int(conf, CONF_hide_mouseptr))
|
||||
show = 1; /* override if this feature disabled */
|
||||
if (cursor_visible && !show)
|
||||
ShowCursor(FALSE);
|
||||
ShowCursor(false);
|
||||
else if (!cursor_visible && show)
|
||||
ShowCursor(TRUE);
|
||||
ShowCursor(true);
|
||||
cursor_visible = show;
|
||||
}
|
||||
|
||||
@ -2060,12 +2060,12 @@ static int is_alt_pressed(void)
|
||||
BYTE keystate[256];
|
||||
int r = GetKeyboardState(keystate);
|
||||
if (!r)
|
||||
return FALSE;
|
||||
return false;
|
||||
if (keystate[VK_MENU] & 0x80)
|
||||
return TRUE;
|
||||
return true;
|
||||
if (keystate[VK_RMENU] & 0x80)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int resizing;
|
||||
@ -2084,7 +2084,7 @@ static void win_seat_notify_remote_exit(Seat *seat)
|
||||
PostQuitMessage(0);
|
||||
} else {
|
||||
queue_toplevel_callback(close_session, NULL);
|
||||
session_closed = TRUE;
|
||||
session_closed = true;
|
||||
/* exitcode == INT_MAX indicates that the connection was closed
|
||||
* by a fatal error, so an error box will be coming our way and
|
||||
* we should not generate this informational one. */
|
||||
@ -2128,14 +2128,14 @@ static HDC make_hdc(void)
|
||||
if (!hdc)
|
||||
return NULL;
|
||||
|
||||
SelectPalette(hdc, pal, FALSE);
|
||||
SelectPalette(hdc, pal, false);
|
||||
return hdc;
|
||||
}
|
||||
|
||||
static void free_hdc(HDC hdc)
|
||||
{
|
||||
assert(hwnd);
|
||||
SelectPalette(hdc, GetStockObject(DEFAULT_PALETTE), FALSE);
|
||||
SelectPalette(hdc, GetStockObject(DEFAULT_PALETTE), false);
|
||||
ReleaseDC(hwnd, hdc);
|
||||
}
|
||||
|
||||
@ -2143,10 +2143,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hdc;
|
||||
static int ignore_clip = FALSE;
|
||||
static int need_backend_resize = FALSE;
|
||||
static int fullscr_on_max = FALSE;
|
||||
static int processed_resize = FALSE;
|
||||
static int ignore_clip = false;
|
||||
static int need_backend_resize = false;
|
||||
static int fullscr_on_max = false;
|
||||
static int processed_resize = false;
|
||||
static UINT last_mousemove = 0;
|
||||
int resize_action;
|
||||
|
||||
@ -2186,8 +2186,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
if ((HMENU)wParam == savedsess_menu) {
|
||||
/* About to pop up Saved Sessions sub-menu.
|
||||
* Refresh the session list. */
|
||||
get_sesslist(&sesslist, FALSE); /* free */
|
||||
get_sesslist(&sesslist, TRUE);
|
||||
get_sesslist(&sesslist, false); /* free */
|
||||
get_sesslist(&sesslist, true);
|
||||
update_savedsess_menu();
|
||||
return 0;
|
||||
}
|
||||
@ -2231,7 +2231,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
|
||||
sa.nLength = sizeof(sa);
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = TRUE;
|
||||
sa.bInheritHandle = true;
|
||||
filemap = CreateFileMapping(INVALID_HANDLE_VALUE,
|
||||
&sa,
|
||||
PAGE_READWRITE,
|
||||
@ -2245,7 +2245,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
}
|
||||
|
||||
strbuf_free(serbuf);
|
||||
inherit_handles = TRUE;
|
||||
inherit_handles = true;
|
||||
cl = dupprintf("putty %s&%p:%u", argprefix,
|
||||
filemap, (unsigned)size);
|
||||
} else if (wParam == IDM_SAVEDSESS) {
|
||||
@ -2254,14 +2254,14 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
if (sessno < (unsigned)sesslist.nsessions) {
|
||||
const char *session = sesslist.sessions[sessno];
|
||||
cl = dupprintf("putty %s@%s", argprefix, session);
|
||||
inherit_handles = FALSE;
|
||||
inherit_handles = false;
|
||||
} else
|
||||
break;
|
||||
} else /* IDM_NEWSESS */ {
|
||||
cl = dupprintf("putty%s%s",
|
||||
*argprefix ? " " : "",
|
||||
argprefix);
|
||||
inherit_handles = FALSE;
|
||||
inherit_handles = false;
|
||||
}
|
||||
|
||||
GetModuleFileName(NULL, b, sizeof(b) - 1);
|
||||
@ -2286,7 +2286,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
if (!backend) {
|
||||
lp_eventlog(default_logpolicy,
|
||||
"----- Session restarted -----");
|
||||
term_pwron(term, FALSE);
|
||||
term_pwron(term, false);
|
||||
start_backend();
|
||||
}
|
||||
|
||||
@ -2300,7 +2300,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
if (reconfiguring)
|
||||
break;
|
||||
else
|
||||
reconfiguring = TRUE;
|
||||
reconfiguring = true;
|
||||
|
||||
/*
|
||||
* Copy the current window title into the stored
|
||||
@ -2314,7 +2314,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
|
||||
reconfig_result =
|
||||
do_reconfig(hwnd, backend ? backend_cfg_info(backend) : 0);
|
||||
reconfiguring = FALSE;
|
||||
reconfiguring = false;
|
||||
if (!reconfig_result) {
|
||||
conf_free(prev_conf);
|
||||
break;
|
||||
@ -2472,7 +2472,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
init_lvl = 2;
|
||||
}
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
reset_window(init_lvl);
|
||||
|
||||
conf_free(prev_conf);
|
||||
@ -2491,7 +2491,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
term_clrsb(term);
|
||||
break;
|
||||
case IDM_RESET:
|
||||
term_pwron(term, TRUE);
|
||||
term_pwron(term, true);
|
||||
if (ldisc)
|
||||
ldisc_echoedit_update(ldisc);
|
||||
break;
|
||||
@ -2719,7 +2719,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
case WM_DESTROYCLIPBOARD:
|
||||
if (!ignore_clip)
|
||||
term_lost_clipboard_ownership(term, CLIP_SYSTEM);
|
||||
ignore_clip = FALSE;
|
||||
ignore_clip = false;
|
||||
return 0;
|
||||
case WM_PAINT:
|
||||
{
|
||||
@ -2728,7 +2728,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
HideCaret(hwnd);
|
||||
hdc = BeginPaint(hwnd, &p);
|
||||
if (pal) {
|
||||
SelectPalette(hdc, pal, TRUE);
|
||||
SelectPalette(hdc, pal, true);
|
||||
RealizePalette(hdc);
|
||||
}
|
||||
|
||||
@ -2838,7 +2838,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
}
|
||||
return 0;
|
||||
case WM_SETFOCUS:
|
||||
term_set_focus(term, TRUE);
|
||||
term_set_focus(term, true);
|
||||
CreateCaret(hwnd, caretbm, font_width, font_height);
|
||||
ShowCaret(hwnd);
|
||||
flash_window(0); /* stop */
|
||||
@ -2847,7 +2847,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
break;
|
||||
case WM_KILLFOCUS:
|
||||
show_mouseptr(1);
|
||||
term_set_focus(term, FALSE);
|
||||
term_set_focus(term, false);
|
||||
DestroyCaret();
|
||||
caret_x = caret_y = -1; /* ensure caret is replaced next time */
|
||||
term_update(term);
|
||||
@ -2857,12 +2857,12 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
debug((27, "WM_ENTERSIZEMOVE"));
|
||||
#endif
|
||||
EnableSizeTip(1);
|
||||
resizing = TRUE;
|
||||
need_backend_resize = FALSE;
|
||||
resizing = true;
|
||||
need_backend_resize = false;
|
||||
break;
|
||||
case WM_EXITSIZEMOVE:
|
||||
EnableSizeTip(0);
|
||||
resizing = FALSE;
|
||||
resizing = false;
|
||||
#ifdef RDB_DEBUG_PATCH
|
||||
debug((27, "WM_EXITSIZEMOVE"));
|
||||
#endif
|
||||
@ -2870,7 +2870,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
term_size(term, conf_get_int(conf, CONF_height),
|
||||
conf_get_int(conf, CONF_width),
|
||||
conf_get_int(conf, CONF_savelines));
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
}
|
||||
break;
|
||||
case WM_SIZING:
|
||||
@ -2900,8 +2900,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
conf_set_int(conf, CONF_height, term->rows);
|
||||
conf_set_int(conf, CONF_width, term->cols);
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
need_backend_resize = TRUE;
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
need_backend_resize = true;
|
||||
}
|
||||
|
||||
width = r->right - r->left - extra_width;
|
||||
@ -2967,7 +2967,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
}
|
||||
/* break; (never reached) */
|
||||
case WM_FULLSCR_ON_MAX:
|
||||
fullscr_on_max = TRUE;
|
||||
fullscr_on_max = true;
|
||||
break;
|
||||
case WM_MOVE:
|
||||
sys_cursor_update();
|
||||
@ -2990,7 +2990,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
if (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED)
|
||||
SetWindowText(hwnd, window_name);
|
||||
if (wParam == SIZE_RESTORED) {
|
||||
processed_resize = FALSE;
|
||||
processed_resize = false;
|
||||
clear_full_screen();
|
||||
if (processed_resize) {
|
||||
/*
|
||||
@ -3003,8 +3003,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
}
|
||||
}
|
||||
if (wParam == SIZE_MAXIMIZED && fullscr_on_max) {
|
||||
fullscr_on_max = FALSE;
|
||||
processed_resize = FALSE;
|
||||
fullscr_on_max = false;
|
||||
processed_resize = false;
|
||||
make_full_screen();
|
||||
if (processed_resize) {
|
||||
/*
|
||||
@ -3017,7 +3017,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
}
|
||||
}
|
||||
|
||||
processed_resize = TRUE;
|
||||
processed_resize = true;
|
||||
|
||||
if (resize_action == RESIZE_DISABLED) {
|
||||
/* A resize, well it better be a minimize. */
|
||||
@ -3048,7 +3048,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
* arise in maximisation as well via the Aero
|
||||
* snap UI.
|
||||
*/
|
||||
need_backend_resize = TRUE;
|
||||
need_backend_resize = true;
|
||||
conf_set_int(conf, CONF_height, h);
|
||||
conf_set_int(conf, CONF_width, w);
|
||||
} else {
|
||||
@ -3087,7 +3087,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
* getting sent down the connection during an NT
|
||||
* opaque drag.)
|
||||
*/
|
||||
need_backend_resize = TRUE;
|
||||
need_backend_resize = true;
|
||||
conf_set_int(conf, CONF_height, h);
|
||||
conf_set_int(conf, CONF_width, w);
|
||||
} else {
|
||||
@ -3154,10 +3154,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
if (RealizePalette(hdc) > 0)
|
||||
UpdateColors(hdc);
|
||||
free_hdc(hdc);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
case WM_KEYUP:
|
||||
@ -3470,7 +3470,7 @@ static void do_text_internal(
|
||||
int text_adjust = 0;
|
||||
int xoffset = 0;
|
||||
int maxlen, remaining, opaque;
|
||||
int is_cursor = FALSE;
|
||||
int is_cursor = false;
|
||||
static int *lpDx = NULL;
|
||||
static int lpDx_len = 0;
|
||||
int *lpDx_maybe;
|
||||
@ -3497,7 +3497,7 @@ static void do_text_internal(
|
||||
attr &= ~(ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS|ATTR_DIM);
|
||||
/* cursor fg and bg */
|
||||
attr |= (260 << ATTR_FGSHIFT) | (261 << ATTR_BGSHIFT);
|
||||
is_cursor = TRUE;
|
||||
is_cursor = true;
|
||||
}
|
||||
|
||||
nfont = 0;
|
||||
@ -3666,7 +3666,7 @@ static void do_text_internal(
|
||||
maxlen = len;
|
||||
}
|
||||
|
||||
opaque = TRUE; /* start by erasing the rectangle */
|
||||
opaque = true; /* start by erasing the rectangle */
|
||||
for (remaining = len; remaining > 0;
|
||||
text += len, remaining -= len, x += char_width * len2) {
|
||||
len = (maxlen < remaining ? maxlen : remaining);
|
||||
@ -3831,7 +3831,7 @@ static void do_text_internal(
|
||||
* rectangle.
|
||||
*/
|
||||
SetBkMode(wintw_hdc, TRANSPARENT);
|
||||
opaque = FALSE;
|
||||
opaque = false;
|
||||
}
|
||||
if (lattr != LATTR_TOP && (force_manual_underline ||
|
||||
(und_mode == UND_LINE
|
||||
@ -4975,7 +4975,7 @@ static void wintw_set_scrollbar(TermWin *tw, int total, int start, int page)
|
||||
si.nPage = page;
|
||||
si.nPos = start;
|
||||
if (hwnd)
|
||||
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
|
||||
SetScrollInfo(hwnd, SB_VERT, &si, true);
|
||||
}
|
||||
|
||||
static int wintw_setup_draw_ctx(TermWin *tw)
|
||||
@ -5007,11 +5007,11 @@ static void real_palette_set(int n, int r, int g, int b)
|
||||
static int wintw_palette_get(TermWin *tw, int n, int *r, int *g, int *b)
|
||||
{
|
||||
if (n < 0 || n >= NALLCOLOURS)
|
||||
return FALSE;
|
||||
return false;
|
||||
*r = colours_rgb[n].r;
|
||||
*g = colours_rgb[n].g;
|
||||
*b = colours_rgb[n].b;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void wintw_palette_set(TermWin *tw, int n, int r, int g, int b)
|
||||
@ -5031,7 +5031,7 @@ static void wintw_palette_set(TermWin *tw, int n, int r, int g, int b)
|
||||
/* If Default Background changes, we need to ensure any
|
||||
* space between the text area and the window border is
|
||||
* redrawn. */
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5060,7 +5060,7 @@ static void wintw_palette_reset(TermWin *tw)
|
||||
} else {
|
||||
/* Default Background may have changed. Ensure any space between
|
||||
* text area and window border is redrawn. */
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5083,7 +5083,7 @@ void write_aclip(int clipboard, char *data, int len, int must_deselect)
|
||||
GlobalUnlock(clipdata);
|
||||
|
||||
if (!must_deselect)
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, TRUE, 0);
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, true, 0);
|
||||
|
||||
if (OpenClipboard(hwnd)) {
|
||||
EmptyClipboard();
|
||||
@ -5093,7 +5093,7 @@ void write_aclip(int clipboard, char *data, int len, int must_deselect)
|
||||
GlobalFree(clipdata);
|
||||
|
||||
if (!must_deselect)
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, FALSE, 0);
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, false, 0);
|
||||
}
|
||||
|
||||
typedef struct _rgbindex {
|
||||
@ -5511,7 +5511,7 @@ static void wintw_clip_write(
|
||||
GlobalUnlock(clipdata2);
|
||||
|
||||
if (!must_deselect)
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, TRUE, 0);
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, true, 0);
|
||||
|
||||
if (OpenClipboard(hwnd)) {
|
||||
EmptyClipboard();
|
||||
@ -5526,7 +5526,7 @@ static void wintw_clip_write(
|
||||
}
|
||||
|
||||
if (!must_deselect)
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, FALSE, 0);
|
||||
SendMessage(hwnd, WM_IGNORE_CLIP, false, 0);
|
||||
}
|
||||
|
||||
static DWORD WINAPI clipboard_read_threadfunc(void *param)
|
||||
@ -5653,7 +5653,7 @@ static BOOL flash_window_ex(DWORD dwFlags, UINT uCount, DWORD dwTimeout)
|
||||
return (*p_FlashWindowEx)(&fi);
|
||||
}
|
||||
else
|
||||
return FALSE; /* shrug */
|
||||
return false; /* shrug */
|
||||
}
|
||||
|
||||
static void flash_window(int mode);
|
||||
@ -5685,7 +5685,7 @@ static void flash_window(int mode)
|
||||
if (p_FlashWindowEx)
|
||||
flash_window_ex(FLASHW_STOP, 0, 0);
|
||||
else
|
||||
FlashWindow(hwnd, FALSE);
|
||||
FlashWindow(hwnd, false);
|
||||
}
|
||||
|
||||
} else if (mode == 2) {
|
||||
@ -5704,7 +5704,7 @@ static void flash_window(int mode)
|
||||
0 /* system cursor blink rate */);
|
||||
/* No need to schedule timer */
|
||||
} else {
|
||||
FlashWindow(hwnd, TRUE);
|
||||
FlashWindow(hwnd, true);
|
||||
next_flash = schedule_timer(450, flash_window_timer, hwnd);
|
||||
}
|
||||
}
|
||||
@ -5712,7 +5712,7 @@ static void flash_window(int mode)
|
||||
} else if ((mode == 1) && (beep_ind == B_IND_FLASH)) {
|
||||
/* maintain */
|
||||
if (flashing && !p_FlashWindowEx) {
|
||||
FlashWindow(hwnd, TRUE); /* toggle */
|
||||
FlashWindow(hwnd, true); /* toggle */
|
||||
next_flash = schedule_timer(450, flash_window_timer, hwnd);
|
||||
}
|
||||
}
|
||||
@ -5825,7 +5825,7 @@ static void wintw_set_zorder(TermWin *tw, int top)
|
||||
*/
|
||||
static void wintw_refresh(TermWin *tw)
|
||||
{
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
InvalidateRect(hwnd, NULL, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -5887,10 +5887,10 @@ static const char *wintw_get_title(TermWin *tw, int icon)
|
||||
static int is_full_screen()
|
||||
{
|
||||
if (!IsZoomed(hwnd))
|
||||
return FALSE;
|
||||
return false;
|
||||
if (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_CAPTION)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Get the rect/size of a full screen window using the nearest available
|
||||
@ -5907,7 +5907,7 @@ static int get_fullscreen_rect(RECT * ss)
|
||||
|
||||
/* structure copy */
|
||||
*ss = mi.rcMonitor;
|
||||
return TRUE;
|
||||
return true;
|
||||
#else
|
||||
/* could also use code like this:
|
||||
ss->left = ss->top = 0;
|
||||
@ -6017,7 +6017,7 @@ static int win_seat_output(Seat *seat, int is_stderr,
|
||||
|
||||
static int win_seat_eof(Seat *seat)
|
||||
{
|
||||
return TRUE; /* do respond to incoming EOF with outgoing */
|
||||
return true; /* do respond to incoming EOF with outgoing */
|
||||
}
|
||||
|
||||
static int win_seat_get_userpass_input(
|
||||
|
@ -119,7 +119,7 @@ static DWORD WINAPI handle_input_threadfunc(void *param)
|
||||
|
||||
if (ctx->flags & HANDLE_FLAG_OVERLAPPED) {
|
||||
povl = &ovl;
|
||||
oev = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
oev = CreateEvent(NULL, true, false, NULL);
|
||||
} else {
|
||||
povl = NULL;
|
||||
}
|
||||
@ -141,7 +141,7 @@ static DWORD WINAPI handle_input_threadfunc(void *param)
|
||||
ctx->readerr = 0;
|
||||
if (povl && !readret && ctx->readerr == ERROR_IO_PENDING) {
|
||||
WaitForSingleObject(povl->hEvent, INFINITE);
|
||||
readret = GetOverlappedResult(ctx->h, povl, &ctx->len, FALSE);
|
||||
readret = GetOverlappedResult(ctx->h, povl, &ctx->len, false);
|
||||
if (!readret)
|
||||
ctx->readerr = GetLastError();
|
||||
else
|
||||
@ -223,7 +223,7 @@ static void handle_throttle(struct handle_input *ctx, int backlog)
|
||||
*/
|
||||
if (backlog < MAX_BACKLOG) {
|
||||
SetEvent(ctx->ev_from_main);
|
||||
ctx->busy = TRUE;
|
||||
ctx->busy = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,7 +288,7 @@ static DWORD WINAPI handle_output_threadfunc(void *param)
|
||||
|
||||
if (ctx->flags & HANDLE_FLAG_OVERLAPPED) {
|
||||
povl = &ovl;
|
||||
oev = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
oev = CreateEvent(NULL, true, false, NULL);
|
||||
} else {
|
||||
povl = NULL;
|
||||
}
|
||||
@ -318,7 +318,7 @@ static DWORD WINAPI handle_output_threadfunc(void *param)
|
||||
ctx->writeerr = 0;
|
||||
if (povl && !writeret && GetLastError() == ERROR_IO_PENDING) {
|
||||
writeret = GetOverlappedResult(ctx->h, povl,
|
||||
&ctx->lenwritten, TRUE);
|
||||
&ctx->lenwritten, true);
|
||||
if (!writeret)
|
||||
ctx->writeerr = GetLastError();
|
||||
else
|
||||
@ -354,7 +354,7 @@ static void handle_try_output(struct handle_output *ctx)
|
||||
ctx->buffer = senddata;
|
||||
ctx->len = sendlen;
|
||||
SetEvent(ctx->ev_from_main);
|
||||
ctx->busy = TRUE;
|
||||
ctx->busy = true;
|
||||
} else if (!ctx->busy && bufchain_size(&ctx->queued_data) == 0 &&
|
||||
ctx->outgoingeof == EOF_PENDING) {
|
||||
CloseHandle(ctx->h);
|
||||
@ -440,12 +440,12 @@ struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata,
|
||||
|
||||
h->type = HT_INPUT;
|
||||
h->u.i.h = handle;
|
||||
h->u.i.ev_to_main = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
h->u.i.ev_from_main = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
h->u.i.ev_to_main = CreateEvent(NULL, false, false, NULL);
|
||||
h->u.i.ev_from_main = CreateEvent(NULL, false, false, NULL);
|
||||
h->u.i.gotdata = gotdata;
|
||||
h->u.i.defunct = FALSE;
|
||||
h->u.i.moribund = FALSE;
|
||||
h->u.i.done = FALSE;
|
||||
h->u.i.defunct = false;
|
||||
h->u.i.moribund = false;
|
||||
h->u.i.done = false;
|
||||
h->u.i.privdata = privdata;
|
||||
h->u.i.flags = flags;
|
||||
|
||||
@ -455,7 +455,7 @@ struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata,
|
||||
|
||||
CreateThread(NULL, 0, handle_input_threadfunc,
|
||||
&h->u.i, 0, &in_threadid);
|
||||
h->u.i.busy = TRUE;
|
||||
h->u.i.busy = true;
|
||||
|
||||
return h;
|
||||
}
|
||||
@ -468,12 +468,12 @@ struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata,
|
||||
|
||||
h->type = HT_OUTPUT;
|
||||
h->u.o.h = handle;
|
||||
h->u.o.ev_to_main = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
h->u.o.ev_from_main = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
h->u.o.busy = FALSE;
|
||||
h->u.o.defunct = FALSE;
|
||||
h->u.o.moribund = FALSE;
|
||||
h->u.o.done = FALSE;
|
||||
h->u.o.ev_to_main = CreateEvent(NULL, false, false, NULL);
|
||||
h->u.o.ev_from_main = CreateEvent(NULL, false, false, NULL);
|
||||
h->u.o.busy = false;
|
||||
h->u.o.defunct = false;
|
||||
h->u.o.moribund = false;
|
||||
h->u.o.done = false;
|
||||
h->u.o.privdata = privdata;
|
||||
bufchain_init(&h->u.o.queued_data);
|
||||
h->u.o.outgoingeof = EOF_NO;
|
||||
@ -499,13 +499,13 @@ struct handle *handle_add_foreign_event(HANDLE event,
|
||||
h->u.f.h = INVALID_HANDLE_VALUE;
|
||||
h->u.f.ev_to_main = event;
|
||||
h->u.f.ev_from_main = INVALID_HANDLE_VALUE;
|
||||
h->u.f.defunct = TRUE; /* we have no thread in the first place */
|
||||
h->u.f.moribund = FALSE;
|
||||
h->u.f.done = FALSE;
|
||||
h->u.f.defunct = true; /* we have no thread in the first place */
|
||||
h->u.f.moribund = false;
|
||||
h->u.f.done = false;
|
||||
h->u.f.privdata = NULL;
|
||||
h->u.f.callback = callback;
|
||||
h->u.f.ctx = ctx;
|
||||
h->u.f.busy = TRUE;
|
||||
h->u.f.busy = true;
|
||||
|
||||
if (!handles_by_evtomain)
|
||||
handles_by_evtomain = newtree234(handle_cmp_evtomain);
|
||||
@ -592,7 +592,7 @@ void handle_free(struct handle *h)
|
||||
* we set the moribund flag, which will be noticed next time
|
||||
* an operation completes.
|
||||
*/
|
||||
h->u.g.moribund = TRUE;
|
||||
h->u.g.moribund = true;
|
||||
} else if (h->u.g.defunct) {
|
||||
/*
|
||||
* There isn't even a subthread; we can go straight to
|
||||
@ -605,9 +605,9 @@ void handle_free(struct handle *h)
|
||||
* to die. Set the moribund flag to indicate that it will
|
||||
* want destroying after that.
|
||||
*/
|
||||
h->u.g.moribund = TRUE;
|
||||
h->u.g.done = TRUE;
|
||||
h->u.g.busy = TRUE;
|
||||
h->u.g.moribund = true;
|
||||
h->u.g.done = true;
|
||||
h->u.g.busy = true;
|
||||
SetEvent(h->u.g.ev_from_main);
|
||||
}
|
||||
}
|
||||
@ -642,8 +642,8 @@ void handle_got_event(HANDLE event)
|
||||
if (h->u.g.done) {
|
||||
handle_destroy(h);
|
||||
} else {
|
||||
h->u.g.done = TRUE;
|
||||
h->u.g.busy = TRUE;
|
||||
h->u.g.done = true;
|
||||
h->u.g.busy = true;
|
||||
SetEvent(h->u.g.ev_from_main);
|
||||
}
|
||||
return;
|
||||
@ -653,7 +653,7 @@ void handle_got_event(HANDLE event)
|
||||
int backlog;
|
||||
|
||||
case HT_INPUT:
|
||||
h->u.i.busy = FALSE;
|
||||
h->u.i.busy = false;
|
||||
|
||||
/*
|
||||
* A signal on an input handle means data has arrived.
|
||||
@ -662,7 +662,7 @@ void handle_got_event(HANDLE event)
|
||||
/*
|
||||
* EOF, or (nearly equivalently) read error.
|
||||
*/
|
||||
h->u.i.defunct = TRUE;
|
||||
h->u.i.defunct = true;
|
||||
h->u.i.gotdata(h, NULL, -h->u.i.readerr);
|
||||
} else {
|
||||
backlog = h->u.i.gotdata(h, h->u.i.buffer, h->u.i.len);
|
||||
@ -671,7 +671,7 @@ void handle_got_event(HANDLE event)
|
||||
break;
|
||||
|
||||
case HT_OUTPUT:
|
||||
h->u.o.busy = FALSE;
|
||||
h->u.o.busy = false;
|
||||
|
||||
/*
|
||||
* A signal on an output handle means we have completed a
|
||||
@ -684,7 +684,7 @@ void handle_got_event(HANDLE event)
|
||||
* and mark the thread as defunct (because the output
|
||||
* thread is terminating by now).
|
||||
*/
|
||||
h->u.o.defunct = TRUE;
|
||||
h->u.o.defunct = true;
|
||||
h->u.o.sentdata(h, -h->u.o.writeerr);
|
||||
} else {
|
||||
bufchain_consume(&h->u.o.queued_data, h->u.o.lenwritten);
|
||||
|
@ -42,10 +42,10 @@ void init_help(void)
|
||||
help_path = NULL;
|
||||
strcpy(r, PUTTY_HELP_CONTENTS);
|
||||
if ( (fp = fopen(b, "r")) != NULL) {
|
||||
help_has_contents = TRUE;
|
||||
help_has_contents = true;
|
||||
fclose(fp);
|
||||
} else
|
||||
help_has_contents = FALSE;
|
||||
help_has_contents = false;
|
||||
|
||||
#ifndef NO_HTMLHELP
|
||||
strcpy(r, PUTTY_CHM_FILE);
|
||||
@ -120,7 +120,7 @@ void launch_help(HWND hwnd, const char *topic)
|
||||
help_has_contents ? HELP_FINDER : HELP_CONTENTS, 0);
|
||||
}
|
||||
}
|
||||
requested_help = TRUE;
|
||||
requested_help = true;
|
||||
}
|
||||
|
||||
void quit_help(HWND hwnd)
|
||||
@ -134,6 +134,6 @@ void quit_help(HWND hwnd)
|
||||
if (help_path) {
|
||||
WinHelp(hwnd, help_path, HELP_QUIT, 0);
|
||||
}
|
||||
requested_help = FALSE;
|
||||
requested_help = false;
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ static void sk_handle_close(Socket *s)
|
||||
HandleSocket *hs = container_of(s, HandleSocket, sock);
|
||||
|
||||
if (hs->defer_close) {
|
||||
hs->deferred_close = TRUE;
|
||||
hs->deferred_close = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -185,10 +185,10 @@ static void handle_socket_unfreeze(void *hsv)
|
||||
* Hand it off to the plug. Be careful of re-entrance - that might
|
||||
* have the effect of trying to close this socket.
|
||||
*/
|
||||
hs->defer_close = TRUE;
|
||||
hs->defer_close = true;
|
||||
plug_receive(hs->plug, 0, data, len);
|
||||
bufchain_consume(&hs->inputdata, len);
|
||||
hs->defer_close = FALSE;
|
||||
hs->defer_close = false;
|
||||
if (hs->deferred_close) {
|
||||
sk_handle_close(&hs->sock);
|
||||
return;
|
||||
@ -346,7 +346,7 @@ Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H,
|
||||
hs->stderr_h = handle_input_new(hs->stderr_H, handle_stderr,
|
||||
hs, flags);
|
||||
|
||||
hs->defer_close = hs->deferred_close = FALSE;
|
||||
hs->defer_close = hs->deferred_close = false;
|
||||
|
||||
return &hs->sock;
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ static void update_jumplist_from_registry(void)
|
||||
IObjectArray *array = NULL;
|
||||
IShellLink *link = NULL;
|
||||
IObjectArray *pRemoved = NULL;
|
||||
int need_abort = FALSE;
|
||||
int need_abort = false;
|
||||
|
||||
/*
|
||||
* Create an ICustomDestinationList: the top-level object which
|
||||
@ -513,7 +513,7 @@ static void update_jumplist_from_registry(void)
|
||||
if (!SUCCEEDED(pCDL->lpVtbl->BeginList(pCDL, &num_items,
|
||||
COMPTR(IObjectArray, &pRemoved))))
|
||||
goto cleanup;
|
||||
need_abort = TRUE;
|
||||
need_abort = true;
|
||||
if (!SUCCEEDED(pRemoved->lpVtbl->GetCount(pRemoved, &nremoved)))
|
||||
nremoved = 0;
|
||||
|
||||
@ -543,7 +543,7 @@ static void update_jumplist_from_registry(void)
|
||||
/*
|
||||
* Check that the link isn't in the user-removed list.
|
||||
*/
|
||||
for (i = 0, found = FALSE; i < nremoved && !found; i++) {
|
||||
for (i = 0, found = false; i < nremoved && !found; i++) {
|
||||
IShellLink *rlink;
|
||||
if (SUCCEEDED(pRemoved->lpVtbl->GetAt
|
||||
(pRemoved, i, COMPTR(IShellLink, &rlink)))) {
|
||||
@ -553,7 +553,7 @@ static void update_jumplist_from_registry(void)
|
||||
SUCCEEDED(rlink->lpVtbl->GetDescription
|
||||
(rlink, desc2, sizeof(desc2)-1)) &&
|
||||
!strcmp(desc1, desc2)) {
|
||||
found = TRUE;
|
||||
found = true;
|
||||
}
|
||||
rlink->lpVtbl->Release(rlink);
|
||||
}
|
||||
@ -656,7 +656,7 @@ static void update_jumplist_from_registry(void)
|
||||
* Commit the jump list.
|
||||
*/
|
||||
pCDL->lpVtbl->CommitList(pCDL);
|
||||
need_abort = FALSE;
|
||||
need_abort = false;
|
||||
|
||||
/*
|
||||
* Clean up.
|
||||
@ -738,12 +738,12 @@ BOOL set_explicit_app_user_model_id()
|
||||
{
|
||||
if (p_SetCurrentProcessExplicitAppUserModelID(L"SimonTatham.PuTTY") == S_OK)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* Function doesn't exist, which is ok for Pre-7 systems */
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
@ -81,12 +81,12 @@ char *get_username(void)
|
||||
{
|
||||
DWORD namelen;
|
||||
char *user;
|
||||
int got_username = FALSE;
|
||||
int got_username = false;
|
||||
DECL_WINDOWS_FUNCTION(static, BOOLEAN, GetUserNameExA,
|
||||
(EXTENDED_NAME_FORMAT, LPSTR, PULONG));
|
||||
|
||||
{
|
||||
static int tried_usernameex = FALSE;
|
||||
static int tried_usernameex = false;
|
||||
if (!tried_usernameex) {
|
||||
/* Not available on Win9x, so load dynamically */
|
||||
HMODULE secur32 = load_system32_dll("secur32.dll");
|
||||
@ -97,7 +97,7 @@ char *get_username(void)
|
||||
HMODULE sspicli = load_system32_dll("sspicli.dll");
|
||||
(void)sspicli; /* squash compiler warning about unused variable */
|
||||
GET_WINDOWS_FUNCTION(secur32, GetUserNameExA);
|
||||
tried_usernameex = TRUE;
|
||||
tried_usernameex = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ char *get_username(void)
|
||||
if (!got_username) {
|
||||
/* Fall back to local user name */
|
||||
namelen = 0;
|
||||
if (GetUserName(NULL, &namelen) == FALSE) {
|
||||
if (GetUserName(NULL, &namelen) == false) {
|
||||
/*
|
||||
* Apparently this doesn't work at least on Windows XP SP2.
|
||||
* Thus assume a maximum of 256. It will fail again if it
|
||||
@ -604,7 +604,7 @@ int open_for_write_would_lose_data(const Filename *fn)
|
||||
* let the subsequent attempt to open the file for real give a
|
||||
* more useful error message.
|
||||
*/
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (attrs.dwFileAttributes & (FILE_ATTRIBUTE_DEVICE |
|
||||
FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
@ -613,7 +613,7 @@ int open_for_write_would_lose_data(const Filename *fn)
|
||||
* opening it for writing will not cause truncation. (It may
|
||||
* not _succeed_ either, but that's not our problem here!)
|
||||
*/
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (attrs.nFileSizeHigh == 0 && attrs.nFileSizeLow == 0) {
|
||||
/*
|
||||
@ -622,7 +622,7 @@ int open_for_write_would_lose_data(const Filename *fn)
|
||||
* opening it for writing won't truncate any data away because
|
||||
* there's nothing to truncate anyway.
|
||||
*/
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -213,14 +213,14 @@ int sk_startup(int hi, int lo)
|
||||
winsock_ver = MAKEWORD(hi, lo);
|
||||
|
||||
if (p_WSAStartup(winsock_ver, &wsadata)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (LOBYTE(wsadata.wVersion) != LOBYTE(winsock_ver)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Actually define this function pointer, which won't have been
|
||||
@ -524,9 +524,9 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname,
|
||||
#ifndef NO_IPV6
|
||||
ret->ais = NULL;
|
||||
#endif
|
||||
ret->namedpipe = FALSE;
|
||||
ret->namedpipe = false;
|
||||
ret->addresses = NULL;
|
||||
ret->resolved = FALSE;
|
||||
ret->resolved = false;
|
||||
ret->refcount = 1;
|
||||
*realhost = '\0';
|
||||
|
||||
@ -549,7 +549,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname,
|
||||
sfree(trimmed_host);
|
||||
}
|
||||
if (err == 0)
|
||||
ret->resolved = TRUE;
|
||||
ret->resolved = true;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@ -558,7 +558,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname,
|
||||
* (NOTE: we don't use gethostbyname as a fallback!)
|
||||
*/
|
||||
if ( (h = p_gethostbyname(host)) )
|
||||
ret->resolved = TRUE;
|
||||
ret->resolved = true;
|
||||
else
|
||||
err = p_WSAGetLastError();
|
||||
}
|
||||
@ -614,7 +614,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname,
|
||||
ret->addresses = snewn(1, unsigned long);
|
||||
ret->naddresses = 1;
|
||||
ret->addresses[0] = p_ntohl(a);
|
||||
ret->resolved = TRUE;
|
||||
ret->resolved = true;
|
||||
strncpy(realhost, host, sizeof(realhost));
|
||||
}
|
||||
realhost[lenof(realhost)-1] = '\0';
|
||||
@ -627,11 +627,11 @@ SockAddr *sk_nonamelookup(const char *host)
|
||||
{
|
||||
SockAddr *ret = snew(SockAddr);
|
||||
ret->error = NULL;
|
||||
ret->resolved = FALSE;
|
||||
ret->resolved = false;
|
||||
#ifndef NO_IPV6
|
||||
ret->ais = NULL;
|
||||
#endif
|
||||
ret->namedpipe = FALSE;
|
||||
ret->namedpipe = false;
|
||||
ret->addresses = NULL;
|
||||
ret->naddresses = 0;
|
||||
ret->refcount = 1;
|
||||
@ -644,11 +644,11 @@ SockAddr *sk_namedpipe_addr(const char *pipename)
|
||||
{
|
||||
SockAddr *ret = snew(SockAddr);
|
||||
ret->error = NULL;
|
||||
ret->resolved = FALSE;
|
||||
ret->resolved = false;
|
||||
#ifndef NO_IPV6
|
||||
ret->ais = NULL;
|
||||
#endif
|
||||
ret->namedpipe = TRUE;
|
||||
ret->namedpipe = true;
|
||||
ret->addresses = NULL;
|
||||
ret->naddresses = 0;
|
||||
ret->refcount = 1;
|
||||
@ -663,16 +663,16 @@ int sk_nextaddr(SockAddr *addr, SockAddrStep *step)
|
||||
if (step->ai) {
|
||||
if (step->ai->ai_next) {
|
||||
step->ai = step->ai->ai_next;
|
||||
return TRUE;
|
||||
return true;
|
||||
} else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (step->curraddr+1 < addr->naddresses) {
|
||||
step->curraddr++;
|
||||
return TRUE;
|
||||
return true;
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,7 +741,7 @@ static SockAddr sk_extractaddr_tmp(
|
||||
|
||||
int sk_addr_needs_port(SockAddr *addr)
|
||||
{
|
||||
return addr->namedpipe ? FALSE : TRUE;
|
||||
return addr->namedpipe ? false : true;
|
||||
}
|
||||
|
||||
int sk_hostname_is_local(const char *name)
|
||||
@ -851,7 +851,7 @@ void sk_addrcopy(SockAddr *addr, char *buf)
|
||||
memcpy(buf, &((struct sockaddr_in6 *)step.ai->ai_addr)->sin6_addr,
|
||||
sizeof(struct in6_addr));
|
||||
else
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
} else
|
||||
#endif
|
||||
if (family == AF_INET) {
|
||||
@ -1015,17 +1015,17 @@ static DWORD try_connect(NetSocket *sock)
|
||||
SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0);
|
||||
|
||||
if (sock->oobinline) {
|
||||
BOOL b = TRUE;
|
||||
BOOL b = true;
|
||||
p_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *) &b, sizeof(b));
|
||||
}
|
||||
|
||||
if (sock->nodelay) {
|
||||
BOOL b = TRUE;
|
||||
BOOL b = true;
|
||||
p_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (void *) &b, sizeof(b));
|
||||
}
|
||||
|
||||
if (sock->keepalive) {
|
||||
BOOL b = TRUE;
|
||||
BOOL b = true;
|
||||
p_setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (void *) &b, sizeof(b));
|
||||
}
|
||||
|
||||
@ -1470,7 +1470,7 @@ void try_send(NetSocket *s)
|
||||
* a small number - so we check that case and treat
|
||||
* it just like WSAEWOULDBLOCK.)
|
||||
*/
|
||||
s->writable = FALSE;
|
||||
s->writable = false;
|
||||
return;
|
||||
} else {
|
||||
/*
|
||||
|
@ -21,7 +21,7 @@ static HMODULE wincrypt_module = NULL;
|
||||
|
||||
int win_read_random(void *buf, unsigned wanted)
|
||||
{
|
||||
int toret = FALSE;
|
||||
int toret = false;
|
||||
HCRYPTPROV crypt_provider;
|
||||
|
||||
if (!wincrypt_module) {
|
||||
|
@ -80,7 +80,7 @@ Socket *new_named_pipe_client(const char *pipename, Plug *plug)
|
||||
|
||||
LocalFree(psd);
|
||||
|
||||
return make_handle_socket(pipehandle, pipehandle, NULL, plug, TRUE);
|
||||
return make_handle_socket(pipehandle, pipehandle, NULL, plug, true);
|
||||
}
|
||||
|
||||
#endif /* !defined NO_SECURITY */
|
||||
|
@ -80,7 +80,7 @@ static int create_named_pipe(NamedPipeServerSocket *ps, int first_instance)
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.nLength = sizeof(sa);
|
||||
sa.lpSecurityDescriptor = ps->psd;
|
||||
sa.bInheritHandle = FALSE;
|
||||
sa.bInheritHandle = false;
|
||||
|
||||
ps->pipehandle = CreateNamedPipe
|
||||
(/* lpName */
|
||||
@ -117,7 +117,7 @@ static Socket *named_pipe_accept(accept_ctx_t ctx, Plug *plug)
|
||||
{
|
||||
HANDLE conn = (HANDLE)ctx.p;
|
||||
|
||||
return make_handle_socket(conn, conn, NULL, plug, TRUE);
|
||||
return make_handle_socket(conn, conn, NULL, plug, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -136,7 +136,7 @@ static void named_pipe_accept_loop(NamedPipeServerSocket *ps,
|
||||
if (got_one_already) {
|
||||
/* If we were called with a connection already waiting,
|
||||
* skip this step. */
|
||||
got_one_already = FALSE;
|
||||
got_one_already = false;
|
||||
error = 0;
|
||||
} else {
|
||||
/*
|
||||
@ -173,7 +173,7 @@ static void named_pipe_accept_loop(NamedPipeServerSocket *ps,
|
||||
CloseHandle(conn);
|
||||
}
|
||||
|
||||
if (!create_named_pipe(ps, FALSE)) {
|
||||
if (!create_named_pipe(ps, false)) {
|
||||
error = GetLastError();
|
||||
} else {
|
||||
/*
|
||||
@ -196,7 +196,7 @@ static void named_pipe_accept_loop(NamedPipeServerSocket *ps,
|
||||
static void named_pipe_connect_callback(void *vps)
|
||||
{
|
||||
NamedPipeServerSocket *ps = (NamedPipeServerSocket *)vps;
|
||||
named_pipe_accept_loop(ps, TRUE);
|
||||
named_pipe_accept_loop(ps, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -234,18 +234,18 @@ Socket *new_named_pipe_listener(const char *pipename, Plug *plug)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!create_named_pipe(ret, TRUE)) {
|
||||
if (!create_named_pipe(ret, true)) {
|
||||
ret->error = dupprintf("unable to create named pipe '%s': %s",
|
||||
pipename, win_strerror(GetLastError()));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
memset(&ret->connect_ovl, 0, sizeof(ret->connect_ovl));
|
||||
ret->connect_ovl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
ret->connect_ovl.hEvent = CreateEvent(NULL, true, false, NULL);
|
||||
ret->callback_handle =
|
||||
handle_add_foreign_event(ret->connect_ovl.hEvent,
|
||||
named_pipe_connect_callback, ret);
|
||||
named_pipe_accept_loop(ret, FALSE);
|
||||
named_pipe_accept_loop(ret, false);
|
||||
|
||||
cleanup:
|
||||
return &ret->sock;
|
||||
|
@ -171,7 +171,7 @@ static INT_PTR CALLBACK PassphraseProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
p = (struct PassphraseProcStruct *) lParam;
|
||||
@ -233,7 +233,7 @@ static int prompt_keyfile(HWND hwnd, char *dlgtitle,
|
||||
of.lpstrFileTitle = NULL;
|
||||
of.lpstrTitle = dlgtitle;
|
||||
of.Flags = 0;
|
||||
return request_file(NULL, &of, FALSE, save);
|
||||
return request_file(NULL, &of, false, save);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -256,7 +256,7 @@ static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
SetDlgItemText(hwnd, 1000, LICENCE_TEXT("\r\n\r\n"));
|
||||
@ -296,7 +296,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
{
|
||||
@ -493,9 +493,9 @@ void ui_set_state(HWND hwnd, struct MainDlgState *state, int status)
|
||||
|
||||
switch (status) {
|
||||
case 0: /* no key */
|
||||
hidemany(hwnd, nokey_ids, FALSE);
|
||||
hidemany(hwnd, generating_ids, TRUE);
|
||||
hidemany(hwnd, gotkey_ids, TRUE);
|
||||
hidemany(hwnd, nokey_ids, false);
|
||||
hidemany(hwnd, generating_ids, true);
|
||||
hidemany(hwnd, gotkey_ids, true);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_GENERATE), 1);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_LOAD), 1);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_SAVE), 0);
|
||||
@ -526,9 +526,9 @@ void ui_set_state(HWND hwnd, struct MainDlgState *state, int status)
|
||||
MF_GRAYED|MF_BYCOMMAND);
|
||||
break;
|
||||
case 1: /* generating key */
|
||||
hidemany(hwnd, nokey_ids, TRUE);
|
||||
hidemany(hwnd, generating_ids, FALSE);
|
||||
hidemany(hwnd, gotkey_ids, TRUE);
|
||||
hidemany(hwnd, nokey_ids, true);
|
||||
hidemany(hwnd, generating_ids, false);
|
||||
hidemany(hwnd, gotkey_ids, true);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_GENERATE), 0);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_LOAD), 0);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_SAVE), 0);
|
||||
@ -559,9 +559,9 @@ void ui_set_state(HWND hwnd, struct MainDlgState *state, int status)
|
||||
MF_GRAYED|MF_BYCOMMAND);
|
||||
break;
|
||||
case 2:
|
||||
hidemany(hwnd, nokey_ids, TRUE);
|
||||
hidemany(hwnd, generating_ids, TRUE);
|
||||
hidemany(hwnd, gotkey_ids, FALSE);
|
||||
hidemany(hwnd, nokey_ids, true);
|
||||
hidemany(hwnd, generating_ids, true);
|
||||
hidemany(hwnd, gotkey_ids, false);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_GENERATE), 1);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_LOAD), 1);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_SAVE), 1);
|
||||
@ -739,7 +739,7 @@ void load_key_file(HWND hwnd, struct MainDlgState *state,
|
||||
if (type == SSH_KEYTYPE_SSH1) {
|
||||
char *fingerprint, *savecomment;
|
||||
|
||||
state->ssh2 = FALSE;
|
||||
state->ssh2 = false;
|
||||
state->commentptr = &state->key.comment;
|
||||
state->key = newkey1;
|
||||
|
||||
@ -764,7 +764,7 @@ void load_key_file(HWND hwnd, struct MainDlgState *state,
|
||||
char *fp;
|
||||
char *savecomment;
|
||||
|
||||
state->ssh2 = TRUE;
|
||||
state->ssh2 = true;
|
||||
state->commentptr =
|
||||
&state->ssh2key.comment;
|
||||
state->ssh2key = *newkey2; /* structure copy */
|
||||
@ -789,7 +789,7 @@ void load_key_file(HWND hwnd, struct MainDlgState *state,
|
||||
* the key data.
|
||||
*/
|
||||
ui_set_state(hwnd, state, 2);
|
||||
state->key_exists = TRUE;
|
||||
state->key_exists = true;
|
||||
|
||||
/*
|
||||
* If the user has imported a foreign key
|
||||
@ -841,7 +841,7 @@ static void start_generating_key(HWND hwnd, struct MainDlgState *state)
|
||||
MB_OK | MB_ICONERROR);
|
||||
sfree(params);
|
||||
} else {
|
||||
state->generation_thread_exists = TRUE;
|
||||
state->generation_thread_exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -871,10 +871,10 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
(LPARAM) LoadIcon(hinst, MAKEINTRESOURCE(200)));
|
||||
|
||||
state = snew(struct MainDlgState);
|
||||
state->generation_thread_exists = FALSE;
|
||||
state->collecting_entropy = FALSE;
|
||||
state->generation_thread_exists = false;
|
||||
state->collecting_entropy = false;
|
||||
state->entropy = NULL;
|
||||
state->key_exists = FALSE;
|
||||
state->key_exists = false;
|
||||
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) state);
|
||||
{
|
||||
HMENU menu, menu1;
|
||||
@ -935,7 +935,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
{
|
||||
@ -1012,7 +1012,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
endbox(&cp);
|
||||
}
|
||||
ui_set_key_type(hwnd, state, IDC_KEYSSH2RSA);
|
||||
SetDlgItemInt(hwnd, IDC_BITS, DEFAULT_KEY_BITS, FALSE);
|
||||
SetDlgItemInt(hwnd, IDC_BITS, DEFAULT_KEY_BITS, false);
|
||||
SendDlgItemMessage(hwnd, IDC_CURVE, CB_SETCURSEL,
|
||||
DEFAULT_CURVE_INDEX, 0);
|
||||
|
||||
@ -1049,7 +1049,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
random_add_heavynoise(state->entropy, state->entropy_size);
|
||||
smemclr(state->entropy, state->entropy_size);
|
||||
sfree(state->entropy);
|
||||
state->collecting_entropy = FALSE;
|
||||
state->collecting_entropy = false;
|
||||
|
||||
start_generating_key(hwnd, state);
|
||||
}
|
||||
@ -1114,7 +1114,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
unsigned raw_entropy_required;
|
||||
unsigned char *raw_entropy_buf;
|
||||
BOOL ok;
|
||||
state->key_bits = GetDlgItemInt(hwnd, IDC_BITS, &ok, FALSE);
|
||||
state->key_bits = GetDlgItemInt(hwnd, IDC_BITS, &ok, false);
|
||||
if (!ok)
|
||||
state->key_bits = DEFAULT_KEY_BITS;
|
||||
{
|
||||
@ -1147,7 +1147,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
if (ret != IDOK)
|
||||
break;
|
||||
state->key_bits = DEFAULT_KEY_BITS;
|
||||
SetDlgItemInt(hwnd, IDC_BITS, DEFAULT_KEY_BITS, FALSE);
|
||||
SetDlgItemInt(hwnd, IDC_BITS, DEFAULT_KEY_BITS, false);
|
||||
} else if ((state->keytype == RSA || state->keytype == DSA) &&
|
||||
state->key_bits < DEFAULT_KEY_BITS) {
|
||||
char *message = dupprintf
|
||||
@ -1201,8 +1201,8 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
|
||||
ui_set_state(hwnd, state, 1);
|
||||
SetDlgItemText(hwnd, IDC_GENERATING, entropy_msg);
|
||||
state->key_exists = FALSE;
|
||||
state->collecting_entropy = TRUE;
|
||||
state->key_exists = false;
|
||||
state->collecting_entropy = true;
|
||||
|
||||
state->entropy_got = 0;
|
||||
state->entropy_size = (state->entropy_required *
|
||||
@ -1392,8 +1392,8 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
|
||||
return 0;
|
||||
case WM_DONEKEY:
|
||||
state = (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||
state->generation_thread_exists = FALSE;
|
||||
state->key_exists = TRUE;
|
||||
state->generation_thread_exists = false;
|
||||
state->key_exists = true;
|
||||
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETRANGE, 0,
|
||||
MAKELPARAM(0, PROGRESSRANGE));
|
||||
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETPOS, PROGRESSRANGE, 0);
|
||||
|
@ -58,7 +58,7 @@ static HMENU systray_menu, session_menu;
|
||||
static int already_running;
|
||||
|
||||
static char *putty_path;
|
||||
static int restrict_putty_acl = FALSE;
|
||||
static int restrict_putty_acl = false;
|
||||
|
||||
/* CWD for "add key" file requester. */
|
||||
static filereq *keypath = NULL;
|
||||
@ -222,7 +222,7 @@ static INT_PTR CALLBACK PassphraseProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
SetForegroundWindow(hwnd);
|
||||
@ -467,7 +467,7 @@ static void prompt_add_keyfile(void)
|
||||
of.lpstrFileTitle = NULL;
|
||||
of.lpstrTitle = "Select Private Key File";
|
||||
of.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER;
|
||||
if (request_file(keypath, &of, TRUE, FALSE)) {
|
||||
if (request_file(keypath, &of, true, false)) {
|
||||
if(strlen(filelist) > of.nFileOffset) {
|
||||
/* Only one filename returned? */
|
||||
Filename *fn = filename_from_str(filelist);
|
||||
@ -520,7 +520,7 @@ static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
|
||||
MoveWindow(hwnd,
|
||||
(rs.right + rs.left + rd.left - rd.right) / 2,
|
||||
(rs.bottom + rs.top + rd.top - rd.bottom) / 2,
|
||||
rd.right - rd.left, rd.bottom - rd.top, TRUE);
|
||||
rd.right - rd.left, rd.bottom - rd.top, true);
|
||||
}
|
||||
|
||||
if (has_help())
|
||||
@ -715,7 +715,7 @@ static void update_sessions(void)
|
||||
mii.fState = MFS_ENABLED;
|
||||
mii.wID = (index_menu * 16) + IDM_SESSIONS_BASE;
|
||||
mii.dwTypeData = session_name;
|
||||
InsertMenuItem(session_menu, index_menu, TRUE, &mii);
|
||||
InsertMenuItem(session_menu, index_menu, true, &mii);
|
||||
index_menu++;
|
||||
}
|
||||
index_key++;
|
||||
@ -729,7 +729,7 @@ static void update_sessions(void)
|
||||
mii.fType = MFT_STRING;
|
||||
mii.fState = MFS_GRAYED;
|
||||
mii.dwTypeData = _T("(No sessions)");
|
||||
InsertMenuItem(session_menu, index_menu, TRUE, &mii);
|
||||
InsertMenuItem(session_menu, index_menu, true, &mii);
|
||||
}
|
||||
}
|
||||
|
||||
@ -748,7 +748,7 @@ PSID get_default_sid(void)
|
||||
PSECURITY_DESCRIPTOR psd = NULL;
|
||||
PSID sid = NULL, copy = NULL, ret = NULL;
|
||||
|
||||
if ((proc = OpenProcess(MAXIMUM_ALLOWED, FALSE,
|
||||
if ((proc = OpenProcess(MAXIMUM_ALLOWED, false,
|
||||
GetCurrentProcessId())) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
@ -795,7 +795,7 @@ static void pageant_reply_BinarySink_write(
|
||||
memcpy(rep->buf + rep->len, data, len);
|
||||
rep->len += len;
|
||||
} else {
|
||||
rep->overflowed = TRUE;
|
||||
rep->overflowed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -821,7 +821,7 @@ static char *answer_filemapping_message(const char *mapname)
|
||||
debug(("mapname = \"%s\"\n", mapname));
|
||||
#endif
|
||||
|
||||
maphandle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, mapname);
|
||||
maphandle = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, mapname);
|
||||
if (maphandle == NULL || maphandle == INVALID_HANDLE_VALUE) {
|
||||
err = dupprintf("OpenFileMapping(\"%s\"): %s",
|
||||
mapname, win_strerror(GetLastError()));
|
||||
@ -928,7 +928,7 @@ static char *answer_filemapping_message(const char *mapname)
|
||||
reply.buf = (char *)mapaddr + 4;
|
||||
reply.size = mapsize - 4;
|
||||
reply.len = 0;
|
||||
reply.overflowed = FALSE;
|
||||
reply.overflowed = false;
|
||||
BinarySink_INIT(&reply, pageant_reply_BinarySink_write);
|
||||
|
||||
if (msglen > mapsize - 4) {
|
||||
@ -939,7 +939,7 @@ static char *answer_filemapping_message(const char *mapname)
|
||||
(unsigned char *)mapaddr + 4, msglen, NULL, NULL);
|
||||
if (reply.overflowed) {
|
||||
reply.len = 0;
|
||||
reply.overflowed = FALSE;
|
||||
reply.overflowed = false;
|
||||
pageant_failure_msg(BinarySink_UPCAST(&reply),
|
||||
"output would overflow message buffer",
|
||||
NULL, NULL);
|
||||
@ -993,7 +993,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
PostMessage(hwnd, WM_SYSTRAY2, cursorpos.x, cursorpos.y);
|
||||
} else if (lParam == WM_LBUTTONDBLCLK) {
|
||||
/* Run the default menu item. */
|
||||
UINT menuitem = GetMenuDefaultItem(systray_menu, FALSE, 0);
|
||||
UINT menuitem = GetMenuDefaultItem(systray_menu, false, 0);
|
||||
if (menuitem != -1)
|
||||
PostMessage(hwnd, WM_COMMAND, menuitem, 0);
|
||||
}
|
||||
@ -1085,7 +1085,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
mii.fMask = MIIM_TYPE;
|
||||
mii.cch = MAX_PATH;
|
||||
mii.dwTypeData = buf;
|
||||
GetMenuItemInfo(session_menu, wParam, FALSE, &mii);
|
||||
GetMenuItemInfo(session_menu, wParam, false, &mii);
|
||||
param[0] = '\0';
|
||||
if (restrict_putty_acl)
|
||||
strcat(param, "&R");
|
||||
@ -1258,7 +1258,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
restrict_process_acl();
|
||||
} else if (!strcmp(argv[i], "-restrict-putty-acl") ||
|
||||
!strcmp(argv[i], "-restrict_putty_acl")) {
|
||||
restrict_putty_acl = TRUE;
|
||||
restrict_putty_acl = true;
|
||||
} else if (!strcmp(argv[i], "-c")) {
|
||||
/*
|
||||
* If we see `-c', then the rest of the
|
||||
@ -1274,7 +1274,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
Filename *fn = filename_from_str(argv[i]);
|
||||
win_add_keyfile(fn);
|
||||
filename_free(fn);
|
||||
added_keys = TRUE;
|
||||
added_keys = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1356,7 +1356,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
initial_menuitems_count = GetMenuItemCount(session_menu);
|
||||
|
||||
/* Set the default menu item. */
|
||||
SetMenuDefaultItem(systray_menu, IDM_VIEWKEYS, FALSE);
|
||||
SetMenuDefaultItem(systray_menu, IDM_VIEWKEYS, false);
|
||||
|
||||
ShowWindow(hwnd, SW_HIDE);
|
||||
|
||||
|
@ -20,9 +20,9 @@ int agent_exists(void)
|
||||
HWND hwnd;
|
||||
hwnd = FindWindow("Pageant", "Pageant");
|
||||
if (!hwnd)
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void agent_cancel_query(agent_pending_query *q)
|
||||
@ -75,9 +75,9 @@ agent_pending_query *agent_query(
|
||||
if (psd) {
|
||||
if (p_InitializeSecurityDescriptor
|
||||
(psd, SECURITY_DESCRIPTOR_REVISION) &&
|
||||
p_SetSecurityDescriptorOwner(psd, usersid, FALSE)) {
|
||||
p_SetSecurityDescriptorOwner(psd, usersid, false)) {
|
||||
sa.nLength = sizeof(sa);
|
||||
sa.bInheritHandle = TRUE;
|
||||
sa.bInheritHandle = true;
|
||||
sa.lpSecurityDescriptor = psd;
|
||||
psa = &sa;
|
||||
} else {
|
||||
|
@ -42,7 +42,7 @@ static Conf *conf;
|
||||
|
||||
int term_ldisc(Terminal *term, int mode)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
static void plink_echoedit_update(Seat *seat, int echo, int edit)
|
||||
{
|
||||
@ -75,7 +75,7 @@ static int plink_output(Seat *seat, int is_stderr, const void *data, int len)
|
||||
static int plink_eof(Seat *seat)
|
||||
{
|
||||
handle_write_eof(stdout_handle);
|
||||
return FALSE; /* do not respond to incoming EOF with outgoing */
|
||||
return false; /* do not respond to incoming EOF with outgoing */
|
||||
}
|
||||
|
||||
static int plink_get_userpass_input(Seat *seat, prompts_t *p, bufchain *input)
|
||||
@ -254,8 +254,8 @@ void stdouterr_sent(struct handle *h, int new_backlog)
|
||||
}
|
||||
}
|
||||
|
||||
const int share_can_be_downstream = TRUE;
|
||||
const int share_can_be_upstream = TRUE;
|
||||
const int share_can_be_downstream = true;
|
||||
const int share_can_be_upstream = true;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@ -265,7 +265,7 @@ int main(int argc, char **argv)
|
||||
int exitcode;
|
||||
int errors;
|
||||
int use_subsystem = 0;
|
||||
int just_test_share_exists = FALSE;
|
||||
int just_test_share_exists = false;
|
||||
unsigned long now, next, then;
|
||||
const struct BackendVtable *vt;
|
||||
|
||||
@ -292,7 +292,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
conf = conf_new();
|
||||
do_defaults(NULL, conf);
|
||||
loaded_session = FALSE;
|
||||
loaded_session = false;
|
||||
default_protocol = conf_get_int(conf, CONF_protocol);
|
||||
default_port = conf_get_int(conf, CONF_port);
|
||||
errors = 0;
|
||||
@ -336,7 +336,7 @@ int main(int argc, char **argv)
|
||||
pgp_fingerprints();
|
||||
exit(1);
|
||||
} else if (!strcmp(p, "-shareexists")) {
|
||||
just_test_share_exists = TRUE;
|
||||
just_test_share_exists = true;
|
||||
} else if (*p != '-') {
|
||||
char *command;
|
||||
int cmdlen, cmdsize;
|
||||
@ -362,7 +362,7 @@ int main(int argc, char **argv)
|
||||
/* change trailing blank to NUL */
|
||||
conf_set_str(conf, CONF_remote_cmd, command);
|
||||
conf_set_str(conf, CONF_remote_cmd2, "");
|
||||
conf_set_int(conf, CONF_nopty, TRUE); /* command => no tty */
|
||||
conf_set_int(conf, CONF_nopty, true); /* command => no tty */
|
||||
|
||||
break; /* done with cmdline */
|
||||
} else {
|
||||
@ -389,7 +389,7 @@ int main(int argc, char **argv)
|
||||
* Apply subsystem status.
|
||||
*/
|
||||
if (use_subsystem)
|
||||
conf_set_int(conf, CONF_ssh_subsys, TRUE);
|
||||
conf_set_int(conf, CONF_ssh_subsys, true);
|
||||
|
||||
if (!*conf_get_str(conf, CONF_remote_cmd) &&
|
||||
!*conf_get_str(conf, CONF_remote_cmd2) &&
|
||||
@ -422,7 +422,7 @@ int main(int argc, char **argv)
|
||||
!conf_get_int(conf, CONF_x11_forward) &&
|
||||
!conf_get_int(conf, CONF_agentfwd) &&
|
||||
!conf_get_str_nthstrkey(conf, CONF_portfwd, 0))
|
||||
conf_set_int(conf, CONF_ssh_simple, TRUE);
|
||||
conf_set_int(conf, CONF_ssh_simple, true);
|
||||
|
||||
logctx = log_init(default_logpolicy, conf);
|
||||
|
||||
@ -446,7 +446,7 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
* Start up the connection.
|
||||
*/
|
||||
netevent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
netevent = CreateEvent(NULL, false, false, NULL);
|
||||
{
|
||||
const char *error;
|
||||
char *realhost;
|
||||
@ -488,7 +488,7 @@ int main(int argc, char **argv)
|
||||
|
||||
main_thread_id = GetCurrentThreadId();
|
||||
|
||||
sending = FALSE;
|
||||
sending = false;
|
||||
|
||||
now = GETTICKCOUNT();
|
||||
|
||||
@ -501,7 +501,7 @@ int main(int argc, char **argv)
|
||||
if (!sending && backend_sendok(backend)) {
|
||||
stdin_handle = handle_input_new(inhandle, stdin_gotdata, NULL,
|
||||
0);
|
||||
sending = TRUE;
|
||||
sending = true;
|
||||
}
|
||||
|
||||
if (toplevel_callback_pending()) {
|
||||
@ -523,7 +523,7 @@ int main(int argc, char **argv)
|
||||
handles = handle_get_events(&nhandles);
|
||||
handles = sresize(handles, nhandles+1, HANDLE);
|
||||
handles[nhandles] = netevent;
|
||||
n = MsgWaitForMultipleObjects(nhandles+1, handles, FALSE, ticks,
|
||||
n = MsgWaitForMultipleObjects(nhandles+1, handles, false, ticks,
|
||||
QS_POSTMESSAGE);
|
||||
if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
|
||||
handle_got_event(handles[n - WAIT_OBJECT_0]);
|
||||
|
@ -32,7 +32,7 @@ DECL_WINDOWS_FUNCTION(static, BOOL, WritePrinter,
|
||||
|
||||
static void init_winfuncs(void)
|
||||
{
|
||||
static int initialised = FALSE;
|
||||
static int initialised = false;
|
||||
if (initialised)
|
||||
return;
|
||||
{
|
||||
@ -53,7 +53,7 @@ static void init_winfuncs(void)
|
||||
GET_WINDOWS_FUNCTION_PP(winspool_module, EndPagePrinter);
|
||||
GET_WINDOWS_FUNCTION_PP(winspool_module, WritePrinter);
|
||||
}
|
||||
initialised = TRUE;
|
||||
initialised = true;
|
||||
}
|
||||
|
||||
static int printer_add_enum(int param, DWORD level, char **buffer,
|
||||
@ -80,11 +80,11 @@ static int printer_add_enum(int param, DWORD level, char **buffer,
|
||||
|
||||
if (p_EnumPrinters(param, NULL, level, (LPBYTE)((*buffer)+offset),
|
||||
needed, &needed, &nprinters) == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
*nprinters_ptr += nprinters;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
printer_enum *printer_start_enum(int *nprinters_ptr)
|
||||
|
@ -48,7 +48,7 @@ Socket *platform_new_connection(SockAddr *addr, const char *hostname,
|
||||
*/
|
||||
sa.nLength = sizeof(sa);
|
||||
sa.lpSecurityDescriptor = NULL; /* default */
|
||||
sa.bInheritHandle = TRUE;
|
||||
sa.bInheritHandle = true;
|
||||
if (!CreatePipe(&us_from_cmd, &cmd_to_us, &sa, 0)) {
|
||||
sfree(cmd);
|
||||
return new_error_socket_fmt(
|
||||
@ -91,7 +91,7 @@ Socket *platform_new_connection(SockAddr *addr, const char *hostname,
|
||||
si.hStdInput = cmd_from_us;
|
||||
si.hStdOutput = cmd_to_us;
|
||||
si.hStdError = cmd_err_to_us;
|
||||
CreateProcess(NULL, cmd, NULL, NULL, TRUE,
|
||||
CreateProcess(NULL, cmd, NULL, NULL, true,
|
||||
CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS,
|
||||
NULL, NULL, &si, &pi);
|
||||
CloseHandle(pi.hProcess);
|
||||
@ -106,5 +106,5 @@ Socket *platform_new_connection(SockAddr *addr, const char *hostname,
|
||||
CloseHandle(cmd_err_to_us);
|
||||
|
||||
return make_handle_socket(us_to_cmd, us_from_cmd, us_from_cmd_err,
|
||||
plug, FALSE);
|
||||
plug, false);
|
||||
}
|
||||
|
@ -18,12 +18,12 @@ static PSID worldsid, networksid, usersid;
|
||||
|
||||
int got_advapi(void)
|
||||
{
|
||||
static int attempted = FALSE;
|
||||
static int attempted = false;
|
||||
static int successful;
|
||||
static HMODULE advapi;
|
||||
|
||||
if (!attempted) {
|
||||
attempted = TRUE;
|
||||
attempted = true;
|
||||
advapi = load_system32_dll("advapi32.dll");
|
||||
successful = advapi &&
|
||||
GET_WINDOWS_FUNCTION(advapi, GetSecurityInfo) &&
|
||||
@ -50,7 +50,7 @@ PSID get_user_sid(void)
|
||||
if (!got_advapi())
|
||||
goto cleanup;
|
||||
|
||||
if ((proc = OpenProcess(MAXIMUM_ALLOWED, FALSE,
|
||||
if ((proc = OpenProcess(MAXIMUM_ALLOWED, false,
|
||||
GetCurrentProcessId())) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
@ -104,7 +104,7 @@ int getsids(char **error)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
int ret = FALSE;
|
||||
int ret = false;
|
||||
|
||||
*error = NULL;
|
||||
|
||||
@ -135,7 +135,7 @@ int getsids(char **error)
|
||||
}
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
|
||||
cleanup:
|
||||
return ret;
|
||||
@ -149,7 +149,7 @@ int make_private_security_descriptor(DWORD permissions,
|
||||
{
|
||||
EXPLICIT_ACCESS ea[3];
|
||||
int acl_err;
|
||||
int ret = FALSE;
|
||||
int ret = false;
|
||||
|
||||
|
||||
*psd = NULL;
|
||||
@ -197,19 +197,19 @@ int make_private_security_descriptor(DWORD permissions,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!SetSecurityDescriptorOwner(*psd, usersid, FALSE)) {
|
||||
if (!SetSecurityDescriptorOwner(*psd, usersid, false)) {
|
||||
*error = dupprintf("unable to set owner in security descriptor: %s",
|
||||
win_strerror(GetLastError()));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!SetSecurityDescriptorDacl(*psd, TRUE, *acl, FALSE)) {
|
||||
if (!SetSecurityDescriptorDacl(*psd, true, *acl, false)) {
|
||||
*error = dupprintf("unable to set DACL in security descriptor: %s",
|
||||
win_strerror(GetLastError()));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
|
||||
cleanup:
|
||||
if (!ret) {
|
||||
@ -232,7 +232,7 @@ static int really_restrict_process_acl(char **error)
|
||||
{
|
||||
EXPLICIT_ACCESS ea[2];
|
||||
int acl_err;
|
||||
int ret=FALSE;
|
||||
int ret=false;
|
||||
PACL acl = NULL;
|
||||
|
||||
static const DWORD nastyace=WRITE_DAC | WRITE_OWNER |
|
||||
@ -279,7 +279,7 @@ static int really_restrict_process_acl(char **error)
|
||||
}
|
||||
|
||||
|
||||
ret=TRUE;
|
||||
ret=true;
|
||||
|
||||
cleanup:
|
||||
if (!ret) {
|
||||
@ -317,7 +317,7 @@ void restrict_process_acl(void)
|
||||
#if !defined NO_SECURITY
|
||||
ret = really_restrict_process_acl(&error);
|
||||
#else
|
||||
ret = FALSE;
|
||||
ret = false;
|
||||
error = dupstr("ACL restrictions not compiled into this binary");
|
||||
#endif
|
||||
if (!ret)
|
||||
|
@ -46,9 +46,9 @@ PSID get_user_sid(void);
|
||||
* servers, i.e. allowing access only to the current user id and also
|
||||
* only local (i.e. not over SMB) connections.
|
||||
*
|
||||
* If this function returns TRUE, then 'psd' and 'acl' will have been
|
||||
* If this function returns true, then 'psd' and 'acl' will have been
|
||||
* filled in with memory allocated using LocalAlloc (and hence must be
|
||||
* freed later using LocalFree). If it returns FALSE, then instead
|
||||
* freed later using LocalFree). If it returns false, then instead
|
||||
* 'error' has been filled with a dynamically allocated error message.
|
||||
*/
|
||||
int make_private_security_descriptor(DWORD permissions,
|
||||
|
@ -107,18 +107,18 @@ static const char *serial_configure(Serial *serial, HANDLE serport, Conf *conf)
|
||||
/*
|
||||
* Boilerplate.
|
||||
*/
|
||||
dcb.fBinary = TRUE;
|
||||
dcb.fBinary = true;
|
||||
dcb.fDtrControl = DTR_CONTROL_ENABLE;
|
||||
dcb.fDsrSensitivity = FALSE;
|
||||
dcb.fTXContinueOnXoff = FALSE;
|
||||
dcb.fOutX = FALSE;
|
||||
dcb.fInX = FALSE;
|
||||
dcb.fErrorChar = FALSE;
|
||||
dcb.fNull = FALSE;
|
||||
dcb.fDsrSensitivity = false;
|
||||
dcb.fTXContinueOnXoff = false;
|
||||
dcb.fOutX = false;
|
||||
dcb.fInX = false;
|
||||
dcb.fErrorChar = false;
|
||||
dcb.fNull = false;
|
||||
dcb.fRtsControl = RTS_CONTROL_ENABLE;
|
||||
dcb.fAbortOnError = FALSE;
|
||||
dcb.fOutxCtsFlow = FALSE;
|
||||
dcb.fOutxDsrFlow = FALSE;
|
||||
dcb.fAbortOnError = false;
|
||||
dcb.fOutxCtsFlow = false;
|
||||
dcb.fOutxDsrFlow = false;
|
||||
|
||||
/*
|
||||
* Configurable parameters.
|
||||
@ -151,17 +151,17 @@ static const char *serial_configure(Serial *serial, HANDLE serport, Conf *conf)
|
||||
str = "no";
|
||||
break;
|
||||
case SER_FLOW_XONXOFF:
|
||||
dcb.fOutX = dcb.fInX = TRUE;
|
||||
dcb.fOutX = dcb.fInX = true;
|
||||
str = "XON/XOFF";
|
||||
break;
|
||||
case SER_FLOW_RTSCTS:
|
||||
dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;
|
||||
dcb.fOutxCtsFlow = TRUE;
|
||||
dcb.fOutxCtsFlow = true;
|
||||
str = "RTS/CTS";
|
||||
break;
|
||||
case SER_FLOW_DSRDTR:
|
||||
dcb.fDtrControl = DTR_CONTROL_HANDSHAKE;
|
||||
dcb.fOutxDsrFlow = TRUE;
|
||||
dcb.fOutxDsrFlow = true;
|
||||
str = "DSR/DTR";
|
||||
break;
|
||||
}
|
||||
@ -204,7 +204,7 @@ static const char *serial_init(Seat *seat, Backend **backend_handle,
|
||||
serial->port = INVALID_HANDLE_VALUE;
|
||||
serial->out = serial->in = NULL;
|
||||
serial->bufsize = 0;
|
||||
serial->break_in_progress = FALSE;
|
||||
serial->break_in_progress = false;
|
||||
serial->backend.vt = &serial_backend;
|
||||
*backend_handle = &serial->backend;
|
||||
|
||||
@ -329,7 +329,7 @@ static void serbreak_timer(void *ctx, unsigned long now)
|
||||
|
||||
if (now == serial->clearbreak_time && serial->port) {
|
||||
ClearCommBreak(serial->port);
|
||||
serial->break_in_progress = FALSE;
|
||||
serial->break_in_progress = false;
|
||||
logevent(serial->logctx, "Finished serial break");
|
||||
}
|
||||
}
|
||||
@ -356,7 +356,7 @@ static void serial_special(Backend *be, SessionSpecialCode code, int arg)
|
||||
*/
|
||||
serial->clearbreak_time =
|
||||
schedule_timer(TICKSPERSEC * 2 / 5, serbreak_timer, serial);
|
||||
serial->break_in_progress = TRUE;
|
||||
serial->break_in_progress = true;
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -25,7 +25,7 @@ void platform_get_x11_auth(struct X11Display *display, Conf *conf)
|
||||
{
|
||||
/* Do nothing, therefore no auth. */
|
||||
}
|
||||
const int platform_uses_x11_unix_by_default = TRUE;
|
||||
const int platform_uses_x11_unix_by_default = true;
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* File access abstraction.
|
||||
@ -440,12 +440,12 @@ void finish_wildcard_matching(WildcardMatcher *dir)
|
||||
int vet_filename(const char *name)
|
||||
{
|
||||
if (strchr(name, '/') || strchr(name, '\\') || strchr(name, ':'))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!name[strspn(name, ".")]) /* entirely composed of dots */
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int create_directory(const char *name)
|
||||
@ -479,7 +479,7 @@ char *do_select(SOCKET skt, int startup)
|
||||
if (startup) {
|
||||
events = (FD_CONNECT | FD_READ | FD_WRITE |
|
||||
FD_OOB | FD_CLOSE | FD_ACCEPT);
|
||||
netevent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
netevent = CreateEvent(NULL, false, false, NULL);
|
||||
} else {
|
||||
events = 0;
|
||||
}
|
||||
@ -534,7 +534,7 @@ int do_eventsel_loop(HANDLE other_event)
|
||||
else
|
||||
otherindex = -1;
|
||||
|
||||
n = WaitForMultipleObjects(nallhandles, handles, FALSE, ticks);
|
||||
n = WaitForMultipleObjects(nallhandles, handles, false, ticks);
|
||||
|
||||
if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
|
||||
handle_got_event(handles[n - WAIT_OBJECT_0]);
|
||||
@ -721,7 +721,7 @@ char *ssh_sftp_get_cmdline(const char *prompt, int no_fds_ok)
|
||||
* Create a second thread to read from stdin. Process network
|
||||
* and timing events until it terminates.
|
||||
*/
|
||||
ctx->event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
ctx->event = CreateEvent(NULL, false, false, NULL);
|
||||
ctx->line = NULL;
|
||||
|
||||
hThread = CreateThread(NULL, 0, command_read_thread, ctx, 0, &threadid);
|
||||
|
@ -161,9 +161,9 @@ int platform_ssh_share(const char *pi_name, Conf *conf,
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.nLength = sizeof(sa);
|
||||
sa.lpSecurityDescriptor = psd;
|
||||
sa.bInheritHandle = FALSE;
|
||||
sa.bInheritHandle = false;
|
||||
|
||||
mutex = CreateMutex(&sa, FALSE, mutexname);
|
||||
mutex = CreateMutex(&sa, false, mutexname);
|
||||
|
||||
if (!mutex) {
|
||||
*logtext = dupprintf("CreateMutex(\"%s\") failed: %s",
|
||||
|
@ -24,7 +24,7 @@ static const char *const puttystr = PUTTY_REG_POS "\\Sessions";
|
||||
|
||||
static const char hex[16] = "0123456789ABCDEF";
|
||||
|
||||
static int tried_shgetfolderpath = FALSE;
|
||||
static int tried_shgetfolderpath = false;
|
||||
static HMODULE shell32_module = NULL;
|
||||
DECL_WINDOWS_FUNCTION(static, HRESULT, SHGetFolderPathA,
|
||||
(HWND, int, HANDLE, DWORD, LPSTR));
|
||||
@ -511,7 +511,7 @@ static int try_random_seed(char const *path, int action, HANDLE *ret)
|
||||
win_strerror(GetLastError()));
|
||||
}
|
||||
*ret = INVALID_HANDLE_VALUE;
|
||||
return FALSE; /* so we'll do the next ones too */
|
||||
return false; /* so we'll do the next ones too */
|
||||
}
|
||||
|
||||
*ret = CreateFile(path,
|
||||
@ -576,7 +576,7 @@ static HANDLE access_random_seed(int action)
|
||||
* so stuff that. */
|
||||
shell32_module = load_system32_dll("shell32.dll");
|
||||
GET_WINDOWS_FUNCTION(shell32_module, SHGetFolderPathA);
|
||||
tried_shgetfolderpath = TRUE;
|
||||
tried_shgetfolderpath = true;
|
||||
}
|
||||
if (p_SHGetFolderPathA) {
|
||||
if (SUCCEEDED(p_SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA,
|
||||
|
@ -622,7 +622,7 @@ BOOL set_explicit_app_user_model_id();
|
||||
/*
|
||||
* Exports from winnoise.c.
|
||||
*/
|
||||
int win_read_random(void *buf, unsigned wanted); /* returns TRUE on success */
|
||||
int win_read_random(void *buf, unsigned wanted); /* returns true on success */
|
||||
|
||||
/*
|
||||
* Extra functions in winstore.c over and above the interface in
|
||||
@ -654,7 +654,7 @@ char *get_jumplist_registry_entries(void);
|
||||
#define CLIPNAME_EXPLICIT "System clipboard"
|
||||
#define CLIPNAME_EXPLICIT_OBJECT "system clipboard"
|
||||
/* These defaults are the ones PuTTY has historically had */
|
||||
#define CLIPUI_DEFAULT_AUTOCOPY TRUE
|
||||
#define CLIPUI_DEFAULT_AUTOCOPY true
|
||||
#define CLIPUI_DEFAULT_MOUSE CLIPUI_EXPLICIT
|
||||
#define CLIPUI_DEFAULT_INS CLIPUI_EXPLICIT
|
||||
|
||||
|
@ -16,4 +16,4 @@ void platform_get_x11_auth(struct X11Display *disp, Conf *conf)
|
||||
x11_get_auth_from_authfile(disp, xauthpath);
|
||||
}
|
||||
|
||||
const int platform_uses_x11_unix_by_default = FALSE;
|
||||
const int platform_uses_x11_unix_by_default = false;
|
||||
|
Reference in New Issue
Block a user