Sharing memory between kernel and user mode program

Hi all,

I need to develop a driver that shares memory to user programs I’ve tryed many ways to do this but without results; the last I’m trying is to MapViewOfFile the portion of memory allocated in the kernel. I’ve done it like this:

RtlInitUnicodeString(&name, L"\BaseNamedObjects\SharedMem");
InitializeObjectAttributes(&oa, &name, 0, 0, NULL);
ZwCreateSection(&hsection, SECTION_ALL_ACCESS, &oa, &Li, PAGE_READWRITE,
SEC_COMMIT, NULL);
ZwMapViewOfSection(hsection, NtCurrentProcess(),
&userMem, 0, MEM_WIDTH, NULL,
&j, ViewShare, 0, PAGE_READWRITE);

After doing that in user space I’ve done this

HANDLE hMapFile;
char* pBuf = NULL;
hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE,
“Global\SharedMem”);
pBuf = (char*)MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0,0,0);
printf(“pBuf[0]: %c”,pBuf[0]);
pBuf[0] = ‘c’;
pBuf[1] = ‘\n’;
CloseHandle(hMapFile);

then I’ve send an IOCTL to the driver to write in DbgPrint what I’ve written in the memory but it won’t change.

I’ve started 2 days ago and now I don’t know where to bump my head to solve this, anyone have any idea of what I’m doing wrong?

I’m a newbie in this kind of architecture so pardon me if I’m asking a dumb question,

Thanks to all of you,

Please, NOT AGAIN!

This should be a FAQ entry somewhere!

xxxxx@gmail.com wrote:

From: xxxxx@gmail.com
To: “Windows System Software Devs Interest List”
Subject: [ntdev] Sharing memory between kernel and user mode program
Date: Wed, 29 Apr 2015 13:32:40 -0400 (EDT)

Hi all,

I need to develop a driver that shares memory to user programs I’ve tryed many ways to do this but without results; the last I’m trying is to MapViewOfFile the portion of memory allocated in the kernel. I’ve done it like this:

RtlInitUnicodeString(&name, L"\BaseNamedObjects\SharedMem");
InitializeObjectAttributes(&oa, &name, 0, 0, NULL);
ZwCreateSection(&hsection, SECTION_ALL_ACCESS, &oa, &Li, PAGE_READWRITE,
SEC_COMMIT, NULL);
ZwMapViewOfSection(hsection, NtCurrentProcess(),
&userMem, 0, MEM_WIDTH, NULL,
&j, ViewShare, 0, PAGE_READWRITE);

After doing that in user space I’ve done this

HANDLE hMapFile;
char* pBuf = NULL;
hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE,
“Global\SharedMem”);
pBuf = (char*)MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0,0,0);
printf(“pBuf[0]: %c”,pBuf[0]);
pBuf[0] = ‘c’;
pBuf[1] = ‘\n’;
CloseHandle(hMapFile);

then I’ve send an IOCTL to the driver to write in DbgPrint what I’ve written in the memory but it won’t change.

I’ve started 2 days ago and now I don’t know where to bump my head to solve this, anyone have any idea of what I’m doing wrong?

I’m a newbie in this kind of architecture so pardon me if I’m asking a dumb question,

Thanks to all of you,


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I’m sorry…I’ve tried to search in the forum but I haven’t found anything…

xxxxx@gmail.com wrote:

I need to develop a driver that shares memory to user programs I’ve tryed many ways to do this but without results; the last I’m trying is to MapViewOfFile the portion of memory allocated in the kernel. I’ve done it like this:

then I’ve send an IOCTL to the driver to write in DbgPrint what I’ve written in the memory but it won’t change.

I’ve started 2 days ago and now I don’t know where to bump my head to solve this, anyone have any idea of what I’m doing wrong?

I’m a newbie in this kind of architecture so pardon me if I’m asking a dumb question,

It’s not a dumb question, but it is frequently asked. In general,
sharing memory like this is almost always a bad solution. It is a
security exposure, because user-mode processes are not protected. It’s
better to pass your data through ioctls, just like the traditional
driver model. That way, the I/O manager keeps track of locking and
unlocking.

