Summary of the fifth edition of Windows core programming

Source: Internet
Author: User

LP Spring Festival issued the superior card to buy a vacuum cleaner and balance, just some time ago encountered a window process exception problem. So I started with a Windows core programming version 5th. I remember reading the fourth edition of the electronic version a few years ago, but I was not very impressed. I think it should be the reason why I didn't read it carefully! So I decided to post my book notes.

Chapter 1 focuses on window system error handling, which is relatively simple. It is nothing more than setlasterror and getlasterror. Basically, it does not play a major role in actual Server programming.

The second chapter introduces character encoding and string processing unexpectedly. Character encoding focuses on the fact that the WINNT system is basically implemented using Unicode, so the development of WindowsProgramUnicode encoding should be used whenever possible, which can be more efficient than ANSI, mainly to save the time for converting from ANSI to unicode encoding in the operating system. String processing mainly refers to the problem of adding a length judgment from strcpy-"strcpy_s. To convert ANSI and Unicode, use multibytetowidechar and widechartoultibyte for conversion. Determine whether the text is unicoe istextunicode

Chapter 3 focuses on the window kernel. The window kernel manages the window kernel objects, including files, memory ing, I/O Completion Ports, events, and mutex. The kernel objects are secure, the kernel object has a security identifier used to identify which users and groups are accessible. The window kernel also provides reference counting for kernel objects, similar to smart pointer counting. When the reference counting is 0, the kernel objects are automatically deleted. Generally, the creation of kernel objects requires parameters with Security Identifiers, which are a sign for distinguishing kernel object calls from common APIs. To create a kernel object, you must call closehandle to disable the kernel object. Cross-process sharing of kernel objects. The first method is to use the object handle inheritance. In the CreateProcess function, set binherithandles to true. The second method is to use the kernel object name. The win system does not allow kernel objects with the same name, so it extends the mutex used to create a specified name to prevent the system from running multiple identical processes.

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.