简体   繁体   English

CreateProcess 与 CreateFile EXE

[英]CreateProcess vs. CreateFile EXE

[Edited] [编辑]

  • CreateProcess creates a process (for example, from .exe file) CreateProcess创建一个进程(例如,从.exe文件)

  • CreateFile can create / open a file. CreateFile可以创建/打开文件。 If it opens an .exe file, that execution file will run.如果它打开一个.exe文件,该执行文件将运行。 In this case, is it equal to CreateProcess?在这种情况下,它是否等于 CreateProcess?

Are there any differences in this case?在这种情况下有什么不同吗? I'm new to this, thank you in advance!我是新手,在此先感谢您!

Your description of what these functions do is incorrect.您对这些功能的作用的描述不正确。 They serve completely separate purposes.它们服务于完全不同的目的。

  • CreateProcess will run an executable file as a process. CreateProcess运行一个可执行文件作为一个进程。 It will not create a file.它不会创建文件。

    Creates a new process and its primary thread.创建一个新进程及其主线程。 The new process runs in the security context of the calling process.新进程在调用进程的安全上下文中运行。

    Source: MSDN来源: MSDN

  • CreateFile will open or create a file. CreateFile将打开或创建一个文件。 It will not execute that file as a process.不会将该文件作为进程执行。

    Creates or opens a file or I/O device.创建或打开文件或 I/O 设备。 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.最常用的 I/O 设备如下:文件、文件流、目录、物理磁盘、卷、控制台缓冲区、磁带驱动器、通信资源、邮槽和管道。 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.该函数返回一个句柄,该句柄可用于根据文件或设备以及指定的标志和属性为各种类型的 I/O 访问文件或设备。

    Source: MSDN来源: MSDN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM