Fix sublanguage IDs in .rc files:
[reactos.git] / reactos / drivers / video / videoprt / spinlock.c
1 /*
2 * VideoPort driver
3 *
4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; see the file COPYING.LIB.
18 * If not, write to the Free Software Foundation,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 * $Id$
22 */
23
24 #include "videoprt.h"
25
26 /*
27 * @implemented
28 */
29
30 VP_STATUS NTAPI
31 VideoPortCreateSpinLock(
32 IN PVOID HwDeviceExtension,
33 OUT PSPIN_LOCK *SpinLock)
34 {
35 DPRINT("VideoPortCreateSpinLock\n");
36 *SpinLock = ExAllocatePool(NonPagedPool, sizeof(KSPIN_LOCK));
37 if (*SpinLock == NULL)
38 return ERROR_NOT_ENOUGH_MEMORY;
39 KeInitializeSpinLock((PKSPIN_LOCK)*SpinLock);
40 return NO_ERROR;
41 }
42
43 /*
44 * @implemented
45 */
46
47 VP_STATUS NTAPI
48 VideoPortDeleteSpinLock(
49 IN PVOID HwDeviceExtension,
50 IN PSPIN_LOCK SpinLock)
51 {
52 DPRINT("VideoPortDeleteSpinLock\n");
53 ExFreePool(SpinLock);
54 return NO_ERROR;
55 }
56
57 /*
58 * @implemented
59 */
60
61 VOID NTAPI
62 VideoPortAcquireSpinLock(
63 IN PVOID HwDeviceExtension,
64 IN PSPIN_LOCK SpinLock,
65 OUT PUCHAR OldIrql)
66 {
67 DPRINT("VideoPortAcquireSpinLock\n");
68 KeAcquireSpinLock((PKSPIN_LOCK)SpinLock, OldIrql);
69 }
70
71 /*
72 * @implemented
73 */
74
75 VOID NTAPI
76 VideoPortAcquireSpinLockAtDpcLevel(
77 IN PVOID HwDeviceExtension,
78 IN PSPIN_LOCK SpinLock)
79 {
80 DPRINT("VideoPortAcquireSpinLockAtDpcLevel\n");
81 KefAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock);
82 }
83
84 /*
85 * @implemented
86 */
87
88 VOID NTAPI
89 VideoPortReleaseSpinLock(
90 IN PVOID HwDeviceExtension,
91 IN PSPIN_LOCK SpinLock,
92 IN UCHAR NewIrql)
93 {
94 DPRINT("VideoPortReleaseSpinLock\n");
95 KeReleaseSpinLock((PKSPIN_LOCK)SpinLock, NewIrql);
96 }
97
98 /*
99 * @implemented
100 */
101
102 VOID NTAPI
103 VideoPortReleaseSpinLockFromDpcLevel(
104 IN PVOID HwDeviceExtension,
105 IN PSPIN_LOCK SpinLock)
106 {
107 DPRINT("VideoPortReleaseSpinLockFromDpcLevel\n");
108 KefReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock);
109 }