Author: tfaber Date: Sat Aug 8 16:37:55 2015 New Revision: 68636
URL: http://svn.reactos.org/svn/reactos?rev=68636&view=rev Log: [NTMARTA] - In AccpOpenNamedObject, immediately save the last error in case of OpenService failure instead of calling another function in between. CORE-9990 #resolve
Modified: trunk/reactos/dll/win32/ntmarta/ntmarta.c
Modified: trunk/reactos/dll/win32/ntmarta/ntmarta.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntmarta/ntmarta.c... ============================================================================== --- trunk/reactos/dll/win32/ntmarta/ntmarta.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ntmarta/ntmarta.c [iso-8859-1] Sat Aug 8 16:37:55 2015 @@ -1068,7 +1068,9 @@ (DWORD)DesiredAccess); if (*Handle2 == NULL) { - goto FailOpenService; + Ret = GetLastError(); + ASSERT(Ret != ERROR_SUCCESS); + goto Cleanup; }
DesiredAccess &= ~SC_MANAGER_CONNECT; @@ -1077,13 +1079,11 @@ (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;