mirror of
https://github.com/winfsp/winfsp.git
synced 2026-11-02 07:06:04 -06:00
Major refactoring: IRP_MJ_CREATE
This commit is contained in:
1 parent
d773e2f96a
commit
1bd9c09d22
1 file changed
+15
@@ -290,6 +290,21 @@ NTSTATUS FspFsvolCreatePrepare(
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
NTSTATUS Result;
|
||||
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||
PACCESS_STATE AccessState = IrpSp->Parameters.Create.SecurityContext->AccessState;
|
||||
HANDLE UserModeAccessToken;
|
||||
|
||||
/* get a user-mode handle to the access token */
|
||||
Result = ObOpenObjectByPointer(SeQuerySubjectContextToken(&AccessState->SubjectSecurityContext),
|
||||
0, 0, TOKEN_QUERY, *SeTokenObjectType, UserMode, &UserModeAccessToken);
|
||||
if (!NT_SUCCESS(Result))
|
||||
return Result;
|
||||
|
||||
/* send the user-mode handle to the user-mode file system */
|
||||
FspIopRequestContext(Request, RequestAccessToken) = UserModeAccessToken;
|
||||
Request->Req.Create.AccessToken = (UINT_PTR)UserModeAccessToken;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user