fork(1) download
  1. using System;
  2.  
  3. public class DllImportAttribute : Attribute
  4. {
  5. public DllImportAttribute(string filename)
  6. {
  7. }
  8.  
  9. public string EntryPoint { get; set; }
  10. }
  11.  
  12. public struct CAPDRIVERCAPS
  13. {
  14. }
  15.  
  16. public class Test
  17. {
  18. [DllImport("User32.dll", EntryPoint = "SendMessage")]
  19. private static extern bool SendMsgB<T>(IntPtr hWnd, int Msg, int wParam, ref T lParam) where T : struct;
  20.  
  21. public static bool capDriverGetCaps(IntPtr hwnd, ref CAPDRIVERCAPS psCaps, int wSize)
  22. {
  23. return SendMsgB(hwnd, WM_CAP_DRIVER_GET_CAPS, wSize, ref psCaps);
  24. }
  25.  
  26. const int WM_CAP_DRIVER_GET_CAPS = 4711;
  27.  
  28. public static void Main()
  29. {
  30. CAPDRIVERCAPS cdc;
  31. capDriverGetCaps(IntPtr.Zero, ref cdc, 0);
  32. }
  33. }
Runtime error #stdin #stdout #stderr 0.01s 134848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Unhandled Exception:
System.BadImageFormatException: Method has zero rva
File name: 'prog'
  at Test.capDriverGetCaps (System.IntPtr hwnd, CAPDRIVERCAPS& psCaps, System.Int32 wSize) [0x00000] in <8b7a57dfee5a4838914af7ca54c5fc1b>:0 
  at Test.Main () [0x00000] in <8b7a57dfee5a4838914af7ca54c5fc1b>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Method has zero rva
File name: 'prog'
  at Test.capDriverGetCaps (System.IntPtr hwnd, CAPDRIVERCAPS& psCaps, System.Int32 wSize) [0x00000] in <8b7a57dfee5a4838914af7ca54c5fc1b>:0 
  at Test.Main () [0x00000] in <8b7a57dfee5a4838914af7ca54c5fc1b>:0