2014年7月28日

摘要: 设计模式中 最基本的工厂模式感觉就是根据输入的类型决定选择何种类与进行何种操作。跟面向过程中输入1则执行func1();输入2则执行func2()基本一致的想法#include using namespace std;enum eShoeType{ leather = 0,rubber};class... 阅读全文
posted @ 2014-07-28 11:29 itdef 阅读(615) 评论(1) 推荐(0) 编辑

2014年7月6日

摘要: int GBK2UTF8(char *szGbk,char *szUtf8,int Len) { // 先将多字节GBK(CP_ACP或ANSI)转换成宽字符UTF-16 // 得到转换后,所需要的内存字符数 int n = MultiByteToWideChar(CP_ACP,0,s... 阅读全文
posted @ 2014-07-06 13:23 itdef 阅读(300) 评论(0) 推荐(0) 编辑

2014年6月7日

摘要: redis是一个key-value存储系统。和Memcached类似,它的效率很高。目前推出了LIN版 本和WIN版本.虽然不怎么使用数据库,但是抱着开卷有益的心态,我学习了下其中的数 据结构,还是受益良多的。参考 <Redis 设计与实现> 黄健宏 (huangz1990). 1、内存管理 red 阅读全文
posted @ 2014-06-07 11:31 itdef 阅读(335) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include #include #include const int maxCount = 100;const int strMaxLen = 16; BOOLEAN IsMatchPattern(const char* ipPattern,const ... 阅读全文
posted @ 2014-06-07 11:22 itdef 阅读(701) 评论(0) 推荐(0) 编辑

2014年6月1日

摘要: 之前文章的改进版服务器仅仅接受客户端发送的字符串并显示客户端可以调节发送数目 但是不能超过64// SelectServer.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #pragma comment(lib,"ws2_32"... 阅读全文
posted @ 2014-06-01 13:32 itdef 阅读(540) 评论(0) 推荐(0) 编辑
摘要: // SelectCli.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #pragma comment(lib,"ws2_32")#define SOCKET_MAXCNT 64#define THREAD_NUM 2 //... 阅读全文
posted @ 2014-06-01 13:28 itdef 阅读(279) 评论(0) 推荐(0) 编辑

2014年5月29日

摘要: 学了文件过滤驱动,其实多少都要尝试下文件夹隐藏,网络上关于这些的讲解和代码都不少。主要是使用文件过滤驱动监控IRP_MJ_DIRECTORY_CONTROL的IRP,对其返回的FILE_BOTH_DIR_INFORMATION结构进行过滤和修改达到我们隐藏我们指定的文件夹的目的。FILE_BOTH_... 阅读全文
posted @ 2014-05-29 20:36 itdef 阅读(702) 评论(0) 推荐(0) 编辑
摘要: PDEVICE_OBJECTIoGetRelatedDeviceObject( IN PFILE_OBJECT FileObject )/*++Routine Description: This routine returns a pointer to the actual dev... 阅读全文
posted @ 2014-05-29 20:32 itdef 阅读(885) 评论(0) 推荐(0) 编辑
摘要: VOIDKiAdjustIrpCredits ( VOID )其中 Number = KeNumberProcessors;Prcb = KiProcessorBlock[Index];多核情况下调整每个CPU的IRP对象配额。在while (Index Lookaside... 阅读全文
posted @ 2014-05-29 20:30 itdef 阅读(477) 评论(0) 推荐(0) 编辑
摘要: if(bHooked == FALSE){RtlInitUnicodeString (&HookDriverName, L"\\FileSystem\\Ntfs");//获得\Driver\VolSnap驱动对象status = ObReferenceObjectByName (&HookDrive... 阅读全文
posted @ 2014-05-29 20:29 itdef 阅读(585) 评论(0) 推荐(0) 编辑

导航