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
- XmlQueryOutput.cs
- TextLine.cs
- _LocalDataStore.cs
- PreviewPageInfo.cs
- GeneralTransformGroup.cs
- ConfigXmlWhitespace.cs
- LongSumAggregationOperator.cs
- ErrorWebPart.cs
- AuthenticateEventArgs.cs
- HwndProxyElementProvider.cs
- OdbcConnectionFactory.cs
- BamlRecordHelper.cs
- GuidTagList.cs
- XmlSerializerSection.cs
- HttpRequest.cs
- SqlDataSourceConnectionPanel.cs
- DbConvert.cs
- DynamicValidator.cs
- QueryCacheManager.cs
- ConfigurationValidatorBase.cs
- FigureParaClient.cs
- LogConverter.cs
- Composition.cs
- MetaTableHelper.cs
- ScriptingWebServicesSectionGroup.cs
- SQLDouble.cs
- ListViewItem.cs
- EntityFunctions.cs
- SvcMapFileSerializer.cs
- WebBrowserUriTypeConverter.cs
- InternalRelationshipCollection.cs
- BaseDataBoundControl.cs
- ContextMenuStripActionList.cs
- ScalarConstant.cs
- ListView.cs
- EncoderReplacementFallback.cs
- OledbConnectionStringbuilder.cs
- BinaryObjectInfo.cs
- Menu.cs
- OptimizedTemplateContentHelper.cs
- DataObjectAttribute.cs
- UpDownEvent.cs
- CharacterBufferReference.cs
- DBConnection.cs
- PersonalizationStateInfo.cs
- DockingAttribute.cs
- XmlBinaryWriterSession.cs
- CodeTypeMember.cs
- FastPropertyAccessor.cs
- XmlDomTextWriter.cs
- SafeCryptHandles.cs
- ContentControl.cs
- PageCatalogPart.cs
- ExcCanonicalXml.cs
- RoutedEventConverter.cs
- ImplicitInputBrush.cs
- ImageConverter.cs
- PropertySourceInfo.cs
- HiddenField.cs
- ReflectPropertyDescriptor.cs
- UrlPath.cs
- ExtendedProperty.cs
- ReaderWriterLock.cs
- DLinqAssociationProvider.cs
- PropertyPath.cs
- ColorConverter.cs
- OleDbWrapper.cs
- UpdatePanelTriggerCollection.cs
- BinaryObjectWriter.cs
- SafeCancelMibChangeNotify.cs
- FormsAuthenticationUserCollection.cs
- CompilerResults.cs
- TextServicesDisplayAttributePropertyRanges.cs
- Msec.cs
- ContainerParagraph.cs
- HandlerMappingMemo.cs
- NavigationExpr.cs
- ConstructorBuilder.cs
- FormClosedEvent.cs
- UseManagedPresentationBindingElementImporter.cs
- XamlBrushSerializer.cs
- DtdParser.cs
- RectConverter.cs
- AssemblyNameEqualityComparer.cs
- ProfessionalColorTable.cs
- ObjectItemConventionAssemblyLoader.cs
- TreeWalkHelper.cs
- ContextItem.cs
- Duration.cs
- BrowserDefinition.cs
- WebPartActionVerb.cs
- PrintPreviewGraphics.cs
- DocumentReferenceCollection.cs
- AdornerHitTestResult.cs
- PreProcessor.cs
- ImageBrush.cs
- FileReader.cs
- ValueType.cs
- InstanceOwnerQueryResult.cs
- ToolboxComponentsCreatedEventArgs.cs