This article introduces a hotfix that improves the interoperability between the BranchCache feature and the Offline Files feature in Windows 7 and in Windows Server 2008 R2.
Currently, the BranchCache feature uses the WTSQueryUserToken function to maintain the token cache for users who log on in a local branch office environment. To make sure that the Offline Files feature can impersonate the appropriate skin, the client-side caching driver (Csc.sys) sends an upcall to the Offline Files feature (Cscservice.exe). Then, the upcall triggers a prefetch request that incorporates the logon ID of the VNetRoot pointer. This behavior enables the Offline Files feature to open a handle on behalf of the original user.
However, the WTSQueryUserToken function cannot retrieve tokens that are not associated with Remote Desktop logon sessions (such as tokens that are created by using the runas.exe /netonly command or by using direct LogonUser() API calls). Therefore, when the BranchCache feature uses the WTSQueryUserToken function to retrieve tokens that are not associated with Romote Desktop logon sessions, the prefetch request fails. This behavior causes WAN connections to perform file IO operations.
For example, consider the following scenario:
Currently, the BranchCache feature uses the WTSQueryUserToken function to maintain the token cache for users who log on in a local branch office environment. To make sure that the Offline Files feature can impersonate the appropriate skin, the client-side caching driver (Csc.sys) sends an upcall to the Offline Files feature (Cscservice.exe). Then, the upcall triggers a prefetch request that incorporates the logon ID of the VNetRoot pointer. This behavior enables the Offline Files feature to open a handle on behalf of the original user.
However, the WTSQueryUserToken function cannot retrieve tokens that are not associated with Remote Desktop logon sessions (such as tokens that are created by using the runas.exe /netonly command or by using direct LogonUser() API calls). Therefore, when the BranchCache feature uses the WTSQueryUserToken function to retrieve tokens that are not associated with Romote Desktop logon sessions, the prefetch request fails. This behavior causes WAN connections to perform file IO operations.
For example, consider the following scenario:
- The BranchCache feature is deployed in distributed cache mode in a local branch environment.
- The Forefront Endpoint Protection (FEP) definition update service runs under the context of the Network Service credentials.
- The FEP definition updates are distributed by using DFSR shares.