diff --git a/mozilla/xpfe/appshell/src/makefile.win b/mozilla/xpfe/appshell/src/makefile.win index f631e454bd1..77f4d58e81e 100644 --- a/mozilla/xpfe/appshell/src/makefile.win +++ b/mozilla/xpfe/appshell/src/makefile.win @@ -46,6 +46,7 @@ CPPSRCS= \ nsDialogParamBlock.cpp \ nsCommonDialogs.cpp \ nsAbout.cpp \ + nsUserInfoWin.cpp \ $(NULL) CPP_OBJS= \ @@ -67,6 +68,7 @@ CPP_OBJS= \ .\$(OBJDIR)\nsDialogParamBlock.obj \ .\$(OBJDIR)\nsCommonDialogs.obj \ .\$(OBJDIR)\nsAbout.obj \ + .\$(OBJDIR)\nsUserInfoWin.obj \ $(NULL) LINCS=-I$(PUBLIC)\raptor \ diff --git a/mozilla/xpfe/appshell/src/nsAppShellFactory.cpp b/mozilla/xpfe/appshell/src/nsAppShellFactory.cpp index 2fffb201ff5..236c5515062 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellFactory.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellFactory.cpp @@ -47,8 +47,8 @@ #include "nsDialogParamBlock.h" #include "nsFileLocations.h" -/* right now, only unix has user info, but mac and windows implementations are coming soon */ -#ifdef XP_UNIX +/* right now, only unix and windows have implementations of nsIUserInfo. mac is coming soon. */ +#if defined(XP_UNIX) || defined(XP_PC) #define HAVE_USER_INFO 1 #endif /* XP_UNIX */ diff --git a/mozilla/xpfe/appshell/src/nsUserInfoWin.cpp b/mozilla/xpfe/appshell/src/nsUserInfoWin.cpp index 7538f01f21e..2d90d0feb58 100644 --- a/mozilla/xpfe/appshell/src/nsUserInfoWin.cpp +++ b/mozilla/xpfe/appshell/src/nsUserInfoWin.cpp @@ -19,11 +19,14 @@ * * Contributor(s): * Doug Turner + * Seth Spitzer */ #include "nsUserInfo.h" #include "nsString.h" #include "windows.h" +#include "nsCRT.h" +#include "nsXPIDLString.h" nsUserInfo::nsUserInfo() { @@ -37,9 +40,9 @@ nsUserInfo::~nsUserInfo() NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo); NS_IMETHODIMP -nsUserInfo::GetFullname(PRUnichar **aFullname) +nsUserInfo::GetUsername(char **aUsername) { - *aFullname = nsnull; + *aUsername = nsnull; TCHAR username[256]; DWORD size = 256; @@ -47,29 +50,30 @@ nsUserInfo::GetFullname(PRUnichar **aFullname) if (!GetUserName(username, &size)) return NS_ERROR_FAILURE; - nsAutoString fullname(username); - *aFullname = fullname.ToNewUnicode(); + *aUsername = nsCRT::strdup(username); - if (*aFullname) - return NS_OK; + if (*aUsername) return NS_OK; return NS_ERROR_FAILURE; } -NS_IMETHODIMP -nsUserInfo::GetEmailAddress(char * *aEmailAddress) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP -nsUserInfo::GetUsername(char * *aUsername) +nsUserInfo::GetFullname(PRUnichar **aFullname) { + *aFullname = nsnull; return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsUserInfo::GetDomain(char * *aDomain) -{ +{ + *aDomain = nsnull; + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +nsUserInfo::GetEmailAddress(char * *aEmailAddress) +{ + *aEmailAddress = nsnull; return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/mozilla/xpfe/components/startup/src/nsUserInfoWin.cpp b/mozilla/xpfe/components/startup/src/nsUserInfoWin.cpp index 7538f01f21e..2d90d0feb58 100644 --- a/mozilla/xpfe/components/startup/src/nsUserInfoWin.cpp +++ b/mozilla/xpfe/components/startup/src/nsUserInfoWin.cpp @@ -19,11 +19,14 @@ * * Contributor(s): * Doug Turner + * Seth Spitzer */ #include "nsUserInfo.h" #include "nsString.h" #include "windows.h" +#include "nsCRT.h" +#include "nsXPIDLString.h" nsUserInfo::nsUserInfo() { @@ -37,9 +40,9 @@ nsUserInfo::~nsUserInfo() NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo); NS_IMETHODIMP -nsUserInfo::GetFullname(PRUnichar **aFullname) +nsUserInfo::GetUsername(char **aUsername) { - *aFullname = nsnull; + *aUsername = nsnull; TCHAR username[256]; DWORD size = 256; @@ -47,29 +50,30 @@ nsUserInfo::GetFullname(PRUnichar **aFullname) if (!GetUserName(username, &size)) return NS_ERROR_FAILURE; - nsAutoString fullname(username); - *aFullname = fullname.ToNewUnicode(); + *aUsername = nsCRT::strdup(username); - if (*aFullname) - return NS_OK; + if (*aUsername) return NS_OK; return NS_ERROR_FAILURE; } -NS_IMETHODIMP -nsUserInfo::GetEmailAddress(char * *aEmailAddress) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP -nsUserInfo::GetUsername(char * *aUsername) +nsUserInfo::GetFullname(PRUnichar **aFullname) { + *aFullname = nsnull; return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsUserInfo::GetDomain(char * *aDomain) -{ +{ + *aDomain = nsnull; + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +nsUserInfo::GetEmailAddress(char * *aEmailAddress) +{ + *aEmailAddress = nsnull; return NS_ERROR_NOT_IMPLEMENTED; }