public static string GetDesktopName(IntPtr desktopHandle)
        {
            if (desktopHandle == IntPtr.Zero)
            {
                return((string)null);
            }
            int    lpnLengthNeeded = 0;
            string empty           = string.Empty;

            SEBDesktopController.GetUserObjectInformation(desktopHandle, 2, IntPtr.Zero, 0, ref lpnLengthNeeded);
            IntPtr num1       = Marshal.AllocHGlobal(lpnLengthNeeded);
            int    num2       = SEBDesktopController.GetUserObjectInformation(desktopHandle, 2, num1, lpnLengthNeeded, ref lpnLengthNeeded) ? 1 : 0;
            string stringAnsi = Marshal.PtrToStringAnsi(num1);

            Marshal.FreeHGlobal(num1);
            if (num2 == 0)
            {
                return((string)null);
            }
            return(stringAnsi);
        }