windows
文章平均质量分 54
godspeed
这个作者很懒,什么都没留下…
展开
-
windows下加入删除服务
#include #include #define ____DEVICE_BASENAME ("myfirst")//// Get system error message string//PCSTR SystemMessage(DWORD nError){static CHAR msg[256];if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |FOR原创 2013-10-16 11:41:42 · 792 阅读 · 1 评论 -
Printf %输出格式
%d--输出有符号十进制整数%o --输出无符号八进制整数%x - 输出无符号十六进制整数%X –除了大写字母使用'A'-'F'外同 %x%u - 输出无符号十进制整数%s – 输出一个以C 中空字符NULL 结束的字符串%c – 以 ASCII 字符形式输出只输出一个字符%f – 以小数形式输出浮点数%S – 输出在FLASH 存贮器中的字符串常量如果在% 和转载 2013-11-27 20:59:28 · 1515 阅读 · 0 评论 -
从dll生成.lib
需要工具dumpbin.exelib.exe1. 查看DLL导出函数表DUMPBIN.EXE /EXPORTS ntdll.dll输出类似: ordinal hint RVA name 1207 4B6 0002DC81 _itow 1208 4B7 0006F989 _lfind 1209 4B8 0原创 2013-12-23 11:45:10 · 686 阅读 · 0 评论 -
写IRP返回的长度可能不是sectorsize的整数倍
返回的长度 》》》》 Irp->IoStatus.Information0-1: W F7F42000 off=759200, len=400*** Assertion failed: Length % SECTOR_SIZE == 0*** Source File: c:\winddk\mine\wdutils\dmon2\cache.c, l原创 2014-01-06 16:52:27 · 690 阅读 · 0 评论 -
wdm驱动dbg输出
头文件定义输出宏#define PTDBG_TRACE_ROUTINES 0x00000001#define PTDBG_TRACE_OPERATION_STATUS 0x00000002#define PT_DBG_PRINT( _dbgLevel, _string ) \ ( FlagOn(gTraceFlags,(_dbgLev原创 2014-01-09 11:00:12 · 1077 阅读 · 0 评论 -
win32读取raw扇区
#define WIN32_LEAN_AND_MEAN#include #include #include #define BytesPerSector 512char Drive[] = "\\\\.\\PHYSICALDRIVE0";BOOL ReadPhysicalSector(LONGLONG SectorStart, ULONG SectorCount, PVOI原创 2014-01-24 12:10:56 · 739 阅读 · 0 评论 -
windows启动停止服务
#include #include #define ____DEVICE_BASENAME ("myfirst")//// Get system error message string//PCSTR SystemMessage( DWORD nError){ static CHAR msg[256]; if (!FormatMessage( FORMAT_M原创 2013-10-16 16:03:23 · 873 阅读 · 0 评论 -
windows获得服务配置(驱动路径)
#include #include #include #define ____DEVICE_BASENAME ("myfirst")//// Get system error message string//PCSTR SystemMessage( DWORD nError){ static CHAR msg[256]; if (!FormatMessage(原创 2013-10-16 17:19:21 · 2962 阅读 · 0 评论 -
nullFilter
/* This is the main module of the nullFilter mini filter driver. It is a simple minifilter that registers itself with the main filter for no callback operations.*/#include #include #in原创 2013-11-01 16:46:07 · 830 阅读 · 0 评论 -
system thread
#includeVOID WorkThread(IN PVOID pContext){ int i; for(i=0;i<5;i++) DbgPrint("I am %d\r\n", i+1); PsTerminateSystemThread(STATUS_SUCCESS);}NTSTATUS DriverEntry(IN PDRIVER_OBJECT Driv原创 2013-11-05 15:48:49 · 727 阅读 · 0 评论 -
windows下获得磁盘分区信息
#define WIN32_LEAN_AND_MEAN#include #include #include #include #ifndef STORAGE_DEVICE_NUMBERtypedef struct _STORAGE_DEVICE_NUMBER { DEVICE_TYPE DeviceType; ULONG DeviceNumber; ULONG P原创 2014-01-17 11:58:20 · 3566 阅读 · 1 评论