Author: ekohl
Date: Mon May 23 13:53:24 2016
New Revision: 71385
URL:
http://svn.reactos.org/svn/reactos?rev=71385&view=rev
Log:
[ADVAPI32]
Implement LogonUserEx[A/W].
Modified:
trunk/reactos/dll/win32/advapi32/advapi32.spec
trunk/reactos/dll/win32/advapi32/misc/logon.c
trunk/reactos/sdk/include/psdk/winbase.h
Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Mon May 23 13:53:24 2016
@@ -322,8 +322,8 @@
322 stdcall IsWellKnownSid(ptr long)
323 stdcall LockServiceDatabase(ptr)
324 stdcall LogonUserA(str str str long long ptr)
-325 stub LogonUserExA
-326 stub LogonUserExW
+325 stdcall LogonUserExA(str str str long long ptr ptr ptr ptr ptr)
+326 stdcall LogonUserExW(wstr wstr wstr long long ptr ptr ptr ptr ptr)
327 stdcall LogonUserW(wstr wstr wstr long long ptr)
328 stdcall LookupAccountNameA(str str ptr ptr ptr ptr ptr)
329 stdcall LookupAccountNameW(wstr wstr ptr ptr ptr ptr ptr)
Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Mon May 23 13:53:24 2016
@@ -221,16 +221,49 @@
return TRUE;
}
+
/*
* @implemented
*/
-BOOL WINAPI
-LogonUserA(LPSTR lpszUsername,
- LPSTR lpszDomain,
- LPSTR lpszPassword,
- DWORD dwLogonType,
- DWORD dwLogonProvider,
- PHANDLE phToken)
+BOOL
+WINAPI
+LogonUserA(
+ _In_ LPSTR lpszUsername,
+ _In_opt_ LPSTR lpszDomain,
+ _In_opt_ LPSTR lpszPassword,
+ _In_ DWORD dwLogonType,
+ _In_ DWORD dwLogonProvider,
+ _Out_opt_ PHANDLE phToken)
+{
+ return LogonUserExA(lpszUsername,
+ lpszDomain,
+ lpszPassword,
+ dwLogonType,
+ dwLogonProvider,
+ phToken,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+LogonUserExA(
+ _In_ LPSTR lpszUsername,
+ _In_opt_ LPSTR lpszDomain,
+ _In_opt_ LPSTR lpszPassword,
+ _In_ DWORD dwLogonType,
+ _In_ DWORD dwLogonProvider,
+ _Out_opt_ PHANDLE phToken,
+ _Out_opt_ PSID *ppLogonSid,
+ _Out_opt_ PVOID *ppProfileBuffer,
+ _Out_opt_ LPDWORD pdwProfileLength,
+ _Out_opt_ PQUOTA_LIMITS pQuotaLimits)
{
UNICODE_STRING UserName;
UNICODE_STRING Domain;
@@ -259,12 +292,16 @@
goto PasswordDone;
}
- ret = LogonUserW(UserName.Buffer,
- Domain.Buffer,
- Password.Buffer,
- dwLogonType,
- dwLogonProvider,
- phToken);
+ ret = LogonUserExW(UserName.Buffer,
+ Domain.Buffer,
+ Password.Buffer,
+ dwLogonType,
+ dwLogonProvider,
+ phToken,
+ ppLogonSid,
+ ppProfileBuffer,
+ pdwProfileLength,
+ pQuotaLimits);
if (Password.Buffer != NULL)
RtlFreeUnicodeString(&Password);
@@ -285,13 +322,45 @@
/*
* @implemented
*/
-BOOL WINAPI
-LogonUserW(LPWSTR lpszUsername,
- LPWSTR lpszDomain,
- LPWSTR lpszPassword,
- DWORD dwLogonType,
- DWORD dwLogonProvider,
- PHANDLE phToken)
+BOOL
+WINAPI
+LogonUserW(
+ _In_ LPWSTR lpszUsername,
+ _In_opt_ LPWSTR lpszDomain,
+ _In_opt_ LPWSTR lpszPassword,
+ _In_ DWORD dwLogonType,
+ _In_ DWORD dwLogonProvider,
+ _Out_opt_ PHANDLE phToken)
+{
+ return LogonUserExW(lpszUsername,
+ lpszDomain,
+ lpszPassword,
+ dwLogonType,
+ dwLogonProvider,
+ phToken,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+LogonUserExW(
+ _In_ LPWSTR lpszUsername,
+ _In_opt_ LPWSTR lpszDomain,
+ _In_opt_ LPWSTR lpszPassword,
+ _In_ DWORD dwLogonType,
+ _In_ DWORD dwLogonProvider,
+ _Out_opt_ PHANDLE phToken,
+ _Out_opt_ PSID *ppLogonSid,
+ _Out_opt_ PVOID *ppProfileBuffer,
+ _Out_opt_ LPDWORD pdwProfileLength,
+ _Out_opt_ PQUOTA_LIMITS pQuotaLimits)
{
SID_IDENTIFIER_AUTHORITY LocalAuthority = {SECURITY_LOCAL_SID_AUTHORITY};
SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY};
@@ -503,6 +572,8 @@
*phToken = TokenHandle;
+ /* FIXME: return ppLogonSid, ppProfileBuffer, pdwProfileLength and pQuotaLimits */
+
done:
if (ProfileBuffer != NULL)
LsaFreeReturnBuffer(ProfileBuffer);
Modified: trunk/reactos/sdk/include/psdk/winbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/winbase.h…
==============================================================================
--- trunk/reactos/sdk/include/psdk/winbase.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/winbase.h [iso-8859-1] Mon May 23 13:53:24 2016
@@ -2569,6 +2569,36 @@
_Success_(return != FALSE)
BOOL
WINAPI
+LogonUserExA(
+ _In_ LPSTR lpszUsername,
+ _In_opt_ LPSTR lpszDomain,
+ _In_opt_ LPSTR lpszPassword,
+ _In_ DWORD dwLogonType,
+ _In_ DWORD dwLogonProvider,
+ _Out_opt_ PHANDLE phToken,
+ _Out_opt_ PSID *ppLogonSid,
+ _Out_opt_ PVOID *ppProfileBuffer,
+ _Out_opt_ LPDWORD pdwProfileLength,
+ _Out_opt_ PQUOTA_LIMITS pQuotaLimits);
+
+_Success_(return != FALSE)
+BOOL
+WINAPI
+LogonUserExW(
+ _In_ LPWSTR lpszUsername,
+ _In_opt_ LPWSTR lpszDomain,
+ _In_opt_ LPWSTR lpszPassword,
+ _In_ DWORD dwLogonType,
+ _In_ DWORD dwLogonProvider,
+ _Out_opt_ PHANDLE phToken,
+ _Out_opt_ PSID *ppLogonSid,
+ _Out_opt_ PVOID *ppProfileBuffer,
+ _Out_opt_ LPDWORD pdwProfileLength,
+ _Out_opt_ PQUOTA_LIMITS pQuotaLimits);
+
+_Success_(return != FALSE)
+BOOL
+WINAPI
LookupAccountNameA(
_In_opt_ LPCSTR lpSystemName,
_In_ LPCSTR lpAccountName,
@@ -3359,6 +3389,7 @@
#define LoadLibrary LoadLibraryW
#define LoadLibraryEx LoadLibraryExW
#define LogonUser LogonUserW
+#define LogonUserEx LogonUserExW
#define LookupAccountName LookupAccountNameW
#define LookupAccountSid LookupAccountSidW
#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW
@@ -3567,6 +3598,7 @@
#define LoadLibrary LoadLibraryA
#define LoadLibraryEx LoadLibraryExA
#define LogonUser LogonUserA
+#define LogonUserEx LogonUserExA
#define LookupAccountName LookupAccountNameA
#define LookupAccountSid LookupAccountSidA
#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA