" ZwMapViewOfSection " failing....

I have problem in " ZwMapViewOfSection " in my file system filter driver.

It returned status is STATUS_INVALID_PARAMETER_3 .I have gone thru the previous archives …there was a thread related to this .But I could take any help from that .

Here is my code ,I am calling this xxxxCreateShare() function in CREATE DISPATCH…

void xxxxCreateShare()
{
NTSTATUS ntstatus;
OBJECT_ATTRIBUTES objectAttributes;
Pxxx_SHARE_DATA sharedata;
PVOID baseaddr;
UNICODE_STRING ShareName;
LARGE_INTEGER SectionOffset;

LARGE_INTEGER MaximumSize;
SIZE_T ViewSize;
HANDLE SectionHandle;
WCHAR ShareNameBuffer = L"\BaseNamedObjects\TestMemory";

sharedata = NULL;

MaximumSize.LowPart=sizeof(xxx_SHARE_DATA);

MaximumSize.HighPart=0;

RtlInitUnicodeString(&ShareName,ShareNameBuffer);

InitializeObjectAttributes( &objectAttributes, &ShareName,
OBJ_CASE_INSENSITIVE, NULL, NULL );

ntstatus = ZwOpenSection( &SectionHandle , SECTION_MAP_WRITE|SECTION_MAP_READ ,&objectAttributes );

ntstatus = ZwMapViewOfSection( SectionHandle,
PsGetCurrentProcessId(),
&baseaddr,
0,
sizeof(xxx_SHARE_DATA),
&SectionOffset,
&ViewSize,
ViewShare,
0,
PAGE_READWRITE ) ;

}

I could open the section successfully…But when calling ZwMapViewOfSection it returns STATUS_INVALID_PARAMETER_3 .

Any idea where I am wrong …

PRIYA MS


Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn more.

It does not like the value you have set in baseaddr. The code snippet
you sent does not set it prior to passing it in to this function, so it
is possible (if this really is how your code works) that the value in
the uninitialized variable is not set to zero. From the DDK:

BaseAddress

Pointer to a variable that will receive the base address of the view. If
the initial value of this argument is non-NULL, the view is allocated
starting at the specified virtual address rounded down to the next
64-kilobyte address boundary.

I would suggest that you try setting this value to zero (or a valid base
address) and trying again.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of NTFSD NTDEV
Sent: Wednesday, December 22, 2004 3:44 AM
To: ntfsd redirect
Subject: [ntfsd] " ZwMapViewOfSection " failing…

I have problem in " ZwMapViewOfSection " in my file system filter
driver.

It returned status is STATUS_INVALID_PARAMETER_3 .I have gone thru
the previous archives …there was a thread related to this .But I could
take any help from that .

Here is my code ,I am calling this xxxxCreateShare() function in
CREATE DISPATCH…



void xxxxCreateShare()
{
NTSTATUS ntstatus;
OBJECT_ATTRIBUTES objectAttributes;
Pxxx_SHARE_DATA sharedata;
PVOID baseaddr;
UNICODE_STRING ShareName;
LARGE_INTEGER SectionOffset;

LARGE_INTEGER MaximumSize;
SIZE_T ViewSize;
HANDLE SectionHandle;
WCHAR ShareNameBuffer = L"\BaseNamedObjects\TestMemory
<file:> ";

sharedata = NULL;

MaximumSize.LowPart=sizeof(xxx_SHARE_DATA);

MaximumSize.HighPart=0;

RtlInitUnicodeString(&ShareName,ShareNameBuffer);

InitializeObjectAttributes( &objectAttributes, &ShareName,
OBJ_CASE_INSENSITIVE, NULL, NULL );

ntstatus = ZwOpenSection( &SectionHandle ,
SECTION_MAP_WRITE|SECTION_MAP_READ ,&objectAttributes );

ntstatus = ZwMapViewOfSection( SectionHandle,
PsGetCurrentProcessId(),
&baseaddr,
0,
sizeof(xxx_SHARE_DATA),
&SectionOffset,
&ViewSize,
ViewShare,
0,
PAGE_READWRITE ) ;

}

I could open the section successfully…But when calling
ZwMapViewOfSection it returns STATUS_INVALID_PARAMETER_3 .

Any idea where I am wrong …

PRIYA MS

________________________________

Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn more.
http:
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to
xxxxx@lists.osr.com</http:></file:>

Thanks Tony for your reply…

I tried setting baseaddr = 0 …But the status is still STATUS_INVALID_PARAMETER_3 …

Any other suggestions that I can try out …?

Tony Mason wrote:
v:* {behavior:url(#default#VML);}o:* {behavior:url(#default#VML);}w:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}st1:*{behavior:url(#default#ieooui) }
It does not like the value you have set in baseaddr. The code snippet you sent does not set it prior to passing it in to this function, so it is possible (if this really is how your code works) that the value in the uninitialized variable is not set to zero. From the DDK:

BaseAddress

Pointer to a variable that will receive the base address of the view. If the initial value of this argument is non-NULL, the view is allocated starting at the specified virtual address rounded down to the next 64-kilobyte address boundary.

I would suggest that you try setting this value to zero (or a valid base address) and trying again.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com

---------------------------------

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of NTFSD NTDEV
Sent: Wednesday, December 22, 2004 3:44 AM
To: ntfsd redirect
Subject: [ntfsd] " ZwMapViewOfSection " failing…

I have problem in " ZwMapViewOfSection " in my file system filter driver.

It returned status is STATUS_INVALID_PARAMETER_3 .I have gone thru the previous archives …there was a thread related to this .But I could take any help from that .

Here is my code ,I am calling this xxxxCreateShare() function in CREATE DISPATCH…

---------------------------------------------------------------------------------------------------------------------------------

void xxxxCreateShare()
{
NTSTATUS ntstatus;
OBJECT_ATTRIBUTES objectAttributes;
Pxxx_SHARE_DATA sharedata;
PVOID baseaddr;
UNICODE_STRING ShareName;
LARGE_INTEGER SectionOffset;

LARGE_INTEGER MaximumSize;
SIZE_T ViewSize;
HANDLE SectionHandle;
WCHAR ShareNameBuffer = L"\BaseNamedObjects\TestMemory";

sharedata = NULL;

MaximumSize.LowPart=sizeof(xxx_SHARE_DATA);

MaximumSize.HighPart=0;

RtlInitUnicodeString(&ShareName,ShareNameBuffer);

InitializeObjectAttributes( &objectAttributes, &ShareName,
OBJ_CASE_INSENSITIVE, NULL, NULL );

ntstatus = ZwOpenSection( &SectionHandle , SECTION_MAP_WRITE|SECTION_MAP_READ ,&objectAttributes );

ntstatus = ZwMapViewOfSection( SectionHandle,
PsGetCurrentProcessId(),
&baseaddr,
0,
sizeof(xxx_SHARE_DATA),
&SectionOffset,
&ViewSize,
ViewShare,
0,
PAGE_READWRITE ) ;

}

I could open the section successfully…But when calling ZwMapViewOfSection it returns STATUS_INVALID_PARAMETER_3 .

Any idea where I am wrong …

PRIYA MS

---------------------------------

Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn more. — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

PRIYA MS

---------------------------------
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

I too suggest you to pay carefully attention to the settings of the rest of the parameters according to the documentation of the function.
Maybe SectionOffset , CommitSize and ViewSize should be 0.
Hope this helps,
Jose Mari

-----Mensaje original-----
De: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]En nombre de NTFSD NTDEV
Enviado el: mi?rcoles, 22 de diciembre de 2004 12:09
Para: Windows File Systems Devs Interest List
Asunto: RE: [ntfsd] " ZwMapViewOfSection " failing…

Thanks Tony for your reply…

I tried setting baseaddr = 0 …But the status is still STATUS_INVALID_PARAMETER_3 …

Any other suggestions that I can try out …?

Tony Mason wrote:

It does not like the value you have set in baseaddr. The code snippet you sent does not set it prior to passing it in to this function, so it is possible (if this really is how your code works) that the value in the uninitialized variable is not set to zero. From the DDK:

BaseAddress

Pointer to a variable that will receive the base address of the view. If the initial value of this argument is non-NULL, the view is allocated starting at the specified virtual address rounded down to the next 64-kilobyte address boundary.

I would suggest that you try setting this value to zero (or a valid base address) and trying again.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>



From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of NTFSD NTDEV
Sent: Wednesday, December 22, 2004 3:44 AM
To: ntfsd redirect
Subject: [ntfsd] " ZwMapViewOfSection " failing…

I have problem in " ZwMapViewOfSection " in my file system filter driver.

It returned status is STATUS_INVALID_PARAMETER_3 .I have gone thru the previous archives …there was a thread related to this .But I could take any help from that .

Here is my code ,I am calling this xxxxCreateShare() function in CREATE DISPATCH…

---------------------------------------------------------------------------------------------------------------------------------

void xxxxCreateShare()
{
NTSTATUS ntstatus;
OBJECT_ATTRIBUTES objectAttributes;
Pxxx_SHARE_DATA sharedata;
PVOID baseaddr;
UNICODE_STRING ShareName;
LARGE_INTEGER SectionOffset;

LARGE_INTEGER MaximumSize;
SIZE_T ViewSize;
HANDLE SectionHandle;
WCHAR ShareNameBuffer[] = L" \BaseNamedObjects\TestMemory <file:> ";

sharedata = NULL;

MaximumSize.LowPart=sizeof(xxx_SHARE_DATA);

MaximumSize.HighPart=0;

RtlInitUnicodeString(&ShareName,ShareNameBuffer);

InitializeObjectAttributes( &objectAttributes, &ShareName,
OBJ_CASE_INSENSITIVE, NULL, NULL );

ntstatus = ZwOpenSection( &SectionHandle , SECTION_MAP_WRITE|SECTION_MAP_READ ,&objectAttributes );

ntstatus = ZwMapViewOfSection( SectionHandle,
PsGetCurrentProcessId(),
&baseaddr,
0,
sizeof(xxx_SHARE_DATA),
&SectionOffset,
&ViewSize,
ViewShare,
0,
PAGE_READWRITE ) ;

}

I could open the section successfully…But when calling ZwMapViewOfSection it returns STATUS_INVALID_PARAMETER_3 .

Any idea where I am wrong …

PRIYA MS



Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn http: more. — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

PRIYA MS

_____

Do you Yahoo!?
Yahoo! http: Mail - You care about security. So do we. — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es To unsubscribe send a blank email to xxxxx@lists.osr.com</http:></http:></file:>