|
不知这里能否问个 关于C# socket与服务器的问题
missdiog server ,client 都用wireshark、tcpdump抓一下包,发出来帮你分析一下。不过我觉得这应该是云主机配置的问题,好吧,那我先抓一下 |
|
使用IRPTRACE跟踪IRP无法查看其信息
我选 的是NT式驱动啊, |
|
问问用WinDbg打开蓝屏产生的DMP文件显示的信息问题
就是说,出现这些信息就是正常了吗? 那为什么没出来CONTEXT 的信息? |
|
问问用WinDbg打开蓝屏产生的DMP文件显示的信息问题
******************************************************************************* * * * Bugcheck Analysis * * * ******************************************************************************* Use !analyze -v to get detailed debugging information. BugCheck 19, {20, 8960f7b0, 8960f7d8, a050007} Probably caused by : BSODCheck.sys ( BSODCheck!DriverEntry+59 ) Followup: MachineOwner --------- kd> !analyze -v ******************************************************************************* * * * Bugcheck Analysis * * * ******************************************************************************* BAD_POOL_HEADER (19) The pool is already corrupt at the time of the current request. This may or may not be due to the caller. The internal pool links must be walked to figure out a possible cause of the problem, and then special pool applied to the suspect tags or the driver verifier to a suspect driver. Arguments: Arg1: 00000020, a pool block header size is corrupt. Arg2: 8960f7b0, The pool entry we were looking for within the page. Arg3: 8960f7d8, The next pool entry. Arg4: 0a050007, (reserved) Debugging Details: ------------------ BUGCHECK_STR: 0x19_20 POOL_ADDRESS: 8960f7b0 Nonpaged pool DEFAULT_BUCKET_ID: DRIVER_FAULT PROCESS_NAME: System LAST_CONTROL_TRANSFER: from 80545a86 to 804f9cb5 STACK_TEXT: bacfbc10 80545a86 00000019 00000020 8960f7b0 nt!KeBugCheckEx+0x1b bacfbc60 bac69179 8960f7b8 00000000 00000004 nt!ExFreePoolWithTag+0x2a0 bacfbc7c 8057777f 895acb10 89748000 00000000 BSODCheck!DriverEntry+0x59 [e:\agptemp\temp\bsodcheck\bsodcheck.c @ 61] bacfbd4c 8057788f 80000904 00000001 00000000 nt!IopLoadDriver+0x66d bacfbd74 80535c02 80000904 00000000 89a328b8 nt!IopLoadUnloadDriver+0x45 bacfbdac 805c7160 b1b9dcf4 00000000 00000000 nt!ExpWorkerThread+0x100 bacfbddc 80542dd2 80535b02 00000001 00000000 nt!PspSystemThreadStartup+0x34 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16 STACK_COMMAND: kb FOLLOWUP_IP: BSODCheck!DriverEntry+59 [e:\agptemp\temp\bsodcheck\bsodcheck.c @ 61] bac69179 6800800080 push 80008000h FAULTING_SOURCE_CODE: 57: { 58: memcpy(pwz_buf,theRegistryPath->Buffer,theRegistryPath->Length); 59: ExFreePool(pwz_buf); 60: } > 61: IsExitProcess(0x80008000); 62: 63: return STATUS_SUCCESS; 64: } SYMBOL_STACK_INDEX: 2 SYMBOL_NAME: BSODCheck!DriverEntry+59 FOLLOWUP_NAME: MachineOwner MODULE_NAME: BSODCheck IMAGE_NAME: BSODCheck.sys DEBUG_FLR_IMAGE_TIMESTAMP: 53925617 FAILURE_BUCKET_ID: 0x19_20_BSODCheck!DriverEntry+59 BUCKET_ID: 0x19_20_BSODCheck!DriverEntry+59 Followup: MachineOwner 这是这次出来的提示,这应该是不完整的吧? |
|
问问用WinDbg打开蓝屏产生的DMP文件显示的信息问题
这次我重新把项目重新编译,得出SYS文件,然后直接拿到虚拟机,运行SYS,蓝屏,然后生成DMP文件,生成后重启了虚拟机,进入系统把DMP文件取出来到我的64位系统中,然后用WinDbg-Open Crash Dump打开DMP文件分析,但这次出现的信息依然是没有CONTEXT 蓝屏时候的现场环境,这是为什么呢?CONTEXT不是一定会出来的吗? 还有一个问题就是,我运行SYS蓝屏后,虚拟机系统自动启动,但到了那个XP标题的读取界面,就一直卡住在那里,一动不动,必须要我再手动,RESTART 后才能进入系统,这又是为什么呢? |
|
DriverMonitor加载驱动不成功,求解
确实 是因为之前代码写错,没有把设备删除干净,所以后来代码改回while(pNextObj != NULL) 也不能解决问题,之后重启了系统,再运行就没有问题了。 |
|
DriverMonitor加载驱动不成功,求解
#include "Driver.h" #pragma INITCODE VOID StringInitTest() { //(1)用RtlInitAnsiString初始化字符串 ANSI_STRING AnsiString1; CHAR * string1= "hello"; //初始化ANSI_STRING字符串 RtlInitAnsiString(&AnsiString1,string1); KdPrint(("AnsiString1:%Z\n",&AnsiString1));//打印hello string1[0]='H'; string1[1]='E'; string1[2]='L'; string1[3]='L'; string1[4]='O'; //改变string1,AnsiString1同样会导致变化 KdPrint(("AnsiString1:%Z\n",&AnsiString1));//打印HELLO //(2)程序员自己初始化字符串 #define BUFFER_SIZE 1024 UNICODE_STRING UnicodeString1 = {0}; //设置缓冲区大小 UnicodeString1.MaximumLength = BUFFER_SIZE; //分配内存 // 参一:Specifies the type of pool memory to allocate. UnicodeString1.Buffer = (PWSTR)ExAllocatePool(PagedPool,BUFFER_SIZE); WCHAR* wideString = L"hello"; //设置字符长度,因为是宽字符,所以是字符长度的2倍 UnicodeString1.Length = 2*wcslen(wideString); //保证缓冲区足够大,否则程序终止 ASSERT(UnicodeString1.MaximumLength>=UnicodeString1.Length); //内存拷贝, RtlCopyMemory(UnicodeString1.Buffer,wideString,UnicodeString1.Length); //设置字符长度 UnicodeString1.Length = 2*wcslen(wideString); KdPrint(("UnicodeString:%wZ\n",&UnicodeString1)); //清理内存 ExFreePool(UnicodeString1.Buffer); UnicodeString1.Buffer = NULL; UnicodeString1.Length = UnicodeString1.MaximumLength = 0; } /************************************************************************ * 函数名称:DriverEntry * 功能描述:初始化驱动程序,定位和申请硬件资源,创建内核对象 * 参数列表: pDriverObject:从I/O管理器中传进来的驱动对象 pRegistryPath:驱动程序在注册表的中的路径 * 返回 值:返回初始化驱动状态 *************************************************************************/ #pragma INITCODE// 放在INIT段,加载结束可从内存中卸载 extern "C" NTSTATUS DriverEntry ( IN PDRIVER_OBJECT pDriverObject, // IN-代表参数纯粹用于输入目的,OUT-代表这参数仅用于函数的输出参数,INOUT-既可以输入又可以输出的参数 IN PUNICODE_STRING pRegistryPath ) { NTSTATUS status; KdPrint(("Enter DriverEntry\n")); //注册其他驱动调用函数入口 // 向Windows的I/O管理器注册一些回调函数 pDriverObject->DriverUnload = HelloDDKUnload; pDriverObject->MajorFunction[IRP_MJ_CREATE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_CLOSE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_WRITE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_READ] = HelloDDKDispatchRoutine; //创建驱动设备对象 status = CreateDevice(pDriverObject); StringInitTest(); KdPrint(("DriverEntry end\n")); return status; } /************************************************************************ * 函数名称:CreateDevice * 功能描述:初始化设备对象 (此函数能将多个设备对象链接在一起) * 参数列表: pDriverObject:从I/O管理器中传进来的驱动对象 * 返回 值:返回初始化状态 *************************************************************************/ #pragma INITCODE // 指明此函数加载到INIT内存区域,成功卸载后可退出内存 NTSTATUS CreateDevice ( IN PDRIVER_OBJECT pDriverObject) { NTSTATUS status; PDEVICE_OBJECT pDevObj; PDEVICE_EXTENSION pDevExt; //创建设备名称 UNICODE_STRING devName;// 存储设备对象名称 RtlInitUnicodeString(&devName,L"\\Device\\MyDDKDevice"); //创建设备 创建设备对象 status = IoCreateDevice( pDriverObject, sizeof(DEVICE_EXTENSION), &(UNICODE_STRING)devName, FILE_DEVICE_UNKNOWN,// 此设备为独占设备,只能被一个应用程序使用 一般虚拟设备常使用这个作为设备类型 0,// 指定一个或多个系统定义的常量,连接在一起,提供有关驱动程序的设备其他信息. TRUE,// 如果是独占的话设置为TRUE,非独占设置为FALSE. &pDevObj );// 指向的指针用来接收DEVICE_OBJECT结构体. if (!NT_SUCCESS(status)) return status; pDevObj->Flags |= DO_BUFFERED_IO;// 表明此种设备为BUFFERED_IO设备 读写操作使用缓冲方式 书P114 将设备设置成缓冲区设备 // 填写设备的扩展结构体,在其它驱动程序的函数中可很方便得到这个结构体,进而得到该设备的自定义信息 pDevExt = (PDEVICE_EXTENSION)pDevObj->DeviceExtension;// 得到设备对象扩展数据结构 // 设置设备扩展的设备对象 pDevExt->pDevice = pDevObj; // 设置设备扩展中的设备名称 pDevExt->ustrDeviceName = devName; //创建符号链接 UNICODE_STRING symLinkName; RtlInitUnicodeString(&symLinkName,L"\\??\\HelloDDK"); // 符号链接以 \??\ 开头, 如C盘是 \??\C pDevExt->ustrSymLinkName = symLinkName; status = IoCreateSymbolicLink( &symLinkName,&devName ); if (!NT_SUCCESS(status)) { IoDeleteDevice( pDevObj ); // 删除设备对象 return status; } return STATUS_SUCCESS; } /************************************************************************ * 函数名称:HelloDDKUnload * 功能描述:负责驱动程序的卸载操作 * 参数列表: pDriverObject:驱动对象 * 返回 值:返回状态 *************************************************************************/ // 由I/O管理器负责调用此回调函数 // 卸载驱动例程主要目的是遍历系统中所有此类设备对象,然后删除设备对象及符号链接 #pragma PAGEDCODE VOID HelloDDKUnload (IN PDRIVER_OBJECT pDriverObject) { PDEVICE_OBJECT pNextObj; KdPrint(("Enter DriverUnload\n")); pNextObj = pDriverObject->DeviceObject;// 第一个设备对象的地址存在于驱动对象的DeviceObject域 while (pNextObj != NULL) { PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION) pNextObj->DeviceExtension; // 得到设备扩展 设备的扩展结构体 //删除符号链接 UNICODE_STRING pLinkName = pDevExt->ustrSymLinkName; IoDeleteSymbolicLink(&pLinkName); pNextObj = pNextObj->NextDevice; // 每个设备对象的NextDevice域记录着下一个设备对象的地址 // 删除设备 IoDeleteDevice( pDevExt->pDevice );// 参数就是要被删除的设备对象指针 } } /************************************************************************ * 函数名称:HelloDDKDispatchRoutine * 功能描述:对读IRP进行处理 * 参数列表: pDevObj:功能设备对象 pIrp:从IO请求包 * 返回 值:返回状态 *************************************************************************/ // 对设备对象的创建,关闭和读写操作都被指定到这个默认的派遣例程中 #pragma PAGEDCODE NTSTATUS HelloDDKDispatchRoutine(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { KdPrint(("Enter HelloDDKDispatchRoutine\n")); NTSTATUS status = STATUS_SUCCESS; // 完成IRP pIrp->IoStatus.Status = status; pIrp->IoStatus.Information = 0; // bytes xfered // This value is IO_NO_INCREMENT if the original thread requested an operation // the driver could complete quickly (so the requesting thread is not compensated for its assumed wait for I/O to be completed) // or if the IRP is completed with an error. // 如果要求操作的原始线程需要驱动程序快速的完成处理, // 或者IRP填充完成时有错误发生,那么这个值就应该设为 IO_NO_INCREMENT。 IoCompleteRequest( pIrp, IO_NO_INCREMENT ); KdPrint(("Leave HelloDDKDispatchRoutine\n")); return status; } 我6楼的代码就是按照上面的代码抄来的,但这段代码生成的SYS文件,就能不停地加载,不会出现1楼所说的提示,但我用6楼的代码就会有这提示,请问是怎么回事啊? 我已经把while(!pNextObj) 改回 while(pNextObj != NULL) 还是这样。 求教啊 |
|
DriverMonitor加载驱动不成功,求解
头文件 #pragma once #ifdef __cplusplus extern "C" { #endif #include <NTDDK.h> #ifdef __cplusplus } #endif #define PAGEDCODE code_seg("PAGE") #define LOCKEDCODE code_seg() #define INITCODE code_seg("INIT") #define PAGEDDATA data_seg("PAGE") #define LOCKEDDATA data_seg() #define INITDATA data_seg("INIT") #define arraysize(p) (sizeof(p)/sizeof((p)[0])) typedef struct _DEVICE_EXTENSION { PDEVICE_OBJECT pDevice; UNICODE_STRING ustrDeviceName; //设备名称 UNICODE_STRING ustrSymLinkName; //符号链接名 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; // 函数声明 NTSTATUS CreateDevice (IN PDRIVER_OBJECT pDriverObject); VOID HelloDDKUnload (IN PDRIVER_OBJECT pDriverObject); NTSTATUS HelloDDKDispatchRoutine(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp); #include "Driver.h" #pragma INITCODE VOID StringInitTest() { ANSI_STRING AnsiString1; CHAR *string1 = "hello"; RtlInitAnsiString(&AnsiString1, string1); KdPrint(("Ansistring1:%Z\n", &AnsiString1)); string1[0] = 'H'; string1[1] = 'f'; string1[2] = 'L'; string1[3] = 'L'; string1[4] = 'O'; KdPrint(("AnsiString1:%Z\n", &AnsiString1)); #define BUFFER_SIZE 1024 UNICODE_STRING UnicodeString1 = {0}; UnicodeString1.MaximumLength = BUFFER_SIZE; UnicodeString1.Buffer = (PWSTR)ExAllocatePool(PagedPool, BUFFER_SIZE); WCHAR *wideString = L"hello"; UnicodeString1.Length = 2 * wcslen(wideString); ASSERT(UnicodeString1.MaximumLength >= UnicodeString1.Length); RtlCopyMemory(UnicodeString1.Buffer, wideString, UnicodeString1.Length); KdPrint(("UnidodeString:%wZ\n", &UnicodeString1)); ExFreePool(UnicodeString1.Buffer); UnicodeString1.Buffer = NULL; UnicodeString1.Length = UnicodeString1.MaximumLength = 0; } /************************************************************************ * 函数名称:DriverEntry * 功能描述:初始化驱动程序,定位和申请硬件资源,创建内核对象 * 参数列表: pDriverObject:从I/O管理器中传进来的驱动对象 pRegistryPath:驱动程序在注册表的中的路径 * 返回 值:返回初始化驱动状态 *************************************************************************/ #pragma INITCODE extern "C" NTSTATUS DriverEntry( IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath) { NTSTATUS status; KdPrint(("Enter driverEntry\n")); pDriverObject->DriverUnload = HelloDDKUnload; pDriverObject->MajorFunction[IRP_MJ_CREATE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_CLOSE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_WRITE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_READ] = HelloDDKDispatchRoutine; status = CreateDevice(pDriverObject); StringInitTest(); KdPrint(("driverEntry end\n")); return status; } /************************************************************************ * 函数名称:CreateDevice * 功能描述:初始化设备对象 * 参数列表: pDriverObject:从I/O管理器中传进来的驱动对象 * 返回 值:返回初始化状态 *************************************************************************/ #pragma INITCODE NTSTATUS CreateDevice(IN PDRIVER_OBJECT pDriverObject) { NTSTATUS status; PDEVICE_OBJECT pDevObj; PDEVICE_EXTENSION pDevExt; UNICODE_STRING devName; RtlInitUnicodeString(&devName, L"\\Device\\MyDDKDevice"); status = IoCreateDevice(pDriverObject, sizeof(DEVICE_EXTENSION), &(UNICODE_STRING)devName, FILE_DEVICE_UNKNOWN, 0, TRUE, &pDevObj); if(!NT_SUCCESS(status)) return status; pDevObj->Flags |= DO_BUFFERED_IO; pDevExt = (PDEVICE_EXTENSION)pDevObj->DeviceExtension; pDevExt->pDevice = pDevObj; pDevExt->ustrDeviceName = devName; UNICODE_STRING symLinkName; RtlInitUnicodeString(&symLinkName, L"\\??\\HelloDDK"); pDevExt->ustrSymLinkName = symLinkName; status = IoCreateSymbolicLink(&symLinkName, &devName); if(!NT_SUCCESS(status)) { IoDeleteDevice(pDevObj); return status; } return STATUS_SUCCESS; } /************************************************************************ * 函数名称:HelloDDKUnload * 功能描述:负责驱动程序的卸载操作 * 参数列表: pDriverObject:驱动对象 * 返回 值:返回状态 *************************************************************************/ #pragma PAGEDCODE VOID HelloDDKUnload(IN PDRIVER_OBJECT pDriverObject) { PDEVICE_OBJECT pNextObj; KdPrint(("Enter DriverUnload\n")); pNextObj = pDriverObject->DeviceObject; while(!pNextObj) { PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)pNextObj->DeviceExtension; UNICODE_STRING pLinkName = pDevExt->ustrSymLinkName; IoDeleteSymbolicLink(&pLinkName); pNextObj = pNextObj->NextDevice; IoDeleteDevice(pDevExt->pDevice); } } /************************************************************************ * 函数名称:HelloDDKDispatchRoutine * 功能描述:对读IRP进行处理 * 参数列表: pDevObj:功能设备对象 pIrp:从IO请求包 * 返回 值:返回状态 *************************************************************************/ #pragma PAGEDCODE NTSTATUS HelloDDKDispatchRoutine(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { KdPrint(("Enter HelloDDKDispatchRoutine\n")); NTSTATUS status = STATUS_SUCCESS; pIrp->IoStatus.Status = status; pIrp->IoStatus.Information = 0; IoCompleteRequest(pIrp, IO_NO_INCREMENT); KdPrint(("leave HelloDDKDispatchRoutine\n")); return status; } 全部的了 |
|
DriverMonitor加载驱动不成功,求解
有啊,代码都直接抄过来的, 如果没有的话,我第一次卸载不了啊 #pragma INITCODE extern "C" NTSTATUS DriverEntry ( IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath ) { NTSTATUS status; KdPrint(("Enter DriverEntry\n")); //注册其他驱动调用函数入口 pDriverObject->DriverUnload = HelloDDKUnload; pDriverObject->MajorFunction[IRP_MJ_CREATE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_CLOSE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_WRITE] = HelloDDKDispatchRoutine; pDriverObject->MajorFunction[IRP_MJ_READ] = HelloDDKDispatchRoutine; //创建驱动设备对象 status = CreateDevice(pDriverObject); StringTest(); KdPrint(("DriverEntry end\n")); return status; } ........ ........ #pragma PAGEDCODE VOID HelloDDKUnload (IN PDRIVER_OBJECT pDriverObject) { PDEVICE_OBJECT pNextObj; KdPrint(("Enter DriverUnload\n")); pNextObj = pDriverObject->DeviceObject; while (pNextObj != NULL) { PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION) pNextObj->DeviceExtension; //删除符号链接 UNICODE_STRING pLinkName = pDevExt->ustrSymLinkName; IoDeleteSymbolicLink(&pLinkName); pNextObj = pNextObj->NextDevice; IoDeleteDevice( pDevExt->pDevice ); } } |
|
想问问关于WinDbg无法连接上WIN7的解决办法
也许这也是问题,不过我没试这个,还是先谢谢 |
|
想问问关于WinDbg无法连接上WIN7的解决办法
果然是这样,太感谢了 |
|
想问问关于WinDbg无法连接上WIN7的解决办法
这样啊,我回去看看,是不是这问题 |
|
想问问关于WinDbg无法连接上WIN7的解决办法
[QUOTE=aait;1275153]这不是写了serial port 2吗? [/QUOTE] 那 user named pipe那里要写成 \\.\pipe\com_2 ????? |
|
想问问关于WinDbg无法连接上WIN7的解决办法
哦,这样啊,我回去下来试试行不行 |
|
想问问关于WinDbg无法连接上WIN7的解决办法
我印象中,右下角没显示,我回去看看,如果那里显示不对的话,要怎么改呢? |
|
想问问关于WinDbg无法连接上WIN7的解决办法
我不是贴图了么? 是\\.\pipe\com_1 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值