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
dad70912
Commit
dad70912
authored
Jul 16, 2000
by
Marcus Meissner
Committed by
Alexandre Julliard
Jul 16, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transmit current directory settings to newly created processes.
parent
33923f29
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
process.h
include/process.h
+2
-1
module.c
loader/module.c
+2
-5
process.c
scheduler/process.c
+19
-3
No files found.
include/process.h
View file @
dad70912
...
...
@@ -155,7 +155,8 @@ extern void PROCESS_CallUserSignalProc( UINT uCode, HMODULE hModule );
extern
BOOL
PROCESS_Create
(
HFILE
hFile
,
LPCSTR
filename
,
LPSTR
cmd_line
,
LPCSTR
env
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
BOOL
inherit
,
DWORD
flags
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
);
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
,
LPCSTR
lpCurrentDirectory
);
static
inline
PDB
WINE_UNUSED
*
PROCESS_Current
(
void
)
{
...
...
loader/module.c
View file @
dad70912
...
...
@@ -949,9 +949,6 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
FIXME
(
"(%s,...): PROFILE_KERNEL ignored
\n
"
,
name
);
if
(
dwCreationFlags
&
PROFILE_SERVER
)
FIXME
(
"(%s,...): PROFILE_SERVER ignored
\n
"
,
name
);
if
(
lpCurrentDirectory
)
FIXME
(
"(%s,...): lpCurrentDirectory %s ignored
\n
"
,
name
,
lpCurrentDirectory
);
if
(
lpStartupInfo
->
lpDesktop
)
FIXME
(
"(%s,...): lpStartupInfo->lpDesktop %s ignored
\n
"
,
name
,
lpStartupInfo
->
lpDesktop
);
...
...
@@ -984,7 +981,7 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
retv
=
PROCESS_Create
(
-
1
,
name
,
tidy_cmdline
,
lpEnvironment
,
lpProcessAttributes
,
lpThreadAttributes
,
bInheritHandles
,
dwCreationFlags
,
lpStartupInfo
,
lpProcessInfo
);
lpStartupInfo
,
lpProcessInfo
,
lpCurrentDirectory
);
goto
done
;
}
...
...
@@ -998,7 +995,7 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
retv
=
PROCESS_Create
(
hFile
,
name
,
tidy_cmdline
,
lpEnvironment
,
lpProcessAttributes
,
lpThreadAttributes
,
bInheritHandles
,
dwCreationFlags
,
lpStartupInfo
,
lpProcessInfo
);
lpStartupInfo
,
lpProcessInfo
,
lpCurrentDirectory
);
break
;
case
SCS_PIF_BINARY
:
...
...
scheduler/process.c
View file @
dad70912
...
...
@@ -674,7 +674,8 @@ static void exec_wine_binary( char **argv, char **envp )
*
* Fork and exec a new Unix process, checking for errors.
*/
static
int
fork_and_exec
(
const
char
*
filename
,
char
*
cmdline
,
const
char
*
env
)
static
int
fork_and_exec
(
const
char
*
filename
,
char
*
cmdline
,
const
char
*
env
,
const
char
*
newdir
)
{
int
fd
[
2
];
int
pid
,
err
;
...
...
@@ -690,6 +691,9 @@ static int fork_and_exec( const char *filename, char *cmdline, const char *env )
char
**
argv
=
build_argv
(
cmdline
,
filename
?
0
:
2
);
char
**
envp
=
build_envp
(
env
);
close
(
fd
[
0
]
);
if
(
newdir
)
chdir
(
newdir
);
if
(
argv
&&
envp
)
{
if
(
!
filename
)
...
...
@@ -725,10 +729,11 @@ static int fork_and_exec( const char *filename, char *cmdline, const char *env )
BOOL
PROCESS_Create
(
HFILE
hFile
,
LPCSTR
filename
,
LPSTR
cmd_line
,
LPCSTR
env
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
BOOL
inherit
,
DWORD
flags
,
LPSTARTUPINFOA
startup
,
LPPROCESS_INFORMATION
info
)
LPPROCESS_INFORMATION
info
,
LPCSTR
lpCurrentDirectory
)
{
int
pid
;
const
char
*
unixfilename
=
NULL
;
const
char
*
unixdir
=
NULL
;
DOS_FULL_NAME
full_name
;
HANDLE
load_done_evt
=
-
1
;
struct
new_process_request
*
req
=
get_req_buffer
();
...
...
@@ -757,6 +762,17 @@ BOOL PROCESS_Create( HFILE hFile, LPCSTR filename, LPSTR cmd_line, LPCSTR env,
req
->
cmd_show
=
startup
->
wShowWindow
;
req
->
alloc_fd
=
0
;
if
(
lpCurrentDirectory
)
{
if
(
DOSFS_GetFullName
(
lpCurrentDirectory
,
TRUE
,
&
full_name
))
unixdir
=
full_name
.
long_name
;
}
else
{
CHAR
buf
[
260
];
if
(
GetCurrentDirectoryA
(
sizeof
(
buf
),
buf
))
{
if
(
DOSFS_GetFullName
(
buf
,
TRUE
,
&
full_name
))
unixdir
=
full_name
.
long_name
;
}
}
if
(
hFile
==
-
1
)
/* unix process */
{
unixfilename
=
filename
;
...
...
@@ -772,7 +788,7 @@ BOOL PROCESS_Create( HFILE hFile, LPCSTR filename, LPSTR cmd_line, LPCSTR env,
/* fork and execute */
pid
=
fork_and_exec
(
unixfilename
,
cmd_line
,
env
?
env
:
GetEnvironmentStringsA
()
);
pid
=
fork_and_exec
(
unixfilename
,
cmd_line
,
env
?
env
:
GetEnvironmentStringsA
()
,
unixdir
);
wait_req
->
cancel
=
(
pid
==
-
1
);
wait_req
->
pinherit
=
(
psa
&&
(
psa
->
nLength
>=
sizeof
(
*
psa
))
&&
psa
->
bInheritHandle
);
...
...
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