creation of symbolic link when mapping a network share

Hi All,

I am writing a crypt filter driver.
A network share is mapped as X:
The requirement is to encrypt/decrypt only the X:
So I need the real device name of X:
Using ZwQuerySymbolicLinkObject, I am trying to find the real device name of X:
The symbolic link X: is created under the path \Sessions\0\DosDevices\00000000-0000xxxx\
Here xxxx is the logon session id.
Is there anyway to get the logon session id in the minifilter?

Also I have noticed that if the network share mapping is done in the local system context, the symbolic link is created globally.
But after reboot, the symbolic link X: moves under the current session.
Is there anyway to ensure the symbolic link X: always created globally?

Please help me in resolving the symbolic link path.

Thanks,
S Ramakrishnan

> Is there anyway to get the logon session id in the minifilter?

NTKERNELAPI ULONG PsGetProcessSessionId(
__in PEPROCESS Process
);