Re: Win32 API and Kernel

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Don Burn (burn_at_stopspam.acm.org)
Date: 02/24/04


Date: Tue, 24 Feb 2004 09:16:15 -0500

The book referenced was out of date and crap when printed. I would strongly
advise against using it, at least if you want code that people will trust.

-- 
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Arkady Frenkel" <arkadyf@hotmailxdotxcom> wrote in message
news:%23ah72Au%23DHA.1212@TK2MSFTNGP12.phx.gbl...
> Yes , you can find that in
> http://www.windowsitlibrary.com/Documents/Book.cfm?DocumentID=356
> ( aware of wrap )
> Arkady
>
> "Bill Cunningham" <nospam@nspam.net> wrote in message
> news:#ujomwi#DHA.2524@TK2MSFTNGP10.phx.gbl...
> > So this is the Application call.
> > >
> > > BOOL ReadFile(HANDLE hFile,LPVOID lpBuffer,
> > >                            DWORD nNumberOfBytesToRead,
> > >                            LPDWORD lpNumberOfBytesRead,
> > >                            LPOVERLAPPED lpOverlapped);
> > >
> > > becomes the following native API:
> > >
> > And these bellow are system calls
> >
> > > NTSTATUS NtReadFile(IN HANDLE  FileHandle,
> > >                                         IN HANDLE  Event  OPTIONAL,
> > >                                         IN PIO_APC_ROUTINE  ApcRoutine
> > > OPTIONAL,
> > >                                         IN PVOID  ApcContext
OPTIONAL,
> > >                                         OUT PIO_STATUS_BLOCK
> > IoStatusBlock,
> > >                                         OUT PVOID  Buffer,
> > >                                         IN ULONG  Length,
> > >                                         IN PLARGE_INTEGER  ByteOffset
> > > OPTIONAL,
> > >                                         IN PULONG  Key  OPTIONAL);
> > >
> > > There is no news list for native API's, there is a book "Windows
NT/2000
> > > Native API Reference" by Gary Nebbett, and questions can sometimes be
> > > answered at microsoft.public.development.device.drivers.
> > >
> > > Now inside the kernel, there is a set of Kernel Support Routines
(KSR's)
> > > that allow programming of device drivers, so match the Ntxxx routines
> that
> > > perform the transition, and others are totally different such as:
> > >
> > > PVOID ExAllocatePoolWithTag(IN POOL_TYPE  PoolType,
> > >                                                    IN SIZE_T
> > NumberOfBytes,
> > >                                                    IN ULONG  Tag);
> > >
> > > The above is the kernel memory allocation routine. This is driver
> > > programming, since even a piece of code without a device is a driver
in
> > the
> > > kernel.  The new list for these is again:
> > > microsoft.public.development.device.drivers
> > >
> > >
> > > --
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > "Bill Cunningham" <nospam@nspam.net> wrote in message
> > > news:ekxFZ1e%23DHA.2664@TK2MSFTNGP09.phx.gbl...
> > > > I see by the meaning "Application" programming interface, the API is
> > used
> > > to
> > > > design applications at user layer.
> > > >     However since this group is about kernel programming, where do
you
> > get
> > > > the means to do it? The API calls in turn call on the kernel's
system
> > > calls
> > > > when needed I understand. Is there a Kernel Programming Interface?
> > > >
> > > >     Bill
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: [tip:core/rcu] rcu: Add diagnostic check for a possible CPU-hotplug race
    ... I am testing the right kernel version. ... # CAN Device Drivers ... # You can enable one or both FireWire driver stacks. ...
    (Linux-Kernel)
  • Re: mount PCI-express RAM memory as block device
    ... that points to the RAM memory on the PCI card, ... tried to remap so that the kernel can address it using ... I wrote a pci driver (character driver ... use> the appropriate copy_to/from_userroutines. ...
    (Linux-Kernel)
  • Re: freed_symbols [Re: People, not GPL [was: Re: Driver Model]]
    ... this is why most device drivers ARE derived from the kernel and ... interface it with the kernel without making it a derived work. ... >> force the GPL on a driver that works with that version of the kernel ... > I think we both a agree that such a driver would be a derived work. ...
    (Linux-Kernel)
  • Re: FreeBSD DRIVER DEVELOPMENT
    ... Most drivers in FreeBSD are written in C. ... Checking out some sample driver sources would be even better:) ... drivers are located in the kernel source ... writing device drivers is completely dependant upon a specific kernel. ...
    (freebsd-questions)
  • Serial PCI driver in 2.6.x kernel (i.e. 8250_pci HOWTO)
    ... I am paraphrasing my thread "development of serial driver" from the ... I am a developer for a line of multi-port PCI serial cards. ... I have been painfully digging through the linux kernel mailing list archive ... .init and .setup routines. ...
    (Linux-Kernel)