EngMapFile issue on vista.

Hi frineds,
My kernel driver is trying to create one shared memory using
EngMapFile(). It is working fine on XP & Win7 but it is not working on
vista. I have checked that particular drive is having enough space. I don’t
have any clue why it is not able to create the file.
Is there any way to find out the error code. Because this API is only
returning NULL in case of failure.

Any help will be highly appreciable.

Thanks in advance.
/sarbojit

Why do you need to map with this function especially.
Why not use the section functions in kernel ?

I am using engMapFile() because I found with this I can create shared file
between two different processes. Please let know if there are better options
available to do this.

Could you please let me know what do you mean by “section functions in
kernel”?

On Tue, Aug 17, 2010 at 1:58 PM, wrote:

> Why do you need to map with this function especially.
> Why not use the section functions in kernel ?
>
> —
> NTDEV is sponsored by OSR
>
> 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
>

Lookup these documentation pages:
http://msdn.microsoft.com/en-us/library/ff566428(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ff566481(v=VS.85).aspx

This is what I am talking about.
The EngMapFile surely does this behind the scenes.

Step through its assembler code.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

“Sarbojit Sarkar” wrote in message news:xxxxx@ntdev…
Hi frineds,
My kernel driver is trying to create one shared memory using EngMapFile(). It is working fine on XP & Win7 but it is not working on vista. I have checked that particular drive is having enough space. I don’t have any clue why it is not able to create the file.
Is there any way to find out the error code. Because this API is only returning NULL in case of failure.

Any help will be highly appreciable.

Thanks in advance.
/sarbojit

xxxxx@gmail.com wrote:

Why do you need to map with this function especially.
Why not use the section functions in kernel ?

He’s writing a display driver. Display drivers cannot refer to any
kernel functions except those in win32k.sys. That excludes section
functions.


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

Oh right, I am sorry.

On Wed, Aug 18, 2010 at 7:44 PM, Tim Roberts wrote:

> xxxxx@gmail.com wrote:
> > Why do you need to map with this function especially.
> > Why not use the section functions in kernel ?
>
> He’s writing a display driver. Display drivers cannot refer to any
> kernel functions except those in win32k.sys. That excludes section
> functions.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> 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 am seeing some time call is failing some times it is passing.
Do you have any idea what are possible reasons of failing EngMapFile()? I am
interested in the possible scenarios when EngMapFile can fail. I tried to
google it but could not found out.

/sarbojit

On Thu, Aug 19, 2010 at 1:16 AM, Gabriel Bercea wrote:

> Oh right, I am sorry.
>
>
> On Wed, Aug 18, 2010 at 7:44 PM, Tim Roberts wrote:
>
>> xxxxx@gmail.com wrote:
>> > Why do you need to map with this function especially.
>> > Why not use the section functions in kernel ?
>>
>> He’s writing a display driver. Display drivers cannot refer to any
>> kernel functions except those in win32k.sys. That excludes section
>> functions.
>>
>> –
>> Tim Roberts, xxxxx@probo.com
>> Providenza & Boekelheide, Inc.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> 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
>>
>
> — NTDEV is sponsored by OSR 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

give us the code sample.

Here is the code.

DrvEnablePDEV()
{

pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
&pDev->pMappedFile);

}

Some times calling is getting success and some time it is failing but I am
not sure how to debug the issue? Even I am not able to find out what are the
situations when it is failing.

