Tag Archives: WINAPI

HOWTO detect WIN11 using Windows API

The main problem here is that Windows 11 is a Windows 10++, and there is no function like IsWindows10OrGreater(). This forced us to write down our own IsWindows11OrGreater(). I want to write a function similar to the existing IsWindows*() using VerifyVersionInfo(). Here is the working body of such a function: BOOL IsWindows11OrGreater() { OSVERSIONINFOEX vi; ULONGLONG conditions; memset (&vi, 0, sizeof(vi)); vi.dwOSVersionInfoSize = sizeof(vi); vi.dwMajorVersion … Continue reading HOWTO detect WIN11 using Windows API »

A custom EVENT object for lighting fast thread synchronization

Several weeks ago, while I was working on the next version of Horodruin, I was optimizing the multithreaded file copy engine. This optimization phase pops up an unexpected event on the standard event object processing.  It seems that frequent uses of SetEvent() API are not exactly processing-resources free. This is probably caused by some code overhead needed for a system object… During these evaluations, I … Continue reading A custom EVENT object for lighting fast thread synchronization »

HOWTO Automatically Catch Problems While Debugging

Suppose to have the ability to add dozens of breakpoints into your program main error detection points, whenever you start a debugging session. This should allow you to easily track down some hidden/unnoticed problems. For example, suppose to have a C function like the below one: __MYOBJECTDATA * WINAPI MYOBJGetPtr (HANDLE hMyObject) { __MYOBJECTDATA *pObj; pObj = (__MYOBJECTDATA *) hMyObject; __try { if ((pObj != … Continue reading HOWTO Automatically Catch Problems While Debugging »

About Using & Designing DLLs

requirement: medium knowledge of C/C++ or similar languages under MS Windows. Introduction Some days ago, I was explaining how a .DLL works, and how to use them in programs written into C or C++. Supposing to have MYAPP.EXE and MYLIB.DLL, we will face the following main scenarios: scenario MYAPP.EXE MYLIB.DLL 1 The program uses MYLIB.DLL. The used functions are all exported. 2 The program uses … Continue reading About Using & Designing DLLs »