If you can describe in a bit more detail WHY you think you need this,
perhaps we can help you zero in on a good solution.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thnak you very much…I need to develop a port from Linux/BSD of a program that mmap a file descriptor that resides in the kernel and write directly in the shared memory.
I need the same way because of performance.
Every time I write something with an IOCTL I lose about 2/3000 microseconds on an high performance system for the creation of the IRP and the consequent call; this is not usable for the system I need to write.
Sharing memory gives me the opportunity of writing/reading the memory and then calling an IOCTL that tells the driver to sync his internal structure with the buffer the user program is working on.

The portion of code that manage the concurrency is already written and working so I don’t need to worry about this.

I don’t know if there is a better way to do this instead of sharing memory; sadly internet doesn’t have many resources on this kind of problem.

You have not indicated your performance needs, while this is the common way
to do things in Linux as Tim already pointed out it a terrible approach in
Windows. How many requests per second, and how many bytes per request are
you looking at? I’ve encountered this a lot in my consulting, that “We have
a linux program and we need to do the same thing for performance on
Windows”, 19 out 20 times, that assumption is wrong.

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Wednesday, April 29, 2015 2:12 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Sharing memory between kernel and user mode program

Thnak you very much…I need to develop a port from Linux/BSD of a program
that mmap a file descriptor that resides in the kernel and write directly in
the shared memory.
I need the same way because of performance.
Every time I write something with an IOCTL I lose about 2/3000 microseconds
on an high performance system for the creation of the IRP and the consequent
call; this is not usable for the system I need to write.
Sharing memory gives me the opportunity of writing/reading the memory and
then calling an IOCTL that tells the driver to sync his internal structure
with the buffer the user program is working on.

The portion of code that manage the concurrency is already written and
working so I don’t need to worry about this.

I don’t know if there is a better way to do this instead of sharing memory;
sadly internet doesn’t have many resources on this kind of problem.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

You need to adjust the DACL of the section object in the kernel code. For a
quick test, try this:

Create the section object as you have done and then:

PVOID sec_obj;

ObReferenceObjectByHandle
(
sec_handle,
SECTION_ALL_ACCESS,
NULL,
KernelMode,
&sec_obj,
0
);E

PSECURITY_DESCRIPTOR secure_desc;
BOOLEAN allocated;
ObGetObjectSecurity(sec_obj, &secure_desc, &allocated);
RtlSetDaclSecurityDescriptor(secure_desc, FALSE, NULL, FALSE);
ObReleaseObjectSecurity(secure_desc, allocated);
ObDereferenceObject(sec_obj);

SIZE_T view_size = your buffer size goes here;

status = ZwMapViewOfSection
(
sec_handle,
ZwCurrentProcess(),
&userMem,
0L,
view_size,
NULL,
&view_size,
ViewUnmap,
0,
PAGE_READWRITE
);

// It is safe to close the section object handle once mapping has
// been established. This way, we do not have to maintain the handle
// or cleanup on teardown.
ZwClose(sec_handle);

On Wed, Apr 29, 2015 at 1:57 PM, Tim Roberts wrote:

> xxxxx@gmail.com wrote:
> > I need to develop a driver that shares memory to user programs I’ve
> tryed many ways to do this but without results; the last I’m trying is to
> MapViewOfFile the portion of memory allocated in the kernel. I’ve done it
> like this:
> > …
> > then I’ve send an IOCTL to the driver to write in DbgPrint what I’ve
> written in the memory but it won’t change.
> >
> > I’ve started 2 days ago and now I don’t know where to bump my head to
> solve this, anyone have any idea of what I’m doing wrong?
> >
> > I’m a newbie in this kind of architecture so pardon me if I’m asking a
> dumb question,
>
> It’s not a dumb question, but it is frequently asked. In general,
> sharing memory like this is almost always a bad solution. It is a
> security exposure, because user-mode processes are not protected. It’s
> better to pass your data through ioctls, just like the traditional
> driver model. That way, the I/O manager keeps track of locking and
> unlocking.
>
> If you can describe in a bit more detail WHY you think you need this,
> perhaps we can help you zero in on a good solution.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.

