On-demand multhreaded critical section creation

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…

0

DLLs and resource ID 2 manifests

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…

0

C++ object for activating and Deactivating Contexts

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…

0

Fixing Activation Context Pollution

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…

0