public unsafe SECURITY_QUALITY_OF_SERVICE(ImpersonationLevel impersonationLevel, ContextTrackingMode contextTrackingMode, bool effectiveOnly) { Length = (uint)sizeof(SECURITY_QUALITY_OF_SERVICE); ImpersonationLevel = impersonationLevel; ContextTrackingMode = contextTrackingMode; EffectiveOnly = effectiveOnly ? BOOLEAN.TRUE : BOOLEAN.FALSE; }
public static extern NTSTATUS NtQueryDirectoryObject( DirectoryObjectHandle DirectoryHandle, SafeHandle Buffer, uint Length, BOOLEAN ReturnSingleEntry, BOOLEAN RestartScan, ref uint Context, out uint ReturnLength);
public static unsafe extern int NtQueryDirectoryFile( IntPtr FileHandle, IntPtr Event, IntPtr ApcRoutine, IntPtr ApcContext, IO_STATUS_BLOCK *IoStatusBlock, IntPtr FileInformation, uint Length, FILE_INFORMATION_CLASS FileInformationClass, BOOLEAN ReturnSingleEntry, UNICODE_STRING *FileName, BOOLEAN RestartScan);
public unsafe static extern NTSTATUS NtQueryDirectoryFile( SafeFileHandle FileHandle, IntPtr Event, AsyncProcedureCall ApcRoutine, IntPtr ApcContext, out IO_STATUS_BLOCK IoStatusBlock, void *FileInformation, uint Length, FileInformationClass FileInformationClass, BOOLEAN ReturnSingleEntry, UNICODE_STRING *FileName, BOOLEAN RestartScan);
public void BOOLEANConversion() { BOOLEAN B = true; (B == true).Should().BeTrue("Comparison of TRUE with true is true"); (B == false).Should().BeFalse("Comparison of TRUE with false is false"); B.IsTrue.Should().BeTrue("IsTrue should be true when true"); B.IsFalse.Should().BeFalse("IsFalse should be false when true"); bool b = B; b.Should().BeTrue("assignment is true"); b = false; B = b; (B == true).Should().BeFalse("Comparison of FALSE with true is false"); (B == false).Should().BeTrue("Comparison of FALSE with false is true"); B.IsTrue.Should().BeFalse("IsTrue should be false when false"); B.IsFalse.Should().BeTrue("IsFalse should be true when False"); }
public unsafe static extern BOOLEAN RtlIsNameInExpression( UNICODE_STRING *Expression, UNICODE_STRING *Name, BOOLEAN IgnoreCase, IntPtr UpcaseTable);
public static extern BOOLEAN SetSuspendState(BOOLEAN bHibernate, BOOLEAN bForce, BOOLEAN bWakeupEventsDisabled);
public static bool IsFalse(this BOOLEAN b) => b == BOOLEAN.FALSE;
public static bool IsTrue(this BOOLEAN b) => b != BOOLEAN.FALSE;
/// <summary> /// Конвертирует значение BOOLEAN в массив байтов /// </summary> /// <param name="Value">Значение</param> /// <returns></returns> public static byte[] ToBytes(BOOLEAN Value) => BitConverter.GetBytes(Value);
public static async void DownloadFileAsync(string TypeFile, string Company, string SubFolder, BOOLEAN FileDialog, ButtonWpf ButtonWpf, TypeFile TypeFileEnum, bool Run, params string[] FileName) { Request Request = new Request("http://wolf.wolfproject.ru/UIUser/Download/") { ["login"] = Login, ["password"] = Password, ["keyaccess"] = KeyAccess, ["typefile"] = TypeFile, ["company"] = Company, ["subfolder"] = SubFolder }; string GetRespone = await Request.GetResponeAsync(); string Path(string GetFile) => TypeFile + "/" + Company + "/" + SubFolder + "/" + GetFile; string PathFileInfo(string GetFile) => TypeFile + "/" + Company + "/" + SubFolder + "/" + GetFile + ".info"; string PathDirectory = TypeFile + "/" + Company + "/" + SubFolder; using WebClient WebClient = new WebClient(); if (GetRespone != "False") { if (!Directory.Exists(PathDirectory)) { Directory.CreateDirectory(PathDirectory); } ButtonWpf.Content = "Загружается"; ButtonWpf.IsEnabled = false; DownloadFileInfo(GetRespone, SubFolder, PathFileInfo(SubFolder), WebClient); switch (TypeFileEnum) { case Enum.TypeFile.Library: if (FileDialog) { using (SaveFileDialog SaveFile = new SaveFileDialog { Title = "Сохранить файл", FileName = FileName[0], Filter = "Все файлы (*.*) | *.*" }) { if (SaveFile.ShowDialog() == DialogResult.OK) { await WebClient.DownloadFileTaskAsync(new Uri(GetRespone + "/" + FileName[0]), SaveFile.FileName); } } } else { await WebClient.DownloadFileTaskAsync(new Uri(GetRespone + "/" + FileName[0]), Path(FileName[0])); if (Run) { Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\" + PathDirectory); } } ButtonWpf.Content = "Скачать"; ButtonWpf.IsEnabled = true; break; case Enum.TypeFile.Hack: if (!HMemory.IsProcessActive(FileName[0])) { foreach (var GetFile in FileName) { await WebClient.DownloadFileTaskAsync(new Uri(GetRespone + "/" + GetFile), Path(GetFile)); } Process.Start(Path(FileName[0])); } else { MessageBox.Show("Процесс уже запущен!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } ButtonWpf.Content = "Запустить"; ButtonWpf.IsEnabled = true; break; } } }
public static unsafe extern NTSTATUS RtlUpcaseUnicodeString( UNICODE_STRING *DestinationString, UNICODE_STRING *SourceString, BOOLEAN AllocateDestinationString);
public static extern IntPtr OpenProcess(ProcessAccess dwDesiredAccess, BOOLEAN bInheritHandle, DWORD dwProcessId);