CreateProcess 与 CreateFile EXE
CreateProcess vs. CreateFile EXE
[已编辑]
CreateProcess
创建进程(例如,从 .exe
文件)
CreateFile
可以创建/打开一个文件。如果它打开 .exe
文件,则该执行文件将 运行。这样的话,是不是等于CreateProcess?
这种情况有什么不同吗?我是新手,先谢谢你了!
您对这些功能的描述不正确。它们有完全不同的用途。
CreateProcess
将运行一个可执行文件作为一个进程。它不会创建文件。
Creates a new process and its primary thread. The new process runs in the security context of the calling process.
来源:MSDN
CreateFile
将打开或创建一个文件。它不会将该文件作为进程执行。
Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe. The function returns a handle that can be used to access the file or device for various types of I/O depending on the file or device and the flags and attributes specified.
来源:MSDN
[已编辑]
CreateProcess
创建进程(例如,从.exe
文件)CreateFile
可以创建/打开一个文件。如果它打开.exe
文件,则该执行文件将 运行。这样的话,是不是等于CreateProcess?
这种情况有什么不同吗?我是新手,先谢谢你了!
您对这些功能的描述不正确。它们有完全不同的用途。
CreateProcess
将运行一个可执行文件作为一个进程。它不会创建文件。Creates a new process and its primary thread. The new process runs in the security context of the calling process.
来源:MSDN
CreateFile
将打开或创建一个文件。它不会将该文件作为进程执行。Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe. The function returns a handle that can be used to access the file or device for various types of I/O depending on the file or device and the flags and attributes specified.
来源:MSDN