diff -Nur FzSFtp.orig\NOISE.C FzSFtp.patch\NOISE.C
--- FzSFtp.orig\NOISE.C	Wed Aug 04 18:14:16 2004
+++ FzSFtp.patch\NOISE.C	Sun Mar 13 10:32:34 2005
@@ -18,16 +18,16 @@
 void noise_get_heavy(void (*func) (void *, int))
 {
     HANDLE srch;
-    WIN32_FIND_DATA finddata;
+    WIN32_FIND_DATAA finddata;
     char winpath[MAX_PATH + 3];
 
-    GetWindowsDirectory(winpath, sizeof(winpath));
+    GetWindowsDirectoryA(winpath, sizeof(winpath));
     strcat(winpath, "\\*");
-    srch = FindFirstFile(winpath, &finddata);
+    srch = FindFirstFileA(winpath, &finddata);
     if (srch != INVALID_HANDLE_VALUE) {
 	do {
 	    func(&finddata, sizeof(finddata));
-	} while (FindNextFile(srch, &finddata));
+	} while (FindNextFileA(srch, &finddata));
 	FindClose(srch);
     }
 
diff -Nur FzSFtp.orig\PAGEANTC.C FzSFtp.patch\PAGEANTC.C
--- FzSFtp.orig\PAGEANTC.C	Wed Aug 04 17:43:34 2004
+++ FzSFtp.patch\PAGEANTC.C	Sun Mar 13 10:31:51 2005
@@ -19,7 +19,7 @@
 int agent_exists(void)
 {
     HWND hwnd;
-    hwnd = FindWindow("Pageant", "Pageant");
+    hwnd = FindWindowA("Pageant", "Pageant");
     if (!hwnd)
 	return FALSE;
     else
@@ -85,11 +85,11 @@
     *out = NULL;
     *outlen = 0;
 
-    hwnd = FindWindow("Pageant", "Pageant");
+    hwnd = FindWindowA("Pageant", "Pageant");
     if (!hwnd)
 	return 1;		       /* *out == NULL, so failure */
     mapname = dupprintf("PageantRequest%08x", (unsigned)GetCurrentThreadId());
-    filemap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
+    filemap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
 				0, AGENT_MAX_MSGLEN, mapname);
     if (!filemap)
 	return 1;		       /* *out == NULL, so failure */
diff -Nur FzSFtp.orig\PSFTP.C FzSFtp.patch\PSFTP.C
--- FzSFtp.orig\PSFTP.C	Sun Feb 20 01:00:16 2005
+++ FzSFtp.patch\PSFTP.C	Sun Mar 13 10:47:08 2005
@@ -391,9 +391,9 @@
     }
 
     if (restart)
