]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winpgntc.c
Log when -restrict-acl is in use.
[PuTTY.git] / windows / winpgntc.c
index 6e085e424471e62c398fad515a09f6879a17b0f2..cd00f6a3f441540b07bda7fce34e2d93cf6ab5b7 100644 (file)
@@ -4,15 +4,16 @@
 
 #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)
 {
@@ -24,8 +25,14 @@ 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;
@@ -42,7 +49,7 @@ int agent_query(void *in, int inlen, void **out, int *outlen,
 
     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;
@@ -83,7 +90,7 @@ int agent_query(void *in, int inlen, void **out, int *outlen,
                                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);
@@ -111,5 +118,5 @@ int agent_query(void *in, int inlen, void **out, int *outlen,
     sfree(mapname);
     if (psd)
         LocalFree(psd);
-    return 1;
+    return NULL;
 }