mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-21 16:55:54 +02:00
NamedPipeStore: Added support for FSCTL_PIPE_WAIT
This commit is contained in:
parent
0bc9452bbf
commit
a607806c60
1 changed files with 22 additions and 1 deletions
|
@ -102,7 +102,28 @@ namespace SMBLibrary
|
||||||
public NTStatus DeviceIOControl(object handle, uint ctlCode, byte[] input, out byte[] output, int maxOutputLength)
|
public NTStatus DeviceIOControl(object handle, uint ctlCode, byte[] input, out byte[] output, int maxOutputLength)
|
||||||
{
|
{
|
||||||
output = null;
|
output = null;
|
||||||
if (ctlCode == (uint)IoControlCode.FSCTL_PIPE_TRANSCEIVE)
|
if (ctlCode == (uint)IoControlCode.FSCTL_PIPE_WAIT)
|
||||||
|
{
|
||||||
|
PipeWaitRequest request;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
request = new PipeWaitRequest(input, 0);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return NTStatus.STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoteService service = GetService(request.Name);
|
||||||
|
if (service == null)
|
||||||
|
{
|
||||||
|
return NTStatus.STATUS_OBJECT_NAME_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
output = new byte[0];
|
||||||
|
return NTStatus.STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
else if (ctlCode == (uint)IoControlCode.FSCTL_PIPE_TRANSCEIVE)
|
||||||
{
|
{
|
||||||
int numberOfBytesWritten;
|
int numberOfBytesWritten;
|
||||||
NTStatus writeStatus = WriteFile(out numberOfBytesWritten, handle, 0, input);
|
NTStatus writeStatus = WriteFile(out numberOfBytesWritten, handle, 0, input);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue