mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 14:49:27 +00:00
advapi32: Forward LogonUserA to LogonUserW.
This commit is contained in:
parent
02970b578e
commit
7519cddddb
|
@ -35,6 +35,8 @@
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "advapi32_misc.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -268,10 +270,23 @@ BOOL WINAPI InitiateSystemShutdownW( LPWSTR lpMachineName, LPWSTR lpMessage, DWO
|
||||||
BOOL WINAPI LogonUserA( LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
|
BOOL WINAPI LogonUserA( LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
|
||||||
DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken )
|
DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken )
|
||||||
{
|
{
|
||||||
FIXME("%s %s %p 0x%08x 0x%08x %p - stub\n", debugstr_a(lpszUsername),
|
WCHAR *usernameW = NULL, *domainW = NULL, *passwordW = NULL;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
|
TRACE("%s %s %p 0x%08x 0x%08x %p\n", debugstr_a(lpszUsername),
|
||||||
debugstr_a(lpszDomain), lpszPassword, dwLogonType, dwLogonProvider, phToken);
|
debugstr_a(lpszDomain), lpszPassword, dwLogonType, dwLogonProvider, phToken);
|
||||||
|
|
||||||
return TRUE;
|
if (lpszUsername && !(usernameW = strdupAW( lpszUsername ))) return FALSE;
|
||||||
|
if (lpszDomain && !(domainW = strdupAW( lpszUsername ))) goto done;
|
||||||
|
if (lpszPassword && !(passwordW = strdupAW( lpszPassword ))) goto done;
|
||||||
|
|
||||||
|
ret = LogonUserW( usernameW, domainW, passwordW, dwLogonType, dwLogonProvider, phToken );
|
||||||
|
|
||||||
|
done:
|
||||||
|
heap_free( usernameW );
|
||||||
|
heap_free( domainW );
|
||||||
|
heap_free( passwordW );
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI LogonUserW( LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword,
|
BOOL WINAPI LogonUserW( LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword,
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "ntsecapi.h"
|
#include "ntsecapi.h"
|
||||||
#include "winsvc.h"
|
#include "winsvc.h"
|
||||||
|
#include "winnls.h"
|
||||||
|
|
||||||
const char * debugstr_sid(PSID sid) DECLSPEC_HIDDEN;
|
const char * debugstr_sid(PSID sid) DECLSPEC_HIDDEN;
|
||||||
BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName) DECLSPEC_HIDDEN;
|
BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName) DECLSPEC_HIDDEN;
|
||||||
|
@ -52,4 +53,15 @@ static inline BOOL heap_free( void *mem )
|
||||||
return HeapFree( GetProcessHeap(), 0, mem );
|
return HeapFree( GetProcessHeap(), 0, mem );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline WCHAR *strdupAW( const char *src )
|
||||||
|
{
|
||||||
|
WCHAR *dst = NULL;
|
||||||
|
if (src)
|
||||||
|
{
|
||||||
|
DWORD len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
|
||||||
|
if ((dst = heap_alloc( len * sizeof(WCHAR) ))) MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len );
|
||||||
|
}
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __WINE_ADVAPI32MISC_H */
|
#endif /* __WINE_ADVAPI32MISC_H */
|
||||||
|
|
Loading…
Reference in a new issue