mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-03 01:12:58 -05:00
Merge pull request #237 from dworkin/feature/async-dotnet
Async I/O for dotnet
This commit is contained in:
@ -386,6 +386,89 @@ namespace Fsp
|
||||
{
|
||||
return Api.GetVersion();
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a RequestHint to reference the current operation asynchronously.
|
||||
/// </summary>
|
||||
public UInt64 GetOperationRequestHint()
|
||||
{
|
||||
return Api.FspFileSystemGetOperationRequestHint();
|
||||
}
|
||||
/// <summary>
|
||||
/// Asynchronously complete a Write operation.
|
||||
/// </summary>
|
||||
/// <param name="RequestHint">
|
||||
/// A reference to the operation to complete.
|
||||
/// </param>
|
||||
/// <param name="Status">
|
||||
/// STATUS_SUCCESS or error code.
|
||||
/// </param>
|
||||
/// <param name="BytesTransferred">
|
||||
/// The number of bytes written.
|
||||
/// </param>
|
||||
/// <param name="FileInfo">
|
||||
/// Updated file information.
|
||||
/// </param>
|
||||
public void SendWriteResponse(UInt64 RequestHint, Int32 Status, UInt32 BytesTransferred, ref FileInfo FileInfo)
|
||||
{
|
||||
var Response = new FspFsctlTransactRsp()
|
||||
{
|
||||
Size = 128,
|
||||
Kind = (UInt32) FspFsctlTransact.WriteKind,
|
||||
Hint = RequestHint
|
||||
};
|
||||
Response.IoStatus.Information = BytesTransferred;
|
||||
Response.IoStatus.Status = (UInt32) Status;
|
||||
Response.WriteFileInfo = FileInfo;
|
||||
Api.FspFileSystemSendResponse(_FileSystemPtr, ref Response);
|
||||
}
|
||||
/// <summary>
|
||||
/// Asynchronously complete a Read operation.
|
||||
/// </summary>
|
||||
/// <param name="RequestHint">
|
||||
/// A reference to the operation to complete.
|
||||
/// </param>
|
||||
/// <param name="Status">
|
||||
/// STATUS_SUCCESS or error code.
|
||||
/// </param>
|
||||
/// <param name="BytesTransferred">
|
||||
/// Number of bytes read.
|
||||
/// </param>
|
||||
public void SendReadResponse(UInt64 RequestHint, Int32 Status, UInt32 BytesTransferred)
|
||||
{
|
||||
var Response = new FspFsctlTransactRsp()
|
||||
{
|
||||
Size = 128,
|
||||
Kind = (UInt32) FspFsctlTransact.ReadKind,
|
||||
Hint = RequestHint
|
||||
};
|
||||
Response.IoStatus.Information = BytesTransferred;
|
||||
Response.IoStatus.Status = (UInt32) Status;
|
||||
Api.FspFileSystemSendResponse(_FileSystemPtr, ref Response);
|
||||
}
|
||||
/// <summary>
|
||||
/// Asynchronously complete a ReadDirectory operation.
|
||||
/// </summary>
|
||||
/// <param name="RequestHint">
|
||||
/// A reference to the operation to complete.
|
||||
/// </param>
|
||||
/// <param name="Status">
|
||||
/// STATUS_SUCCESS or error code.
|
||||
/// </param>
|
||||
/// <param name="BytesTransferred">
|
||||
/// Number of bytes read.
|
||||
/// </param>
|
||||
public void SendReadDirectoryResponse(UInt64 RequestHint, Int32 Status, UInt32 BytesTransferred)
|
||||
{
|
||||
var Response = new FspFsctlTransactRsp()
|
||||
{
|
||||
Size = 128,
|
||||
Kind = (UInt32) FspFsctlTransact.QueryDirectoryKind,
|
||||
Hint = RequestHint
|
||||
};
|
||||
Response.IoStatus.Information = BytesTransferred;
|
||||
Response.IoStatus.Status = (UInt32) Status;
|
||||
Api.FspFileSystemSendResponse(_FileSystemPtr, ref Response);
|
||||
}
|
||||
|
||||
/* FSP_FILE_SYSTEM_INTERFACE */
|
||||
private static Byte[] ByteBufferNotNull = new Byte[0];
|
||||
|
Reference in New Issue
Block a user