Oh, make sure you initialize the attributes correctly. For example:

InitializeObjectAttributes
(
&oa,
&name,
OBJ_KERNEL_HANDLE | OBJ_FORCE_ACCESS_CHECK | OBJ_CASE_INSENSITIVE |
OBJ_OPENIF,
(HANDLE)NULL,
(PSECURITY_DESCRIPTOR)NULL
);

On Wed, Apr 29, 2015 at 2:21 PM, Jamey Kirby wrote:

> You need to adjust the DACL of the section object in the kernel code. For
> a quick test, try this:
>
> Create the section object as you have done and then:
>
> PVOID sec_obj;
>
> ObReferenceObjectByHandle
> (
> sec_handle,
> SECTION_ALL_ACCESS,
> NULL,
> KernelMode,
> &sec_obj,
> 0
> );E
>
> PSECURITY_DESCRIPTOR secure_desc;
> BOOLEAN allocated;
> ObGetObjectSecurity(sec_obj, &secure_desc, &allocated);
> RtlSetDaclSecurityDescriptor(secure_desc, FALSE, NULL, FALSE);
> ObReleaseObjectSecurity(secure_desc, allocated);
> ObDereferenceObject(sec_obj);
>
> SIZE_T view_size = your buffer size goes here;
>
> status = ZwMapViewOfSection
> (
> sec_handle,
> ZwCurrentProcess(),
> &userMem,
> 0L,
> view_size,
> NULL,
> &view_size,
> ViewUnmap,
> 0,
> PAGE_READWRITE
> );
>
> // It is safe to close the section object handle once mapping has
> // been established. This way, we do not have to maintain the
> handle
> // or cleanup on teardown.
> ZwClose(sec_handle);
>
>
>
> ᐧ
>
> On Wed, Apr 29, 2015 at 1:57 PM, Tim Roberts wrote:
>
>> xxxxx@gmail.com wrote:
>> > I need to develop a driver that shares memory to user programs I’ve
>> tryed many ways to do this but without results; the last I’m trying is to
>> MapViewOfFile the portion of memory allocated in the kernel. I’ve done it
>> like this:
>> > …
>> > then I’ve send an IOCTL to the driver to write in DbgPrint what I’ve
>> written in the memory but it won’t change.
>> >
>> > I’ve started 2 days ago and now I don’t know where to bump my head to
>> solve this, anyone have any idea of what I’m doing wrong?
>> >
>> > I’m a newbie in this kind of architecture so pardon me if I’m asking a
>> dumb question,
>>
>> It’s not a dumb question, but it is frequently asked. In general,
>> sharing memory like this is almost always a bad solution. It is a
>> security exposure, because user-mode processes are not protected. It’s
>> better to pass your data through ioctls, just like the traditional
>> driver model. That way, the I/O manager keeps track of locking and
>> unlocking.
>>
>> If you can describe in a bit more detail WHY you think you need this,
>> perhaps we can help you zero in on a good solution.
>>
>> –
>> Tim Roberts, xxxxx@probo.com
>> Providenza & Boekelheide, Inc.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
>
> –
> Jamey Kirby
> Disrupting the establishment since 1964
>
> This is a personal email account and as such, emails are not subject to
> archiving. Nothing else really matters.

>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.

For the performance I need to exchange about 20 millions packets per second, and every packet is 1500 bytes; I’ve seen that with DIRECT_IO ioctl I can archieve from 250000 to 400000 pps if I’m lucky.
I know that is a terrible way to work, I’ve read some articles and every article points out that; but unfortunately I cannot change the underlying architecture…

Ok, now I’m going to try what you said Jamey , thanks

You want to transfer 30 GIGABYTES (plus overhead) every second? Is this split across multiple memory regions and PCIe (or other) busses? Lots of DMA?

Greg

xxxxx@gmail.com wrote:

