Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / Registry.cs / 1606164 / Registry.cs
using System; using MS.Internal; using MS.Internal.WindowsBase; using System.Security; using System.Security.Permissions; using Microsoft.Win32; //****** // Keep in [....] with host\Inc\Registry.hxx namespace MS.Internal { [FriendAccessAllowed] internal static class RegistryKeys { internal const string WPF = @"Software\Microsoft\.NETFramework\Windows Presentation Foundation", WPF_Features = WPF+"\\Features", value_MediaImageDisallow = "MediaImageDisallow", value_MediaVideoDisallow = "MediaVideoDisallow", value_MediaAudioDisallow = "MediaAudioDisallow", value_WebBrowserDisallow = "WebBrowserDisallow", value_ScriptInteropDisallow = "ScriptInteropDisallow", value_AutomationWeakReferenceDisallow = "AutomationWeakReferenceDisallow", WPF_Hosting = WPF+"\\Hosting", value_DisableXbapErrorPage = "DisableXbapErrorPage", value_UnblockWebBrowserControl = "UnblockWebBrowserControl", HKCU_XpsViewer = @"HKEY_CURRENT_USER\Software\Microsoft\XPSViewer", value_IsolatedStorageUserQuota = "IsolatedStorageUserQuota", HKLM_XpsViewerLocalServer32 = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID\\{7DDA204B-2097-47C9-8323-C40BB840AE44}\\LocalServer32", HKLM_IetfLanguage = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\IetfLanguage", // These constants are cloned in // wpf\src\Shared\Cpp\Utils.cxx // Should these reg keys change the above file should be also modified to reflect that. FRAMEWORK_RegKey = @"Software\Microsoft\Net Framework Setup\NDP\v4\Client\", FRAMEWORK_RegKey_FullPath = @"HKEY_LOCAL_MACHINE\" + FRAMEWORK_RegKey, FRAMEWORK_InstallPath_RegValue = "InstallPath"; ////// Critical: Reads an arbitrary registry key. /// [SecurityCritical] internal static bool ReadLocalMachineBool(string key, string valueName) { string keyPath = "HKEY_LOCAL_MACHINE\\" + key; new RegistryPermission(RegistryPermissionAccess.Read, keyPath).Assert(); object value = Registry.GetValue(keyPath, valueName, null); return value is int && (int)value != 0; } }; } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using MS.Internal; using MS.Internal.WindowsBase; using System.Security; using System.Security.Permissions; using Microsoft.Win32; //****** // Keep in [....] with host\Inc\Registry.hxx namespace MS.Internal { [FriendAccessAllowed] internal static class RegistryKeys { internal const string WPF = @"Software\Microsoft\.NETFramework\Windows Presentation Foundation", WPF_Features = WPF+"\\Features", value_MediaImageDisallow = "MediaImageDisallow", value_MediaVideoDisallow = "MediaVideoDisallow", value_MediaAudioDisallow = "MediaAudioDisallow", value_WebBrowserDisallow = "WebBrowserDisallow", value_ScriptInteropDisallow = "ScriptInteropDisallow", value_AutomationWeakReferenceDisallow = "AutomationWeakReferenceDisallow", WPF_Hosting = WPF+"\\Hosting", value_DisableXbapErrorPage = "DisableXbapErrorPage", value_UnblockWebBrowserControl = "UnblockWebBrowserControl", HKCU_XpsViewer = @"HKEY_CURRENT_USER\Software\Microsoft\XPSViewer", value_IsolatedStorageUserQuota = "IsolatedStorageUserQuota", HKLM_XpsViewerLocalServer32 = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID\\{7DDA204B-2097-47C9-8323-C40BB840AE44}\\LocalServer32", HKLM_IetfLanguage = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\IetfLanguage", // These constants are cloned in // wpf\src\Shared\Cpp\Utils.cxx // Should these reg keys change the above file should be also modified to reflect that. FRAMEWORK_RegKey = @"Software\Microsoft\Net Framework Setup\NDP\v4\Client\", FRAMEWORK_RegKey_FullPath = @"HKEY_LOCAL_MACHINE\" + FRAMEWORK_RegKey, FRAMEWORK_InstallPath_RegValue = "InstallPath"; ////// Critical: Reads an arbitrary registry key. /// [SecurityCritical] internal static bool ReadLocalMachineBool(string key, string valueName) { string keyPath = "HKEY_LOCAL_MACHINE\\" + key; new RegistryPermission(RegistryPermissionAccess.Read, keyPath).Assert(); object value = Registry.GetValue(keyPath, valueName, null); return value is int && (int)value != 0; } }; } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TraceSwitch.cs
- XmlObjectSerializerContext.cs
- FontFaceLayoutInfo.cs
- HideDisabledControlAdapter.cs
- MimeWriter.cs
- CodeDirectionExpression.cs
- WebEventTraceProvider.cs
- MsmqIntegrationBindingElement.cs
- WindowPattern.cs
- DialogBaseForm.cs
- BoundColumn.cs
- Error.cs
- OrthographicCamera.cs
- CounterSampleCalculator.cs
- Preprocessor.cs
- TextSearch.cs
- ProgressBar.cs
- ScrollData.cs
- future.cs
- TransformCollection.cs
- SoapInteropTypes.cs
- UInt32.cs
- ListenerElementsCollection.cs
- CharacterHit.cs
- Predicate.cs
- PropertyPath.cs
- ADConnectionHelper.cs
- HtmlInputImage.cs
- CqlQuery.cs
- RecognizedAudio.cs
- Size3DConverter.cs
- CustomAttributeSerializer.cs
- IisTraceListener.cs
- AddingNewEventArgs.cs
- ValueUnavailableException.cs
- HttpEncoderUtility.cs
- DataRelationPropertyDescriptor.cs
- Missing.cs
- SingleAnimationBase.cs
- WebHttpElement.cs
- CompoundFileReference.cs
- Byte.cs
- AppLevelCompilationSectionCache.cs
- BlockingCollection.cs
- IncrementalReadDecoders.cs
- DataTemplateKey.cs
- WebResponse.cs
- ValueTypeFieldReference.cs
- DataSourceControlBuilder.cs
- DataGridViewColumnStateChangedEventArgs.cs
- RotationValidation.cs
- HttpWebResponse.cs
- PropertyOverridesTypeEditor.cs
- ExpandSegment.cs
- DateTimeOffsetStorage.cs
- LinkDescriptor.cs
- DropDownList.cs
- GregorianCalendarHelper.cs
- SecurityUtils.cs
- MaskedTextBoxDesignerActionList.cs
- WindowsImpersonationContext.cs
- XpsImageSerializationService.cs
- SemanticResultKey.cs
- Directory.cs
- _ChunkParse.cs
- Form.cs
- SqlDependency.cs
- NetworkStream.cs
- KeyValuePair.cs
- BitVec.cs
- ValidationErrorCollection.cs
- StickyNoteAnnotations.cs
- TrustLevelCollection.cs
- SqlConnectionHelper.cs
- CollectionBase.cs
- Canvas.cs
- GuidelineSet.cs
- StylusTip.cs
- SpeakProgressEventArgs.cs
- SqlRowUpdatingEvent.cs
- MemberPathMap.cs
- ComponentManagerBroker.cs
- HttpStreamXmlDictionaryReader.cs
- TrustLevel.cs
- BaseCollection.cs
- Help.cs
- Light.cs
- WorkflowMessageEventHandler.cs
- VisualStyleElement.cs
- ReaderContextStackData.cs
- XComponentModel.cs
- MessageContractExporter.cs
- AttachedPropertyBrowsableAttribute.cs
- TypeLibConverter.cs
- DbConnectionPoolGroupProviderInfo.cs
- MessageLoggingFilterTraceRecord.cs
- UniqueConstraint.cs
- PersistenceTypeAttribute.cs
- AccessKeyManager.cs
- VideoDrawing.cs