#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
#include "putty.h"
+#include "pageant.h" /* for AGENT_MAX_MSGLEN */
#ifndef NO_SECURITY
#include "winsecur.h"
#endif
#define AGENT_COPYDATA_ID 0x804e50ba /* random goop */
-#define AGENT_MAX_MSGLEN 8192
int agent_exists(void)
{
return TRUE;
}
-int agent_query(void *in, int inlen, void **out, int *outlen,
- void (*callback)(void *, void *, int), void *callback_ctx)
+void agent_cancel_query(agent_pending_query *q)
+{
+ assert(0 && "Windows agent queries are never asynchronous!");
+}
+
+agent_pending_query *agent_query(
+ void *in, int inlen, void **out, int *outlen,
+ void (*callback)(void *, void *, int), void *callback_ctx)
{
HWND hwnd;
char *mapname;
hwnd = FindWindow("Pageant", "Pageant");
if (!hwnd)
- return 1; /* *out == NULL, so failure */
+ return NULL; /* *out == NULL, so failure */
mapname = dupprintf("PageantRequest%08x", (unsigned)GetCurrentThreadId());
psa = NULL;
0, AGENT_MAX_MSGLEN, mapname);
if (filemap == NULL || filemap == INVALID_HANDLE_VALUE) {
sfree(mapname);
- return 1; /* *out == NULL, so failure */
+ return NULL; /* *out == NULL, so failure */
}
p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
memcpy(p, in, inlen);
sfree(mapname);
if (psd)
LocalFree(psd);
- return 1;
+ return NULL;
}