예제 #1
0
 IoCtlAsync(
     UInt32 ControlCode,
     NativeLog.IKBuffer InBuffer,
     CancellationToken Token)
 {
     return(Utility.WrapNativeAsyncInvokeInMTA <IoctlResults>(
                (Callback) => this.IoCtlAsyncBeginWrapper(ControlCode, InBuffer, Callback),
                (Context) => this.IoCtlAsyncEndWrapper(Context),
                Token,
                "NativeLog.WaitForNotification"));
 }
예제 #2
0
        IoCtlAsyncBeginWrapper(
            UInt32 ControlCode,
            NativeLog.IKBuffer InBuffer,
            NativeCommon.IFabricAsyncOperationCallback Callback)
        {
            NativeCommon.IFabricAsyncOperationContext context;

            // CONSIDER: does native code need to AddRef InBuffer ?

            this._NativeStream.BeginIoctl(ControlCode, InBuffer, Callback, out context);
            return(context);
        }
예제 #3
0
        CreatePhysicalLogStreamBeginWrapper(
            Guid PhysicalLogStreamId,
            Guid PhysicalLogStreamTypeId,
            string OptionalLogStreamAlias,
            string OptionalPath,
            FileSecurity OptionalSecurityInfo,
            Int64 MaximumSize,
            UInt32 MaximumBlockSize,
            LogManager.LogCreationFlags CreationFlags,
            NativeCommon.IFabricAsyncOperationCallback Callback)
        {
            NativeLog.IKBuffer secInfo = null;

            if (OptionalSecurityInfo != null)
            {
                var secDesc = OptionalSecurityInfo.GetSecurityDescriptorBinaryForm();
                NativeLog.CreateKBuffer((UInt32)secDesc.GetLength(0), out secInfo);
            }

            NativeCommon.IFabricAsyncOperationContext context;

            using (var pin = new PinCollection())
            {
                this._NativeContainer.BeginCreateLogStream(
                    PhysicalLogStreamId,
                    PhysicalLogStreamTypeId,
                    pin.AddBlittable(OptionalLogStreamAlias),
                    // CONSIDER: what about NULL Alias ?
                    pin.AddBlittable(OptionalPath),
                    secInfo,
                    // CONSIDER: does native code need to AddRef() ?
                    MaximumSize,
                    MaximumBlockSize,
                    CreationFlags,
                    Callback,
                    out context);
            }

            return(context);
        }