This article is the continuation of How to become a Microsoft Expert? (http://netazurerangers.com/blog/comment-devenir-un-expert-microsoft/)
Windows has been Microsoft’s technological flagship for 25 years. You will tell me, yes but now there is Azure. OK but what is Azure? It is ; if I ignore the Linux part; Windows Server and Service Fabric… and that’s Windows. It’s C / C ++. And yes, again! There is no secret. it must work quickly and well. It must be reliable, robust, fast and secure.
In one of my last post “C ++ unsafe and unsecure?” (http://netazurerangers.com/blog/c-unsafe-et-unsecure/), I explain why C / C ++ is the best and why Microsoft is doing 95% of its products with. Microsoft is the # 1 company in the software industry. It’s not an advertising agency like Google or Facebook, it’s pure juice Tech. Microsoft sells Products and Services. Anyway next…
How to become a Windows expert? The question is asked. First, we learn about the operating system principles via Microsoft Docs (ex: MSDN LIbrary) on https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/overview-of-windows -components
Then, we read the passage on User mode and Kernel mode via https://docs.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/user-mode-and-kernel-mode
From there, we know the basic architecture of Windows. now we attack the elements on the operating system, namely the kernel and the thread scheduler. Windows order threads, Linux order processes. These two systems do not work the same way. The Processes & Threads doc is here: https://docs.microsoft.com/en-us/windows/win32/procthread/about-processes-and-threads
Then we go to practice, how to create a thread, a process, reach the end, etc. the API doc also called reference doc is here: https://docs.microsoft.com/en-us/windows/win32/procthread/process-and-thread-reference
The easiest examples can be viewed via https://docs.microsoft.com/en-us/windows/win32/procthread/process-and-thread-functions#process-and-thread-functions and more specifically the CreateThread function: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread?redirectedfrom=MSDN and its example: https://docs.microsoft.com/en-us/windows / win32 / procthread / Creating-threads
To test this, you must install Visual C ++ available in Visual Studio 2019 for example, Community Edition or Pro 30 day trial. If you received money from Santa Claus, buy the following books:
Windows via C / C ++ by Jeffrey Richter and Christophe Nasarre
Windows Internals ex-Inside Windows NT (https://docs.microsoft.com/en-us/sysinternals/learn/windows-internals)
I bought Inside Windows NT in 1992 and got the virus.
Windows is huge. It’s powerful. You read the Windows Internals book and you will have vision; you will understand how the OS works. It’s very interesting and you will have no trouble understanding new Microsoft technologies with that. Microsoft NET, CLR, BCL, it’s done with C ++ and parts of the Windows API aka Win32. Watch the code on GitHub of CoreCLR (https://github.com/dotnet/runtime)
There are urban legends that Microsoft rewrites Windows from scratch; this is for managers and IT 01. For technicians, the truth is that Windows is sitting on the same code and has been evolving for 25 years. The code is improved and regularly revised in Modern C ++. I can certify it because I have the source code of Windows NT 4, Windows 2000 and access to the latest source code of Windows 190x. The code is made in:
C for kernel and drivers
in C / C ++ for the rest.
What is Modern C ++?
automatic memory release with smart points
using the Standard Template Library (STL)
use of C ++ 11/14/17 with auto, lambdas, etc.
Windows uses COM technology a lot. A COM component is registered in the registry and is invoked via APIs (https://docs.microsoft.com/en-us/windows/win32/api/_com/)
A COM component is a class with AddRef, Release, QueryInterface and methods:
The COM component is created via CoCreateObject and the COM factory:
For more information on COM components, I made in 200x a translation of some elements of “Inside COM + Base Services”: Apartments | Threads | Apartments types | Threading for In-Proc components | Apartment and languages
For more information on COM, get your hands on Inside COM + Base Services (http://www.windowscpp.com/Books/MSPress-InsideCOMBaseServices.zip) or on docs but on docs, the doc is spartan.
201x saw Microsoft turn to open source so you can find Windows components in open source:
Windows Terminal (https://github.com/microsoft/terminal)
Windows NET CoreCLR (https://github.com/dotnet/runtime)
Do like me, study these two modules and try to contribute in GitHub. And who knows, one day, you may work for Microsoft!
Christophe | http://www.christophepichaud.com