Delete unused access right checks from PAL (dotnet/coreclr#26383)
authorJan Kotas <jkotas@microsoft.com>
Tue, 27 Aug 2019 11:48:53 +0000 (04:48 -0700)
committerJan Vorlicek <janvorli@microsoft.com>
Tue, 27 Aug 2019 11:48:53 +0000 (13:48 +0200)
Commit migrated from https://github.com/dotnet/coreclr/commit/b283f8c9833d9c38b4e21640c6aada16fd642bde

23 files changed:
src/coreclr/src/pal/src/cruntime/filecrt.cpp
src/coreclr/src/pal/src/debug/debug.cpp
src/coreclr/src/pal/src/file/file.cpp
src/coreclr/src/pal/src/handlemgr/handleapi.cpp
src/coreclr/src/pal/src/handlemgr/handlemgr.cpp
src/coreclr/src/pal/src/include/pal/corunix.hpp
src/coreclr/src/pal/src/include/pal/file.hpp
src/coreclr/src/pal/src/include/pal/handleapi.hpp
src/coreclr/src/pal/src/include/pal/handlemgr.hpp
src/coreclr/src/pal/src/include/pal/mutex.hpp
src/coreclr/src/pal/src/include/pal/procobj.hpp
src/coreclr/src/pal/src/include/pal/thread.hpp
src/coreclr/src/pal/src/map/map.cpp
src/coreclr/src/pal/src/objmgr/shmobjectmanager.cpp
src/coreclr/src/pal/src/objmgr/shmobjectmanager.hpp
src/coreclr/src/pal/src/synchmgr/synchmanager.cpp
src/coreclr/src/pal/src/synchmgr/wait.cpp
src/coreclr/src/pal/src/synchobj/event.cpp
src/coreclr/src/pal/src/synchobj/mutex.cpp
src/coreclr/src/pal/src/synchobj/semaphore.cpp
src/coreclr/src/pal/src/thread/process.cpp
src/coreclr/src/pal/src/thread/thread.cpp
src/coreclr/src/pal/src/thread/threadsusp.cpp

index 6b6b621..e461e1a 100644 (file)
@@ -74,7 +74,6 @@ _open_osfhandle( INT_PTR osfhandle, int flags )
         pthrCurrent,
         reinterpret_cast<HANDLE>(osfhandle),
         &aotFile,
-        0,
         &pobjFile
         );
 
index d31d66f..8036ba6 100644 (file)
@@ -448,7 +448,6 @@ GetThreadContext(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hThread,
-        0, // THREAD_GET_CONTEXT
         &pTargetThread,
         &pobjThread
         );
@@ -510,7 +509,6 @@ SetThreadContext(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hThread,
-        0, // THREAD_SET_CONTEXT
         &pTargetThread,
         &pobjThread
         );
index 3097509..87c6912 100644 (file)
@@ -730,7 +730,6 @@ CorUnix::InternalCreateFile(
 
     pLocalData->inheritable = inheritable;
     pLocalData->unix_fd = filed;
-    pLocalData->dwDesiredAccess = dwDesiredAccess;
     pLocalData->open_flags = open_flags;
     pLocalData->open_flags_deviceaccessonly = (dwDesiredAccess == 0);
 
@@ -745,7 +744,6 @@ CorUnix::InternalCreateFile(
         pThread,
         pFileObject,
         &aotFile, 
-        dwDesiredAccess,
         phFile,
         &pRegisteredFile
         );
@@ -1841,7 +1839,6 @@ CorUnix::InternalWriteFile(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_WRITE,
         &pFileObject
         );
 
@@ -2022,7 +2019,6 @@ CorUnix::InternalReadFile(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_READ,
         &pFileObject
         );
 
@@ -2208,7 +2204,6 @@ CorUnix::InternalSetEndOfFile(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_WRITE,
         &pFileObject
         );
 
@@ -2520,7 +2515,6 @@ CorUnix::InternalSetFilePointer(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_READ,
         &pFileObject
         );
 
@@ -2709,7 +2703,6 @@ CorUnix::InternalGetFileSize(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_READ,
         &pFileObject
         );
 
@@ -2875,7 +2868,6 @@ CorUnix::InternalFlushFileBuffers(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_WRITE,
         &pFileObject
         );
 
@@ -3862,7 +3854,6 @@ CorUnix::InternalCreatePipe(
         pThread,
         pReadFileObject,
         &aotFile,
-        GENERIC_READ,
         phReadPipe,
         &pReadRegisteredFile
         );
@@ -3884,7 +3875,6 @@ CorUnix::InternalCreatePipe(
         pThread,
         pWriteFileObject,
         &aotFile,
-        GENERIC_WRITE,
         phWritePipe,
         &pWriteRegisteredFile
         );
@@ -4038,7 +4028,6 @@ static HANDLE init_std_handle(HANDLE * pStd, FILE *stream)
 
     pLocalData->inheritable = TRUE;
     pLocalData->unix_fd = new_fd;
-    pLocalData->dwDesiredAccess = 0;
     pLocalData->open_flags = 0;
     pLocalData->open_flags_deviceaccessonly = FALSE;
 
@@ -4053,7 +4042,6 @@ static HANDLE init_std_handle(HANDLE * pStd, FILE *stream)
         pThread,
         pFileObject,
         &aotFile, 
-        0,
         &hFile,
         &pRegisteredFile
         );
