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
7c2c6a57
Commit
7c2c6a57
authored
May 18, 2009
by
Andrew Nguyen
Committed by
Alexandre Julliard
May 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Correct the last error of CreateProcessW with an empty command line string.
parent
645e59c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
process.c
dlls/kernel32/process.c
+1
-0
process.c
dlls/kernel32/tests/process.c
+34
-0
No files found.
dlls/kernel32/process.c
View file @
7c2c6a57
...
...
@@ -1824,6 +1824,7 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
sprintfW
(
ret
,
quotesW
,
name
);
strcatW
(
ret
,
p
);
}
else
if
(
!
ret
)
SetLastError
(
ERROR_FILE_NOT_FOUND
);
done:
HeapFree
(
GetProcessHeap
(),
0
,
name
);
...
...
dlls/kernel32/tests/process.c
View file @
7c2c6a57
...
...
@@ -955,6 +955,40 @@ static void test_CommandLine(void)
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
||
broken
(
GetLastError
()
==
ERROR_ACCESS_DENIED
)
/* Win98 */
,
"Expected ERROR_PATH_NOT_FOUND, got %d
\n
"
,
GetLastError
());
/* Test empty command line parameter. */
SetLastError
(
0xdeadbeef
);
ret
=
CreateProcessA
(
NULL
,
buffer2
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
ok
(
!
ret
,
"CreateProcessA unexpectedly succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
||
GetLastError
()
==
ERROR_PATH_NOT_FOUND
/* NT4 */
||
GetLastError
()
==
ERROR_BAD_PATHNAME
/* Win98 */
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
strcpy
(
buffer
,
"doesnotexist.exe"
);
strcpy
(
buffer2
,
"does not exist.exe"
);
/* Test nonexistent application name. */
SetLastError
(
0xdeadbeef
);
ret
=
CreateProcessA
(
buffer
,
NULL
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
ok
(
!
ret
,
"CreateProcessA unexpectedly succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CreateProcessA
(
buffer2
,
NULL
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
ok
(
!
ret
,
"CreateProcessA unexpectedly succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
/* Test nonexistent command line parameter. */
SetLastError
(
0xdeadbeef
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
ok
(
!
ret
,
"CreateProcessA unexpectedly succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CreateProcessA
(
NULL
,
buffer2
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
ok
(
!
ret
,
"CreateProcessA unexpectedly succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
}
static
void
test_Directory
(
void
)
...
...
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