*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
- * FILE: ntoskrnl/ps/kill.c
- * PURPOSE: Terminating a thread
- * PROGRAMMER: David Welch (welch@cwcom.net)
- * UPDATE HISTORY:
- * Created 22/05/98
+ * FILE: ntoskrnl/ob/sdcache.c
+ * PURPOSE: No purpose listed.
+ *
+ * PROGRAMMERS: David Welch (welch@cwcom.net)
*/
/* INCLUDES *****************************************************************/
/* GLOBALS ******************************************************************/
-PLIST_ENTRY ObpSdCache;
-KSPIN_LOCK ObpSdCacheSpinLock;
-KIRQL ObpSdCacheIrql;
-
-
#define SD_CACHE_ENTRIES 0x100
+LIST_ENTRY ObpSdCache[SD_CACHE_ENTRIES];
+FAST_MUTEX ObpSdCacheMutex;
+
/* FUNCTIONS ****************************************************************/
NTSTATUS
+NTAPI
ObpInitSdCache(VOID)
{
ULONG i;
- ObpSdCache = ExAllocatePool(NonPagedPool,
- SD_CACHE_ENTRIES * sizeof(LIST_ENTRY));
- if (ObpSdCache == NULL)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- for (i = 0; i < SD_CACHE_ENTRIES; i++)
+ for (i = 0; i < (sizeof(ObpSdCache) / sizeof(ObpSdCache[0])); i++)
{
InitializeListHead(&ObpSdCache[i]);
}
- KeInitializeSpinLock(&ObpSdCacheSpinLock);
+ ExInitializeFastMutex(&ObpSdCacheMutex);
return STATUS_SUCCESS;
}
-static VOID
+static __inline VOID
ObpSdCacheLock(VOID)
{
- KeAcquireSpinLock(&ObpSdCacheSpinLock,
- &ObpSdCacheIrql);
+ /* can't acquire a fast mutex in the early boot process... */
+ if(KeGetCurrentThread() != NULL)
+ {
+ ExAcquireFastMutex(&ObpSdCacheMutex);
+ }
}
-static VOID
+static __inline VOID
ObpSdCacheUnlock(VOID)
{
- KeReleaseSpinLock(&ObpSdCacheSpinLock,
- ObpSdCacheIrql);
+ /* can't acquire a fast mutex in the early boot process... */
+ if(KeGetCurrentThread() != NULL)
+ {
+ ExReleaseFastMutex(&ObpSdCacheMutex);
+ }
}
NTSTATUS
+NTAPI
ObpAddSecurityDescriptor(IN PSECURITY_DESCRIPTOR SourceSD,
OUT PSECURITY_DESCRIPTOR *DestinationSD)
{
NTSTATUS
+NTAPI
ObpRemoveSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
PSD_CACHE_ENTRY CacheEntry;
VOID
+NTAPI
ObpReferenceCachedSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
PSD_CACHE_ENTRY CacheEntry;
VOID
+NTAPI
ObpDereferenceCachedSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
DPRINT("ObpDereferenceCachedSecurityDescriptor() called\n");