示例#1
0
 internal static extern bool PInvoke_VirtualFreeEx(IntPtr hProcess, IntPtr lpBaseAddress, int dwSize, MemoryAllocationTypes flFreeType);
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hProcess"></param>
        /// <param name="lpBaseAddress"></param>
        /// <param name="dwSize"></param>
        /// <param name="flFreeType"></param>
        /// <returns></returns>
        public static bool VirtualFreeEx(IntPtr hProcess, IntPtr lpBaseAddress, int dwSize, MemoryAllocationTypes flFreeType, [CallerMemberName] string callerName = "")
        {
            if (!PInvokeDebugger.LoggingEnabled)
            {
                return(PInvoke_VirtualFreeEx(hProcess, lpBaseAddress, dwSize, flFreeType));
            }

            bool             returnValue = PInvoke_VirtualFreeEx(hProcess, lpBaseAddress, dwSize, flFreeType);
            PInvokeDebugInfo debugInfo   = PInvokeDebugInfo.TraceDebugInfo(
                ModuleName,
                nameof(VirtualFreeEx),
                callerName,
                returnValue,
                false,
                nameof(hProcess), hProcess,
                nameof(lpBaseAddress), lpBaseAddress,
                nameof(dwSize), dwSize,
                nameof(flFreeType), flFreeType
                );

            PInvokeDebugger.SafeCapture(debugInfo);
            return(returnValue);
        }
示例#3
0
 internal static extern IntPtr PInvoke_VirtualAllocEx(IntPtr hProcess, IntPtr lpBaseAddress, int dwSize, MemoryAllocationTypes flAllocationType, MemoryProtections flProtect);
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hProcess"></param>
        /// <param name="lpBaseAddress"></param>
        /// <param name="dwSize"></param>
        /// <param name="flAllocationType"></param>
        /// <param name="flProtect"></param>
        /// <returns></returns>
        public static IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpBaseAddress, int dwSize, MemoryAllocationTypes flAllocationType, MemoryProtections flProtect, [CallerMemberName] string callerName = "")
        {
            if (!PInvokeDebugger.LoggingEnabled)
            {
                return(PInvoke_VirtualAllocEx(hProcess, lpBaseAddress, dwSize, flAllocationType, flProtect));
            }

            IntPtr           returnValue = PInvoke_VirtualAllocEx(hProcess, lpBaseAddress, dwSize, flAllocationType, flProtect);
            PInvokeDebugInfo debugInfo   = PInvokeDebugInfo.TraceDebugInfo(
                ModuleName,
                nameof(VirtualAllocEx),
                callerName,
                returnValue,
                IntPtr.Zero,
                nameof(hProcess), hProcess,
                nameof(lpBaseAddress), lpBaseAddress,
                nameof(dwSize), dwSize,
                nameof(flAllocationType), flAllocationType,
                nameof(flProtect), flProtect
                );

            PInvokeDebugger.SafeCapture(debugInfo);
            return(returnValue);
        }