2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsUserInfo.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "windows.h"
|
|
|
|
#include "nsCRT.h"
|
|
|
|
#include "nsXPIDLString.h"
|
|
|
|
|
|
|
|
nsUserInfo::nsUserInfo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsUserInfo::~nsUserInfo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo)
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsUserInfo::GetUsername(char **aUsername)
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
*aUsername = nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-07-07 15:57:08 -07:00
|
|
|
PRUnichar username[256];
|
2007-03-22 10:30:00 -07:00
|
|
|
DWORD size = 256;
|
|
|
|
|
2008-07-07 15:57:08 -07:00
|
|
|
if (!GetUserNameW(username, &size))
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_ERROR_FAILURE;
|
2008-07-07 15:57:08 -07:00
|
|
|
|
|
|
|
*aUsername = ToNewUTF8String(nsDependentString(username));
|
2011-04-29 03:38:26 -07:00
|
|
|
|
|
|
|
return (*aUsername) ? NS_OK : NS_ERROR_FAILURE;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsUserInfo::GetFullname(PRUnichar **aFullname)
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
*aFullname = nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsUserInfo::GetDomain(char * *aDomain)
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
*aDomain = nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsUserInfo::GetEmailAddress(char * *aEmailAddress)
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
*aEmailAddress = nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|