Windows: Redirector opens must set a valid FsContext
[openafs.git] / src / WINNT / afsrdr / kernel / fs / AFSCreate.cpp
index 2401b53..55d7418 100644 (file)
@@ -244,13 +244,20 @@ AFSOpenRedirector( IN PIRP Irp)
     NTSTATUS ntStatus = STATUS_SUCCESS;
     FILE_OBJECT        *pFileObject = NULL;
     IO_STACK_LOCATION  *pIrpSp;
+    AFSDeviceExt* pDeviceExt =
+        (AFSDeviceExt *)AFSRDRDeviceObject->DeviceExtension;
 
     __Enter
     {
 
         pIrpSp = IoGetCurrentIrpStackLocation( Irp);
+
         pFileObject = pIrpSp->FileObject;
 
+        pFileObject->FsContext = (PVOID) pDeviceExt->Fcb;
+
+        ASSERT(pFileObject->FsContext != NULL);
+
         //
         // Return the open result for this file
         //