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
17736b90
Commit
17736b90
authored
Jan 31, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Invoke RegGetValue on SHRegGetValue call.
parent
dfe53522
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
64 deletions
+44
-64
reg.c
dlls/shlwapi/reg.c
+0
-62
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
shreg.c
dlls/shlwapi/tests/shreg.c
+42
-0
No files found.
dlls/shlwapi/reg.c
View file @
17736b90
...
...
@@ -1138,68 +1138,6 @@ DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue,
}
/*************************************************************************
* SHRegGetValueA [SHLWAPI.@]
*
* Get a value from the registry.
*
* PARAMS
* hKey [I] Handle to registry key
* lpszSubKey [I] Name of sub key containing value to get
* lpszValue [I] Name of value to get
* srrf [I] Flags for restricting returned data
* pwType [O] Pointer to the values type
* pvData [O] Pointer to the values data
* pcbData [O] Pointer to the values size
*
* RETURNS
* Success: ERROR_SUCCESS. Output parameters contain the details read.
* Failure: An error code from RegOpenKeyExA() or SHQueryValueExA().
*/
LSTATUS
WINAPI
SHRegGetValueA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
,
LPCSTR
lpszValue
,
SRRF
srrfFlags
,
LPDWORD
pwType
,
LPVOID
pvData
,
LPDWORD
pcbData
)
{
DWORD
dwRet
=
0
;
HKEY
hSubKey
=
0
;
TRACE
(
"(hkey=%p,%s,%s,%p,%p,%p)
\n
"
,
hKey
,
debugstr_a
(
lpszSubKey
),
debugstr_a
(
lpszValue
),
pwType
,
pvData
,
pcbData
);
FIXME
(
"Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08x
\n
"
,
srrfFlags
);
dwRet
=
RegOpenKeyExA
(
hKey
,
lpszSubKey
,
0
,
KEY_QUERY_VALUE
,
&
hSubKey
);
if
(
!
dwRet
)
{
/* SHQueryValueEx expands Environment strings */
dwRet
=
SHQueryValueExA
(
hSubKey
,
lpszValue
,
0
,
pwType
,
pvData
,
pcbData
);
RegCloseKey
(
hSubKey
);
}
return
dwRet
;
}
/*************************************************************************
* SHReg GetRegValueW [SHLWAPI.@]
*
* See SHGetValueA.
*/
LSTATUS
WINAPI
SHRegGetValueW
(
HKEY
hKey
,
LPCWSTR
lpszSubKey
,
LPCWSTR
lpszValue
,
SRRF
srrfFlags
,
LPDWORD
pwType
,
LPVOID
pvData
,
LPDWORD
pcbData
)
{
DWORD
dwRet
=
0
;
HKEY
hSubKey
=
0
;
TRACE
(
"(hkey=%p,%s,%s,0x%08x, %p,%p,%p)
\n
"
,
hKey
,
debugstr_w
(
lpszSubKey
),
debugstr_w
(
lpszValue
),
srrfFlags
,
pwType
,
pvData
,
pcbData
);
FIXME
(
"Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08x
\n
"
,
srrfFlags
);
dwRet
=
RegOpenKeyExW
(
hKey
,
lpszSubKey
,
0
,
KEY_QUERY_VALUE
,
&
hSubKey
);
if
(
!
dwRet
)
{
dwRet
=
SHQueryValueExW
(
hSubKey
,
lpszValue
,
0
,
pwType
,
pvData
,
pcbData
);
RegCloseKey
(
hSubKey
);
}
return
dwRet
;
}
/*************************************************************************
* SHGetValueW [SHLWAPI.@]
*
* See SHGetValueA.
...
...
dlls/shlwapi/shlwapi.spec
View file @
17736b90
...
...
@@ -725,8 +725,8 @@
@ stdcall SHRegGetPathW(long wstr wstr ptr long)
@ stdcall SHRegGetUSValueA ( str str ptr ptr ptr long ptr long )
@ stdcall SHRegGetUSValueW ( wstr wstr ptr ptr ptr long ptr long )
@ stdcall SHRegGetValueA ( long str str long ptr ptr ptr )
@ stdcall SHRegGetValueW ( long wstr wstr long ptr ptr ptr )
@ stdcall SHRegGetValueA ( long str str long ptr ptr ptr )
advapi32.RegGetValueA
@ stdcall SHRegGetValueW ( long wstr wstr long ptr ptr ptr )
advapi32.RegGetValueW
@ stdcall SHRegOpenUSKeyA ( str long long long long )
@ stdcall SHRegOpenUSKeyW ( wstr long long long long )
@ stdcall SHRegQueryInfoUSKeyA ( long ptr ptr ptr ptr long )
...
...
dlls/shlwapi/tests/shreg.c
View file @
17736b90
...
...
@@ -38,6 +38,8 @@ typedef DWORD (WINAPI *SHCopyKeyA_func)(HKEY,LPCSTR,HKEY,DWORD);
static
SHCopyKeyA_func
pSHCopyKeyA
;
typedef
DWORD
(
WINAPI
*
SHRegGetPathA_func
)(
HKEY
,
LPCSTR
,
LPCSTR
,
LPSTR
,
DWORD
);
static
SHRegGetPathA_func
pSHRegGetPathA
;
typedef
LSTATUS
(
WINAPI
*
SHRegGetValueA_func
)(
HKEY
,
LPCSTR
,
LPCSTR
,
SRRF
,
LPDWORD
,
LPVOID
,
LPDWORD
);
static
SHRegGetValueA_func
pSHRegGetValueA
;
static
char
sTestpath1
[]
=
"%LONGSYSTEMVAR%
\\
subdir1"
;
static
char
sTestpath2
[]
=
"%FOO%
\\
subdir1"
;
...
...
@@ -138,6 +140,44 @@ static void test_SHGetValue(void)
ok
(
REG_SZ
==
dwType
,
"Expected REG_SZ, got (%u)
\n
"
,
dwType
);
}
static
void
test_SHRegGetValue
(
void
)
{
LSTATUS
ret
;
DWORD
size
,
type
;
char
data
[
MAX_PATH
];
if
(
!
pSHRegGetValueA
)
return
;
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
SRRF_RT_REG_EXPAND_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
SRRF_RT_REG_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
!
strcmp
(
data
,
sExpTestpath1
),
"data = %s, expected %s
\n
"
,
data
,
sExpTestpath1
);
ok
(
type
==
REG_SZ
,
"type = %d, expected REG_SZ
\n
"
,
type
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
SRRF_RT_REG_DWORD
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_UNSUPPORTED_TYPE
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
SRRF_RT_REG_EXPAND_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
SRRF_RT_REG_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
!
strcmp
(
data
,
sTestpath1
),
"data = %s, expected %s
\n
"
,
data
,
sTestpath1
);
ok
(
type
==
REG_SZ
,
"type = %d, expected REG_SZ
\n
"
,
type
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
SRRF_RT_REG_QWORD
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_UNSUPPORTED_TYPE
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
}
static
void
test_SHGetRegPath
(
void
)
{
char
buf
[
MAX_PATH
];
...
...
@@ -414,7 +454,9 @@ START_TEST(shreg)
hshlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
pSHCopyKeyA
=
(
SHCopyKeyA_func
)
GetProcAddress
(
hshlwapi
,
"SHCopyKeyA"
);
pSHRegGetPathA
=
(
SHRegGetPathA_func
)
GetProcAddress
(
hshlwapi
,
"SHRegGetPathA"
);
pSHRegGetValueA
=
(
SHRegGetValueA_func
)
GetProcAddress
(
hshlwapi
,
"SHRegGetValueA"
);
test_SHGetValue
();
test_SHRegGetValue
();
test_SHQUeryValueEx
();
test_SHGetRegPath
();
test_SHCopyKey
();
...
...
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