added stub for ObFindHandleForObject() and export it

svn path=/trunk/; revision=11031
This commit is contained in:
Thomas Bluemel 2004-09-24 16:18:28 +00:00
parent ec73e88d5f
commit 109dc19c13
3 changed files with 59 additions and 3 deletions

View file

@ -139,4 +139,11 @@ ObSetSecurityDescriptorInfo(IN PVOID Object,
IN PGENERIC_MAPPING GenericMapping);
*/
NTSTATUS STDCALL
ObFindHandleForObject(IN PEPROCESS Process,
IN PVOID Object,
IN POBJECT_TYPE ObjectType,
IN POBJECT_HANDLE_INFORMATION HandleInformation,
OUT PHANDLE HandleReturn);
#endif /* ndef _INCLUDE_DDK_OBFUNCS_H */

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.192 2004/09/22 22:31:46 weiden Exp $
; $Id: ntoskrnl.def,v 1.193 2004/09/24 16:18:28 weiden Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -834,7 +834,7 @@ ObAssignSecurity@16
;ObCheckCreateObjectAccess@28
;ObCheckObjectAccess@20
ObCreateObject@36
;ObFindHandleForObject@20
ObFindHandleForObject@20
ObGetObjectPointerCount@4
ObGetObjectSecurity@12
ObInsertObject@24

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: handle.c,v 1.60 2004/09/13 14:43:50 ekohl Exp $
/* $Id: handle.c,v 1.61 2004/09/24 16:18:28 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -1026,4 +1026,53 @@ ObpGetHandleCountByHandleTable(PHANDLE_TABLE HandleTable)
return Count;
}
/*
* FUNCTION: Searches the handle table of a specified process whether it contains a
* valid handle to the Object we're looking for. If not, it'll create one.
*
* NOTES:
* The parameters of this function is basically a mixture of some of the parameters
* of ObReferenceObjectByHandle() and ObReferenceObjectByPointer(). A little thinking
* about what this function does (by it's name) makes clear what parameters it requires.
* For example the AccessMode parameter of ObReferenceObjectByHandle/Pointer() is not
* required at all as it only has influence on the object security. This function doesn't
* want to get access to an object, it just looks for a valid handle and if it can't find
* one, it'll just create one. It wouldn't make sense to check for security again as the
* caller already has a pointer to the object.
*
* A test on an XP machine shows that this prototype appears to be correct.
*
* ARGUMENTS:
* Process = This parameter simply describes in which handle table we're looking
* for a handle to the object.
* Object = The object pointer that we're looking for
* ObjectType = Just a sanity check as ObReferenceObjectByHandle() and
* ObReferenceObjectByPointer() provides.
* HandleInformation = This one has to be the opposite meaning of the usage in
* ObReferenceObjectByHandle(). If we actually found a valid
* handle in the table, we need to check against the information
* provided so we make sure this handle has all access rights
* (and attributes?!) we need. If they don't match, we can't
* use this handle and keep looking because the caller is likely
* to depend on these access rights.
* HandleReturn = The last parameter is the same as in ObCreateHandle(). If we could
* find a suitable handle in the handle table, return this handle, if
* not, we'll just create one using ObCreateHandle() with all access
* rights the caller needs.
*
* RETURNS: Status
*
* @unimplemented
*/
NTSTATUS STDCALL
ObFindHandleForObject(IN PEPROCESS Process,
IN PVOID Object,
IN POBJECT_TYPE ObjectType,
IN POBJECT_HANDLE_INFORMATION HandleInformation,
OUT PHANDLE HandleReturn)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* EOF */