Various tweaks to header comments to remind me which bits are meant to be
[u/mdw/putty] / winmisc.c
index 10c9fe3..2357ea6 100644 (file)
--- a/winmisc.c
+++ b/winmisc.c
@@ -1,12 +1,10 @@
 /*
- * winmisc.c: miscellaneous Windows-specific things.
+ * winmisc.c: miscellaneous Windows-specific things
  */
 
-#include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "putty.h"
-#include "winstuff.h"
 
 OSVERSIONINFO osVersion;
 
@@ -39,6 +37,21 @@ int filename_is_null(Filename fn)
     return !*fn.path;
 }
 
+char *get_username(void)
+{
+    DWORD namelen;
+    char *user;
+
+    namelen = 0;
+    if (GetUserName(NULL, &namelen) == FALSE)
+       return NULL;
+
+    user = snewn(namelen, char);
+    GetUserName(user, &namelen);
+
+    return user;
+}
+
 int SaneDialogBox(HINSTANCE hinst,
                  LPCTSTR tmpl,
                  HWND hwndparent,