Re: ntddk.h conflict with winnt.h
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 07 Feb 2007 01:23:27 -0500
See below
On 6 Feb 2007 13:49:02 -0800, "mitenko" <mitenko@xxxxxxxxx> wrote:
I'm trying to make a dll that will generate interrupts off the*****
parallel port. it's going to run on xp and nt machines.
It's never going to happen. A DLL runs in user space. Interrupts are generated by
hardware. If you want to simulate an interrupt, you need to be running in a
multiprocessor HAL and generate the interrupt from within the kernel. A user DLL can
never do this.
We simulate interrupts in the device simulator we use in our Device Driver course. But
that is done in a kernel device driver.
Note that the uniprocessor HAL will not suport the simulation of interrupts even from
within the kernel. This feature was removed by NT4 SP4.
*****
*****
i would love to just use inpout32.dll but it doesn't make use of
interrupts and the signal i'm trying to catch comes in fast (lasts 50
microsec). if there's an easier way to do this, please, please let me
know.
You are living in a dream world. In the best of all possible conditions you MIGHT catch
this signal line, but it is unlikely it will ever happen. Think about it: your thread is
polling, and gets suspended for 200ms. What happens to your examination of the signal?
There is no possible way a user-level piece of code will be able to interact with
hardware. It isn't going to happen. All the wishing in the world will not make it
happen. It cannot be done. User code cannot receive interrupts. User code cannot cause
interrupts. User code does not embody any CONCEPT of interrupts. There is no mechanism
in WIndows for delivering interrupts to user space.
You can write a device driver to do this, but since you specify the parallel port, life
has gotten thoroughly miserable, because you somehow have to replace the default parallel
port driver with yours. This involves deep mysteries.
If your device obeys standard parallel-port hardware protocols, rather than being
completely ad-hoc, you can probably use the existing parallel port driver, or buy a
third-party PP driver. You might want to look at http://www.thaiio.com/parallelport.html
for pointers to interesting places.
This is a real operating system, not MS-DOS.
joe
Joseph M. Newcomer [MVP]
On Feb 5, 7:19 pm, Joseph M. Newcomer <newco...@xxxxxxxxxxxx> wrote:
First, what kind of DLL would use the DDK? [I know a couple answers, but I want to hear
yours].
Yes, there is a problem; this is usually solved by putting the DDK in a namespace, e.g.,
namespace NTDDK {
#include <ntddk.h>
}
(A trick I picked up from Nebbet's Undocumented Windows 2000 book) but the newer DDKs will
generate fatal errors, and I had put put conditionals in the DDK of the form
#ifndef __NEBBETT
....stuff here
#endif
around the offending sections. You should not comment lines out, you should remove them
with a conditional.
joe
On 5 Feb 2007 17:25:18 -0800, "mitenko" <mite...@xxxxxxxxx> wrote:
hi everyone,
this is killing me. i'm trying to make a .dll using the Windows ddk
but everytime i try to compile i keep getting redefinition errors.
i've been going through the include files, commenting out lines but
there's got to be a better way to do this? am i using the wrong
version? i'm using VC .NET.
Note: including file: C:\WinDDK\6000\inc\ddk\ntddk.h
Note: including file: C:\WinDDK\6000\inc\ddk\wdm.h
Note: including file: C:\WinDDK\6000\inc\api\ntdef.h
C:\WinDDK\6000\inc\api\ntdef.h(80) : warning C4005:
'MAX_NATURAL_ALIGNMENT' : macro redefinition
C:\WinDDK\6000\inc\api\WINNT.H(55) : see previous definition
of 'MAX_NATURAL_ALIGNMENT'
Joseph M. Newcomer [MVP]
email: newco...@xxxxxxxxxxxx
Web:http://www.flounder.com
MVP Tips:http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- ntddk.h conflict with winnt.h
- From: mitenko
- Re: ntddk.h conflict with winnt.h
- From: Joseph M . Newcomer
- Re: ntddk.h conflict with winnt.h
- From: mitenko
- ntddk.h conflict with winnt.h
- Prev by Date: Re: how to write the parameter of CreateService (the last two)
- Next by Date: Re: Closing an App
- Previous by thread: Re: ntddk.h conflict with winnt.h
- Next by thread: Re: Converting from 6.0 to VS2005
- Index(es):
Relevant Pages
|