Beispiel #1
0
 public extern static int FormatMessage(
     int dwFlags,
     global::System.IntPtr lpSource,
     uint dwMessageId,
     int dwLanguageId,
     ushort *lpBuffer,
     int nSize,
     global::System.IntPtr *arguments);
Beispiel #2
0
        public unsafe static int WaitForMultipleObjects(
            int nCount,
            global::System.IntPtr *lpHandles,
            bool bWaitAll,
            int dwMilliseconds
            )
        {
            return(Helper.SimpleWrap <int>(
                       delegate(ClrSyncManager manager)
            {
                SyncVar[] v = new SyncVar[nCount];
                for (int i = 0; i < nCount; i++)
                {
                    v[i] = manager.GetSyncVarFromNativeHandle(lpHandles[i]);
                }

                int returnVal;
                while (true)
                {
                    manager.SetMethodInfo(bWaitAll ? "Win32WaitForMultipleObjects::WAIT_ALL" : "Win32WaitForMultipleObjects::WAIT_ANY");
                    manager.AggregateSyncVarAccess(v, bWaitAll ? MSyncVarOp.WAIT_ALL : MSyncVarOp.WAIT_ANY);
                    try
                    {
                        returnVal = OrigNativeMethods.WaitForMultipleObjects(nCount, lpHandles, bWaitAll, 0);
                    }
                    catch (Exception e)
                    {
                        manager.CommitSyncVarAccess();
                        throw e;
                    }
                    if (OrigNativeMethods.WAIT_OBJECT_0 <= returnVal && returnVal <= OrigNativeMethods.WAIT_OBJECT_0 + nCount - 1)
                    {
                        // success
                        manager.CommitSyncVarAccess();
                        return returnVal;
                    }
                    global::System.Diagnostics.Debug.Assert(returnVal == OrigNativeMethods.WAIT_TIMEOUT);
                    if (dwMilliseconds != OrigNativeMethods.INFINITE)
                    {
                        // timeout
                        manager.MarkTimeout();
                        manager.CommitSyncVarAccess();
                        manager.TaskYield();
                        return returnVal;
                    }
                    manager.LocalBacktrack();
                }
            },
                       delegate()
            {
                return OrigNativeMethods.WaitForMultipleObjects(nCount, lpHandles, bWaitAll, dwMilliseconds);
            }));
        }
		public static int RhCompatibleReentrantWaitAny(
					int alertable, 
					int timeout, 
					int count, 
					global::System.IntPtr* handles)
		{
			// Setup
			int unsafe___value;
			// Marshalling
			// Call to native method
			unsafe___value = global::McgInterop._MRT__PInvokes.RhCompatibleReentrantWaitAny(
								alertable, 
								timeout, 
								count, 
								((global::System.IntPtr*)handles)
							);
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			// Return
			return unsafe___value;
		}
Beispiel #4
0
 public extern static int CoCreateInstance(
     byte *rclsid,
     global::System.IntPtr pUnkOuter,
     int dwClsContext,
     byte *riid,
     global::System.IntPtr *ppv);
Beispiel #5
0
 public extern static void CallingConventionConverter_GetStubs(
     global::System.IntPtr *returnVoidStub,
     global::System.IntPtr *returnIntegerStub,
     global::System.IntPtr *commonStub);
Beispiel #6
0
 public extern static int RhCompatibleReentrantWaitAny(
     int alertable,
     int timeout,
     int count,
     global::System.IntPtr *handles);
Beispiel #7
0
 public extern static void CallingConventionConverter_GetStubs(
     global::System.IntPtr *returnVoidStub,
     global::System.IntPtr *returnIntegerStub,
     global::System.IntPtr *commonStub,
     global::System.IntPtr *returnFloatingPointReturn4Thunk,
     global::System.IntPtr *returnFloatingPointReturn8Thunk);
Beispiel #8
0
 public static extern int av_expr_parse_and_eval(double *res, string s, sbyte **const_names, double *const_values, sbyte **func1_names, global::System.IntPtr *funcs1, sbyte **func2_names, global::System.IntPtr *funcs2, void *opaque, int log_offset, void *log_ctx);
Beispiel #9
0
 public static extern int av_expr_parse(libavutil.AVExpr **expr, string s, sbyte **const_names, sbyte **func1_names, global::System.IntPtr *funcs1, sbyte **func2_names, global::System.IntPtr *funcs2, int log_offset, void *log_ctx);
Beispiel #10
0
 internal unsafe static extern int WaitForMultipleObjects(
     int nCount,
     global::System.IntPtr *lpHandles,
     bool bWaitAll,
     int dwMilliseconds
     );