Why is an error occurred while running the CreateProcess function in the 64-bit Windows 7 system to process files in the lower part of the System32 folder?

Source: Internet
Author: User

In the 64-bit Windows 7 operating system, visualstudio compiles a 32-bit application. Calling CreateProcess to run the System32 folder to process files in the next batch will fail. The returned value of getlasterror is 2. Query error lookup: the system cannot find the specified file.
The reason is that 64 is the operating system's processing method for 32-bit programs to call files under system32 [1]. For 64-bit operating systems, the c: \ windows \ system32 folder is not a system folder, but reserved for the 64-bit operating system. When the 64-bit and 32-bit DLL with the same name exist in a system at the same time, system32 is used to store 32-bit DLL and these DLL are called by 64-bit applications. Because the file system redirector mechanism exists, syswow64 transparently calls different files.
If a 32-bit application needs to call the file under system32, it is better to use the System32 alias of sysnative. Otherwise, the call will fail. In fact, the sysnative Folder does not exist. This is only a convenience provided by windows for 32-bit application developers. It cannot be used in 64-bit applications.

--------------------------------------------------------
[1] http://msdn.microsoft.com/en-us/library/aa384187.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.