Beispiel #1
0
        public static bool SetTimeW([MarshalAs(UnmanagedType.LPWStr)] string remoteName, IntPtr creationTime, IntPtr lastAccessTime, IntPtr lastWriteTime)
        {
            var crTime = TcUtils.ReadDateTime(creationTime);

            var laTime = TcUtils.ReadDateTime(lastAccessTime);
            var lwTime = TcUtils.ReadDateTime(lastWriteTime);

            _callSignature = $"SetTime '{remoteName}' (" +
                             (crTime.HasValue ? $" {crTime.Value:g} #" : " NULL #") +
                             (laTime.HasValue ? $" {laTime.Value:g} #" : " NULL #") +
                             (lwTime.HasValue ? $" {lwTime.Value:g} #" : " NULL #") +
                             ")";

            var result = false;

            try {
                result = Plugin.SetTime(remoteName, crTime, laTime, lwTime);

                TraceCall(TraceLevel.Info, result ? "OK" : "No");
            }
            catch (Exception ex) {
                ProcessException(ex);
            }

            return(result);
        }