I was thinking, do I need send the request with high IRQL? Just a guess may
be bad one :(. But I am clueless here.

On Thu, Aug 19, 2010 at 6:59 PM, wrote:

> give us the code sample.
>
> —
> NTDEV is sponsored by OSR
>
> 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 saw both processes are running at 0 level only.

Any pointer or any suggestion will help a lot.

On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar wrote:

> Here is the code.
>
> DrvEnablePDEV()
> {
> …
> pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
> &pDev->pMappedFile);
> …
> }
>
> Some times calling is getting success and some time it is failing but I am
> not sure how to debug the issue? Even I am not able to find out what are the
> situations when it is failing.
>
> I was thinking, do I need send the request with high IRQL? Just a guess may
> be bad one :(. But I am clueless here.
>
> On Thu, Aug 19, 2010 at 6:59 PM, wrote:
>
>> give us the code sample.
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> 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
>>
>
>

Ahhh…how fool I am…

I was doing some App level changes for my driver. At the time of development
I hit some app crashes. So at the time of app crash my driver was not
getting disable properly. But I was deleting the file without checking
whether driver is successfully unmape the file or not?

My doubt is this situation will arise only if, we are in DrvDisablePDEV()
and still some one is using that file?[I am un-mapping and deleting the file inside DrvDisablePDEV()]
But as per me, DrvDisablePDEV() should get call at the end and no one will
be using the file at that time, please correct me if I am wrong.
Should I use some lock so that we will get to know if some one is using that
file and we need to wait for unmape? Please suggest.

/sarbojit

On Fri, Aug 20, 2010 at 4:23 PM, Sarbojit Sarkar wrote:

> I saw both processes are running at 0 level only.
>
> Any pointer or any suggestion will help a lot.
>
>
> On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar wrote:
>
>> Here is the code.
>>
>> DrvEnablePDEV()
>> {
>> …
>> pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
>> &pDev->pMappedFile);
>> …
>> }
>>
>> Some times calling is getting success and some time it is failing but I am
>> not sure how to debug the issue? Even I am not able to find out what are the
>> situations when it is failing.
>>
>> I was thinking, do I need send the request with high IRQL? Just a guess
>> may be bad one :(. But I am clueless here.
>>
>> On Thu, Aug 19, 2010 at 6:59 PM, wrote:
>>
>>> give us the code sample.
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> 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
>>>
>>
>>
>

Sorry for lot of updates…

Though that codding mistake (I have explained in my previous response) was
there but even after putting that check driver is not able to create file
using EngMapFile().

But it is correct that when ever app is crashing or some error in
initialization of driver is happening then only this error is coming, else
it is working fine.

Any help or suggestion will highly appreciable.

/sarbojit

On Mon, Aug 23, 2010 at 1:45 PM, Sarbojit Sarkar wrote:

> Ahhh…how fool I am…
>
> I was doing some App level changes for my driver. At the time of
> development I hit some app crashes. So at the time of app crash my driver
> was not getting disable properly. But I was deleting the file without
> checking whether driver is successfully unmape the file or not?
>
> My doubt is this situation will arise only if, we are in DrvDisablePDEV()
> and still some one is using that file?[I am un-mapping and deleting the file<br>&gt; inside DrvDisablePDEV()]
> But as per me, DrvDisablePDEV() should get call at the end and no one will
> be using the file at that time, please correct me if I am wrong.
> Should I use some lock so that we will get to know if some one is using
> that file and we need to wait for unmape? Please suggest.
>
> /sarbojit
>
>
> On Fri, Aug 20, 2010 at 4:23 PM, Sarbojit Sarkar wrote:
>
>> I saw both processes are running at 0 level only.
>>
>> Any pointer or any suggestion will help a lot.
>>
>>
>> On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar wrote:
>>
>>> Here is the code.
>>>
>>> DrvEnablePDEV()
>>> {
>>> …
>>> pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
>>> &pDev->pMappedFile);
>>> …
>>> }
>>>
>>> Some times calling is getting success and some time it is failing but I
>>> am not sure how to debug the issue? Even I am not able to find out what are
>>> the situations when it is failing.
>>>
>>> I was thinking, do I need send the request with high IRQL? Just a guess
>>> may be bad one :(. But I am clueless here.
>>>
>>> On Thu, Aug 19, 2010 at 6:59 PM, wrote:
>>>
>>>> give us the code sample.
>>>>
>>>> —
>>>> NTDEV is sponsored by OSR
>>>>
>>>> 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
>>>>
>>>
>>>
>>
>

Maxim said we get to know something in assembler.
Could you please let me know what exactly I need to check in assembler?

I have tried all possible combinations but did not get any success.

Even after re-installation of driver issue is reproing.

I have googled a lot but did not get anything worth.

On Mon, Aug 23, 2010 at 6:11 PM, Sarbojit Sarkar wrote:

> Sorry for lot of updates…
>
> Though that codding mistake (I have explained in my previous response) was
> there but even after putting that check driver is not able to create file
> using EngMapFile().
>
> But it is correct that when ever app is crashing or some error in
> initialization of driver is happening then only this error is coming, else
> it is working fine.
>
> Any help or suggestion will highly appreciable.
>
> /sarbojit
>
>
> On Mon, Aug 23, 2010 at 1:45 PM, Sarbojit Sarkar wrote:
>
>> Ahhh…how fool I am…
>>
>> I was doing some App level changes for my driver. At the time of
>> development I hit some app crashes. So at the time of app crash my driver
>> was not getting disable properly. But I was deleting the file without
>> checking whether driver is successfully unmape the file or not?
>>
>> My doubt is this situation will arise only if, we are in DrvDisablePDEV()
>> and still some one is using that file?[I am un-mapping and deleting the file<br>&gt;&gt; inside DrvDisablePDEV()]
>> But as per me, DrvDisablePDEV() should get call at the end and no one will
>> be using the file at that time, please correct me if I am wrong.
>> Should I use some lock so that we will get to know if some one is using
>> that file and we need to wait for unmape? Please suggest.
>>
>> /sarbojit
>>
>>
>> On Fri, Aug 20, 2010 at 4:23 PM, Sarbojit Sarkar wrote:
>>
>>> I saw both processes are running at 0 level only.
>>>
>>> Any pointer or any suggestion will help a lot.
>>>
>>>
>>> On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar wrote:
>>>
>>>> Here is the code.
>>>>
>>>> DrvEnablePDEV()
>>>> {
>>>> …
>>>> pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
>>>> &pDev->pMappedFile);
>>>> …
>>>> }
>>>>
>>>> Some times calling is getting success and some time it is failing but I
>>>> am not sure how to debug the issue? Even I am not able to find out what are
>>>> the situations when it is failing.
>>>>
>>>> I was thinking, do I need send the request with high IRQL? Just a guess
>>>> may be bad one :(. But I am clueless here.
>>>>
>>>> On Thu, Aug 19, 2010 at 6:59 PM, wrote:
>>>>
>>>>> give us the code sample.
>>>>>
>>>>> —
>>>>> NTDEV is sponsored by OSR
>>>>>
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>
>

well, in windbg with the “u” (unassable command)
u win32k!EngMapFile
something like that it should be.

On Tue, Aug 24, 2010 at 3:42 PM, Sarbojit Sarkar wrote:

> Maxim said we get to know something in assembler.
> Could you please let me know what exactly I need to check in assembler?
>
> I have tried all possible combinations but did not get any success.
>
> Even after re-installation of driver issue is reproing.
>
> I have googled a lot but did not get anything worth.
>
>
> On Mon, Aug 23, 2010 at 6:11 PM, Sarbojit Sarkar wrote:
>
>> Sorry for lot of updates…
>>
>> Though that codding mistake (I have explained in my previous response) was
>> there but even after putting that check driver is not able to create file
>> using EngMapFile().
>>
>> But it is correct that when ever app is crashing or some error in
>> initialization of driver is happening then only this error is coming, else
>> it is working fine.
>>
>> Any help or suggestion will highly appreciable.
>>
>> /sarbojit
>>
>>
>> On Mon, Aug 23, 2010 at 1:45 PM, Sarbojit Sarkar wrote:
>>
>>> Ahhh…how fool I am…
>>>
>>> I was doing some App level changes for my driver. At the time of
>>> development I hit some app crashes. So at the time of app crash my driver
>>> was not getting disable properly. But I was deleting the file without
>>> checking whether driver is successfully unmape the file or not?
>>>
>>> My doubt is this situation will arise only if, we are in DrvDisablePDEV()
>>> and still some one is using that file?[I am un-mapping and deleting the file<br>&gt;&gt;&gt; inside DrvDisablePDEV()]
>>> But as per me, DrvDisablePDEV() should get call at the end and no one
>>> will be using the file at that time, please correct me if I am wrong.
>>> Should I use some lock so that we will get to know if some one is using
>>> that file and we need to wait for unmape? Please suggest.
>>>
>>> /sarbojit
>>>
>>>
>>> On Fri, Aug 20, 2010 at 4:23 PM, Sarbojit Sarkar wrote:
>>>
>>>> I saw both processes are running at 0 level only.
>>>>
>>>> Any pointer or any suggestion will help a lot.
>>>>
>>>>
>>>> On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar >>>> > wrote:
>>>>
>>>>> Here is the code.
>>>>>
>>>>> DrvEnablePDEV()
>>>>> {
>>>>> …
>>>>> pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
>>>>> &pDev->pMappedFile);
>>>>> …
>>>>> }
>>>>>
>>>>> Some times calling is getting success and some time it is failing but I
>>>>> am not sure how to debug the issue? Even I am not able to find out what are
>>>>> the situations when it is failing.
>>>>>
>>>>> I was thinking, do I need send the request with high IRQL? Just a guess
>>>>> may be bad one :(. But I am clueless here.
>>>>>
>>>>> On Thu, Aug 19, 2010 at 6:59 PM, wrote:
>>>>>
>>>>>> give us the code sample.
>>>>>>
>>>>>> —
>>>>>> NTDEV is sponsored by OSR
>>>>>>
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
> — NTDEV is sponsored by OSR 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
>

Ya that I know. I was asking how I will decide what is problem or where is
the problem.
Sorry for asking this, I never debugged assembly level.
I saw below is the assembly code

win32k!EngMapFile:
9529e584 8bff mov edi,edi
9529e586 55 push ebp
9529e587 8bec mov ebp,esp
9529e589 56 push esi
9529e58a 57 push edi
9529e58b 684766696c push 6C696647h
9529e590 6a20 push 20h
9529e592 33ff xor edi,edi
9529e594 e856b7f0ff call win32k!PALLOCMEM (951a9cef)
9529e599 8bf0 mov esi,eax
9529e59b 3bf7 cmp esi,edi
9529e59d 742d je win32k!EngMapFile+0x48 (9529e5cc)
9529e59f 8b450c mov eax,dword ptr [ebp+0Ch]
9529e5a2 3bc7 cmp eax,edi
9529e5a4 7503 jne win32k!EngMapFile+0x25 (9529e5a9)
9529e5a6 83c8ff or eax,0FFFFFFFFh
9529e5a9 57 push edi

I have step through these part but not able to find out any clue.

Any suggestion will help a lot.

/sarbojit

On Tue, Aug 24, 2010 at 6:33 PM, Gabriel Bercea wrote:

> well, in windbg with the “u” (unassable command)
> u win32k!EngMapFile
> something like that it should be.
>
> On Tue, Aug 24, 2010 at 3:42 PM, Sarbojit Sarkar wrote:
>
>> Maxim said we get to know something in assembler.
>> Could you please let me know what exactly I need to check in assembler?
>>
>> I have tried all possible combinations but did not get any success.
>>
>> Even after re-installation of driver issue is reproing.
>>
>> I have googled a lot but did not get anything worth.
>>
>>
>> On Mon, Aug 23, 2010 at 6:11 PM, Sarbojit Sarkar wrote:
>>
>>> Sorry for lot of updates…
>>>
>>> Though that codding mistake (I have explained in my previous response)
>>> was there but even after putting that check driver is not able to create
>>> file using EngMapFile().
>>>
>>> But it is correct that when ever app is crashing or some error in
>>> initialization of driver is happening then only this error is coming, else
>>> it is working fine.
>>>
>>> Any help or suggestion will highly appreciable.
>>>
>>> /sarbojit
>>>
>>>
>>> On Mon, Aug 23, 2010 at 1:45 PM, Sarbojit Sarkar wrote:
>>>
>>>> Ahhh…how fool I am…
>>>>
>>>> I was doing some App level changes for my driver. At the time of
>>>> development I hit some app crashes. So at the time of app crash my driver
>>>> was not getting disable properly. But I was deleting the file without
>>>> checking whether driver is successfully unmape the file or not?
>>>>
>>>> My doubt is this situation will arise only if, we are in
>>>> DrvDisablePDEV() and still some one is using that file?[I am un-mapping and<br>&gt;&gt;&gt;&gt; deleting the file inside DrvDisablePDEV()]
>>>> But as per me, DrvDisablePDEV() should get call at the end and no one
>>>> will be using the file at that time, please correct me if I am wrong.
>>>> Should I use some lock so that we will get to know if some one is using
>>>> that file and we need to wait for unmape? Please suggest.
>>>>
>>>> /sarbojit
>>>>
>>>>
>>>> On Fri, Aug 20, 2010 at 4:23 PM, Sarbojit Sarkar >>>> > wrote:
>>>>
>>>>> I saw both processes are running at 0 level only.
>>>>>
>>>>> Any pointer or any suggestion will help a lot.
>>>>>
>>>>>
>>>>> On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar <
>>>>> xxxxx@gmail.com> wrote:
>>>>>
>>>>>> Here is the code.
>>>>>>
>>>>>> DrvEnablePDEV()
>>>>>> {
>>>>>> …
>>>>>> pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat", sizeof(buffer),
>>>>>> &pDev->pMappedFile);
>>>>>> …
>>>>>> }
>>>>>>
>>>>>> Some times calling is getting success and some time it is failing but
>>>>>> I am not sure how to debug the issue? Even I am not able to find out what
>>>>>> are the situations when it is failing.
>>>>>>
>>>>>> I was thinking, do I need send the request with high IRQL? Just a
>>>>>> guess may be bad one :(. But I am clueless here.
>>>>>>
>>>>>> On Thu, Aug 19, 2010 at 6:59 PM, wrote:
>>>>>>
>>>>>>> give us the code sample.
>>>>>>>
>>>>>>> —
>>>>>>> NTDEV is sponsored by OSR
>>>>>>>
>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>> — NTDEV is sponsored by OSR 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
>>
>
> — NTDEV is sponsored by OSR 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 believe what Max referred to is that you may need to step into the
assembly for the code for which you don’t have source. That is called
reverse engineering and sometimes that is the only way to find out where you
failed. Look for NULL pointers, or pointer offsets based on NULL, or
parameters that have meaningless information. The stack trace will provide a
few of those parameters as well as the return address of the code. You may
have to run through more than one stack frame.

Gary G. Little

H (952) 223-1349

C (952) 454-4629

xxxxx@comcast.net

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sarbojit Sarkar
Sent: Tuesday, August 24, 2010 7:43 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] EngMapFile issue on vista.

