⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 virtual.h

📁 该项目主要是将wingdows程序直接运行在linux上
💻 H
字号:
/* * virtual.h * * Copyright (C) 2006  Insigme Co., Ltd * * Authors:  * - Liwei Zhou * * This software has been developed while working on the Linux Unified Kernel * project (http://linux.insigma.com.cn) in the Insigma Reaserch Institute,  * which is a subdivision of Insigma Co., Ltd (http://www.insigma.com.cn). *  * The project is sponsored by Insigma Co., Ltd. * * The authors can be reached at linux@insigma.com.cn. * * This program is free software; you can redistribute it and/or modify it * under the terms of  the GNU General  Public License as published by the * Free Software Foundation; either version 2 of the  License, or (at your * option) any later version. * * Revision History: *   Jan 2006 - Created. *//*  * virtual.h: * Reference to ReactOS code */ #ifndef _VIRTUAL_H#define _VIRTUAL_H#include "../win32.h"#include <asm/page.h>#include <asm/pgtable.h>#ifdef CONFIG_UNIFIED_KERNEL#define CONST consttypedef struct _MEMORY_BASIC_INFORMATION {	PVOID BaseAddress;	PVOID AllocationBase;	DWORD AllocationProtect;	DWORD RegionSize;	DWORD State;	DWORD Protect;	DWORD Type;} MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;typedef CONST int CINT;#define PAGE_NOACCESS			0x00000001     #define PAGE_READ				0x00000002     /* FIXME */#define PAGE_READWRITE			0x00000004     #define PAGE_WRITECOPY			0x00000008     #define PAGE_EXECUTE			0x00000010     #define PAGE_EXECUTE_READ		0x00000020     #define PAGE_EXECUTE_READWRITE		0x00000040     #define PAGE_EXECUTE_WRITECOPY		0x00000080     #define PAGE_GUARD			0x00000100     #define PAGE_NOCACHE			0x00000200     #define PAGE_WRITECOMBINE		0x00000400#define MEM_COMMIT			0x00001000     #define MEM_RESERVE			0x00002000     #define MEM_DECOMMIT			0x00004000     #define MEM_RELEASE			0x00008000     #define MEM_FREE			0x00010000     #define MEM_PRIVATE			0x00020000     #define MEM_MAPPED			0x00040000     #define MEM_RESET			0x00080000     #define MEM_TOP_DOWN			0x00100000#define PAGE_FLAGS_VALID_FROM_USER_MODE (PAGE_READ | \					PAGE_READWRITE | \					PAGE_WRITECOPY | \					PAGE_EXECUTE | \					PAGE_EXECUTE_READ | \					PAGE_EXECUTE_READWRITE | \					PAGE_EXECUTE_WRITECOPY | \					PAGE_GUARD | \					PAGE_NOACCESS | \					PAGE_NOCACHE)#define MEMORY_AREA_INVALID              (0)#define MEMORY_AREA_SECTION_VIEW         (1)#define MEMORY_AREA_CONTINUOUS_MEMORY    (2)#define MEMORY_AREA_NO_CACHE             (3)#define MEMORY_AREA_IO_MAPPING           (4)#define MEMORY_AREA_SYSTEM               (5)#define MEMORY_AREA_MDL_MAPPING          (7)#define MEMORY_AREA_VIRTUAL_MEMORY       (8)#define MEMORY_AREA_CACHE_SEGMENT        (9)#define MEMORY_AREA_SHARED_DATA          (10)#define MEMORY_AREA_KERNEL_STACK         (11)#define MEMORY_AREA_PAGED_POOL           (12)#define MEMORY_AREA_NO_ACCESS            (13)#define MEMORY_AREA_PEB_OR_TEB           (14)typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;typedef struct _MADDRESS_SPACE{} MADDRESS_SPACE, *PMADDRESS_SPACE;typedef struct _MEMORY_AREA{} MEMORY_AREA, *PMEMORY_AREA;NTSTATUS STDCALLprotect_memory(struct mm_struct *mm,                ULONG address,                ULONG size,                pgprot_t new_prot,                pgprot_t *old_prot);unsigned long win32_do_mmap_pgoff(struct task_struct *task, char topdown,			struct file * file, unsigned long addr, unsigned long len, unsigned long prot,			unsigned long flags, unsigned long pgoff);NTSTATUS STDCALLMmCreateMemoryArea(struct eprocess *Process,		PMADDRESS_SPACE AddressSpace,		ULONG Type,		PVOID *BaseAddress,		ULONG_PTR Length,		ULONG Attributes,		PMEMORY_AREA *Result,		BOOLEAN FixedAddress,		BOOLEAN TopDown,		PHYSICAL_ADDRESS BoundaryAddressMultiple);NTSTATUS STDCALLNtQueryVirtualMemory (IN HANDLE ProcessHandle,		IN PVOID Address,		IN CINT VirtualMemoryInformationClass,		OUT PVOID VirtualMemoryInformation,		IN ULONG Length,		OUT PULONG UnsafeResultLength);NTSTATUS STDCALLNtAllocateVirtualMemory(IN HANDLE ProcessHandle,			IN OUT PVOID*  UBaseAddress,			IN ULONG ZeroBits,			IN OUT PULONG URegionSize,			IN ULONG AllocationType,			IN ULONG Protect);NTSTATUS STDCALLNtWriteVirtualMemory(IN HANDLE ProcessHandle,		IN PVOID BaseAddress,		IN PVOID Buffer,		IN ULONG NumberOfBytesToWrite,		OUT PULONG NumberOfBytesWritten OPTIONAL);NTSTATUS STDCALLNtReadVirtualMemory(IN HANDLE ProcessHandle,		IN PVOID BaseAddress,		OUT PVOID Buffer,		IN ULONG NumberOfBytesToRead,		OUT PULONG NumberOfBytesRead OPTIONAL);NTSTATUS STDCALLNtFreeVirtualMemory(IN HANDLE ProcessHandle,		IN PVOID*  PBaseAddress,		IN PULONG PRegionSize,		IN ULONG FreeType);#endif /* CONFIG_UNIFIED_KERNEL */#endif /* _VIRTUAL_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -