mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-08 04:52:10 -05:00
sys: IRP_MJ_CREATE
This commit is contained in:
parent
26b4727a0b
commit
171c8eff04
@ -52,7 +52,8 @@ typedef struct
|
|||||||
UINT16 Version;
|
UINT16 Version;
|
||||||
UINT16 SectorSize;
|
UINT16 SectorSize;
|
||||||
UINT32 SerialNumber;
|
UINT32 SerialNumber;
|
||||||
BOOLEAN EaSupported;
|
BOOLEAN EaSupported; /* supports extended attributes (unimplemented; set to 0) */
|
||||||
|
BOOLEAN FileNameRequired; /* FileName required for all operations (not just Create) */
|
||||||
} FSP_FSCTL_VOLUME_PARAMS;
|
} FSP_FSCTL_VOLUME_PARAMS;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -65,9 +66,9 @@ typedef struct
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
UINT8 Placeholder;
|
UINT8 Placeholder;
|
||||||
WCHAR FileName[];
|
|
||||||
} Create;
|
} Create;
|
||||||
} Req;
|
} Req;
|
||||||
|
WCHAR FileName[];
|
||||||
} FSP_FSCTL_TRANSACT_REQ;
|
} FSP_FSCTL_TRANSACT_REQ;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -166,7 +166,7 @@ static NTSTATUS FspFsvolCreate(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* create the user-mode file system request */
|
/* create the user-mode file system request */
|
||||||
Result = FspIopCreateRequest(Irp, FsContext->FileName.Length, &Request);
|
Result = FspIopCreateRequest(Irp, &FsContext->FileName, 0, &Request);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
FspFileContextDelete(FsContext);
|
FspFileContextDelete(FsContext);
|
||||||
|
@ -246,7 +246,8 @@ BOOLEAN FspIoqStartProcessingIrp(FSP_IOQ *Ioq, PIRP Irp);
|
|||||||
PIRP FspIoqEndProcessingIrp(FSP_IOQ *Ioq, UINT_PTR IrpHint);
|
PIRP FspIoqEndProcessingIrp(FSP_IOQ *Ioq, UINT_PTR IrpHint);
|
||||||
|
|
||||||
/* I/O processing */
|
/* I/O processing */
|
||||||
NTSTATUS FspIopCreateRequest(PIRP Irp, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest);
|
NTSTATUS FspIopCreateRequest(
|
||||||
|
PIRP Irp, PUNICODE_STRING FileName, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest);
|
||||||
VOID FspIopCompleteRequest(PIRP Irp, NTSTATUS Result);
|
VOID FspIopCompleteRequest(PIRP Irp, NTSTATUS Result);
|
||||||
VOID FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response);
|
VOID FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ NTSTATUS FspFileContextCreate(ULONG ExtraSize, FSP_FILE_CONTEXT **PFsContext)
|
|||||||
RtlZeroMemory(NonPaged, sizeof *NonPaged);
|
RtlZeroMemory(NonPaged, sizeof *NonPaged);
|
||||||
ExInitializeFastMutex(&NonPaged->HeaderFastMutex);
|
ExInitializeFastMutex(&NonPaged->HeaderFastMutex);
|
||||||
|
|
||||||
RtlZeroMemory(FsContext, sizeof *FsContext + ExtraSize);
|
RtlZeroMemory(FsContext, sizeof *FsContext);
|
||||||
FsRtlSetupAdvancedHeader(&FsContext->Header, &NonPaged->HeaderFastMutex);
|
FsRtlSetupAdvancedHeader(&FsContext->Header, &NonPaged->HeaderFastMutex);
|
||||||
FsContext->NonPaged = NonPaged;
|
FsContext->NonPaged = NonPaged;
|
||||||
RtlInitEmptyUnicodeString(&FsContext->FileName, FsContext->FileNameBuf, (USHORT)ExtraSize);
|
RtlInitEmptyUnicodeString(&FsContext->FileName, FsContext->FileNameBuf, (USHORT)ExtraSize);
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
#include <sys/driver.h>
|
#include <sys/driver.h>
|
||||||
|
|
||||||
NTSTATUS FspIopCreateRequest(PIRP Irp, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest);
|
NTSTATUS FspIopCreateRequest(
|
||||||
|
PIRP Irp, PUNICODE_STRING FileName, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest);
|
||||||
VOID FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response);
|
VOID FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response);
|
||||||
|
|
||||||
#ifdef ALLOC_PRAGMA
|
#ifdef ALLOC_PRAGMA
|
||||||
@ -14,20 +15,29 @@ VOID FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response);
|
|||||||
#pragma alloc_text(PAGE, FspIopDispatchComplete)
|
#pragma alloc_text(PAGE, FspIopDispatchComplete)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NTSTATUS FspIopCreateRequest(PIRP Irp, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest)
|
NTSTATUS FspIopCreateRequest(
|
||||||
|
PIRP Irp, PUNICODE_STRING FileName, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest)
|
||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
*PRequest = 0;
|
*PRequest = 0;
|
||||||
|
|
||||||
|
if (0 != FileName)
|
||||||
|
ExtraSize += FileName->Length + sizeof(WCHAR);
|
||||||
|
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request = ExAllocatePoolWithTag(PagedPool,
|
FSP_FSCTL_TRANSACT_REQ *Request = ExAllocatePoolWithTag(PagedPool,
|
||||||
sizeof *Request + ExtraSize, FSP_TAG);
|
sizeof *Request + ExtraSize, FSP_TAG);
|
||||||
if (0 == Request)
|
if (0 == Request)
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
RtlZeroMemory(Request, sizeof *Request + ExtraSize);
|
RtlZeroMemory(Request, sizeof *Request);
|
||||||
Request->Size = (UINT16)(sizeof *Request + ExtraSize);
|
Request->Size = (UINT16)(sizeof *Request + ExtraSize);
|
||||||
Request->Hint = (UINT_PTR)Irp;
|
Request->Hint = (UINT_PTR)Irp;
|
||||||
|
if (0 != FileName)
|
||||||
|
{
|
||||||
|
memcpy(Request->FileName, FileName->Buffer, FileName->Length);
|
||||||
|
Request->FileName[FileName->Length / 2] = L'\0';
|
||||||
|
}
|
||||||
|
|
||||||
Irp->Tail.Overlay.DriverContext[0] = Request;
|
Irp->Tail.Overlay.DriverContext[0] = Request;
|
||||||
*PRequest = Request;
|
*PRequest = Request;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user