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
ce41edab
Commit
ce41edab
authored
Mar 11, 2024
by
Jinoh Kang
Committed by
Alexandre Julliard
Mar 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement NtMakePermanentObject.
parent
e368515e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
3 deletions
+77
-3
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-2
ntsyscalls.h
dlls/ntdll/ntsyscalls.h
+0
-0
signal_arm64ec.c
dlls/ntdll/signal_arm64ec.c
+5
-0
om.c
dlls/ntdll/tests/om.c
+37
-0
sync.c
dlls/ntdll/unix/sync.c
+20
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-1
sync.c
dlls/wow64/sync.c
+11
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
ce41edab
...
...
@@ -253,7 +253,7 @@
# @ stub NtLockProductActivationKeys
# @ stub NtLockRegistryKey
@ stdcall -syscall NtLockVirtualMemory(long ptr ptr long)
# @ stub NtMakePermanentObject
@ stdcall -syscall NtMakePermanentObject(long)
@ stdcall -syscall NtMakeTemporaryObject(long)
# @ stub NtMapUserPhysicalPages
# @ stub NtMapUserPhysicalPagesScatter
...
...
@@ -1302,7 +1302,7 @@
# @ stub ZwLockProductActivationKeys
# @ stub ZwLockRegistryKey
@ stdcall -private -syscall ZwLockVirtualMemory(long ptr ptr long) NtLockVirtualMemory
# @ stub Zw
MakePermanentObject
@ stdcall -private -syscall ZwMakePermanentObject(long) Nt
MakePermanentObject
@ stdcall -private -syscall ZwMakeTemporaryObject(long) NtMakeTemporaryObject
# @ stub ZwMapUserPhysicalPages
# @ stub ZwMapUserPhysicalPagesScatter
...
...
dlls/ntdll/ntsyscalls.h
View file @
ce41edab
This diff is collapsed.
Click to expand it.
dlls/ntdll/signal_arm64ec.c
View file @
ce41edab
...
...
@@ -611,6 +611,11 @@ NTSTATUS SYSCALL_API NtLockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *s
SYSCALL_FUNC
(
NtLockVirtualMemory
);
}
NTSTATUS
SYSCALL_API
NtMakePermanentObject
(
HANDLE
handle
)
{
SYSCALL_FUNC
(
NtMakePermanentObject
);
}
NTSTATUS
SYSCALL_API
NtMakeTemporaryObject
(
HANDLE
handle
)
{
SYSCALL_FUNC
(
NtMakeTemporaryObject
);
...
...
dlls/ntdll/tests/om.c
View file @
ce41edab
...
...
@@ -3163,6 +3163,7 @@ static void test_object_permanence(void)
ULONG
initial_attr
;
ACCESS_MASK
access
;
BOOLEAN
make_temporary
;
BOOLEAN
make_permanent
;
NTSTATUS
make_temp_status
;
}
tests
[]
=
{
{
...
...
@@ -3184,6 +3185,20 @@ static void test_object_permanence(void)
.
make_temporary
=
TRUE
,
.
make_temp_status
=
STATUS_ACCESS_DENIED
,
},
{
.
name
=
"NtMakePermanentObject() succeeds even if already permanent"
,
.
initial_attr
=
OBJ_PERMANENT
,
.
access
=
EVENT_ALL_ACCESS
&
~
DELETE
,
.
make_permanent
=
TRUE
,
},
{
.
name
=
"NtMakePermanentObject() reverses effect of NtMakeTemporaryObject()"
,
.
initial_attr
=
OBJ_PERMANENT
,
.
access
=
GENERIC_ALL
,
.
make_temporary
=
TRUE
,
.
make_temp_status
=
STATUS_SUCCESS
,
.
make_permanent
=
TRUE
,
},
{
.
name
=
"temporary object disappears"
,
...
...
@@ -3204,6 +3219,20 @@ static void test_object_permanence(void)
.
make_temporary
=
TRUE
,
.
make_temp_status
=
STATUS_ACCESS_DENIED
,
},
{
.
name
=
"NtMakePermanentObject() makes an object persist"
,
.
initial_attr
=
0
,
.
access
=
EVENT_ALL_ACCESS
&
~
DELETE
,
.
make_permanent
=
TRUE
,
},
{
.
name
=
"NtMakePermanentObject() is not annulled by calling NtMakeTemporaryObject() on an already temporary object"
,
.
initial_attr
=
0
,
.
access
=
GENERIC_ALL
,
.
make_temporary
=
TRUE
,
.
make_temp_status
=
STATUS_SUCCESS
,
.
make_permanent
=
TRUE
,
},
};
const
struct
object_permanence_test
*
test
;
HANDLE
process_token
=
NULL
,
thread_token
=
NULL
;
...
...
@@ -3317,6 +3346,14 @@ static void test_object_permanence(void)
}
winetest_pop_context
();
if
(
test
->
make_permanent
)
{
status
=
NtMakePermanentObject
(
handle
);
todo_wine_if
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_PRIVILEGE_NOT_HELD
)
ok
(
status
==
make_perma_status
,
"NtMakePermanentObject returned %08lx expected (%08lx)
\n
"
,
status
,
make_perma_status
);
if
(
!
NT_ERROR
(
status
))
is_permanent
=
TRUE
;
}
if
(
winetest_debug
>
1
)
trace
(
"NOTE: about to close earlier handle (%p) which should be the last"
,
handle
);
NtClose
(
handle
);
...
...
dlls/ntdll/unix/sync.c
View file @
ce41edab
...
...
@@ -1273,6 +1273,26 @@ NTSTATUS WINAPI NtQuerySymbolicLinkObject( HANDLE handle, UNICODE_STRING *target
/**************************************************************************
* NtMakePermanentObject (NTDLL.@)
*/
NTSTATUS
WINAPI
NtMakePermanentObject
(
HANDLE
handle
)
{
unsigned
int
ret
;
TRACE
(
"%p
\n
"
,
handle
);
SERVER_START_REQ
(
set_object_permanence
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
permanent
=
1
;
ret
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
return
ret
;
}
/**************************************************************************
* NtMakeTemporaryObject (NTDLL.@)
*/
NTSTATUS
WINAPI
NtMakeTemporaryObject
(
HANDLE
handle
)
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
ce41edab
...
...
@@ -799,7 +799,6 @@
@ stdcall NtFsControlFile(long long ptr ptr ptr long ptr long ptr long)
@ stub NtGlobalFlag
@ stdcall NtLockFile(long long ptr ptr ptr ptr ptr ptr long long)
@ stub NtMakePermanentObject
@ stdcall NtMapViewOfSection(long long ptr long long ptr ptr long long long)
@ stdcall NtNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long)
@ stdcall NtOpenFile(ptr long ptr ptr long long)
...
...
@@ -1446,6 +1445,7 @@
@ stdcall -private ZwLoadKey(ptr ptr) NtLoadKey
@ stdcall -private ZwLockFile(long long ptr ptr ptr ptr ptr ptr long long) NtLockFile
@ stdcall -private ZwLockVirtualMemory(long ptr ptr long) NtLockVirtualMemory
@ stdcall ZwMakePermanentObject(long) NtMakePermanentObject
@ stdcall ZwMakeTemporaryObject(long) NtMakeTemporaryObject
@ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) NtMapViewOfSection
@ stdcall -private ZwNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) NtNotifyChangeDirectoryFile
...
...
dlls/wow64/sync.c
View file @
ce41edab
...
...
@@ -535,6 +535,17 @@ NTSTATUS WINAPI wow64_NtListenPort( UINT *args )
/**********************************************************************
* wow64_NtMakePermanentObject
*/
NTSTATUS
WINAPI
wow64_NtMakePermanentObject
(
UINT
*
args
)
{
HANDLE
handle
=
get_handle
(
&
args
);
return
NtMakePermanentObject
(
handle
);
}
/**********************************************************************
* wow64_NtMakeTemporaryObject
*/
NTSTATUS
WINAPI
wow64_NtMakeTemporaryObject
(
UINT
*
args
)
...
...
include/winternl.h
View file @
ce41edab
...
...
@@ -4480,6 +4480,7 @@ NTSYSAPI NTSTATUS WINAPI NtLoadKey2(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES
NTSYSAPI
NTSTATUS
WINAPI
NtLoadKeyEx
(
const
OBJECT_ATTRIBUTES
*
,
OBJECT_ATTRIBUTES
*
,
ULONG
,
HANDLE
,
HANDLE
,
ACCESS_MASK
,
HANDLE
*
,
IO_STATUS_BLOCK
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtLockFile
(
HANDLE
,
HANDLE
,
PIO_APC_ROUTINE
,
void
*
,
PIO_STATUS_BLOCK
,
PLARGE_INTEGER
,
PLARGE_INTEGER
,
ULONG
*
,
BOOLEAN
,
BOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
NtLockVirtualMemory
(
HANDLE
,
PVOID
*
,
SIZE_T
*
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtMakePermanentObject
(
HANDLE
);
NTSYSAPI
NTSTATUS
WINAPI
NtMakeTemporaryObject
(
HANDLE
);
NTSYSAPI
NTSTATUS
WINAPI
NtMapViewOfSection
(
HANDLE
,
HANDLE
,
PVOID
*
,
ULONG_PTR
,
SIZE_T
,
const
LARGE_INTEGER
*
,
SIZE_T
*
,
SECTION_INHERIT
,
ULONG
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtMapViewOfSectionEx
(
HANDLE
,
HANDLE
,
PVOID
*
,
const
LARGE_INTEGER
*
,
SIZE_T
*
,
ULONG
,
ULONG
,
MEM_EXTENDED_PARAMETER
*
,
ULONG
);
...
...
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