mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Remove agent_schedule_callback().
This is another piece of the old 2003 attempt at async agent requests. Nothing ever calls this function (in particular, the new working version of async-agent doesn't need it). Remove it completely, and all its special-window-message implementations too. (If we _were_ still using this function, then it would surely be possible to fold it into the more recently introduced general toplevel-callback system, and get rid of all this single-use special code. But we're not, so removing it completely is even easier.) In particular, this system was the only reason why Windows Plink paid any attention to its message queue. So now I can make it call plain WaitForMultipleObjects instead of MsgWaitForMultipleObjects.
This commit is contained in:
parent
4ea811a0bf
commit
9da36bd897
6
pscp.c
6
pscp.c
@ -129,12 +129,6 @@ static PRINTF_LIKE(2, 3) void tell_user(FILE *stream, const char *fmt, ...)
|
|||||||
sfree(str2);
|
sfree(str2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void agent_schedule_callback(void (*callback)(void *, void *, int),
|
|
||||||
void *callback_ctx, void *data, int len)
|
|
||||||
{
|
|
||||||
unreachable("all PSCP agent requests should be synchronous");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Receive a block of data from the SSH link. Block until all data
|
* Receive a block of data from the SSH link. Block until all data
|
||||||
* is available.
|
* is available.
|
||||||
|
6
psftp.c
6
psftp.c
@ -2430,12 +2430,6 @@ static bool verbose = false;
|
|||||||
|
|
||||||
void ldisc_echoedit_update(Ldisc *ldisc) { }
|
void ldisc_echoedit_update(Ldisc *ldisc) { }
|
||||||
|
|
||||||
void agent_schedule_callback(void (*callback)(void *, void *, int),
|
|
||||||
void *callback_ctx, void *data, int len)
|
|
||||||
{
|
|
||||||
unreachable("all PSFTP agent requests should be synchronous");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Receive a block of data from the SSH link. Block until all data
|
* Receive a block of data from the SSH link. Block until all data
|
||||||
* is available.
|
* is available.
|
||||||
|
@ -67,8 +67,7 @@
|
|||||||
|
|
||||||
#define WM_IGNORE_CLIP (WM_APP + 2)
|
#define WM_IGNORE_CLIP (WM_APP + 2)
|
||||||
#define WM_FULLSCR_ON_MAX (WM_APP + 3)
|
#define WM_FULLSCR_ON_MAX (WM_APP + 3)
|
||||||
#define WM_AGENT_CALLBACK (WM_APP + 4)
|
#define WM_GOT_CLIPDATA (WM_APP + 4)
|
||||||
#define WM_GOT_CLIPDATA (WM_APP + 6)
|
|
||||||
|
|
||||||
/* Needed for Chinese support and apparently not always defined. */
|
/* Needed for Chinese support and apparently not always defined. */
|
||||||
#ifndef VK_PROCESSKEY
|
#ifndef VK_PROCESSKEY
|
||||||
@ -158,13 +157,6 @@ int vtmode;
|
|||||||
|
|
||||||
static struct sesslist sesslist; /* for saved-session menu */
|
static struct sesslist sesslist; /* for saved-session menu */
|
||||||
|
|
||||||
struct agent_callback {
|
|
||||||
void (*callback)(void *, void *, int);
|
|
||||||
void *callback_ctx;
|
|
||||||
void *data;
|
|
||||||
int len;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define FONT_NORMAL 0
|
#define FONT_NORMAL 0
|
||||||
#define FONT_BOLD 1
|
#define FONT_BOLD 1
|
||||||
#define FONT_UNDERLINE 2
|
#define FONT_UNDERLINE 2
|
||||||
@ -3339,13 +3331,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
term_invalidate(term);
|
term_invalidate(term);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_AGENT_CALLBACK:
|
|
||||||
{
|
|
||||||
struct agent_callback *c = (struct agent_callback *)lParam;
|
|
||||||
c->callback(c->callback_ctx, c->data, c->len);
|
|
||||||
sfree(c);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
case WM_GOT_CLIPDATA:
|
case WM_GOT_CLIPDATA:
|
||||||
process_clipdata((HGLOBAL)lParam, wParam);
|
process_clipdata((HGLOBAL)lParam, wParam);
|
||||||
return 0;
|
return 0;
|
||||||
@ -5815,17 +5800,6 @@ static int win_seat_get_userpass_input(
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void agent_schedule_callback(void (*callback)(void *, void *, int),
|
|
||||||
void *callback_ctx, void *data, int len)
|
|
||||||
{
|
|
||||||
struct agent_callback *c = snew(struct agent_callback);
|
|
||||||
c->callback = callback;
|
|
||||||
c->callback_ctx = callback_ctx;
|
|
||||||
c->data = data;
|
|
||||||
c->len = len;
|
|
||||||
PostMessage(hwnd, WM_AGENT_CALLBACK, 0, (LPARAM)c);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool win_seat_set_trust_status(Seat *seat, bool trusted)
|
static bool win_seat_set_trust_status(Seat *seat, bool trusted)
|
||||||
{
|
{
|
||||||
term_set_trust_status(term, trusted);
|
term_set_trust_status(term, trusted);
|
||||||
|
@ -1161,12 +1161,6 @@ void spawn_cmd(const char *cmdline, const char *args, int show)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void agent_schedule_callback(void (*callback)(void *, void *, int),
|
|
||||||
void *callback_ctx, void *data, int len)
|
|
||||||
{
|
|
||||||
unreachable("all Pageant's own agent requests should be synchronous");
|
|
||||||
}
|
|
||||||
|
|
||||||
void logevent(LogContext *logctx, const char *event)
|
void logevent(LogContext *logctx, const char *event)
|
||||||
{
|
{
|
||||||
unreachable("Pageant can't create a LogContext, so this can't be called");
|
unreachable("Pageant can't create a LogContext, so this can't be called");
|
||||||
|
@ -13,15 +13,6 @@
|
|||||||
#include "tree234.h"
|
#include "tree234.h"
|
||||||
#include "winsecur.h"
|
#include "winsecur.h"
|
||||||
|
|
||||||
#define WM_AGENT_CALLBACK (WM_APP + 4)
|
|
||||||
|
|
||||||
struct agent_callback {
|
|
||||||
void (*callback)(void *, void *, int);
|
|
||||||
void *callback_ctx;
|
|
||||||
void *data;
|
|
||||||
int len;
|
|
||||||
};
|
|
||||||
|
|
||||||
void cmdline_error(const char *fmt, ...)
|
void cmdline_error(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -115,17 +106,6 @@ static Seat plink_seat[1] = {{ &plink_seat_vt }};
|
|||||||
|
|
||||||
static DWORD main_thread_id;
|
static DWORD main_thread_id;
|
||||||
|
|
||||||
void agent_schedule_callback(void (*callback)(void *, void *, int),
|
|
||||||
void *callback_ctx, void *data, int len)
|
|
||||||
{
|
|
||||||
struct agent_callback *c = snew(struct agent_callback);
|
|
||||||
c->callback = callback;
|
|
||||||
c->callback_ctx = callback_ctx;
|
|
||||||
c->data = data;
|
|
||||||
c->len = len;
|
|
||||||
PostThreadMessage(main_thread_id, WM_AGENT_CALLBACK, 0, (LPARAM)c);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Short description of parameters.
|
* Short description of parameters.
|
||||||
*/
|
*/
|
||||||
@ -541,8 +521,7 @@ int main(int argc, char **argv)
|
|||||||
handles = handle_get_events(&nhandles);
|
handles = handle_get_events(&nhandles);
|
||||||
handles = sresize(handles, nhandles+1, HANDLE);
|
handles = sresize(handles, nhandles+1, HANDLE);
|
||||||
handles[nhandles] = winselcli_event;
|
handles[nhandles] = winselcli_event;
|
||||||
n = MsgWaitForMultipleObjects(nhandles+1, handles, false, ticks,
|
n = WaitForMultipleObjects(nhandles+1, handles, false, ticks);
|
||||||
QS_POSTMESSAGE);
|
|
||||||
if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
|
if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
|
||||||
handle_got_event(handles[n - WAIT_OBJECT_0]);
|
handle_got_event(handles[n - WAIT_OBJECT_0]);
|
||||||
} else if (n == WAIT_OBJECT_0 + nhandles) {
|
} else if (n == WAIT_OBJECT_0 + nhandles) {
|
||||||
@ -600,15 +579,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (n == WAIT_OBJECT_0 + nhandles + 1) {
|
|
||||||
MSG msg;
|
|
||||||
while (PeekMessage(&msg, INVALID_HANDLE_VALUE,
|
|
||||||
WM_AGENT_CALLBACK, WM_AGENT_CALLBACK,
|
|
||||||
PM_REMOVE)) {
|
|
||||||
struct agent_callback *c = (struct agent_callback *)msg.lParam;
|
|
||||||
c->callback(c->callback_ctx, c->data, c->len);
|
|
||||||
sfree(c);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_toplevel_callbacks();
|
run_toplevel_callbacks();
|
||||||
|
@ -658,14 +658,6 @@ void handle_sink_init(handle_sink *sink, struct handle *h);
|
|||||||
*/
|
*/
|
||||||
char *agent_named_pipe_name(void);
|
char *agent_named_pipe_name(void);
|
||||||
|
|
||||||
/*
|
|
||||||
* winpgntc.c needs to schedule callbacks for asynchronous agent
|
|
||||||
* requests. This has to be done differently in GUI and console, so
|
|
||||||
* there's an exported function used for the purpose.
|
|
||||||
*/
|
|
||||||
void agent_schedule_callback(void (*callback)(void *, void *, int),
|
|
||||||
void *callback_ctx, void *data, int len);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from winser.c.
|
* Exports from winser.c.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user