Discussion:
Debugging a Custom FD Provider
(too old to reply)
Yoke
2007-05-30 13:59:00 UTC
Permalink
How do you setup to debug a custom FD provider?

Mike
Ben McGregor
2007-06-20 22:17:56 UTC
Permalink
Hi Mike,

I'm unsure what level of detail you're looking for. Have you taken a look at
the SampleProvider that is provided in the SDK? Are you trying to run your
provider in-proc or out-of-proc? If you're running it in-proc you'd debug
it in the same process as your application using it. If it's out-of-proc
you'd need to debug the service that is hosting your provider.

You can grab the latest SDK from here.
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by Yoke
How do you setup to debug a custom FD provider?
Mike
Ben McGregor
2007-06-20 22:28:30 UTC
Permalink
Sorry, the hyperlink didn't get embedded.
http://www.microsoft.com/downloads/details.aspx?FamilyID=58726aca-8d84-4683-8959-be0038da7084&DisplayLang=en
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by Ben McGregor
Hi Mike,
I'm unsure what level of detail you're looking for. Have you taken a look
at the SampleProvider that is provided in the SDK? Are you trying to run
your provider in-proc or out-of-proc? If you're running it in-proc you'd
debug it in the same process as your application using it. If it's
out-of-proc you'd need to debug the service that is hosting your provider.
You can grab the latest SDK from here.
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by Yoke
How do you setup to debug a custom FD provider?
Mike
Yoke
2007-06-25 15:53:03 UTC
Permalink
I have been working with the FunctionDiscoveryProvider sample. Since most of
my development work has been in kernel-mode for the past several years, my
COM-based dev skills are a bit rusty. I have been successful by just
attaching the debugger to the FDProviderHostSample process after the Network
Explorer starts it up. I was just wondering if this was the right technique
to use or if there are other debug mechanisms built in for function discovery
providers.

Mike
Post by Ben McGregor
Hi Mike,
I'm unsure what level of detail you're looking for. Have you taken a look at
the SampleProvider that is provided in the SDK? Are you trying to run your
provider in-proc or out-of-proc? If you're running it in-proc you'd debug
it in the same process as your application using it. If it's out-of-proc
you'd need to debug the service that is hosting your provider.
You can grab the latest SDK from here.
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by Yoke
How do you setup to debug a custom FD provider?
Mike
Ben McGregor
2007-07-12 21:04:39 UTC
Permalink
Sorry for the delay in my response.

The mothod you are using is fine, but there is an easier way to debug your
provider. I'd write a small test application that can just load your
provider in-proc and query it. Do do this, simply instantiate function
discovery, create a query to your provider, then add the query constraint
that says to load your provider in-proc, and then finally execute your
query. It should look something like this

wprintf( L"CoCreate the Function Discovery object..." );
hr = CoCreateInstance(
__uuidof(FunctionDiscovery),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IFunctionDiscovery),
reinterpret_cast<void**>(&pFunDisc)
);
wprintf( L"0x%x\n", hr );

if ( S_OK == hr )
{
wprintf( L"Create an instance collection query..." );
hr = pFunDisc->CreateInstanceCollectionQuery(
L"<string representing your provider>",
NULL,
TRUE,
pFDCallback,
NULL,
&pFunInstsQuery
);
wprintf( L"0x%x\n", hr );
}

if ( S_OK == hr )
{
wprintf( L"Adding inproc constraint on the query..." );
hr = pFunInstsQuery->AddQueryConstraint(
FD_QUERYCONSTRAINT_COMCLSCONTEXT,
FD_CONSTRAINTVALUE_COMCLSCONTEXT_INPROC_SERVER
);
wprintf( L"0x%x\n", hr );
}

if ( S_OK == hr )
{
wprintf( L"Execute the query..." );
hr = pFunInstsQuery->Execute( &pFunInsts );
wprintf( L"0x%x\n", hr );
}
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by Yoke
I have been working with the FunctionDiscoveryProvider sample. Since most of
my development work has been in kernel-mode for the past several years, my
COM-based dev skills are a bit rusty. I have been successful by just
attaching the debugger to the FDProviderHostSample process after the Network
Explorer starts it up. I was just wondering if this was the right technique
to use or if there are other debug mechanisms built in for function discovery
providers.
Mike
Post by Ben McGregor
Hi Mike,
I'm unsure what level of detail you're looking for. Have you taken a look at
the SampleProvider that is provided in the SDK? Are you trying to run your
provider in-proc or out-of-proc? If you're running it in-proc you'd debug
it in the same process as your application using it. If it's out-of-proc
you'd need to debug the service that is hosting your provider.
You can grab the latest SDK from here.
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by Yoke
How do you setup to debug a custom FD provider?
Mike
Loading...