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
2554a55b
Commit
2554a55b
authored
Apr 30, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
May 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Handle NULL pName in ShellLink fnSetDescription.
parent
8b8e15d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
shelllink.c
dlls/shell32/shelllink.c
+18
-8
shelllink.c
dlls/shell32/tests/shelllink.c
+9
-0
No files found.
dlls/shell32/shelllink.c
View file @
2554a55b
...
...
@@ -1469,9 +1469,14 @@ static HRESULT WINAPI IShellLinkA_fnSetDescription(IShellLinkA * iface, LPCSTR p
TRACE
(
"(%p)->(pName=%s)
\n
"
,
This
,
pszName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sDescription
);
This
->
sDescription
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszName
);
if
(
!
This
->
sDescription
)
return
E_OUTOFMEMORY
;
if
(
pszName
)
{
This
->
sDescription
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszName
);
if
(
!
This
->
sDescription
)
return
E_OUTOFMEMORY
;
}
else
This
->
sDescription
=
NULL
;
This
->
bDirty
=
TRUE
;
...
...
@@ -1852,12 +1857,17 @@ static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR
TRACE
(
"(%p)->(desc=%s)
\n
"
,
This
,
debugstr_w
(
pszName
));
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sDescription
);
This
->
sDescription
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pszName
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sDescription
)
return
E_OUTOFMEMORY
;
if
(
pszName
)
{
This
->
sDescription
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pszName
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sDescription
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
This
->
sDescription
,
pszName
);
lstrcpyW
(
This
->
sDescription
,
pszName
);
}
else
This
->
sDescription
=
NULL
;
This
->
bDirty
=
TRUE
;
return
S_OK
;
...
...
dlls/shell32/tests/shelllink.c
View file @
2554a55b
...
...
@@ -136,6 +136,15 @@ static void test_get_set(void)
ok
(
r
==
S_OK
,
"GetDescription failed (0x%08x)
\n
"
,
r
);
ok
(
lstrcmp
(
buffer
,
str
)
==
0
,
"GetDescription returned '%s'
\n
"
,
buffer
);
r
=
IShellLinkA_SetDescription
(
sl
,
NULL
);
ok
(
r
==
S_OK
,
"SetDescription failed (0x%08x)
\n
"
,
r
);
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_GetDescription
(
sl
,
buffer
,
sizeof
(
buffer
));
ok
(
r
==
S_OK
,
"GetDescription failed (0x%08x)
\n
"
,
r
);
ok
(
*
buffer
==
'\0'
||
broken
(
lstrcmp
(
buffer
,
str
)
==
0
),
"GetDescription returned '%s'
\n
"
,
buffer
);
/* NT4 */
/* Test Getting / Setting the work directory */
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_GetWorkingDirectory
(
sl
,
buffer
,
sizeof
(
buffer
));
...
...
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