Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
2051acb1
Commit
2051acb1
authored
Jul 06, 2020
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll, server: Implement NtCreateMutant().
parent
bdbdf5dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
0 deletions
+37
-0
esync.c
dlls/ntdll/unix/esync.c
+16
-0
esync.h
dlls/ntdll/unix/esync.h
+3
-0
sync.c
dlls/ntdll/unix/sync.c
+4
-0
esync.c
server/esync.c
+14
-0
No files found.
dlls/ntdll/unix/esync.c
View file @
2051acb1
...
...
@@ -84,6 +84,13 @@ struct semaphore
};
C_ASSERT
(
sizeof
(
struct
semaphore
)
==
8
);
struct
mutex
{
DWORD
tid
;
int
count
;
/* recursion count */
};
C_ASSERT
(
sizeof
(
struct
mutex
)
==
8
);
struct
event
{
int
signaled
;
...
...
@@ -408,6 +415,15 @@ NTSTATUS esync_reset_event( HANDLE handle )
return
STATUS_SUCCESS
;
}
NTSTATUS
esync_create_mutex
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
BOOLEAN
initial
)
{
TRACE
(
"name %s, initial %d.
\n
"
,
attr
?
debugstr_us
(
attr
->
ObjectName
)
:
"<no name>"
,
initial
);
return
create_esync
(
ESYNC_MUTEX
,
handle
,
access
,
attr
,
initial
?
0
:
1
,
0
);
}
#define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000
...
...
dlls/ntdll/unix/esync.h
View file @
2051acb1
...
...
@@ -31,6 +31,9 @@ extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access,
extern
NTSTATUS
esync_reset_event
(
HANDLE
handle
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_set_event
(
HANDLE
handle
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_create_mutex
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
BOOLEAN
initial
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_wait_objects
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOLEAN
wait_any
,
BOOLEAN
alertable
,
const
LARGE_INTEGER
*
timeout
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/sync.c
View file @
2051acb1
...
...
@@ -556,6 +556,10 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT
struct
object_attributes
*
objattr
;
*
handle
=
0
;
if
(
do_esync
())
return
esync_create_mutex
(
handle
,
access
,
attr
,
owned
);
if
((
ret
=
alloc_object_attributes
(
attr
,
&
objattr
,
&
len
)))
return
ret
;
SERVER_START_REQ
(
create_mutex
)
...
...
server/esync.c
View file @
2051acb1
...
...
@@ -202,6 +202,13 @@ struct semaphore
};
C_ASSERT
(
sizeof
(
struct
semaphore
)
==
8
);
struct
mutex
{
DWORD
tid
;
int
count
;
/* recursion count */
};
C_ASSERT
(
sizeof
(
struct
mutex
)
==
8
);
struct
event
{
int
signaled
;
...
...
@@ -272,6 +279,13 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name,
event
->
locked
=
0
;
break
;
}
case
ESYNC_MUTEX
:
{
struct
mutex
*
mutex
=
get_shm
(
esync
->
shm_idx
);
mutex
->
tid
=
initval
?
0
:
current
->
id
;
mutex
->
count
=
initval
?
0
:
1
;
break
;
}
default:
assert
(
0
);
}
...
...
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