Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / dll / win32 / ntmarta / ntmarta.c
index e077b05..bbb2a40 100644 (file)
@@ -16,8 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id: ntmarta.c 31176 2007-12-12 07:04:12Z weiden $
- *
+/*
  * PROJECT:         ReactOS MARTA provider
  * FILE:            lib/ntmarta/ntmarta.c
  * PURPOSE:         ReactOS MARTA provider
@@ -26,7 +25,7 @@
  * UPDATE HISTORY:
  *      07/26/2005  Created
  */
-#include <ntmarta.h>
+#include "ntmarta.h"
 
 #define NDEBUG
 #include <debug.h>
@@ -888,7 +887,7 @@ AccpOpenNamedObject(LPWSTR pObjectName,
                                        NULL);
 
             Status = NtOpenFile(Handle,
-                                DesiredAccess,
+                                DesiredAccess /* | SYNCHRONIZE */,
                                 &ObjectAttributes,
                                 &IoStatusBlock,
                                 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
@@ -1236,7 +1235,7 @@ AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries,
     DWORD ObjectsPresent;
     BOOL needToClean;
     PSID pSid1, pSid2;
-    ULONG i;
+    ULONG i, j;
     LSA_HANDLE PolicyHandle = NULL;
     BOOL bRet;
     DWORD LastErr;
@@ -1295,11 +1294,11 @@ AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries,
             case REVOKE_ACCESS:
             case SET_ACCESS:
                 /* Discard all accesses for the trustee... */
-                for (i = 0; i < SizeInformation.AceCount; i++)
+                for (j = 0; j < SizeInformation.AceCount; j++)
                 {
-                    if (!pKeepAce[i])
+                    if (!pKeepAce[j])
                         continue;
-                    if (!GetAce(OldAcl, i, (PVOID*)&pAce))
+                    if (!GetAce(OldAcl, j, (PVOID*)&pAce))
                     {
                         Ret = GetLastError();
                         goto Cleanup;
@@ -1308,7 +1307,7 @@ AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries,
                     pSid2 = AccpGetAceSid(pAce);
                     if (RtlEqualSid(pSid1, pSid2))
                     {
-                        pKeepAce[i] = FALSE;
+                        pKeepAce[j] = FALSE;
                         SizeInformation.AclBytesInUse -= pAce->AceSize;
                     }
                 }