Esempio n. 1
0
        public static unsafe void DuplicateObject(
            IntPtr sourceProcessHandle,
            IntPtr sourceHandle,
            int desiredAccess,
            HandleFlags handleAttributes,
            DuplicateOptions options
            )
        {
            IntPtr dummy;

            DuplicateObject(
                sourceProcessHandle,
                sourceHandle,
                IntPtr.Zero,
                out dummy,
                desiredAccess,
                handleAttributes,
                options
                );
        }
Esempio n. 2
0
 protected IfcBuildingElement(DatabaseIfc db, IfcBuildingElement e, DuplicateOptions options) : base(db, e, options)
 {
 }
Esempio n. 3
0
 internal IfcBeam(DatabaseIfc db, IfcBeam b, DuplicateOptions options) : base(db, b, options)
 {
     mPredefinedType = b.mPredefinedType;
 }
Esempio n. 4
0
 internal IfcBuildingStorey(DatabaseIfc db, IfcBuildingStorey s, DuplicateOptions options) : base(db, s, options)
 {
 }
Esempio n. 5
0
 protected IfcLoop(DatabaseIfc db, IfcLoop l, DuplicateOptions options) : base(db, l, options)
 {
 }
Esempio n. 6
0
 internal IfcLineSegment2D(DatabaseIfc db, IfcLineSegment2D s, DuplicateOptions options) : base(db, s, options)
 {
 }
Esempio n. 7
0
 protected IfcLinearPositioningElement(DatabaseIfc db, IfcLinearPositioningElement e, DuplicateOptions options) : base(db, e, options)
 {
     Axis = db.Factory.Duplicate(e.Axis) as IfcCurve;
 }
Esempio n. 8
0
 public static void DuplicateObject(
     IntPtr sourceProcessHandle,
     IntPtr sourceHandle,
     IntPtr targetProcessHandle,
     out IntPtr targetHandle,
     int desiredAccess,
     HandleFlags handleAttributes,
     DuplicateOptions options
     )
 {
     NtDuplicateObject(
         sourceProcessHandle,
         sourceHandle,
         targetProcessHandle,
         out targetHandle,
         desiredAccess,
         handleAttributes,
         options
         ).ThrowIf();
 }
Esempio n. 9
0
        public unsafe static void DuplicateObject(
            IntPtr sourceProcessHandle,
            IntPtr sourceHandle,
            IntPtr targetProcessHandle,
            out IntPtr targetHandle,
            int desiredAccess,
            HandleFlags handleAttributes,
            DuplicateOptions options
            )
        {
            if (KProcessHacker.Instance != null)
            {
                int target;

                KProcessHacker.Instance.KphDuplicateObject(
                    sourceProcessHandle.ToInt32(),
                    sourceHandle.ToInt32(),
                    targetProcessHandle.ToInt32(),
                    out target,
                    desiredAccess,
                    handleAttributes,
                    options);
                targetHandle = new IntPtr(target);
            }
            else
            {
                NtStatus status;

                if ((status = NtDuplicateObject(
                    sourceProcessHandle,
                    sourceHandle,
                    targetProcessHandle,
                    out targetHandle,
                    desiredAccess,
                    handleAttributes,
                    options)) >= NtStatus.Error)
                    ThrowLastError(status);
            }
        }
Esempio n. 10
0
 public static extern bool DuplicateHandle([In] IntPtr hSourceProcessHandle, [In] IntPtr hSourceHandle, [In] IntPtr hTargetProcessHandle, [Out] out IntPtr lpTargetHandle, [In] DesiredAccessRights dwDesiredAccess, [In] bool bInheritHandle, [In] DuplicateOptions dwOptions);
Esempio n. 11
0
 internal IfcJunctionBoxType(DatabaseIfc db, IfcJunctionBoxType t, DuplicateOptions options) : base(db, t, options)
 {
     PredefinedType = t.PredefinedType;
 }
Esempio n. 12
0
 protected IfcQuantitySet(DatabaseIfc db, IfcQuantitySet s, DuplicateOptions options) : base(db, s, options)
 {
 }
Esempio n. 13
0
 public IfcKerbType(DatabaseIfc db, IfcKerbType kerbType, DuplicateOptions options) : base(db, kerbType, options)
 {
     Mountable = kerbType.Mountable;
 }
Esempio n. 14
0
        public void KphDuplicateObject(
            int sourceProcessHandle,
            int sourceHandle,
            int targetProcessHandle,
            int targetHandle,
            int desiredAccess,
            HandleFlags handleAttributes,
            DuplicateOptions options
            )
        {
            byte[] data = new byte[7 * sizeof(int)];

            fixed (byte* dataPtr = data)
            {
                *(int*)(dataPtr + 0x0) = sourceProcessHandle;
                *(int*)(dataPtr + 0x4) = sourceHandle;
                *(int*)(dataPtr + 0x8) = targetProcessHandle;
                *(int*)(dataPtr + 0xc) = targetHandle;
                *(int*)(dataPtr + 0x10) = desiredAccess;
                *(int*)(dataPtr + 0x14) = (int)handleAttributes;
                *(int*)(dataPtr + 0x18) = (int)options;

                _fileHandle.IoControl(CtlCode(Control.KphDuplicateObject), data, null);
            }
        }
Esempio n. 15
0
        public void KphDuplicateObject(
            int sourceProcessHandle,
            int sourceHandle,
            int targetProcessHandle,
            out int targetHandle,
            int desiredAccess,
            HandleFlags handleAttributes,
            DuplicateOptions options
            )
        {
            int handle;

            KphDuplicateObject(
                sourceProcessHandle,
                sourceHandle,
                targetProcessHandle,
                (int)&handle,
                desiredAccess,
                handleAttributes,
                options
                );

            targetHandle = handle;
        }
