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
- Decimal.cs
- FileVersionInfo.cs
- BrowserCapabilitiesCompiler.cs
- EntityExpressionVisitor.cs
- DrawToolTipEventArgs.cs
- VisualProxy.cs
- PanelStyle.cs
- XmlSchemaAppInfo.cs
- IconConverter.cs
- PropertyKey.cs
- Helpers.cs
- LineMetrics.cs
- SelectionPattern.cs
- CodeCastExpression.cs
- FixedDocument.cs
- CodeExpressionRuleDeclaration.cs
- EntitySet.cs
- OleDbException.cs
- MgmtResManager.cs
- DbConnectionPool.cs
- PeerContact.cs
- QueryOpeningEnumerator.cs
- OracleBoolean.cs
- NestPullup.cs
- OleCmdHelper.cs
- HMACRIPEMD160.cs
- UserPersonalizationStateInfo.cs
- DataGridColumnCollection.cs
- XPathMultyIterator.cs
- ResXResourceReader.cs
- MissingMethodException.cs
- EditingCommands.cs
- XPathException.cs
- BitStack.cs
- XsltSettings.cs
- BindingObserver.cs
- ProcessMonitor.cs
- LambdaCompiler.ControlFlow.cs
- ReceiveParametersContent.cs
- PeerNameRecordCollection.cs
- CacheMode.cs
- DbConnectionStringBuilder.cs
- ElementNotEnabledException.cs
- ClientUIRequest.cs
- ObjectPersistData.cs
- PrePrepareMethodAttribute.cs
- DocumentReferenceCollection.cs
- CapabilitiesUse.cs
- SecurityException.cs
- EditingMode.cs
- RemotingSurrogateSelector.cs
- BamlBinaryReader.cs
- CachedCompositeFamily.cs
- FixedBufferAttribute.cs
- SystemEvents.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- InfoCardListRequest.cs
- VisualStyleElement.cs
- HTTPNotFoundHandler.cs
- JpegBitmapEncoder.cs
- OlePropertyStructs.cs
- RootBuilder.cs
- Unit.cs
- dataSvcMapFileLoader.cs
- WorkflowRuntimeServicesBehavior.cs
- Collection.cs
- SafeHandles.cs
- dbdatarecord.cs
- ParseElementCollection.cs
- OverflowException.cs
- HashStream.cs
- TemplateParser.cs
- SplineKeyFrames.cs
- cookiecollection.cs
- PowerEase.cs
- Geometry3D.cs
- ConfigurationFileMap.cs
- NameValuePermission.cs
- UrlUtility.cs
- ExpressionPrinter.cs
- AppDomainManager.cs
- IBuiltInEvidence.cs
- IndependentAnimationStorage.cs
- TextSelectionProcessor.cs
- PropertyPathWorker.cs
- BamlLocalizableResourceKey.cs
- InstanceDataCollection.cs
- EncryptedReference.cs
- DefaultValueAttribute.cs
- DeclarativeCatalogPart.cs
- StorageAssociationTypeMapping.cs
- ColumnMap.cs
- PageEventArgs.cs
- glyphs.cs
- BroadcastEventHelper.cs
- WebHttpSecurity.cs
- DbConnectionInternal.cs
- WindowsSecurityToken.cs
- ListViewInsertionMark.cs
- DrawListViewSubItemEventArgs.cs