From: xxxxx@gmail.com
To: “Windows System Software Devs Interest List”
Subject: RE:[ntdev] Sharing memory between kernel and user mode program
Date: Wed, 29 Apr 2015 14:41:57 -0400 (EDT)

For the performance I need to exchange about 20 millions packets per second, and every packet is 1500 bytes; I’ve seen that with DIRECT_IO ioctl I can archieve from 250000 to 400000 pps if I’m lucky.
I know that is a terrible way to work, I’ve read some articles and every article points out that; but unfortunately I cannot change the underlying architecture…


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

On 29-Apr-2015 20:51, Gregory G Dyess wrote:

Please, NOT AGAIN!

This should be a FAQ entry somewhere!

Yes, definitely. Given, which OS is dominant today,
and which OS more students are trained on.
And these students will lead projects and manage people
in a few years.
– pa

/* no i’m not a troll. someone just complained about decrease of traffic
in this list :wink: */

Yes, it kinda need to go fast :slight_smile:

I’ve tryed to do what you said Jamey but it goes in BSOD with PAGE_FAULT_IN_NON_PAGED_AREA.

I’ve pulled the code on GitHub, maybe is better than a simple snippet; if someone wants to give it a shot is here -----> https://github.com/PicMelter/uniioShd
And no, I’m not asking for someone to write for me the code, I just want to understand how to handle this kind of problem.

Ah, don’t mind the mess, it’s just a test program.

If I will be capable to solve this problem, after I will have fully understand how to write this code, I promise I’ll write a tutorial somewhere for people like me to understand better how to solve this kind of problems.

Now I need to go to bed, it’s late here; tomorrow morning I will start to work again on the project.

Thanks again to everyone.

xxxxx@gmail.com wrote:

Yes, it kinda need to go fast :slight_smile:

That’s nearly impossible to believe. How is the data going to arrive,
and where do you expect to put it? That’s twice the capacity of a
PCIExpress Gen 3 bus.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Can you do this on Linux? I’ve worked in several high performance
controllers, and you are way beyond what I would expect with current
architectures. The only way I could imagine doing this, is a server with a
huge number of cores, and a device or set of devices that can be spread over
something like 4 PCIe Gen 3 buses.

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Wednesday, April 29, 2015 2:42 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Sharing memory between kernel and user mode program

For the performance I need to exchange about 20 millions packets per second,
and every packet is 1500 bytes; I’ve seen that with DIRECT_IO ioctl I can
archieve from 250000 to 400000 pps if I’m lucky.
I know that is a terrible way to work, I’ve read some articles and every
article points out that; but unfortunately I cannot change the underlying
architecture…


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Is you code running in the context of the system process or the calling
process?
It should be the system process. You can use a workitem or worker thread to
get tot he correct process.

On Wed, Apr 29, 2015 at 4:16 PM, wrote:

> Yes, it kinda need to go fast :slight_smile:
>
> I’ve tryed to do what you said Jamey but it goes in BSOD with
> PAGE_FAULT_IN_NON_PAGED_AREA.
>
> I’ve pulled the code on GitHub, maybe is better than a simple snippet; if
> someone wants to give it a shot is here ----->
> https://github.com/PicMelter/uniioShd
> And no, I’m not asking for someone to write for me the code, I just want
> to understand how to handle this kind of problem.
>
> Ah, don’t mind the mess, it’s just a test program.
>
> If I will be capable to solve this problem, after I will have fully
> understand how to write this code, I promise I’ll write a tutorial
> somewhere for people like me to understand better how to solve this kind of
> problems.
>
> Now I need to go to bed, it’s late here; tomorrow morning I will start to
> work again on the project.
>
> Thanks again to everyone.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.

Also, that code was just of the top of my head, not tested. I expected you
would need to do a little work.

On Wed, Apr 29, 2015 at 6:11 PM, Jamey Kirby wrote:

