Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
899fc8d4
Commit
899fc8d4
authored
Jan 21, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlTryAcquireSRWLockShared/Exclusive commands.
parent
8ca96a9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
sync.c
dlls/ntdll/sync.c
+33
-0
winternl.h
include/winternl.h
+2
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
899fc8d4
...
...
@@ -891,6 +891,8 @@
# @ stub RtlTraceDatabaseLock
# @ stub RtlTraceDatabaseUnlock
# @ stub RtlTraceDatabaseValidate
@ stdcall RtlTryAcquireSRWLockExclusive(ptr)
@ stdcall RtlTryAcquireSRWLockShared(ptr)
@ stdcall RtlTryEnterCriticalSection(ptr)
@ cdecl -i386 -norelay RtlUlongByteSwap() NTDLL_RtlUlongByteSwap
@ cdecl -ret64 RtlUlonglongByteSwap(int64)
...
...
dlls/ntdll/sync.c
View file @
899fc8d4
...
...
@@ -1535,6 +1535,10 @@ void WINAPI RtlAcquireSRWLockExclusive( RTL_SRWLOCK *lock )
/***********************************************************************
* RtlAcquireSRWLockShared (NTDLL.@)
*
* NOTES
* Do not call this function recursively - it will only succeed when
* there are no threads waiting for an exclusive lock!
*/
void
WINAPI
RtlAcquireSRWLockShared
(
RTL_SRWLOCK
*
lock
)
{
...
...
@@ -1583,6 +1587,35 @@ void WINAPI RtlReleaseSRWLockShared( RTL_SRWLOCK *lock )
}
/***********************************************************************
* RtlTryAcquireSRWLockExclusive (NTDLL.@)
*
* NOTES
* Similar to AcquireSRWLockExclusive recusive calls are not allowed
* and will fail with return value FALSE.
*/
BOOLEAN
WINAPI
RtlTryAcquireSRWLockExclusive
(
RTL_SRWLOCK
*
lock
)
{
return
interlocked_cmpxchg
(
(
int
*
)
&
lock
->
Ptr
,
SRWLOCK_MASK_IN_EXCLUSIVE
|
SRWLOCK_RES_EXCLUSIVE
,
0
)
==
0
;
}
/***********************************************************************
* RtlTryAcquireSRWLockShared (NTDLL.@)
*/
BOOLEAN
WINAPI
RtlTryAcquireSRWLockShared
(
RTL_SRWLOCK
*
lock
)
{
unsigned
int
val
,
tmp
;
for
(
val
=
*
(
unsigned
int
*
)
&
lock
->
Ptr
;;
val
=
tmp
)
{
if
(
val
&
SRWLOCK_MASK_EXCLUSIVE_QUEUE
)
return
FALSE
;
if
((
tmp
=
interlocked_cmpxchg
(
(
int
*
)
&
lock
->
Ptr
,
val
+
SRWLOCK_RES_SHARED
,
val
))
==
val
)
break
;
}
return
TRUE
;
}
/***********************************************************************
* RtlInitializeConditionVariable (NTDLL.@)
*
* Initializes the condition variable with NULL.
...
...
include/winternl.h
View file @
899fc8d4
...
...
@@ -2512,6 +2512,8 @@ NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
NTSYSAPI
void
WINAPI
RtlTimeToElapsedTimeFields
(
const
LARGE_INTEGER
*
,
PTIME_FIELDS
);
NTSYSAPI
BOOLEAN
WINAPI
RtlTimeToSecondsSince1970
(
const
LARGE_INTEGER
*
,
LPDWORD
);
NTSYSAPI
BOOLEAN
WINAPI
RtlTimeToSecondsSince1980
(
const
LARGE_INTEGER
*
,
LPDWORD
);
NTSYSAPI
BOOLEAN
WINAPI
RtlTryAcquireSRWLockExclusive
(
RTL_SRWLOCK
*
);
NTSYSAPI
BOOLEAN
WINAPI
RtlTryAcquireSRWLockShared
(
RTL_SRWLOCK
*
);
NTSYSAPI
BOOL
WINAPI
RtlTryEnterCriticalSection
(
RTL_CRITICAL_SECTION
*
);
NTSYSAPI
ULONGLONG
__cdecl
RtlUlonglongByteSwap
(
ULONGLONG
);
NTSYSAPI
DWORD
WINAPI
RtlUnicodeStringToAnsiSize
(
const
UNICODE_STRING
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment