CE6.0 Driver Pointer Marshalling - passing pointers out only?



Hi all,

First off, apologies if this is a repost - I think something
odd is going on with my news server!

I've got a pretty complex driver I'm porting up at the moment
and am stuck scratching my head over a slightly odd issue. I have
an API that talks to the driver via DeviceIoControl() with various
structures that relate to API parameters.

For all of the calls so far its been straightforward mapping
embedded pointers via CeOpenCallerBuffer() and CeCloseCallerBuffer().
However there's a particular API function where the app passes in :
UINT8 **bufferarray;
UINT32 buffersize;
UINT32 buffercount;

This is an array of pointers to (n) buffers that get set up
_by_the_driver_ and returned to the caller rather than passed
in. i.e. the app sets up the count and size parameters and then
the driver allocates the buffers (via an internal allocation
routine from its own block of reserved memory). So I can map
in the bufferarray to set the pointers up in, but I can't work
out how to map the allocated buffers back into the callers
process space.

Obviously to map the buffer back out via the CeOpenCallerBuffer()
idiom it would have to have been passed in in the first place which
it wasnt so I'm kind of stumped trying to think what the most correct
mechanism to do this by would be?!

Of course I understand that changing the driver so it doesn't work
this way is likely to be the first suggested answer but this is a very
large driver and API that is cross platform to various other OS's and
this isn't a feasible option sadly...

Has anyone else had to try and get around this or a similar issue
in CE6.0 yet?

Best Wishes,

~Pev
.



Relevant Pages

  • [PATCH] [TRIVIAL] Fixing occurrences of "the the "
    ... Registering a driver using platform_driver_probeworks just like ... Free all pages associated with DMA buffers, the buffers and pages lists, and ... * hw - Struct containing variables accessed by shared code ... * This option is used to tune the the maximum retransmission attempts ...
    (Linux-Kernel)
  • Re: [PATCH] [TRIVIAL] Fixing occurrences of "the the "
    ... Registering a driver using platform_driver_probeworks just like ... Free all pages associated with DMA buffers, the buffers and pages lists, and ... * hw - Struct containing variables accessed by shared code ... * This option is used to tune the the maximum retransmission attempts ...
    (Linux-Kernel)
  • Re: DICE II Firewire Driver Settings
    ... usb etc) spend too much time in a DPC call, and the kernel cannot run the ... soundcard driver in time for it to service the audio buffers. ... arguments that people use in the Firewire vs. USB2 wars. ...
    (rec.audio.pro)
  • Re: Ring buffer overflow and LAN91C111 ethernet driver
    ... My network driver is the modified version of Linux SMC91111.c. ... handlereceive routine runs at tNetTask. ... allocating your RX buffers from. ... onto all fragments until the whole packet is reassembled. ...
    (comp.os.vxworks)
  • Re: XP SP2 WDM driver - Sharing Memory between driver and application
    ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... I'm almost translating my application from> Windows to Linux just because I can't make a WDM driver for my PCI> card... ... > I have a motion control PCI card that can command 2 motors. ... > The only big problem is that I need to share 10 buffers between the> driver and the user app. ...
    (microsoft.public.development.device.drivers)