1 // System.Runtime.InteropServices.Marshal
3 // Sean MacIsaac (macisaac@ximian.com)
4 // Paolo Molaro (lupus@ximian.com)
6 // (C) 2001-2002 Ximian, Inc.
8 using System.Runtime.CompilerServices;
10 using System.Reflection;
11 using System.Threading;
13 namespace System.Runtime.InteropServices
15 public sealed class Marshal
18 public static readonly int SystemMaxDBCSCharSize = 2; // don't know what this is
19 public static readonly int SystemDefaultCharSize = 2;
24 public static int AddRef (IntPtr pUnk) {
25 throw new NotImplementedException ();
28 public static IntPtr AllocCoTaskMem (int cb) {
29 throw new NotImplementedException ();
32 [MethodImplAttribute(MethodImplOptions.InternalCall)]
33 public extern static IntPtr AllocHGlobal (IntPtr cb);
35 public static IntPtr AllocHGlobal (int cb) {
36 return AllocHGlobal (cb);
40 public static object BindToMoniker (string monikerName) {
41 throw new NotImplementedException ();
45 public static void ChangeWrapperHandleStrength (object otp, bool fIsWeak) {
46 throw new NotImplementedException ();
50 public static void Copy (byte[] source, int startIndex, IntPtr destination, int length) {
51 throw new NotImplementedException ();
55 public static void Copy (char[] source, int startIndex, IntPtr destination, int length) {
56 throw new NotImplementedException ();
60 public static void Copy (short[] source, int startIndex, IntPtr destination, int length) {
61 throw new NotImplementedException ();
65 public static void Copy (int[] source, int startIndex, IntPtr destination, int length) {
66 throw new NotImplementedException ();
70 public static void Copy (long[] source, int startIndex, IntPtr destination, int length) {
71 throw new NotImplementedException ();
75 public static void Copy (float[] source, int startIndex, IntPtr destination, int length) {
76 throw new NotImplementedException ();
80 public static void Copy (double[] source, int startIndex, IntPtr destination, int length) {
81 throw new NotImplementedException ();
85 public static void Copy (IntPtr source, byte[] destination, int startIndex, int length) {
86 throw new NotImplementedException ();
90 public static void Copy (IntPtr source, char[] destination, int startIndex, int length) {
91 throw new NotImplementedException ();
95 public static void Copy (IntPtr source, short[] destination, int startIndex, int length) {
96 throw new NotImplementedException ();
100 public static void Copy (IntPtr source, int[] destination, int startIndex, int length) {
101 throw new NotImplementedException ();
105 public static void Copy (IntPtr source, long[] destination, int startIndex, int length) {
106 throw new NotImplementedException ();
110 public static void Copy (IntPtr source, float[] destination, int startIndex, int length) {
111 throw new NotImplementedException ();
115 public static void Copy (IntPtr source, double[] destination, int startIndex, int length) {
116 throw new NotImplementedException ();
120 public static object CreateWrapperOfType (object o, Type t) {
121 throw new NotImplementedException ();
125 public static void DestroyStructure (IntPtr ptr, Type structuretype) {
126 throw new NotImplementedException ();
130 public static void FreeBSTR (IntPtr ptr) {
131 throw new NotImplementedException ();
135 public static void FreeCoTaskMem (IntPtr ptr) {
136 throw new NotImplementedException ();
139 [MethodImplAttribute(MethodImplOptions.InternalCall)]
140 public extern static void FreeHGlobal (IntPtr hglobal);
143 public static Guid GenerateGuidForType (Type type) {
144 throw new NotImplementedException ();
148 public static string GenerateProgIdForType (Type type) {
149 throw new NotImplementedException ();
153 public static object GetActiveObject (string progID) {
154 throw new NotImplementedException ();
158 public static IntPtr GetComInterfaceForObject (object o, Type T) {
159 throw new NotImplementedException ();
163 public static object GetComObjectData (object obj, object key) {
164 throw new NotImplementedException ();
168 public static int GetComSlotForMethodInfo (MemberInfo m) {
169 throw new NotImplementedException ();
173 public static int GetEndComSlot (Type t) {
174 throw new NotImplementedException ();
178 public static int GetExceptionCode() {
179 throw new NotImplementedException ();
183 public static IntPtr GetExceptionPointers() {
184 throw new NotImplementedException ();
188 public static IntPtr GetHINSTANCE (Module m) {
189 throw new NotImplementedException ();
193 public static int GetHRForException (Exception e) {
194 throw new NotImplementedException ();
198 public static int GetHRForLastWin32Error() {
199 throw new NotImplementedException ();
203 public static IntPtr GetIDispatchForObject (object o) {
204 throw new NotImplementedException ();
208 public static IntPtr GetITypeInfoForType (Type t) {
209 throw new NotImplementedException ();
213 public static IntPtr GetIUnknownForObject (object o) {
214 throw new NotImplementedException ();
217 [MethodImplAttribute(MethodImplOptions.InternalCall)]
218 public static extern int GetLastWin32Error();
221 public static IntPtr GetManagedThunkForUnmanagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature) {
222 throw new NotImplementedException ();
226 public static MemberInfo GetMethodInfoForComSlot (Type t, int slot, ref ComMemberType memberType) {
227 throw new NotImplementedException ();
231 public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant) {
232 throw new NotImplementedException ();
236 public static object GetObjectForIUnknown (IntPtr pUnk) {
237 throw new NotImplementedException ();
241 public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant) {
242 throw new NotImplementedException ();
246 public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars) {
247 throw new NotImplementedException ();
251 public static int GetStartComSlot (Type t) {
252 throw new NotImplementedException ();
256 public static Thread GetThreadFromFiberCookie (int cookie) {
257 throw new NotImplementedException ();
261 public static object GetTypedObjectForIUnknown (IntPtr pUnk, Type t) {
262 throw new NotImplementedException ();
266 public static Type GetTypeForITypeInfo (IntPtr piTypeInfo) {
267 throw new NotImplementedException ();
271 public static string GetTypeInfoName (UCOMITypeInfo pTI) {
272 throw new NotImplementedException ();
276 public static Guid GetTypeLibGuid (UCOMITypeLib pTLB) {
277 throw new NotImplementedException ();
281 public static Guid GetTypeLibGuidForAssembly (Assembly asm) {
282 throw new NotImplementedException ();
286 public static int GetTypeLibLcid (UCOMITypeLib pTLB) {
287 throw new NotImplementedException ();
291 public static string GetTypeLibName (UCOMITypeLib pTLB) {
292 throw new NotImplementedException ();
296 public static IntPtr GetUnmanagedThunkForManagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature) {
297 throw new NotImplementedException ();
301 public static bool IsComObject (object o) {
302 throw new NotImplementedException ();
306 public static bool IsTypeVisibleFromCom (Type t) {
307 throw new NotImplementedException ();
311 public static int NumParamBytes (MethodInfo m) {
312 throw new NotImplementedException ();
316 public static IntPtr OffsetOf (Type t, string fieldName) {
317 throw new NotImplementedException ();
321 public static void Prelink (MethodInfo m) {
322 throw new NotImplementedException ();
326 public static void PrelinkAll (Type c) {
327 throw new NotImplementedException ();
331 public static string PtrToStringAnsi (IntPtr ptr) {
332 throw new NotImplementedException ();
336 public static string PtrToStringAnsi (IntPtr ptr, int len) {
337 throw new NotImplementedException ();
341 public static string PtrToStringAuto (IntPtr ptr, int len) {
342 throw new NotImplementedException ();
345 [MethodImplAttribute(MethodImplOptions.InternalCall)]
346 public static extern string PtrToStringAuto (IntPtr ptr);
349 public static string PtrToStringBSTR (IntPtr ptr) {
350 throw new NotImplementedException ();
354 public static string PtrToStringUni (IntPtr ptr) {
355 throw new NotImplementedException ();
359 public static string PtrToStringUni (IntPtr ptr, int len) {
360 throw new NotImplementedException ();
364 public static void PtrToStructure (IntPtr ptr, object structure) {
365 throw new NotImplementedException ();
369 public static object PtrToStructure (IntPtr ptr, Type structureType) {
370 throw new NotImplementedException ();
374 public static int QueryInterface (IntPtr pUnk, ref Guid iid, out IntPtr ppv) {
375 throw new NotImplementedException ();
378 public static byte ReadByte (IntPtr ptr) {
379 return ReadByte (ptr, 0);
382 [MethodImplAttribute(MethodImplOptions.InternalCall)]
383 public extern static byte ReadByte (IntPtr ptr, int ofs);
386 public static byte ReadByte (object ptr, int ofs) {
387 throw new NotImplementedException ();
390 public static short ReadInt16 (IntPtr ptr) {
391 return ReadInt16 (ptr, 0);
394 [MethodImplAttribute(MethodImplOptions.InternalCall)]
395 public extern static short ReadInt16 (IntPtr ptr, int ofs);
398 public static short ReadInt16 (object ptr, int ofs) {
399 throw new NotImplementedException ();
402 public static int ReadInt32 (IntPtr ptr) {
403 return ReadInt32 (ptr, 0);
406 [MethodImplAttribute(MethodImplOptions.InternalCall)]
407 public extern static int ReadInt32 (IntPtr ptr, int ofs);
410 public static int ReadInt32 (object ptr, int ofs) {
411 throw new NotImplementedException ();
414 public static long ReadInt64 (IntPtr ptr) {
415 return ReadInt64 (ptr, 0);
418 [MethodImplAttribute(MethodImplOptions.InternalCall)]
419 public extern static long ReadInt64 (IntPtr ptr, int ofs);
422 public static long ReadInt64(object ptr, int ofs) {
423 throw new NotImplementedException ();
426 public static IntPtr ReadIntPtr (IntPtr ptr) {
427 return ReadIntPtr (ptr, 0);
430 [MethodImplAttribute(MethodImplOptions.InternalCall)]
431 public extern static IntPtr ReadIntPtr (IntPtr ptr, int ofs);
434 public static IntPtr ReadIntPtr(object ptr, int ofs) {
435 throw new NotImplementedException ();
439 public static IntPtr ReAllocCoTaskMem (IntPtr pv, int cb) {
440 throw new NotImplementedException ();
443 [MethodImplAttribute(MethodImplOptions.InternalCall)]
444 public extern static IntPtr ReAllocHGlobal (IntPtr pv, IntPtr cb);
447 public static int Release (IntPtr pUnk) {
448 throw new NotImplementedException ();
452 public static int ReleaseComObject (object o) {
453 throw new NotImplementedException ();
457 public static void ReleaseThreadCache() {
458 throw new NotImplementedException ();
462 public static bool SetComObjectData (object obj, object key, object data) {
463 throw new NotImplementedException ();
466 public static int SizeOf (object structure) {
467 return SizeOf (structure.GetType ());
471 public static int SizeOf (Type t) {
472 throw new NotImplementedException ();
476 public static IntPtr StringToBSTR (string s) {
477 throw new NotImplementedException ();
481 public static IntPtr StringToCoTaskMemAnsi (string s) {
482 throw new NotImplementedException ();
486 public static IntPtr StringToCoTaskMemAuto (string s) {
487 throw new NotImplementedException ();
491 public static IntPtr StringToCoTaskMemUni (string s) {
492 throw new NotImplementedException ();
496 public static IntPtr StringToHGlobalAnsi (string s) {
497 throw new NotImplementedException ();
501 public static IntPtr StringToHGlobalAuto (string s) {
502 throw new NotImplementedException ();
506 public static IntPtr StringToHGlobalUni (string s) {
507 throw new NotImplementedException ();
511 public static void StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld) {
512 throw new NotImplementedException ();
516 public static void ThrowExceptionForHR (int errorCode) {
517 throw new NotImplementedException ();
521 public static void ThrowExceptionForHR (int errorCode, IntPtr errorInfo) {
522 throw new NotImplementedException ();
526 public static IntPtr UnsafeAddrOfPinnedArrayElement (Array arr, int index) {
527 throw new NotImplementedException ();
530 public static void WriteByte (IntPtr ptr, byte val) {
531 WriteByte (ptr, 0, val);
534 [MethodImplAttribute(MethodImplOptions.InternalCall)]
535 public extern static void WriteByte (IntPtr ptr, int ofs, byte val);
538 public static void WriteByte(object ptr, int ofs, byte val) {
539 throw new NotImplementedException ();
542 public static void WriteInt16 (IntPtr ptr, short val) {
543 WriteInt16 (ptr, 0, val);
546 [MethodImplAttribute(MethodImplOptions.InternalCall)]
547 public extern static void WriteInt16 (IntPtr ptr, int ofs, short val);
550 public static void WriteInt16(object ptr, int ofs, short val) {
551 throw new NotImplementedException ();
554 public static void WriteInt32 (IntPtr ptr, int val) {
555 WriteInt32 (ptr, 0, val);
558 [MethodImplAttribute(MethodImplOptions.InternalCall)]
559 public extern static void WriteInt32 (IntPtr ptr, int ofs, int val);
562 public static void WriteInt32(object ptr, int ofs, int val) {
563 throw new NotImplementedException ();
566 public static void WriteInt64 (IntPtr ptr, long val) {
567 WriteInt64 (ptr, 0, val);
570 [MethodImplAttribute(MethodImplOptions.InternalCall)]
571 public extern static void WriteInt64 (IntPtr ptr, int ofs, long val);
574 public static void WriteInt64(object ptr, int ofs, long val) {
575 throw new NotImplementedException ();
578 public static void WriteIntPtr (IntPtr ptr, IntPtr val) {
579 WriteIntPtr (ptr, 0, val);
582 [MethodImplAttribute(MethodImplOptions.InternalCall)]
583 public extern static void WriteIntPtr (IntPtr ptr, int ofs, IntPtr val);
586 public static void WriteIntPtr(object ptr, int ofs, IntPtr val) {
587 throw new NotImplementedException ();