Author: janderwald Date: Fri Dec 3 13:32:50 2010 New Revision: 49923
URL: http://svn.reactos.org/svn/reactos?rev=49923&view=rev Log: - Merge from trunk - Hackfixed to build
Modified: branches/audio-bringup/dll/win32/advapi32/sec/cred.c branches/audio-bringup/dll/win32/advapi32/sec/lsa.c
Modified: branches/audio-bringup/dll/win32/advapi32/sec/cred.c URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/dll/win32/advapi32... ============================================================================== --- branches/audio-bringup/dll/win32/advapi32/sec/cred.c [iso-8859-1] (original) +++ branches/audio-bringup/dll/win32/advapi32/sec/cred.c [iso-8859-1] Fri Dec 3 13:32:50 2010 @@ -103,16 +103,22 @@ credential->TargetName = (LPWSTR)buffer; ret = RegQueryValueExW(hkey, NULL, 0, &type, (LPVOID)credential->TargetName, &count); - if (ret != ERROR_SUCCESS || type != REG_SZ) return ret; + if (ret != ERROR_SUCCESS) + return ret; + else if (type != REG_SZ) + return ERROR_REGISTRY_CORRUPT; buffer += count; }
ret = RegQueryValueExW(hkey, wszCommentValue, 0, &type, NULL, &count); - if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS) - return ret; - else if (type != REG_SZ) - return ERROR_REGISTRY_CORRUPT; - *len += count; + if (ret != ERROR_FILE_NOT_FOUND) + { + if (ret != ERROR_SUCCESS) + return ret; + else if (type != REG_SZ) + return ERROR_REGISTRY_CORRUPT; + *len += count; + } if (credential) { credential->Comment = (LPWSTR)buffer; @@ -129,11 +135,14 @@ }
ret = RegQueryValueExW(hkey, wszTargetAliasValue, 0, &type, NULL, &count); - if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS) - return ret; - else if (type != REG_SZ) - return ERROR_REGISTRY_CORRUPT; - *len += count; + if (ret != ERROR_FILE_NOT_FOUND) + { + if (ret != ERROR_SUCCESS) + return ret; + else if (type != REG_SZ) + return ERROR_REGISTRY_CORRUPT; + *len += count; + } if (credential) { credential->TargetAlias = (LPWSTR)buffer; @@ -150,11 +159,14 @@ }
ret = RegQueryValueExW(hkey, wszUserNameValue, 0, &type, NULL, &count); - if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS) - return ret; - else if (type != REG_SZ) - return ERROR_REGISTRY_CORRUPT; - *len += count; + if (ret != ERROR_FILE_NOT_FOUND) + { + if (ret != ERROR_SUCCESS) + return ret; + else if (type != REG_SZ) + return ERROR_REGISTRY_CORRUPT; + *len += count; + } if (credential) { credential->UserName = (LPWSTR)buffer; @@ -171,9 +183,12 @@ }
ret = read_credential_blob(hkey, key_data, NULL, &count); - if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS) - return ret; - *len += count; + if (ret != ERROR_FILE_NOT_FOUND) + { + if (ret != ERROR_SUCCESS) + return ret; + *len += count; + } if (credential) { credential->CredentialBlob = (LPBYTE)buffer;
Modified: branches/audio-bringup/dll/win32/advapi32/sec/lsa.c URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/dll/win32/advapi32... ============================================================================== --- branches/audio-bringup/dll/win32/advapi32/sec/lsa.c [iso-8859-1] (original) +++ branches/audio-bringup/dll/win32/advapi32/sec/lsa.c [iso-8859-1] Fri Dec 3 13:32:50 2010 @@ -143,18 +143,37 @@
/* - * @unimplemented - */ -NTSTATUS -WINAPI -LsaAddAccountRights( - LSA_HANDLE PolicyHandle, - PSID AccountSid, - PLSA_UNICODE_STRING UserRights, - ULONG CountOfRights) -{ - FIXME("(%p,%p,%p,0x%08x) stub\n", PolicyHandle, AccountSid, UserRights, CountOfRights); - return STATUS_OBJECT_NAME_NOT_FOUND; + * @implemented + */ +NTSTATUS +WINAPI +LsaAddAccountRights(IN LSA_HANDLE PolicyHandle, + IN PSID AccountSid, + IN PLSA_UNICODE_STRING UserRights, + IN ULONG CountOfRights) +{ + LSAPR_USER_RIGHT_SET UserRightSet; + NTSTATUS Status; + + TRACE("(%p,%p,%p,0x%08x) stub\n", PolicyHandle, AccountSid, UserRights, CountOfRights); + + UserRightSet.Entries = CountOfRights; + UserRightSet.UserRights = (PRPC_UNICODE_STRING)UserRights; + + RpcTryExcept + { + Status = LsarAddAccountRights((LSAPR_HANDLE)PolicyHandle, + (PRPC_SID)AccountSid, + &UserRightSet); + + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return Status; }
@@ -265,6 +284,7 @@ return STATUS_SUCCESS; }
+ /* * @implemented */ @@ -291,16 +311,16 @@ return Status; }
-/* - * @implemented - */ -NTSTATUS -WINAPI -LsaEnumerateAccountRights( - LSA_HANDLE PolicyHandle, - PSID AccountSid, - PLSA_UNICODE_STRING *UserRights, - PULONG CountOfRights) + +/* + * @implemented + */ +NTSTATUS +WINAPI +LsaEnumerateAccountRights(IN LSA_HANDLE PolicyHandle, + IN PSID AccountSid, + OUT PLSA_UNICODE_STRING *UserRights, + OUT PULONG CountOfRights) { LSAPR_USER_RIGHT_SET UserRightsSet; NTSTATUS Status; @@ -332,6 +352,7 @@
return Status; } +
/* * @unimplemented @@ -385,16 +406,18 @@ return STATUS_SUCCESS; }
-/* - * @implemented - */ -NTSTATUS -WINAPI -LsaFreeMemory(PVOID Buffer) + +/* + * @implemented + */ +NTSTATUS +WINAPI +LsaFreeMemory(IN PVOID Buffer) { TRACE("(%p)\n", Buffer); return RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); } +
/* * @implemented @@ -446,6 +469,7 @@ return Status; }
+ /* * @unimplemented */ @@ -470,8 +494,9 @@ return STATUS_NONE_MAPPED; }
-/* - * @unmplemented + +/* + * @implemented */ NTSTATUS WINAPI @@ -503,6 +528,7 @@
return Status; } +
/* * @implemented @@ -534,6 +560,7 @@
return Status; } +
/* * @implemented @@ -591,6 +618,7 @@ return Status; }
+ /****************************************************************************** * LsaNtStatusToWinError * @@ -599,7 +627,8 @@ * * @implemented */ -ULONG WINAPI +ULONG +WINAPI LsaNtStatusToWinError(IN NTSTATUS Status) { TRACE("(%lx)\n", Status); @@ -747,6 +776,7 @@ return STATUS_NOT_IMPLEMENTED; }
+ /* * @implemented */ @@ -782,20 +812,6 @@ return Status; }
-/* - * @unimplemented - */ -NTSTATUS -WINAPI -LsaQueryTrustedDomainInfoByName( - LSA_HANDLE PolicyHandle, - PLSA_UNICODE_STRING TrustedDomainName, - TRUSTED_INFORMATION_CLASS InformationClass, - PVOID *Buffer) -{ - FIXME("(%p,%p,%d,%p) stub\n", PolicyHandle, TrustedDomainName, InformationClass, Buffer); - return STATUS_OBJECT_NAME_NOT_FOUND; -}
/* * @unimplemented @@ -812,21 +828,77 @@ return STATUS_OBJECT_NAME_NOT_FOUND; }
-/* - * @unimplemented - */ -NTSTATUS -WINAPI -LsaRemoveAccountRights( - LSA_HANDLE PolicyHandle, - PSID AccountSid, - BOOLEAN AllRights, - PLSA_UNICODE_STRING UserRights, - ULONG CountOfRights) -{ - FIXME("(%p,%p,%d,%p,0x%08x) stub\n", PolicyHandle, AccountSid, AllRights, UserRights, CountOfRights); + +/* + * @implemented + */ +NTSTATUS +WINAPI +LsaQueryTrustedDomainInfoByName(IN LSA_HANDLE PolicyHandle, + IN PLSA_UNICODE_STRING TrustedDomainName, + IN TRUSTED_INFORMATION_CLASS InformationClass, + OUT PVOID *Buffer) +{ + NTSTATUS Status; + + TRACE("(%p,%p,%d,%p)\n", PolicyHandle, TrustedDomainName, InformationClass, Buffer); + + if (InformationClass == 9 /*TrustedDomainAuthInformationInternal*/ || + InformationClass == 10 /*TrustedDomainFullInformationInternal*/) + return STATUS_INVALID_INFO_CLASS; + + RpcTryExcept + { + Status = LsarQueryTrustedDomainInfoByName((LSAPR_HANDLE)PolicyHandle, + (PRPC_UNICODE_STRING)TrustedDomainName, + InformationClass, + (unsigned long *)Buffer); // Shuld be: (PLSAPR_POLICY_INFORMATION *)Buffer + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return Status; +} + + +/* + * @implemented + */ +NTSTATUS +WINAPI +LsaRemoveAccountRights(IN LSA_HANDLE PolicyHandle, + IN PSID AccountSid, + IN BOOLEAN AllRights, + IN PLSA_UNICODE_STRING UserRights, + IN ULONG CountOfRights) +{ + LSAPR_USER_RIGHT_SET UserRightSet; + NTSTATUS Status; + + TRACE("(%p,%p,%d,%p,0x%08x) stub\n", PolicyHandle, AccountSid, AllRights, UserRights, CountOfRights); + + UserRightSet.Entries = CountOfRights; + UserRightSet.UserRights = (PRPC_UNICODE_STRING)UserRights; + + RpcTryExcept + { + Status = LsarRemoveAccountRights((LSAPR_HANDLE)PolicyHandle, + (PRPC_SID)AccountSid, + AllRights, + &UserRightSet); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + return STATUS_SUCCESS; } +
/* * @unimplemented