2 * WoW64 synchronization objects and functions
4 * Copyright 2021 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
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 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define WIN32_NO_STATUS
29 #include "wow64_private.h"
32 /**********************************************************************
35 NTSTATUS WINAPI
wow64_NtClearEvent( UINT
*args
)
37 HANDLE handle
= get_handle( &args
);
39 return NtClearEvent( handle
);
43 /**********************************************************************
46 NTSTATUS WINAPI
wow64_NtCreateEvent( UINT
*args
)
48 ULONG
*handle_ptr
= get_ptr( &args
);
49 ACCESS_MASK access
= get_ulong( &args
);
50 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
51 EVENT_TYPE type
= get_ulong( &args
);
52 BOOLEAN state
= get_ulong( &args
);
54 struct object_attr64 attr
;
59 status
= NtCreateEvent( &handle
, access
, objattr_32to64( &attr
, attr32
), type
, state
);
60 put_handle( handle_ptr
, handle
);
65 /**********************************************************************
66 * wow64_NtCreateMutant
68 NTSTATUS WINAPI
wow64_NtCreateMutant( UINT
*args
)
70 ULONG
*handle_ptr
= get_ptr( &args
);
71 ACCESS_MASK access
= get_ulong( &args
);
72 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
73 BOOLEAN owned
= get_ulong( &args
);
75 struct object_attr64 attr
;
80 status
= NtCreateMutant( &handle
, access
, objattr_32to64( &attr
, attr32
), owned
);
81 put_handle( handle_ptr
, handle
);
86 /**********************************************************************
89 NTSTATUS WINAPI
wow64_NtOpenEvent( UINT
*args
)
91 ULONG
*handle_ptr
= get_ptr( &args
);
92 ACCESS_MASK access
= get_ulong( &args
);
93 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
95 struct object_attr64 attr
;
100 status
= NtOpenEvent( &handle
, access
, objattr_32to64( &attr
, attr32
));
101 put_handle( handle_ptr
, handle
);
106 /**********************************************************************
109 NTSTATUS WINAPI
wow64_NtOpenMutant( UINT
*args
)
111 ULONG
*handle_ptr
= get_ptr( &args
);
112 ACCESS_MASK access
= get_ulong( &args
);
113 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
115 struct object_attr64 attr
;
120 status
= NtOpenMutant( &handle
, access
, objattr_32to64( &attr
, attr32
));
121 put_handle( handle_ptr
, handle
);
126 /**********************************************************************
129 NTSTATUS WINAPI
wow64_NtPulseEvent( UINT
*args
)
131 HANDLE handle
= get_handle( &args
);
132 LONG
*prev_state
= get_ptr( &args
);
134 return NtPulseEvent( handle
, prev_state
);
138 /**********************************************************************
141 NTSTATUS WINAPI
wow64_NtQueryEvent( UINT
*args
)
143 HANDLE handle
= get_handle( &args
);
144 EVENT_INFORMATION_CLASS
class = get_ulong( &args
);
145 void *info
= get_ptr( &args
);
146 ULONG len
= get_ulong( &args
);
147 ULONG
*retlen
= get_ptr( &args
);
149 return NtQueryEvent( handle
, class, info
, len
, retlen
);
153 /**********************************************************************
154 * wow64_NtQueryMutant
156 NTSTATUS WINAPI
wow64_NtQueryMutant( UINT
*args
)
158 HANDLE handle
= get_handle( &args
);
159 MUTANT_INFORMATION_CLASS
class = get_ulong( &args
);
160 void *info
= get_ptr( &args
);
161 ULONG len
= get_ulong( &args
);
162 ULONG
*retlen
= get_ptr( &args
);
164 return NtQueryMutant( handle
, class, info
, len
, retlen
);
168 /**********************************************************************
169 * wow64_NtReleaseMutant
171 NTSTATUS WINAPI
wow64_NtReleaseMutant( UINT
*args
)
173 HANDLE handle
= get_handle( &args
);
174 LONG
*prev_count
= get_ptr( &args
);
176 return NtReleaseMutant( handle
, prev_count
);
180 /**********************************************************************
183 NTSTATUS WINAPI
wow64_NtResetEvent( UINT
*args
)
185 HANDLE handle
= get_handle( &args
);
186 LONG
*prev_state
= get_ptr( &args
);
188 return NtResetEvent( handle
, prev_state
);
192 /**********************************************************************
195 NTSTATUS WINAPI
wow64_NtSetEvent( UINT
*args
)
197 HANDLE handle
= get_handle( &args
);
198 LONG
*prev_state
= get_ptr( &args
);
200 return NtSetEvent( handle
, prev_state
);