Microsoft.KtmIntegration.NativeMethods.DeviceIoControl C# (CSharp) Méthode

DeviceIoControl() private méthode

private DeviceIoControl ( [ hDevice, [ dwIoControlCode, [ lpInBuffer, [ nInBufferSize, [ lpOutBuffer, [ nOutBufferSize, [ lpBytesReturned, [ lpOverlapped ) : bool
hDevice [
dwIoControlCode [
lpInBuffer [
nInBufferSize [
lpOutBuffer [
nOutBufferSize [
lpBytesReturned [
lpOverlapped [
Résultat bool
        internal static extern bool DeviceIoControl(
            [In] SafeFileHandle hDevice,
            [In] int dwIoControlCode,
            [In] IntPtr lpInBuffer,
            [In] int nInBufferSize,
            [Out] IntPtr lpOutBuffer,
            [In] int nOutBufferSize,
            [Out] out int lpBytesReturned,
            [In] IntPtr lpOverlapped);

Usage Example

        // Stops the secondary RM under a given 'path'
        public static void StopTxFResource(string path)
        {
            SafeFileHandle handle = TransactedDirectory.GetDirectoryHandle(path);

            using (handle)
            {
                int bytesReturned = 0;

                // Issue the IO ctrl asking to stop a secondary RM...
                bool result = NativeMethods.DeviceIoControl(
                    handle,
                    NativeMethods.FSCTL_TXFS_SHUTDOWN_RM,
                    IntPtr.Zero,
                    0,
                    IntPtr.Zero,
                    0,
                    out bytesReturned,
                    IntPtr.Zero);
                if (!result)
                {
                    throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error());
                }
            }
        }
All Usage Examples Of Microsoft.KtmIntegration.NativeMethods::DeviceIoControl