summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_secur.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-21 13:43:29 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-21 13:43:29 +0000
commita6359218bf2588d71c41a9dac62f62d6a36aea30 (patch)
tree787091b58eb36310aba34f88fe77fb5f77c8186a /protocols/JabberG/src/jabber_secur.cpp
parentc69a9c892f52056d452ad8520e6c09b6956f30e3 (diff)
using Uxtheme in protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@6156 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_secur.cpp')
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index 67423b03b4..459c61f9e4 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -24,9 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber.h"
#include "jabber_secur.h"
-typedef BYTE (WINAPI *GetUserNameExType)(int NameFormat, LPTSTR lpNameBuffer, PULONG nSize);
-
-
/////////////////////////////////////////////////////////////////////////////////////////
// ntlm auth - LanServer based authorization
@@ -67,23 +64,13 @@ TNtlmAuth::~TNtlmAuth()
bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
{
- HMODULE hDll = GetModuleHandle(_T("secur32.dll"));
- if ( !hDll)
- hDll = LoadLibrary(_T("secur32.dll"));
- if ( !hDll)
- return false;
-
- GetUserNameExType myGetUserNameEx =
- (GetUserNameExType)GetProcAddress(hDll, "GetUserNameExW");
-
- if ( !myGetUserNameEx) return false;
TCHAR szFullUserName[128] = _T("");
ULONG szFullUserNameLen = SIZEOF(szFullUserName);
- if ( !myGetUserNameEx(12, szFullUserName, &szFullUserNameLen)) {
+ if ( !GetUserNameEx(NameDnsDomain, szFullUserName, &szFullUserNameLen)) {
szFullUserName[ 0 ] = 0;
szFullUserNameLen = SIZEOF(szFullUserName);
- myGetUserNameEx(2, szFullUserName, &szFullUserNameLen);
+ GetUserNameEx(NameSamCompatible, szFullUserName, &szFullUserNameLen);
}
TCHAR *name = _tcsrchr(szFullUserName, '\\');