X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4c48c989a62fba2809d684b30963b4411038fe96..cdd310bb1a216ee7713926b6cd813016fe5343ee:/winmisc.c diff --git a/winmisc.c b/winmisc.c index 10c9fe36..7e58e93d 100644 --- a/winmisc.c +++ b/winmisc.c @@ -2,11 +2,9 @@ * winmisc.c: miscellaneous Windows-specific things. */ -#include #include #include #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,