Jump to ratings and reviews
Rate this book

Windows 10 System Programming, Part 1

Rate this book
Delve into programming the Windows operating system through the Windows API in with C++. Use the power of the Windows API to working with processes, threads, jobs, memory, I/O and more. The book covers current Windows 10 versions, allowing you to get the most of what Windows has to offer to developers in terms of productivity, performance and scalability.

528 pages, Paperback

Published April 11, 2020

11 people are currently reading
26 people want to read

About the author

Pavel Yosifovich

14 books6 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
3 (33%)
4 stars
6 (66%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 2 of 2 reviews
Profile Image for Rene Stein.
228 reviews36 followers
September 27, 2024
=========================================================================
Problém (R1):
Kapitola 7, sekce Condition Variables, demo The Queue Demo Application.
Race condition a UB (undefined behavior):
1) Spustí se Consumer thread.
2) Proměnná data je přidána do kolekce - m_ConsumerThreads.push_back(std::move(data));
3) Consumer thread si hned vyzvedne data (auto& data = m_ConsumerThreads[index];). Race - aplikace asi necrashuje, protože bylo voláno m_ConsumerThreads.reserve(consumers); - ale sáhne si na neinicializovaná data v m_ConsumerThreads a může se updatova jiný objekt. Pokud Consumer thread naběhne až poté, co jsou data přidána, vše je OK.


m_ConsumerThreads.clear();
m_ConsumerThreads.reserve(consumers);
for (int i = 0; i < consumers; i++) {
ConsumerThreadData data;
data.hThread.reset(::CreateThread(nullptr, 0, [](auto p) {
return m_pThis->ConsumerThread(PtrToLong(p));
}, LongToPtr(i), 0, nullptr));
if (!data.hThread) {
abort = true;
break;
}
m_ConsumerThreads.push_back(std::move(data));
}
if (abort) {
::SetEvent(m_hAbortEvent.get());
return;
}


DWORD CMainDlg::ConsumerThread(int index) {
auto& data = m_ConsumerThreads[index];
auto tick = ::GetTickCount64();
Profile Image for Paweł Rusin.
208 reviews5 followers
February 28, 2025
More practical than "Windows Internals" with a lot of code snippets, interesting applications and introduction of tools that helps understand Windows under the hood.
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.