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.