|
我自己写的驱动 就入口代码 怎么会慢慢死机呢?
还有 有个软件 VStart这个软件会死掉。是不是这个软件和我驱动有冲突啊?
驱动、代码
DispatchCreateClose proc pDeviceObject:PDEVICE_OBJECT, pIrp:PIRP ;DispatchCreateClose
mov eax,pIrp
assume eax : ptr _IRP
mov [eax].IoStatus.Status,STATUS_SUCCESS
and [eax].IoStatus.Information,0
assume eax : ptr nothing
invoke IoCompleteRequest,pIrp,IO_NO_INCREMENT
mov eax,STATUS_SUCCESS
ret
DispatchCreateClose endp
DriverUnload proc pDriverObject:PDRIVER_OBJECT ;DriverUnload
invoke IoDeleteSymbolicLink,addr usLinkName
mov eax,pDriverObject
invoke IoDeleteDevice,(DRIVER_OBJECT PTR [eax]).DeviceObject
invoke ZwClose,hWaitEvent
ret
DriverUnload endp
DispatchControl proc uses esi edi ebx pDeviceObject:PDEVICE_OBJECT, pIrp:PIRP ;DispatchControl
ret
DispatchControl endp
DriverEntry proc pDriverObject:PDRIVER_OBJECT, pusRegistryPath:PUNICODE_STRING
local status:NTSTATUS
local pDeviceObject:PVOID
local @dwTmp
mov eax,cr0
and eax,0FFFEFFFFH
mov cr0,eax
mov status, STATUS_DEVICE_CONFIGURATION_ERROR
invoke IoCreateDevice,pDriverObject,0,addr usDevName, FILE_DEVICE_UNKNOWN,0, FALSE, addr pDeviceObject
.if eax == STATUS_SUCCESS
invoke IoCreateSymbolicLink,addr usLinkName,addr usDevName
.if eax == STATUS_SUCCESS
mov eax,pDriverObject
assume eax : ptr DRIVER_OBJECT
mov [eax].MajorFunction[IRP_MJ_CREATE*(sizeof PVOID)], offset DispatchCreateClose
mov [eax].MajorFunction[IRP_MJ_CLOSE*(sizeof PVOID)], offset DispatchCreateClose
mov [eax].MajorFunction[IRP_MJ_DEVICE_CONTROL*(sizeof PVOID)], offset DispatchControl
mov [eax].DriverUnload, offset DriverUnload
assume eax:nothing
mov status, STATUS_SUCCESS
.else
invoke IoDeleteDevice, pDeviceObject
.endif
.endif
;int 3
mov eax,status
ret
DriverEntry endp
end DriverEntry
|
|