示例#1
0
		public static void CancelThreadpoolIo(global::Microsoft.Win32.SafeHandles.SafeThreadPoolIOHandle__System_Threading_Overlapped pio)
		{
			// Setup
			bool addRefed = false;
			// Marshalling
			pio.DangerousAddRef(ref addRefed);
			// Call to native method
			global::McgInterop.api_ms_win_core_threadpool_l1_2_0_dll_PInvokes.CancelThreadpoolIo(pio.DangerousGetHandle());
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			if (addRefed)
				pio.DangerousRelease();
			// Return
		}
示例#2
0
		public static bool GetFileInformationByHandleEx(
					global::Microsoft.Win32.SafeHandles.SafeFileHandle__System_IO_FileSystem hFile, 
					global::Interop.mincore.FILE_INFO_BY_HANDLE_CLASS__System_IO_FileSystem FileInformationClass, 
					out global::Interop.mincore.FILE_STANDARD_INFO__System_IO_FileSystem lpFileInformation, 
					uint dwBufferSize)
		{
			// Setup
			bool addRefed = false;
			global::Interop.mincore.FILE_STANDARD_INFO__System_IO_FileSystem__Impl.UnsafeType unsafe_lpFileInformation = default(global::Interop.mincore.FILE_STANDARD_INFO__System_IO_FileSystem__Impl.UnsafeType);
			int unsafe___value;
			// Marshalling
			hFile.DangerousAddRef(ref addRefed);
			unsafe_lpFileInformation = default(global::Interop.mincore.FILE_STANDARD_INFO__System_IO_FileSystem__Impl.UnsafeType);
			// Call to native method
			unsafe___value = global::McgInterop.api_ms_win_core_file_l2_1_0_dll_PInvokes.GetFileInformationByHandleEx(
								hFile.DangerousGetHandle(), 
								FileInformationClass, 
								&(unsafe_lpFileInformation), 
								dwBufferSize
							);
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
			global::Interop.mincore.FILE_STANDARD_INFO__System_IO_FileSystem__Impl.Marshal__UnsafeToSafe(
								ref unsafe_lpFileInformation, 
								out lpFileInformation
							);
			if (addRefed)
				hFile.DangerousRelease();
			// Return
			return unsafe___value != 0;
		}
示例#3
0
		public static global::Microsoft.Win32.SafeHandles.SafeThreadPoolIOHandle__System_Threading_Overlapped CreateThreadpoolIo(
					global::System.Runtime.InteropServices.SafeHandle fl, 
					global::Interop.NativeIoCompletionCallback__System_Threading_Overlapped pfnio, 
					global::System.IntPtr context, 
					global::System.IntPtr pcbe)
		{
			// Setup
			bool addRefed = false;
			void* unsafe_pfnio = default(void*);
			global::Microsoft.Win32.SafeHandles.SafeThreadPoolIOHandle__System_Threading_Overlapped __value;
			global::System.IntPtr unsafe___value;
			try
			{
				// Marshalling
				fl.DangerousAddRef(ref addRefed);
				unsafe_pfnio = (void*)global::System.Runtime.InteropServices.McgModuleManager.GetStubForPInvokeDelegate(
									global::System.Runtime.InteropServices.TypeOfHelper.RuntimeTypeHandleOf("Interop+NativeIoCompletionCallback,System.Threading.Overlapped, Version=4.0.0.0, Culture=neutral, PublicKeyToken" +
											"=b03f5f7f11d50a3a"), 
									pfnio
								);
				__value = new global::Microsoft.Win32.SafeHandles.SafeThreadPoolIOHandle__System_Threading_Overlapped();
				// Call to native method
				unsafe___value = global::McgInterop.api_ms_win_core_threadpool_l1_2_0_dll_PInvokes.CreateThreadpoolIo(
									fl.DangerousGetHandle(), 
									unsafe_pfnio, 
									context, 
									pcbe
								);
				global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
				global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
				global::System.Runtime.InteropServices.McgMarshal.InitializeHandle(
									__value, 
									unsafe___value
								);
				if (addRefed)
					fl.DangerousRelease();
				// Return
				return __value;
			}
			finally
			{
				// Cleanup
				global::System.GC.KeepAlive(pfnio);
			}
		}
