#include "stdafx.h"
#include <windows.h>
STARTUPINFOW StartInfo = {0};
PROCESS_INFORMATION pi = {0};
TCHAR szCommandLine[MAX_PATH] = TEXT("C:\\Windows\\NOTEPAD.EXE D:\\parallel_studio_xe_2013_update4_for_windows.txt");
int _tmain(int argc, _TCHAR* argv[])
{
StartInfo .cb = sizeof(StartInfo);
__asm
{
sub rsp, 80
lea rax, pi
mov qword ptr [rsp+72], rax
lea rax, StartInfo
mov qword ptr [rsp+64], rax
mov qword ptr [rsp+56], 0
mov qword ptr [rsp+48], 0
mov qword ptr [rsp+40], 0
mov qword ptr [rsp+32], 0
xor r9, r9
xor r8, r8
lea rax, szCommandLine
mov rdx, rax
xor rcx, rcx
mov rsi, qword ptr CreateProcessW
call rsi
add rsp, 80
}
//CreateProcess(0, szCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &StartInfo, &pi);
return 0;
x64内联汇编调用API(需intel编译器,vc不支持x64内联汇编)
,