Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Input / Stylus / PenThread.cs / 2 / PenThread.cs
//#define TRACE using System; using System.Diagnostics; using System.Collections; using System.Collections.ObjectModel; using System.Runtime.InteropServices; using System.Windows.Threading; using System.Threading; using System.Security; using System.Security.Permissions; using MS.Internal; using MS.Internal.PresentationCore; // SecurityHelper using MS.Win32.Penimc; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ///////////////////////////////////////////////////////////////////////// internal sealed class PenThread { private PenThreadWorker _penThreadWorker; ////// Critical - Calls SecurityCritical code PenThreadWorker constructor. /// Called by PenThreadPool.RegisterPenContextHelper. /// TreatAsSafe boundry is Stylus.EnableCore, Stylus.RegisterHwndForInput /// and HwndWrapperHook class (via HwndSource.InputFilterMessage). /// [SecurityCritical] internal PenThread() { _penThreadWorker = new PenThreadWorker(); } ////// Dispose /// internal void Dispose() { DisposeHelper(); } ///////////////////////////////////////////////////////////////////// ~PenThread() { DisposeHelper(); } ///////////////////////////////////////////////////////////////////// ////// Critical - Call security critical method PenThreadWorker.Dispose(). /// TreatAsSafe - Safe since it only frees internal private handle /// on an object that is going to be also marked as disposed and /// start failing all calls after return. /// [SecurityCritical, SecurityTreatAsSafe] void DisposeHelper() { // NOTE: PenThreadWorker deals with already being disposed logic. _penThreadWorker.Dispose(); GC.KeepAlive(this); } ///////////////////////////////////////////////////////////////////// ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerAddPenContext. /// Called by PenThreadPool.RegisterPenContextHelper. /// TreatAsSafe boundry is Stylus.EnableCore, Stylus.RegisterHwndForInput /// and HwndWrapperHook class (via HwndSource.InputFilterMessage). /// [SecurityCritical] internal bool AddPenContext(PenContext penContext) { return _penThreadWorker.WorkerAddPenContext(penContext); } ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerRemovePenContext. /// Called by PenContext.Disable. /// TreatAsSafe boundry is PenContext.Dispose, Stylus.ProcessDisplayChange /// and HwndWrapperHook class (via HwndSource.InputFilterMessage). /// [SecurityCritical] internal bool RemovePenContext(PenContext penContext) { return _penThreadWorker.WorkerRemovePenContext(penContext); } ///////////////////////////////////////////////////////////////////// ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerGetTabletsInfo. /// Called by PenThreadPool.WorkerGetTabletsInfo. /// [SecurityCritical] internal TabletDeviceInfo[] WorkerGetTabletsInfo() { return _penThreadWorker.WorkerGetTabletsInfo(); } ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerCreateContext. /// Called by PenThreadPool.WorkerCreateContext. /// TreatAsSafe boundry is Stylus.EnableCore and HwndWrapperHook class /// (via HwndSource.InputFilterMessage). /// [SecurityCritical] internal PenContextInfo WorkerCreateContext(IntPtr hwnd, IPimcTablet pimcTablet) { return _penThreadWorker.WorkerCreateContext(hwnd, pimcTablet); } ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerRefreshCursorInfo. /// Called by PenThreadPool.WorkerRefreshCursorInfo. /// [SecurityCritical] internal StylusDeviceInfo[] WorkerRefreshCursorInfo(IPimcTablet pimcTablet) { return _penThreadWorker.WorkerRefreshCursorInfo(pimcTablet); } ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerGetTabletInfo. /// Called by PenThreadPool.WorkerGetTabletInfo. /// [SecurityCritical] internal TabletDeviceInfo WorkerGetTabletInfo(uint index) { return _penThreadWorker.WorkerGetTabletInfo(index); } ////// Critical - Calls SecurityCritical code PenThreadWorker.WorkerGetUpdatedSizes. /// Called by PenThreadPool.WorkerGetUpdatedTabletRect. /// [SecurityCritical] internal TabletDeviceSizeInfo WorkerGetUpdatedSizes(IPimcTablet pimcTablet) { return _penThreadWorker.WorkerGetUpdatedSizes(pimcTablet); } } } // 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
- SizeLimitedCache.cs
- ParameterToken.cs
- DummyDataSource.cs
- SeekableReadStream.cs
- ProcessModelInfo.cs
- externdll.cs
- SpeechEvent.cs
- DeviceContext2.cs
- WindowsSolidBrush.cs
- ScrollViewerAutomationPeer.cs
- ProcessInfo.cs
- SettingsSavedEventArgs.cs
- SchemaNamespaceManager.cs
- WebPartHelpVerb.cs
- ViewBase.cs
- ExceptionRoutedEventArgs.cs
- ResourceBinder.cs
- CellRelation.cs
- RemoteWebConfigurationHostServer.cs
- BuildProviderAppliesToAttribute.cs
- LicenseProviderAttribute.cs
- JulianCalendar.cs
- FilterableAttribute.cs
- OLEDB_Util.cs
- FlowLayoutPanel.cs
- StringUtil.cs
- Group.cs
- SQLBoolean.cs
- DocumentReferenceCollection.cs
- DriveInfo.cs
- SeparatorAutomationPeer.cs
- ExternalCalls.cs
- ReadOnlyHierarchicalDataSourceView.cs
- SplineKeyFrames.cs
- InternalBase.cs
- Hash.cs
- CompositeCollectionView.cs
- InstancePersistenceEvent.cs
- DateTimePicker.cs
- IncrementalReadDecoders.cs
- RowVisual.cs
- CodeDOMProvider.cs
- CheckoutException.cs
- Win32Exception.cs
- HybridDictionary.cs
- ExpressionBinding.cs
- MetaChildrenColumn.cs
- WebPartCatalogCloseVerb.cs
- MdImport.cs
- TextDecorationLocationValidation.cs
- XmlSerializerFactory.cs
- StylusTip.cs
- CompilerWrapper.cs
- SystemWebExtensionsSectionGroup.cs
- EventProviderWriter.cs
- BaseCollection.cs
- Rectangle.cs
- SyndicationSerializer.cs
- DataControlExtensions.cs
- SafeLibraryHandle.cs
- StrokeFIndices.cs
- LeaseManager.cs
- ExpressionTable.cs
- LinkLabelLinkClickedEvent.cs
- HttpRuntime.cs
- GenericWebPart.cs
- SafeThreadHandle.cs
- MemberHolder.cs
- QueryCursorEventArgs.cs
- XmlCustomFormatter.cs
- RowToParametersTransformer.cs
- Rotation3D.cs
- Typeface.cs
- OutputScopeManager.cs
- DetailsViewRowCollection.cs
- TextOptions.cs
- PropertyMetadata.cs
- UIElementParaClient.cs
- MD5CryptoServiceProvider.cs
- MemoryStream.cs
- BoundColumn.cs
- Serialization.cs
- DataPointer.cs
- GridViewDeletedEventArgs.cs
- OdbcConnectionHandle.cs
- WebEncodingValidatorAttribute.cs
- SimpleFileLog.cs
- XmlSerializer.cs
- CompositeKey.cs
- BindStream.cs
- _NegotiateClient.cs
- Simplifier.cs
- Script.cs
- Classification.cs
- SoapIncludeAttribute.cs
- InstalledFontCollection.cs
- DesignerSerializationOptionsAttribute.cs
- ConstrainedGroup.cs
- ListInitExpression.cs
- PropertyItemInternal.cs