I can tell you a little help too:
Section object is independent of the address space type,
i.e. there can be number of views mapped from a single
section into different user process spaces together with
cache views and possible system space views.
But you must dustinguish among those types of views!
-
ZwMapViewOfSection needs handle to process, so it
always maps a view into the process’ user address space
(address below 0x80000000 on IA32)
-
MmMapViewInSystemSpace always maps into the kernel
process space, but substantial disadvantage of this routine
is absence of SectionOffset argument, so you must always
map a view from the beginning of the section :-((
-
MmMapViewInSystemCache always maps into the space
for Cache Manager usage. The routine has SectionOffset
argument, however it’s not exported by NTOSKRNL :-(((.
Paul
PS: Your problem is probably in the vlaue of the third argument.
I think that the routine have a good reason to fail if it points
to system space ;-)))).
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Toni Garabedyan
Sent: Monday, July 08, 2002 9:15 AM
To: File Systems Developers
Subject: [ntfsd] Problem with ZwMapViewOfSection()
Hi,
Could you help me to resolve this situation (I spend several days trying
to find-out where is my mistake): I follow R.Nagar’s “File System
Internals” [220], and try to create section using ZwCreateSection in
Kernel mode (actualy in filter driver). The section seems to be properly
created in adress space 0x8000xxxx. Then I wish to invoke
ZwMapViewOfSection() to map a view on this section object. But I always
receive error STATUS_INVALID_PARAMETER_9 (AllocationType). Unfortunately
(as many things in Microsoft’s
documentation) for meaning and acceptable values of this parameter has
just a few words. Here is extract of my code:
InitializeObjectAttributes(&ObjectAttributes, NULL, OBJ_KERNEL_HANDLE,
NULL, NULL);
if (NT_SUCCESS( RC=ZwCreateSection(&SectionHandle,
(STANDARD_RIGHTS_REQUIRED |
SECTION_MAP_READ |
SECTION_MAP_WRITE |
SECTION_QUERY),
&ObjectAttributes,
&AllocationSize,
PAGE_READWRITE,
SEC_RESERVE,
NULL
)))
{
if (NT_SUCCESS( RC=ZwMapViewOfSection(SectionHandle,
NtCurrentProcess(),
&ShadowSection,
0,
ReadBytes,
NULL,
&ViewSize,
ViewShare,
MEM_TOP_DOWN, // (!??!)
PAGE_READWRITE )))
{
…
}
}
Please, give me some advice!
10x in advance.
You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to %%email.unsub%%