Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jason Beetham
wine
Commits
fec23293
Commit
fec23293
authored
25 years ago
by
Dave Pickles
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ensure that the command-line passed to the various *CreateProcess
functions contains the path to the program being invoked.
parent
dfc46d94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loader/module.c
+41
-25
41 additions, 25 deletions
loader/module.c
with
41 additions
and
25 deletions
loader/module.c
+
41
−
25
View file @
fec23293
...
...
@@ -777,6 +777,12 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
||
lpStartupInfo
->
wShowWindow
==
SW_SHOWMINNOACTIVE
)
iconic
=
TRUE
;
/* Build argument list */
argptr
=
argv
;
if
(
!
useWine
)
{
char
*
p
=
strdup
(
lpCmdLine
);
if
(
strchr
(
filename
,
'/'
)
||
strchr
(
filename
,
':'
)
||
strchr
(
filename
,
'\\'
)
)
...
...
@@ -784,19 +790,6 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
if
(
DOSFS_GetFullName
(
filename
,
TRUE
,
&
full_name
)
)
unixfilename
=
full_name
.
long_name
;
}
if
(
!
unixfilename
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
/* Build argument list */
argptr
=
argv
;
if
(
!
useWine
)
{
char
*
p
=
strdup
(
lpCmdLine
);
*
argptr
++
=
unixfilename
;
if
(
iconic
)
*
argptr
++
=
"-iconic"
;
while
(
1
)
...
...
@@ -806,6 +799,7 @@ static BOOL MODULE_CreateUnixProcess( LPCSTR filename, LPCSTR lpCmdLine,
*
argptr
++
=
p
;
while
(
*
p
&&
*
p
!=
' '
&&
*
p
!=
'\t'
)
p
++
;
}
free
(
p
);
}
else
{
...
...
@@ -1129,8 +1123,10 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
HFILE
hFile
;
OFSTRUCT
ofs
;
DWORD
type
;
char
name
[
256
];
char
name
[
256
]
,
dummy
[
256
]
;
LPCSTR
cmdline
=
NULL
;
LPSTR
tidy_cmdline
;
int
len
=
0
;
/* Get name and command line */
...
...
@@ -1140,16 +1136,24 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
return
FALSE
;
}
/* Process the AppName or CmdLine to get module name and path */
/* Process the AppName
and/
or CmdLine to get module name and path */
name
[
0
]
=
'\0'
;
if
(
lpApplicationName
)
{
found_file
=
make_lpApplicationName_name
(
lpApplicationName
,
name
,
sizeof
(
name
)
);
cmdline
=
(
lpCommandLine
)
?
lpCommandLine
:
lpApplicationName
;
if
(
lpCommandLine
)
{
make_lpCommandLine_name
(
lpCommandLine
,
dummy
,
sizeof
(
dummy
),
&
cmdline
);
}
else
else
{
cmdline
=
lpApplicationName
;
}
len
+=
strlen
(
lpApplicationName
);
}
else
{
found_file
=
make_lpCommandLine_name
(
lpCommandLine
,
name
,
sizeof
(
name
),
&
cmdline
);
if
(
lpCommandLine
)
len
=
strlen
(
lpCommandLine
);
}
if
(
!
found_file
)
{
/* make an early exit if file not found - save second pass */
...
...
@@ -1157,6 +1161,10 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
return
FALSE
;
}
len
+=
strlen
(
name
)
+
2
;
tidy_cmdline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
sprintf
(
tidy_cmdline
,
"
\"
%s
\"
%s"
,
name
,
cmdline
);
/* Warn if unsupported features are used */
if
(
dwCreationFlags
&
CREATE_SUSPENDED
)
...
...
@@ -1217,14 +1225,17 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
/* When in WineLib, always fork new Unix process */
if
(
__winelib
)
ret
urn
MODULE_CreateUnixProcess
(
name
,
cmdline
,
if
(
__winelib
)
{
ret
v
=
MODULE_CreateUnixProcess
(
name
,
tidy_
cmdline
,
lpStartupInfo
,
lpProcessInfo
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
tidy_cmdline
);
return
(
retv
);
}
/* Check for special case: second instance of NE module */
lstrcpynA
(
ofs
.
szPathName
,
name
,
sizeof
(
ofs
.
szPathName
)
);
retv
=
NE_CreateProcess
(
HFILE_ERROR
,
&
ofs
,
cmdline
,
lpEnvironment
,
retv
=
NE_CreateProcess
(
HFILE_ERROR
,
&
ofs
,
tidy_
cmdline
,
lpEnvironment
,
lpProcessAttributes
,
lpThreadAttributes
,
bInheritHandles
,
dwCreationFlags
,
lpStartupInfo
,
lpProcessInfo
);
...
...
@@ -1238,6 +1249,7 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
if
(
(
hFile
=
OpenFile
(
name
,
&
ofs
,
OF_READ
))
==
HFILE_ERROR
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
HeapFree
(
GetProcessHeap
(),
0
,
tidy_cmdline
);
return
FALSE
;
}
...
...
@@ -1246,10 +1258,13 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
CloseHandle
(
hFile
);
/* FIXME: Try Unix executable only when appropriate! */
if
(
MODULE_CreateUnixProcess
(
name
,
cmdline
,
if
(
MODULE_CreateUnixProcess
(
name
,
tidy_
cmdline
,
lpStartupInfo
,
lpProcessInfo
,
FALSE
)
)
{
HeapFree
(
GetProcessHeap
(),
0
,
tidy_cmdline
);
return
TRUE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
tidy_cmdline
);
SetLastError
(
ERROR_BAD_FORMAT
);
return
FALSE
;
}
...
...
@@ -1260,21 +1275,21 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
switch
(
type
)
{
case
SCS_32BIT_BINARY
:
retv
=
PE_CreateProcess
(
hFile
,
&
ofs
,
cmdline
,
lpEnvironment
,
retv
=
PE_CreateProcess
(
hFile
,
&
ofs
,
tidy_
cmdline
,
lpEnvironment
,
lpProcessAttributes
,
lpThreadAttributes
,
bInheritHandles
,
dwCreationFlags
,
lpStartupInfo
,
lpProcessInfo
);
break
;
case
SCS_DOS_BINARY
:
retv
=
MZ_CreateProcess
(
hFile
,
&
ofs
,
cmdline
,
lpEnvironment
,
retv
=
MZ_CreateProcess
(
hFile
,
&
ofs
,
tidy_
cmdline
,
lpEnvironment
,
lpProcessAttributes
,
lpThreadAttributes
,
bInheritHandles
,
dwCreationFlags
,
lpStartupInfo
,
lpProcessInfo
);
break
;
case
SCS_WOW_BINARY
:
retv
=
NE_CreateProcess
(
hFile
,
&
ofs
,
cmdline
,
lpEnvironment
,
retv
=
NE_CreateProcess
(
hFile
,
&
ofs
,
tidy_
cmdline
,
lpEnvironment
,
lpProcessAttributes
,
lpThreadAttributes
,
bInheritHandles
,
dwCreationFlags
,
lpStartupInfo
,
lpProcessInfo
);
...
...
@@ -1294,6 +1309,7 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
CloseHandle
(
hFile
);
}
HeapFree
(
GetProcessHeap
(),
0
,
tidy_cmdline
);
return
retv
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment