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
e27e733f
Commit
e27e733f
authored
May 28, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebrowser: Support browser and mailer commands with arguments.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
01cc315b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
Makefile.in
programs/winebrowser/Makefile.in
+1
-1
main.c
programs/winebrowser/main.c
+16
-11
No files found.
programs/winebrowser/Makefile.in
View file @
e27e733f
MODULE
=
winebrowser.exe
APPMODE
=
-mwindows
-municode
IMPORTS
=
urlmon oleaut32 user32 advapi32
IMPORTS
=
urlmon oleaut32
shell32
user32 advapi32
C_SRCS
=
\
main.c
programs/winebrowser/main.c
View file @
e27e733f
...
...
@@ -45,6 +45,7 @@
#include <windows.h>
#include <shlwapi.h>
#include <shellapi.h>
#include <urlmon.h>
#include <ddeml.h>
#include <stdio.h>
...
...
@@ -71,27 +72,31 @@ static char *strdup_unixcp( const WCHAR *str )
/* try to launch a unix app from a comma separated string of app names */
static
int
launch_app
(
const
WCHAR
*
candidates
,
const
WCHAR
*
argv1
)
{
char
*
app
,
*
cmdline
;
const
char
*
argv_new
[
3
];
char
*
cmdline
;
int
i
,
count
;
char
**
argv_new
;
if
(
!
(
cmdline
=
strdup_unixcp
(
argv1
)))
return
1
;
while
(
*
candidates
)
{
if
(
!
(
app
=
strdup_unixcp
(
candidates
)))
break
;
WCHAR
**
args
=
CommandLineToArgvW
(
candidates
,
&
count
)
;
WINE_TRACE
(
"Considering: %s
\n
"
,
wine_dbgstr_a
(
app
)
);
WINE_TRACE
(
"argv[1]: %s
\n
"
,
wine_dbgstr_a
(
cmdline
)
);
if
(
!
(
argv_new
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
count
+
1
)
*
sizeof
(
*
argv_new
)
)))
break
;
for
(
i
=
0
;
i
<
count
;
i
++
)
argv_new
[
i
]
=
strdup_unixcp
(
args
[
i
]
);
argv_new
[
count
]
=
cmdline
;
argv_new
[
count
+
1
]
=
NULL
;
argv_new
[
0
]
=
app
;
argv_new
[
1
]
=
cmdline
;
argv_new
[
2
]
=
NULL
;
TRACE
(
"Trying"
)
;
for
(
i
=
0
;
i
<=
count
;
i
++
)
TRACE
(
" %s"
,
wine_dbgstr_a
(
argv_new
[
i
]
))
;
TRACE
(
"
\n
"
)
;
_spawnvp
(
_P_OVERLAY
,
app
,
argv_new
);
/* only returns on error */
HeapFree
(
GetProcessHeap
(),
0
,
app
);
_spawnvp
(
_P_OVERLAY
,
argv_new
[
0
],
(
const
char
**
)
argv_new
);
/* only returns on error */
for
(
i
=
0
;
i
<
count
;
i
++
)
HeapFree
(
GetProcessHeap
(),
0
,
argv_new
[
i
]
);
HeapFree
(
GetProcessHeap
(),
0
,
argv_new
);
candidates
+=
strlenW
(
candidates
)
+
1
;
/* grab the next app */
}
WINE_ERR
(
"could not find a suitable app to
run
\n
"
);
WINE_ERR
(
"could not find a suitable app to
open %s
\n
"
,
debugstr_w
(
argv1
)
);
HeapFree
(
GetProcessHeap
(),
0
,
cmdline
);
return
1
;
...
...
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