internal RunningInstance(IFileSystem fileSystem, InstanceOptions options, IRunnableInstance instanceOf, Functions outboundFunctions) { FileSystem = fileSystem; InstanceOf = instanceOf; _outboundFunctions = outboundFunctions; _asyncOperations = new AsyncManager(_outboundFunctions); var callbacks = new PRJ_CALLBACKS { CancelCommandCallback = ProcessCancelCommand, QueryFileNameCallback = fileSystem is ISeekableFileSystem ? ProcessQueryFileName : (PRJ_QUERY_FILE_NAME_CB)null, StartDirectoryEnumerationCallback = ProcessStartEnumeration, EndDirectoryEnumerationCallback = ProcessEndEnumeration, GetDirectoryEnumerationCallback = ProcessEnumerationStep, GetPlaceholderInfoCallback = ProcessPlaceholderRequest, GetFileDataCallback = ProcessDataRequest }; PRJ_STARTVIRTUALIZING_OPTIONS optionsNative = CreateOptions(fileSystem, options, callbacks); _callbacks = new NativeBuffer <PRJ_CALLBACKS>(callbacks); if (_outboundFunctions.PrjStartVirtualizing( instanceOf.RootPath, _callbacks.Buffer, IntPtr.Zero, optionsNative, out _namespaceVirtualizationContext) != HRESULT.S_OK) { throw new Exception("Failed to start up"); } if (_outboundFunctions.PrjGetVirtualizationInstanceInfo(_namespaceVirtualizationContext, ref _virtualizationInfo) != HRESULT.S_OK) { throw new Exception("Failed to start up"); } }
private void AsyncProvideHRESULTWithNotificationMask(IntPtr namespaceVirtualizationContext, int commandId, HRESULT final, PRJ_NOTIFY_TYPES notifyTypes) { var args = new PRJ_COMPLETE_COMMAND_EXTENDED_PARAMETERS { CommandType = PRJ_COMPLETE_COMMAND_TYPE.PRJ_COMPLETE_COMMAND_TYPE_ENUMERATION }; args._Union.NotificationMask = notifyTypes; _inFlight.TryRemove(commandId, out _); using (var buffer = new NativeBuffer <PRJ_COMPLETE_COMMAND_EXTENDED_PARAMETERS>(args)) { _outboundFunctions.PrjCompleteCommand(namespaceVirtualizationContext, commandId, final, buffer.Buffer); } }
public void AsyncProvideHRESULTWithDirEntry(IntPtr namespaceVirtualizationContext, int commandId, HRESULT final, IntPtr dirEntryBufferHandle) { var args = new PRJ_COMPLETE_COMMAND_EXTENDED_PARAMETERS { CommandType = PRJ_COMPLETE_COMMAND_TYPE.PRJ_COMPLETE_COMMAND_TYPE_ENUMERATION }; args._Union.DirEntryBufferHandle = dirEntryBufferHandle; _inFlight.TryRemove(commandId, out _); using (var buffer = new NativeBuffer <PRJ_COMPLETE_COMMAND_EXTENDED_PARAMETERS>(args)) { _outboundFunctions.PrjCompleteCommand(namespaceVirtualizationContext, commandId, final, buffer.Buffer); } }