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
9dee1b24
Commit
9dee1b24
authored
Jul 24, 2010
by
Ilya Basin
Committed by
Alexandre Julliard
Jul 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix CommandLineToArgvW("") truncating returned exe path.
parent
f6299c1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
shell32_main.c
dlls/shell32/shell32_main.c
+8
-6
No files found.
dlls/shell32/shell32_main.c
View file @
9dee1b24
...
...
@@ -94,20 +94,22 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
if
(
*
lpCmdline
==
0
)
{
/* Return the path to the executable */
DWORD
len
,
size
=
16
;
DWORD
len
,
deslen
=
MAX_PATH
,
size
;
argv
=
LocalAlloc
(
LMEM_FIXED
,
size
);
size
=
sizeof
(
LPWSTR
)
+
deslen
*
sizeof
(
WCHAR
)
+
sizeof
(
LPWSTR
);
for
(;;)
{
len
=
GetModuleFileNameW
(
0
,
(
LPWSTR
)(
argv
+
1
),
(
size
-
sizeof
(
LPWSTR
))
/
sizeof
(
WCHAR
));
if
(
!
(
argv
=
LocalAlloc
(
LMEM_FIXED
,
size
)))
return
NULL
;
len
=
GetModuleFileNameW
(
0
,
(
LPWSTR
)(
argv
+
1
),
deslen
);
if
(
!
len
)
{
LocalFree
(
argv
);
return
NULL
;
}
if
(
len
<
size
)
break
;
size
*=
2
;
argv
=
LocalReAlloc
(
argv
,
size
,
0
);
if
(
len
<
deslen
)
break
;
deslen
*=
2
;
size
=
sizeof
(
LPWSTR
)
+
deslen
*
sizeof
(
WCHAR
)
+
sizeof
(
LPWSTR
);
LocalFree
(
argv
);
}
argv
[
0
]
=
(
LPWSTR
)(
argv
+
1
);
if
(
numargs
)
...
...
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