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

📄 win32.h

📁 该项目主要是将wingdows程序直接运行在linux上
💻 H
📖 第 1 页 / 共 3 页
字号:
/* * win32.h * * Copyright (C) 2006  Insigme Co., Ltd * * Authors:  * - Chenzhan Hu, Lixing Chu, Limin Jin, Liwei Zhou, Zhiqiang Jiao * * 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. */ /* * win32.h includes the type definitions of W32 syscall functions.  * Reference to ReactOS code */#ifndef _WIN32_H#define _WIN32_H#include <linux/module.h>#include <asm/byteorder.h>#include <linux/list.h>#include <linux/winternl.h>#ifdef CONFIG_UNIFIED_KERNEL#ifndef CREATE_THREAD#define CREATE_THREAD 2#endif#define IN#define OUT#define STATUS_SUCCESS 0#define ANYSIZE_ARRAY 1#define NTAPI __stdcall#define STDCALL __stdcall#ifndef __stdcall#define __stdcall __attribute__((stdcall))#endif#ifndef NULL#define NULL 0#endif#define OPTIONAL#define OBJ_INHERIT          0x00000002L#define OBJ_PERMANENT        0x00000010L#define OBJ_EXCLUSIVE        0x00000020L#define OBJ_CASE_INSENSITIVE 0x00000040L#define OBJ_OPENIF           0x00000080L#define OBJ_OPENLINK         0x00000100L#define OBJ_KERNEL_HANDLE    0x00000200L#define OBJ_VALID_ATTRIBUTES 0x000003F2L#define DUPLICATE_CLOSE_SOURCE            0x00000001#define DUPLICATE_SAME_ACCESS             0x00000002#define DUPLICATE_SAME_ATTRIBUTES         0x00000004#define __int64 long longtypedef void 		VOID, *PVOID;typedef void 		*LPVOID;typedef void 		*PVOID64;typedef void 		*HANDLE;typedef const void 	*LPCVOID;typedef char 		BOOLEAN, *PBOOLEAN;typedef const char 	*LPCSTR;typedef signed char 	CHAR, *PCHAR, *LPSTR, *PSTR;typedef unsigned short 	WORD;typedef unsigned char 	UCHAR, *PUCHAR;typedef unsigned char 	BYTE;typedef unsigned char	UINT8;typedef unsigned short 		WCHAR;typedef short 		CSHORT;typedef unsigned short 	USHORT, *PUSHORT;typedef unsigned short	UINT16;typedef signed int 	LONG, *PLONG;typedef unsigned int 	UINT;typedef unsigned int 	UINT32;typedef unsigned int 	DWORD;typedef unsigned int 	ULONG, *PULONG;;typedef unsigned long 	ULONG_PTR, *PULONG_PTR;typedef long long 		LONGLONG;typedef unsigned long long 	ULONGLONG;typedef unsigned __int64 ULONG64, *PULONG64;typedef struct SECURITY_ATTRIBUTES 	*LPSECURITY_ATTRIBUTES;typedef struct OFSTRUCT			*LPOFSTRUCT;typedef BYTE 	BOOL;typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE;typedef WORD 	*PSECURITY_DESCRIPTOR_CONTROL;typedef DWORD 	*PDWORD, *LPDWORD;typedef DWORD 	LCID;typedef DWORD 	*PACCESS_MASK;typedef DWORD 	SECURITY_INFORMATION, *PSECURITY_INFORMATION;typedef PDWORD 	PLCID;typedef USHORT 		RTL_ATOM, *PRTL_ATOM;typedef USHORT 		LANGID, *PLANGID;typedef LONG 		NTSTATUS, *PNTSTATUS;typedef ULONG_PTR 	KAFFINITY;typedef ULONG_PTR 	SIZE_T, *PSIZE_T;typedef ULONG_PTR 	DWORD_PTR, *PDWORD_PTR;typedef HANDLE 		*PHANDLE, *LPHANDLE;typedef UCHAR 	SSPT, *PSSPT;typedef WCHAR 	*PWCHAR, *LPWCH, *PWCH, *NWPSTR, *LPWSTR, *PWSTR;typedef PVOID 	PSID;typedef PVOID 	(NTAPI * SSDT)(VOID);typedef SSDT 	*PSSDT;typedef struct list_head LIST_ENTRY;#define LPC_SIZE_T SIZE_T#define LPC_PVOID PVOID#define LPC_HANDLE HANDLE#define LPC_CLIENT_ID CLIENT_ID#define EXCEPTION_MAXIMUM_PARAMETERS 15#define _ANONYMOUS_STRUCT#define	FALSE	false#define	false	(BOOLEAN)0#define	TRUE	true#define	true	(BOOLEAN)1#define const_cpu_to_le16(x)	__constant_cpu_to_le16(x)typedef enum _TIMER_TYPE{	NotificationTimer,	SynchronizationTimer} TIMER_TYPE;typedef enum tagTOKEN_TYPE {	TokenPrimary = 1,	TokenImpersonation} TOKEN_TYPE,*PTOKEN_TYPE;typedef enum _KPROFILE_SOURCE{	ProfileTime,	ProfileAlignmentFixup,	ProfileTotalIssues,	ProfilePipelineDry,	ProfileLoadInstructions,	ProfilePipelineFrozen,	ProfileBranchInstructions,	ProfileTotalNonissues,	ProfileDcacheMisses,	ProfileIcacheMisses,	ProfileCacheMisses,	ProfileBranchMispredictions,	ProfileStoreInstructions,	ProfileFpInstructions,	ProfileIntegerInstructions,	Profile2Issue,	Profile3Issue,	Profile4Issue,	ProfileSpecialInstructions,	ProfileTotalCycles,	ProfileIcacheIssues,	ProfileDcacheAccesses,	ProfileMemoryBarrierCycles,	ProfileLoadLinkedIssues,	ProfileMaximum} KPROFILE_SOURCE;typedef enum _EVENT_TYPE{	NotificationEvent,	SynchronizationEvent} EVENT_TYPE;typedef enum _PNP_VETO_TYPE {  	PNP_VetoTypeUnknown,  	PNP_VetoLegacyDevice,  	PNP_VetoPendingClose,  	PNP_VetoWindowsApp,  	PNP_VetoWindowsService,	PNP_VetoOutstandingOpen,  	PNP_VetoDevice,  	PNP_VetoDriver,  	PNP_VetoIllegalDeviceRequest,  	PNP_VetoInsufficientPower,  	PNP_VetoNonDisableable,  	PNP_VetoLegacyDriver} PNP_VETO_TYPE, *PPNP_VETO_TYPE;typedef enum _PLUGPLAY_EVENT_CATEGORY{	HardwareProfileChangeEvent,	TargetDeviceChangeEvent,	DeviceClassChangeEvent,	CustomDeviceEvent,	DeviceInstallEvent,	DeviceArrivalEvent,	PowerEvent,	VetoEvent,	BlockedDriverEvent,	MaxPlugEventCategory} PLUGPLAY_EVENT_CATEGORY;typedef enum _SECURITY_IMPERSONATION_LEVEL {	SecurityAnonymous,	SecurityIdentification,	SecurityImpersonation,	SecurityDelegation} SECURITY_IMPERSONATION_LEVEL,*PSECURITY_IMPERSONATION_LEVEL;typedef enum {	SE_OWNER_DEFAULTED		= const_cpu_to_le16(0x0001),	SE_GROUP_DEFAULTED		= const_cpu_to_le16(0x0002),	SE_DACL_PRESENT			= const_cpu_to_le16(0x0004),	SE_DACL_DEFAULTED		= const_cpu_to_le16(0x0008),	SE_SACL_PRESENT			= const_cpu_to_le16(0x0010),	SE_SACL_DEFAULTED		= const_cpu_to_le16(0x0020),	SE_DACL_AUTO_INHERIT_REQ	= const_cpu_to_le16(0x0100),	SE_SACL_AUTO_INHERIT_REQ	= const_cpu_to_le16(0x0200),	SE_DACL_AUTO_INHERITED		= const_cpu_to_le16(0x0400),	SE_SACL_AUTO_INHERITED		= const_cpu_to_le16(0x0800),	SE_DACL_PROTECTED		= const_cpu_to_le16(0x1000),	SE_SACL_PROTECTED		= const_cpu_to_le16(0x2000),	SE_RM_CONTROL_VALID		= const_cpu_to_le16(0x4000),	SE_SELF_RELATIVE		= const_cpu_to_le16(0x8000),} __attribute__ ((__packed__)) SECURITY_DESCRIPTOR_CONTROL;#define const_cpu_to_le32(x)	__constant_cpu_to_le32(x)typedef enum {	/*	 * The specific rights (bits 0 to 15). Depend on the type of the	 * object being secured by the ACE.	 */	/* Specific rights for files and directories are as follows: */	/* Right to read data from the file. (FILE) */	FILE_READ_DATA			= const_cpu_to_le32(0x00000001),	/* Right to list contents of a directory. (DIRECTORY) */	FILE_LIST_DIRECTORY		= const_cpu_to_le32(0x00000001),	/* Right to write data to the file. (FILE) */	FILE_WRITE_DATA			= const_cpu_to_le32(0x00000002),	/* Right to create a file in the directory. (DIRECTORY) */	FILE_ADD_FILE			= const_cpu_to_le32(0x00000002),	/* Right to append data to the file. (FILE) */	FILE_APPEND_DATA		= const_cpu_to_le32(0x00000004),	/* Right to create a subdirectory. (DIRECTORY) */	FILE_ADD_SUBDIRECTORY		= const_cpu_to_le32(0x00000004),	/* Right to read extended attributes. (FILE/DIRECTORY) */	FILE_READ_EA			= const_cpu_to_le32(0x00000008),	/* Right to write extended attributes. (FILE/DIRECTORY) */	FILE_WRITE_EA			= const_cpu_to_le32(0x00000010),	/* Right to execute a file. (FILE) */	FILE_EXECUTE			= const_cpu_to_le32(0x00000020),	/* Right to traverse the directory. (DIRECTORY) */	FILE_TRAVERSE			= const_cpu_to_le32(0x00000020),	/*	 * Right to delete a directory and all the files it contains (its	 * children), even if the files are read-only. (DIRECTORY)	 */	FILE_DELETE_CHILD		= const_cpu_to_le32(0x00000040),	/* Right to read file attributes. (FILE/DIRECTORY) */	FILE_READ_ATTRIBUTES		= const_cpu_to_le32(0x00000080),	/* Right to change file attributes. (FILE/DIRECTORY) */	FILE_WRITE_ATTRIBUTES		= const_cpu_to_le32(0x00000100),	/*	 * The standard rights (bits 16 to 23). Are independent of the type of	 * object being secured.	 */	/* Right to delete the object. */	DELETE				= const_cpu_to_le32(0x00010000),	/*	 * Right to read the information in the object's security descriptor,	 * not including the information in the SACL. I.e. right to read the	 * security descriptor and owner.	 */	READ_CONTROL			= const_cpu_to_le32(0x00020000),	/* Right to modify the DACL in the object's security descriptor. */	WRITE_DAC			= const_cpu_to_le32(0x00040000),	/* Right to change the owner in the object's security descriptor. */	WRITE_OWNER			= const_cpu_to_le32(0x00080000),	/*	 * Right to use the object for synchronization. Enables a process to	 * wait until the object is in the signalled state. Some object types	 * do not support this access right.	 */	SYNCHRONIZE			= const_cpu_to_le32(0x00100000),	/*	 * The following STANDARD_RIGHTS_* are combinations of the above for	 * convenience and are defined by the Win32 API.	 */	/* These are currently defined to READ_CONTROL. */	STANDARD_RIGHTS_READ		= const_cpu_to_le32(0x00020000),	STANDARD_RIGHTS_WRITE		= const_cpu_to_le32(0x00020000),	STANDARD_RIGHTS_EXECUTE		= const_cpu_to_le32(0x00020000),	/* Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access. */	STANDARD_RIGHTS_REQUIRED	= const_cpu_to_le32(0x000f0000),	/*	 * Combines DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, and	 * SYNCHRONIZE access.	 */	STANDARD_RIGHTS_ALL		= const_cpu_to_le32(0x001f0000),	/*	 * The access system ACL and maximum allowed access types (bits 24 to	 * 25, bits 26 to 27 are reserved).	 */	ACCESS_SYSTEM_SECURITY		= const_cpu_to_le32(0x01000000),	MAXIMUM_ALLOWED			= const_cpu_to_le32(0x02000000),	/*	 * The generic rights (bits 28 to 31). These map onto the standard and	 * specific rights.	 */	/* Read, write, and execute access. */	GENERIC_ALL			= const_cpu_to_le32(0x10000000),	/* Execute access. */	GENERIC_EXECUTE			= const_cpu_to_le32(0x20000000),	/*	 * Write access. For files, this maps onto:	 *	FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA |	 *	FILE_WRITE_EA | STANDARD_RIGHTS_WRITE | SYNCHRONIZE	 * For directories, the mapping has the same numberical value. See	 * above for the descriptions of the rights granted.	 */	GENERIC_WRITE			= const_cpu_to_le32(0x40000000),	/*	 * Read access. For files, this maps onto:	 *	FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_READ_EA |	 *	STANDARD_RIGHTS_READ | SYNCHRONIZE	 * For directories, the mapping has the same numberical value. See	 * above for the descriptions of the rights granted.	 */	GENERIC_READ			= const_cpu_to_le32(0x80000000),} ACCESS_MASK;typedef enum _KEY_INFORMATION_CLASS{	KeyBasicInformation,	KeyNodeInformation,	KeyFullInformation,	KeyNameInformation,	KeyCachedInformation,	KeyFlagsInformation} KEY_INFORMATION_CLASS;typedef enum _KEY_VALUE_INFORMATION_CLASS{	KeyValueBasicInformation,	KeyValueFullInformation,	KeyValuePartialInformation,	KeyValueFullInformationAlign64,	KeyValuePartialInformationAlign64} KEY_VALUE_INFORMATION_CLASS;typedef enum {	PowerActionNone,	PowerActionReserved,	PowerActionSleep,	PowerActionHibernate,	PowerActionShutdown,	PowerActionShutdownReset,	PowerActionShutdownOff,	PowerActionWarmEject} POWER_ACTION, *PPOWER_ACTION;typedef enum _SYSTEM_POWER_STATE {	PowerSystemUnspecified,	PowerSystemWorking,	PowerSystemSleeping1,	PowerSystemSleeping2,	PowerSystemSleeping3,	PowerSystemHibernate,	PowerSystemShutdown,	PowerSystemMaximum} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;typedef enum _SECTION_INHERIT{	ViewShare = 1,	ViewUnmap = 2} SECTION_INHERIT;typedef enum _PLUGPLAY_CONTROL_CLASS{	PlugPlayControlUserResponse = 0x07,	PlugPlayControlProperty = 0x0A,	PlugPlayControlGetRelatedDevice = 0x0C,	PlugPlayControlDeviceStatus = 0x0E,	PlugPlayControlGetDeviceDepth,	PlugPlayControlResetDevice = 0x14} PLUGPLAY_CONTROL_CLASS;typedef enum _POWER_INFORMATION_LEVEL {	SystemPowerPolicyAc,	SystemPowerPolicyDc,	VerifySystemPolicyAc,	VerifySystemPolicyDc,	SystemPowerCapabilities,	SystemBatteryState,	SystemPowerStateHandler,	ProcessorStateHandler,	SystemPowerPolicyCurrent,	AdministratorPowerPolicy,	SystemReserveHiberFile,	ProcessorInformation,	SystemPowerInformation,	ProcessorStateHandler2,	LastWakeTime,	LastSleepTime,	SystemExecutionState,	SystemPowerStateNotifyHandler,	ProcessorPowerPolicyAc,	ProcessorPowerPolicyDc,	VerifyProcessorPowerPolicyAc,	VerifyProcessorPowerPolicyDc,	ProcessorPowerPolicyCurrent} POWER_INFORMATION_LEVEL;typedef enum _ATOM_INFORMATION_CLASS{	AtomBasicInformation,	AtomTableInformation,} ATOM_INFORMATION_CLASS;typedef enum _FILE_INFORMATION_CLASS{

⌨️ 快捷键说明

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