Year: 2006

A question came up on an internal newsgroup recently – “How do I do on-demand initialization of critical sections in a multithread-aware library?” The asker didn’t have an explicit Initialize function in which his critical section could be created, and instead wanted to know what the right approach was for creating one on demand. Below…

Manifests at resource ID 2 help simplify the lives of DLL authors who want to consume side-by-side components via static imports. Just before processing your DLL’s static imports and calling its entrypoint, the loader will create and activate an activation context based on the manifest that it finds at resource ID 2. This ensures that all…

As explained earlier, the activation context system is implemented as a per-thread (or per-fiber) stack. Activating a context pushes the context onto the stack, deactivating it pops it from the stack. To ensure that the same sequence of pushes and pops is performed, each ActivateActCtx call gets a cookie – an opaque value that identifies…

As the number of apps in the world that use side-by-side activation (as a result of depending on the new Visual C++ Runtime v8.0) increases, providers of callable code (libraries, control packs, whatever) may start seeing odd and potentially unexpected behavior. Typically it’s hard to diagnose. Somewhere deep inside your publicly exposed surface area, a…