Skip to content

Commit be2111b

Browse files
author
nahida-mouo
committed
修复HutaoProcess错误的参数传递
1 parent 5cdbf5c commit be2111b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Snap.Hutao.Remastered.Native/HutaoNativeProcess.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ BOOL HutaoNativeProcess::CreateProcessInternal()
6969
// 创建进程
7070
BOOL success = CreateProcessW(
7171
m_startInfo.ApplicationName, // 应用程序名称
72-
commandLine.IsEmpty() ? nullptr : &commandLine[0], // 命令行
72+
commandLine.IsEmpty() ? nullptr : commandLine.Data(), // 命令行
7373
nullptr, // 进程安全属性
7474
nullptr, // 线程安全属性
7575
m_startInfo.InheritHandles, // 继承句柄
@@ -89,11 +89,9 @@ HRESULT __stdcall HutaoNativeProcess::Start()
8989
{
9090
return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS);
9191
}
92-
93-
if (m_startInfo.ApplicationName == nullptr && m_startInfo.CommandLine == nullptr)
94-
{
95-
return E_INVALIDARG;
96-
}
92+
93+
AssertNonNullAndReturn(m_startInfo.ApplicationName);
94+
AssertNonNullAndReturn(m_startInfo.CommandLine);
9795

9896
if (!CreateProcessInternal())
9997
{

0 commit comments

Comments
 (0)