Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / NativeMethods.cs / 1305376 / NativeMethods.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Runtime.InteropServices; using System.Runtime.ConstrainedExecution; using System.ComponentModel; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // For common & resources // using Microsoft.InfoCards; internal static class NativeMethods { public static IntPtr GetProcAddressWrapper( SafeLibraryHandle implDll, string procName ) { IntPtr procaddr = NativeMethods.GetProcAddress( implDll, procName ); if ( IntPtr.Zero == procaddr ) { // // We'll get the last error's message using Win32Exception // Adding the procName gives more context. // ThrowWin32ExceptionWithContext( new Win32Exception(), procName ); } return procaddr; } public static Win32Exception ThrowWin32ExceptionWithContext( Win32Exception wex, string context ) { throw IDT.ThrowHelperError( new Win32Exception( wex.NativeErrorCode, SR.GetString( SR.ClientAPIDetailedExceptionMessage, wex.Message, context ) ) ); } [DllImport( "kernel32.dll" , CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true, CallingConvention = CallingConvention.StdCall )] private static extern IntPtr GetProcAddress( SafeLibraryHandle hModule, [MarshalAs( UnmanagedType.LPStr )] string procname ); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Transactions.cs
- EdmToObjectNamespaceMap.cs
- ContentElement.cs
- StatusBarItem.cs
- XmlSchemaSimpleContentRestriction.cs
- XamlReaderHelper.cs
- WebMessageEncodingElement.cs
- AssemblyResourceLoader.cs
- IdentityHolder.cs
- TrimSurroundingWhitespaceAttribute.cs
- ImageList.cs
- HttpServerUtilityBase.cs
- IDReferencePropertyAttribute.cs
- ResourceKey.cs
- TextBoxRenderer.cs
- ObjectSecurity.cs
- ToolboxSnapDragDropEventArgs.cs
- BitmapEffectInput.cs
- ServicesUtilities.cs
- Calendar.cs
- SessionPageStatePersister.cs
- hresults.cs
- Operand.cs
- EUCJPEncoding.cs
- RegexGroupCollection.cs
- RawStylusActions.cs
- XmlMembersMapping.cs
- MachineKeySection.cs
- QuaternionAnimationBase.cs
- CompositeScriptReferenceEventArgs.cs
- SqlDataRecord.cs
- X509ChainPolicy.cs
- CorePropertiesFilter.cs
- ServiceProviders.cs
- EndOfStreamException.cs
- PersistenceTask.cs
- DeclaredTypeElementCollection.cs
- PageSetupDialog.cs
- SimpleApplicationHost.cs
- ListBox.cs
- ClientData.cs
- FrameworkElementAutomationPeer.cs
- OdbcConnectionOpen.cs
- LayoutEvent.cs
- SessionStateItemCollection.cs
- CompleteWizardStep.cs
- XmlChildEnumerator.cs
- EventHandlers.cs
- PtsHelper.cs
- UIPermission.cs
- HttpRuntime.cs
- ExpressionValueEditor.cs
- TextBoxAutoCompleteSourceConverter.cs
- CorrelationManager.cs
- WebPartMinimizeVerb.cs
- X509Certificate2.cs
- MustUnderstandSoapException.cs
- RowBinding.cs
- SQLSingleStorage.cs
- LinqDataSourceHelper.cs
- AssemblyBuilderData.cs
- ContextMenuService.cs
- TableLayoutPanelDesigner.cs
- ToolboxBitmapAttribute.cs
- ExceptionRoutedEventArgs.cs
- CustomAttribute.cs
- TdsRecordBufferSetter.cs
- KerberosSecurityTokenProvider.cs
- RelationshipFixer.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- NamedPipeTransportElement.cs
- UrlMapping.cs
- Parsers.cs
- ItemCheckEvent.cs
- EditorResources.cs
- TrustLevelCollection.cs
- mansign.cs
- TextEditorTyping.cs
- ServicePerformanceCounters.cs
- SvcMapFileLoader.cs
- MatrixCamera.cs
- FileSecurity.cs
- ReplacementText.cs
- TreeIterator.cs
- AuthorizationRule.cs
- LocatorPart.cs
- BooleanKeyFrameCollection.cs
- EntryWrittenEventArgs.cs
- SortFieldComparer.cs
- DataGridViewImageColumn.cs
- Section.cs
- SafeHandles.cs
- ComContractElement.cs
- BinaryObjectReader.cs
- NumberSubstitution.cs
- StringCollection.cs
- Timer.cs
- ReadOnlyDataSource.cs
- SoapDocumentServiceAttribute.cs
- TextOutput.cs