X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/b51259f6a879f69bec5348bddb604d9b3d499941..799dfcfab944cd604ee0850f37e0dcb07f02d84d:/winmisc.c diff --git a/winmisc.c b/winmisc.c index 10c9fe36..a524b96f 100644 --- a/winmisc.c +++ b/winmisc.c @@ -39,6 +39,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,