]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winmisc.c
Add a new COMPAT option for environments lacking SecureZeroMemory(),
[PuTTY.git] / windows / winmisc.c
index f54e8a4d6e0d2ebea272a6eeea7723e39bc28f33..c74f1e7a6b90164eb3ab39f0c418073554a5a5da 100644 (file)
@@ -68,6 +68,16 @@ Filename *filename_deserialise(void *vdata, int maxsize, int *used)
     return filename_from_str(data);
 }
 
+#ifndef NO_SECUREZEROMEMORY
+/*
+ * Windows implementation of smemclr (see misc.c) using SecureZeroMemory.
+ */
+void smemclr(void *b, size_t n) {
+    if (b && n > 0)
+        SecureZeroMemory(b, n);
+}
+#endif
+
 char *get_username(void)
 {
     DWORD namelen;