Re: Unsized Arrays in Structures, and user space
- From: "Hesham Desouky" <hesham>
- Date: Wed, 14 Dec 2005 11:15:13 +0200
just for knowledge,
why mapping to user space is a bad idea?
"Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
news:ODXqGg$$FHA.272@xxxxxxxxxxxxxxxxxxxxxxx
> Well if you possibly can have the application pass the buffers in and have
> the driver lock them down.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
>
>
> "Hesham Desouky" <hesham> wrote in message
> news:uP60oa$$FHA.292@xxxxxxxxxxxxxxxxxxxxxxx
> > Thanks for reply
> >
> > I am using Compuware Driverworks for driver development and it is c++.
> >
> > Anyhow, what are you suggesting for sharing memory between the driver
and
> > the application?
> >
> > The driver needs to allocate large amount of locked memory to stream
high
> > rate data from hardware device. So what mechanism you sugges?
> >
> > Sorry for double post
> >
> > Thanks
> >
> > "Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
> > news:uT994W$$FHA.3872@xxxxxxxxxxxxxxxxxxxxxxx
> >> Well first mapping anything to user space that was allocated in the
> >> kernel
> >> is a bad idea. Second, mapping ps does not map memory it points to.
> > Third,
> >> asking the level of questions you are, I would not recomend C++ in the
> >> kernel.
> >>
> >>
> >> --
> >> Don Burn (MVP, Windows DDK)
> >> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >> Remove StopSpam from the email to reply
> >>
> >>
> >>
> >>
> >> "Hesham Desouky" <hesham> wrote in message
> >> news:uuNWSS$$FHA.3392@xxxxxxxxxxxxxxxxxxxxxxx
> >> > Hello all
> >> > I have the following:
> >> >
> >> > struct mystruct
> >> > {
> >> > int a;
> >> > UCHAR d[];
> >> > };
> >> >
> >> > this structure is allocated in the driver from the heap with the
> > following
> >> > code:
> >> >
> >> > PUCHAR p = new(NonPagedPool)UCHAR[sizeof(s) + 512];
> >> >
> >> > mystruct* ps = (mystruct*)ps;
> >> > so now ps->d points to 512 bytes;
> >> >
> >> > If I mapped the ps structure to the user space, is d will have the
> > coorect
> >> > mapped use space address to point to the allocated memory?
> >> >
> >> > Thanks for support
> >> >
> >> >
> >>
> >>
> >
> >
>
>
.
- Follow-Ups:
- Re: Unsized Arrays in Structures, and user space
- From: Maxim S. Shatskih
- Re: Unsized Arrays in Structures, and user space
- From: Don Burn
- Re: Unsized Arrays in Structures, and user space
- References:
- Unsized Arrays in Structures, and user space
- From: Hesham Desouky
- Re: Unsized Arrays in Structures, and user space
- From: Don Burn
- Re: Unsized Arrays in Structures, and user space
- From: Hesham Desouky
- Re: Unsized Arrays in Structures, and user space
- From: Don Burn
- Unsized Arrays in Structures, and user space
- Prev by Date: Re: Tool to detect drivers with long period at DISPATCH_LEVEL?
- Next by Date: x64 porting: error C4013: 'HalGetInterruptVector' undefined
- Previous by thread: Re: Unsized Arrays in Structures, and user space
- Next by thread: Re: Unsized Arrays in Structures, and user space
- Index(es):
Relevant Pages
|
|