Category Archives: Win32

MSVC Pointer Type Attributes

One of the lesser-known features of Visual Studio’s C/C++ compiler are the pointer type attributes __ptr32 and __ptr64. More information about them can be found on MSDN. These pointer type attributes are used to control the visible size and behavior … Continue reading

Posted in C/C++, Win32 | 1 Comment

Source Indexing SVN Repositories is Broken

Some of us spend a fair amount of time pouring through crash dumps generated on Windows. For us, the symbol server support provided by Microsoft’s debugging engines is a godsend. However, source indexing is an even bigger boon because it … Continue reading

Posted in Win32 | Tagged , , | 1 Comment

Describing the MSVC ABI for Structure Return Types

An ABI is an “application binary interface”, which is basically a contract between pieces of executable code on how to behave. The ABI dictates things like how parameters are passed, where return values go, how to create and destroy stack … Continue reading

Posted in C/C++, Win32 | Tagged , , , , | 6 Comments

String Resources

On Windows, when you need to access a string resource, you turn to the LoadString API. It takes care of finding the string for you, loading it, and copying it into the buffer you supply. However, there are times when … Continue reading

Posted in Win32 | Tagged , | Leave a comment

An Almost Useful Language Extension

While fiddling around a bit with clang, I came across an interesting C++ language extension from Microsoft. If you’ve done library development on Windows, you’ve likely come across the __declspec keyword for things like importing and exporting symbols from a … Continue reading

Posted in C/C++, Win32 | Tagged , , | 2 Comments

How DLL Imports Work

When you make a function call into a function that exists in a DLL, what happens, exactly? How does the function call happen, and what work goes on behind the scenes to make it so? I want to cover some … Continue reading

Posted in Win32 | Tagged , , , | Leave a comment

Threading on Windows

Threads are becoming one of the more ubiquitous concepts in programming. Chances are quite good that you’ve a few of them before. But have you ever stopped to think about how a thread works under the hood? There are some … Continue reading

Posted in Win32 | Tagged , , | Leave a comment

What Happens When You Load a Library

At this point in time, I think it’s safe to say that almost all programmers on Windows take shared libraries (DLLs) for granted. They’re this background thing that always “just works” (even if you do recall the ‘DLL hell’ days). … Continue reading

Posted in Win32 | Tagged | Leave a comment

How to Check Access Rights

Given that everyone is always pushing for better security mechanisms, I’m always surprised at how incredibly difficult the simple tasks can be in the Win32 security model. At work, we have an application that wants to do the right thing … Continue reading

Posted in Win32 | Tagged , | 17 Comments

Calling Instance Methods in WMI

It’s pretty rare that I wind up using WMI from a C++ application, but when I’ve done so in the past, it’s been a straightforward process. The documentation in MSDN is generally adequate, and their example projects tend to lead … Continue reading

Posted in Win32 | Tagged | 3 Comments