-	fp = CreateFile(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+	fp = CreateFileA(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
     else
-	fp = CreateFile(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
+	fp = CreateFileA(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
 
     if (fp==INVALID_HANDLE_VALUE)
     {
@@ -508,7 +508,7 @@
 	return 0;
     }
 
-    fp = CreateFile(localfile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+    fp = CreateFileA(localfile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
     if (fp == INVALID_HANDLE_VALUE)
     {
 	FzSFtpIpc_Error1("Unable to open %s", localfile);
@@ -1415,7 +1415,7 @@
 
 	if (!FzSFtpIpc_Init(lpCmdLine))
 	{
-		MessageBox(0, "Error: You can't start FzSFtp directly. It can only by started from FileZilla when connecting to an SFTP server.", "FzSFtp Error", MB_OK);
+		MessageBoxA(0, "Error: You can't start FzSFtp directly. It can only by started from FileZilla when connecting to an SFTP server.", "FzSFtp Error", MB_OK);
 		return 1;
 	}
 
diff -Nur FzSFtp.orig\winmisc.c FzSFtp.patch\winmisc.c
--- FzSFtp.orig\winmisc.c	Wed Aug 04 20:12:52 2004
+++ FzSFtp.patch\winmisc.c	Sun Mar 13 10:41:46 2005
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "putty.h"
-
+#include <tchar.h>
 OSVERSIONINFO osVersion;
 
 void platform_get_x11_auth(char *display, int *proto,
@@ -49,7 +49,7 @@
 	return NULL;
 
     user = snewn(namelen, char);
-    GetUserName(user, &namelen);
+    GetUserNameA(user, &namelen);
 
     return user;
 }
@@ -75,7 +75,7 @@
     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
     wc.hbrBackground = (HBRUSH) (COLOR_BACKGROUND +1);
     wc.lpszMenuName = NULL;
-    wc.lpszClassName = "PuTTYConfigBox";
+    wc.lpszClassName = _T("PuTTYConfigBox");
     RegisterClass(&wc);
 
     hwnd = CreateDialog(hinst, tmpl, hwndparent, lpDialogFunc);
diff -Nur FzSFtp.orig\WINNET.C FzSFtp.patch\WINNET.C
--- FzSFtp.orig\WINNET.C	Thu Aug 05 12:01:42 2004
+++ FzSFtp.patch\WINNET.C	Sun Mar 13 10:32:23 2005
@@ -679,7 +679,7 @@
 	}
 
 	if (len>20480)
-		MessageBox(0, "Error! Please get in contact with Tim.Kosse@gmx.de if this happens frequently.\r\nError: WINNET.C->try_send->len>20480", "Critical error!!!", MB_ICONSTOP);
+		MessageBoxA(0, "Error! Please get in contact with Tim.Kosse@gmx.de if this happens frequently.\r\nError: WINNET.C->try_send->len>20480", "Critical error!!!", MB_ICONSTOP);
 	while (TRUE)
 	{
 		FzSFtpIpc_SendRequest(SFTP_DATAID_CTS_WRITE, len, data);
@@ -959,7 +959,7 @@
       case FD_WRITE:
 	{
 	    int bufsize_before, bufsize_after;
-		MessageBox(0, "FD_WRITE", "FD_WRITE", MB_OK);
+		MessageBoxA(0, "FD_WRITE", "FD_WRITE", MB_OK);
 	    s->writable = 1;
 	    bufsize_before = s->sending_oob + bufchain_size(&s->output_data);
 	    try_send(s);
diff -Nur FzSFtp.orig\winsftp.c FzSFtp.patch\winsftp.c
--- FzSFtp.orig\winsftp.c	Wed Oct 15 00:01:22 2003
+++ FzSFtp.patch\winsftp.c	Sun Mar 13 10:26:18 2005
@@ -135,7 +135,7 @@
 {
     char *ret = NULL;
 
-    if (!SetCurrentDirectory(dir)) {
+    if (!SetCurrentDirectoryA(dir)) {
 	LPVOID message;
 	int i;
 	FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
@@ -159,10 +159,10 @@
 char *psftp_getcwd(void)
 {
     char *ret = snewn(256, char);
-    int len = GetCurrentDirectory(256, ret);
+    int len = GetCurrentDirectoryA(256, ret);
     if (len > 256)
 	ret = sresize(ret, len, char);
-    GetCurrentDirectory(len, ret);
+    GetCurrentDirectoryA(len, ret);
     return ret;
 }
 
@@ -181,7 +181,7 @@
     HANDLE h;
     RFile *ret;
 
-    h = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL,
+    h = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL,
 		   OPEN_EXISTING, 0, 0);
     if (h == INVALID_HANDLE_VALUE)
 	return NULL;
@@ -229,7 +229,7 @@
     HANDLE h;
     WFile *ret;
 
-    h = CreateFile(name, GENERIC_WRITE, 0, NULL,
+    h = CreateFileA(name, GENERIC_WRITE, 0, NULL,
 		   CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
     if (h == INVALID_HANDLE_VALUE)
 	return NULL;
@@ -267,7 +267,7 @@
 int file_type(char *name)
 {
     DWORD attr;
-    attr = GetFileAttributes(name);
+    attr = GetFileAttributesA(name);
     /* We know of no `weird' files under Windows. */
     if (attr == (DWORD)-1)
 	return FILE_TYPE_NONEXISTENT;
@@ -285,13 +285,13 @@
 DirHandle *open_directory(char *name)
 {
     HANDLE h;
-    WIN32_FIND_DATA fdat;
+    WIN32_FIND_DATAA fdat;
     char *findfile;
     DirHandle *ret;
 
     /* To enumerate files in dir `foo', we search for `foo/*'. */
     findfile = dupcat(name, "/*", NULL);
-    h = FindFirstFile(findfile, &fdat);
+    h = FindFirstFileA(findfile, &fdat);
     if (h == INVALID_HANDLE_VALUE)
 	return NULL;
     sfree(findfile);
@@ -305,8 +305,8 @@
 char *read_filename(DirHandle *dir)
 {
     while (!dir->name) {
-	WIN32_FIND_DATA fdat;
-	int ok = FindNextFile(dir->h, &fdat);
+	WIN32_FIND_DATAA fdat;
+	int ok = FindNextFileA(dir->h, &fdat);
 
 	if (!ok)
 	    return NULL;
@@ -338,14 +338,14 @@
 int test_wildcard(char *name, int cmdline)
 {
     HANDLE fh;
-    WIN32_FIND_DATA fdat;
+    WIN32_FIND_DATAA fdat;
 
     /* First see if the exact name exists. */
-    if (GetFileAttributes(name) != (DWORD)-1)
+    if (GetFileAttributesA(name) != (DWORD)-1)
 	return WCTYPE_FILENAME;
 
     /* Otherwise see if a wildcard match finds anything. */
-    fh = FindFirstFile(name, &fdat);
+    fh = FindFirstFileA(name, &fdat);
     if (fh == INVALID_HANDLE_VALUE)
 	return WCTYPE_NONEXISTENT;
 
@@ -386,11 +386,11 @@
 WildcardMatcher *begin_wildcard_matching(char *name)
 {
     HANDLE h;
-    WIN32_FIND_DATA fdat;
+    WIN32_FIND_DATAA fdat;
     WildcardMatcher *ret;
     char *last;
 
-    h = FindFirstFile(name, &fdat);
+    h = FindFirstFileA(name, &fdat);
     if (h == INVALID_HANDLE_VALUE)
 	return NULL;
 
@@ -445,7 +445,7 @@
 
 int create_directory(char *name)
 {
-    return CreateDirectory(name, NULL) != 0;
+    return CreateDirectoryA(name, NULL) != 0;
 }
 
 char *dir_file_cat(char *dir, char *file)
diff -Nur FzSFtp.orig\WINSTORE.C FzSFtp.patch\WINSTORE.C
--- FzSFtp.orig\WINSTORE.C	Wed Aug 04 20:05:00 2004
+++ FzSFtp.patch\WINSTORE.C	Sun Mar 13 10:10:55 2005
@@ -74,14 +74,15 @@
     p = snewn(3 * strlen(sessionname) + 1, char);
     mungestr(sessionname, p);
 
-    ret = RegCreateKey(HKEY_CURRENT_USER, puttystr, &subkey1);
+	// tommy
+    ret = RegCreateKeyA(HKEY_CURRENT_USER, puttystr, &subkey1);
     if (ret != ERROR_SUCCESS) {
 	sfree(p);
         *errmsg = dupprintf("Unable to create registry key\n"
                             "HKEY_CURRENT_USER%s", puttystr);
 	return NULL;
     }
-    ret = RegCreateKey(subkey1, p, &sesskey);
+    ret = RegCreateKeyA(subkey1, p, &sesskey);
     sfree(p);
     RegCloseKey(subkey1);
     if (ret != ERROR_SUCCESS) {
@@ -95,14 +96,14 @@
 void write_setting_s(void *handle, const char *key, const char *value)
 {
     if (handle)
-	RegSetValueEx((HKEY) handle, key, 0, REG_SZ, value,
+	RegSetValueExA((HKEY) handle, key, 0, REG_SZ, value,
 		      1 + strlen(value));
 }
 
 void write_setting_i(void *handle, const char *key, int value)
 {
     if (handle)
-	RegSetValueEx((HKEY) handle, key, 0, REG_DWORD,
+	RegSetValueExA((HKEY) handle, key, 0, REG_DWORD,
 		      (CONST BYTE *) & value, sizeof(value));
 }
 
@@ -122,10 +123,10 @@
     p = snewn(3 * strlen(sessionname) + 1, char);
     mungestr(sessionname, p);
 
-    if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) {
+    if (RegOpenKeyA(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) {
 	sesskey = NULL;
     } else {
-	if (RegOpenKey(subkey1, p, &sesskey) != ERROR_SUCCESS) {
+	if (RegOpenKeyA(subkey1, p, &sesskey) != ERROR_SUCCESS) {
 	    sesskey = NULL;
 	}
 	RegCloseKey(subkey1);
@@ -142,7 +143,7 @@
     size = buflen;
 
     if (!handle ||
-	RegQueryValueEx((HKEY) handle, key, 0,
+	RegQueryValueExA((HKEY) handle, key, 0,
 			&type, buffer, &size) != ERROR_SUCCESS ||
 	type != REG_SZ) return NULL;
     else
@@ -155,7 +156,7 @@
     size = sizeof(val);
 
     if (!handle ||
-	RegQueryValueEx((HKEY) handle, key, 0, &type,
+	RegQueryValueExA((HKEY) handle, key, 0, &type,
 			(BYTE *) & val, &size) != ERROR_SUCCESS ||
 	size != sizeof(val) || type != REG_DWORD)
 	return defvalue;
@@ -222,12 +223,12 @@
     HKEY subkey1;
     char *p;
 
-    if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS)
+    if (RegOpenKeyA(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS)
 	return;
 
     p = snewn(3 * strlen(sessionname) + 1, char);
     mungestr(sessionname, p);
-    RegDeleteKey(subkey1, p);
+    RegDeleteKeyA(subkey1, p);
     sfree(p);
 
     RegCloseKey(subkey1);
@@ -243,7 +244,7 @@
     struct enumsettings *ret;
     HKEY key;
 
-    if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &key) != ERROR_SUCCESS)
+    if (RegOpenKeyA(HKEY_CURRENT_USER, puttystr, &key) != ERROR_SUCCESS)
 	return NULL;
 
     ret = snew(struct enumsettings);
@@ -260,7 +261,7 @@
     struct enumsettings *e = (struct enumsettings *) handle;
     char *otherbuf;
     otherbuf = snewn(3 * buflen, char);
-    if (RegEnumKey(e->key, e->i++, otherbuf, 3 * buflen) == ERROR_SUCCESS) {
+    if (RegEnumKeyA(e->key, e->i++, otherbuf, 3 * buflen) == ERROR_SUCCESS) {
 	unmungestr(otherbuf, buffer, buflen);
 	sfree(otherbuf);
 	return buffer;
@@ -309,12 +310,12 @@
 
     hostkey_regname(regname, hostname, port, keytype);
 
-    if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys",
+    if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys",
 		   &rkey) != ERROR_SUCCESS)
 	return 1;		       /* key does not exist in registry */
 
     readlen = len;
-    ret = RegQueryValueEx(rkey, regname, NULL, &type, otherstr, &readlen);
+    ret = RegQueryValueExA(rkey, regname, NULL, &type, otherstr, &readlen);
 
     if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA &&
 	!strcmp(keytype, "rsa")) {
@@ -326,7 +327,7 @@
 	char *justhost = regname + 1 + strcspn(regname, ":");
 	char *oldstyle = snewn(len + 10, char);	/* safety margin */
 	readlen = len;
-	ret = RegQueryValueEx(rkey, justhost, NULL, &type,
+	ret = RegQueryValueExA(rkey, justhost, NULL, &type,
 			      oldstyle, &readlen);
 
 	if (ret == ERROR_SUCCESS && type == REG_SZ) {
@@ -373,7 +374,7 @@
 	     * wrong, and hyper-cautiously do nothing.
 	     */
 	    if (!strcmp(otherstr, key))
-		RegSetValueEx(rkey, regname, 0, REG_SZ, otherstr,
+		RegSetValueExA(rkey, regname, 0, REG_SZ, otherstr,
 			      strlen(otherstr) + 1);
 	}
     }
@@ -404,10 +405,10 @@
 
     hostkey_regname(regname, hostname, port, keytype);
 
-    if (RegCreateKey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys",
+    if (RegCreateKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys",
 		     &rkey) != ERROR_SUCCESS)
 	return;			       /* key does not exist in registry */
-    RegSetValueEx(rkey, regname, 0, REG_SZ, key, strlen(key) + 1);
+    RegSetValueExA(rkey, regname, 0, REG_SZ, key, strlen(key) + 1);
     RegCloseKey(rkey);
 }
 
@@ -421,9 +422,9 @@
 
     size = sizeof(seedpath);
 
-    if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS, &rkey) ==
+    if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS, &rkey) ==
 	ERROR_SUCCESS) {
-	int ret = RegQueryValueEx(rkey, "RandSeedFile",
+	int ret = RegQueryValueExA(rkey, "RandSeedFile",
 				  0, &type, seedpath, &size);
 	if (ret != ERROR_SUCCESS || type != REG_SZ)
 	    seedpath[0] = '\0';
@@ -435,13 +436,13 @@
 	int len, ret;
 
 	len =
-	    GetEnvironmentVariable("HOMEDRIVE", seedpath,
+	    GetEnvironmentVariableA("HOMEDRIVE", seedpath,
 				   sizeof(seedpath));
 	ret =
-	    GetEnvironmentVariable("HOMEPATH", seedpath + len,
+	    GetEnvironmentVariableA("HOMEPATH", seedpath + len,
 				   sizeof(seedpath) - len);
 	if (ret == 0) {		       /* probably win95; store in \WINDOWS */
-	    GetWindowsDirectory(seedpath, sizeof(seedpath));
+	    GetWindowsDirectoryA(seedpath, sizeof(seedpath));
 	    len = strlen(seedpath);
 	} else
 	    len += ret;
@@ -456,7 +457,7 @@
     if (!seedpath[0])
 	get_seedpath();
 
-    seedf = CreateFile(seedpath, GENERIC_READ,
+    seedf = CreateFileA(seedpath, GENERIC_READ,
 		       FILE_SHARE_READ | FILE_SHARE_WRITE,
 		       NULL, OPEN_EXISTING, 0, NULL);
 
@@ -481,7 +482,7 @@
     if (!seedpath[0])
 	get_seedpath();
 
-    seedf = CreateFile(seedpath, GENERIC_WRITE, 0,
+    seedf = CreateFileA(seedpath, GENERIC_WRITE, 0,
 		       NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
 
     if (seedf != INVALID_HANDLE_VALUE) {
@@ -502,12 +503,12 @@
     HKEY subkey;
 
     i = 0;
-    while (RegEnumKey(key, i, name, sizeof(name)) == ERROR_SUCCESS) {
-	if (RegOpenKey(key, name, &subkey) == ERROR_SUCCESS) {
+    while (RegEnumKeyA(key, i, name, sizeof(name)) == ERROR_SUCCESS) {
+	if (RegOpenKeyA(key, name, &subkey) == ERROR_SUCCESS) {
 	    registry_recursive_remove(subkey);
 	    RegCloseKey(subkey);
 	}
-	RegDeleteKey(key, name);
+	RegDeleteKeyA(key, name);
     }
 }
 
@@ -531,7 +532,7 @@
     /*
      * Open the main PuTTY registry key and remove everything in it.
      */
-    if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS, &key) ==
+    if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS, &key) ==
 	ERROR_SUCCESS) {
 	registry_recursive_remove(key);
 	RegCloseKey(key);
@@ -541,10 +542,10 @@
      * we've done that, see if the parent key has any other
      * children.
      */
-    if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_PARENT,
+    if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_PARENT,
 		   &key) == ERROR_SUCCESS) {
-	RegDeleteKey(key, PUTTY_REG_PARENT_CHILD);
-	ret = RegEnumKey(key, 0, name, sizeof(name));
+	RegDeleteKeyA(key, PUTTY_REG_PARENT_CHILD);
+	ret = RegEnumKeyA(key, 0, name, sizeof(name));
 	RegCloseKey(key);
 	/*
 	 * If the parent key had no other children, we must delete
@@ -552,9 +553,9 @@
 	 * key.
 	 */
 	if (ret != ERROR_SUCCESS) {
-	    if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_GPARENT,
+	    if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_GPARENT,
 			   &key) == ERROR_SUCCESS) {
-		RegDeleteKey(key, PUTTY_REG_GPARENT_CHILD);
+		RegDeleteKeyA(key, PUTTY_REG_GPARENT_CHILD);
 		RegCloseKey(key);
 	    }
 	}
