For .NET, you could use something like TypeMock, which uses the profiling API and allows you to hook into calls to nearly anything.
For .NET, you could use something like TypeMock, which uses the profiling API and allows you to hook into calls to nearly anything.