Path: news.mitre.org!blanket.mitre.org!nntprelay.mathworks.com!news-peer-east.sprintlink.net!news-peer.sprintlink.net!news-backup-west.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!209.90.0.8!alpha.sky.net!newshub.cts.com!newsfeed.cts.com!cmkrnl!jeh From: jeh@cmkrnl.com (Jamie Hanrahan) Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode Subject: Re: multiprocessor issue Message-ID: <1998Jan25.113218.8445@cmkrnl> Date: 25 Jan 98 11:32:18 PST References: <34CB6BE2.25BF@tekram.com.tw> Organization: Kernel Mode Systems, San Diego, CA Lines: 27 In article <34CB6BE2.25BF@tekram.com.tw>, pkc writes: > Hi there, > > I have written a (booting)device driver for NT 4.0. It works well > under single processor kernel. But in dual processor environment, this > driver traps when calling KeWaitForSingleObject(...) from within a > thread created in my driver DriverEntry() routine. The thread priority > has been changed to LOW_REALTIME_PRIORITY at the entrance, and I have > tried to call KeAcquireSpinLock(...) before calling > KeWaitForSingleObject(...), thought I don't know if this is necessary. > > So how do i get around this? Simple - DON'T call KeAcquireSpinLock (or KeRaiseIrql) before calling KeWaitForEtc. KeAcquireSpinLock raises IRQL to DISPATCH_LEVEL. You can't enter a wait from >= DISPATCH_LEVEL (though you can call KeWaitForEtc. from == DISPATCH_LEVEL if you know that it won't actually wait, e.g. if you specify a timeout period of 0.) --- Jamie Hanrahan, Kernel Mode Systems, San Diego CA Internet: jeh@cmkrnl.com (JH645) CompuServe: 74140,2055 drivers, internals, networks, applications, and training for VMS and Windows NT NT driver FAQ, links, and other information: http://www.cmkrnl.com/ If you post a reply in news, please don't e-mail it too.