mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 02:37:49 +02:00
Pass FSCTL_PIPE_WAIT to the INTFileStore layer
This commit is contained in:
parent
1d532ed758
commit
eaa8300e11
1 changed files with 15 additions and 2 deletions
|
@ -25,14 +25,27 @@ namespace SMBLibrary.Server.SMB2
|
|||
}
|
||||
|
||||
OpenFileObject openFile = session.GetOpenFileObject(request.FileId.Persistent);
|
||||
object handle;
|
||||
if (openFile == null)
|
||||
{
|
||||
if (request.CtlCode == (uint)IoControlCode.FSCTL_PIPE_WAIT)
|
||||
{
|
||||
// [MS-SMB2] 3.2.4.20.9 - FSCTL_PIPE_WAIT request has FileId set to 0xFFFFFFFFFFFFFFFF
|
||||
handle = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ErrorResponse(request.CommandName, NTStatus.STATUS_FILE_CLOSED);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
handle = openFile.Handle;
|
||||
}
|
||||
|
||||
int maxOutputLength = (int)request.MaxOutputResponse;
|
||||
byte[] output;
|
||||
NTStatus status = share.FileStore.DeviceIOControl(openFile.Handle, request.CtlCode, request.Input, out output, maxOutputLength);
|
||||
NTStatus status = share.FileStore.DeviceIOControl(handle, request.CtlCode, request.Input, out output, maxOutputLength);
|
||||
if (status != NTStatus.STATUS_SUCCESS)
|
||||
{
|
||||
return new ErrorResponse(request.CommandName, status);
|
||||
|
|
Loading…
Add table
Reference in a new issue