@@ -4225,7 +4213,6 @@ GetFileInformationByHandle(
         pThread,
         hFile,
         &aotFile,
-        GENERIC_READ,
         &pFileObject
         );
 
index 6b99a85..d4d4962 100644 (file)
@@ -80,7 +80,6 @@ DuplicateHandle(
         hSourceHandle,
         hTargetProcessHandle,
         lpTargetHandle,
-        dwDesiredAccess,
         bInheritHandle,
         dwOptions
         );
@@ -102,7 +101,6 @@ CorUnix::InternalDuplicateHandle(
     HANDLE hSource,
     HANDLE hTargetProcess,
     LPHANDLE phDuplicate,
-    DWORD dwDesiredAccess,
     BOOL bInheritHandle,
     DWORD dwOptions
     )
@@ -198,7 +196,6 @@ CorUnix::InternalDuplicateHandle(
             pThread,
             hSource,
             &aotDuplicateHandle,
-            dwDesiredAccess,
             &pobjSource
             );
 
@@ -232,9 +229,6 @@ CorUnix::InternalDuplicateHandle(
     palError = g_pObjectManager->ObtainHandleForObject(
         pThread,
         pobjSource,
-        dwDesiredAccess,
-        bInheritHandle,
-        NULL,
         phDuplicate
         );
 
index 3516287..6009398 100644 (file)
@@ -82,8 +82,6 @@ PAL_ERROR
 CSimpleHandleManager::AllocateHandle(
     CPalThread *pThread,
     IPalObject *pObject,
-    DWORD dwAccessRights,
-    bool fInheritable,
     HANDLE *ph
     )
 {
@@ -158,8 +156,6 @@ CSimpleHandleManager::AllocateHandle(
     
     pObject->AddReference();
     m_rghteHandleTable[dwIndex].u.pObject = pObject;
-    m_rghteHandleTable[dwIndex].dwAccessRights = dwAccessRights;
-    m_rghteHandleTable[dwIndex].fInheritable = fInheritable;
     m_rghteHandleTable[dwIndex].fEntryAllocated = TRUE;
 
 AllocateHandleExit:
@@ -173,7 +169,6 @@ PAL_ERROR
 CSimpleHandleManager::GetObjectFromHandle(
     CPalThread *pThread,
     HANDLE h,
-    DWORD *pdwRightsGranted,
     IPalObject **ppObject
     )
 {
@@ -191,7 +186,6 @@ CSimpleHandleManager::GetObjectFromHandle(
     
     hi = HandleToHandleIndex(h);
 
-    *pdwRightsGranted = m_rghteHandleTable[hi].dwAccessRights;
     *ppObject = m_rghteHandleTable[hi].u.pObject;
     (*ppObject)->AddReference();
     
index c3a37cb..8807e83 100644 (file)
@@ -1018,7 +1018,6 @@ namespace CorUnix
             CPalThread *pThread,                // IN, OPTIONAL
             IPalObject *pObjectToRegister,
             CAllowedObjectTypes *pAllowedTypes,
-            DWORD dwRightsRequested,
             HANDLE *pHandle,                    // OUT
             IPalObject **ppRegisteredObject     // OUT
             ) = 0;
@@ -1050,9 +1049,6 @@ namespace CorUnix
         ObtainHandleForObject(
             CPalThread *pThread,                // IN, OPTIONAL
             IPalObject *pObject,
-            DWORD dwRightsRequested,
-            bool fInheritHandle,
-            IPalProcess *pProcessForHandle,     // IN, OPTIONAL
             HANDLE *pNewHandle                  // OUT
             ) = 0;
 
@@ -1083,7 +1079,6 @@ namespace CorUnix
             CPalThread *pThread,                // IN, OPTIONAL
             HANDLE hHandleToReference,
             CAllowedObjectTypes *pAllowedTypes,
-            DWORD dwRightsRequired,
             IPalObject **ppObject               // OUT
             ) = 0;
 
@@ -1098,25 +1093,8 @@ namespace CorUnix
             HANDLE rghHandlesToReference[],
             DWORD dwHandleCount,
             CAllowedObjectTypes *pAllowedTypes,
-            DWORD dwRightsRequired,
             IPalObject *rgpObjects[]            // OUT
             ) = 0;
-
-        //
-        // This routine is for cross-process handle duplication.
-        //
-
-        virtual
-        PAL_ERROR
-        ReferenceObjectByForeignHandle(
-            CPalThread *pThread,                // IN, OPTIONAL
-            HANDLE hForeignHandle,
-            IPalProcess *pForeignProcess,
-            CAllowedObjectTypes *pAllowedTypes,
-            DWORD dwRightsRequired,
-            IPalObject **ppObject               // OUT
-            ) = 0;
-        
     };
 
     extern IPalObjectManager *g_pObjectManager;
index 2c9fe42..b5a58b4 100644 (file)
@@ -38,8 +38,6 @@ namespace CorUnix
     {
     public:
         int  unix_fd;
-        DWORD dwDesiredAccess; /* Unix assumes files are always opened for reading.
-                                  In Windows we can open a file for writing only */
         int  open_flags;       /* stores Unix file creation flags */
         BOOL open_flags_deviceaccessonly;
         CHAR *unix_filename;
index 7974432..ac1c3d9 100644 (file)
@@ -32,7 +32,6 @@ namespace CorUnix
         HANDLE hSource,
         HANDLE hTargetProcess,
         LPHANDLE phDuplicate,
-        DWORD dwDesiredAccess,
         BOOL bInheritHandle,
         DWORD dwOptions
         );
index 1fbdb87..823a658 100644 (file)
@@ -63,10 +63,7 @@ namespace CorUnix
                 IPalObject *pObject;
                 HANDLE_INDEX hiNextIndex;
             } u;
