Chinaunix首页 | 论坛 | 博客
  • 博客访问: 848056
  • 博文数量: 756
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 4980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 14:40
文章分类

全部博文(756)

文章存档

2011年(1)

2008年(755)

我的朋友

分类:

2008-10-13 16:11:07

#define WIN32_LEAN_AND_MEAN
#include
#include
#include

#define KI_USER_SHARED_DATA               0x7FFE0000
#define SharedUserData                    ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA)

typedef struct _KSYSTEM_TIME
{
 ULONG LowPart;
 LONG High1Time;
 LONG High2Time;
} KSYSTEM_TIME, *PKSYSTEM_TIME;

typedef enum _NT_PRODUCT_TYPE
{
 NtProductWinNt = 1,
 NtProductLanManNt,
 NtProductServer
} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;

//
// Maximum Processor Features supported in KUSER_SHARED_DATA
//
#define PROCESSOR_FEATURE_MAX           64

typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
{
 StandardDesign,
 NEC98x86,
 EndAlternatives
} ALTERNATIVE_ARCHITECTURE_TYPE;

#define MAX_WOW64_SHARED_ENTRIES        16

typedef struct _KUSER_SHARED_DATA
{
 ULONG TickCountLowDeprecated;
 ULONG TickCountMultiplier;
 volatile KSYSTEM_TIME InterruptTime;
 volatile KSYSTEM_TIME SystemTime;
 volatile KSYSTEM_TIME TimeZoneBias;
 USHORT ImageNumberLow;
 USHORT ImageNumberHigh;
 WCHAR NtSystemRoot[260];
 ULONG MaxStackTraceDepth;
 ULONG CryptoExponent;
 ULONG TimeZoneId;
 ULONG LargePageMinimum;
 ULONG Reserved2[7];
 NT_PRODUCT_TYPE NtProductType;
 BOOLEAN ProductTypeIsValid;
 ULONG NtMajorVersion;
 ULONG NtMinorVersion;
 BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
 ULONG Reserved1;
 ULONG Reserved3;
 volatile ULONG TimeSlip;
 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
 LARGE_INTEGER SystemExpirationDate;
 ULONG SuiteMask;
 BOOLEAN KdDebuggerEnabled;
 volatile ULONG ActiveConsoleId;
 volatile ULONG DismountCount;
 ULONG ComPlusPackage;
 ULONG LastSystemRITEventTickCount;
 ULONG NumberOfPhysicalPages;
 BOOLEAN SafeBootMode;
 ULONG TraceLogging;
 ULONG Fill0;
 ULONGLONG TestRetInstruction;
 ULONG SystemCall;
 ULONG SystemCallReturn;
 ULONGLONG SystemCallPad[3];
 union {
  volatile KSYSTEM_TIME TickCount;
  volatile ULONG64 TickCountQuad;
 };
 ULONG Cookie;
 LONGLONG ConsoleSessionForegroundProcessId;
 ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
 ULONG UserModeGlobalLogging;
} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;


DWORD MyGetTickCount()
{
 return (DWORD)((ULONGLONG)SharedUserData->TickCountLowDeprecated * SharedUserData->TickCountMultiplier / 16777216);
}


int main(int argc,char *argv[])
{
 DWORD u1=GetTickCount();
 DWORD u2=MyGetTickCount();
 return 0;
}


--------------------next---------------------

阅读(808) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~