Example #1
0
        /// <summary>
        /// Get the address of an exported function from an ordinal.
        /// </summary>
        /// <param name="ordinal">The ordinal of the exported function.</param>
        /// <param name="throw_on_error">True to throw on error.</param>
        /// <returns>Pointer to the exported function.</returns>
        /// <exception cref="NtException">Thrown if the ordinal doesn't exist.</exception>
        public NtResult <IntPtr> GetProcAddress(IntPtr ordinal, bool throw_on_error)
        {
            IntPtr func = Win32NativeMethods.GetProcAddress(handle, ordinal);

            if (func == IntPtr.Zero)
            {
                return(NtObjectUtils.MapDosErrorToStatus().CreateResultFromError <IntPtr>(throw_on_error));
            }
            return(func.CreateResult());
        }
 /// <summary>
 /// Get the address of an exported function from an ordinal.
 /// </summary>
 /// <param name="ordinal">The ordinal of the exported function.</param>
 /// <returns>Pointer to the exported function, or IntPtr.Zero if it can't be found.</returns>
 public IntPtr GetProcAddress(IntPtr ordinal)
 {
     return(Win32NativeMethods.GetProcAddress(handle, ordinal));
 }
 /// <summary>
 /// Get the address of an exported function.
 /// </summary>
 /// <param name="name">The name of the exported function.</param>
 /// <returns>Pointer to the exported function, or IntPtr.Zero if it can't be found.</returns>
 public IntPtr GetProcAddress(string name)
 {
     return(Win32NativeMethods.GetProcAddress(handle, name));
 }