-            
-            DWORD dwAccessRights;
-            bool fInheritable;
-            
+
             bool fEntryAllocated;
         } HANDLE_TABLE_ENTRY;
 
@@ -118,8 +115,6 @@ namespace CorUnix
         AllocateHandle(
             CPalThread *pThread,
             IPalObject *pObject,
-            DWORD dwAccessRights,
-            bool fInheritable,
             HANDLE *ph
             );
 
@@ -131,7 +126,6 @@ namespace CorUnix
         GetObjectFromHandle(
             CPalThread *pThread,
             HANDLE h,
-            DWORD *pdwRightsGranted,
             IPalObject **ppObject
             );
 
index ba82c2d..728beab 100644 (file)
@@ -49,8 +49,6 @@ namespace CorUnix
     PAL_ERROR
     InternalOpenMutex(
         CPalThread *pThread,
-        DWORD dwDesiredAccess,
-        BOOL bInheritHandle,
         LPCSTR lpName,
         HANDLE *phMutex
         );
index a75c764..2c62f57 100644 (file)
@@ -94,7 +94,6 @@ namespace CorUnix
         LPWSTR lpCommandLine,
         LPSECURITY_ATTRIBUTES lpProcessAttributes,
         LPSECURITY_ATTRIBUTES lpThreadAttributes,
-        BOOL bInheritHandles,
         DWORD dwCreationFlags,
         LPVOID lpEnvironment,
         LPCWSTR lpCurrentDirectory,
index c320b22..ea8a5f4 100644 (file)
@@ -75,7 +75,6 @@ namespace CorUnix
     InternalGetThreadDataFromHandle(
         CPalThread *pThread,
         HANDLE hThread,
-        DWORD dwRightsRequired,
         CPalThread **ppTargetThread,
         IPalObject **ppobjThread
         );
index a8d8af2..e8f7cba 100644 (file)
@@ -572,7 +572,6 @@ CorUnix::InternalCreateFileMapping(
                 pThread,
                 hFile,
                 &aotFile,
-                GENERIC_READ,
                 &pFileObject
                 );
 
@@ -779,7 +778,6 @@ CorUnix::InternalCreateFileMapping(
         pThread,
         pMapping,
         &aotFileMapping, 
-        flProtect,          // TODO: is flProtect really an access right?
         phMapping,
         &pRegisteredMapping
         );
@@ -1115,7 +1113,6 @@ CorUnix::InternalMapViewOfFile(
         pThread,
         hFileMappingObject,
         &aotFileMapping,
-        dwDesiredAccess,
         &pMappingObject
         );
 
@@ -2248,7 +2245,6 @@ void * MAPMapPEFile(HANDLE hFile)
             pThread,
             hFile,
             &aotFile,
-            GENERIC_READ,
             &pFileObject
             );
     if (NO_ERROR != palError)