Esempio n. 16
0
 internal IfcBuildingElementProxy(DatabaseIfc db, IfcBuildingElementProxy p, DuplicateOptions options) : base(db, p, options)
 {
     mPredefinedType = p.mPredefinedType;
 }
Esempio n. 17
0
 internal static extern bool DuplicateHandle(IntPtr hSourceProcessHandle,
                                             IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out IntPtr lpTargetHandle,
                                             uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, DuplicateOptions dwOptions);
Esempio n. 18
0
 internal IfcJunctionBox(DatabaseIfc db, IfcJunctionBox b, DuplicateOptions options) : base(db, b, options)
 {
     mPredefinedType = b.mPredefinedType;
 }
Esempio n. 19
0
 internal IfcLine(DatabaseIfc db, IfcLine l, DuplicateOptions options) : base(db, l, options)
 {
     Pnt = db.Factory.Duplicate(l.Pnt) as IfcCartesianPoint; Dir = db.Factory.Duplicate(l.Dir) as IfcVector;
 }
Esempio n. 20
0
 internal IfcUnitaryControlElementType(DatabaseIfc db, IfcUnitaryControlElementType t, DuplicateOptions options) : base(db, t, options)
 {
     mPredefinedType = t.mPredefinedType;
 }
Esempio n. 21
0
 internal IfcLaborResourceType(DatabaseIfc db, IfcLaborResourceType t, DuplicateOptions options) : base(db, t, options)
 {
     mPredefinedType = t.mPredefinedType;
 }
Esempio n. 22
0
 internal IfcUnitaryEquipment(DatabaseIfc db, IfcUnitaryEquipment e, DuplicateOptions options) : base(db, e, options)
 {
     mPredefinedType = e.mPredefinedType;
 }
Esempio n. 23
0
 public IfcLiquidTerminalType(DatabaseIfc db, IfcLiquidTerminalType liquidTerminalType, DuplicateOptions options) : base(db, liquidTerminalType, options)
 {
     PredefinedType = liquidTerminalType.PredefinedType;
 }
Esempio n. 24
0
        internal static unsafe IntPtr DuplicateHandleLocal(IntPtr sourceHandle, uint desiredAccess, bool inheritHandle, DuplicateOptions options)
        {
            IntPtr newHandle = IntPtr.Zero;
            bool   success   = DuplicateHandle(SafeProcessHandle.CurrentProcess, sourceHandle, SafeProcessHandle.CurrentProcess, (IntPtr)(int)&newHandle, desiredAccess, inheritHandle, options);

            if (!success)
            {
                throw new Win32Exception();
            }
            return(newHandle);
        }
Esempio n. 25
0
 protected IfcBuildingElementType(DatabaseIfc db, IfcBuildingElementType t, DuplicateOptions options) : base(db, t, options)
 {
 }
Esempio n. 26
0
 internal static extern bool DuplicateHandle(SafeProcessHandle sourceProcess, IntPtr sourceHandle, SafeProcessHandle destinationProcess, IntPtr destinationHandlePtr, uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, DuplicateOptions dwOptions);
Esempio n. 27
0
 internal IfcBuildingSystem(DatabaseIfc db, IfcBuildingSystem s, DuplicateOptions options) : base(db, s, options)
 {
     mLongName = s.mLongName; mPredefinedType = s.mPredefinedType;
 }
Esempio n. 28
0
 private static extern Boolean DuplicateHandle(IntPtr hSourceProcessHandle, IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out NativeNormalHandle lpTargetHandle, UInt32 dwDesiredAccess, Boolean bInheritHandle, DuplicateOptions dwOptions);
Esempio n. 29
0
 internal IfcBeamStandardCase(DatabaseIfc db, IfcBeamStandardCase b, DuplicateOptions options) : base(db, b, options)
 {
 }
Esempio n. 30
0
 internal IfcLamp(DatabaseIfc db, IfcLamp l, DuplicateOptions options) : base(db, l, options)
 {
     mPredefinedType = l.mPredefinedType;
 }
Esempio n. 31
0
 internal IfcBeamType(DatabaseIfc db, IfcBeamType t, DuplicateOptions options) : base(db, t, options)
 {
     mPredefinedType = t.mPredefinedType;
 }
Esempio n. 32
0
 internal IfcLightFixture(DatabaseIfc db, IfcLightFixture f, DuplicateOptions options) : base(db, f, options)
 {
     mPredefinedType = f.mPredefinedType;
 }
Esempio n. 33
0
 internal IfcBuildingElementProxyType(DatabaseIfc db, IfcBuildingElementProxyType t, DuplicateOptions options) : base(db, t, options)
 {
     mPredefinedType = t.mPredefinedType;
 }
Esempio n. 34
0
 protected IfcLightSource(DatabaseIfc db, IfcLightSource l, DuplicateOptions options) : base(db, l, options)
 {
     mName = l.mName; mLightColour = l.mLightColour; mAmbientIntensity = l.mAmbientIntensity; mIntensity = l.mIntensity;
 }
Esempio n. 35
0
 private static extern bool DuplicateHandle(IntPtr hSourceProcessHandle,
     IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out IntPtr lpTargetHandle,
     uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, DuplicateOptions dwOptions);
Esempio n. 36
0
 internal IfcLaborResource(DatabaseIfc db, IfcLaborResource r, DuplicateOptions options) : base(db, r, options)
 {
     mPredefinedType = r.mPredefinedType;
 }