Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmupdate
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
fmupdate
Commits
099796b1
Commit
099796b1
authored
Aug 13, 2021
by
shuai.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Lanch process success on platform WIN10
parent
c66c559f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletions
+32
-1
fmscupd/fmcontrol.cpp
+32
-1
No files found.
fmscupd/fmcontrol.cpp
View file @
099796b1
...
...
@@ -157,7 +157,38 @@ bool FmControl::_LaunchProcess(const QString &exePath, QString& error)
DestroyEnvironmentBlock
(
lpEnvironment
);
}
error
=
QString
(
"CreateProcessAsUser failed [%1]"
).
arg
(
QString
::
number
(
::
GetLastError
()));
return
false
;
{
STARTUPINFO
si
;
PROCESS_INFORMATION
pi
;
ZeroMemory
(
&
si
,
sizeof
(
si
));
si
.
cb
=
sizeof
(
si
);
ZeroMemory
(
&
pi
,
sizeof
(
pi
));
int
size
=
exePath
.
size
();
wchar_t
*
pwc
=
new
wchar_t
[
size
+
1
];
memset
(
pwc
,
0
,(
size
+
1
)
*
2
);
wcscpy
(
pwc
,
reinterpret_cast
<
const
wchar_t
*>
(
exePath
.
utf16
())
);
if
(
!
CreateProcess
(
NULL
,
// No module name (use command line)
pwc
,
// Command line
NULL
,
// Process handle not inheritable
NULL
,
// Thread handle not inheritable
FALSE
,
// Set handle inheritance to FALSE
0
,
// No creation flags
NULL
,
// Use parent's environment block
NULL
,
// Use parent's starting directory
&
si
,
// Pointer to STARTUPINFO structure
&
pi
)
// Pointer to PROCESS_INFORMATION structure
)
{
QLOG_ERROR
()
<<
QString
(
"launch process failed [%1]"
).
arg
(
GetLastError
());
delete
[]
pwc
;
return
false
;
}
else
{
delete
[]
pwc
;
return
true
;
}
}
}
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
...
...
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