From ae64df8016695033f50291ff1c7a7a09c27ca802 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 8 Aug 2015 16:37:55 +0000 Subject: [PATCH] [NTMARTA] - In AccpOpenNamedObject, immediately save the last error in case of OpenService failure instead of calling another function in between. CORE-9990 #resolve svn path=/trunk/; revision=68636 --- reactos/dll/win32/ntmarta/ntmarta.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/ntmarta/ntmarta.c b/reactos/dll/win32/ntmarta/ntmarta.c index 5549949a63e..cc293b14c3e 100644 --- a/reactos/dll/win32/ntmarta/ntmarta.c +++ b/reactos/dll/win32/ntmarta/ntmarta.c @@ -1068,7 +1068,9 @@ ParseRegErr: (DWORD)DesiredAccess); if (*Handle2 == NULL) { - goto FailOpenService; + Ret = GetLastError(); + ASSERT(Ret != ERROR_SUCCESS); + goto Cleanup; } DesiredAccess &= ~SC_MANAGER_CONNECT; @@ -1077,13 +1079,11 @@ ParseRegErr: (DWORD)DesiredAccess); if (*Handle == NULL) { - if (*Handle2 != NULL) - { - CloseServiceHandle((SC_HANDLE)(*Handle2)); - } - -FailOpenService: Ret = GetLastError(); + ASSERT(Ret != ERROR_SUCCESS); + ASSERT(*Handle2 != NULL); + CloseServiceHandle((SC_HANDLE)(*Handle2)); + goto Cleanup; } break;