2 * reactos Cache Manager (Cc*) owner handling of libcaptive
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "privatebcbpin.h"
23 #include "privatebcb.h"
27 * CcSetBcbOwnerPointer:
28 * @Bcb: Initialized #PUBLIC_BCB structure.
29 * %NULL value is forbidden.
30 * @Owner: Thread-specific pointer (FIXME: Is it KeGetCurrentThread()?).
31 * %NULL value is forbidden (FIXME: Is it W32 compliant?).
33 * Set thread-specific pointer for a pinned @Bcb. Use CcUnpinDataForThread()
34 * when @Bcb is no longer needed. CcUnpinDataForThread() is NOT a reverse
35 * operation for this single call CcSetBcbOwnerPointer(), see CcUnpinDataForThread().
37 * libcaptive implements this function as no-operation as it does not yet
38 * support any threading.
40 VOID CcSetBcbOwnerPointer(IN PVOID Bcb,IN PVOID Owner)
42 CaptivePrivateBcbPinObject *captive_private_bcb_pin_object;
44 g_return_if_fail(Bcb!=NULL);
45 g_return_if_fail(Owner!=NULL);
47 captive_private_bcb_pin_object=CAPTIVE_PRIVATE_BCB_PIN_OBJECT(captive_PublicBcb_to_PrivateBcbObject(Bcb));
49 captive_private_bcb_pin_object_detach_pin(captive_private_bcb_pin_object);
54 * CcUnpinDataForThread:
55 * @Bcb: Initialized #PUBLIC_BCB structure.
56 * %NULL value is forbidden.
57 * @ResourceThreadId: Thread-specific pointer (FIXME: Is it KeGetCurrentThread()?).
58 * This pointer had to be passed to CcSetBcbOwnerPointer() #Owner parameter previously.
59 * %NULL value is forbidden (FIXME: is it W32 compliant?).
61 * CcUnpinData() for a thread specified by @ResourceThreadId.
62 * Reverse operation for a pair of CcMapData() and CcSetBcbOwnerPointer().
64 * libcaptive implements this function as a simple pass to CcUnpinData() as it does not yet
65 * support any threading.
67 VOID CcUnpinDataForThread(IN PVOID Bcb,IN ERESOURCE_THREAD ResourceThreadId)
69 CaptivePrivateBcbObject *captive_private_bcb_object;
71 g_return_if_fail(Bcb!=NULL);
72 g_return_if_fail(ResourceThreadId!=0);
74 captive_private_bcb_object=captive_PublicBcb_to_PrivateBcbObject(Bcb);
76 g_object_unref(captive_private_bcb_object);