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
93d87ca3
Commit
93d87ca3
authored
Nov 12, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Added HlinkGetSpecialReference implementation.
parent
9771c739
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
2 deletions
+82
-2
hlink_main.c
dlls/hlink/hlink_main.c
+51
-2
hlink.c
dlls/hlink/tests/hlink.c
+31
-0
No files found.
dlls/hlink/hlink_main.c
View file @
93d87ca3
...
@@ -278,8 +278,57 @@ HRESULT WINAPI HlinkIsShortcut(LPCWSTR pwzFileName)
...
@@ -278,8 +278,57 @@ HRESULT WINAPI HlinkIsShortcut(LPCWSTR pwzFileName)
HRESULT
WINAPI
HlinkGetSpecialReference
(
ULONG
uReference
,
LPWSTR
*
ppwzReference
)
HRESULT
WINAPI
HlinkGetSpecialReference
(
ULONG
uReference
,
LPWSTR
*
ppwzReference
)
{
{
FIXME
(
"(%u %p) stub
\n
"
,
uReference
,
ppwzReference
);
DWORD
res
,
type
,
size
=
100
;
return
E_NOTIMPL
;
LPCWSTR
value_name
;
WCHAR
*
buf
;
HKEY
hkey
;
static
const
WCHAR
start_pageW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
' '
,
'P'
,
'a'
,
'g'
,
'e'
,
0
};
static
const
WCHAR
search_pageW
[]
=
{
'S'
,
'e'
,
'a'
,
'r'
,
'c'
,
'h'
,
' '
,
'P'
,
'a'
,
'g'
,
'e'
,
0
};
static
const
WCHAR
ie_main_keyW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'n'
,
'e'
,
't'
,
' '
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'\\'
,
'M'
,
'a'
,
'i'
,
'n'
,
0
};
TRACE
(
"(%u %p)
\n
"
,
uReference
,
ppwzReference
);
*
ppwzReference
=
NULL
;
switch
(
uReference
)
{
case
HLSR_HOME
:
value_name
=
start_pageW
;
break
;
case
HLSR_SEARCHPAGE
:
value_name
=
search_pageW
;
break
;
case
HLSR_HISTORYFOLDER
:
return
E_NOTIMPL
;
default:
return
E_INVALIDARG
;
}
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
ie_main_keyW
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
{
WARN
(
"Could not open key: %u
\n
"
,
res
);
return
HRESULT_FROM_WIN32
(
res
);
}
buf
=
CoTaskMemAlloc
(
size
);
res
=
RegQueryValueExW
(
hkey
,
value_name
,
NULL
,
&
type
,
(
PBYTE
)
buf
,
&
size
);
buf
=
CoTaskMemRealloc
(
buf
,
size
);
if
(
res
==
ERROR_MORE_DATA
)
res
=
RegQueryValueExW
(
hkey
,
value_name
,
NULL
,
&
type
,
(
PBYTE
)
buf
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
{
WARN
(
"Could not query value %s: %u
\n
"
,
debugstr_w
(
value_name
),
res
);
CoTaskMemFree
(
buf
);
return
HRESULT_FROM_WIN32
(
res
);
}
*
ppwzReference
=
buf
;
return
S_OK
;
}
}
HRESULT
WINAPI
HlinkTranslateURL
(
LPCWSTR
pwzURL
,
DWORD
grfFlags
,
LPWSTR
*
ppwzTranslatedURL
)
HRESULT
WINAPI
HlinkTranslateURL
(
LPCWSTR
pwzURL
,
DWORD
grfFlags
,
LPWSTR
*
ppwzTranslatedURL
)
...
...
dlls/hlink/tests/hlink.c
View file @
93d87ca3
...
@@ -316,6 +316,36 @@ static void test_persist(void)
...
@@ -316,6 +316,36 @@ static void test_persist(void)
IHlink_Release
(
lnk
);
IHlink_Release
(
lnk
);
}
}
static
void
test_special_reference
(
void
)
{
LPWSTR
ref
;
HRESULT
hres
;
hres
=
HlinkGetSpecialReference
(
HLSR_HOME
,
&
ref
);
todo_wine
ok
(
hres
==
S_OK
,
"HlinkGetSpecialReference(HLSR_HOME) failed: %08x
\n
"
,
hres
);
todo_wine
ok
(
ref
!=
NULL
,
"ref == NULL
\n
"
);
CoTaskMemFree
(
ref
);
hres
=
HlinkGetSpecialReference
(
HLSR_SEARCHPAGE
,
&
ref
);
todo_wine
ok
(
hres
==
S_OK
,
"HlinkGetSpecialReference(HLSR_SEARCHPAGE) failed: %08x
\n
"
,
hres
);
todo_wine
ok
(
ref
!=
NULL
,
"ref == NULL
\n
"
);
CoTaskMemFree
(
ref
);
ref
=
(
void
*
)
0xdeadbeef
;
hres
=
HlinkGetSpecialReference
(
HLSR_HISTORYFOLDER
,
&
ref
);
ok
(
hres
==
E_NOTIMPL
,
"HlinkGetSpecialReference(HLSR_HISTORYFOLDER) failed: %08x
\n
"
,
hres
);
ok
(
ref
==
NULL
,
"ref=%p
\n
"
,
ref
);
ref
=
(
void
*
)
0xdeadbeef
;
hres
=
HlinkGetSpecialReference
(
4
,
&
ref
);
ok
(
hres
==
E_INVALIDARG
,
"HlinkGetSpecialReference(HLSR_HISTORYFOLDER) failed: %08x
\n
"
,
hres
);
ok
(
ref
==
NULL
,
"ref=%p
\n
"
,
ref
);
}
START_TEST
(
hlink
)
START_TEST
(
hlink
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -323,6 +353,7 @@ START_TEST(hlink)
...
@@ -323,6 +353,7 @@ START_TEST(hlink)
test_HlinkIsShortcut
();
test_HlinkIsShortcut
();
test_reference
();
test_reference
();
test_persist
();
test_persist
();
test_special_reference
();
CoUninitialize
();
CoUninitialize
();
}
}
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