FilterConnectCommunicationPort return 0x80070005

I have a call to FilterConnectCommunicationPort that usually works, but sometimes I get the error result 0x80070005.

I executed “fltmc” command and found my minifilter driver was loaded, but “fltmc” command couldn’t stop until i press “Ctrl+C”
(
“fltmc” command repeatedly output same info:
“Filter Name Num Instances Frame”
"MyMinifilter 3 0 "
)
Can someone help me?
Thanks in advance. devia

Hi Devia,

I have a call to FilterConnectCommunicationPort that usually works, but sometimes I get the error result 0x80070005.

The status code is Access denied.

I executed “fltmc” command and found my minifilter driver was loaded, but “fltmc” command couldn’t stop until i press “Ctrl+C”
(
“fltmc” command repeatedly output same info:
“Filter Name Num Instances Frame”
"MyMinifilter 3 0 "
)
Can someone help me?

Which Operating system is it?
Is it failing on the same OS on which it is usually working? Or is it failing on a particular OS only?
If my guess is right, this must be failing on Vista. This would be happening because your application would not be running with sufficient priviliges.

Regards,
Ayush Gupta

> I have a call to FilterConnectCommunicationPort that usually works,

but sometimes I get the error result 0x80070005.

0x80070005 is error code for “Access Denied”.
Could you define “sometimes” more exactly ?

L.

I installed “minispy” minfilter driver that in WDK 6000 package
(C:\WinDDK\6000\src\filesys\miniFilter\minispy),
unfortunately problem recured!

Hi Devia,

I installed “minispy” minfilter driver that in WDK 6000 package
(C:\WinDDK\6000\src\filesys\miniFilter\minispy),
unfortunately problem recured!

If you have installed it on Vista, just do a small thing…
Choose “Run as administrator” while running minispy.exe.
Or if you are running it from command line, start cmd.exe by choosing “Run as administrator”.
This should do the work.

Regards,
Ayush Gupta

Thank you, Ayush Gupta! My minifilter driver is running on Windows XP SP2.

Hi Devia,

Thank you, Ayush Gupta! My minifilter driver is running on Windows XP SP2.

Is this problem coming on Windows XP SP2? Or do you mean that it is running on Windows XP but not on Vista? I am little confused. :slight_smile:

Regards,
Ayush Gupta

When I had this error and fltmc hung as you described, it was due to me not
releasing all my resouces in the driver. It will not unload correctly if you
have a
ref count error (as in my case).

Thus, this failure occurred when trying to restart it. I couldn’t connect
back as
you describe.

That is, if my memory serves me correctly.

Good Luck,

Matt
----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Monday, January 14, 2008 1:05 AM
Subject: [ntfsd] FilterConnectCommunicationPort return 0x80070005

>I have a call to FilterConnectCommunicationPort that usually works, but
>sometimes I get the error result 0x80070005.
>
> I executed “fltmc” command and found my minifilter driver was loaded, but
> “fltmc” command couldn’t stop until i press “Ctrl+C”
> (
> “fltmc” command repeatedly output same info:
> “Filter Name Num Instances Frame”
> "MyMinifilter 3 0 "
> )
> Can someone help me?
> Thanks in advance. devia
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: matt-martin@tx.rr.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Hi Ayush Gupta,
〉Is this problem coming on Windows XP SP2? Or do you mean that it is running on Windows XP but not 〉on Vista? I am little confused. :slight_smile:

I’m sorry! My mean is “I test my driver only on Windows XP SP2”

Hi Devia,

Hmm… Ok… give some more details.

  1. Have you modified the sample to add some of your own functionality?
  2. Do you unload the driver using fltmc.exe? Does your driver unloads properly?
  3. Does this happen in the same load session or happens when you re-load after unloading?
  4. you mentioned that fltmc.exe hangs and you need to press ctrl+c. What command do you issue? Just Fltmc or fltmc unload minispy or something else?

Regards,
Ayush Gupta

Hi Ayush Gupta,
Thank you for your reply!

  1. I compile “minispy” sample driver in WDK 6000 directory.
    (Note: I modify nothing)
  2. Install minispy driver on Windows XP SP2 and restart OS.
  3. Execute “fltmc /load minispy” command in “cmd.exe”
    then “fltmc” process hangs.

Does the driver get loaded, does DriverEntry get called ? BTW the syntax is
fltmc load .

/Daniel

wrote in message news:xxxxx@ntfsd…
> Hi Ayush Gupta,
> Thank you for your reply!
> 1. I compile “minispy” sample driver in WDK 6000 directory.
> (Note: I modify nothing)
> 2. Install minispy driver on Windows XP SP2 and restart OS.
> 3. Execute “fltmc /load minispy” command in “cmd.exe”
> then “fltmc” process hangs.
>
>

If you have changed anything, and you built it for the correct platform you
shouldn’t have any problems (other than what Daniel pointed out).

Run “SFC /SCANNOW” and try again… Sounds like maybe your system
is damaged???

You are logged on as an Admin right?

Matt

----- Original Message -----
From:
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, January 14, 2008 4:09 AM
Subject: Re:[ntfsd] FilterConnectCommunicationPort return 0x80070005

> Does the driver get loaded, does DriverEntry get called ? BTW the syntax
> is fltmc load .
>
> /Daniel
>
>
> wrote in message news:xxxxx@ntfsd…
>> Hi Ayush Gupta,
>> Thank you for your reply!
>> 1. I compile “minispy” sample driver in WDK 6000 directory.
>> (Note: I modify nothing)
>> 2. Install minispy driver on Windows XP SP2 and restart OS.
>> 3. Execute “fltmc /load minispy” command in “cmd.exe”
>> then “fltmc” process hangs.
>>
>>
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: matt-martin@tx.rr.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Thanks m, Daniel Terhell and Ayush Gupta! I found some updates in Microsoft web site, when i installed package KB922582, the “minispy” sample driver works well.

http://support.microsoft.com/kb/922582

This works for me:

HRESULT
__cdecl
xxxEnableDriverLoad()
{
HANDLE Token;
HRESULT hResult = S_OK;
HANDLE procHandle = GetCurrentProcess();
BOOL result = OpenProcessToken(procHandle,
TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES,
&Token);

if (result)
{
PRIVILEGE_SET privilegeSet;
privilegeSet.PrivilegeCount = 1;
privilegeSet.Control = PRIVILEGE_SET_ALL_NECESSARY;

result = LookupPrivilegeValue(NULL, SE_LOAD_DRIVER_NAME,
&privilegeSet.Privilege[0].Luid);
if (result)
{
TOKEN_PRIVILEGES tokenPrivileges;
tokenPrivileges.PrivilegeCount = 1;
tokenPrivileges.Privileges[0].Luid = privilegeSet.Privilege[0].Luid;
tokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

result = AdjustTokenPrivileges(Token, FALSE,
&tokenPrivileges, 0, NULL, NULL);
if (result)
{
BOOL callReturn = PrivilegeCheck(Token, &privilegeSet, &result);
if (!callReturn)
{
result = FALSE;
}
if (!result)
{
SetLastError(ERROR_PRIVILEGE_NOT_HELD);
}
}
}
CloseHandle(Token);
}
if (!result)
{
hResult = HRESULT_FROM_WIN32(GetLastError());
}
return hResult;
}

On Jan 14, 2008 6:39 AM, wrote:
> Thanks m, Daniel Terhell and Ayush Gupta! I found some updates in Microsoft web site, when i installed package KB922582, the “minispy” sample driver works well.
>
> http://support.microsoft.com/kb/922582
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: xxxxx@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Mark Roddy