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
506e0930
Commit
506e0930
authored
Aug 02, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Added HlinkIsShortcut implementation.
parent
3cf1e46d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
1 deletion
+59
-1
hlink.spec
dlls/hlink/hlink.spec
+1
-1
hlink_main.c
dlls/hlink/hlink_main.c
+19
-0
hlink.c
dlls/hlink/tests/hlink.c
+38
-0
hlink.idl
include/hlink.idl
+1
-0
No files found.
dlls/hlink/hlink.spec
View file @
506e0930
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
22 stub HlinkGetSpecialReference
22 stub HlinkGetSpecialReference
23 stub HlinkCreateShortcut
23 stub HlinkCreateShortcut
24 stub HlinkResolveShortcut
24 stub HlinkResolveShortcut
25 st
ub HlinkIsShortcut
25 st
dcall HlinkIsShortcut(wstr)
26 stub HlinkResolveShortcutToString
26 stub HlinkResolveShortcutToString
27 stub HlinkCreateShortcutFromString
27 stub HlinkCreateShortcutFromString
28 stub HlinkGetValueFromParams
28 stub HlinkGetValueFromParams
...
...
dlls/hlink/hlink_main.c
View file @
506e0930
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "unknwn.h"
#include "unknwn.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "hlink.h"
#include "hlink.h"
#include "initguid.h"
#include "initguid.h"
...
@@ -254,6 +255,24 @@ HRESULT WINAPI HlinkNavigateToStringReference( LPCWSTR pwzTarget,
...
@@ -254,6 +255,24 @@ HRESULT WINAPI HlinkNavigateToStringReference( LPCWSTR pwzTarget,
return
r
;
return
r
;
}
}
HRESULT
WINAPI
HlinkIsShortcut
(
LPCWSTR
pwzFileName
)
{
int
len
;
static
const
WCHAR
url_ext
[]
=
{
'.'
,
'u'
,
'r'
,
'l'
,
0
};
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
pwzFileName
));
if
(
!
pwzFileName
)
return
E_INVALIDARG
;
len
=
strlenW
(
pwzFileName
)
-
4
;
if
(
len
<
0
)
return
S_FALSE
;
return
strcmpiW
(
pwzFileName
+
len
,
url_ext
)
?
S_FALSE
:
S_OK
;
}
static
HRESULT
WINAPI
HLinkCF_fnQueryInterface
(
LPCLASSFACTORY
iface
,
static
HRESULT
WINAPI
HLinkCF_fnQueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
REFIID
riid
,
LPVOID
*
ppvObj
)
{
{
...
...
dlls/hlink/tests/hlink.c
View file @
506e0930
...
@@ -25,6 +25,42 @@
...
@@ -25,6 +25,42 @@
#include "wine/test.h"
#include "wine/test.h"
static
void
test_HlinkIsShortcut
(
void
)
{
int
i
;
HRESULT
hres
;
static
const
WCHAR
file0
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
file1
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'u'
,
'r'
,
'l'
,
0
};
static
const
WCHAR
file2
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'l'
,
'n'
,
'k'
,
0
};
static
const
WCHAR
file3
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'u'
,
'R'
,
'l'
,
0
};
static
const
WCHAR
file4
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
'u'
,
'r'
,
'l'
,
0
};
static
const
WCHAR
file5
[]
=
{
'c'
,
':'
,
'\\'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'u'
,
'r'
,
'l'
,
0
};
static
const
WCHAR
file6
[]
=
{
'c'
,
':'
,
'\\'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'l'
,
'n'
,
'k'
,
0
};
static
const
WCHAR
file7
[]
=
{
'.'
,
'u'
,
'r'
,
'l'
,
0
};
static
struct
{
LPCWSTR
file
;
HRESULT
hres
;
}
shortcut_test
[]
=
{
{
file0
,
S_FALSE
},
{
file1
,
S_OK
},
{
file2
,
S_FALSE
},
{
file3
,
S_OK
},
{
file4
,
S_FALSE
},
{
file5
,
S_OK
},
{
file6
,
S_FALSE
},
{
file7
,
S_OK
},
{
NULL
,
E_INVALIDARG
}
};
for
(
i
=
0
;
i
<
sizeof
(
shortcut_test
)
/
sizeof
(
shortcut_test
[
0
]);
i
++
)
{
hres
=
HlinkIsShortcut
(
shortcut_test
[
i
].
file
);
ok
(
hres
==
shortcut_test
[
i
].
hres
,
"[%d] HlinkIsShortcut returned %08lx, expected %08lx
\n
"
,
i
,
hres
,
shortcut_test
[
i
].
hres
);
}
}
START_TEST
(
hlink
)
START_TEST
(
hlink
)
{
{
HRESULT
r
;
HRESULT
r
;
...
@@ -69,4 +105,6 @@ START_TEST(hlink)
...
@@ -69,4 +105,6 @@ START_TEST(hlink)
r
=
IHlink_GetStringReference
(
lnk
,
HLINKGETREF_DEFAULT
,
NULL
,
&
str
);
r
=
IHlink_GetStringReference
(
lnk
,
HLINKGETREF_DEFAULT
,
NULL
,
&
str
);
ok
(
r
==
S_OK
,
"failed
\n
"
);
ok
(
r
==
S_OK
,
"failed
\n
"
);
ok
(
str
==
NULL
,
"string should be null
\n
"
);
ok
(
str
==
NULL
,
"string should be null
\n
"
);
test_HlinkIsShortcut
();
}
}
include/hlink.idl
View file @
506e0930
...
@@ -32,6 +32,7 @@ cpp_quote("HRESULT WINAPI HlinkCreateBrowseContext(IUnknown*, REFIID, void **);"
...
@@ -32,6 +32,7 @@ cpp_quote("HRESULT WINAPI HlinkCreateBrowseContext(IUnknown*, REFIID, void **);"
cpp_quote
(
"HRESULT WINAPI HlinkNavigateToStringReference(LPCWSTR, LPCWSTR, IHlinkSite*, DWORD, IHlinkFrame*, DWORD, LPBC, IBindStatusCallback*, IHlinkBrowseContext*);"
)
cpp_quote
(
"HRESULT WINAPI HlinkNavigateToStringReference(LPCWSTR, LPCWSTR, IHlinkSite*, DWORD, IHlinkFrame*, DWORD, LPBC, IBindStatusCallback*, IHlinkBrowseContext*);"
)
cpp_quote
(
"HRESULT WINAPI HlinkNavigate(IHlink*, IHlinkFrame*, DWORD, LPBC, IBindStatusCallback*, IHlinkBrowseContext*);"
)
cpp_quote
(
"HRESULT WINAPI HlinkNavigate(IHlink*, IHlinkFrame*, DWORD, LPBC, IBindStatusCallback*, IHlinkBrowseContext*);"
)
cpp_quote
(
"HRESULT WINAPI HlinkOnNavigate(IHlinkFrame*, IHlinkBrowseContext*, DWORD, IMoniker*, LPCWSTR, LPCWSTR, ULONG*);"
)
cpp_quote
(
"HRESULT WINAPI HlinkOnNavigate(IHlinkFrame*, IHlinkBrowseContext*, DWORD, IMoniker*, LPCWSTR, LPCWSTR, ULONG*);"
)
cpp_quote
(
"HRESULT WINAPI HlinkIsShortcut(LPCWSTR);"
)
/*****************************************************************************
/*****************************************************************************
*
IHlink
interface
*
IHlink
interface
...
...
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