[pso] [tema2][win] Imi crapa KeSynchronizeRoutine
Marius Nicolae
mariusn007 at gmail.com
Wed Apr 16 20:09:42 EEST 2008
Salut,
Scuze pentru mailul anterior, am apasat o combinatie nefericita de taste.
Reiau:
La tema2 pe windows, pentru sincronizarea cu intreruperile incerc sa
rulez in metoda de write a modulului, urmatoarea secventa de cod:
BOOLEAN sync_write(PVOID pServiceContext) {
return TRUE;
}
NTSTATUS uart_write(PDEVICE_OBJECT device, IRP *irp)
{
struct uart_dev *dev_id=(struct uart_dev*)device->DeviceExtension;
KeSynchronizeExecution(dev_id->pIntObj, sync_write, NULL);
IoCompleteRequest(irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
Cand rulez test.exe, imi apare un blue screen si zice ca a aparut o
eroare la adresa 8081f0d3.
Dupa restart, am rulat kd.exe -z c:\windows\memory.dmp
ln 8081f0d3 zice:
(8081f0ce) nt!KeSynchronizeExecution+0x5 | (8081f0fe) nt!KiChainedDispatch
iar u 8081f0d3 zice:
nt!KeSynchronizeExecution+0x5:
8081f0d3 8a4b29 mov cl,byte ptr [ebx+29h]
8081f0d6 ff15d0108080 call dword ptr [nt!_imp_KfRaiseIrql (808010d0)]
8081f0dc 50 push eax
8081f0dd ff742414 push dword ptr [esp+14h]
8081f0e1 ff542414 call dword ptr [esp+14h]
8081f0e5 8bd8 mov ebx,eax
8081f0e7 59 pop ecx
8081f0e8 ff15e4108080 call dword ptr [nt!_imp_KfLowerIrql (808010e4)]
Alte precizari:
Pentru a initializa dev_id->pIntObject, in DriverEntry, am ceva de genul:
for (i = 0; i < NCOM; ++i) {
NTSTATUS status;
KIRQL kIrql;
KAFFINITY kAffinity;
ULONG kVector;
kVector = HalGetInterruptVector(Internal, 0, irq[i], 0, &kIrql, &kAffinity);
status = IoConnectInterrupt(&devs[i].pIntObj, uart_interrupt_handle[i],
&devs[i], NULL, kVector, kIrql, kIrql, Latched, TRUE, kAffinity, FALSE );
if (!NT_SUCCESS(status)) {
DbgPrint("uart: can't get irq %d\n", irq[i]);
return status;
}
}
unde devs[i] a fost initializat asa:
struct uart_dev *di;
for(i=0; i < UART_MAX_MINORS; i++) {
if ((ret=IoCreateDevice(driver, sizeof(*di), TO_UNICODE(dev_name,
&dev_uname),
0xF0000000,0, FALSE, &device)) != STATUS_SUCCESS)
goto error;
di=(struct uart_dev*)device->DeviceExtension;
di->com = i;
devs[i] = *di;
}
Mentionez ca am masina virtuala de pe site, care si-a facut update de
la microdoft, de curand.
Stie cineva care ar putea fi cauza?
Multumesc,
Marius NICOLAE
More information about the pso
mailing list