MobileStubs.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. // help compiles sources for mobile without having unusable
  2. // Windows p/invoke in the assemblies
  3. //
  4. // Copyright 2015 Xamarin Inc.
  5. #if MOBILE
  6. namespace System.Runtime.Interop {
  7. using Microsoft.Win32.SafeHandles;
  8. using System.Runtime.Diagnostics;
  9. using System.Runtime.InteropServices;
  10. using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
  11. sealed class SafeEventLogWriteHandle : SafeHandleZeroOrMinusOneIsInvalid {
  12. SafeEventLogWriteHandle () : base (true)
  13. {
  14. }
  15. public static SafeEventLogWriteHandle RegisterEventSource (string uncServerName, string sourceName)
  16. {
  17. throw new NotImplementedException ();
  18. }
  19. static bool DeregisterEventSource (IntPtr hEventLog)
  20. {
  21. throw new NotImplementedException ();
  22. }
  23. protected override bool ReleaseHandle ()
  24. {
  25. throw new NotImplementedException ();
  26. }
  27. }
  28. static class UnsafeNativeMethods {
  29. public const int ERROR_MORE_DATA = 234;
  30. public const int ERROR_ARITHMETIC_OVERFLOW = 534;
  31. public const int ERROR_NOT_ENOUGH_MEMORY = 8;
  32. [StructLayout (LayoutKind.Explicit, Size = 16)]
  33. public struct EventData {
  34. [FieldOffset(0)]
  35. internal UInt64 DataPointer;
  36. [FieldOffset(8)]
  37. internal uint Size;
  38. [FieldOffset(12)]
  39. internal int Reserved;
  40. }
  41. public static SafeWaitHandle CreateWaitableTimer (IntPtr mustBeZero, bool manualReset, string timerName)
  42. {
  43. throw new NotImplementedException ();
  44. }
  45. public static bool SetWaitableTimer (SafeWaitHandle handle, ref long dueTime, int period, IntPtr mustBeZero, IntPtr mustBeZeroAlso, bool resume)
  46. {
  47. throw new NotImplementedException ();
  48. }
  49. public static int QueryPerformanceCounter (out long time)
  50. {
  51. throw new NotImplementedException ();
  52. }
  53. public static uint GetSystemTimeAdjustment (out int adjustment, out uint increment, out uint adjustmentDisabled)
  54. {
  55. throw new NotImplementedException ();
  56. }
  57. public static void GetSystemTimeAsFileTime (out long time)
  58. {
  59. throw new NotImplementedException ();
  60. }
  61. internal static string GetComputerName (ComputerNameFormat nameType)
  62. {
  63. throw new NotImplementedException ();
  64. }
  65. internal static bool IsDebuggerPresent ()
  66. {
  67. throw new NotImplementedException ();
  68. }
  69. internal static void DebugBreak ()
  70. {
  71. throw new NotImplementedException ();
  72. }
  73. internal static void OutputDebugString (string lpOutputString)
  74. {
  75. throw new NotImplementedException ();
  76. }
  77. internal unsafe delegate void EtwEnableCallback (ref Guid sourceId, int isEnabled, byte level, long matchAnyKeywords, long matchAllKeywords, void* filterData, void* callbackContext);
  78. internal static unsafe uint EventRegister (ref Guid providerId, EtwEnableCallback enableCallback, void* callbackContext, ref long registrationHandle)
  79. {
  80. throw new NotImplementedException ();
  81. }
  82. internal static uint EventUnregister (long registrationHandle)
  83. {
  84. throw new NotImplementedException ();
  85. }
  86. internal static bool EventEnabled (long registrationHandle, ref EventDescriptor eventDescriptor)
  87. {
  88. throw new NotImplementedException ();
  89. }
  90. internal static unsafe uint EventWrite (long registrationHandle, ref EventDescriptor eventDescriptor, uint userDataCount, EventData* userData)
  91. {
  92. throw new NotImplementedException ();
  93. }
  94. internal static unsafe uint EventWriteTransfer (long registrationHandle, ref EventDescriptor eventDescriptor, ref Guid activityId, ref Guid relatedActivityId, uint userDataCount, EventData* userData)
  95. {
  96. throw new NotImplementedException ();
  97. }
  98. internal static unsafe uint EventWriteString (long registrationHandle, byte level, long keywords, char* message)
  99. {
  100. throw new NotImplementedException ();
  101. }
  102. internal static unsafe uint EventActivityIdControl (int ControlCode, ref Guid ActivityId)
  103. {
  104. throw new NotImplementedException ();
  105. }
  106. internal static bool ReportEvent (SafeHandle hEventLog, ushort type, ushort category, uint eventID, byte[] userSID, ushort numStrings, uint dataLen, HandleRef strings, byte[] rawData)
  107. {
  108. throw new NotImplementedException ();
  109. }
  110. internal static SafeEventLogWriteHandle RegisterEventSource (string uncServerName, string sourceName)
  111. {
  112. throw new NotImplementedException ();
  113. }
  114. }
  115. }
  116. #endif