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
2daca626
Commit
2daca626
authored
Dec 22, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Mar 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement [Nt|Zw]QueryLicenseValue.
parent
dc0f544d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
1 deletion
+68
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
reg.c
dlls/ntdll/reg.c
+64
-0
reg.c
dlls/ntdll/tests/reg.c
+1
-1
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
2daca626
...
...
@@ -255,6 +255,7 @@
@ stub NtQueryIntervalProfile
@ stdcall NtQueryIoCompletion(long long ptr long ptr)
@ stdcall NtQueryKey (long long ptr long ptr)
@ stdcall NtQueryLicenseValue(ptr ptr ptr long ptr)
@ stdcall NtQueryMultipleValueKey(long ptr long ptr long ptr)
@ stdcall NtQueryMutant(long long ptr long ptr)
@ stdcall NtQueryObject(long long long long long)
...
...
@@ -1134,6 +1135,7 @@
@ stub ZwQueryIntervalProfile
@ stdcall ZwQueryIoCompletion(long long ptr long ptr) NtQueryIoCompletion
@ stdcall ZwQueryKey(long long ptr long ptr) NtQueryKey
@ stdcall ZwQueryLicenseValue(ptr ptr ptr long ptr) NtQueryLicenseValue
@ stdcall ZwQueryMultipleValueKey(long ptr long ptr long ptr) NtQueryMultipleValueKey
@ stdcall ZwQueryMutant(long long ptr long ptr) NtQueryMutant
@ stdcall ZwQueryObject(long long long long long) NtQueryObject
...
...
dlls/ntdll/reg.c
View file @
2daca626
...
...
@@ -1401,3 +1401,67 @@ NTSTATUS WINAPI RtlWriteRegistryValue( ULONG RelativeTo, PCWSTR path, PCWSTR nam
return
status
;
}
/*************************************************************************
* NtQueryLicenseValue [NTDLL.@]
*
* NOTES
* On Windows all license properties are stored in a single key, but
* unless there is some app which explicitly depends on that, there is
* no good reason to reproduce that.
*/
NTSTATUS
WINAPI
NtQueryLicenseValue
(
const
UNICODE_STRING
*
name
,
ULONG
*
result_type
,
PVOID
data
,
ULONG
length
,
ULONG
*
result_len
)
{
static
const
WCHAR
LicenseInformationW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'L'
,
'i'
,
'c'
,
'e'
,
'n'
,
's'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'r'
,
'm'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
KEY_VALUE_PARTIAL_INFORMATION
*
info
;
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
DWORD
info_length
,
count
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
keyW
;
HANDLE
hkey
;
if
(
!
name
||
!
name
->
Buffer
||
!
name
->
Length
||
!
result_len
)
return
STATUS_INVALID_PARAMETER
;
info_length
=
FIELD_OFFSET
(
KEY_VALUE_PARTIAL_INFORMATION
,
Data
)
+
length
;
info
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
info_length
);
if
(
!
info
)
return
STATUS_NO_MEMORY
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
keyW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
keyW
,
LicenseInformationW
);
/* @@ Wine registry key: HKLM\Software\Wine\LicenseInformation */
if
(
!
NtOpenKey
(
&
hkey
,
KEY_READ
,
&
attr
))
{
status
=
NtQueryValueKey
(
hkey
,
name
,
KeyValuePartialInformation
,
info
,
info_length
,
&
count
);
if
(
!
status
||
status
==
STATUS_BUFFER_OVERFLOW
)
{
if
(
result_type
)
*
result_type
=
info
->
Type
;
*
result_len
=
info
->
DataLength
;
if
(
status
==
STATUS_BUFFER_OVERFLOW
)
status
=
STATUS_BUFFER_TOO_SMALL
;
else
memcpy
(
data
,
info
->
Data
,
info
->
DataLength
);
}
NtClose
(
hkey
);
}
if
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
)
FIXME
(
"License key %s not found
\n
"
,
debugstr_w
(
name
->
Buffer
)
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
info
);
return
status
;
}
dlls/ntdll/tests/reg.c
View file @
2daca626
...
...
@@ -661,7 +661,7 @@ static void test_NtQueryLicenseKey(void)
if
(
!
pNtQueryLicenseValue
)
{
skip
(
"NtQueryLicenseValue not found, skipping tests
\n
"
);
win_
skip
(
"NtQueryLicenseValue not found, skipping tests
\n
"
);
return
;
}
...
...
include/winternl.h
View file @
2daca626
...
...
@@ -2189,6 +2189,7 @@ NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryTimer
(
HANDLE
,
TIMER_INFORMATION_CLASS
,
PVOID
,
ULONG
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryTimerResolution
(
PULONG
,
PULONG
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryValueKey
(
HANDLE
,
const
UNICODE_STRING
*
,
KEY_VALUE_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryLicenseValue
(
const
UNICODE_STRING
*
,
ULONG
*
,
PVOID
,
ULONG
,
ULONG
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryVirtualMemory
(
HANDLE
,
LPCVOID
,
MEMORY_INFORMATION_CLASS
,
PVOID
,
SIZE_T
,
SIZE_T
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryVolumeInformationFile
(
HANDLE
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
FS_INFORMATION_CLASS
);
NTSYSAPI
NTSTATUS
WINAPI
NtRaiseException
(
PEXCEPTION_RECORD
,
PCONTEXT
,
BOOL
);
...
...
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