Я дизассемблировал Идой один драйверок и в нужном мне месте натолкнулся на ExCreateCallback. Я об этой функции не слышал и естевственно полез в инет, но ничего толкового на руском языке так и не нашёл( Но мне очень хотелось бы понять, как этот кусок работает Код (Text): PAGE:0001058A ; int __stdcall MouFilter_AddDevice(PDRIVER_OBJECT DeviceObject, PDEVICE_OBJECT TargetDevice) PAGE:0001058A public _MouFilter_AddDevice@8 PAGE:0001058A _MouFilter_AddDevice@8 proc near ; DATA XREF: DriverEntry(x,x)+44o PAGE:0001058A PAGE:0001058A ObjectAttributes= OBJECT_ATTRIBUTES ptr -24h PAGE:0001058A DestinationString= UNICODE_STRING ptr -0Ch PAGE:0001058A CallbackObject = dword ptr -4 PAGE:0001058A DeviceObject = dword ptr 8 PAGE:0001058A TargetDevice = dword ptr 0Ch PAGE:0001058A PAGE:0001058A push ebp PAGE:0001058B mov ebp, esp PAGE:0001058D sub esp, 24h PAGE:00010590 push ebx PAGE:00010591 lea eax, [ebp+DeviceObject] PAGE:00010594 push esi PAGE:00010595 xor ebx, ebx PAGE:00010597 push eax ; DeviceObject PAGE:00010598 push ebx ; Exclusive PAGE:00010599 push ebx ; DeviceCharacteristics PAGE:0001059A push 0Fh ; DeviceType PAGE:0001059C push ebx ; DeviceName PAGE:0001059D push 3Ch ; DeviceExtensionSize PAGE:0001059F push [ebp+DeviceObject] ; DriverObject PAGE:000105A2 call ds:__imp__IoCreateDevice@28 ; IoCreateDevice(x,x,x,x,x,x,x) PAGE:000105A8 cmp eax, ebx PAGE:000105AA jl loc_10640 PAGE:000105B0 mov edx, [ebp+DeviceObject] PAGE:000105B3 push edi PAGE:000105B4 push 0Fh PAGE:000105B6 xor eax, eax PAGE:000105B8 mov edi, [edx+28h] PAGE:000105BB pop ecx PAGE:000105BC rep stosd PAGE:000105BE mov edi, [ebp+TargetDevice] PAGE:000105C1 mov eax, [ebp+DeviceObject] PAGE:000105C4 push edi ; TargetDevice PAGE:000105C5 push eax ; SourceDevice PAGE:000105C6 mov esi, [eax+28h] PAGE:000105C9 call ds:__imp__IoAttachDeviceToDeviceStack@8 ; IoAttachDeviceToDeviceStack(x,x) PAGE:000105CF mov [esi+24h], eax PAGE:000105D2 mov eax, [ebp+DeviceObject] PAGE:000105D5 push 1 PAGE:000105D7 mov [esi+20h], edi PAGE:000105DA mov [esi+1Ch], eax PAGE:000105DD pop edi PAGE:000105DE lea eax, [ebp+DestinationString] PAGE:000105E1 push offset $SG6275 ; "\\Callback\\MouseInput" PAGE:000105E6 push eax ; DestinationString PAGE:000105E7 mov [esi+34h], edi PAGE:000105EA mov [esi+39h], bl PAGE:000105ED mov [esi+3Ah], bl PAGE:000105F0 mov [esi+38h], bl PAGE:000105F3 call ds:__imp__RtlInitUnicodeString@8 ; RtlInitUnicodeString(x,x) PAGE:000105F9 lea eax, [ebp+DestinationString] PAGE:000105FC push ebx ; AllowMultipleCallbacks PAGE:000105FD mov [ebp+ObjectAttributes.ObjectName], eax PAGE:00010600 lea eax, [ebp+ObjectAttributes] PAGE:00010603 push edi ; Create PAGE:00010604 push eax ; ObjectAttributes PAGE:00010605 lea eax, [ebp+CallbackObject] PAGE:00010608 mov [ebp+ObjectAttributes.Length], 18h PAGE:0001060F push eax ; CallbackObject PAGE:00010610 mov [ebp+ObjectAttributes.RootDirectory], ebx PAGE:00010613 mov [ebp+ObjectAttributes.Attributes], 50h PAGE:0001061A mov [ebp+ObjectAttributes.SecurityDescriptor], ebx PAGE:0001061D mov [ebp+ObjectAttributes.SecurityQualityOfService], ebx PAGE:00010620 call ds:__imp__ExCreateCallback@16 ; ExCreateCallback(x,x,x,x) PAGE:00010626 cmp eax, ebx PAGE:00010628 pop edi PAGE:00010629 jl short loc_10640 PAGE:0001062B mov ecx, [ebp+CallbackObject] PAGE:0001062E mov [esi], ecx PAGE:00010630 mov ecx, [ebp+DeviceObject] PAGE:00010633 or word ptr [ecx+1Ch], 2004h PAGE:00010639 mov ecx, [ebp+DeviceObject] PAGE:0001063C and byte ptr [ecx+1Ch], 7Fh PAGE:00010640 PAGE:00010640 loc_10640: ; CODE XREF: MouFilter_AddDevice(x,x)+20j PAGE:00010640 ; MouFilter_AddDevice(x,x)+9Fj PAGE:00010640 pop esi PAGE:00010641 pop ebx PAGE:00010642 leave PAGE:00010643 retn 8 PAGE:00010643 _MouFilter_AddDevice@8 endp
Создает Callback по линку "\\Callback\\MouseInput" Callback мехназим для комуникации драйверов("\\Callback\\MouseInput" либо не документированный виндовый, либо каких дров) по идеи спайс. http://msdn.microsoft.com/en-us/library/ff540718%28v=VS.85%29.aspx