index 2277003..67137c2 100644 (file)
@@ -36,9 +36,7 @@ static
 PAL_ERROR
 CheckObjectTypeAndRights(
     IPalObject *pobj,
-    CAllowedObjectTypes *paot,
-    DWORD dwRightsGranted,
-    DWORD dwRightsRequired
+    CAllowedObjectTypes *paot
     );
 
 /*++
@@ -209,7 +207,6 @@ Parameters:
   pobjToRegister -- the object instance to register. This routine will always
     call ReleaseReference on this instance
   paot -- object types that are compatible with the new object instance
-  dwRightsRequested -- requested access rights for the returned handle (ignored)
   pHandle -- on success, receives a handle to the registered object
   ppobjRegistered -- on success, receives a reference to the registered object
     instance.
@@ -220,7 +217,6 @@ CSharedMemoryObjectManager::RegisterObject(
     CPalThread *pthr,
     IPalObject *pobjToRegister,
     CAllowedObjectTypes *paot,
-    DWORD dwRightsRequested,
     HANDLE *pHandle,                 // OUT
     IPalObject **ppobjRegistered     // OUT
     )
@@ -231,7 +227,6 @@ CSharedMemoryObjectManager::RegisterObject(
     CObjectAttributes *poa;
     CObjectType *potObj;
     IPalObject *pobjExisting;
-    BOOL fInherit = FALSE;
     BOOL fShared = FALSE;
 
     _ASSERTE(NULL != pthr);
@@ -242,12 +237,11 @@ CSharedMemoryObjectManager::RegisterObject(
 
     ENTRY("CSharedMemoryObjectManager::RegisterObject "
         "(this=%p, pthr=%p, pobjToRegister=%p, paot=%p, "
-        "dwRightsRequested=%d, pHandle=%p, ppobjRegistered=%p)\n",
+        "pHandle=%p, ppobjRegistered=%p)\n",
         this,
         pthr,
         pobjToRegister,
         paot,
-        dwRightsRequested,
         pHandle,
         ppobjRegistered
         );
@@ -255,11 +249,6 @@ CSharedMemoryObjectManager::RegisterObject(
     poa = pobjToRegister->GetObjectAttributes();
     _ASSERTE(NULL != poa);
 
-    if (NULL != poa->pSecurityAttributes)
-    {
-        fInherit = poa->pSecurityAttributes->bInheritHandle;
-    }
-
     potObj = pobjToRegister->GetObjectType();
     fShared = (SharedObject == pshmobj->GetObjectDomain());
     
@@ -305,9 +294,6 @@ CSharedMemoryObjectManager::RegisterObject(
             palError = ObtainHandleForObject(
                 pthr,
                 pobjExisting,
-                dwRightsRequested,
-                fInherit,
-                NULL, 
                 pHandle
                 );
 
@@ -449,9 +435,6 @@ CSharedMemoryObjectManager::RegisterObject(
     palError = ObtainHandleForObject(
         pthr,
         pobjToRegister,
-        dwRightsRequested,
-        fInherit,
-        NULL, 
         pHandle
         );
 
@@ -727,11 +710,6 @@ Function:
 Parameters:
   pthr -- thread data for calling thread
   pobj -- the object to allocate a handle for
-  dwRightsRequired -- the access rights to grant the handle; currently ignored
-  fInheritHandle -- true if the handle is inheritable; ignored for all but file
-    objects that represent pipes
-  pProcessForHandle -- the process the handle is to be used from; currently
-    must be NULL
   pNewHandle -- on success, receives the newly allocated handle
 --*/
 
