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
767970a0
Commit
767970a0
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 NtCreateEvent().
parent
803cee46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
esync.c
dlls/ntdll/unix/esync.c
+27
-0
esync.h
dlls/ntdll/unix/esync.h
+3
-0
sync.c
dlls/ntdll/unix/sync.c
+4
-0
esync.c
server/esync.c
+15
-0
No files found.
dlls/ntdll/unix/esync.c
View file @
767970a0
...
...
@@ -89,6 +89,13 @@ struct semaphore
};
C_ASSERT
(
sizeof
(
struct
semaphore
)
==
8
);
struct
event
{
int
signaled
;
int
locked
;
};
C_ASSERT
(
sizeof
(
struct
event
)
==
8
);
static
char
shm_name
[
29
];
static
int
shm_fd
;
static
void
**
shm_addrs
;
...
...
@@ -295,6 +302,18 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev )
return
STATUS_SUCCESS
;
}
NTSTATUS
esync_create_event
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
EVENT_TYPE
event_type
,
BOOLEAN
initial
)
{
enum
esync_type
type
=
(
event_type
==
SynchronizationEvent
?
ESYNC_AUTO_EVENT
:
ESYNC_MANUAL_EVENT
);
TRACE
(
"name %s, %s-reset, initial %d.
\n
"
,
attr
?
debugstr_us
(
attr
->
ObjectName
)
:
"<no name>"
,
event_type
==
NotificationEvent
?
"manual"
:
"auto"
,
initial
);
return
create_esync
(
type
,
handle
,
access
,
attr
,
initial
,
0
);
}
#define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000
...
...
@@ -340,6 +359,14 @@ static void update_grabbed_object( struct esync *obj )
* etc. */
InterlockedExchangeAdd
(
&
semaphore
->
count
,
-
1
);
}
else
if
(
obj
->
type
==
ESYNC_AUTO_EVENT
)
{
struct
event
*
event
=
obj
->
shm
;
/* We don't have to worry about a race between this and read(), since
* this is just a hint, and the real state is in the kernel object.
* This might already be 0, but that's okay! */
event
->
signaled
=
0
;
}
}
/* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we
...
...
dlls/ntdll/unix/esync.h
View file @
767970a0
...
...
@@ -26,6 +26,9 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access,
const
OBJECT_ATTRIBUTES
*
attr
,
LONG
initial
,
LONG
max
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_release_semaphore
(
HANDLE
handle
,
ULONG
count
,
ULONG
*
prev
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_create_event
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
EVENT_TYPE
type
,
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 @
767970a0
...
...
@@ -388,6 +388,10 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_
*
handle
=
0
;
if
(
type
!=
NotificationEvent
&&
type
!=
SynchronizationEvent
)
return
STATUS_INVALID_PARAMETER
;
if
(
do_esync
())
return
esync_create_event
(
handle
,
access
,
attr
,
type
,
state
);
if
((
ret
=
alloc_object_attributes
(
attr
,
&
objattr
,
&
len
)))
return
ret
;
SERVER_START_REQ
(
create_event
)
...
...
server/esync.c
View file @
767970a0
...
...
@@ -201,6 +201,13 @@ struct semaphore
};
C_ASSERT
(
sizeof
(
struct
semaphore
)
==
8
);
struct
event
{
int
signaled
;
int
locked
;
};
C_ASSERT
(
sizeof
(
struct
event
)
==
8
);
struct
esync
*
create_esync
(
struct
object
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
int
initval
,
int
max
,
enum
esync_type
type
,
const
struct
security_descriptor
*
sd
)
...
...
@@ -256,6 +263,14 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name,
semaphore
->
count
=
initval
;
break
;
}
case
ESYNC_AUTO_EVENT
:
case
ESYNC_MANUAL_EVENT
:
{
struct
event
*
event
=
get_shm
(
esync
->
shm_idx
);
event
->
signaled
=
initval
?
1
:
0
;
event
->
locked
=
0
;
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