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
7096384d
Commit
7096384d
authored
Sep 22, 2000
by
Andreas Mohr
Committed by
Alexandre Julliard
Sep 22, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed WinExec16 to handle quoted filenames correctly.
parent
72140b02
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
16 deletions
+41
-16
module.c
loader/module.c
+41
-16
No files found.
loader/module.c
View file @
7096384d
...
...
@@ -720,35 +720,60 @@ BOOL WINAPI GetBinaryTypeW( LPCWSTR lpApplicationName, LPDWORD lpBinaryType )
*/
HINSTANCE16
WINAPI
WinExec16
(
LPCSTR
lpCmdLine
,
UINT16
nCmdShow
)
{
LPCSTR
p
=
NULL
;
LPCSTR
p
,
args
=
NULL
;
LPCSTR
name_beg
,
name_end
;
LPSTR
name
,
cmdline
;
int
len
;
int
arg
len
;
HINSTANCE16
ret
;
char
buffer
[
MAX_PATH
];
if
(
(
*
lpCmdLine
==
'"'
)
&&
(
p
=
strchr
(
lpCmdLine
+
1
,
'"'
)
)
)
p
=
strchr
(
p
,
' '
);
if
(
*
lpCmdLine
==
'"'
)
/* has to be only one and only at beginning ! */
{
name_beg
=
lpCmdLine
+
1
;
p
=
strchr
(
lpCmdLine
+
1
,
'"'
);
if
(
p
)
{
name_end
=
p
;
args
=
strchr
(
p
,
' '
);
}
else
/* yes, even valid with trailing '"' missing */
name_end
=
lpCmdLine
+
strlen
(
lpCmdLine
);
}
else
p
=
strchr
(
lpCmdLine
,
' '
);
if
(
p
)
{
if
(
!
(
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
p
-
lpCmdLine
+
1
)))
name_beg
=
lpCmdLine
;
args
=
strchr
(
lpCmdLine
,
' '
);
name_end
=
args
?
args
:
lpCmdLine
+
strlen
(
lpCmdLine
);
}
if
((
name_beg
==
lpCmdLine
)
&&
(
!
args
))
{
/* just use the original cmdline string as file name */
name
=
(
LPSTR
)
lpCmdLine
;
}
else
{
if
(
!
(
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_end
-
name_beg
+
1
)))
return
ERROR_NOT_ENOUGH_MEMORY
;
memcpy
(
name
,
lpCmdLine
,
p
-
lpCmdLine
);
name
[
p
-
lpCmdLine
]
=
0
;
p
++
;
len
=
strlen
(
p
);
cmdline
=
SEGPTR_ALLOC
(
len
+
2
);
cmdline
[
0
]
=
(
BYTE
)
len
;
strcpy
(
cmdline
+
1
,
p
);
memcpy
(
name
,
name_beg
,
name_end
-
name_beg
);
name
[
name_end
-
name_beg
]
=
'\0'
;
}
if
(
args
)
{
args
++
;
arglen
=
strlen
(
args
);
cmdline
=
SEGPTR_ALLOC
(
2
+
arglen
);
cmdline
[
0
]
=
(
BYTE
)
arglen
;
strcpy
(
cmdline
+
1
,
args
);
}
else
{
name
=
(
LPSTR
)
lpCmdLine
;
cmdline
=
SEGPTR_ALLOC
(
2
);
cmdline
=
SEGPTR_ALLOC
(
2
);
cmdline
[
0
]
=
cmdline
[
1
]
=
0
;
}
TRACE
(
"name: %s, cmdline: %.*s
\n
"
,
name
,
cmdline
[
0
],
&
cmdline
[
1
]);
if
(
SearchPathA
(
NULL
,
name
,
".exe"
,
sizeof
(
buffer
),
buffer
,
NULL
))
{
LOADPARAMS16
params
;
...
...
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