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
191bc054
Commit
191bc054
authored
Dec 01, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Partially implement SHRegCreateUSKeyW.
parent
ff9ae10b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
29 deletions
+84
-29
reg.c
dlls/shlwapi/reg.c
+42
-5
shreg.c
dlls/shlwapi/tests/shreg.c
+42
-24
No files found.
dlls/shlwapi/reg.c
View file @
191bc054
...
@@ -235,12 +235,49 @@ LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativ
...
@@ -235,12 +235,49 @@ LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativ
*
*
* See SHRegCreateUSKeyA.
* See SHRegCreateUSKeyA.
*/
*/
LONG
WINAPI
SHRegCreateUSKeyW
(
LPCWSTR
p
szPath
,
REGSAM
samDesired
,
HUSKEY
hRelativeUSK
ey
,
LONG
WINAPI
SHRegCreateUSKeyW
(
LPCWSTR
p
ath
,
REGSAM
samDesired
,
HUSKEY
relative_k
ey
,
PHUSKEY
phNewUSKey
,
DWORD
dwF
lags
)
PHUSKEY
new_uskey
,
DWORD
f
lags
)
{
{
FIXME
(
"(%s, 0x%08x, %p, %p, 0x%08x) stub
\n
"
,
debugstr_w
(
pszPath
),
samDesired
,
LONG
ret
=
ERROR_CALL_NOT_IMPLEMENTED
;
hRelativeUSKey
,
phNewUSKey
,
dwFlags
);
SHUSKEY
*
ret_key
;
return
ERROR_SUCCESS
;
TRACE
(
"(%s, 0x%08x, %p, %p, 0x%08x)
\n
"
,
debugstr_w
(
path
),
samDesired
,
relative_key
,
new_uskey
,
flags
);
if
(
!
new_uskey
)
return
ERROR_INVALID_PARAMETER
;
*
new_uskey
=
NULL
;
if
(
flags
&
~
SHREGSET_FORCE_HKCU
)
{
FIXME
(
"unsupported flags 0x%08x
\n
"
,
flags
);
return
ERROR_SUCCESS
;
}
ret_key
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
ret_key
));
lstrcpynW
(
ret_key
->
lpszPath
,
path
,
sizeof
(
ret_key
->
lpszPath
)
/
sizeof
(
WCHAR
));
if
(
relative_key
)
{
ret_key
->
HKCUstart
=
SHRegDuplicateHKey
(
REG_GetHKEYFromHUSKEY
(
relative_key
,
REG_HKCU
));
ret_key
->
HKLMstart
=
SHRegDuplicateHKey
(
REG_GetHKEYFromHUSKEY
(
relative_key
,
REG_HKLM
));
}
else
{
ret_key
->
HKCUstart
=
HKEY_CURRENT_USER
;
ret_key
->
HKLMstart
=
HKEY_LOCAL_MACHINE
;
}
if
(
flags
&
SHREGSET_FORCE_HKCU
)
{
ret
=
RegCreateKeyExW
(
ret_key
->
HKCUstart
,
path
,
0
,
NULL
,
0
,
samDesired
,
NULL
,
&
ret_key
->
HKCUkey
,
NULL
);
if
(
ret
==
ERROR_SUCCESS
)
*
new_uskey
=
ret_key
;
else
HeapFree
(
GetProcessHeap
(),
0
,
ret_key
);
}
return
ret
;
}
}
/*************************************************************************
/*************************************************************************
...
...
dlls/shlwapi/tests/shreg.c
View file @
191bc054
...
@@ -33,12 +33,11 @@
...
@@ -33,12 +33,11 @@
#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer"
#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer"
static
HMODULE
hshlwapi
;
static
HMODULE
hshlwapi
;
typedef
DWORD
(
WINAPI
*
SHCopyKeyA_func
)(
HKEY
,
LPCSTR
,
HKEY
,
DWORD
);
static
SHCopyKeyA_func
pSHCopyKeyA
;
static
DWORD
(
WINAPI
*
pSHCopyKeyA
)(
HKEY
,
LPCSTR
,
HKEY
,
DWORD
);
typedef
DWORD
(
WINAPI
*
SHRegGetPathA_func
)(
HKEY
,
LPCSTR
,
LPCSTR
,
LPSTR
,
DWORD
);
static
DWORD
(
WINAPI
*
pSHRegGetPathA
)(
HKEY
,
LPCSTR
,
LPCSTR
,
LPSTR
,
DWORD
);
static
SHRegGetPathA_func
pSHRegGetPathA
;
static
LSTATUS
(
WINAPI
*
pSHRegGetValueA
)(
HKEY
,
LPCSTR
,
LPCSTR
,
SRRF
,
LPDWORD
,
LPVOID
,
LPDWORD
);
typedef
LSTATUS
(
WINAPI
*
SHRegGetValueA_func
)(
HKEY
,
LPCSTR
,
LPCSTR
,
SRRF
,
LPDWORD
,
LPVOID
,
LPDWORD
);
static
LSTATUS
(
WINAPI
*
pSHRegCreateUSKeyW
)(
LPCWSTR
,
REGSAM
,
HUSKEY
,
PHUSKEY
,
DWORD
);
static
SHRegGetValueA_func
pSHRegGetValueA
;
static
char
sTestpath1
[]
=
"%LONGSYSTEMVAR%
\\
subdir1"
;
static
char
sTestpath1
[]
=
"%LONGSYSTEMVAR%
\\
subdir1"
;
static
char
sTestpath2
[]
=
"%FOO%
\\
subdir1"
;
static
char
sTestpath2
[]
=
"%FOO%
\\
subdir1"
;
...
@@ -444,28 +443,47 @@ static void test_SHDeleteKey(void)
...
@@ -444,28 +443,47 @@ static void test_SHDeleteKey(void)
ok
(
0
,
"Could not set up SHDeleteKey test
\n
"
);
ok
(
0
,
"Could not set up SHDeleteKey test
\n
"
);
}
}
static
void
test_SHRegCreateUSKeyW
(
void
)
{
static
const
WCHAR
subkeyW
[]
=
{
's'
,
'u'
,
'b'
,
'k'
,
'e'
,
'y'
,
0
};
LONG
ret
;
if
(
!
pSHRegCreateUSKeyW
)
{
win_skip
(
"SHRegCreateUSKeyW not available
\n
"
);
return
;
}
ret
=
pSHRegCreateUSKeyW
(
subkeyW
,
KEY_ALL_ACCESS
,
NULL
,
NULL
,
SHREGSET_FORCE_HKCU
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %d
\n
"
,
ret
);
}
START_TEST
(
shreg
)
START_TEST
(
shreg
)
{
{
HKEY
hkey
=
create_test_entries
();
HKEY
hkey
=
create_test_entries
();
if
(
!
hkey
)
return
;
if
(
!
hkey
)
return
;
hshlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
hshlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
/* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */
/* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */
if
(
!
GetProcAddress
(
hshlwapi
,
"SHCreateStreamOnFileEx"
)){
if
(
!
GetProcAddress
(
hshlwapi
,
"SHCreateStreamOnFileEx"
)){
win_skip
(
"Too old shlwapi version
\n
"
);
win_skip
(
"Too old shlwapi version
\n
"
);
return
;
return
;
}
}
pSHCopyKeyA
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"SHCopyKeyA"
);
pSHRegGetPathA
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"SHRegGetPathA"
);
pSHRegGetValueA
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"SHRegGetValueA"
);
pSHRegCreateUSKeyW
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"SHRegCreateUSKeyW"
);
test_SHGetValue
();
test_SHRegGetValue
();
test_SHQueryValueEx
();
test_SHGetRegPath
();
test_SHCopyKey
();
test_SHDeleteKey
();
test_SHRegCreateUSKeyW
();
pSHCopyKeyA
=
(
SHCopyKeyA_func
)
GetProcAddress
(
hshlwapi
,
"SHCopyKeyA"
);
delete_key
(
hkey
,
"Software
\\
Wine"
,
"Test"
);
pSHRegGetPathA
=
(
SHRegGetPathA_func
)
GetProcAddress
(
hshlwapi
,
"SHRegGetPathA"
);
pSHRegGetValueA
=
(
SHRegGetValueA_func
)
GetProcAddress
(
hshlwapi
,
"SHRegGetValueA"
);
test_SHGetValue
();
test_SHRegGetValue
();
test_SHQueryValueEx
();
test_SHGetRegPath
();
test_SHCopyKey
();
test_SHDeleteKey
();
delete_key
(
hkey
,
"Software
\\
Wine"
,
"Test"
);
}
}
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