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
52aaddcd
Commit
52aaddcd
authored
Jun 30, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement RegDisablePredefinedCache.
parent
8a42a8c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
advapi32.spec
dlls/advapi32/advapi32.spec
+1
-1
registry.c
dlls/advapi32/registry.c
+36
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
52aaddcd
...
@@ -475,7 +475,7 @@
...
@@ -475,7 +475,7 @@
@ stdcall RegDeleteKeyW(long wstr)
@ stdcall RegDeleteKeyW(long wstr)
@ stdcall RegDeleteValueA(long str)
@ stdcall RegDeleteValueA(long str)
@ stdcall RegDeleteValueW(long wstr)
@ stdcall RegDeleteValueW(long wstr)
# @ stub RegDisablePredefinedCache
@ stdcall RegDisablePredefinedCache()
@ stdcall RegEnumKeyA(long long ptr long)
@ stdcall RegEnumKeyA(long long ptr long)
@ stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr)
@ stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr)
@ stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr)
@ stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr)
...
...
dlls/advapi32/registry.c
View file @
52aaddcd
...
@@ -52,6 +52,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg);
...
@@ -52,6 +52,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg);
#define NB_SPECIAL_ROOT_KEYS ((UINT)HKEY_SPECIAL_ROOT_LAST - (UINT)HKEY_SPECIAL_ROOT_FIRST + 1)
#define NB_SPECIAL_ROOT_KEYS ((UINT)HKEY_SPECIAL_ROOT_LAST - (UINT)HKEY_SPECIAL_ROOT_FIRST + 1)
static
HKEY
special_root_keys
[
NB_SPECIAL_ROOT_KEYS
];
static
HKEY
special_root_keys
[
NB_SPECIAL_ROOT_KEYS
];
static
BOOL
hkcu_cache_disabled
;
static
const
WCHAR
name_CLASSES_ROOT
[]
=
static
const
WCHAR
name_CLASSES_ROOT
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
...
@@ -108,6 +109,10 @@ static HKEY create_special_root_hkey( HANDLE hkey, DWORD access )
...
@@ -108,6 +109,10 @@ static HKEY create_special_root_hkey( HANDLE hkey, DWORD access )
{
{
if
(
RtlOpenCurrentUser
(
access
,
&
hkey
))
return
0
;
if
(
RtlOpenCurrentUser
(
access
,
&
hkey
))
return
0
;
TRACE
(
"HKEY_CURRENT_USER -> %p
\n
"
,
hkey
);
TRACE
(
"HKEY_CURRENT_USER -> %p
\n
"
,
hkey
);
/* don't cache the key in the table if caching is disabled */
if
(
hkcu_cache_disabled
)
return
hkey
;
}
}
else
else
{
{
...
@@ -2565,3 +2570,34 @@ cleanup:
...
@@ -2565,3 +2570,34 @@ cleanup:
return
result
;
return
result
;
}
}
/******************************************************************************
* RegDisablePredefinedCache [ADVAPI32.@]
*
* Disables the caching of the HKEY_CLASSES_ROOT key for the process.
*
* PARAMS
* None.
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: nonzero error code from Winerror.h
*
* NOTES
* This is useful for services that use impersonation.
*/
LONG
WINAPI
RegDisablePredefinedCache
(
void
)
{
HKEY
hkey_current_user
;
int
idx
=
(
UINT_PTR
)
HKEY_CURRENT_USER
-
(
UINT_PTR
)
HKEY_SPECIAL_ROOT_FIRST
;
/* prevent caching of future requests */
hkcu_cache_disabled
=
TRUE
;
hkey_current_user
=
InterlockedExchangePointer
(
(
void
**
)
&
special_root_keys
[
idx
],
NULL
);
if
(
hkey_current_user
)
NtClose
(
hkey_current_user
);
return
ERROR_SUCCESS
;
}
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