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
e7395e09
Commit
e7395e09
authored
Jul 29, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Partially implement SHGetShellKey.
parent
b684c60a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
3 deletions
+94
-3
ordinal.c
dlls/shlwapi/ordinal.c
+33
-3
ordinal.c
dlls/shlwapi/tests/ordinal.c
+61
-0
No files found.
dlls/shlwapi/ordinal.c
View file @
e7395e09
...
...
@@ -4401,12 +4401,42 @@ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid)
}
/***********************************************************************
* SHGetShellKey (SHLWAPI.
@
)
* SHGetShellKey (SHLWAPI.
491
)
*/
HKEY
WINAPI
SHGetShellKey
(
DWORD
flags
,
LPCWSTR
sub_key
,
BOOL
create
)
{
FIXME
(
"(0x%08x, %s, %d): stub
\n
"
,
flags
,
debugstr_w
(
sub_key
),
create
);
return
(
HKEY
)
0x50
;
enum
_shellkey_flags
{
SHKEY_Explorer
=
0x00
,
SHKEY_Root_HKCU
=
0x01
};
static
const
WCHAR
explorerW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
0
};
HKEY
hroot
,
hkey
=
NULL
;
TRACE
(
"(0x%08x, %s, %d)
\n
"
,
flags
,
debugstr_w
(
sub_key
),
create
);
switch
(
flags
)
{
case
SHKEY_Explorer
|
SHKEY_Root_HKCU
:
RegOpenKeyExW
(
HKEY_CURRENT_USER
,
explorerW
,
0
,
MAXIMUM_ALLOWED
,
&
hroot
);
break
;
case
0
:
return
NULL
;
default:
FIXME
(
"unsupported flags (0x%08x)
\n
"
,
flags
);
return
(
HKEY
)
0xdeadbeef
;
}
if
(
create
)
RegCreateKeyExW
(
hroot
,
sub_key
,
0
,
NULL
,
0
,
MAXIMUM_ALLOWED
,
NULL
,
&
hkey
,
NULL
);
else
RegOpenKeyExW
(
hroot
,
sub_key
,
0
,
MAXIMUM_ALLOWED
,
&
hkey
);
RegCloseKey
(
hroot
);
return
hkey
;
}
/***********************************************************************
...
...
dlls/shlwapi/tests/ordinal.c
View file @
e7395e09
...
...
@@ -36,6 +36,7 @@
/* Function ptrs for ordinal calls */
static
HMODULE
hShlwapi
;
static
BOOL
is_win2k_and_lower
;
static
BOOL
is_win9x
;
static
int
(
WINAPI
*
pSHSearchMapInt
)(
const
int
*
,
const
int
*
,
int
,
int
);
static
HRESULT
(
WINAPI
*
pGetAcceptLanguagesA
)(
LPSTR
,
LPDWORD
);
...
...
@@ -60,6 +61,7 @@ static HWND (WINAPI *pSHCreateWorkerWindowA)(LONG, HWND, DWORD, DWORD, HMENU,
static
HRESULT
(
WINAPI
*
pSHIShellFolder_EnumObjects
)(
LPSHELLFOLDER
,
HWND
,
SHCONTF
,
IEnumIDList
**
);
static
DWORD
(
WINAPI
*
pSHGetIniStringW
)(
LPCWSTR
,
LPCWSTR
,
LPWSTR
,
DWORD
,
LPCWSTR
);
static
BOOL
(
WINAPI
*
pSHSetIniStringW
)(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
LPCWSTR
);
static
HKEY
(
WINAPI
*
pSHGetShellKey
)(
DWORD
,
LPWSTR
,
BOOL
);
static
HMODULE
hmlang
;
static
HRESULT
(
WINAPI
*
pLcidToRfc1766A
)(
LCID
,
LPSTR
,
INT
);
...
...
@@ -2675,6 +2677,62 @@ static void test_SHSetIniString(void)
DeleteFileW
(
TestIniW
);
}
enum
_shellkey_flags
{
SHKEY_Explorer
=
0x00
,
SHKEY_Root_HKCU
=
0x01
};
static
void
test_SHGetShellKey
(
void
)
{
void
*
pPathBuildRootW
=
GetProcAddress
(
hShlwapi
,
"PathBuildRootW"
);
HKEY
hkey
,
hkey2
;
DWORD
ret
;
if
(
!
pSHGetShellKey
)
{
win_skip
(
"SHGetShellKey(ordinal 491) isn't available
\n
"
);
return
;
}
/* some win2k */
if
(
pPathBuildRootW
&&
pPathBuildRootW
==
pSHGetShellKey
)
{
win_skip
(
"SHGetShellKey(ordinal 491) used for PathBuildRootW
\n
"
);
return
;
}
if
(
is_win9x
||
is_win2k_and_lower
)
{
win_skip
(
"Ordinal 491 used for another call, skipping SHGetShellKey tests
\n
"
);
return
;
}
/* marking broken cause latest Vista+ versions fail here */
SetLastError
(
0xdeadbeef
);
hkey
=
pSHGetShellKey
(
SHKEY_Explorer
,
NULL
,
FALSE
);
ok
(
hkey
==
NULL
||
broken
(
hkey
!=
NULL
),
"got %p
\n
"
,
hkey
);
if
(
hkey
)
{
hkey2
=
0
;
ret
=
RegOpenKeyExA
(
hkey
,
"Shell Folders"
,
0
,
KEY_READ
,
&
hkey2
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %d
\n
"
,
ret
);
ok
(
hkey2
!=
NULL
,
"got %p
\n
"
,
hkey2
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey
);
}
hkey
=
pSHGetShellKey
(
SHKEY_Explorer
|
SHKEY_Root_HKCU
,
NULL
,
FALSE
);
ok
(
hkey
!=
NULL
,
"got %p
\n
"
,
hkey
);
hkey2
=
0
;
ret
=
RegOpenKeyExA
(
hkey
,
"Shell Folders"
,
0
,
KEY_READ
,
&
hkey2
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %d
\n
"
,
ret
);
ok
(
hkey2
!=
NULL
,
"got %p
\n
"
,
hkey2
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey
);
}
static
void
init_pointers
(
void
)
{
#define MAKEFUNC(f, ord) (p##f = (void*)GetProcAddress(hShlwapi, (LPSTR)(ord)))
...
...
@@ -2698,6 +2756,7 @@ static void init_pointers(void)
MAKEFUNC
(
SHIShellFolder_EnumObjects
,
404
);
MAKEFUNC
(
SHGetObjectCompatFlags
,
476
);
MAKEFUNC
(
IUnknown_QueryServiceExec
,
484
);
MAKEFUNC
(
SHGetShellKey
,
491
);
MAKEFUNC
(
SHPropertyBag_ReadLONG
,
496
);
MAKEFUNC
(
IUnknown_ProfferService
,
514
);
#undef MAKEFUNC
...
...
@@ -2707,6 +2766,7 @@ START_TEST(ordinal)
{
hShlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
is_win2k_and_lower
=
GetProcAddress
(
hShlwapi
,
"StrChrNW"
)
==
0
;
is_win9x
=
GetProcAddress
(
hShlwapi
,
(
LPSTR
)
99
)
==
0
;
/* StrCpyNXA */
init_pointers
();
...
...
@@ -2734,6 +2794,7 @@ START_TEST(ordinal)
test_SHIShellFolder_EnumObjects
();
test_SHGetIniString
();
test_SHSetIniString
();
test_SHGetShellKey
();
FreeLibrary
(
hshell32
);
FreeLibrary
(
hmlang
);
...
...
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