#include <rtl.h>
#include <debug.h>
Go to the source code of this file.
◆ NDEBUG
◆ RtlAcquireResourceExclusive()
Definition at line 85 of file resource.c.
88{
91
95 {
98 }
100 {
102 {
105 goto done;
106 }
107wait:
109 {
111
117 goto done;
119 }
120 }
121 else
122 {
124 goto wait;
125 }
126 if (retVal)
128done:
130 return retVal;
131}
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
#define NT_SUCCESS(StatCode)
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
_In_ WDFDPC _In_ BOOLEAN Wait
_Out_ PCLIENT_ID ClientId
◆ RtlAcquireResourceShared()
Definition at line 139 of file resource.c.
142{
145
149 {
151 {
154 goto done;
155 }
156
158 {
165 goto done;
167 }
168 }
169 else
170 {
174 }
175done:
177 return retVal;
178}
#define STATUS_UNSUCCESSFUL
◆ RtlConvertExclusiveToShared()
Definition at line 186 of file resource.c.
187{
189
191 {
193
195 {
197
198
205 }
206 else
207 {
209 }
210 }
211
213}
NTSTATUS NTAPI NtReleaseSemaphore(IN HANDLE SemaphoreHandle, IN LONG ReleaseCount, OUT PLONG PreviousCount OPTIONAL)
◆ RtlConvertSharedToExclusive()
Definition at line 221 of file resource.c.
222{
224
226
228 {
231 }
232 else
233 {
235
241 return;
242
246 }
248}
◆ RtlDeleteResource()
Definition at line 68 of file resource.c.
69{
77}
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
◆ RtlDumpResource()
Definition at line 311 of file resource.c.
312{
313 DbgPrint(
"RtlDumpResource(%p):\n\tactive count = %d\n\twaiting readers = %u\n\twaiting writers = %u\n",
318
320 {
323 }
324}
◆ RtlInitializeResource()
Definition at line 25 of file resource.c.
26{
28
31 {
33 }
34
38 0,
39 65535);
41 {
43 }
45
49 0,
50 65535);
52 {
54 }
55
60}
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
NTSTATUS NTAPI NtCreateSemaphore(OUT PHANDLE SemaphoreHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN LONG InitialCount, IN LONG MaximumCount)
#define SEMAPHORE_ALL_ACCESS
◆ RtlReleaseResource()
Definition at line 256 of file resource.c.
257{
259
261 {
264 {
266 {
267wake_exclusive:
270 1,
272 }
273 }
274 }
275 else if (
Resource->NumberActive < 0)
276 {
279 {
282 {
283 goto wake_exclusive;
284 }
285 else
286 {
288 {
290
291
298 }
299 }
300 }
301 }
303}