> Is you code running in the context of the system process or the calling
> process?
> It should be the system process. You can use a workitem or worker thread
> to get tot he correct process.
>
>
> ᐧ
>
> On Wed, Apr 29, 2015 at 4:16 PM, wrote:
>
>> Yes, it kinda need to go fast :slight_smile:
>>
>> I’ve tryed to do what you said Jamey but it goes in BSOD with
>> PAGE_FAULT_IN_NON_PAGED_AREA.
>>
>> I’ve pulled the code on GitHub, maybe is better than a simple snippet; if
>> someone wants to give it a shot is here ----->
>> https://github.com/PicMelter/uniioShd
>> And no, I’m not asking for someone to write for me the code, I just want
>> to understand how to handle this kind of problem.
>>
>> Ah, don’t mind the mess, it’s just a test program.
>>
>> If I will be capable to solve this problem, after I will have fully
>> understand how to write this code, I promise I’ll write a tutorial
>> somewhere for people like me to understand better how to solve this kind of
>> problems.
>>
>> Now I need to go to bed, it’s late here; tomorrow morning I will start to
>> work again on the project.
>>
>> Thanks again to everyone.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
>
> –
> Jamey Kirby
> Disrupting the establishment since 1964
>
> This is a personal email account and as such, emails are not subject to
> archiving. Nothing else really matters.

>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.

Change the first view_size in map to another variable. This can be
problematic using the same variable. My mistake. i.e. SIZE_T mem_size =
1500;

I also suggest creating the section in kernel first and then open it in
user-mode.

I think I will write a working sample tonight and share with the group. I
have done this several times and it works great.

On Wed, Apr 29, 2015 at 6:12 PM, Jamey Kirby wrote:

> Also, that code was just of the top of my head, not tested. I expected you
> would need to do a little work.
>
> ᐧ
>
> On Wed, Apr 29, 2015 at 6:11 PM, Jamey Kirby
> wrote:
>
>> Is you code running in the context of the system process or the calling
>> process?
>> It should be the system process. You can use a workitem or worker thread
>> to get tot he correct process.
>>
>>
>> ᐧ
>>
>> On Wed, Apr 29, 2015 at 4:16 PM, wrote:
>>
>>> Yes, it kinda need to go fast :slight_smile:
>>>
>>> I’ve tryed to do what you said Jamey but it goes in BSOD with
>>> PAGE_FAULT_IN_NON_PAGED_AREA.
>>>
>>> I’ve pulled the code on GitHub, maybe is better than a simple snippet;
>>> if someone wants to give it a shot is here ----->
>>> https://github.com/PicMelter/uniioShd
>>> And no, I’m not asking for someone to write for me the code, I just want
>>> to understand how to handle this kind of problem.
>>>
>>> Ah, don’t mind the mess, it’s just a test program.
>>>
>>> If I will be capable to solve this problem, after I will have fully
>>> understand how to write this code, I promise I’ll write a tutorial
>>> somewhere for people like me to understand better how to solve this kind of
>>> problems.
>>>
>>> Now I need to go to bed, it’s late here; tomorrow morning I will start
>>> to work again on the project.
>>>
>>> Thanks again to everyone.
>>>
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>>
>>> OSR is HIRING!! See http://www.osr.com/careers
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>
>>
>>
>> –
>> Jamey Kirby
>> Disrupting the establishment since 1964
>>
>> This is a personal email account and as such, emails are not subject to
>> archiving. Nothing else really matters.

>>
>
>
>
> –
> Jamey Kirby
> Disrupting the establishment since 1964
>
> This is a personal email account and as such, emails are not subject to
> archiving. Nothing else really matters.

>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.

It need to go fast, yes, but I wrote a stupid thing; I’ve tested the system and it can archieve 70 Gbit/s with 1500-byte frames generated randomly. This is the max performance it can reach between 2 user mode programs in the same machine. I read the specs and I’ve interpreted what is written on it in a wrong way. I’ve said yes to 30 Gigabytes maybe without even thinking of what we were talking about yesterday night because I was lacking sleep. Sorry if I’ve upset all of you. The 20 Mpps is archieved with 60 bytes packets.

> Sharing memory gives me the opportunity of writing/reading the memory and then calling an IOCTL

And calling an IOCTL will have the same overhead.

Create a MDL from your shared memory and then MmMapLockedPages(UserMode).


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com