public SubjectToHook() { _module = LoadLibrary("kernel32"); _unmanagedSleep = (SleepDelegate) Marshal.GetDelegateForFunctionPointer( GetProcAddress(_module, "Sleep"), typeof(SleepDelegate)); _managed = d => { WasManagedCalled = true; return (int) d; }; }
public SubjectToHook() { _module = LoadLibrary("kernel32"); _unmanagedSleep = (SleepDelegate)Marshal.GetDelegateForFunctionPointer( GetProcAddress(_module, "Sleep"), typeof(SleepDelegate)); _managed = d => { WasManagedCalled = true; return((int)d); }; }