]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: Move afsredir process type check
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 27 Sep 2012 02:03:03 +0000 (22:03 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 1 Oct 2012 23:21:58 +0000 (16:21 -0700)
The process type check in afsredir.sys was performed during the
Process Creation callback which is processed in the context of the
parent process which might not be the same type (32-bit or 64-bit)
as the process being created.

Change-Id: I6ae79a6dacf434a986c7bb0135b2238fcfeeb0cd
Reviewed-on: http://gerrit.openafs.org/8165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp

index af87c80cd8f2b6a309cdb91aaba3f206306f61a4..88b7a3c87466b0ba97654ab1e0761349ac1e3e1b 100644 (file)
@@ -372,6 +372,24 @@ AFSValidateProcessEntry( IN HANDLE ProcessId)
 
         AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
 
+#if defined(_WIN64)
+
+        //
+        // Mark the process as 64-bit if it is.
+        //
+
+        if( !IoIs32bitProcess( NULL))
+        {
+
+            SetFlag( pProcessCB->Flags, AFS_PROCESS_FLAG_IS_64BIT);
+        }
+        else
+        {
+
+            ClearFlag( pProcessCB->Flags, AFS_PROCESS_FLAG_IS_64BIT);
+        }
+#endif
+
         //
         // Locate the SID for the caller
         //
@@ -832,15 +850,6 @@ AFSInitializeProcessCB( IN ULONGLONG ParentProcessId,
 
         pProcessCB->ParentProcessId = (ULONGLONG)ParentProcessId;
 
-#if defined(_WIN64)
-
-        if( !IoIs32bitProcess( NULL))
-        {
-            SetFlag( pProcessCB->Flags, AFS_PROCESS_FLAG_IS_64BIT);
-        }
-
-#endif
-
         if( pDeviceExt->Specific.Control.ProcessTree.TreeHead == NULL)
         {
             pDeviceExt->Specific.Control.ProcessTree.TreeHead = (AFSBTreeEntry *)pProcessCB;