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
084e596a
Commit
084e596a
authored
Feb 16, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Feb 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SetPath("") should return S_OK.
SetPath("nonexistent_path") should return S_FALSE.
parent
e2f07fb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
shelllink.c
dlls/shell32/shelllink.c
+14
-4
shelllink.c
dlls/shell32/tests/shelllink.c
+9
-1
No files found.
dlls/shell32/shelllink.c
View file @
084e596a
...
@@ -1336,11 +1336,16 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
...
@@ -1336,11 +1336,16 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
IShellLinkImpl
*
This
=
(
IShellLinkImpl
*
)
iface
;
IShellLinkImpl
*
This
=
(
IShellLinkImpl
*
)
iface
;
char
buffer
[
MAX_PATH
];
char
buffer
[
MAX_PATH
];
LPSTR
fname
;
LPSTR
fname
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
pszFile
);
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
pszFile
);
if
(
!
GetFullPathNameA
(
pszFile
,
MAX_PATH
,
buffer
,
&
fname
))
if
(
*
pszFile
==
'\0'
)
*
buffer
=
'\0'
;
else
if
(
!
GetFullPathNameA
(
pszFile
,
MAX_PATH
,
buffer
,
&
fname
))
return
E_FAIL
;
return
E_FAIL
;
else
if
(
!
PathFileExistsA
(
buffer
))
hr
=
S_FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sPath
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sPath
);
This
->
sPath
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
buffer
);
This
->
sPath
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
buffer
);
...
@@ -1349,7 +1354,7 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
...
@@ -1349,7 +1354,7 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
This
->
bDirty
=
TRUE
;
This
->
bDirty
=
TRUE
;
return
S_OK
;
return
hr
;
}
}
/**************************************************************************
/**************************************************************************
...
@@ -1756,11 +1761,16 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
...
@@ -1756,11 +1761,16 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
_ICOM_THIS_From_IShellLinkW
(
IShellLinkImpl
,
iface
);
_ICOM_THIS_From_IShellLinkW
(
IShellLinkImpl
,
iface
);
WCHAR
buffer
[
MAX_PATH
];
WCHAR
buffer
[
MAX_PATH
];
LPWSTR
fname
;
LPWSTR
fname
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
debugstr_w
(
pszFile
));
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
debugstr_w
(
pszFile
));
if
(
!
GetFullPathNameW
(
pszFile
,
MAX_PATH
,
buffer
,
&
fname
))
if
(
*
pszFile
==
'\0'
)
*
buffer
=
'\0'
;
else
if
(
!
GetFullPathNameW
(
pszFile
,
MAX_PATH
,
buffer
,
&
fname
))
return
E_FAIL
;
return
E_FAIL
;
else
if
(
!
PathFileExistsW
(
buffer
))
hr
=
S_FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sPath
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sPath
);
This
->
sPath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
sPath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
...
@@ -1771,7 +1781,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
...
@@ -1771,7 +1781,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
lstrcpyW
(
This
->
sPath
,
buffer
);
lstrcpyW
(
This
->
sPath
,
buffer
);
This
->
bDirty
=
TRUE
;
This
->
bDirty
=
TRUE
;
return
S_OK
;
return
hr
;
}
}
/**************************************************************************
/**************************************************************************
...
...
dlls/shell32/tests/shelllink.c
View file @
084e596a
...
@@ -136,9 +136,17 @@ static void test_get_set()
...
@@ -136,9 +136,17 @@ static void test_get_set()
ok
(
SUCCEEDED
(
r
),
"GetPath failed (0x%08lx)
\n
"
,
r
);
ok
(
SUCCEEDED
(
r
),
"GetPath failed (0x%08lx)
\n
"
,
r
);
ok
(
*
buffer
==
'\0'
,
"GetPath returned '%s'
\n
"
,
buffer
);
ok
(
*
buffer
==
'\0'
,
"GetPath returned '%s'
\n
"
,
buffer
);
r
=
IShellLinkA_SetPath
(
sl
,
""
);
ok
(
r
==
S_OK
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
NULL
,
SLGP_RAWPATH
);
ok
(
SUCCEEDED
(
r
),
"GetPath failed (0x%08lx)
\n
"
,
r
);
ok
(
*
buffer
==
'\0'
,
"GetPath returned '%s'
\n
"
,
buffer
);
str
=
"c:
\\
nonexistent
\\
file"
;
str
=
"c:
\\
nonexistent
\\
file"
;
r
=
IShellLinkA_SetPath
(
sl
,
str
);
r
=
IShellLinkA_SetPath
(
sl
,
str
);
ok
(
SUCCEEDED
(
r
)
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
strcpy
(
buffer
,
"garbage"
);
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
NULL
,
SLGP_RAWPATH
);
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
NULL
,
SLGP_RAWPATH
);
...
...
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