Maxim said we get to know something in assembler.

Could you please let me know what exactly I need to check in assembler?

I have tried all possible combinations but did not get any success.

Even after re-installation of driver issue is reproing.

I have googled a lot but did not get anything worth.

On Mon, Aug 23, 2010 at 6:11 PM, Sarbojit Sarkar
wrote:

Sorry for lot of updates…

Though that codding mistake (I have explained in my previous response) was
there but even after putting that check driver is not able to create file
using EngMapFile().

But it is correct that when ever app is crashing or some error in
initialization of driver is happening then only this error is coming, else
it is working fine.

Any help or suggestion will highly appreciable.

/sarbojit

On Mon, Aug 23, 2010 at 1:45 PM, Sarbojit Sarkar
wrote:

Ahhh…how fool I am…

I was doing some App level changes for my driver. At the time of development
I hit some app crashes. So at the time of app crash my driver was not
getting disable properly. But I was deleting the file without checking
whether driver is successfully unmape the file or not?

My doubt is this situation will arise only if, we are in DrvDisablePDEV()
and still some one is using that file?[I am un-mapping and deleting the file<br>inside DrvDisablePDEV()]

But as per me, DrvDisablePDEV() should get call at the end and no one will
be using the file at that time, please correct me if I am wrong.

Should I use some lock so that we will get to know if some one is using that
file and we need to wait for unmape? Please suggest.

