static SecuredRegistryMethods() { if (ProfilerInterceptor.IsProfilerAttached) { ProfilerInterceptor.WrapCallToDelegate("SetRegistryValue", out setValue); ProfilerInterceptor.WrapCallToDelegate("GetRegistryValue", out getValue); } else { getValue = (currentUser, keyName, valueName, outValue, outValueByteCount) => GetRegistryValue(currentUser, keyName, valueName, outValue); setValue = (currentUser, keyName, valueName, value) => SetRegistryValue(currentUser, keyName, valueName, value); } }