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
8a46b9e5
Commit
8a46b9e5
authored
Sep 25, 2017
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add support for find data in IShellLink:GetPath.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aa37e696
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
2 deletions
+97
-2
shelllink.c
dlls/shell32/shelllink.c
+64
-2
shelllink.c
dlls/shell32/tests/shelllink.c
+33
-0
No files found.
dlls/shell32/shelllink.c
View file @
8a46b9e5
...
...
@@ -1270,7 +1270,39 @@ static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA *iface, LPSTR pszFile, I
else
res
=
S_FALSE
;
if
(
pfd
)
FIXME
(
"(%p): WIN32_FIND_DATA is not yet filled.
\n
"
,
This
);
if
(
pfd
)
{
memset
(
pfd
,
0
,
sizeof
(
*
pfd
));
if
(
res
==
S_OK
)
{
char
path
[
MAX_PATH
];
WIN32_FILE_ATTRIBUTE_DATA
fad
;
WideCharToMultiByte
(
CP_ACP
,
0
,
This
->
sPath
,
-
1
,
path
,
MAX_PATH
,
NULL
,
NULL
);
if
(
GetFileAttributesExW
(
This
->
sPath
,
GetFileExInfoStandard
,
&
fad
))
{
pfd
->
dwFileAttributes
=
fad
.
dwFileAttributes
;
pfd
->
ftCreationTime
=
fad
.
ftCreationTime
;
pfd
->
ftLastAccessTime
=
fad
.
ftLastAccessTime
;
pfd
->
ftLastWriteTime
=
fad
.
ftLastWriteTime
;
pfd
->
nFileSizeHigh
=
fad
.
nFileSizeHigh
;
pfd
->
nFileSizeLow
=
fad
.
nFileSizeLow
;
}
lstrcpyA
(
pfd
->
cFileName
,
PathFindFileNameA
(
path
));
if
(
GetShortPathNameA
(
path
,
path
,
MAX_PATH
))
{
lstrcpyA
(
pfd
->
cAlternateFileName
,
PathFindFileNameA
(
path
));
}
}
TRACE
(
"attr 0x%08x size 0x%08x%08x name %s shortname %s
\n
"
,
pfd
->
dwFileAttributes
,
pfd
->
nFileSizeHigh
,
pfd
->
nFileSizeLow
,
wine_dbgstr_a
(
pfd
->
cFileName
),
wine_dbgstr_a
(
pfd
->
cAlternateFileName
));
}
return
res
;
}
...
...
@@ -1657,7 +1689,37 @@ static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,
else
res
=
S_FALSE
;
if
(
pfd
)
FIXME
(
"(%p): WIN32_FIND_DATA is not yet filled.
\n
"
,
This
);
if
(
pfd
)
{
memset
(
pfd
,
0
,
sizeof
(
*
pfd
));
if
(
res
==
S_OK
)
{
WCHAR
path
[
MAX_PATH
];
WIN32_FILE_ATTRIBUTE_DATA
fad
;
if
(
GetFileAttributesExW
(
This
->
sPath
,
GetFileExInfoStandard
,
&
fad
))
{
pfd
->
dwFileAttributes
=
fad
.
dwFileAttributes
;
pfd
->
ftCreationTime
=
fad
.
ftCreationTime
;
pfd
->
ftLastAccessTime
=
fad
.
ftLastAccessTime
;
pfd
->
ftLastWriteTime
=
fad
.
ftLastWriteTime
;
pfd
->
nFileSizeHigh
=
fad
.
nFileSizeHigh
;
pfd
->
nFileSizeLow
=
fad
.
nFileSizeLow
;
}
lstrcpyW
(
pfd
->
cFileName
,
PathFindFileNameW
(
This
->
sPath
));
if
(
GetShortPathNameW
(
This
->
sPath
,
path
,
MAX_PATH
))
{
lstrcpyW
(
pfd
->
cAlternateFileName
,
PathFindFileNameW
(
path
));
}
}
TRACE
(
"attr 0x%08x size 0x%08x%08x name %s shortname %s
\n
"
,
pfd
->
dwFileAttributes
,
pfd
->
nFileSizeHigh
,
pfd
->
nFileSizeLow
,
wine_dbgstr_w
(
pfd
->
cFileName
),
wine_dbgstr_w
(
pfd
->
cAlternateFileName
));
}
return
res
;
}
...
...
dlls/shell32/tests/shelllink.c
View file @
8a46b9e5
...
...
@@ -105,6 +105,7 @@ static void test_get_set(void)
IShellLinkW
*
slW
=
NULL
;
char
mypath
[
MAX_PATH
];
char
buffer
[
INFOTIPSIZE
];
WIN32_FIND_DATAA
finddata
;
LPITEMIDLIST
pidl
,
tmp_pidl
;
const
char
*
str
;
int
i
;
...
...
@@ -160,6 +161,14 @@ static void test_get_set(void)
ok
(
r
==
S_FALSE
||
broken
(
r
==
S_OK
)
/* NT4/W2K */
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
*
buffer
==
'\0'
,
"GetPath returned '%s'
\n
"
,
buffer
);
strcpy
(
buffer
,
"garbage"
);
memset
(
&
finddata
,
0xaa
,
sizeof
(
finddata
));
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
&
finddata
,
SLGP_RAWPATH
);
ok
(
r
==
S_FALSE
||
broken
(
r
==
S_OK
)
/* NT4/W2K */
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
*
buffer
==
'\0'
,
"GetPath returned '%s'
\n
"
,
buffer
);
ok
(
finddata
.
dwFileAttributes
==
0
,
"unexpected attributes %x
\n
"
,
finddata
.
dwFileAttributes
);
ok
(
finddata
.
cFileName
[
0
]
==
0
,
"unexpected filename '%s'
\n
"
,
finddata
.
cFileName
);
CoCreateInstance
(
&
CLSID_ShellLink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IShellLinkW
,
(
LPVOID
*
)
&
slW
);
if
(
!
slW
/* Win9x */
||
!
pGetLongPathNameA
/* NT4 */
)
...
...
@@ -191,6 +200,14 @@ static void test_get_set(void)
ok
(
r
==
S_OK
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
lstrcmpiA
(
buffer
,
str
)
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
strcpy
(
buffer
,
"garbage"
);
memset
(
&
finddata
,
0xaa
,
sizeof
(
finddata
));
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
&
finddata
,
SLGP_RAWPATH
);
ok
(
r
==
S_OK
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
lstrcmpiA
(
buffer
,
str
)
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
ok
(
finddata
.
dwFileAttributes
==
0
,
"unexpected attributes %x
\n
"
,
finddata
.
dwFileAttributes
);
ok
(
lstrcmpiA
(
finddata
.
cFileName
,
"file"
)
==
0
,
"unexpected filename '%s'
\n
"
,
finddata
.
cFileName
);
/* Get some real path to play with */
GetWindowsDirectoryA
(
mypath
,
sizeof
(
mypath
)
-
12
);
strcat
(
mypath
,
"
\\
regedit.exe"
);
...
...
@@ -241,6 +258,14 @@ static void test_get_set(void)
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
NULL
,
SLGP_RAWPATH
);
ok
(
r
==
S_OK
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
lstrcmpiA
(
buffer
,
mypath
)
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
strcpy
(
buffer
,
"garbage"
);
memset
(
&
finddata
,
0xaa
,
sizeof
(
finddata
));
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
&
finddata
,
SLGP_RAWPATH
);
ok
(
r
==
S_OK
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
lstrcmpiA
(
buffer
,
mypath
)
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
ok
(
finddata
.
dwFileAttributes
!=
0
,
"unexpected attributes %x
\n
"
,
finddata
.
dwFileAttributes
);
ok
(
lstrcmpiA
(
finddata
.
cFileName
,
"regedit.exe"
)
==
0
,
"unexpected filename '%s'
\n
"
,
finddata
.
cFileName
);
}
if
(
pSHGetFolderLocation
)
...
...
@@ -258,6 +283,14 @@ static void test_get_set(void)
ok
(
r
==
S_FALSE
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
buffer
[
0
]
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
strcpy
(
buffer
,
"garbage"
);
memset
(
&
finddata
,
0xaa
,
sizeof
(
finddata
));
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
&
finddata
,
SLGP_RAWPATH
);
ok
(
r
==
S_FALSE
,
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
buffer
[
0
]
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
ok
(
finddata
.
dwFileAttributes
==
0
,
"unexpected attributes %x
\n
"
,
finddata
.
dwFileAttributes
);
ok
(
finddata
.
cFileName
[
0
]
==
0
,
"unexpected filename '%s'
\n
"
,
finddata
.
cFileName
);
pILFree
(
pidl_controls
);
}
...
...
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