internal SystemEnvironmentValue(string name, byte[] value, OptionalInt32 attributes, OptionalGuid vendor_guid) { Name = name; Value = value; Attributes = (SystemEnvironmentValueAttribute)attributes.Value; VendorGuid = vendor_guid.Value; }
/// <summary> /// Wake the thread from an alertable state and resume the thread. /// </summary> /// <returns>The previous suspend count for the thread.</returns> public int AlertResume() { OptionalInt32 suspend_count = new OptionalInt32(); NtSystemCalls.NtAlertResumeThread(Handle, suspend_count).ToNtException(); return(suspend_count.Value); }
public static extern NtStatus NtQueryIoCompletion( SafeKernelObjectHandle IoCompletionHandle, IoCompletionInformationClass IoCompletionInformationClass, SafeBuffer IoCompletionInformation, int IoCompletionInformationLength, OptionalInt32 ReturnLength );
public static extern NtStatus NtQueryEaFile( SafeKernelObjectHandle FileHandle, [Out] IoStatus IoStatusBlock, [Out] byte[] Buffer, int Length, bool ReturnSingleEntry, SafeBuffer EaList, int EaListLength, [In] OptionalInt32 EaIndex, bool RestartScan );
public static extern NtStatus NtAlpcConnectPort( out SafeKernelObjectHandle PortHandle, [In] UnicodeString PortName, [Optional, In] ObjectAttributes ObjectAttributes, [Optional, In] AlpcPortAttributes PortAttributes, uint Flags, [Optional] IntPtr RequiredServerSid, [Optional, In, Out] AlpcPortMessage ConnectionMessage, [Optional, In, Out] OptionalInt32 BufferLength, [Optional, In, Out] AlpcMessageAtributes OutMessageAttributes, [Optional, In, Out] AlpcMessageAtributes InMessageAttributes, [Optional, In] LargeInteger Timeout );
/// <summary> /// Query a single system environment value. /// </summary> /// <param name="name">The name of the value.</param> /// <param name="vendor_guid">The associated vendor guid</param> /// <param name="throw_on_error">True to throw on error.</param> /// <returns>The system environment value.</returns> public static NtResult <SystemEnvironmentValue> QuerySystemEnvironmentValue(string name, Guid vendor_guid, bool throw_on_error) { UnicodeString name_string = new UnicodeString(name); int value_length = 0; NtStatus status = NtSystemCalls.NtQuerySystemEnvironmentValueEx(name_string, ref vendor_guid, null, ref value_length, 0); if (status != NtStatus.STATUS_BUFFER_TOO_SMALL) { return(status.CreateResultFromError <SystemEnvironmentValue>(throw_on_error)); } byte[] value = new byte[value_length]; OptionalInt32 attributes = new OptionalInt32(); return(NtSystemCalls.NtQuerySystemEnvironmentValueEx(name_string, ref vendor_guid, value, ref value_length, attributes) .CreateResult(throw_on_error, () => new SystemEnvironmentValue(name, value, attributes, vendor_guid))); }
public static extern NtStatus NtQuerySystemEnvironmentValueEx([In] UnicodeString ValueName, ref Guid VendorGuid, [Out] byte[] Value, ref int ValueLength, OptionalInt32 Attributes);
public static extern NtStatus NtLockProductActivationKeys( OptionalInt32 pPrivateVer, OptionalInt32 pSafeMode);
public static extern NtStatus NtAlertResumeThread( SafeKernelObjectHandle ThreadHandle, [Out] OptionalInt32 PreviousSuspendCount );
public static extern NtStatus LdrLoadDll( IntPtr Flags, OptionalInt32 DllCharacteristics, UnicodeString DllName, out IntPtr DllHandle );
/// <summary> /// Wake the thread from an alertable state and resume the thread. /// </summary> /// <param name="throw_on_error">True to throw on error.</param> /// <returns>The previous suspend count for the thread.</returns> public NtResult <int> AlertResume(bool throw_on_error) { OptionalInt32 suspend_count = new OptionalInt32(); return(NtSystemCalls.NtAlertResumeThread(Handle, suspend_count).CreateResult(throw_on_error, () => suspend_count.Value)); }