- Forgot to commit these for MSVC build...
[reactos.git] / reactos / drivers / net / tcpip / tcpip / lock.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: tcpip/lock.c
5 * PURPOSE: Locking and unlocking
6 * PROGRAMMERS: Art Yerkes
7 * REVISIONS:
8 */
9 #include "precomp.h"
10
11 KIRQL TcpipGetCurrentIrql() { return KeGetCurrentIrql(); }
12
13 VOID TcpipInitializeSpinLock( PKSPIN_LOCK SpinLock ) {
14 KeInitializeSpinLock( SpinLock );
15 }
16
17 VOID TcpipAcquireSpinLock( PKSPIN_LOCK SpinLock, PKIRQL Irql ) {
18 KeAcquireSpinLock( SpinLock, Irql );
19 }
20
21 VOID TcpipAcquireSpinLockAtDpcLevel( PKSPIN_LOCK SpinLock ) {
22 KeAcquireSpinLockAtDpcLevel( SpinLock );
23 }
24
25 VOID TcpipReleaseSpinLock( PKSPIN_LOCK SpinLock, KIRQL Irql ) {
26 KeReleaseSpinLock( SpinLock, Irql );
27 }
28
29 VOID TcpipReleaseSpinLockFromDpcLevel( PKSPIN_LOCK SpinLock ) {
30 KeReleaseSpinLockFromDpcLevel( SpinLock );
31 }
32
33 VOID TcpipInterlockedInsertTailList( PLIST_ENTRY ListHead,
34 PLIST_ENTRY Item,
35 PKSPIN_LOCK Lock ) {
36 ExInterlockedInsertTailList( ListHead, Item, Lock );
37 }
38
39 VOID TcpipAcquireFastMutex( PFAST_MUTEX Mutex ) {
40 ExAcquireFastMutex( Mutex );
41 }
42
43 VOID TcpipReleaseFastMutex( PFAST_MUTEX Mutex ) {
44 ExReleaseFastMutex( Mutex );
45 }
46
47 VOID TcpipRecursiveMutexInit( PRECURSIVE_MUTEX RecMutex ) {
48 RecursiveMutexInit( RecMutex );
49 }
50
51 UINT TcpipRecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOL ToWrite ) {
52 UINT Ret;
53 TI_DbgPrint(DEBUG_LOCK,("Locking\n"));
54 Ret = RecursiveMutexEnter( RecMutex, ToWrite );
55 TI_DbgPrint(DEBUG_LOCK,("Locked\n"));
56 return Ret;
57 }
58
59 VOID TcpipRecursiveMutexLeave( PRECURSIVE_MUTEX RecMutex ) {
60 TI_DbgPrint(DEBUG_LOCK,("Unlocking\n"));
61 RecursiveMutexLeave( RecMutex );
62 }