如何在windows2000中进入系统零层 如果不写wdm,如何在windows2000中进入系统零层? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://person.okey.net/~webcrazy/ntring0.htm这是用到的类型://要安装ntddk//typedef unsigned long ULONG_PTR, *PULONG_PTR;#define _X86_ #include <windows.h>/*//#include <winbase.h>extern "C" {#include "ntddk.h"}*/#include <windef.h>typedef long NTSTATUS; typedef unsigned short USHORT;#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) #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 0x000003F2Ltypedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; #ifdef MIDL_PASS [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer; #else // MIDL_PASS PWSTR Buffer; #endif // MIDL_PASS } UNICODE_STRING;typedef UNICODE_STRING *PUNICODE_STRING; typedef const UNICODE_STRING *PCUNICODE_STRING; #define UNICODE_NULL ((WCHAR)0) // winnt typedef struct _OBJECT_ATTRIBUTES { ULONG Length; HANDLE RootDirectory; PUNICODE_STRING ObjectName; ULONG Attributes; PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE } OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; #define InitializeObjectAttributes( p, n, a, r, s ) { \ (p)->Length = sizeof( OBJECT_ATTRIBUTES ); \ (p)->RootDirectory = r; \ (p)->Attributes = a; \ (p)->ObjectName = n; \ (p)->SecurityDescriptor = s; \ (p)->SecurityQualityOfService = NULL; \} extern "C"NTSYSAPI VOID NTAPI RtlInitUnicodeString( PUNICODE_STRING DestinationString, PCWSTR SourceString ); extern "C"NTSYSAPI NTSTATUS NTAPI ZwOpenSection( OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes ); extern "C"NTSYSAPI NTSTATUS NTAPI ZwClose( IN HANDLE Handle ); #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L)#pragma comment(lib,"ntdll.lib")//#include "ntring0.h"//#include <windows.h>/*namespace NT { extern "C" { #pragma warning (disable:4005) //macro redfination #include "ntddk.h" #pragma warning (default:4005) } } */#include <stdio.h>#include <aclapi.h>#include <conio.h>#define ENTERRING0 _asm pushad \ _asm pushf \_asm cli#define LEAVERING0 _asm popf \ _asm popad \_asm retftypedef struct gdtr { unsigned short Limit; unsigned short BaseLow; unsigned short BaseHigh;} Gdtr_t, *PGdtr_t;typedef struct idtr { short Limit; short BaseLow; short BaseHigh;}IdtR;typedef struct{ unsigned short offset_0_15; unsigned short selector; unsigned char param_count : 4; unsigned char some_bits : 4; unsigned char type : 4; unsigned char app_system : 1; unsigned char dpl : 2; unsigned char present : 1; unsigned short offset_16_31;} CALLGATE_DESCRIPTOR;void PrintWin32Error( DWORD ErrorCode ){ LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, ErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf ); LocalFree( lpMsgBuf );} 不清楚啊,我没有装XP,哪个地方出了问题啊?是GDT那儿吗? CFrameWnd隐藏时,触发什么消息? 调用wininet远程下载文件时的一个问题,有完整代码。 一个需要设计算法的问题 用过Xtreme或者BCG的同学进来! 点击某按钮弹出另一个窗体时,如何设置弹出的窗体的标题及其内部控件的标题? SDK VS JDK(那位解释一下这几个术语) 怎样画空心矩形? 用MFC开发ActiveX时,外观只能够在OnDraw中实现吗? folder dialog 如何把一个CString变量作为dll函数的返回值?? 树视问题100分相送 关于ActiveX控件的注册出现的怪现象(100分相送)
//typedef unsigned long ULONG_PTR, *PULONG_PTR;
#define _X86_ #include <windows.h>
/*
//#include <winbase.h>
extern "C" {
#include "ntddk.h"
}
*/
#include <windef.h>
typedef long NTSTATUS;
typedef unsigned short USHORT;
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
#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 0x000003F2Ltypedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
#ifdef MIDL_PASS
[size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer;
#else // MIDL_PASS
PWSTR Buffer;
#endif // MIDL_PASS
} UNICODE_STRING;
typedef UNICODE_STRING *PUNICODE_STRING;
typedef const UNICODE_STRING *PCUNICODE_STRING;
#define UNICODE_NULL ((WCHAR)0) // winnt typedef struct _OBJECT_ATTRIBUTES {
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR
PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE
} OBJECT_ATTRIBUTES;
typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
#define InitializeObjectAttributes( p, n, a, r, s ) { \
(p)->Length = sizeof( OBJECT_ATTRIBUTES ); \
(p)->RootDirectory = r; \
(p)->Attributes = a; \
(p)->ObjectName = n; \
(p)->SecurityDescriptor = s; \
(p)->SecurityQualityOfService = NULL; \
} extern "C"
NTSYSAPI
VOID
NTAPI
RtlInitUnicodeString(
PUNICODE_STRING DestinationString,
PCWSTR SourceString
);
extern "C"
NTSYSAPI
NTSTATUS
NTAPI
ZwOpenSection(
OUT PHANDLE SectionHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes
);
extern "C"
NTSYSAPI
NTSTATUS
NTAPI
ZwClose(
IN HANDLE Handle
);
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth
#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L)
#pragma comment(lib,"ntdll.lib")
//#include "ntring0.h"
//#include <windows.h>
/*
namespace NT
{
extern "C"
{
#pragma warning (disable:4005) //macro redfination
#include "ntddk.h"
#pragma warning (default:4005)
}
}
*/#include <stdio.h>#include <aclapi.h>
#include <conio.h>#define ENTERRING0 _asm pushad \
_asm pushf \
_asm cli#define LEAVERING0 _asm popf \
_asm popad \
_asm retftypedef struct gdtr {
unsigned short Limit;
unsigned short BaseLow;
unsigned short BaseHigh;
} Gdtr_t, *PGdtr_t;typedef struct idtr {
short Limit;
short BaseLow;
short BaseHigh;
}IdtR;
typedef struct
{
unsigned short offset_0_15;
unsigned short selector;
unsigned char param_count : 4;
unsigned char some_bits : 4;
unsigned char type : 4;
unsigned char app_system : 1;
unsigned char dpl : 2;
unsigned char present : 1;
unsigned short offset_16_31;
} CALLGATE_DESCRIPTOR;void PrintWin32Error( DWORD ErrorCode )
{
LPVOID lpMsgBuf;
FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, ErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL );
printf("%s\n", lpMsgBuf );
LocalFree( lpMsgBuf );
}