/sarbojit

On Fri, Aug 20, 2010 at 4:23 PM, Sarbojit Sarkar
wrote:

I saw both processes are running at 0 level only.

Any pointer or any suggestion will help a lot.

On Fri, Aug 20, 2010 at 4:08 PM, Sarbojit Sarkar
wrote:

Here is the code.

DrvEnablePDEV()

{



pVideoMemory = EngMapFile(L"\??\c:\DispBuffer.dat
<file:> ", sizeof(buffer), &pDev->pMappedFile);



}

Some times calling is getting success and some time it is failing but I am
not sure how to debug the issue? Even I am not able to find out what are the
situations when it is failing.

I was thinking, do I need send the request with high IRQL? Just a guess may
be bad one :(. But I am clueless here.

On Thu, Aug 19, 2010 at 6:59 PM, wrote:

give us the code sample.


NTDEV is sponsored by OSR

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

— NTDEV is sponsored by OSR 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</file:>

>I saw below is the assembly code


win32k!EngMapFile:

Just single-step it down and look at what function fails.

Yes, a major effort, even with intermediate breakpoints set using something like a “binary search” method.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks for responses, I will debug as per your instruction.
BTW, I am seeing
“*SXS: RtlQueryInformationActivationContext() - Caller passed invalid
address, not in any .dll (1EE259E0)*” message in between DrvEnablePDEV()
call. I am not sure whether it is related this issue or not.

One more strange thing I have observed in my debugger.
I am getting some extra messages in between my debug print, some thing like
“*Ü^ ‡Ü^ ‡èq*®x!£‚Ð^ DrvEnablePDEV*”, even after loading correct symbols.

I am pointing out all these because I am absolutely clue less here :(.

/sarbojit

On Wed, Aug 25, 2010 at 1:24 AM, Maxim S. Shatskih
wrote:

> >I saw below is the assembly code
> >…
> >win32k!EngMapFile:
>
> Just single-step it down and look at what function fails.
>
> Yes, a major effort, even with intermediate breakpoints set using something
> like a “binary search” method.
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTDEV is sponsored by OSR
>
> 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
>

Sarbojit Sarkar wrote:

Thanks for responses, I will debug as per your instruction.
BTW, I am seeing
“*SXS: RtlQueryInformationActivationContext() - Caller passed invalid
address, not in any .dll (1EE259E0)*” message in between
DrvEnablePDEV() call. I am not sure whether it is related this issue
or not.

That’s a user-mode address. It shouldn’t take very much thinking to
figure out whether it is related.

One more strange thing I have observed in my debugger.
I am getting some extra messages in between my debug print, some thing
like “*Ü^ ‡Ü^ ‡èq*®x!£‚Ð^ DrvEnablePDEV*”, even after loading correct
symbols.

Well, show us your EngDebugPrint calls. Maybe you’re doing it wrong.


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