コード例 #1
0
 public static extern IntPtr CreateDesktop(
     [MarshalAs(UnmanagedType.LPWStr)] string name,
     [MarshalAs(UnmanagedType.LPWStr)] string device,
     [MarshalAs(UnmanagedType.LPWStr)] string devMode,
     [MarshalAs(UnmanagedType.U4)] int flags,
     [MarshalAs(UnmanagedType.U4)] AccessRights desiredAccess,
     [In] ref NativeSecurityAttributes lpsa
     );
コード例 #2
0
        /// <summary>
        /// Handles intercepted directory access.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="securityAttributes"></param>
        /// <returns></returns>
        public bool CreateDirectory(string fileName, NativeSecurityAttributes securityAttributes)
        {
            var request = new FileRequest
            {
                CreationDisposition = FileCreationDisposition.OpenAlways,
                Path         = fileName,
                ResourceType = ResourceType.Directory
            };

            using (EngineCore.Engine.GetEngineProcessingSpace())
            {
                var virtualPath = _fileSystem.GetVirtualPath(request);
                return(HostFileSystem.NativeMethods.CreateDirectory(virtualPath, securityAttributes));
            }
        }