@@ -739,9 +717,6 @@ PAL_ERROR
 CSharedMemoryObjectManager::ObtainHandleForObject(
     CPalThread *pthr,
     IPalObject *pobj,
-    DWORD dwRightsRequested,
-    bool fInheritHandle,
-    IPalProcess *pProcessForHandle,     // IN, OPTIONAL
     HANDLE *pNewHandle                  // OUT
     )
 {
@@ -752,32 +727,17 @@ CSharedMemoryObjectManager::ObtainHandleForObject(
     _ASSERTE(NULL != pNewHandle);
 
     ENTRY("CSharedMemoryObjectManager::ObtainHandleForObject "
-        "(this=%p, pthr=%p, pobj=%p, dwRightsRequested=%d, "
-        "fInheritHandle=%p, pProcessForHandle=%p, pNewHandle=%p)\n",
+        "(this=%p, pthr=%p, pobj=%p, "
+        "pNewHandle=%p)\n",
         this,
         pthr,
         pobj,
-        dwRightsRequested,
-        fInheritHandle,
-        pProcessForHandle,
         pNewHandle
         );
 
-    if (NULL != pProcessForHandle)
-    {
-        //
-        // Not yet supported
-        //
-
-        ASSERT("Caller to ObtainHandleForObject provided a process\n");
-        return ERROR_CALL_NOT_IMPLEMENTED;
-    }
-
     palError = m_HandleManager.AllocateHandle(
         pthr,
         pobj,
-        dwRightsRequested,
-        fInheritHandle,
         pNewHandle
         );
 
@@ -832,7 +792,6 @@ Parameters:
   pthr -- thread data for calling thread
   hHandleToReference -- the handle to reference
   paot -- acceptable types for the underlying object
-  dwRightsRequired -- the access rights that the handle must have been
     granted; currently ignored
   ppobj -- on success, receives a reference to the object instance
 --*/
@@ -842,12 +801,10 @@ CSharedMemoryObjectManager::ReferenceObjectByHandle(
     CPalThread *pthr,
     HANDLE hHandleToReference,
     CAllowedObjectTypes *paot,
-    DWORD dwRightsRequired,
     IPalObject **ppobj               // OUT
     )
 {
     PAL_ERROR palError;
-    DWORD dwRightsGranted;
     IPalObject *pobj;
 
     _ASSERTE(NULL != pthr);
@@ -855,20 +812,17 @@ CSharedMemoryObjectManager::ReferenceObjectByHandle(
     _ASSERTE(NULL != ppobj);
 
     ENTRY("CSharedMemoryObjectManager::ReferenceObjectByHandle "
-        "(this=%p, pthr=%p, hHandleToReference=%p, paot=%p, "
-        "dwRightsRequired=%d, ppobj=%p)\n",
+        "(this=%p, pthr=%p, hHandleToReference=%p, paot=%p, ppobj=%p)\n",
         this,
         pthr,
         hHandleToReference,
         paot,
-        dwRightsRequired,
         ppobj
         );
 
     palError = m_HandleManager.GetObjectFromHandle(
         pthr,
         hHandleToReference,
-        &dwRightsGranted,
         &pobj
         );
 
@@ -876,9 +830,7 @@ CSharedMemoryObjectManager::ReferenceObjectByHandle(
     {
         palError = CheckObjectTypeAndRights(
             pobj,
-            paot,
-            dwRightsGranted,
-            dwRightsRequired
+            paot
             );
 
         if (NO_ERROR == palError)
@@ -914,8 +866,6 @@ Parameters:
   rgHandlesToReference -- the array of handles to reference
   dwHandleCount -- the number of handles in the arrayu
   paot -- acceptable types for the underlying objects
-  dwRightsRequired -- the access rights that the handles must have been
-    granted; currently ignored
   rgpobjs -- on success, receives references to the object instances; will
     be empty on failures
 --*/
@@ -926,13 +876,11 @@ CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray(
     HANDLE rghHandlesToReference[],
     DWORD dwHandleCount,
     CAllowedObjectTypes *paot,
-    DWORD dwRightsRequired,
     IPalObject *rgpobjs[]            // OUT (caller allocated)
     )
 {
     PAL_ERROR palError = NO_ERROR;
     IPalObject *pobj = NULL;
-    DWORD dwRightsGranted;
     DWORD dw;
 
     _ASSERTE(NULL != pthr);
@@ -943,13 +891,12 @@ CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray(
 
     ENTRY("CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray "
         "(this=%p, pthr=%p, rghHandlesToReference=%p, dwHandleCount=%d, "
-        "pAllowedTyped=%d, dwRightsRequired=%d, rgpobjs=%p)\n",
+        "pAllowedTyped=%d, rgpobjs=%p)\n",
         this,
         pthr,
         rghHandlesToReference,
         dwHandleCount,
         paot,
-        dwRightsRequired,
         rgpobjs
         );
 
@@ -960,7 +907,6 @@ CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray(
         palError = m_HandleManager.GetObjectFromHandle(
             pthr,
             rghHandlesToReference[dw],
-            &dwRightsGranted,
             &pobj
             );
 
@@ -968,9 +914,7 @@ CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray(
         {
             palError = CheckObjectTypeAndRights(
                 pobj,
-                paot,
-                dwRightsGranted,
-                dwRightsRequired
+                paot
                 );
 
             if (NO_ERROR == palError)
@@ -1027,44 +971,6 @@ CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray(
 
 /*++
 Function:
-  CSharedMemoryObjectManager::ReferenceObjectByForeignHandle
-
-  Returns a referenced object instance that a handle belongin to
-  another process refers to; currently unimplemented
-
-Parameters:
-  pthr -- thread data for calling thread
-  hForeignHandle -- the handle to reference
-  pForeignProcess -- the process that hForeignHandle belongs to
-  paot -- acceptable types for the underlying object
-  dwRightsRequired -- the access rights that the handle must have been
-    granted; currently ignored
-  ppobj -- on success, receives a reference to the object instance
---*/
-
-PAL_ERROR
-CSharedMemoryObjectManager::ReferenceObjectByForeignHandle(
-    CPalThread *pthr,
-    HANDLE hForeignHandle,
-    IPalProcess *pForeignProcess,
-    CAllowedObjectTypes *paot,
-    DWORD dwRightsRequired,
-    IPalObject **ppobj               // OUT
-    )
-{
-    //
-    // Not implemented for basic shared memory object manager --
-    // requires an IPC channel. (For the shared memory object manager
-    // PAL_LocalHandleToRemote and PAL_RemoteHandleToLocal must still
-    // be used...)
-    //
-
-    ASSERT("ReferenceObjectByForeignHandle not yet supported\n");
-    return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-/*++
-Function:
   CSharedMemoryObjectManager::ImportSharedObjectIntoProcess
 
   Takes an object's shared memory data and from it creates the
@@ -1192,17 +1098,13 @@ Function:
 Parameters:
   pobj -- the object instance whose type is to be checked
   paot -- the acceptable type for the object instance
-  dwRightsGranted -- the granted access rights (ignored)
-  dwRightsRequired -- the required access rights (ignored)
 --*/
 
 static
 PAL_ERROR
 CheckObjectTypeAndRights(
     IPalObject *pobj,
-    CAllowedObjectTypes *paot,
-    DWORD dwRightsGranted,
-    DWORD dwRightsRequired
+    CAllowedObjectTypes *paot
     )
 {
     PAL_ERROR palError = NO_ERROR;
@@ -1210,30 +1112,12 @@ CheckObjectTypeAndRights(
     _ASSERTE(NULL != pobj);
     _ASSERTE(NULL != paot);
 
-    ENTRY("CheckObjectTypeAndRights (pobj=%p, paot=%p, "
-        "dwRightsGranted=%d, dwRightsRequired=%d)\n",
+    ENTRY("CheckObjectTypeAndRights (pobj=%p, paot=%p)\n",
         pobj,
-        paot,
-        dwRightsGranted,
-        dwRightsRequired
+        paot
         );
 
-    if (paot->IsTypeAllowed(pobj->GetObjectType()->GetId()))
-    {
-#ifdef ENFORCE_OBJECT_ACCESS_RIGHTS
-
-        //
-        // This is where the access right check would occur if Win32 object
-        // security were supported.
-        //
-        
-        if ((dwRightsRequired & dwRightsGranted) != dwRightsRequired)
-        {
-            palError = ERROR_ACCESS_DENIED;
-        }
-#endif
-    }
-    else
+    if (!paot->IsTypeAllowed(pobj->GetObjectType()->GetId()))
     {
         palError = ERROR_INVALID_HANDLE;
     }
index 6e11b20..4abfc12 100644 (file)
@@ -90,7 +90,6 @@ namespace CorUnix
             CPalThread *pthr,
             IPalObject *pobjToRegister,
             CAllowedObjectTypes *paot,
-            DWORD dwRightsRequested,
             HANDLE *pHandle,
             IPalObject **ppobjRegistered
             );
@@ -109,9 +108,6 @@ namespace CorUnix
         ObtainHandleForObject(
             CPalThread *pthr,
             IPalObject *pobj,
-            DWORD dwRightsRequested,
-            bool fInheritHandle,
-            IPalProcess *pProcessForHandle,     // IN, OPTIONAL
             HANDLE *pNewHandle
             );
 
@@ -128,7 +124,6 @@ namespace CorUnix
             CPalThread *pthr,
             HANDLE hHandleToReference,
             CAllowedObjectTypes *paot,
-            DWORD dwRightsRequired,
             IPalObject **ppobj
             );
 
@@ -139,20 +134,8 @@ namespace CorUnix
             HANDLE rghHandlesToReference[],
             DWORD dwHandleCount,
             CAllowedObjectTypes *paot,
-            DWORD dwRightsRequired,
             IPalObject *rgpobjs[]
             );
-
-        virtual
-        PAL_ERROR
-        ReferenceObjectByForeignHandle(
-            CPalThread *pthr,
-            HANDLE hForeignHandle,
-            IPalProcess *pForeignProcess,
-            CAllowedObjectTypes *paot,
-            DWORD dwRightsRequired,
-            IPalObject **ppobj
-            );
     };
 }
 
index c0631a6..dbb2d52 100644 (file)
@@ -1502,7 +1502,6 @@ namespace CorUnix
             pSynchManager->m_dwWorkerThreadTid = (DWORD)osThreadId;
             palErr = InternalGetThreadDataFromHandle(pthrCurrent,
                                                      hWorkerThread,
-                                                     0,
                                                      &pSynchManager->m_pthrWorker,
                                                      &pSynchManager->m_pipoThread);
             if (NO_ERROR != palErr)
index 1f20ba2..2727c59 100644 (file)
@@ -323,7 +323,6 @@ QueueUserAPC(
     palErr = InternalGetThreadDataFromHandle(
         pCurrentThread,
         hThread,
-        0, // THREAD_SET_CONTEXT
         &pTargetThread,
         &pTargetThreadObject
         );
@@ -407,7 +406,6 @@ DWORD CorUnix::InternalWaitForMultipleObjectsEx(
                                                                      (VOID **)lpHandles, 
                                                                      nCount,
                                                                      &sg_aotWaitObject,
-                                                                     SYNCHRONIZE,
                                                                      ppIPalObjs);
     if (NO_ERROR != palErr)
     {
@@ -735,7 +733,6 @@ DWORD CorUnix::InternalSignalObjectAndWait(
             thread,
             hObjectToSignal,
             &sg_aotSignalableObject,
-            0, // should be MUTEX_MODIFY_STATE or equivalent for a signalable object, currently ignored (no Win32 security)
             &objectToSignal);
     if (palError != NO_ERROR)
     {
@@ -749,7 +746,6 @@ DWORD CorUnix::InternalSignalObjectAndWait(
             thread,
             hObjectToWaitOn,
             &sg_aotWaitObject,
-            SYNCHRONIZE,
             &objectToWaitOn);
     if (palError != NO_ERROR)
     {
index 3db9a3a..8b1be0e 100644 (file)
@@ -312,7 +312,6 @@ CorUnix::InternalCreateEvent(
         pthr,
         pobjEvent,
         &aotEvent, 
-        EVENT_ALL_ACCESS, // Currently ignored (no Win32 security)
         phEvent,
         &pobjRegisteredEvent
         );
@@ -441,7 +440,6 @@ CorUnix::InternalSetEvent(
         pthr,
         hEvent,
         &aotEvent,
-        0, // Should be EVENT_MODIFY_STATE; currently ignored (no Win32 security)
         &pobjEvent
         );
 
@@ -542,4 +540,4 @@ OpenEventWExit:
     PERF_EXIT(OpenEventW);
 
     return hEvent;
-}
\ No newline at end of file
+}
index a018d9d..14e5248 100644 (file)
@@ -343,7 +343,6 @@ CorUnix::InternalCreateMutex(
         pthr,
         pobjMutex,
         aot,
-        0, // should be MUTEX_ALL_ACCESS -- currently ignored (no Win32 security)
         &hMutex,
         &pobjRegisteredMutex
         );
@@ -471,7 +470,6 @@ CorUnix::InternalReleaseMutex(
         pthr,
         hMutex,
         &aotAnyMutex,
-        0, // should be MUTEX_MODIFY_STATE -- current ignored (no Win32 security)
         &pobjMutex
         );
 
@@ -574,7 +572,7 @@ OpenMutexA (
         goto OpenMutexAExit;
     }
 
-    palError = InternalOpenMutex(pthr, dwDesiredAccess, bInheritHandle, lpName, &hMutex);
+    palError = InternalOpenMutex(pthr, lpName, &hMutex);
 
 OpenMutexAExit:
     if (NO_ERROR != palError)
@@ -642,7 +640,7 @@ OpenMutexW(
         }
     }
 
-    palError = InternalOpenMutex(pthr, dwDesiredAccess, bInheritHandle, lpName == nullptr ? nullptr : utf8Name, &hMutex);
+    palError = InternalOpenMutex(pthr, lpName == nullptr ? nullptr : utf8Name, &hMutex);
 
 OpenMutexWExit:
     if (NO_ERROR != palError)
@@ -660,10 +658,6 @@ OpenMutexWExit:
 Function:
   InternalOpenMutex
 
-Note:
-  dwDesiredAccess is currently ignored (no Win32 object security support)
-  bInheritHandle is currently ignored (handles to mutexes are not inheritable)
-
 Parameters:
   pthr -- thread data for calling thread
   phEvent -- on success, receives the allocated mutex handle
@@ -674,8 +668,6 @@ Parameters:
 PAL_ERROR
 CorUnix::InternalOpenMutex(
     CPalThread *pthr,
-    DWORD dwDesiredAccess,
-    BOOL bInheritHandle,
     LPCSTR lpName,
     HANDLE *phMutex
     )
@@ -690,11 +682,9 @@ CorUnix::InternalOpenMutex(
     _ASSERTE(NULL != lpName);
     _ASSERTE(NULL != phMutex);
 
-    ENTRY("InternalOpenMutex(pthr=%p, dwDesiredAccess=%d, bInheritHandle=%d, "
+    ENTRY("InternalOpenMutex(pthr=%p, "
         "lpName=%p, phMutex=%p)\n",
         pthr,
-        dwDesiredAccess,
-        bInheritHandle,
         lpName,
         phMutex
         );
@@ -715,7 +705,6 @@ CorUnix::InternalOpenMutex(
         pthr,
         pobjMutex,
         &aotNamedMutex,
-        dwDesiredAccess,
         &hMutex,
         &pobjRegisteredMutex
         );
index 499f847..67862c0 100644 (file)
@@ -353,7 +353,6 @@ CorUnix::InternalCreateSemaphore(
         pthr,
         pobjSemaphore,
         &aotSempahore, 
-        0, // Should be SEMAPHORE_ALL_ACCESS; currently ignored (no Win32 security)
         phSemaphore,
         &pobjRegisteredSemaphore
         );
@@ -469,8 +468,7 @@ CorUnix::InternalReleaseSemaphore(
     palError = g_pObjectManager->ReferenceObjectByHandle(
         pthr,
         hSemaphore,
-        &aotSempahore, 
-        0, // Should be SEMAPHORE_MODIFY_STATE; currently ignored (no Win32 security)
+        &aotSempahore,
         &pobjSemaphore
         );
 
index 7f186a4..995ec20 100644 (file)
@@ -480,7 +480,6 @@ CreateProcessA(
         CommandLineW,
         lpProcessAttributes,
         lpThreadAttributes,
-        bInheritHandles,
         dwCreationFlags,
         lpEnvironment,
         CurrentDirectoryW,
@@ -551,7 +550,6 @@ CreateProcessW(
         lpCommandLine,
         lpProcessAttributes,
         lpThreadAttributes,
-        bInheritHandles,
         dwCreationFlags,
         lpEnvironment,
         lpCurrentDirectory,
@@ -588,7 +586,6 @@ PrepareStandardHandle(
         pThread,
         hFile,
         &aotFile,
-        0,
         &pobjFile
         );
 
@@ -663,7 +660,6 @@ CorUnix::InternalCreateProcess(
     LPWSTR lpCommandLine,
     LPSECURITY_ATTRIBUTES lpProcessAttributes,
     LPSECURITY_ATTRIBUTES lpThreadAttributes,
-    BOOL bInheritHandles,
     DWORD dwCreationFlags,
     LPVOID lpEnvironment,
     LPCWSTR lpCurrentDirectory,
@@ -897,7 +893,6 @@ CorUnix::InternalCreateProcess(
         pThread,
         pobjProcess,
         &aotProcess,
-        PROCESS_ALL_ACCESS,
         &hProcess,
         &pobjProcessRegistered
         );
@@ -2721,7 +2716,6 @@ OpenProcess(
         pThread,
         pobjProcess,
         &aotProcess,
-        dwDesiredAccess,
         &hProcess,
         &pobjProcessRegistered
         );
@@ -2896,7 +2890,6 @@ GetProcessModulesFromHandle(
             pThread,
             hProcess,
             &aotProcess,
-            0,
             &pobjProcess);
 
         if (NO_ERROR != palError)
@@ -3614,7 +3607,6 @@ PROCGetProcessIDFromHandle(
         pThread,
         hProcess,
         &aotProcess,
-        0,
         &pobjProcess
         );
 
@@ -3819,7 +3811,6 @@ CorUnix::CreateInitialProcessAndThreadObjects(
         pThread,
         pobjProcess,
         &aotProcess,
-        PROCESS_ALL_ACCESS,
         &hProcess,
         &g_pobjProcess
         );
@@ -4191,7 +4182,6 @@ PROCGetProcessStatus(
         pThread,
         hProcess,
         &aotProcess,
-        0,
         &pobjProcess
         );
 
index 9048505..b4e9731 100644 (file)
@@ -263,7 +263,6 @@ THREADGetThreadProcessId(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hThread,
-        0,
         &pTargetThread,
         &pobjThread
         );
@@ -1055,7 +1054,6 @@ CorUnix::InternalGetThreadPriority(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hThread,
-        0,  // THREAD_QUERY_INFORMATION
         &pTargetThread,
         &pobjThread
         );
@@ -1141,7 +1139,6 @@ CorUnix::InternalSetThreadPriority(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hTargetThread,
-        0, // THREAD_SET_INFORMATION
         &pTargetThread,
         &pobjThread
         );
@@ -1324,7 +1321,6 @@ CorUnix::GetThreadTimesInternal(
     palError = InternalGetThreadDataFromHandle(
         pthrCurrent,
         hThread,
-        0,
         &pthrTarget,
         &pobjThread
         );
@@ -1394,7 +1390,6 @@ CorUnix::GetThreadTimesInternal(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hThread,
-        0, // THREAD_GET_CONTEXT
         &pTargetThread,
         &pobjThread
         );
@@ -1473,7 +1468,6 @@ CorUnix::GetThreadTimesInternal(
     palError = InternalGetThreadDataFromHandle(
         pThread,
         hThread,
-        0, // THREAD_GET_CONTEXT
         &pTargetThread,
         &pobjThread
         );
@@ -1876,7 +1870,6 @@ CorUnix::CreateThreadObject(
         pThread,
         pobjThread,
         &aotThread,
-        0, //THREAD_ALL_ACCESS,
         &hThread,
         &pobjRegisteredThread
         );
@@ -2006,7 +1999,6 @@ CorUnix::InternalCreateDummyThread(
         pThread,
         pobjThread,
         &aotThread,
-        0, // THREAD_ALL_ACCESS
         phThread,
         &pobjThreadRegistered
         );
@@ -2058,7 +2050,6 @@ PAL_ERROR
 CorUnix::InternalGetThreadDataFromHandle(
     CPalThread *pThread,
     HANDLE hThread,
-    DWORD dwRightsRequired,
     CPalThread **ppTargetThread,
     IPalObject **ppobjThread
     )
@@ -2080,7 +2071,6 @@ CorUnix::InternalGetThreadDataFromHandle(
             pThread,
             hThread,
             &aotThread,
-            dwRightsRequired,
             &pobj
             );
 
@@ -2715,7 +2705,6 @@ PAL_InjectActivation(
     PAL_ERROR palError = InternalGetThreadDataFromHandle(
         pCurrentThread,
         hThread,
-        0,
         &pTargetThread,
         &pobjThread
         );
index f8a435c..861a4af 100644 (file)
@@ -193,7 +193,6 @@ CorUnix::InternalResumeThread(
     palError = InternalGetThreadDataFromHandle(
         pthrResumer,
         hTargetThread,
-        0, // THREAD_SUSPEND_RESUME
         &pthrTarget,
         &pobjThread
         );