mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:55:41 +00:00
- Implement KsCopyObjectBagItems
svn path=/trunk/; revision=42805
This commit is contained in:
parent
bfe81917e0
commit
0d280a8bde
1 changed files with 50 additions and 3 deletions
|
@ -235,7 +235,7 @@ KsRemoveItemFromObjectBag(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@unimplemented
|
@implemented
|
||||||
*/
|
*/
|
||||||
KSDDKAPI
|
KSDDKAPI
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -244,8 +244,55 @@ KsCopyObjectBagItems(
|
||||||
IN KSOBJECT_BAG ObjectBagDestination,
|
IN KSOBJECT_BAG ObjectBagDestination,
|
||||||
IN KSOBJECT_BAG ObjectBagSource)
|
IN KSOBJECT_BAG ObjectBagSource)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
PKSIOBJECT_BAG ObjectBagDest, ObjectBagSrc;
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
PLIST_ENTRY Entry;
|
||||||
|
PKSIOBJECT_BAG_ENTRY BagEntry;
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
/* get object bag src */
|
||||||
|
ObjectBagSrc = (PKSIOBJECT_BAG)ObjectBagSource;
|
||||||
|
|
||||||
|
/* get object bag dst */
|
||||||
|
ObjectBagDest = (PKSIOBJECT_BAG)ObjectBagDestination;
|
||||||
|
|
||||||
|
/* acquire source mutex */
|
||||||
|
KeWaitForSingleObject(ObjectBagSrc->BagMutex, Executive, KernelMode, FALSE, NULL);
|
||||||
|
|
||||||
|
if (ObjectBagSrc->BagMutex != ObjectBagDest->BagMutex)
|
||||||
|
{
|
||||||
|
/* acquire destination mutex */
|
||||||
|
KeWaitForSingleObject(ObjectBagDest->BagMutex, Executive, KernelMode, FALSE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* point to first item */
|
||||||
|
Entry = ObjectBagSrc->ObjectList.Flink;
|
||||||
|
/* first scan the list if the item is already inserted */
|
||||||
|
while(Entry != &ObjectBagSrc->ObjectList)
|
||||||
|
{
|
||||||
|
/* get bag entry */
|
||||||
|
BagEntry = (PKSIOBJECT_BAG_ENTRY)CONTAINING_RECORD(Entry, KSIOBJECT_BAG_ENTRY, Entry);
|
||||||
|
|
||||||
|
/* add the item */
|
||||||
|
Status = KsAddItemToObjectBag(ObjectBagDestination, BagEntry->Item, BagEntry->Free);
|
||||||
|
|
||||||
|
/* check for success */
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* move to next entry */
|
||||||
|
Entry = Entry->Flink;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectBagSrc->BagMutex != ObjectBagDest->BagMutex)
|
||||||
|
{
|
||||||
|
/* release destination mutex */
|
||||||
|
KeReleaseMutex(ObjectBagDest->BagMutex, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* release source mutex */
|
||||||
|
KeReleaseMutex(ObjectBagSrc->BagMutex, FALSE);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue