Example #1
0
        /// <summary>
        /// Reads data from the NSudo logging infrastructure.
        /// </summary>
        /// <returns>
        /// The content of the data from the NSudo logging infrastructure.
        /// </returns>
        public string ReadLog()
        {
            if (NSudoReadLogInstance == null)
            {
                NSudoReadLogInstance =
                    GetFunctionAddress <NSudoReadLogType>(
                        "NSudoReadLog");
            }

            return(Marshal.PtrToStringUni(NSudoReadLogInstance()));
        }
Example #2
0
        /// <summary>
        /// Reads data from the NSudo logging infrastructure.
        /// </summary>
        /// <returns>
        /// The content of the data from the NSudo logging infrastructure.
        /// </returns>
        public string ReadLog()
        {
            IntPtr NSudoReadLogInstanceAddress = Win32.GetProcAddress(
                this.ModuleHandle, "NSudoReadLog");

            if (NSudoReadLogInstanceAddress == IntPtr.Zero)
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }

            NSudoReadLogType NSudoReadLogInstance =
                Marshal.GetDelegateForFunctionPointer <NSudoReadLogType>(
                    NSudoReadLogInstanceAddress);

            return(Marshal.PtrToStringUni(NSudoReadLogInstance()));
        }