mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
sys: IRP_MJ_CREATE
This commit is contained in:
parent
26b4727a0b
commit
171c8eff04
@ -52,7 +52,8 @@ typedef struct
|
||||
UINT16 Version;
|
||||
UINT16 SectorSize;
|
||||
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;
|
||||
typedef struct
|
||||
{
|
||||
@ -65,9 +66,9 @@ typedef struct
|
||||
struct
|
||||
{
|
||||
UINT8 Placeholder;
|
||||
WCHAR FileName[];
|
||||
} Create;
|
||||
} Req;
|
||||
WCHAR FileName[];
|
||||
} FSP_FSCTL_TRANSACT_REQ;
|
||||
typedef struct
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ static NTSTATUS FspFsvolCreate(
|
||||
*/
|
||||
|
||||
/* 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))
|
||||
{
|
||||
FspFileContextDelete(FsContext);
|
||||
|
@ -246,7 +246,8 @@ BOOLEAN FspIoqStartProcessingIrp(FSP_IOQ *Ioq, PIRP Irp);
|
||||
PIRP FspIoqEndProcessingIrp(FSP_IOQ *Ioq, UINT_PTR IrpHint);
|
||||
|
||||
/* 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 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);
|
||||
ExInitializeFastMutex(&NonPaged->HeaderFastMutex);
|
||||
|
||||
RtlZeroMemory(FsContext, sizeof *FsContext + ExtraSize);
|
||||
RtlZeroMemory(FsContext, sizeof *FsContext);
|
||||
FsRtlSetupAdvancedHeader(&FsContext->Header, &NonPaged->HeaderFastMutex);
|
||||
FsContext->NonPaged = NonPaged;
|
||||
RtlInitEmptyUnicodeString(&FsContext->FileName, FsContext->FileNameBuf, (USHORT)ExtraSize);
|
||||
|
@ -6,7 +6,8 @@
|
||||
|
||||
#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);
|
||||
|
||||
#ifdef ALLOC_PRAGMA
|
||||
@ -14,20 +15,29 @@ VOID FspIopDispatchComplete(PIRP Irp, const FSP_FSCTL_TRANSACT_RSP *Response);
|
||||
#pragma alloc_text(PAGE, FspIopDispatchComplete)
|
||||
#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();
|
||||
|
||||
*PRequest = 0;
|
||||
|
||||
if (0 != FileName)
|
||||
ExtraSize += FileName->Length + sizeof(WCHAR);
|
||||
|
||||
FSP_FSCTL_TRANSACT_REQ *Request = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof *Request + ExtraSize, FSP_TAG);
|
||||
if (0 == Request)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
RtlZeroMemory(Request, sizeof *Request + ExtraSize);
|
||||
RtlZeroMemory(Request, sizeof *Request);
|
||||
Request->Size = (UINT16)(sizeof *Request + ExtraSize);
|
||||
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;
|
||||
*PRequest = Request;
|
||||
|
Loading…
x
Reference in New Issue
Block a user