Author: sginsberg
Date: Sun Nov 2 08:08:49 2008
New Revision: 37149
URL:
http://svn.reactos.org/svn/reactos?rev=37149&view=rev
Log:
- Sync 36654 to trunk
Modified:
trunk/reactos/include/ndk/exfuncs.h
trunk/reactos/ntoskrnl/ex/resource.c
trunk/reactos/ntoskrnl/ntoskrnl.pspec
Modified: trunk/reactos/include/ndk/exfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/exfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/exfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/exfuncs.h [iso-8859-1] Sun Nov 2 08:08:49 2008
@@ -111,6 +111,33 @@
IN PEX_ENUM_HANDLE_CALLBACK EnumHandleProcedure,
IN OUT PVOID Context,
OUT PHANDLE Handle OPTIONAL
+);
+
+//
+// Resource Functions
+//
+PVOID
+NTAPI
+ExEnterCriticalRegionAndAcquireResourceExclusive(
+ IN PERESOURCE Resource
+);
+
+PVOID
+NTAPI
+ExEnterCriticalRegionAndAcquireResourceShared(
+ IN PERESOURCE Resource
+);
+
+PVOID
+NTAPI
+ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(
+ IN PERESOURCE Resource
+);
+
+VOID
+FASTCALL
+ExReleaseResourceAndLeaveCriticalRegion(
+ IN PERESOURCE Resource
);
#endif
Modified: trunk/reactos/ntoskrnl/ex/resource.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/resource.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/resource.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/resource.c [iso-8859-1] Sun Nov 2 08:08:49 2008
@@ -2199,6 +2199,66 @@
}
/*++
+ * @name ExEnterCriticalRegionAndAcquireResourceShared
+ * @implemented NT5.2
+ *
+ * The ExEnterCriticalRegionAndAcquireResourceShared routine
+ * enters a critical region and then acquires a resource shared.
+ *
+ * @param Resource
+ * Pointer to the resource to acquire.
+ *
+ * @return Pointer to the Win32K thread pointer of the current thread.
+ *
+ * @remarks See ExAcquireResourceSharedLite.
+ *
+ *--*/
+PVOID
+NTAPI
+ExEnterCriticalRegionAndAcquireResourceShared(IN PERESOURCE Resource)
+{
+ /* Enter critical region */
+ KeEnterCriticalRegion();
+
+ /* Acquire the resource */
+ ExAcquireResourceSharedLite(Resource, TRUE);
+
+ /* Return the Win32 Thread */
+ return KeGetCurrentThread()->Win32Thread;
+}
+
+/*++
+ * @name ExEnterCriticalRegionAndAcquireSharedWaitForExclusive
+ * @implemented NT5.2
+ *
+ * The ExEnterCriticalRegionAndAcquireSharedWaitForExclusive routine
+ * enters a critical region and then acquires a resource shared if
+ * shared access can be granted and there are no exclusive waiters.
+ * It then acquires the resource exclusively.
+ *
+ * @param Resource
+ * Pointer to the resource to acquire.
+ *
+ * @return Pointer to the Win32K thread pointer of the current thread.
+ *
+ * @remarks See ExAcquireSharedWaitForExclusive.
+ *
+ *--*/
+PVOID
+NTAPI
+ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(IN PERESOURCE Resource)
+{
+ /* Enter critical region */
+ KeEnterCriticalRegion();
+
+ /* Acquire the resource */
+ ExAcquireSharedWaitForExclusive(Resource, TRUE);
+
+ /* Return the Win32 Thread */
+ return KeGetCurrentThread()->Win32Thread;
+}
+
+/*++
* @name ExReleaseResourceAndLeaveCriticalRegion
* @implemented NT5.1
*
@@ -2223,6 +2283,3 @@
/* Leave critical region */
KeLeaveCriticalRegion();
}
-
-/* EOF */
-
Modified: trunk/reactos/ntoskrnl/ntoskrnl.pspec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.pspec?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl.pspec [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl.pspec [iso-8859-1] Sun Nov 2 08:08:49 2008
@@ -80,8 +80,8 @@
@ stdcall ExDisableResourceBoostLite(ptr)
@ fastcall ExEnterCriticalRegionAndAcquireFastMutexUnsafe(ptr)
@ stdcall ExEnterCriticalRegionAndAcquireResourceExclusive(ptr)
-;ExEnterCriticalRegionAndAcquireResourceShared
-;ExEnterCriticalRegionAndAcquireSharedWaitForExclusive
+@ stdcall ExEnterCriticalRegionAndAcquireResourceShared(ptr)
+@ stdcall ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(ptr)
@ stdcall ExEnumHandleTable(ptr ptr ptr ptr)
@ extern ExEventObjectType _ExEventObjectType
@ stdcall ExExtendZone(ptr ptr long)