示例#4
0
		public static bool FlushFileBuffers(global::System.Runtime.InteropServices.SafeHandle hHandle)
		{
			// Setup
			bool addRefed = false;
			int unsafe___value;
			// Marshalling
			hHandle.DangerousAddRef(ref addRefed);
			// Call to native method
			unsafe___value = global::McgInterop.api_ms_win_core_file_l1_1_0_dll_PInvokes.FlushFileBuffers(hHandle.DangerousGetHandle());
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
			if (addRefed)
				hHandle.DangerousRelease();
			// Return
			return unsafe___value != 0;
		}
示例#5
0
		public static int WriteFile__0(
					global::System.Runtime.InteropServices.SafeHandle handle, 
					byte* bytes, 
					int numBytesToWrite, 
					out int numBytesWritten, 
					global::System.IntPtr mustBeZero)
		{
			// Setup
			bool addRefed = false;
			int unsafe_numBytesWritten;
			int unsafe___value;
			// Marshalling
			handle.DangerousAddRef(ref addRefed);
			// Call to native method
			unsafe___value = global::McgInterop.api_ms_win_core_file_l1_1_0_dll_PInvokes.WriteFile__0(
								handle.DangerousGetHandle(), 
								((byte*)bytes), 
								numBytesToWrite, 
								&(unsafe_numBytesWritten), 
								mustBeZero
							);
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
			numBytesWritten = unsafe_numBytesWritten;
			if (addRefed)
				handle.DangerousRelease();
			// Return
			return unsafe___value;
		}
示例#6
0
		public static int ReadFile(
					global::System.Runtime.InteropServices.SafeHandle handle, 
					byte* bytes, 
					int numBytesToRead, 
					global::System.IntPtr numBytesRead_mustBeZero, 
					global::System.Threading.NativeOverlapped__System_Threading_Overlapped* overlapped)
		{
			// Setup
			bool addRefed = false;
			int unsafe___value;
			// Marshalling
			handle.DangerousAddRef(ref addRefed);
			// Call to native method
			unsafe___value = global::McgInterop.api_ms_win_core_file_l1_1_0_dll_PInvokes.ReadFile(
								handle.DangerousGetHandle(), 
								((byte*)bytes), 
								numBytesToRead, 
								numBytesRead_mustBeZero, 
								((global::System.Threading.NativeOverlapped__System_Threading_Overlapped*)overlapped)
							);
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
			if (addRefed)
				handle.DangerousRelease();
			// Return
			return unsafe___value;
		}
示例#7
0
		public static bool SetFilePointerEx(
					global::Microsoft.Win32.SafeHandles.SafeFileHandle__System_IO_FileSystem hFile, 
					long liDistanceToMove, 
					out long lpNewFilePointer, 
					uint dwMoveMethod)
		{
			// Setup
			bool addRefed = false;
			long unsafe_lpNewFilePointer;
			int unsafe___value;
			// Marshalling
			hFile.DangerousAddRef(ref addRefed);
			// Call to native method
			unsafe___value = global::McgInterop.api_ms_win_core_file_l1_1_0_dll_PInvokes.SetFilePointerEx(
								hFile.DangerousGetHandle(), 
								liDistanceToMove, 
								&(unsafe_lpNewFilePointer), 
								dwMoveMethod
							);
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
			lpNewFilePointer = unsafe_lpNewFilePointer;
			if (addRefed)
				hFile.DangerousRelease();
			// Return
			return unsafe___value != 0;
		}
示例#8
0
		public static bool CancelIoEx(
					global::System.Runtime.InteropServices.SafeHandle handle, 
					global::System.Threading.NativeOverlapped__System_Threading_Overlapped* lpOverlapped)
		{
			// Setup
			bool addRefed = false;
			int unsafe___value;
			// Marshalling
			handle.DangerousAddRef(ref addRefed);
			// Call to native method
			unsafe___value = global::McgInterop.api_ms_win_core_io_l1_1_0_dll_PInvokes.CancelIoEx(
								handle.DangerousGetHandle(), 
								((global::System.Threading.NativeOverlapped__System_Threading_Overlapped*)lpOverlapped)
							);
			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
			global::System.Runtime.InteropServices.McgMarshal.SaveLastWin32Error();
			if (addRefed)
				handle.DangerousRelease();
			// Return
			return unsafe___value != 0;
		}