Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
61a42001
Commit
61a42001
authored
Nov 16, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix setting of NULL arguments in IShellLink.
parent
d51b4e19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
shelllink.c
dlls/shell32/shelllink.c
+17
-8
shelllink.c
dlls/shell32/tests/shelllink.c
+14
-0
No files found.
dlls/shell32/shelllink.c
View file @
61a42001
...
...
@@ -1497,9 +1497,13 @@ static HRESULT WINAPI IShellLinkA_fnSetArguments(IShellLinkA * iface, LPCSTR psz
TRACE
(
"(%p)->(args=%s)
\n
"
,
This
,
pszArgs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sArgs
);
This
->
sArgs
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszArgs
);
if
(
!
This
->
sArgs
)
return
E_OUTOFMEMORY
;
if
(
pszArgs
)
{
This
->
sArgs
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszArgs
);
if
(
!
This
->
sArgs
)
return
E_OUTOFMEMORY
;
}
else
This
->
sArgs
=
NULL
;
This
->
bDirty
=
TRUE
;
...
...
@@ -1877,11 +1881,16 @@ static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR ps
TRACE
(
"(%p)->(args=%s)
\n
"
,
This
,
debugstr_w
(
pszArgs
));
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sArgs
);
This
->
sArgs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pszArgs
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sArgs
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
This
->
sArgs
,
pszArgs
);
if
(
pszArgs
)
{
This
->
sArgs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pszArgs
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
This
->
sArgs
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
This
->
sArgs
,
pszArgs
);
}
else
This
->
sArgs
=
NULL
;
This
->
bDirty
=
TRUE
;
return
S_OK
;
...
...
dlls/shell32/tests/shelllink.c
View file @
61a42001
...
...
@@ -275,6 +275,20 @@ static void test_get_set(void)
ok
(
SUCCEEDED
(
r
),
"GetArguments failed (0x%08x)
\n
"
,
r
);
ok
(
lstrcmp
(
buffer
,
str
)
==
0
,
"GetArguments returned '%s'
\n
"
,
buffer
);
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_SetArguments
(
sl
,
NULL
);
ok
(
SUCCEEDED
(
r
),
"SetArguments failed (0x%08x)
\n
"
,
r
);
r
=
IShellLinkA_GetArguments
(
sl
,
buffer
,
sizeof
(
buffer
));
ok
(
SUCCEEDED
(
r
),
"GetArguments failed (0x%08x)
\n
"
,
r
);
ok
(
!
buffer
[
0
]
||
lstrcmp
(
buffer
,
str
)
==
0
,
"GetArguments returned '%s'
\n
"
,
buffer
);
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_SetArguments
(
sl
,
""
);
ok
(
SUCCEEDED
(
r
),
"SetArguments failed (0x%08x)
\n
"
,
r
);
r
=
IShellLinkA_GetArguments
(
sl
,
buffer
,
sizeof
(
buffer
));
ok
(
SUCCEEDED
(
r
),
"GetArguments failed (0x%08x)
\n
"
,
r
);
ok
(
!
buffer
[
0
],
"GetArguments returned '%s'
\n
"
,
buffer
);
/* Test Getting / Setting showcmd */
i
=
0xdeadbeef
;
r
=
IShellLinkA_GetShowCmd
(
sl
,
&
i
);
...
...
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