Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b15680a0
Commit
b15680a0
authored
Oct 05, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement NtQueryValueKey(KeyValuePartialInformationAlign64).
parent
9878b47b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
reg.c
dlls/ntdll/tests/reg.c
+37
-0
registry.c
dlls/ntdll/unix/registry.c
+15
-0
winternl.h
include/winternl.h
+6
-0
No files found.
dlls/ntdll/tests/reg.c
View file @
b15680a0
...
@@ -768,6 +768,7 @@ static void test_NtQueryValueKey(void)
...
@@ -768,6 +768,7 @@ static void test_NtQueryValueKey(void)
UNICODE_STRING
ValName
;
UNICODE_STRING
ValName
;
KEY_VALUE_BASIC_INFORMATION
*
basic_info
;
KEY_VALUE_BASIC_INFORMATION
*
basic_info
;
KEY_VALUE_PARTIAL_INFORMATION
*
partial_info
,
pi
;
KEY_VALUE_PARTIAL_INFORMATION
*
partial_info
,
pi
;
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
*
aligned_info
;
KEY_VALUE_FULL_INFORMATION
*
full_info
;
KEY_VALUE_FULL_INFORMATION
*
full_info
;
DWORD
len
,
expected
;
DWORD
len
,
expected
;
...
@@ -815,6 +816,42 @@ static void test_NtQueryValueKey(void)
...
@@ -815,6 +816,42 @@ static void test_NtQueryValueKey(void)
ok
(
*
(
DWORD
*
)
partial_info
->
Data
==
711
,
"incorrect Data returned: 0x%lx
\n
"
,
*
(
DWORD
*
)
partial_info
->
Data
);
ok
(
*
(
DWORD
*
)
partial_info
->
Data
==
711
,
"incorrect Data returned: 0x%lx
\n
"
,
*
(
DWORD
*
)
partial_info
->
Data
);
HeapFree
(
GetProcessHeap
(),
0
,
partial_info
);
HeapFree
(
GetProcessHeap
(),
0
,
partial_info
);
len
=
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
[
0
]);
aligned_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
aligned_info
)
+
4
);
aligned_info
=
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
*
)((
char
*
)
aligned_info
+
4
);
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValuePartialInformationAlign64
,
aligned_info
,
len
,
&
len
);
ok
(
status
==
STATUS_BUFFER_OVERFLOW
,
"NtQueryValueKey should have returned STATUS_BUFFER_OVERFLOW instead of 0x%08lx
\n
"
,
status
);
ok
(
aligned_info
->
Type
==
REG_DWORD
,
"NtQueryValueKey returned wrong Type %ld
\n
"
,
aligned_info
->
Type
);
ok
(
aligned_info
->
DataLength
==
4
,
"NtQueryValueKey returned wrong DataLength %ld
\n
"
,
aligned_info
->
DataLength
);
ok
(
len
==
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
[
aligned_info
->
DataLength
]),
"NtQueryValueKey returned wrong len %ld
\n
"
,
len
);
len
=
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
[
0
]);
aligned_info
=
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
*
)((
char
*
)
aligned_info
-
4
);
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValuePartialInformationAlign64
,
aligned_info
,
len
,
&
len
);
ok
(
status
==
STATUS_BUFFER_OVERFLOW
,
"NtQueryValueKey should have returned STATUS_BUFFER_OVERFLOW instead of 0x%08lx
\n
"
,
status
);
ok
(
aligned_info
->
Type
==
REG_DWORD
,
"NtQueryValueKey returned wrong Type %ld
\n
"
,
aligned_info
->
Type
);
ok
(
aligned_info
->
DataLength
==
4
,
"NtQueryValueKey returned wrong DataLength %ld
\n
"
,
aligned_info
->
DataLength
);
ok
(
len
==
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
[
aligned_info
->
DataLength
]),
"NtQueryValueKey returned wrong len %ld
\n
"
,
len
);
aligned_info
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
aligned_info
,
len
+
4
);
aligned_info
=
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
*
)((
char
*
)
aligned_info
+
4
);
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValuePartialInformationAlign64
,
aligned_info
,
len
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08lx
\n
"
,
status
);
ok
(
aligned_info
->
Type
==
REG_DWORD
,
"NtQueryValueKey returned wrong Type %ld
\n
"
,
aligned_info
->
Type
);
ok
(
aligned_info
->
DataLength
==
4
,
"NtQueryValueKey returned wrong DataLength %ld
\n
"
,
aligned_info
->
DataLength
);
ok
(
len
==
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
[
aligned_info
->
DataLength
]),
"NtQueryValueKey returned wrong len %ld
\n
"
,
len
);
ok
(
*
(
DWORD
*
)
aligned_info
->
Data
==
711
,
"incorrect Data returned: 0x%lx
\n
"
,
*
(
DWORD
*
)
aligned_info
->
Data
);
aligned_info
=
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
*
)((
char
*
)
aligned_info
-
4
);
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValuePartialInformationAlign64
,
aligned_info
,
len
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08lx
\n
"
,
status
);
ok
(
aligned_info
->
Type
==
REG_DWORD
,
"NtQueryValueKey returned wrong Type %ld
\n
"
,
aligned_info
->
Type
);
ok
(
aligned_info
->
DataLength
==
4
,
"NtQueryValueKey returned wrong DataLength %ld
\n
"
,
aligned_info
->
DataLength
);
ok
(
len
==
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
[
aligned_info
->
DataLength
]),
"NtQueryValueKey returned wrong len %ld
\n
"
,
len
);
ok
(
*
(
DWORD
*
)
aligned_info
->
Data
==
711
,
"incorrect Data returned: 0x%lx
\n
"
,
*
(
DWORD
*
)
aligned_info
->
Data
);
HeapFree
(
GetProcessHeap
(),
0
,
aligned_info
);
len
=
FIELD_OFFSET
(
KEY_VALUE_FULL_INFORMATION
,
Name
[
0
]);
len
=
FIELD_OFFSET
(
KEY_VALUE_FULL_INFORMATION
,
Name
[
0
]);
full_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
full_info
));
full_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
full_info
));
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValueFullInformation
,
full_info
,
len
,
&
len
);
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValueFullInformation
,
full_info
,
len
,
&
len
);
...
...
dlls/ntdll/unix/registry.c
View file @
b15680a0
...
@@ -425,6 +425,16 @@ static void copy_key_value_info( KEY_VALUE_INFORMATION_CLASS info_class, void *i
...
@@ -425,6 +425,16 @@ static void copy_key_value_info( KEY_VALUE_INFORMATION_CLASS info_class, void *i
break
;
break
;
}
}
case
KeyValuePartialInformationAlign64
:
{
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
keyinfo
;
keyinfo
.
Type
=
type
;
keyinfo
.
DataLength
=
data_len
;
length
=
min
(
length
,
(
char
*
)
keyinfo
.
Data
-
(
char
*
)
&
keyinfo
);
memcpy
(
info
,
&
keyinfo
,
length
);
break
;
}
default:
default:
break
;
break
;
}
}
...
@@ -519,6 +529,11 @@ NTSTATUS WINAPI NtQueryValueKey( HANDLE handle, const UNICODE_STRING *name,
...
@@ -519,6 +529,11 @@ NTSTATUS WINAPI NtQueryValueKey( HANDLE handle, const UNICODE_STRING *name,
data_ptr
=
((
KEY_VALUE_PARTIAL_INFORMATION
*
)
info
)
->
Data
;
data_ptr
=
((
KEY_VALUE_PARTIAL_INFORMATION
*
)
info
)
->
Data
;
break
;
break
;
case
KeyValuePartialInformationAlign64
:
min_size
=
fixed_size
=
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
Data
);
data_ptr
=
((
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
*
)
info
)
->
Data
;
break
;
default:
default:
FIXME
(
"Information class %d not implemented
\n
"
,
info_class
);
FIXME
(
"Information class %d not implemented
\n
"
,
info_class
);
return
STATUS_INVALID_PARAMETER
;
return
STATUS_INVALID_PARAMETER
;
...
...
include/winternl.h
View file @
b15680a0
...
@@ -2460,6 +2460,12 @@ typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
...
@@ -2460,6 +2460,12 @@ typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
UCHAR
Data
[
1
];
UCHAR
Data
[
1
];
}
KEY_VALUE_PARTIAL_INFORMATION
,
*
PKEY_VALUE_PARTIAL_INFORMATION
;
}
KEY_VALUE_PARTIAL_INFORMATION
,
*
PKEY_VALUE_PARTIAL_INFORMATION
;
typedef
struct
_KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
{
ULONG
Type
;
ULONG
DataLength
;
UCHAR
Data
[
1
];
}
KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
,
*
PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64
;
#ifndef __OBJECT_ATTRIBUTES_DEFINED__
#ifndef __OBJECT_ATTRIBUTES_DEFINED__
#define __OBJECT_ATTRIBUTES_DEFINED__
#define __OBJECT_ATTRIBUTES_DEFINED__
typedef
struct
_OBJECT_ATTRIBUTES
{
typedef
struct
_OBJECT_ATTRIBUTES
{
...
...
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