The Labs \ Source Viewer \ SSCLI \ System.Runtime.InteropServices \ PInvokeMap

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. ////////////////////////////////////////////////////////////////////////////////
  16. ////////////////////////////////////////////////////////////////////////////////
  17. //
  18. // PInvokeMap is an enum that defines the PInvoke attributes. These
  19. // values are defined in CorHdr.h.
  20. //
  21. // Date: Sep 99
  22. //
  23. namespace System.Runtime.InteropServices
  24. {
  25.     using System.Runtime.InteropServices;
  26.     using System;
  27.    
  28.     // This Enum matchs the CorPinvokeMap defined in CorHdr.h
  29.     [Serializable()]
  30.     internal enum PInvokeMap
  31.     {
  32.         NoMangle = 1,
  33.         // Pinvoke is to use the member name as specified.
  34.         CharSetMask = 6,
  35.         // Heuristic used in data type & name mapping.
  36.         CharSetNotSpec = 0,
  37.         CharSetAnsi = 2,
  38.         CharSetUnicode = 4,
  39.         CharSetAuto = 6,
  40.        
  41.         PinvokeOLE = 32,
  42.         // Heuristic: pinvoke will return hresult, with return value becoming the retval param. Not relevant for fields.
  43.         SupportsLastError = 64,
  44.         // Information about target function. Not relevant for fields.
  45.         BestFitMask = 48,
  46.         BestFitEnabled = 16,
  47.         BestFitDisabled = 32,
  48.         BestFitUseAsm = 48,
  49.        
  50.         ThrowOnUnmappableCharMask = 12288,
  51.         ThrowOnUnmappableCharEnabled = 4096,
  52.         ThrowOnUnmappableCharDisabled = 8192,
  53.         ThrowOnUnmappableCharUseAsm = 12288,
  54.        
  55.         // None of the calling convention flags is relevant for fields.
  56.         CallConvMask = 1792,
  57.         CallConvWinapi = 256,
  58.         // Pinvoke will use native callconv appropriate to target windows platform.
  59.         CallConvCdecl = 512,
  60.         CallConvStdcall = 768,
  61.         CallConvThiscall = 1024,
  62.         // In M9, pinvoke will raise exception.
  63.         CallConvFastcall = 1280
  64.     }
  65. }

Developer Fusion